diff --git a/deploy/scripts/base/pool1/16_vaeth_deposit_token.ts b/deploy/scripts/base/pool1/16_vaeth_deposit_token.ts new file mode 100644 index 0000000..22cbe16 --- /dev/null +++ b/deploy/scripts/base/pool1/16_vaeth_deposit_token.ts @@ -0,0 +1,20 @@ +import {buildDepositTokenDeployFunction, UpgradableContracts} from '../../../helpers' +import Address from '../../../../helpers/address' +import {parseEther} from 'ethers/lib/utils' + +const {VAETH_ADDRESS} = Address + +const { + Pool1: {alias: Pool1}, +} = UpgradableContracts + +const func = buildDepositTokenDeployFunction({ + poolAlias: Pool1, + underlyingAddress: VAETH_ADDRESS, + underlyingSymbol: 'vaETH', + underlyingDecimals: 18, + collateralFactor: parseEther('0.8'), // 80% + maxTotalSupply: parseEther('150'), +}) + +export default func diff --git a/deploy/scripts/base/pool1/17_vausdc_deposit_token.ts b/deploy/scripts/base/pool1/17_vausdc_deposit_token.ts new file mode 100644 index 0000000..4dfe1d4 --- /dev/null +++ b/deploy/scripts/base/pool1/17_vausdc_deposit_token.ts @@ -0,0 +1,20 @@ +import {buildDepositTokenDeployFunction, UpgradableContracts} from '../../../helpers' +import Address from '../../../../helpers/address' +import {parseEther} from 'ethers/lib/utils' + +const {VAUSDC_ADDRESS} = Address + +const { + Pool1: {alias: Pool1}, +} = UpgradableContracts + +const func = buildDepositTokenDeployFunction({ + poolAlias: Pool1, + underlyingAddress: VAUSDC_ADDRESS, + underlyingSymbol: 'vaUSDC', + underlyingDecimals: 18, + collateralFactor: parseEther('0.82'), // 82% + maxTotalSupply: parseEther('500000'), +}) + +export default func diff --git a/deploy/scripts/base/pool1/18_vawsteth_deposit_token.ts b/deploy/scripts/base/pool1/18_vawsteth_deposit_token.ts new file mode 100644 index 0000000..4144249 --- /dev/null +++ b/deploy/scripts/base/pool1/18_vawsteth_deposit_token.ts @@ -0,0 +1,20 @@ +import {buildDepositTokenDeployFunction, UpgradableContracts} from '../../../helpers' +import Address from '../../../../helpers/address' +import {parseEther} from 'ethers/lib/utils' + +const {VAWSTETH_ADDRESS} = Address + +const { + Pool1: {alias: Pool1}, +} = UpgradableContracts + +const func = buildDepositTokenDeployFunction({ + poolAlias: Pool1, + underlyingAddress: VAWSTETH_ADDRESS, + underlyingSymbol: 'vaWSTETH', + underlyingDecimals: 18, + collateralFactor: parseEther('0.78'), // 78% + maxTotalSupply: parseEther('100'), +}) + +export default func diff --git a/deploy/scripts/base/pool1/19_vacbeth_deposit_token.ts b/deploy/scripts/base/pool1/19_vacbeth_deposit_token.ts new file mode 100644 index 0000000..b4a17c2 --- /dev/null +++ b/deploy/scripts/base/pool1/19_vacbeth_deposit_token.ts @@ -0,0 +1,20 @@ +import {buildDepositTokenDeployFunction, UpgradableContracts} from '../../../helpers' +import Address from '../../../../helpers/address' +import {parseEther} from 'ethers/lib/utils' + +const {VACBETH_ADDRESS} = Address + +const { + Pool1: {alias: Pool1}, +} = UpgradableContracts + +const func = buildDepositTokenDeployFunction({ + poolAlias: Pool1, + underlyingAddress: VACBETH_ADDRESS, + underlyingSymbol: 'vaCBETH', + underlyingDecimals: 18, + collateralFactor: parseEther('0.75'), // 75% + maxTotalSupply: parseEther('50'), +}) + +export default func diff --git a/deployments/base/CrossChainDispatcher.json b/deployments/base/CrossChainDispatcher.json index 849665f..4cc1038 100644 --- a/deployments/base/CrossChainDispatcher.json +++ b/deployments/base/CrossChainDispatcher.json @@ -439,6 +439,25 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "extraCallbackTxNativeFee", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "flashRepayCallbackTxGasLimit", @@ -1133,20 +1152,12 @@ "0xed6673F4bFaDD4D269BE68C7dbCC516218C0baD9", "0xc0c53b8b0000000000000000000000004372a2b9304296c06197a823f25cf03119d2fd820000000000000000000000004200000000000000000000000000000000000006000000000000000000000000224d8fd7ab6ad4c6eb4611ce56ef35dec2277f03" ], - "numDeployments": 1, + "numDeployments": 2, "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": [ - "0x4372A2b9304296c06197a823f25Cf03119d2Fd82", - "0x4200000000000000000000000000000000000006", - "0x224D8Fd7aB6AD4c6eb4611Ce56EF35Dec2277F03" - ] - }, - "implementation": "0x747b4932D6166C30eA34F425498272E65d99eA67", + "implementation": "0xD911e197f8e4797061817dDbf11a93d8D4573d97", "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", diff --git a/deployments/base/CrossChainDispatcher_Implementation.json b/deployments/base/CrossChainDispatcher_Implementation.json index ea35cf2..7d920cf 100644 --- a/deployments/base/CrossChainDispatcher_Implementation.json +++ b/deployments/base/CrossChainDispatcher_Implementation.json @@ -1,5 +1,5 @@ { - "address": "0x747b4932D6166C30eA34F425498272E65d99eA67", + "address": "0xD911e197f8e4797061817dDbf11a93d8D4573d97", "abi": [ { "inputs": [], @@ -321,6 +321,25 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "extraCallbackTxNativeFee", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "flashRepayCallbackTxGasLimit", @@ -939,28 +958,28 @@ "type": "receive" } ], - "transactionHash": "0x64cafcd679e7b4aae92315989ad357d390979679b11207792101da50234d8ca1", + "transactionHash": "0xfbdaa5809cbbb37f67388f336f07cc41a308e60b82cf95f7a55b0c147dac6ab6", "receipt": { "to": null, "from": "0xdf826ff6518e609E4cEE86299d40611C148099d5", - "contractAddress": "0x747b4932D6166C30eA34F425498272E65d99eA67", - "transactionIndex": 25, - "gasUsed": "4140954", + "contractAddress": "0xD911e197f8e4797061817dDbf11a93d8D4573d97", + "transactionIndex": 28, + "gasUsed": "4197496", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x129a5c28b4dfcb0af2c15a258ff516f68cc136e091177cde48b1298dad949f66", - "transactionHash": "0x64cafcd679e7b4aae92315989ad357d390979679b11207792101da50234d8ca1", + "blockHash": "0x4f1de68dc18eefa07561ebb4db72cb568521cb5817ba74430b32bc8777ae6cb6", + "transactionHash": "0xfbdaa5809cbbb37f67388f336f07cc41a308e60b82cf95f7a55b0c147dac6ab6", "logs": [], - "blockNumber": 14104374, - "cumulativeGasUsed": "6853460", + "blockNumber": 15058315, + "cumulativeGasUsed": "7509406", "status": 1, "byzantium": true }, "args": [], - "numDeployments": 1, - "solcInputHash": "05e4492217f7bda719dac100afeac118", - "metadata": "{\"compiler\":{\"version\":\"0.8.9+commit.e5eed63a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AddressIsNull\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BridgeTokenNotSupported\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BridgingIsPaused\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DestinationChainNotAllowed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidFromAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidMsgSender\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidOperationType\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidPayload\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSlippageParam\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NewValueIsSameAsCurrent\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SenderIsNotGovernor\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"newIsActive\",\"type\":\"bool\"}],\"name\":\"BridgingIsActiveUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"chainId\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldCrossChainDispatcher\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newCrossChainDispatcher\",\"type\":\"address\"}],\"name\":\"CrossChainDispatcherUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"chainId\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"newIsSupported\",\"type\":\"bool\"}],\"name\":\"DestinationChainIsSupportedUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"oldCallbackTxGasLimit\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"newCallbackTxGasLimit\",\"type\":\"uint64\"}],\"name\":\"FlashRepayCallbackTxGasLimitUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"oldSwapTxGasLimit\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"newSwapTxGasLimit\",\"type\":\"uint64\"}],\"name\":\"FlashRepaySwapTxGasLimitUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"oldCallbackTxGasLimit\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"newCallbackTxGasLimit\",\"type\":\"uint64\"}],\"name\":\"LeverageCallbackTxGasLimitUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"oldSwapTxGasLimit\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"newSwapTxGasLimit\",\"type\":\"uint64\"}],\"name\":\"LeverageSwapTxGasLimitUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldLzBaseGasLimit\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newLzBaseGasLimit\",\"type\":\"uint256\"}],\"name\":\"LzBaseGasLimitUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"contract IStargateComposer\",\"name\":\"oldStargateComposer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"contract IStargateComposer\",\"name\":\"newStargateComposer\",\"type\":\"address\"}],\"name\":\"StargateComposerUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldPoolId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newPoolId\",\"type\":\"uint256\"}],\"name\":\"StargatePoolIdUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldStargateSlippage\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newStargateSlippage\",\"type\":\"uint256\"}],\"name\":\"StargateSlippageUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"VERSION\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"name\":\"crossChainDispatcherOf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"flashRepayCallbackTxGasLimit\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"flashRepaySwapTxGasLimit\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IPoolRegistry\",\"name\":\"poolRegistry_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"weth_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"sgeth_\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isBridgingActive\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"name\":\"isDestinationChainSupported\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"leverageCallbackTxGasLimit\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"leverageSwapTxGasLimit\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lzBaseGasLimit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"srcChainId_\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"from_\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"amount_\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"payload_\",\"type\":\"bytes\"}],\"name\":\"onOFTReceived\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"poolRegistry\",\"outputs\":[{\"internalType\":\"contract IPoolRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"srcChainId_\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"srcAddress_\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"nonce_\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"token_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount_\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"payload_\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"newAmountOutMin_\",\"type\":\"uint256\"}],\"name\":\"retrySwapAndTriggerFlashRepayCallback\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"srcChainId_\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"srcAddress_\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"nonce_\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"amount_\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"payload_\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"newAmountOutMin_\",\"type\":\"uint256\"}],\"name\":\"retrySwapAndTriggerLeverageCallback\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"srcChainId_\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"srcAddress_\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"token_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountLD_\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"payload_\",\"type\":\"bytes\"}],\"name\":\"sgReceive\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sgeth\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"stargateComposer\",\"outputs\":[{\"internalType\":\"contract IStargateComposer\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"stargatePoolIdOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"stargateSlippage\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"swapAmountOutMin\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"toggleBridgingIsActive\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"chainId_\",\"type\":\"uint16\"}],\"name\":\"toggleDestinationChainIsActive\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId_\",\"type\":\"uint256\"},{\"internalType\":\"address payable\",\"name\":\"account_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenIn_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenOut_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountIn_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMin_\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"lzArgs_\",\"type\":\"bytes\"}],\"name\":\"triggerFlashRepaySwap\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId_\",\"type\":\"uint256\"},{\"internalType\":\"address payable\",\"name\":\"account_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenIn_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenOut_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountIn_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMin_\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"lzArgs_\",\"type\":\"bytes\"}],\"name\":\"triggerLeverageSwap\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"chainId_\",\"type\":\"uint16\"},{\"internalType\":\"address\",\"name\":\"crossChainDispatcher_\",\"type\":\"address\"}],\"name\":\"updateCrossChainDispatcherOf\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"newFlashRepayCallbackTxGasLimit_\",\"type\":\"uint64\"}],\"name\":\"updateFlashRepayCallbackTxGasLimit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"newFlashRepaySwapTxGasLimit_\",\"type\":\"uint64\"}],\"name\":\"updateFlashRepaySwapTxGasLimit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"newLeverageCallbackTxGasLimit_\",\"type\":\"uint64\"}],\"name\":\"updateLeverageCallbackTxGasLimit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"newLeverageSwapTxGasLimit_\",\"type\":\"uint64\"}],\"name\":\"updateLeverageSwapTxGasLimit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newLzBaseGasLimit_\",\"type\":\"uint256\"}],\"name\":\"updateLzBaseGasLimit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IStargateComposer\",\"name\":\"newStargateComposer_\",\"type\":\"address\"}],\"name\":\"updateStargateComposer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"newPoolId_\",\"type\":\"uint256\"}],\"name\":\"updateStargatePoolIdOf\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newStargateSlippage_\",\"type\":\"uint256\"}],\"name\":\"updateStargateSlippage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"weth\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"onOFTReceived(uint16,bytes,uint64,bytes,uint256,bytes)\":{\"details\":\"Token received are swapped to another token\",\"params\":{\"amount_\":\"The amount of tokens to transfer.\",\"from_\":\"The address of the account who calls the sendAndCall() on the source chain.\",\"payload_\":\"Additional data with no specified format.\",\"srcChainId_\":\"The chain id of the source chain.\"}},\"retrySwapAndTriggerFlashRepayCallback(uint16,bytes,uint64,address,uint256,bytes,uint256)\":{\"params\":{\"amount_\":\"The amountIn of failed tx\",\"newAmountOutMin_\":\"If swap failed due to slippage, caller may set lower newAmountOutMin_\",\"nonce_\":\"The nonce of failed tx\",\"payload_\":\"The payload of failed tx\",\"srcAddress_\":\"The source path of failed tx\",\"srcChainId_\":\"The source chain of failed tx\",\"token_\":\"The token of failed tx\"}},\"retrySwapAndTriggerLeverageCallback(uint16,bytes,uint64,uint256,bytes,uint256)\":{\"params\":{\"amount_\":\"The amountIn of failed tx\",\"newAmountOutMin_\":\"If swap failed due to slippage, caller may set lower newAmountOutMin_\",\"nonce_\":\"The nonce of failed tx\",\"payload_\":\"The payload of failed tx\",\"srcAddress_\":\"The source path of failed tx\",\"srcChainId_\":\"The source chain of failed tx\"}},\"sgReceive(uint16,bytes,uint256,address,uint256,bytes)\":{\"params\":{\"amountLD_\":\"The qty of local _token contract tokens\",\"payload_\":\"The payload\",\"srcAddress_\":\"The remote Bridge address\",\"srcChainId_\":\"The chain id of the source chain.\",\"token_\":\"The token contract on the local chain\"}},\"toggleDestinationChainIsActive(uint16)\":{\"details\":\"Use LZ chain id\"},\"updateStargatePoolIdOf(address,uint256)\":{\"details\":\"Use LZ ids (https://stargateprotocol.gitbook.io/stargate/developers/pool-ids)\"}},\"stateVariables\":{\"LZ_ADAPTER_PARAMS_VERSION\":{\"details\":\"LayerZero adapter param version See more: https://layerzero.gitbook.io/docs/evm-guides/advanced/relayer-adapter-parameters\"}},\"title\":\"Cross-chain dispatcher\",\"version\":1},\"userdoc\":{\"events\":{\"BridgingIsActiveUpdated(bool)\":{\"notice\":\"Emitted when flag for pause bridge transfer is toggled\"},\"CrossChainDispatcherUpdated(uint16,address,address)\":{\"notice\":\"Emitted when a Cross-chain dispatcher mapping is updated\"},\"DestinationChainIsSupportedUpdated(uint16,bool)\":{\"notice\":\"Emitted when flag for support chain is toggled\"},\"FlashRepayCallbackTxGasLimitUpdated(uint64,uint64)\":{\"notice\":\"Emitted when flash repay callback gas limit is updated\"},\"FlashRepaySwapTxGasLimitUpdated(uint64,uint64)\":{\"notice\":\"Emitted when underlying->synth L1 swap gas limit is updated\"},\"LeverageCallbackTxGasLimitUpdated(uint64,uint64)\":{\"notice\":\"Emitted when leverage callback gas limit is updated\"},\"LeverageSwapTxGasLimitUpdated(uint64,uint64)\":{\"notice\":\"Emitted when synth->underlying L1 swap gas limit is updated\"},\"LzBaseGasLimitUpdated(uint256,uint256)\":{\"notice\":\"Emitted when Lz base gas limit updated\"},\"StargateComposerUpdated(address,address)\":{\"notice\":\"Emitted when Stargate composer is updated\"},\"StargatePoolIdUpdated(address,uint256,uint256)\":{\"notice\":\"Emitted when Stargate pool id is updated\"},\"StargateSlippageUpdated(uint256,uint256)\":{\"notice\":\"Emitted when Stargate slippage is updated\"}},\"kind\":\"user\",\"methods\":{\"crossChainDispatcherOf(uint16)\":{\"notice\":\"Maps other chains `CrossChainDispatcher` contracts\"},\"flashRepayCallbackTxGasLimit()\":{\"notice\":\"The gas limit to cover `_crossChainFlashRepayCallback()` call\"},\"flashRepaySwapTxGasLimit()\":{\"notice\":\"The gas limit to cover `_swapAndTriggerFlashRepayCallback()` call\"},\"isBridgingActive()\":{\"notice\":\"Flag that pause/unpause all cross-chain activities\"},\"isDestinationChainSupported(uint16)\":{\"notice\":\"Maps supported cross-chain routes (i.e. which chains are allowed to be used as source of liquidity)\"},\"leverageCallbackTxGasLimit()\":{\"notice\":\"The gas limit to cover `_crossChainLeverageCallback()` call\"},\"leverageSwapTxGasLimit()\":{\"notice\":\"The gas limit to cover `_swapAndTriggerLeverageCallback()` call\"},\"lzBaseGasLimit()\":{\"notice\":\"The base gas to pay for cross-chain calls\"},\"onOFTReceived(uint16,bytes,uint64,bytes,uint256,bytes)\":{\"notice\":\"Called by the OFT contract when tokens are received from source chain.\"},\"poolRegistry()\":{\"notice\":\"The pool registry contract\"},\"retrySwapAndTriggerFlashRepayCallback(uint16,bytes,uint64,address,uint256,bytes,uint256)\":{\"notice\":\"Retry swap underlying and trigger callback.\"},\"retrySwapAndTriggerLeverageCallback(uint16,bytes,uint64,uint256,bytes,uint256)\":{\"notice\":\"Retry swap and trigger callback.\"},\"sgReceive(uint16,bytes,uint256,address,uint256,bytes)\":{\"notice\":\"Receive token and payload from Stargate\"},\"sgeth()\":{\"notice\":\"SGETH contract\"},\"stargateComposer()\":{\"notice\":\"The Stargate Router contract\"},\"stargatePoolIdOf(address)\":{\"notice\":\"Maps Stargate's token pools\"},\"stargateSlippage()\":{\"notice\":\"The slippage we're willing to accept for SG like:like transfers\"},\"swapAmountOutMin(uint256)\":{\"notice\":\"Overwritten swap slippage params\"},\"toggleBridgingIsActive()\":{\"notice\":\"Pause/Unpause bridge transfers\"},\"toggleDestinationChainIsActive(uint16)\":{\"notice\":\"Allow/Disallow destination chain\"},\"updateCrossChainDispatcherOf(uint16,address)\":{\"notice\":\"Update Cross-chain dispatcher mapping\"},\"updateFlashRepayCallbackTxGasLimit(uint64)\":{\"notice\":\"Update flash repay callback tx gas limit\"},\"updateFlashRepaySwapTxGasLimit(uint64)\":{\"notice\":\"Update flash repay swap tx gas limit\"},\"updateLeverageCallbackTxGasLimit(uint64)\":{\"notice\":\"Update leverage callback tx gas limit\"},\"updateLeverageSwapTxGasLimit(uint64)\":{\"notice\":\"Update leverage swap tx gas limit\"},\"updateLzBaseGasLimit(uint256)\":{\"notice\":\"Update Lz base gas limit\"},\"updateStargateComposer(address)\":{\"notice\":\"Update StargateComposer\"},\"updateStargatePoolIdOf(address,uint256)\":{\"notice\":\"Update Stargate pool id of token.\"},\"updateStargateSlippage(uint256)\":{\"notice\":\"Update Stargate slippage\"},\"weth()\":{\"notice\":\"WETH contract\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/CrossChainDispatcher.sol\":\"CrossChainDispatcher\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/CrossChainDispatcher.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./utils/ReentrancyGuard.sol\\\";\\nimport \\\"./dependencies/@layerzerolabs/solidity-examples/util/BytesLib.sol\\\";\\nimport \\\"./dependencies/openzeppelin/token/ERC20/utils/SafeERC20.sol\\\";\\nimport \\\"./interfaces/external/IStargateComposerWithRetry.sol\\\";\\nimport \\\"./interfaces/external/IWETH.sol\\\";\\nimport \\\"./interfaces/external/IStargatePool.sol\\\";\\nimport \\\"./interfaces/external/IStargateFactory.sol\\\";\\nimport \\\"./storage/CrossChainDispatcherStorage.sol\\\";\\nimport \\\"./interfaces/IProxyOFT.sol\\\";\\nimport \\\"./interfaces/ISmartFarmingManager.sol\\\";\\nimport \\\"./interfaces/ISyntheticToken.sol\\\";\\nimport \\\"./interfaces/external/ISwapper.sol\\\";\\nimport \\\"./lib/CrossChainLib.sol\\\";\\n\\nerror AddressIsNull();\\nerror InvalidMsgSender();\\nerror BridgingIsPaused();\\nerror InvalidFromAddress();\\nerror InvalidToAddress();\\nerror NewValueIsSameAsCurrent();\\nerror SenderIsNotGovernor();\\nerror DestinationChainNotAllowed();\\nerror InvalidOperationType();\\nerror BridgeTokenNotSupported();\\nerror InvalidSlippageParam();\\nerror InvalidPayload();\\n\\n/**\\n * @title Cross-chain dispatcher\\n */\\ncontract CrossChainDispatcher is ReentrancyGuard, CrossChainDispatcherStorageV1 {\\n using SafeERC20 for IERC20;\\n using BytesLib for bytes;\\n\\n string public constant VERSION = \\\"1.3.0\\\";\\n\\n /**\\n * @dev LayerZero adapter param version\\n * See more: https://layerzero.gitbook.io/docs/evm-guides/advanced/relayer-adapter-parameters\\n */\\n uint16 private constant LZ_ADAPTER_PARAMS_VERSION = 2;\\n\\n uint256 private constant MAX_BPS = 100_00;\\n\\n struct LayerZeroParams {\\n address tokenIn;\\n uint16 dstChainId;\\n uint256 amountIn;\\n uint256 nativeFee;\\n bytes payload;\\n address refundAddress;\\n uint64 dstGasForCall;\\n uint256 dstNativeAmount;\\n }\\n\\n /// @notice Emitted when Lz base gas limit updated\\n event LzBaseGasLimitUpdated(uint256 oldLzBaseGasLimit, uint256 newLzBaseGasLimit);\\n\\n /// @notice Emitted when Stargate composer is updated\\n event StargateComposerUpdated(IStargateComposer oldStargateComposer, IStargateComposer newStargateComposer);\\n\\n /// @notice Emitted when Stargate pool id is updated\\n event StargatePoolIdUpdated(address indexed token, uint256 oldPoolId, uint256 newPoolId);\\n\\n /// @notice Emitted when Stargate slippage is updated\\n event StargateSlippageUpdated(uint256 oldStargateSlippage, uint256 newStargateSlippage);\\n\\n /// @notice Emitted when synth->underlying L1 swap gas limit is updated\\n event LeverageSwapTxGasLimitUpdated(uint64 oldSwapTxGasLimit, uint64 newSwapTxGasLimit);\\n\\n /// @notice Emitted when leverage callback gas limit is updated\\n event LeverageCallbackTxGasLimitUpdated(uint64 oldCallbackTxGasLimit, uint64 newCallbackTxGasLimit);\\n\\n /// @notice Emitted when underlying->synth L1 swap gas limit is updated\\n event FlashRepaySwapTxGasLimitUpdated(uint64 oldSwapTxGasLimit, uint64 newSwapTxGasLimit);\\n\\n /// @notice Emitted when flash repay callback gas limit is updated\\n event FlashRepayCallbackTxGasLimitUpdated(uint64 oldCallbackTxGasLimit, uint64 newCallbackTxGasLimit);\\n\\n /// @notice Emitted when flag for pause bridge transfer is toggled\\n event BridgingIsActiveUpdated(bool newIsActive);\\n\\n /// @notice Emitted when a Cross-chain dispatcher mapping is updated\\n event CrossChainDispatcherUpdated(uint16 chainId, address oldCrossChainDispatcher, address newCrossChainDispatcher);\\n\\n /// @notice Emitted when flag for support chain is toggled\\n event DestinationChainIsSupportedUpdated(uint16 chainId, bool newIsSupported);\\n\\n modifier onlyGovernor() {\\n if (msg.sender != poolRegistry.governor()) revert SenderIsNotGovernor();\\n _;\\n }\\n\\n modifier onlyIfBridgingIsNotPaused() {\\n if (!isBridgingActive) revert BridgingIsPaused();\\n _;\\n }\\n\\n modifier onlyIfSmartFarmingManager() {\\n IPool _pool = IManageable(msg.sender).pool();\\n if (!poolRegistry.isPoolRegistered(address(_pool))) revert InvalidMsgSender();\\n if (msg.sender != address(_pool.smartFarmingManager())) revert InvalidMsgSender();\\n _;\\n }\\n\\n modifier onlyIfStargateComposer() {\\n if (msg.sender != address(stargateComposer)) revert InvalidMsgSender();\\n _;\\n }\\n\\n modifier onlyIfProxyOFT() {\\n if (!_isValidProxyOFT(msg.sender)) revert InvalidMsgSender();\\n _;\\n }\\n\\n constructor() {\\n _disableInitializers();\\n }\\n\\n receive() external payable {}\\n\\n function initialize(IPoolRegistry poolRegistry_, address weth_, address sgeth_) external initializer {\\n if (address(poolRegistry_) == address(0)) revert AddressIsNull();\\n\\n __ReentrancyGuard_init();\\n\\n poolRegistry = poolRegistry_;\\n stargateSlippage = 50; // 0.5%\\n lzBaseGasLimit = 200_000;\\n flashRepayCallbackTxGasLimit = 750_000;\\n flashRepaySwapTxGasLimit = 500_000;\\n leverageCallbackTxGasLimit = 750_000;\\n leverageSwapTxGasLimit = 750_000;\\n weth = weth_;\\n sgeth = sgeth_;\\n }\\n\\n /**\\n * @notice Called by the OFT contract when tokens are received from source chain.\\n * @dev Token received are swapped to another token\\n * @param srcChainId_ The chain id of the source chain.\\n * @param from_ The address of the account who calls the sendAndCall() on the source chain.\\n * @param amount_ The amount of tokens to transfer.\\n * @param payload_ Additional data with no specified format.\\n */\\n function onOFTReceived(\\n uint16 srcChainId_,\\n bytes calldata /*srcAddress_*/,\\n uint64 /*nonce_*/,\\n bytes calldata from_,\\n uint amount_,\\n bytes calldata payload_\\n ) external override onlyIfProxyOFT {\\n address _from = from_.toAddress(0);\\n if (_from == address(0) || _from != crossChainDispatcherOf[srcChainId_]) revert InvalidFromAddress();\\n\\n uint8 _op = CrossChainLib.getOperationType(payload_);\\n\\n if (_op == CrossChainLib.FLASH_REPAY) {\\n _crossChainFlashRepayCallback(amount_, payload_);\\n } else if (_op == CrossChainLib.LEVERAGE) {\\n _swapAndTriggerLeverageCallback(srcChainId_, amount_, payload_);\\n } else {\\n revert InvalidOperationType();\\n }\\n }\\n\\n /**\\n * @dev Finalize cross-chain flash repay process. The callback may fail due to slippage.\\n */\\n function _crossChainFlashRepayCallback(uint amount_, bytes calldata payload_) private {\\n (address proxyOFT_, address _smartFarmingManager, uint256 _requestId) = CrossChainLib\\n .decodeFlashRepayCallbackPayload(payload_);\\n\\n IERC20 _syntheticToken = IERC20(IProxyOFT(proxyOFT_).token());\\n _syntheticToken.safeApprove(_smartFarmingManager, 0);\\n _syntheticToken.safeApprove(_smartFarmingManager, amount_);\\n ISmartFarmingManager(_smartFarmingManager).crossChainFlashRepayCallback(_requestId, amount_);\\n }\\n\\n /**\\n * @dev Swap synthetic token for underlying and trigger callback call\\n */\\n function _swapAndTriggerLeverageCallback(uint16 srcChainId_, uint amountIn_, bytes calldata payload_) private {\\n // 1. Swap\\n (\\n address _srcSmartFarmingManager,\\n address _dstProxyOFT,\\n uint256 _requestId,\\n uint256 _sgPoolId,\\n address _account,\\n uint256 _amountOutMin\\n ) = CrossChainLib.decodeLeverageSwapPayload(payload_);\\n\\n address _bridgeToken = IStargatePool(IStargateFactory(stargateComposer.factory()).getPool(_sgPoolId)).token();\\n\\n if (_bridgeToken == sgeth) _bridgeToken = weth;\\n\\n amountIn_ = _swap({\\n requestId_: _requestId,\\n tokenIn_: IProxyOFT(_dstProxyOFT).token(),\\n tokenOut_: _bridgeToken,\\n amountIn_: amountIn_,\\n amountOutMin_: _amountOutMin\\n });\\n\\n // 2. Transfer underlying to source chain\\n uint16 _srcChainId = srcChainId_;\\n\\n _sendUsingStargate(\\n LayerZeroParams({\\n tokenIn: _bridgeToken,\\n dstChainId: _srcChainId,\\n amountIn: amountIn_,\\n nativeFee: poolRegistry.quoter().quoteLeverageCallbackNativeFee(_srcChainId),\\n payload: CrossChainLib.encodeLeverageCallbackPayload(_srcSmartFarmingManager, _requestId),\\n refundAddress: _account,\\n dstGasForCall: leverageCallbackTxGasLimit,\\n dstNativeAmount: 0\\n })\\n );\\n }\\n\\n /**\\n * @notice Receive token and payload from Stargate\\n * @param srcChainId_ The chain id of the source chain.\\n * @param srcAddress_ The remote Bridge address\\n * @param token_ The token contract on the local chain\\n * @param amountLD_ The qty of local _token contract tokens\\n * @param payload_ The payload\\n */\\n function sgReceive(\\n uint16 srcChainId_,\\n bytes memory srcAddress_,\\n uint256 /*nonce_*/,\\n address token_,\\n uint256 amountLD_,\\n bytes memory payload_\\n ) external override onlyIfStargateComposer {\\n // Note: Stargate uses SGETH as `token_` when receiving native ETH\\n if (token_ == sgeth) {\\n IWETH(weth).deposit{value: amountLD_}();\\n token_ = weth;\\n }\\n\\n address _srcAddress = srcAddress_.toAddress(0);\\n\\n if (_srcAddress == address(0) || _srcAddress != crossChainDispatcherOf[srcChainId_])\\n revert InvalidFromAddress();\\n\\n uint8 _op = CrossChainLib.getOperationType(payload_);\\n\\n if (_op == CrossChainLib.LEVERAGE) {\\n _crossChainLeverageCallback(token_, amountLD_, payload_);\\n } else if (_op == CrossChainLib.FLASH_REPAY) {\\n _swapAndTriggerFlashRepayCallback(srcChainId_, token_, amountLD_, payload_);\\n } else {\\n revert InvalidOperationType();\\n }\\n }\\n\\n /**\\n * @dev Finalize cross-chain leverage process. The callback may fail due to slippage.\\n */\\n function _crossChainLeverageCallback(address bridgeToken_, uint256 amount_, bytes memory payload_) private {\\n (address _smartFarmingManager, uint256 _requestId) = CrossChainLib.decodeLeverageCallbackPayload(payload_);\\n IERC20(bridgeToken_).safeApprove(_smartFarmingManager, 0);\\n IERC20(bridgeToken_).safeApprove(_smartFarmingManager, amount_);\\n ISmartFarmingManager(_smartFarmingManager).crossChainLeverageCallback(_requestId, amount_);\\n }\\n\\n /**\\n * @dev Send synthetic token cross-chain\\n */\\n function _sendUsingLayerZero(LayerZeroParams memory params_) private {\\n address _to = crossChainDispatcherOf[params_.dstChainId];\\n if (_to == address(0)) revert AddressIsNull();\\n\\n bytes memory _adapterParams = abi.encodePacked(\\n LZ_ADAPTER_PARAMS_VERSION,\\n uint256(lzBaseGasLimit + params_.dstGasForCall),\\n params_.dstNativeAmount,\\n (params_.dstNativeAmount > 0) ? _to : address(0)\\n );\\n\\n ISyntheticToken(params_.tokenIn).proxyOFT().sendAndCall{value: params_.nativeFee}({\\n _from: address(this),\\n _dstChainId: params_.dstChainId,\\n _toAddress: abi.encodePacked(_to),\\n _amount: params_.amountIn,\\n _payload: params_.payload,\\n _dstGasForCall: params_.dstGasForCall,\\n _refundAddress: payable(params_.refundAddress),\\n _zroPaymentAddress: address(0),\\n _adapterParams: _adapterParams\\n });\\n }\\n\\n /**\\n * @dev Swap underlying for synthetic token and trigger callback call\\n */\\n function _swapAndTriggerFlashRepayCallback(\\n uint16 srcChainId_,\\n address token_,\\n uint256 amount_,\\n bytes memory payload_\\n ) private {\\n // 1. Swap\\n (\\n address _srcSmartFarmingManager,\\n address _dstProxyOFT,\\n uint256 _requestId,\\n address _account,\\n uint256 _amountOutMin\\n ) = CrossChainLib.decodeFlashRepaySwapPayload(payload_);\\n\\n address _syntheticToken = IProxyOFT(_dstProxyOFT).token();\\n amount_ = _swap({\\n requestId_: _requestId,\\n tokenIn_: token_,\\n tokenOut_: _syntheticToken,\\n amountIn_: amount_,\\n amountOutMin_: _amountOutMin\\n });\\n\\n // 2. Transfer synthetic token to source chain\\n uint16 _srcChainId = srcChainId_;\\n address _srcProxyOFT = IProxyOFT(_dstProxyOFT).getProxyOFTOf(_srcChainId);\\n\\n _sendUsingLayerZero(\\n LayerZeroParams({\\n tokenIn: _syntheticToken,\\n dstChainId: _srcChainId,\\n amountIn: amount_,\\n payload: CrossChainLib.encodeFlashRepayCallbackPayload(\\n _srcProxyOFT,\\n _srcSmartFarmingManager,\\n _requestId\\n ),\\n refundAddress: _account,\\n dstGasForCall: flashRepayCallbackTxGasLimit,\\n dstNativeAmount: 0,\\n nativeFee: poolRegistry.quoter().quoteFlashRepayCallbackNativeFee(_srcChainId)\\n })\\n );\\n }\\n\\n /**\\n * @notice Retry swap underlying and trigger callback.\\n * @param srcChainId_ The source chain of failed tx\\n * @param srcAddress_ The source path of failed tx\\n * @param nonce_ The nonce of failed tx\\n * @param token_ The token of failed tx\\n * @param amount_ The amountIn of failed tx\\n * @param payload_ The payload of failed tx\\n * @param newAmountOutMin_ If swap failed due to slippage, caller may set lower newAmountOutMin_\\n */\\n function retrySwapAndTriggerFlashRepayCallback(\\n uint16 srcChainId_,\\n bytes calldata srcAddress_,\\n uint64 nonce_,\\n address token_,\\n uint256 amount_,\\n bytes calldata payload_,\\n uint256 newAmountOutMin_\\n ) external payable nonReentrant {\\n IStargateComposerWithRetry _stargateComposer = IStargateComposerWithRetry(address(stargateComposer));\\n\\n bytes memory _sgReceiveCallData = abi.encodeWithSelector(\\n IStargateReceiver.sgReceive.selector,\\n srcChainId_,\\n abi.encodePacked(crossChainDispatcherOf[srcChainId_]),\\n nonce_,\\n token_,\\n amount_,\\n payload_\\n );\\n\\n (, , uint256 _requestId, address _account, ) = CrossChainLib.decodeFlashRepaySwapPayload(payload_);\\n\\n if (msg.sender == _account) {\\n // Note: If `swapAmountOutMin[_requestId]` is `0` (default value), swap function will use payload's slippage param\\n if (newAmountOutMin_ == 0) revert InvalidSlippageParam();\\n swapAmountOutMin[_requestId] = newAmountOutMin_;\\n }\\n\\n // Note: `clearCachedSwap()` has checks to ensure that the args are consistent\\n _stargateComposer.clearCachedSwap(srcChainId_, srcAddress_, nonce_, address(this), _sgReceiveCallData);\\n }\\n\\n /**\\n * @notice Retry swap and trigger callback.\\n * @param srcChainId_ The source chain of failed tx\\n * @param srcAddress_ The source path of failed tx\\n * @param nonce_ The nonce of failed tx\\n * @param amount_ The amountIn of failed tx\\n * @param payload_ The payload of failed tx\\n * @param newAmountOutMin_ If swap failed due to slippage, caller may set lower newAmountOutMin_\\n */\\n function retrySwapAndTriggerLeverageCallback(\\n uint16 srcChainId_,\\n bytes calldata srcAddress_,\\n uint64 nonce_,\\n uint256 amount_,\\n bytes calldata payload_,\\n uint256 newAmountOutMin_\\n ) external payable nonReentrant {\\n (, address _dstProxyOFT, uint256 _requestId, , address _account, ) = CrossChainLib.decodeLeverageSwapPayload(\\n payload_\\n );\\n\\n if (!_isValidProxyOFT(_dstProxyOFT)) revert InvalidPayload();\\n\\n if (msg.sender == _account) {\\n // Note: If `swapAmountOutMin[_requestId]` is `0` (default value), swap function will use payload's slippage param\\n if (newAmountOutMin_ == 0) revert InvalidSlippageParam();\\n swapAmountOutMin[_requestId] = newAmountOutMin_;\\n }\\n\\n // Note: `retryOFTReceived()` has checks to ensure that the args are consistent\\n bytes memory _from = abi.encodePacked(crossChainDispatcherOf[srcChainId_]);\\n IProxyOFT(_dstProxyOFT).retryOFTReceived(\\n srcChainId_,\\n srcAddress_,\\n nonce_,\\n _from,\\n address(this),\\n amount_,\\n payload_\\n );\\n }\\n\\n /***\\n * @notice Trigger swap using Stargate for flashRepay.\\n * @param requestId_ Request id.\\n * @param account_ User address and also refund address\\n * @param tokenIn_ tokenIn\\n * @param tokenOut_ tokenOut\\n * @param amountIn_ amountIn_\\n * @param amountOutMin_ amountOutMin_\\n * @param lzArgs_ LayerZero method argument\\n */\\n function triggerFlashRepaySwap(\\n uint256 requestId_,\\n address payable account_,\\n address tokenIn_,\\n address tokenOut_,\\n uint256 amountIn_,\\n uint256 amountOutMin_,\\n bytes calldata lzArgs_\\n ) external payable override nonReentrant onlyIfSmartFarmingManager onlyIfBridgingIsNotPaused {\\n address _account = account_; // stack too deep\\n\\n (uint16 _dstChainId, uint256 callbackTxNativeFee_, uint64 flashRepaySwapTxGasLimit_) = CrossChainLib\\n .decodeLzArgs(lzArgs_);\\n\\n bytes memory _payload;\\n {\\n address _dstProxyOFT = ISyntheticToken(tokenOut_).proxyOFT().getProxyOFTOf(_dstChainId);\\n\\n if (_dstProxyOFT == address(0)) revert AddressIsNull();\\n if (!isDestinationChainSupported[_dstChainId]) revert DestinationChainNotAllowed();\\n\\n uint256 _requestId = requestId_; // stack too deep\\n\\n _payload = CrossChainLib.encodeFlashRepaySwapPayload({\\n srcSmartFarmingManager_: msg.sender,\\n dstProxyOFT_: _dstProxyOFT,\\n requestId_: _requestId,\\n account_: _account,\\n amountOutMin_: amountOutMin_\\n });\\n }\\n\\n _sendUsingStargate(\\n LayerZeroParams({\\n tokenIn: tokenIn_,\\n dstChainId: _dstChainId,\\n amountIn: amountIn_,\\n nativeFee: msg.value,\\n payload: _payload,\\n refundAddress: _account,\\n dstGasForCall: flashRepaySwapTxGasLimit_,\\n dstNativeAmount: callbackTxNativeFee_\\n })\\n );\\n }\\n\\n /***\\n * @notice Send synthetic token and trigger swap at destination chain\\n * @dev Not checking if bridging is pause because `ProxyOFT._debitFrom()` does it\\n * @param requestId_ Request id.\\n * @param account_ User address and also refund address\\n * @param tokenOut_ tokenOut\\n * @param amountIn_ amountIn\\n * @param amountOutMin_ amountOutMin\\n * @param lzArgs_ LayerZero method argument\\n */\\n function triggerLeverageSwap(\\n uint256 requestId_,\\n address payable account_,\\n address tokenIn_,\\n address tokenOut_,\\n uint256 amountIn_,\\n uint256 amountOutMin_,\\n bytes calldata lzArgs_\\n ) external payable override nonReentrant onlyIfSmartFarmingManager {\\n address _account = account_; // stack too deep\\n\\n (uint16 _dstChainId, uint256 _callbackTxNativeFee, uint64 _leverageSwapTxGasLimit) = CrossChainLib.decodeLzArgs(\\n lzArgs_\\n );\\n\\n bytes memory _payload;\\n {\\n address _tokenOut = tokenOut_; // stack too deep\\n uint256 _requestId = requestId_; // stack too deep\\n uint256 _amountOutMin = amountOutMin_; // stack too deep\\n\\n address _dstProxyOFT = ISyntheticToken(tokenIn_).proxyOFT().getProxyOFTOf(_dstChainId);\\n uint256 _sgPoolId = stargatePoolIdOf[_tokenOut];\\n\\n if (_dstProxyOFT == address(0)) revert AddressIsNull();\\n if (!isDestinationChainSupported[_dstChainId]) revert DestinationChainNotAllowed();\\n if (_sgPoolId == 0) revert BridgeTokenNotSupported();\\n\\n _payload = CrossChainLib.encodeLeverageSwapPayload({\\n srcSmartFarmingManager_: msg.sender,\\n dstProxyOFT_: _dstProxyOFT,\\n requestId_: _requestId,\\n sgPoolId_: _sgPoolId,\\n account_: _account,\\n amountOutMin_: _amountOutMin\\n });\\n }\\n\\n _sendUsingLayerZero(\\n LayerZeroParams({\\n tokenIn: tokenIn_,\\n dstChainId: _dstChainId,\\n amountIn: amountIn_,\\n payload: _payload,\\n refundAddress: _account,\\n dstGasForCall: _leverageSwapTxGasLimit,\\n dstNativeAmount: _callbackTxNativeFee,\\n nativeFee: msg.value\\n })\\n );\\n }\\n\\n /**\\n * @dev Check wether an address is a proxyOFT or not\\n */\\n function _isValidProxyOFT(address proxyOFT_) private view returns (bool) {\\n ISyntheticToken _syntheticToken = ISyntheticToken(IProxyOFT(proxyOFT_).token());\\n if (!poolRegistry.doesSyntheticTokenExist(_syntheticToken)) return false;\\n if (proxyOFT_ != address(_syntheticToken.proxyOFT())) return false;\\n\\n return true;\\n }\\n\\n /**\\n * @dev Send underlying token cross-chain\\n */\\n function _sendUsingStargate(LayerZeroParams memory params_) private {\\n IStargateRouter.lzTxObj memory _lzTxParams;\\n bytes memory _to = abi.encodePacked(crossChainDispatcherOf[params_.dstChainId]);\\n {\\n if (_to.toAddress(0) == address(0)) revert AddressIsNull();\\n\\n _lzTxParams = IStargateRouter.lzTxObj({\\n dstGasForCall: params_.dstGasForCall,\\n dstNativeAmount: params_.dstNativeAmount,\\n dstNativeAddr: (params_.dstNativeAmount > 0) ? _to : abi.encode(0)\\n });\\n }\\n\\n uint256 _poolId = stargatePoolIdOf[params_.tokenIn];\\n if (_poolId == 0) revert BridgeTokenNotSupported();\\n uint256 _amountOutMin = (params_.amountIn * (MAX_BPS - stargateSlippage)) / MAX_BPS;\\n bytes memory _payload = params_.payload;\\n\\n IStargateComposer _stargateComposer = stargateComposer;\\n\\n // Note: StargateComposer only accepts native for ETH pool\\n if (params_.tokenIn == weth) {\\n IWETH(weth).withdraw(params_.amountIn);\\n params_.nativeFee += params_.amountIn;\\n } else {\\n IERC20(params_.tokenIn).safeApprove(address(_stargateComposer), 0);\\n IERC20(params_.tokenIn).safeApprove(address(_stargateComposer), params_.amountIn);\\n }\\n\\n _stargateComposer.swap{value: params_.nativeFee}({\\n _dstChainId: params_.dstChainId,\\n _srcPoolId: _poolId,\\n _dstPoolId: _poolId,\\n _refundAddress: payable(params_.refundAddress),\\n _amountLD: params_.amountIn,\\n _minAmountLD: _amountOutMin,\\n _lzTxParams: _lzTxParams,\\n _to: _to,\\n _payload: _payload\\n });\\n }\\n\\n /**\\n * @dev Perform a swap considering slippage param from user\\n */\\n function _swap(\\n uint256 requestId_,\\n address tokenIn_,\\n address tokenOut_,\\n uint256 amountIn_,\\n uint256 amountOutMin_\\n ) private returns (uint256 _amountOut) {\\n // 1. Use updated slippage if exist\\n uint256 _storedAmountOutMin = swapAmountOutMin[requestId_];\\n if (_storedAmountOutMin > 0) {\\n // Use stored slippage and clear it\\n amountOutMin_ = _storedAmountOutMin;\\n delete swapAmountOutMin[requestId_];\\n }\\n\\n // 2. Perform swap\\n ISwapper _swapper = poolRegistry.swapper();\\n IERC20(tokenIn_).safeApprove(address(_swapper), 0);\\n IERC20(tokenIn_).safeApprove(address(_swapper), amountIn_);\\n _amountOut = _swapper.swapExactInput({\\n tokenIn_: tokenIn_,\\n tokenOut_: tokenOut_,\\n amountIn_: amountIn_,\\n amountOutMin_: amountOutMin_,\\n receiver_: address(this)\\n });\\n }\\n\\n /**\\n * @notice Update flash repay callback tx gas limit\\n */\\n function updateFlashRepayCallbackTxGasLimit(uint64 newFlashRepayCallbackTxGasLimit_) external onlyGovernor {\\n uint64 _currentFlashRepayCallbackTxGasLimit = flashRepayCallbackTxGasLimit;\\n if (newFlashRepayCallbackTxGasLimit_ == _currentFlashRepayCallbackTxGasLimit) revert NewValueIsSameAsCurrent();\\n emit FlashRepayCallbackTxGasLimitUpdated(\\n _currentFlashRepayCallbackTxGasLimit,\\n newFlashRepayCallbackTxGasLimit_\\n );\\n flashRepayCallbackTxGasLimit = newFlashRepayCallbackTxGasLimit_;\\n }\\n\\n /**\\n * @notice Update flash repay swap tx gas limit\\n */\\n function updateFlashRepaySwapTxGasLimit(uint64 newFlashRepaySwapTxGasLimit_) external onlyGovernor {\\n uint64 _currentFlashRepaySwapTxGasLimit = flashRepaySwapTxGasLimit;\\n if (newFlashRepaySwapTxGasLimit_ == _currentFlashRepaySwapTxGasLimit) revert NewValueIsSameAsCurrent();\\n emit FlashRepaySwapTxGasLimitUpdated(_currentFlashRepaySwapTxGasLimit, newFlashRepaySwapTxGasLimit_);\\n flashRepaySwapTxGasLimit = newFlashRepaySwapTxGasLimit_;\\n }\\n\\n /**\\n * @notice Update leverage callback tx gas limit\\n */\\n function updateLeverageCallbackTxGasLimit(uint64 newLeverageCallbackTxGasLimit_) external onlyGovernor {\\n uint64 _currentLeverageCallbackTxGasLimit = leverageCallbackTxGasLimit;\\n if (newLeverageCallbackTxGasLimit_ == _currentLeverageCallbackTxGasLimit) revert NewValueIsSameAsCurrent();\\n emit LeverageCallbackTxGasLimitUpdated(_currentLeverageCallbackTxGasLimit, newLeverageCallbackTxGasLimit_);\\n leverageCallbackTxGasLimit = newLeverageCallbackTxGasLimit_;\\n }\\n\\n /**\\n * @notice Update leverage swap tx gas limit\\n */\\n function updateLeverageSwapTxGasLimit(uint64 newLeverageSwapTxGasLimit_) external onlyGovernor {\\n uint64 _currentSwapTxGasLimit = leverageSwapTxGasLimit;\\n if (newLeverageSwapTxGasLimit_ == _currentSwapTxGasLimit) revert NewValueIsSameAsCurrent();\\n emit LeverageSwapTxGasLimitUpdated(_currentSwapTxGasLimit, newLeverageSwapTxGasLimit_);\\n leverageSwapTxGasLimit = newLeverageSwapTxGasLimit_;\\n }\\n\\n /**\\n * @notice Update Lz base gas limit\\n */\\n function updateLzBaseGasLimit(uint256 newLzBaseGasLimit_) external onlyGovernor {\\n uint256 _currentBaseGasLimit = lzBaseGasLimit;\\n if (newLzBaseGasLimit_ == _currentBaseGasLimit) revert NewValueIsSameAsCurrent();\\n emit LzBaseGasLimitUpdated(_currentBaseGasLimit, newLzBaseGasLimit_);\\n lzBaseGasLimit = newLzBaseGasLimit_;\\n }\\n\\n /**\\n * @notice Update Stargate pool id of token.\\n * @dev Use LZ ids (https://stargateprotocol.gitbook.io/stargate/developers/pool-ids)\\n */\\n function updateStargatePoolIdOf(address token_, uint256 newPoolId_) external onlyGovernor {\\n uint256 _currentPoolId = stargatePoolIdOf[token_];\\n if (newPoolId_ == _currentPoolId) revert NewValueIsSameAsCurrent();\\n emit StargatePoolIdUpdated(token_, _currentPoolId, newPoolId_);\\n stargatePoolIdOf[token_] = newPoolId_;\\n }\\n\\n /**\\n * @notice Update Stargate slippage\\n */\\n function updateStargateSlippage(uint256 newStargateSlippage_) external onlyGovernor {\\n uint256 _currentStargateSlippage = stargateSlippage;\\n if (newStargateSlippage_ == _currentStargateSlippage) revert NewValueIsSameAsCurrent();\\n emit StargateSlippageUpdated(_currentStargateSlippage, newStargateSlippage_);\\n stargateSlippage = newStargateSlippage_;\\n }\\n\\n /**\\n * @notice Update StargateComposer\\n */\\n function updateStargateComposer(IStargateComposer newStargateComposer_) external onlyGovernor {\\n IStargateComposer _currentStargateComposer = stargateComposer;\\n if (newStargateComposer_ == _currentStargateComposer) revert NewValueIsSameAsCurrent();\\n emit StargateComposerUpdated(_currentStargateComposer, newStargateComposer_);\\n stargateComposer = newStargateComposer_;\\n }\\n\\n /**\\n * @notice Pause/Unpause bridge transfers\\n */\\n function toggleBridgingIsActive() external onlyGovernor {\\n bool _newIsBridgingActive = !isBridgingActive;\\n emit BridgingIsActiveUpdated(_newIsBridgingActive);\\n isBridgingActive = _newIsBridgingActive;\\n }\\n\\n /**\\n * @notice Update Cross-chain dispatcher mapping\\n */\\n function updateCrossChainDispatcherOf(uint16 chainId_, address crossChainDispatcher_) external onlyGovernor {\\n address _current = crossChainDispatcherOf[chainId_];\\n if (crossChainDispatcher_ == _current) revert NewValueIsSameAsCurrent();\\n emit CrossChainDispatcherUpdated(chainId_, _current, crossChainDispatcher_);\\n crossChainDispatcherOf[chainId_] = crossChainDispatcher_;\\n }\\n\\n /**\\n * @notice Allow/Disallow destination chain\\n * @dev Use LZ chain id\\n */\\n function toggleDestinationChainIsActive(uint16 chainId_) external onlyGovernor {\\n bool _isDestinationChainSupported = !isDestinationChainSupported[chainId_];\\n emit BridgingIsActiveUpdated(_isDestinationChainSupported);\\n isDestinationChainSupported[chainId_] = _isDestinationChainSupported;\\n }\\n}\\n\",\"keccak256\":\"0x1249f77bc564ae88d618357cb9db0ca6b715d9947dbe36a0f6277b81bae8ad8c\",\"license\":\"MIT\"},\"contracts/dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/IOFTCoreUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../../../../openzeppelin-upgradeable/utils/introspection/IERC165Upgradeable.sol\\\";\\n\\n/**\\n * @dev Interface of the IOFT core standard\\n */\\ninterface IOFTCoreUpgradeable is IERC165Upgradeable {\\n /**\\n * @dev estimate send token `_tokenId` to (`_dstChainId`, `_toAddress`)\\n * _dstChainId - L0 defined chain id to send tokens too\\n * _toAddress - dynamic bytes array which contains the address to whom you are sending tokens to on the dstChain\\n * _amount - amount of the tokens to transfer\\n * _useZro - indicates to use zro to pay L0 fees\\n * _adapterParam - flexible bytes array to indicate messaging adapter services in L0\\n */\\n function estimateSendFee(\\n uint16 _dstChainId,\\n bytes calldata _toAddress,\\n uint _amount,\\n bool _useZro,\\n bytes calldata _adapterParams\\n ) external view returns (uint nativeFee, uint zroFee);\\n\\n /**\\n * @dev send `_amount` amount of token to (`_dstChainId`, `_toAddress`) from `_from`\\n * `_from` the owner of token\\n * `_dstChainId` the destination chain identifier\\n * `_toAddress` can be any size depending on the `dstChainId`.\\n * `_amount` the quantity of tokens in wei\\n * `_refundAddress` the address LayerZero refunds if too much message fee is sent\\n * `_zroPaymentAddress` set to address(0x0) if not paying in ZRO (LayerZero Token)\\n * `_adapterParams` is a flexible bytes array to indicate messaging adapter services\\n */\\n function sendFrom(\\n address _from,\\n uint16 _dstChainId,\\n bytes calldata _toAddress,\\n uint _amount,\\n address payable _refundAddress,\\n address _zroPaymentAddress,\\n bytes calldata _adapterParams\\n ) external payable;\\n\\n /**\\n * @dev returns the circulating amount of tokens on current chain\\n */\\n function circulatingSupply() external view returns (uint);\\n\\n /**\\n * @dev returns the address of the ERC20 token\\n */\\n function token() external view returns (address);\\n\\n /**\\n * @dev Emitted when `_amount` tokens are moved from the `_sender` to (`_dstChainId`, `_toAddress`)\\n * `_nonce` is the outbound nonce\\n */\\n event SendToChain(uint16 indexed _dstChainId, address indexed _from, bytes _toAddress, uint _amount);\\n\\n /**\\n * @dev Emitted when `_amount` tokens are received from `_srcChainId` into the `_toAddress` on the local chain.\\n * `_nonce` is the inbound nonce.\\n */\\n event ReceiveFromChain(uint16 indexed _srcChainId, address indexed _to, uint _amount);\\n\\n event SetUseCustomAdapterParams(bool _useCustomAdapterParams);\\n}\\n\",\"keccak256\":\"0x22651924296f8308db8195d7a86a6781023241c53905418f2d3925e3f693f530\",\"license\":\"MIT\"},\"contracts/dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/composable/IComposableOFTCoreUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.5.0;\\n\\nimport \\\"../IOFTCoreUpgradeable.sol\\\";\\n\\n/**\\n * @dev Interface of the composable OFT core standard\\n */\\ninterface IComposableOFTCoreUpgradeable is IOFTCoreUpgradeable {\\n function estimateSendAndCallFee(\\n uint16 _dstChainId,\\n bytes calldata _toAddress,\\n uint _amount,\\n bytes calldata _payload,\\n uint64 _dstGasForCall,\\n bool _useZro,\\n bytes calldata _adapterParams\\n ) external view returns (uint nativeFee, uint zroFee);\\n\\n function sendAndCall(\\n address _from,\\n uint16 _dstChainId,\\n bytes calldata _toAddress,\\n uint _amount,\\n bytes calldata _payload,\\n uint64 _dstGasForCall,\\n address payable _refundAddress,\\n address _zroPaymentAddress,\\n bytes calldata _adapterParams\\n ) external payable;\\n\\n function retryOFTReceived(\\n uint16 _srcChainId,\\n bytes calldata _srcAddress,\\n uint64 _nonce,\\n bytes calldata _from,\\n address _to,\\n uint _amount,\\n bytes calldata _payload\\n ) external;\\n\\n event CallOFTReceivedFailure(\\n uint16 indexed _srcChainId,\\n bytes _srcAddress,\\n uint64 _nonce,\\n bytes _from,\\n address indexed _to,\\n uint _amount,\\n bytes _payload,\\n bytes _reason\\n );\\n\\n event CallOFTReceivedSuccess(uint16 indexed _srcChainId, bytes _srcAddress, uint64 _nonce, bytes32 _hash);\\n\\n event RetryOFTReceivedSuccess(bytes32 _messageHash);\\n\\n event NonContractAddress(address _address);\\n}\\n\",\"keccak256\":\"0x769b9356ad6019bdabdcfc11762f28d15eb9a4e262efc96835725f6862c5d9e9\",\"license\":\"MIT\"},\"contracts/dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/composable/IOFTReceiverUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.5.0;\\n\\ninterface IOFTReceiverUpgradeable {\\n /**\\n * @dev Called by the OFT contract when tokens are received from source chain.\\n * @param _srcChainId The chain id of the source chain.\\n * @param _srcAddress The address of the OFT token contract on the source chain.\\n * @param _nonce The nonce of the transaction on the source chain.\\n * @param _from The address of the account who calls the sendAndCall() on the source chain.\\n * @param _amount The amount of tokens to transfer.\\n * @param _payload Additional data with no specified format.\\n */\\n function onOFTReceived(\\n uint16 _srcChainId,\\n bytes calldata _srcAddress,\\n uint64 _nonce,\\n bytes calldata _from,\\n uint _amount,\\n bytes calldata _payload\\n ) external;\\n}\\n\",\"keccak256\":\"0x287036c704c57e34a6fc3f7e67c8dfaaade6eb3667b570576bc491c0f1f89a5b\",\"license\":\"MIT\"},\"contracts/dependencies/@layerzerolabs/solidity-examples/util/BytesLib.sol\":{\"content\":\"// SPDX-License-Identifier: Unlicense\\n/*\\n * @title Solidity Bytes Arrays Utils\\n * @author Gon\\u00e7alo S\\u00e1 \\n *\\n * @dev Bytes tightly packed arrays utility library for ethereum contracts written in Solidity.\\n * The library lets you concatenate, slice and type cast bytes arrays both in memory and storage.\\n */\\npragma solidity >=0.8.0 <0.9.0;\\n\\nlibrary BytesLib {\\n function concat(bytes memory _preBytes, bytes memory _postBytes) internal pure returns (bytes memory) {\\n bytes memory tempBytes;\\n\\n assembly {\\n // Get a location of some free memory and store it in tempBytes as\\n // Solidity does for memory variables.\\n tempBytes := mload(0x40)\\n\\n // Store the length of the first bytes array at the beginning of\\n // the memory for tempBytes.\\n let length := mload(_preBytes)\\n mstore(tempBytes, length)\\n\\n // Maintain a memory counter for the current write location in the\\n // temp bytes array by adding the 32 bytes for the array length to\\n // the starting location.\\n let mc := add(tempBytes, 0x20)\\n // Stop copying when the memory counter reaches the length of the\\n // first bytes array.\\n let end := add(mc, length)\\n\\n for {\\n // Initialize a copy counter to the start of the _preBytes data,\\n // 32 bytes into its memory.\\n let cc := add(_preBytes, 0x20)\\n } lt(mc, end) {\\n // Increase both counters by 32 bytes each iteration.\\n mc := add(mc, 0x20)\\n cc := add(cc, 0x20)\\n } {\\n // Write the _preBytes data into the tempBytes memory 32 bytes\\n // at a time.\\n mstore(mc, mload(cc))\\n }\\n\\n // Add the length of _postBytes to the current length of tempBytes\\n // and store it as the new length in the first 32 bytes of the\\n // tempBytes memory.\\n length := mload(_postBytes)\\n mstore(tempBytes, add(length, mload(tempBytes)))\\n\\n // Move the memory counter back from a multiple of 0x20 to the\\n // actual end of the _preBytes data.\\n mc := end\\n // Stop copying when the memory counter reaches the new combined\\n // length of the arrays.\\n end := add(mc, length)\\n\\n for {\\n let cc := add(_postBytes, 0x20)\\n } lt(mc, end) {\\n mc := add(mc, 0x20)\\n cc := add(cc, 0x20)\\n } {\\n mstore(mc, mload(cc))\\n }\\n\\n // Update the free-memory pointer by padding our last write location\\n // to 32 bytes: add 31 bytes to the end of tempBytes to move to the\\n // next 32 byte block, then round down to the nearest multiple of\\n // 32. If the sum of the length of the two arrays is zero then add\\n // one before rounding down to leave a blank 32 bytes (the length block with 0).\\n mstore(\\n 0x40,\\n and(\\n add(add(end, iszero(add(length, mload(_preBytes)))), 31),\\n not(31) // Round down to the nearest 32 bytes.\\n )\\n )\\n }\\n\\n return tempBytes;\\n }\\n\\n function concatStorage(bytes storage _preBytes, bytes memory _postBytes) internal {\\n assembly {\\n // Read the first 32 bytes of _preBytes storage, which is the length\\n // of the array. (We don't need to use the offset into the slot\\n // because arrays use the entire slot.)\\n let fslot := sload(_preBytes.slot)\\n // Arrays of 31 bytes or less have an even value in their slot,\\n // while longer arrays have an odd value. The actual length is\\n // the slot divided by two for odd values, and the lowest order\\n // byte divided by two for even values.\\n // If the slot is even, bitwise and the slot with 255 and divide by\\n // two to get the length. If the slot is odd, bitwise and the slot\\n // with -1 and divide by two.\\n let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2)\\n let mlength := mload(_postBytes)\\n let newlength := add(slength, mlength)\\n // slength can contain both the length and contents of the array\\n // if length < 32 bytes so let's prepare for that\\n // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage\\n switch add(lt(slength, 32), lt(newlength, 32))\\n case 2 {\\n // Since the new array still fits in the slot, we just need to\\n // update the contents of the slot.\\n // uint256(bytes_storage) = uint256(bytes_storage) + uint256(bytes_memory) + new_length\\n sstore(\\n _preBytes.slot,\\n // all the modifications to the slot are inside this\\n // next block\\n add(\\n // we can just add to the slot contents because the\\n // bytes we want to change are the LSBs\\n fslot,\\n add(\\n mul(\\n div(\\n // load the bytes from memory\\n mload(add(_postBytes, 0x20)),\\n // zero all bytes to the right\\n exp(0x100, sub(32, mlength))\\n ),\\n // and now shift left the number of bytes to\\n // leave space for the length in the slot\\n exp(0x100, sub(32, newlength))\\n ),\\n // increase length by the double of the memory\\n // bytes length\\n mul(mlength, 2)\\n )\\n )\\n )\\n }\\n case 1 {\\n // The stored value fits in the slot, but the combined value\\n // will exceed it.\\n // get the keccak hash to get the contents of the array\\n mstore(0x0, _preBytes.slot)\\n let sc := add(keccak256(0x0, 0x20), div(slength, 32))\\n\\n // save new length\\n sstore(_preBytes.slot, add(mul(newlength, 2), 1))\\n\\n // The contents of the _postBytes array start 32 bytes into\\n // the structure. Our first read should obtain the `submod`\\n // bytes that can fit into the unused space in the last word\\n // of the stored array. To get this, we read 32 bytes starting\\n // from `submod`, so the data we read overlaps with the array\\n // contents by `submod` bytes. Masking the lowest-order\\n // `submod` bytes allows us to add that value directly to the\\n // stored value.\\n\\n let submod := sub(32, slength)\\n let mc := add(_postBytes, submod)\\n let end := add(_postBytes, mlength)\\n let mask := sub(exp(0x100, submod), 1)\\n\\n sstore(\\n sc,\\n add(\\n and(fslot, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00),\\n and(mload(mc), mask)\\n )\\n )\\n\\n for {\\n mc := add(mc, 0x20)\\n sc := add(sc, 1)\\n } lt(mc, end) {\\n sc := add(sc, 1)\\n mc := add(mc, 0x20)\\n } {\\n sstore(sc, mload(mc))\\n }\\n\\n mask := exp(0x100, sub(mc, end))\\n\\n sstore(sc, mul(div(mload(mc), mask), mask))\\n }\\n default {\\n // get the keccak hash to get the contents of the array\\n mstore(0x0, _preBytes.slot)\\n // Start copying to the last used word of the stored array.\\n let sc := add(keccak256(0x0, 0x20), div(slength, 32))\\n\\n // save new length\\n sstore(_preBytes.slot, add(mul(newlength, 2), 1))\\n\\n // Copy over the first `submod` bytes of the new data as in\\n // case 1 above.\\n let slengthmod := mod(slength, 32)\\n let mlengthmod := mod(mlength, 32)\\n let submod := sub(32, slengthmod)\\n let mc := add(_postBytes, submod)\\n let end := add(_postBytes, mlength)\\n let mask := sub(exp(0x100, submod), 1)\\n\\n sstore(sc, add(sload(sc), and(mload(mc), mask)))\\n\\n for {\\n sc := add(sc, 1)\\n mc := add(mc, 0x20)\\n } lt(mc, end) {\\n sc := add(sc, 1)\\n mc := add(mc, 0x20)\\n } {\\n sstore(sc, mload(mc))\\n }\\n\\n mask := exp(0x100, sub(mc, end))\\n\\n sstore(sc, mul(div(mload(mc), mask), mask))\\n }\\n }\\n }\\n\\n function slice(bytes memory _bytes, uint256 _start, uint256 _length) internal pure returns (bytes memory) {\\n require(_length + 31 >= _length, \\\"slice_overflow\\\");\\n require(_bytes.length >= _start + _length, \\\"slice_outOfBounds\\\");\\n\\n bytes memory tempBytes;\\n\\n assembly {\\n switch iszero(_length)\\n case 0 {\\n // Get a location of some free memory and store it in tempBytes as\\n // Solidity does for memory variables.\\n tempBytes := mload(0x40)\\n\\n // The first word of the slice result is potentially a partial\\n // word read from the original array. To read it, we calculate\\n // the length of that partial word and start copying that many\\n // bytes into the array. The first word we copy will start with\\n // data we don't care about, but the last `lengthmod` bytes will\\n // land at the beginning of the contents of the new array. When\\n // we're done copying, we overwrite the full first word with\\n // the actual length of the slice.\\n let lengthmod := and(_length, 31)\\n\\n // The multiplication in the next line is necessary\\n // because when slicing multiples of 32 bytes (lengthmod == 0)\\n // the following copy loop was copying the origin's length\\n // and then ending prematurely not copying everything it should.\\n let mc := add(add(tempBytes, lengthmod), mul(0x20, iszero(lengthmod)))\\n let end := add(mc, _length)\\n\\n for {\\n // The multiplication in the next line has the same exact purpose\\n // as the one above.\\n let cc := add(add(add(_bytes, lengthmod), mul(0x20, iszero(lengthmod))), _start)\\n } lt(mc, end) {\\n mc := add(mc, 0x20)\\n cc := add(cc, 0x20)\\n } {\\n mstore(mc, mload(cc))\\n }\\n\\n mstore(tempBytes, _length)\\n\\n //update free-memory pointer\\n //allocating the array padded to 32 bytes like the compiler does now\\n mstore(0x40, and(add(mc, 31), not(31)))\\n }\\n //if we want a zero-length slice let's just return a zero-length array\\n default {\\n tempBytes := mload(0x40)\\n //zero out the 32 bytes slice we are about to return\\n //we need to do it because Solidity does not garbage collect\\n mstore(tempBytes, 0)\\n\\n mstore(0x40, add(tempBytes, 0x20))\\n }\\n }\\n\\n return tempBytes;\\n }\\n\\n function toAddress(bytes memory _bytes, uint256 _start) internal pure returns (address) {\\n require(_bytes.length >= _start + 20, \\\"toAddress_outOfBounds\\\");\\n address tempAddress;\\n\\n assembly {\\n tempAddress := div(mload(add(add(_bytes, 0x20), _start)), 0x1000000000000000000000000)\\n }\\n\\n return tempAddress;\\n }\\n\\n function toUint8(bytes memory _bytes, uint256 _start) internal pure returns (uint8) {\\n require(_bytes.length >= _start + 1, \\\"toUint8_outOfBounds\\\");\\n uint8 tempUint;\\n\\n assembly {\\n tempUint := mload(add(add(_bytes, 0x1), _start))\\n }\\n\\n return tempUint;\\n }\\n\\n function toUint16(bytes memory _bytes, uint256 _start) internal pure returns (uint16) {\\n require(_bytes.length >= _start + 2, \\\"toUint16_outOfBounds\\\");\\n uint16 tempUint;\\n\\n assembly {\\n tempUint := mload(add(add(_bytes, 0x2), _start))\\n }\\n\\n return tempUint;\\n }\\n\\n function toUint32(bytes memory _bytes, uint256 _start) internal pure returns (uint32) {\\n require(_bytes.length >= _start + 4, \\\"toUint32_outOfBounds\\\");\\n uint32 tempUint;\\n\\n assembly {\\n tempUint := mload(add(add(_bytes, 0x4), _start))\\n }\\n\\n return tempUint;\\n }\\n\\n function toUint64(bytes memory _bytes, uint256 _start) internal pure returns (uint64) {\\n require(_bytes.length >= _start + 8, \\\"toUint64_outOfBounds\\\");\\n uint64 tempUint;\\n\\n assembly {\\n tempUint := mload(add(add(_bytes, 0x8), _start))\\n }\\n\\n return tempUint;\\n }\\n\\n function toUint96(bytes memory _bytes, uint256 _start) internal pure returns (uint96) {\\n require(_bytes.length >= _start + 12, \\\"toUint96_outOfBounds\\\");\\n uint96 tempUint;\\n\\n assembly {\\n tempUint := mload(add(add(_bytes, 0xc), _start))\\n }\\n\\n return tempUint;\\n }\\n\\n function toUint128(bytes memory _bytes, uint256 _start) internal pure returns (uint128) {\\n require(_bytes.length >= _start + 16, \\\"toUint128_outOfBounds\\\");\\n uint128 tempUint;\\n\\n assembly {\\n tempUint := mload(add(add(_bytes, 0x10), _start))\\n }\\n\\n return tempUint;\\n }\\n\\n function toUint256(bytes memory _bytes, uint256 _start) internal pure returns (uint256) {\\n require(_bytes.length >= _start + 32, \\\"toUint256_outOfBounds\\\");\\n uint256 tempUint;\\n\\n assembly {\\n tempUint := mload(add(add(_bytes, 0x20), _start))\\n }\\n\\n return tempUint;\\n }\\n\\n function toBytes32(bytes memory _bytes, uint256 _start) internal pure returns (bytes32) {\\n require(_bytes.length >= _start + 32, \\\"toBytes32_outOfBounds\\\");\\n bytes32 tempBytes32;\\n\\n assembly {\\n tempBytes32 := mload(add(add(_bytes, 0x20), _start))\\n }\\n\\n return tempBytes32;\\n }\\n\\n function equal(bytes memory _preBytes, bytes memory _postBytes) internal pure returns (bool) {\\n bool success = true;\\n\\n assembly {\\n let length := mload(_preBytes)\\n\\n // if lengths don't match the arrays are not equal\\n switch eq(length, mload(_postBytes))\\n case 1 {\\n // cb is a circuit breaker in the for loop since there's\\n // no said feature for inline assembly loops\\n // cb = 1 - don't breaker\\n // cb = 0 - break\\n let cb := 1\\n\\n let mc := add(_preBytes, 0x20)\\n let end := add(mc, length)\\n\\n for {\\n let cc := add(_postBytes, 0x20)\\n // the next line is the loop condition:\\n // while(uint256(mc < end) + cb == 2)\\n } eq(add(lt(mc, end), cb), 2) {\\n mc := add(mc, 0x20)\\n cc := add(cc, 0x20)\\n } {\\n // if any of these checks fails then arrays are not equal\\n if iszero(eq(mload(mc), mload(cc))) {\\n // unsuccess:\\n success := 0\\n cb := 0\\n }\\n }\\n }\\n default {\\n // unsuccess:\\n success := 0\\n }\\n }\\n\\n return success;\\n }\\n\\n function equalStorage(bytes storage _preBytes, bytes memory _postBytes) internal view returns (bool) {\\n bool success = true;\\n\\n assembly {\\n // we know _preBytes_offset is 0\\n let fslot := sload(_preBytes.slot)\\n // Decode the length of the stored array like in concatStorage().\\n let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2)\\n let mlength := mload(_postBytes)\\n\\n // if lengths don't match the arrays are not equal\\n switch eq(slength, mlength)\\n case 1 {\\n // slength can contain both the length and contents of the array\\n // if length < 32 bytes so let's prepare for that\\n // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage\\n if iszero(iszero(slength)) {\\n switch lt(slength, 32)\\n case 1 {\\n // blank the last byte which is the length\\n fslot := mul(div(fslot, 0x100), 0x100)\\n\\n if iszero(eq(fslot, mload(add(_postBytes, 0x20)))) {\\n // unsuccess:\\n success := 0\\n }\\n }\\n default {\\n // cb is a circuit breaker in the for loop since there's\\n // no said feature for inline assembly loops\\n // cb = 1 - don't breaker\\n // cb = 0 - break\\n let cb := 1\\n\\n // get the keccak hash to get the contents of the array\\n mstore(0x0, _preBytes.slot)\\n let sc := keccak256(0x0, 0x20)\\n\\n let mc := add(_postBytes, 0x20)\\n let end := add(mc, mlength)\\n\\n // the next line is the loop condition:\\n // while(uint256(mc < end) + cb == 2)\\n for {\\n\\n } eq(add(lt(mc, end), cb), 2) {\\n sc := add(sc, 1)\\n mc := add(mc, 0x20)\\n } {\\n if iszero(eq(sload(sc), mload(mc))) {\\n // unsuccess:\\n success := 0\\n cb := 0\\n }\\n }\\n }\\n }\\n }\\n default {\\n // unsuccess:\\n success := 0\\n }\\n }\\n\\n return success;\\n }\\n}\\n\",\"keccak256\":\"0xaa1c57864bd8483bb17f2fa96a0cbebb39006ca7aab1a28ff85e52e487437c4c\",\"license\":\"Unlicense\"},\"contracts/dependencies/openzeppelin-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.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 * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\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. Equivalent to `reinitializer(1)`.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = _setInitializedVersion(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 * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original\\n * initialization step. This is essential to configure modules that are added through upgrades and that require\\n * initialization.\\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 modifier reinitializer(uint8 version) {\\n bool isTopLevelCall = _setInitializedVersion(version);\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(version);\\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} 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 function _disableInitializers() internal virtual {\\n _setInitializedVersion(type(uint8).max);\\n }\\n\\n function _setInitializedVersion(uint8 version) private returns (bool) {\\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, and for the lowest level\\n // of initializers, because in other contexts the contract may have been reentered.\\n if (_initializing) {\\n require(\\n version == 1 && !AddressUpgradeable.isContract(address(this)),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n return false;\\n } else {\\n require(_initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n return true;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x7454006cccb737612b00104d2f606d728e2818b778e7e55542f063c614ce46ba\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin-upgradeable/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.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 *\\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 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\":\"0x55cf2bd9fc76704ddcdc19834cd288b7de00fc0f298a40ea16a954ae8991db2d\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin-upgradeable/utils/introspection/IERC165Upgradeable.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 IERC165Upgradeable {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0xc6cef87559d0aeffdf0a99803de655938a7779ec0a3cd5d4383483ad85565a09\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\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 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 `recipient`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address recipient, 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 `sender` to `recipient` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address sender,\\n address recipient,\\n uint256 amount\\n ) external returns (bool);\\n\\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\",\"keccak256\":\"0x027b891937d20ccf213fdb9c31531574256de774bda99d3a70ecef6e1913ed2a\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\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\":\"0x83fe24f5c04a56091e50f4a345ff504c8bff658a76d4c43b16878c8f940c53b2\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin/token/ERC20/utils/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\nimport \\\"../../../utils/Address.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n using Address for address;\\n\\n function safeTransfer(\\n IERC20 token,\\n address to,\\n uint256 value\\n ) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n function safeTransferFrom(\\n IERC20 token,\\n address from,\\n address to,\\n uint256 value\\n ) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\\n }\\n\\n /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\n */\\n function safeApprove(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n // safeApprove should only be called when setting an initial allowance,\\n // or when resetting it to zero. To increase and decrease it, use\\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\\n require(\\n (value == 0) || (token.allowance(address(this), spender) == 0),\\n \\\"SafeERC20: approve from non-zero to non-zero allowance\\\"\\n );\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\\n }\\n\\n function safeIncreaseAllowance(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n uint256 newAllowance = token.allowance(address(this), spender) + value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n unchecked {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n require(oldAllowance >= value, \\\"SafeERC20: decreased allowance below zero\\\");\\n uint256 newAllowance = oldAllowance - value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\n if (returndata.length > 0) {\\n // Return data is optional\\n require(abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0x02348b2e4b9f3200c7e3907c5c2661643a6d8520e9f79939fbb9b4005a54894d\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.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\":\"0x2ccf9d2313a313d41a791505f2b5abfdc62191b5d4334f7f7a82691c088a1c87\",\"license\":\"MIT\"},\"contracts/dependencies/stargate-protocol/interfaces/IStargateComposer.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./IStargateRouter.sol\\\";\\n\\ninterface IStargateComposer {\\n function swap(\\n uint16 _dstChainId,\\n uint256 _srcPoolId,\\n uint256 _dstPoolId,\\n address payable _refundAddress,\\n uint256 _amountLD,\\n uint256 _minAmountLD,\\n IStargateRouter.lzTxObj memory _lzTxParams,\\n bytes calldata _to,\\n bytes calldata _payload\\n ) external payable;\\n\\n function factory() external view returns (address);\\n\\n function stargateBridge() external view returns (address);\\n\\n function stargateRouter() external view returns (IStargateRouter);\\n\\n function quoteLayerZeroFee(\\n uint16 _dstChainId,\\n uint8 _functionType,\\n bytes calldata _toAddress,\\n bytes calldata _transferAndCallPayload,\\n IStargateRouter.lzTxObj memory _lzTxParams\\n ) external view returns (uint256, uint256);\\n\\n function peers(uint16 _chainId) external view returns (address);\\n}\\n\",\"keccak256\":\"0xdfdd1690bf176ac05803534a60227be90cc435b4bdd8fce2348f1a9417a9f63a\",\"license\":\"BUSL-1.1\"},\"contracts/dependencies/stargate-protocol/interfaces/IStargateReceiver.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\n\\npragma solidity 0.8.9;\\n\\ninterface IStargateReceiver {\\n function sgReceive(\\n uint16 _chainId,\\n bytes memory _srcAddress,\\n uint256 _nonce,\\n address _token,\\n uint256 amountLD,\\n bytes memory payload\\n ) external;\\n}\\n\",\"keccak256\":\"0xe4d6bf9fa422e5e43dc1b6880f951d06611a4ed12c2dd7dd8c0b6a5d9e06ad0d\",\"license\":\"BUSL-1.1\"},\"contracts/dependencies/stargate-protocol/interfaces/IStargateRouter.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\n\\npragma solidity 0.8.9;\\n\\ninterface IStargateRouter {\\n struct lzTxObj {\\n uint256 dstGasForCall;\\n uint256 dstNativeAmount;\\n bytes dstNativeAddr;\\n }\\n\\n function addLiquidity(uint256 _poolId, uint256 _amountLD, address _to) external;\\n\\n function swap(\\n uint16 _dstChainId,\\n uint256 _srcPoolId,\\n uint256 _dstPoolId,\\n address payable _refundAddress,\\n uint256 _amountLD,\\n uint256 _minAmountLD,\\n lzTxObj memory _lzTxParams,\\n bytes calldata _to,\\n bytes calldata _payload\\n ) external payable;\\n\\n function redeemRemote(\\n uint16 _dstChainId,\\n uint256 _srcPoolId,\\n uint256 _dstPoolId,\\n address payable _refundAddress,\\n uint256 _amountLP,\\n uint256 _minAmountLD,\\n bytes calldata _to,\\n lzTxObj memory _lzTxParams\\n ) external payable;\\n\\n function instantRedeemLocal(uint16 _srcPoolId, uint256 _amountLP, address _to) external returns (uint256);\\n\\n function redeemLocal(\\n uint16 _dstChainId,\\n uint256 _srcPoolId,\\n uint256 _dstPoolId,\\n address payable _refundAddress,\\n uint256 _amountLP,\\n bytes calldata _to,\\n lzTxObj memory _lzTxParams\\n ) external payable;\\n\\n function sendCredits(\\n uint16 _dstChainId,\\n uint256 _srcPoolId,\\n uint256 _dstPoolId,\\n address payable _refundAddress\\n ) external payable;\\n\\n function quoteLayerZeroFee(\\n uint16 _dstChainId,\\n uint8 _functionType,\\n bytes calldata _toAddress,\\n bytes calldata _transferAndCallPayload,\\n lzTxObj memory _lzTxParams\\n ) external view returns (uint256, uint256);\\n\\n function clearCachedSwap(uint16 _srcChainId, bytes calldata _srcAddress, uint256 _nonce) external;\\n\\n function factory() external view returns (address);\\n\\n function bridge() external view returns (address);\\n\\n function cachedSwapLookup(\\n uint16 _chainId_,\\n bytes calldata _srcAddress,\\n uint256 _nonce\\n ) external view returns (address token, uint256 amountLD, address to, bytes memory payload);\\n}\\n\",\"keccak256\":\"0x92126df8e682b2c5647c7b22e7387da69f9e72480af86948ce5ed17dc2c9e0a7\",\"license\":\"BUSL-1.1\"},\"contracts/interfaces/ICrossChainDispatcher.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/composable/IOFTReceiverUpgradeable.sol\\\";\\nimport \\\"../dependencies/stargate-protocol/interfaces/IStargateReceiver.sol\\\";\\nimport \\\"../dependencies/stargate-protocol/interfaces/IStargateRouter.sol\\\";\\nimport \\\"../dependencies/stargate-protocol/interfaces/IStargateComposer.sol\\\";\\nimport \\\"./IProxyOFT.sol\\\";\\n\\ninterface ICrossChainDispatcher is IStargateReceiver, IOFTReceiverUpgradeable {\\n function crossChainDispatcherOf(uint16 chainId_) external view returns (address);\\n\\n function triggerFlashRepaySwap(\\n uint256 id_,\\n address payable account_,\\n address tokenIn_,\\n address tokenOut_,\\n uint256 amountIn_,\\n uint256 amountOutMin_,\\n bytes calldata lzArgs_\\n ) external payable;\\n\\n function triggerLeverageSwap(\\n uint256 id_,\\n address payable account_,\\n address tokenIn_,\\n address tokenOut_,\\n uint256 amountIn_,\\n uint256 amountOutMin,\\n bytes calldata lzArgs_\\n ) external payable;\\n\\n function isBridgingActive() external view returns (bool);\\n\\n function flashRepayCallbackTxGasLimit() external view returns (uint64);\\n\\n function flashRepaySwapTxGasLimit() external view returns (uint64);\\n\\n function leverageCallbackTxGasLimit() external view returns (uint64);\\n\\n function leverageSwapTxGasLimit() external view returns (uint64);\\n\\n function lzBaseGasLimit() external view returns (uint256);\\n\\n function stargateComposer() external view returns (IStargateComposer);\\n\\n function stargateSlippage() external view returns (uint256);\\n\\n function stargatePoolIdOf(address token_) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xcaf05e625588dcfaa5706acc78a35fa46d50baeb2d28f689036963695a4e39cb\",\"license\":\"MIT\"},\"contracts/interfaces/IDebtToken.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/openzeppelin/token/ERC20/extensions/IERC20Metadata.sol\\\";\\nimport \\\"./ISyntheticToken.sol\\\";\\n\\ninterface IDebtToken is IERC20Metadata {\\n function lastTimestampAccrued() external view returns (uint256);\\n\\n function isActive() external view returns (bool);\\n\\n function syntheticToken() external view returns (ISyntheticToken);\\n\\n function accrueInterest() external;\\n\\n function debtIndex() external returns (uint256 debtIndex_);\\n\\n function burn(address from_, uint256 amount_) external;\\n\\n function issue(uint256 amount_, address to_) external returns (uint256 _issued, uint256 _fee);\\n\\n function flashIssue(address to_, uint256 amount_) external returns (uint256 _issued, uint256 _fee);\\n\\n function mint(address to_, uint256 amount_) external;\\n\\n function repay(address onBehalfOf_, uint256 amount_) external returns (uint256 _repaid, uint256 _fee);\\n\\n function repayAll(address onBehalfOf_) external returns (uint256 _repaid, uint256 _fee);\\n\\n function quoteIssueIn(uint256 amountToIssue_) external view returns (uint256 _amount, uint256 _fee);\\n\\n function quoteIssueOut(uint256 amount_) external view returns (uint256 _amountToIssue, uint256 _fee);\\n\\n function quoteRepayIn(uint256 amountToRepay_) external view returns (uint256 _amount, uint256 _fee);\\n\\n function quoteRepayOut(uint256 amount_) external view returns (uint256 _amountToRepay, uint256 _fee);\\n\\n function updateMaxTotalSupply(uint256 newMaxTotalSupply_) external;\\n\\n function updateInterestRate(uint256 newInterestRate_) external;\\n\\n function maxTotalSupply() external view returns (uint256);\\n\\n function interestRate() external view returns (uint256);\\n\\n function interestRatePerSecond() external view returns (uint256);\\n\\n function toggleIsActive() external;\\n}\\n\",\"keccak256\":\"0xd2f04aa1bee06d6991b10aaf7c03c3ee09d85f8e48ba92feac595ad855881380\",\"license\":\"MIT\"},\"contracts/interfaces/IDepositToken.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/openzeppelin/token/ERC20/extensions/IERC20Metadata.sol\\\";\\n\\ninterface IDepositToken is IERC20Metadata {\\n function underlying() external view returns (IERC20);\\n\\n function collateralFactor() external view returns (uint256);\\n\\n function unlockedBalanceOf(address account_) external view returns (uint256);\\n\\n function lockedBalanceOf(address account_) external view returns (uint256);\\n\\n function flashWithdraw(address account_, uint256 amount_) external returns (uint256 _withdrawn, uint256 _fee);\\n\\n function deposit(uint256 amount_, address onBehalfOf_) external returns (uint256 _deposited, uint256 _fee);\\n\\n function quoteDepositIn(uint256 amountToDeposit_) external view returns (uint256 _amount, uint256 _fee);\\n\\n function quoteDepositOut(uint256 amount_) external view returns (uint256 _amountToDeposit, uint256 _fee);\\n\\n function quoteWithdrawIn(uint256 amountToWithdraw_) external view returns (uint256 _amount, uint256 _fee);\\n\\n function quoteWithdrawOut(uint256 amount_) external view returns (uint256 _amountToWithdraw, uint256 _fee);\\n\\n function withdraw(uint256 amount_, address to_) external returns (uint256 _withdrawn, uint256 _fee);\\n\\n function seize(address from_, address to_, uint256 amount_) external;\\n\\n function updateCollateralFactor(uint128 newCollateralFactor_) external;\\n\\n function isActive() external view returns (bool);\\n\\n function toggleIsActive() external;\\n\\n function maxTotalSupply() external view returns (uint256);\\n\\n function updateMaxTotalSupply(uint256 newMaxTotalSupply_) external;\\n\\n function withdrawFrom(address from_, uint256 amount_) external returns (uint256 _withdrawn, uint256 _fee);\\n}\\n\",\"keccak256\":\"0xb27092f9450d9c48c1a215925007ca9c7282cfe6cf257b34ab3dbe6e745b6bd1\",\"license\":\"MIT\"},\"contracts/interfaces/IFeeProvider.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\n/**\\n * @notice FeeProvider interface\\n */\\ninterface IFeeProvider {\\n struct LiquidationFees {\\n uint128 liquidatorIncentive;\\n uint128 protocolFee;\\n }\\n\\n function defaultSwapFee() external view returns (uint256);\\n\\n function depositFee() external view returns (uint256);\\n\\n function issueFee() external view returns (uint256);\\n\\n function liquidationFees() external view returns (uint128 liquidatorIncentive, uint128 protocolFee);\\n\\n function repayFee() external view returns (uint256);\\n\\n function swapFeeFor(address account_) external view returns (uint256);\\n\\n function withdrawFee() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x3b132b42090c167b2c0aef6d78d833c669c43b9e55593a7a21a96ed5d3082700\",\"license\":\"MIT\"},\"contracts/interfaces/IGovernable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\n/**\\n * @notice Governable interface\\n */\\ninterface IGovernable {\\n function governor() external view returns (address _governor);\\n\\n function transferGovernorship(address _proposedGovernor) external;\\n}\\n\",\"keccak256\":\"0xbe84461adf33aec1bf31b6d84a5380aaeb791de9a4b95346dd8270dc6632984e\",\"license\":\"MIT\"},\"contracts/interfaces/IManageable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./IPool.sol\\\";\\n\\n/**\\n * @notice Manageable interface\\n */\\ninterface IManageable {\\n function pool() external view returns (IPool _pool);\\n}\\n\",\"keccak256\":\"0xac88e0997a26942cb9cbda1a7dd9756e28ba2025813e5b07e55939fbf8538ea2\",\"license\":\"MIT\"},\"contracts/interfaces/IPauseable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\ninterface IPauseable {\\n function paused() external view returns (bool);\\n\\n function everythingStopped() external view returns (bool);\\n}\\n\",\"keccak256\":\"0xa768de9fadad05a8104cb407ae6243354e70ffd6e1a50c3e0bb0a6a1dc49d32a\",\"license\":\"MIT\"},\"contracts/interfaces/IPool.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./IDepositToken.sol\\\";\\nimport \\\"./IDebtToken.sol\\\";\\nimport \\\"./ITreasury.sol\\\";\\nimport \\\"./IRewardsDistributor.sol\\\";\\nimport \\\"./IPoolRegistry.sol\\\";\\nimport \\\"./IFeeProvider.sol\\\";\\nimport \\\"./ISmartFarmingManager.sol\\\";\\nimport \\\"./external/ISwapper.sol\\\";\\nimport \\\"../interfaces/IFeeProvider.sol\\\";\\n\\n/**\\n * @notice Pool interface\\n */\\ninterface IPool is IPauseable, IGovernable {\\n function debtFloorInUsd() external view returns (uint256);\\n\\n function feeCollector() external view returns (address);\\n\\n function feeProvider() external view returns (IFeeProvider);\\n\\n function maxLiquidable() external view returns (uint256);\\n\\n function doesSyntheticTokenExist(ISyntheticToken syntheticToken_) external view returns (bool);\\n\\n function doesDebtTokenExist(IDebtToken debtToken_) external view returns (bool);\\n\\n function doesDepositTokenExist(IDepositToken depositToken_) external view returns (bool);\\n\\n function depositTokenOf(IERC20 underlying_) external view returns (IDepositToken);\\n\\n function debtTokenOf(ISyntheticToken syntheticToken_) external view returns (IDebtToken);\\n\\n function getDepositTokens() external view returns (address[] memory);\\n\\n function getDebtTokens() external view returns (address[] memory);\\n\\n function getRewardsDistributors() external view returns (address[] memory);\\n\\n function debtOf(address account_) external view returns (uint256 _debtInUsd);\\n\\n function depositOf(address account_) external view returns (uint256 _depositInUsd, uint256 _issuableLimitInUsd);\\n\\n function debtPositionOf(\\n address account_\\n )\\n external\\n view\\n returns (\\n bool _isHealthy,\\n uint256 _depositInUsd,\\n uint256 _debtInUsd,\\n uint256 _issuableLimitInUsd,\\n uint256 _issuableInUsd\\n );\\n\\n function liquidate(\\n ISyntheticToken syntheticToken_,\\n address account_,\\n uint256 amountToRepay_,\\n IDepositToken depositToken_\\n ) external returns (uint256 _totalSeized, uint256 _toLiquidator, uint256 _fee);\\n\\n function quoteLiquidateIn(\\n ISyntheticToken syntheticToken_,\\n uint256 totalToSeized_,\\n IDepositToken depositToken_\\n ) external view returns (uint256 _amountToRepay, uint256 _toLiquidator, uint256 _fee);\\n\\n function quoteLiquidateMax(\\n ISyntheticToken syntheticToken_,\\n address account_,\\n IDepositToken depositToken_\\n ) external view returns (uint256 _maxAmountToRepay);\\n\\n function quoteLiquidateOut(\\n ISyntheticToken syntheticToken_,\\n uint256 amountToRepay_,\\n IDepositToken depositToken_\\n ) external view returns (uint256 _totalSeized, uint256 _toLiquidator, uint256 _fee);\\n\\n function quoteSwapIn(\\n ISyntheticToken syntheticTokenIn_,\\n ISyntheticToken syntheticTokenOut_,\\n uint256 amountOut_\\n ) external view returns (uint256 _amountIn, uint256 _fee);\\n\\n function quoteSwapOut(\\n ISyntheticToken syntheticTokenIn_,\\n ISyntheticToken syntheticTokenOut_,\\n uint256 amountIn_\\n ) external view returns (uint256 _amountOut, uint256 _fee);\\n\\n function swap(\\n ISyntheticToken syntheticTokenIn_,\\n ISyntheticToken syntheticTokenOut_,\\n uint256 amountIn_\\n ) external returns (uint256 _amountOut, uint256 _fee);\\n\\n function treasury() external view returns (ITreasury);\\n\\n function masterOracle() external view returns (IMasterOracle);\\n\\n function poolRegistry() external view returns (IPoolRegistry);\\n\\n function addToDepositTokensOfAccount(address account_) external;\\n\\n function removeFromDepositTokensOfAccount(address account_) external;\\n\\n function addToDebtTokensOfAccount(address account_) external;\\n\\n function removeFromDebtTokensOfAccount(address account_) external;\\n\\n function getDepositTokensOfAccount(address account_) external view returns (address[] memory);\\n\\n function getDebtTokensOfAccount(address account_) external view returns (address[] memory);\\n\\n function isSwapActive() external view returns (bool);\\n\\n function smartFarmingManager() external view returns (ISmartFarmingManager);\\n}\\n\",\"keccak256\":\"0x0f0a869451cca858ba52b56970db167360fe161f2450557a053c4da938558816\",\"license\":\"MIT\"},\"contracts/interfaces/IPoolRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./external/IMasterOracle.sol\\\";\\nimport \\\"./IPauseable.sol\\\";\\nimport \\\"./IGovernable.sol\\\";\\nimport \\\"./ISyntheticToken.sol\\\";\\nimport \\\"./external/ISwapper.sol\\\";\\nimport \\\"./IQuoter.sol\\\";\\nimport \\\"./ICrossChainDispatcher.sol\\\";\\n\\ninterface IPoolRegistry is IPauseable, IGovernable {\\n function feeCollector() external view returns (address);\\n\\n function isPoolRegistered(address pool_) external view returns (bool);\\n\\n function nativeTokenGateway() external view returns (address);\\n\\n function getPools() external view returns (address[] memory);\\n\\n function registerPool(address pool_) external;\\n\\n function unregisterPool(address pool_) external;\\n\\n function masterOracle() external view returns (IMasterOracle);\\n\\n function updateFeeCollector(address newFeeCollector_) external;\\n\\n function idOfPool(address pool_) external view returns (uint256);\\n\\n function nextPoolId() external view returns (uint256);\\n\\n function swapper() external view returns (ISwapper);\\n\\n function quoter() external view returns (IQuoter);\\n\\n function crossChainDispatcher() external view returns (ICrossChainDispatcher);\\n\\n function doesSyntheticTokenExist(ISyntheticToken syntheticToken_) external view returns (bool _exists);\\n}\\n\",\"keccak256\":\"0x9ffa9e5fd39a48ac2bda561af7fb4fc9df5f8ffb7a602ef1d4da8c068019e723\",\"license\":\"MIT\"},\"contracts/interfaces/IProxyOFT.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/composable/IComposableOFTCoreUpgradeable.sol\\\";\\n\\ninterface IProxyOFT is IComposableOFTCoreUpgradeable {\\n function getProxyOFTOf(uint16 chainId_) external view returns (address _proxyOFT);\\n}\\n\",\"keccak256\":\"0x4041a90eb60de460c9e1631aaedfbf2bff2275b3f91964800b1c774546931cd5\",\"license\":\"MIT\"},\"contracts/interfaces/IQuoter.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./IPoolRegistry.sol\\\";\\nimport \\\"./IProxyOFT.sol\\\";\\n\\ninterface IQuoter {\\n function quoteCrossChainFlashRepayNativeFee(\\n IProxyOFT proxyOFT_,\\n bytes calldata lzArgs_\\n ) external view returns (uint256 _nativeFee);\\n\\n function quoteCrossChainLeverageNativeFee(\\n IProxyOFT proxyOFT_,\\n bytes calldata lzArgs_\\n ) external view returns (uint256 _nativeFee);\\n\\n function quoteLeverageCallbackNativeFee(uint16 dstChainId_) external view returns (uint256 _callbackTxNativeFee);\\n\\n function quoteFlashRepayCallbackNativeFee(uint16 dstChainId_) external view returns (uint256 _callbackTxNativeFee);\\n\\n function getFlashRepaySwapAndCallbackLzArgs(\\n uint16 srcChainId_,\\n uint16 dstChainId_\\n ) external view returns (bytes memory lzArgs_);\\n\\n function getLeverageSwapAndCallbackLzArgs(\\n uint16 srcChainId_,\\n uint16 dstChainId_\\n ) external view returns (bytes memory lzArgs_);\\n}\\n\",\"keccak256\":\"0x1e4d2dd779a09dc8ea6b6c244b167deddca3a48e71b73bf940da04113b40c752\",\"license\":\"MIT\"},\"contracts/interfaces/IRewardsDistributor.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/openzeppelin/token/ERC20/IERC20.sol\\\";\\n\\n/**\\n * @notice Reward Distributor interface\\n */\\ninterface IRewardsDistributor {\\n function rewardToken() external view returns (IERC20);\\n\\n function tokenSpeeds(IERC20 token_) external view returns (uint256);\\n\\n function tokensAccruedOf(address account_) external view returns (uint256);\\n\\n function updateBeforeMintOrBurn(IERC20 token_, address account_) external;\\n\\n function updateBeforeTransfer(IERC20 token_, address from_, address to_) external;\\n\\n function claimable(address account_) external view returns (uint256 _claimable);\\n\\n function claimable(address account_, IERC20 token_) external view returns (uint256 _claimable);\\n\\n function claimRewards(address account_) external;\\n\\n function claimRewards(address account_, IERC20[] memory tokens_) external;\\n\\n function claimRewards(address[] memory accounts_, IERC20[] memory tokens_) external;\\n\\n function updateTokenSpeed(IERC20 token_, uint256 newSpeed_) external;\\n\\n function updateTokenSpeeds(IERC20[] calldata tokens_, uint256[] calldata speeds_) external;\\n\\n function tokens(uint256) external view returns (IERC20);\\n\\n function tokenStates(IERC20) external view returns (uint224 index, uint32 timestamp);\\n\\n function accountIndexOf(IERC20, address) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x4f527eeae61b6a5bff7d3b48037234ef718ae7f71dc452e8cab3b60581f0d810\",\"license\":\"MIT\"},\"contracts/interfaces/ISmartFarmingManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./IManageable.sol\\\";\\nimport \\\"./IDepositToken.sol\\\";\\nimport \\\"./IDebtToken.sol\\\";\\n\\n/**\\n * @notice SmartFarmingManager interface\\n */\\ninterface ISmartFarmingManager {\\n function flashRepay(\\n ISyntheticToken syntheticToken_,\\n IDepositToken depositToken_,\\n uint256 withdrawAmount_,\\n uint256 repayAmountMin_\\n ) external returns (uint256 _withdrawn, uint256 _repaid);\\n\\n function crossChainFlashRepay(\\n ISyntheticToken syntheticToken_,\\n IDepositToken depositToken_,\\n uint256 withdrawAmount_,\\n IERC20 bridgeToken_,\\n uint256 bridgeTokenAmountMin_,\\n uint256 swapAmountOutMin_,\\n uint256 repayAmountMin_,\\n bytes calldata lzArgs_\\n ) external payable;\\n\\n function crossChainLeverage(\\n IERC20 tokenIn_,\\n IDepositToken depositToken_,\\n ISyntheticToken syntheticToken_,\\n uint256 amountIn_,\\n uint256 leverage_,\\n uint256 swapAmountOutMin_,\\n uint256 depositAmountMin_,\\n bytes calldata lzArgs_\\n ) external payable;\\n\\n function crossChainLeverageCallback(uint256 id_, uint256 swapAmountOut_) external returns (uint256 _deposited);\\n\\n function crossChainFlashRepayCallback(uint256 id_, uint256 swapAmountOut_) external returns (uint256 _repaid);\\n\\n function leverage(\\n IERC20 tokenIn_,\\n IDepositToken depositToken_,\\n ISyntheticToken syntheticToken_,\\n uint256 amountIn_,\\n uint256 leverage_,\\n uint256 depositAmountMin_\\n ) external returns (uint256 _deposited, uint256 _issued);\\n}\\n\",\"keccak256\":\"0x7544a9d308a49e24d6984c3cfcfe2c1cfb7d9ce4655408438e1c12f37175a3b0\",\"license\":\"MIT\"},\"contracts/interfaces/ISyntheticToken.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/openzeppelin/token/ERC20/extensions/IERC20Metadata.sol\\\";\\nimport \\\"./IDebtToken.sol\\\";\\nimport \\\"./IPoolRegistry.sol\\\";\\nimport \\\"../interfaces/IProxyOFT.sol\\\";\\n\\ninterface ISyntheticToken is IERC20Metadata {\\n function isActive() external view returns (bool);\\n\\n function mint(address to_, uint256 amount_) external;\\n\\n function burn(address from_, uint256 amount) external;\\n\\n function poolRegistry() external view returns (IPoolRegistry);\\n\\n function toggleIsActive() external;\\n\\n function seize(address from_, address to_, uint256 amount_) external;\\n\\n function updateMaxTotalSupply(uint256 newMaxTotalSupply_) external;\\n\\n function updateProxyOFT(IProxyOFT newProxyOFT_) external;\\n\\n function maxTotalSupply() external view returns (uint256);\\n\\n function proxyOFT() external view returns (IProxyOFT);\\n}\\n\",\"keccak256\":\"0xfaeb24d1067e85493a5c8818d6de06fc6dbc72c37e85f82811990d0120f8a0cf\",\"license\":\"MIT\"},\"contracts/interfaces/ITreasury.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\ninterface ITreasury {\\n function pull(address to_, uint256 amount_) external;\\n\\n function migrateTo(address newTreasury_) external;\\n}\\n\",\"keccak256\":\"0x9ee0a41cfe7b5bd2ec256441fc7b2ae6407921ed28a65daeaa476cfc9df73c1b\",\"license\":\"MIT\"},\"contracts/interfaces/external/IMasterOracle.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\ninterface IMasterOracle {\\n function quoteTokenToUsd(address _asset, uint256 _amount) external view returns (uint256 _amountInUsd);\\n\\n function quoteUsdToToken(address _asset, uint256 _amountInUsd) external view returns (uint256 _amount);\\n\\n function quote(address _assetIn, address _assetOut, uint256 _amountIn) external view returns (uint256 _amountOut);\\n}\\n\",\"keccak256\":\"0x2f080adc5880151dc4446ef43b54abab8e3711c5f2e526917ef39a05e3c16a00\",\"license\":\"MIT\"},\"contracts/interfaces/external/IStargateComposerWithRetry.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../../dependencies/stargate-protocol/interfaces/IStargateComposer.sol\\\";\\n\\n// Note: Extending interface instead of adding those function to avoid triggering upgrade for other contracts\\n// We may move functions to `IStargateComposer` on the next major upgrade\\n// Refs: https://github.com/autonomoussoftware/metronome-synth/issues/877\\ninterface IStargateComposerWithRetry is IStargateComposer {\\n function payloadHashes(\\n uint16 _srcChainId,\\n bytes calldata _srcAddress,\\n uint256 _nonce\\n ) external view returns (bytes32);\\n\\n function clearCachedSwap(\\n uint16 _srcChainId,\\n bytes calldata _srcAddress,\\n uint64 _nonce,\\n address _receiver,\\n bytes calldata _sgReceiveCallData\\n ) external;\\n}\\n\",\"keccak256\":\"0x92a0df931fd4ffb78085bf1526c0a5b53c78d9ea9a8a9f9b57d7178b14b80508\",\"license\":\"BUSL-1.1\"},\"contracts/interfaces/external/IStargateFactory.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\ninterface IStargateFactory {\\n function getPool(uint256 _id) external view returns (address _pool);\\n}\\n\",\"keccak256\":\"0x2ab62b49b277ee038b0da54659a1347969300f754ec9a5e47a982d9afdf7f495\",\"license\":\"MIT\"},\"contracts/interfaces/external/IStargatePool.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\ninterface IStargatePool {\\n function token() external view returns (address _token);\\n}\\n\",\"keccak256\":\"0xb1991884813f17988846955930b45d7e77edef53063f088e4b9b7ba08d98d27c\",\"license\":\"MIT\"},\"contracts/interfaces/external/ISwapper.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\ninterface ISwapper {\\n function swapExactInput(\\n address tokenIn_,\\n address tokenOut_,\\n uint256 amountIn_,\\n uint256 amountOutMin_,\\n address receiver_\\n ) external returns (uint256 _amountOut);\\n}\\n\",\"keccak256\":\"0x75f04b225d0c310be7e0a09ee4c1aa6eeeb8d94e02fc0e4160a9597ce2d8d446\",\"license\":\"MIT\"},\"contracts/interfaces/external/IWETH.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../../dependencies/openzeppelin/token/ERC20/IERC20.sol\\\";\\n\\ninterface IWETH is IERC20 {\\n function deposit() external payable;\\n\\n function withdraw(uint256) external;\\n}\\n\",\"keccak256\":\"0x35c8fcbe75a63e851c5c213fd9cdf40dc119fd2fd88e8583ce64d424c093edfd\",\"license\":\"MIT\"},\"contracts/lib/CrossChainLib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nlibrary CrossChainLib {\\n /**\\n * @notice Supported cross-chain operations\\n */\\n uint8 public constant LEVERAGE = 1;\\n uint8 public constant FLASH_REPAY = 2;\\n\\n function getOperationType(bytes memory payload_) internal pure returns (uint8 _op) {\\n (_op, ) = abi.decode(payload_, (uint8, bytes));\\n }\\n\\n function encodeLeverageCallbackPayload(\\n address srcSmartFarmingManager_,\\n uint256 requestId_\\n ) internal pure returns (bytes memory _payload) {\\n return abi.encode(LEVERAGE, abi.encode(srcSmartFarmingManager_, requestId_));\\n }\\n\\n function decodeLeverageCallbackPayload(\\n bytes memory payload_\\n ) internal pure returns (address _srcSmartFarmingManager, uint256 _requestId) {\\n (, payload_) = abi.decode(payload_, (uint8, bytes));\\n return abi.decode(payload_, (address, uint256));\\n }\\n\\n function encodeFlashRepayCallbackPayload(\\n address srcProxyOFT_,\\n address srcSmartFarmingManager_,\\n uint256 requestId_\\n ) internal pure returns (bytes memory _payload) {\\n return abi.encode(FLASH_REPAY, abi.encode(srcProxyOFT_, srcSmartFarmingManager_, requestId_));\\n }\\n\\n function decodeFlashRepayCallbackPayload(\\n bytes memory payload_\\n ) internal pure returns (address srcProxyOFT_, address _srcSmartFarmingManager, uint256 _requestId) {\\n (, payload_) = abi.decode(payload_, (uint8, bytes));\\n return abi.decode(payload_, (address, address, uint256));\\n }\\n\\n function encodeFlashRepaySwapPayload(\\n address srcSmartFarmingManager_,\\n address dstProxyOFT_,\\n uint256 requestId_,\\n address account_,\\n uint256 amountOutMin_\\n ) internal pure returns (bytes memory _payload) {\\n return\\n abi.encode(\\n FLASH_REPAY,\\n abi.encode(srcSmartFarmingManager_, dstProxyOFT_, requestId_, account_, amountOutMin_)\\n );\\n }\\n\\n function decodeFlashRepaySwapPayload(\\n bytes memory payload_\\n )\\n internal\\n pure\\n returns (\\n address srcSmartFarmingManager_,\\n address dstProxyOFT_,\\n uint256 requestId_,\\n address account_,\\n uint256 amountOutMin_\\n )\\n {\\n (, payload_) = abi.decode(payload_, (uint8, bytes));\\n return abi.decode(payload_, (address, address, uint256, address, uint256));\\n }\\n\\n function encodeLeverageSwapPayload(\\n address srcSmartFarmingManager_,\\n address dstProxyOFT_,\\n uint256 requestId_,\\n uint256 sgPoolId_,\\n address account_,\\n uint256 amountOutMin_\\n ) internal pure returns (bytes memory _payload) {\\n return\\n abi.encode(\\n LEVERAGE,\\n abi.encode(srcSmartFarmingManager_, dstProxyOFT_, requestId_, sgPoolId_, account_, amountOutMin_)\\n );\\n }\\n\\n function decodeLeverageSwapPayload(\\n bytes memory payload_\\n )\\n internal\\n pure\\n returns (\\n address srcSmartFarmingManager_,\\n address dstProxyOFT_,\\n uint256 requestId_,\\n uint256 sgPoolId_,\\n address account_,\\n uint256 amountOutMin_\\n )\\n {\\n (, payload_) = abi.decode(payload_, (uint8, bytes));\\n return abi.decode(payload_, (address, address, uint256, uint256, address, uint256));\\n }\\n\\n function encodeLzArgs(\\n uint16 dstChainId_,\\n uint256 callbackNativeFee_,\\n uint64 swapTxGasLimit_\\n ) internal pure returns (bytes memory _lzArgs) {\\n return abi.encode(dstChainId_, callbackNativeFee_, swapTxGasLimit_);\\n }\\n\\n function decodeLzArgs(\\n bytes memory lzArgs_\\n ) internal pure returns (uint16 dstChainId_, uint256 callbackNativeFee_, uint64 swapTxGasLimit_) {\\n return abi.decode(lzArgs_, (uint16, uint256, uint64));\\n }\\n}\\n\",\"keccak256\":\"0x207930d2f144d84704364fc6bafdf7eb3bdb2f12ff7f74d75afded53ff035b90\",\"license\":\"MIT\"},\"contracts/storage/CrossChainDispatcherStorage.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../interfaces/ICrossChainDispatcher.sol\\\";\\nimport \\\"../interfaces/IPoolRegistry.sol\\\";\\n\\nabstract contract CrossChainDispatcherStorageV1 is ICrossChainDispatcher {\\n /**\\n * @notice The pool registry contract\\n */\\n IPoolRegistry public poolRegistry;\\n\\n /**\\n * @notice Overwritten swap slippage params\\n * @dev Used by retry functions in case of swap failure due to slippage (See: `_swap()`)\\n */\\n mapping(uint256 => uint256) public swapAmountOutMin;\\n\\n /**\\n * @notice Maps other chains `CrossChainDispatcher` contracts\\n */\\n mapping(uint16 => address) public crossChainDispatcherOf;\\n\\n /**\\n * @notice The base gas to pay for cross-chain calls\\n * @dev This limit covers basic token transfer LZ cost\\n */\\n uint256 public lzBaseGasLimit;\\n\\n /**\\n * @notice The slippage we're willing to accept for SG like:like transfers\\n */\\n uint256 public stargateSlippage;\\n\\n /**\\n * @notice The gas limit to cover `_crossChainFlashRepayCallback()` call\\n */\\n uint64 public flashRepayCallbackTxGasLimit;\\n\\n /**\\n * @notice The gas limit to cover `_swapAndTriggerFlashRepayCallback()` call\\n */\\n uint64 public flashRepaySwapTxGasLimit;\\n\\n /**\\n * @notice The gas limit to cover `_crossChainLeverageCallback()` call\\n */\\n uint64 public leverageCallbackTxGasLimit;\\n\\n /**\\n * @notice The gas limit to cover `_swapAndTriggerLeverageCallback()` call\\n */\\n uint64 public leverageSwapTxGasLimit;\\n\\n /**\\n * @notice Flag that pause/unpause all cross-chain activities\\n */\\n bool public isBridgingActive;\\n\\n /**\\n * @notice The Stargate Router contract\\n */\\n IStargateComposer public stargateComposer;\\n\\n /**\\n * @notice Maps Stargate's token pools\\n */\\n mapping(address => uint256) public stargatePoolIdOf;\\n\\n /**\\n * @notice Maps supported cross-chain routes (i.e. which chains are allowed to be used as source of liquidity)\\n */\\n mapping(uint16 => bool) public isDestinationChainSupported;\\n\\n /**\\n * @notice WETH contract\\n */\\n address public weth;\\n\\n /**\\n * @notice SGETH contract\\n */\\n address public sgeth;\\n}\\n\",\"keccak256\":\"0xb729e4c15f8bd7d6e1ce67b5b7a7aef2866b6bda4dd52f007a9346365403bc94\",\"license\":\"MIT\"},\"contracts/utils/ReentrancyGuard.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../dependencies/openzeppelin-upgradeable/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 ReentrancyGuard 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 // On the first call to nonReentrant, _notEntered will be true\\n require(_status != _ENTERED, \\\"ReentrancyGuard: reentrant call\\\");\\n\\n // Any calls to nonReentrant after this point will fail\\n _status = _ENTERED;\\n\\n _;\\n\\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\",\"keccak256\":\"0x3bf3c3de5a638ca101f25dfcaec5268e9c8a1c29a9a278d70be4459768fb41fe\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x60806040523480156200001157600080fd5b506200001c62000022565b62000152565b6200002e60ff62000031565b50565b60008054610100900460ff1615620000ca578160ff1660011480156200006a575062000068306200014360201b620024591760201c565b155b620000c25760405162461bcd60e51b815260206004820152602e602482015260008051602062004ad083398151915260448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b506000919050565b60005460ff808416911610620001295760405162461bcd60e51b815260206004820152602e602482015260008051602062004ad083398151915260448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401620000b9565b506000805460ff191660ff92909216919091179055600190565b6001600160a01b03163b151590565b61496e80620001626000396000f3fe6080604052600436106101fc5760003560e01c80638a9cadaf1161010d578063b71b42ec116100a0578063dfda255f1161006f578063dfda255f146105ca578063e3499aa414610600578063e3d47ece14610630578063e7f4c16b14610657578063ffa1ad741461067e57600080fd5b8063b71b42ec1461054a578063b9d817201461056a578063c0c53b8b1461057d578063d89921cb1461059d57600080fd5b8063ab8236f3116100dc578063ab8236f3146104ca578063ac18fce6146104ea578063afcff50f1461050a578063b2d083c11461052a57600080fd5b80638a9cadaf1461044a5780638ece68571461045d578063a761f5f01461047d578063ab4193e21461049d57600080fd5b80633413f1c1116101905780636a46aa381161015f5780636a46aa38146103bf5780636c77d24f146103df5780636e406753146103f55780637b7305d314610415578063833667df1461043557600080fd5b80633413f1c11461034857806339f648bf1461036c5780633fc8cef31461037f57806362491b351461039f57600080fd5b80631e492d56116101cc5780631e492d56146102a15780632b80cc52146102c15780632e369cf2146102eb5780633352b6081461030b57600080fd5b8062bc9db9146102085780630b211f0f1461021d578063147a7d71146102615780631a607f9a1461028157600080fd5b3661020357005b600080fd5b61021b610216366004613ced565b6106bc565b005b34801561022957600080fd5b5060075461024490600160801b90046001600160401b031681565b6040516001600160401b0390911681526020015b60405180910390f35b34801561026d57600080fd5b5061021b61027c366004613da9565b610aec565b34801561028d57600080fd5b5061021b61029c366004613e75565b610c4a565b3480156102ad57600080fd5b5061021b6102bc366004613e8e565b610d64565b3480156102cd57600080fd5b506008546102db9060ff1681565b6040519015158152602001610258565b3480156102f757600080fd5b5061021b610306366004613eab565b610ebf565b34801561031757600080fd5b506008546103309061010090046001600160a01b031681565b6040516001600160a01b039091168152602001610258565b34801561035457600080fd5b5061035e60065481565b604051908152602001610258565b61021b61037a366004613ced565b611018565b34801561038b57600080fd5b50600b54610330906001600160a01b031681565b3480156103ab57600080fd5b50600754610244906001600160401b031681565b3480156103cb57600080fd5b5061021b6103da366004613e75565b61144b565b3480156103eb57600080fd5b5061035e60055481565b34801561040157600080fd5b5061021b610410366004613e8e565b611565565b34801561042157600080fd5b5061021b610430366004613ec8565b6116c5565b34801561044157600080fd5b5061021b611817565b61021b610458366004613ef4565b61191e565b34801561046957600080fd5b5061021b610478366004613fb0565b611aee565b34801561048957600080fd5b50600c54610330906001600160a01b031681565b3480156104a957600080fd5b5061035e6104b8366004613e75565b60036020526000908152604090205481565b3480156104d657600080fd5b5061021b6104e53660046140ac565b611c69565b3480156104f657600080fd5b5061021b610505366004613e8e565b611dd3565b34801561051657600080fd5b50600254610330906001600160a01b031681565b34801561053657600080fd5b5061021b610545366004614148565b611f22565b34801561055657600080fd5b5061021b610565366004613e8e565b61204e565b61021b610578366004614165565b6121b3565b34801561058957600080fd5b5061021b61059836600461420c565b612352565b3480156105a957600080fd5b5061035e6105b8366004613eab565b60096020526000908152604090205481565b3480156105d657600080fd5b506103306105e5366004614148565b6004602052600090815260409020546001600160a01b031681565b34801561060c57600080fd5b506102db61061b366004614148565b600a6020526000908152604090205460ff1681565b34801561063c57600080fd5b5060075461024490600160c01b90046001600160401b031681565b34801561066357600080fd5b5060075461024490600160401b90046001600160401b031681565b34801561068a57600080fd5b506106af604051806040016040528060058152602001640312e332e360dc1b81525081565b60405161025891906142af565b600260015414156106e85760405162461bcd60e51b81526004016106df906142c2565b60405180910390fd5b60026001819055506000336001600160a01b03166316f0115b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561072b57600080fd5b505afa15801561073f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061076391906142f9565b60025460405163c673bdaf60e01b81526001600160a01b03808416600483015292935091169063c673bdaf9060240160206040518083038186803b1580156107aa57600080fd5b505afa1580156107be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107e29190614316565b6107ff57604051633bfe162b60e01b815260040160405180910390fd5b806001600160a01b03166396aaccfe6040518163ffffffff1660e01b815260040160206040518083038186803b15801561083857600080fd5b505afa15801561084c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061087091906142f9565b6001600160a01b0316336001600160a01b0316146108a157604051633bfe162b60e01b815260040160405180910390fd5b60085460ff166108c457604051635621fccf60e01b815260040160405180910390fd5b6000889050600080600061090d87878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061246892505050565b925092509250606060008b6001600160a01b0316636d1bb8f76040518163ffffffff1660e01b815260040160206040518083038186803b15801561095057600080fd5b505afa158015610964573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061098891906142f9565b6040516001627dd58f60e11b0319815261ffff871660048201526001600160a01b03919091169063ff0454e29060240160206040518083038186803b1580156109d057600080fd5b505afa1580156109e4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a0891906142f9565b90506001600160a01b038116610a315760405163fb7566d760e01b815260040160405180910390fd5b61ffff85166000908152600a602052604090205460ff16610a655760405163334dc1fd60e01b815260040160405180910390fd5b8e610a733383838a8f61248e565b92505050610ad86040518061010001604052808e6001600160a01b031681526020018661ffff1681526020018c8152602001348152602001838152602001876001600160a01b03168152602001846001600160401b03168152602001858152506124fd565b505060018055505050505050505050505050565b610af5336127cd565b610b1257604051633bfe162b60e01b815260040160405180910390fd5b6000610b58600087878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092939250506129689050565b90506001600160a01b0381161580610b8f575061ffff8a166000908152600460205260409020546001600160a01b03828116911614155b15610bad57604051637ab628f960e01b815260040160405180910390fd5b6000610bee84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506129cd92505050565b905060ff811660021415610c0c57610c078585856129ea565b610c3d565b60ff811660011415610c2457610c078b868686612b53565b604051630ead561960e11b815260040160405180910390fd5b5050505050505050505050565b600260009054906101000a90046001600160a01b03166001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b158015610c9857600080fd5b505afa158015610cac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cd091906142f9565b6001600160a01b0316336001600160a01b031614610d0157604051634b98449160e11b815260040160405180910390fd5b60065481811415610d2557604051630333a68160e41b815260040160405180910390fd5b60408051828152602081018490527f5cac1093ddd8c1e9cbcd89b2f36fa1889e966cc257753af2d160888564fd9818910160405180910390a150600655565b600260009054906101000a90046001600160a01b03166001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b158015610db257600080fd5b505afa158015610dc6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dea91906142f9565b6001600160a01b0316336001600160a01b031614610e1b57604051634b98449160e11b815260040160405180910390fd5b6007546001600160401b03600160c01b9091048116908216811415610e5357604051630333a68160e41b815260040160405180910390fd5b604080516001600160401b038084168252841660208201527f7dd9d7c71da5859a7d6e34c00f4889cb529dbbc009a358db124855baa125a4dc910160405180910390a150600780546001600160401b03909216600160c01b026001600160c01b03909216919091179055565b600260009054906101000a90046001600160a01b03166001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b158015610f0d57600080fd5b505afa158015610f21573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f4591906142f9565b6001600160a01b0316336001600160a01b031614610f7657604051634b98449160e11b815260040160405180910390fd5b6008546001600160a01b036101009091048116908216811415610fac57604051630333a68160e41b815260040160405180910390fd5b604080516001600160a01b038084168252841660208201527f398baf83f237e7e1e1ce6637c69193c52e8b6382036ceb3c6eba08401e327667910160405180910390a150600880546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b6002600154141561103b5760405162461bcd60e51b81526004016106df906142c2565b60026001819055506000336001600160a01b03166316f0115b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561107e57600080fd5b505afa158015611092573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110b691906142f9565b60025460405163c673bdaf60e01b81526001600160a01b03808416600483015292935091169063c673bdaf9060240160206040518083038186803b1580156110fd57600080fd5b505afa158015611111573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111359190614316565b61115257604051633bfe162b60e01b815260040160405180910390fd5b806001600160a01b03166396aaccfe6040518163ffffffff1660e01b815260040160206040518083038186803b15801561118b57600080fd5b505afa15801561119f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111c391906142f9565b6001600160a01b0316336001600160a01b0316146111f457604051633bfe162b60e01b815260040160405180910390fd5b6000889050600080600061123d87878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061246892505050565b925092509250606060008b905060008f905060008b905060008f6001600160a01b0316636d1bb8f76040518163ffffffff1660e01b815260040160206040518083038186803b15801561128f57600080fd5b505afa1580156112a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112c791906142f9565b6040516001627dd58f60e11b0319815261ffff8a1660048201526001600160a01b03919091169063ff0454e29060240160206040518083038186803b15801561130f57600080fd5b505afa158015611323573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061134791906142f9565b6001600160a01b0380861660009081526009602052604090205491925082166113835760405163fb7566d760e01b815260040160405180910390fd5b61ffff89166000908152600a602052604090205460ff166113b75760405163334dc1fd60e01b815260040160405180910390fd5b806113d55760405163029c545360e41b815260040160405180910390fd5b6113e3338386848e88612f3d565b95505050505050610ad86040518061010001604052808e6001600160a01b031681526020018661ffff1681526020018c8152602001348152602001838152602001876001600160a01b03168152602001846001600160401b0316815260200185815250612fb5565b600260009054906101000a90046001600160a01b03166001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b15801561149957600080fd5b505afa1580156114ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114d191906142f9565b6001600160a01b0316336001600160a01b03161461150257604051634b98449160e11b815260040160405180910390fd5b6005548181141561152657604051630333a68160e41b815260040160405180910390fd5b60408051828152602081018490527f83c9ee8eed7101992146d1c75610cc54c1db740210cde12e135fa657a7850854910160405180910390a150600555565b600260009054906101000a90046001600160a01b03166001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b1580156115b357600080fd5b505afa1580156115c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115eb91906142f9565b6001600160a01b0316336001600160a01b03161461161c57604051634b98449160e11b815260040160405180910390fd5b6007546001600160401b03600160801b909104811690821681141561165457604051630333a68160e41b815260040160405180910390fd5b604080516001600160401b038084168252841660208201527fce0317145f704f138aad728eeb9d95c91260950871930acca6e659f1b0883364910160405180910390a150600780546001600160401b03909216600160801b0267ffffffffffffffff60801b19909216919091179055565b600260009054906101000a90046001600160a01b03166001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b15801561171357600080fd5b505afa158015611727573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061174b91906142f9565b6001600160a01b0316336001600160a01b03161461177c57604051634b98449160e11b815260040160405180910390fd5b6001600160a01b038216600090815260096020526040902054818114156117b657604051630333a68160e41b815260040160405180910390fd5b60408051828152602081018490526001600160a01b038516917ffa622ae921e227a42afec644139331c019f4157c54e93c82dd5f811ba210ac15910160405180910390a2506001600160a01b03909116600090815260096020526040902055565b600260009054906101000a90046001600160a01b03166001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b15801561186557600080fd5b505afa158015611879573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061189d91906142f9565b6001600160a01b0316336001600160a01b0316146118ce57604051634b98449160e11b815260040160405180910390fd5b60085460405160ff90911615808252907f0269774d3426d7e61b04b7d5129948b9f4edf9b937bb0c657fbb32a94a7996ec9060200160405180910390a16008805460ff1916911515919091179055565b600260015414156119415760405162461bcd60e51b81526004016106df906142c2565b600260015560085461ffff8a1660009081526004602090815260408083205490516001600160a01b0361010090950485169463ab8236f360e01b938f9361198b9392169101614338565b60408051601f19818403018152908290526119b392918c908c908c908c908c9060240161437e565b604051602081830303815290604052906001600160e01b0319166020820180516001600160e01b0383818316178352505050509050600080611a2a87878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061319592505050565b5090945092505050336001600160a01b0382161415611a735784611a6157604051634c3ce71f60e11b815260040160405180910390fd5b60008281526003602052604090208590555b836001600160a01b031663c0e6ac6c8e8e8e8e30896040518763ffffffff1660e01b8152600401611aa9969594939291906143e1565b600060405180830381600087803b158015611ac357600080fd5b505af1158015611ad7573d6000803e3d6000fd5b505060018055505050505050505050505050505050565b600260009054906101000a90046001600160a01b03166001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b158015611b3c57600080fd5b505afa158015611b50573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b7491906142f9565b6001600160a01b0316336001600160a01b031614611ba557604051634b98449160e11b815260040160405180910390fd5b61ffff82166000908152600460205260409020546001600160a01b03908116908216811415611be757604051630333a68160e41b815260040160405180910390fd5b6040805161ffff851681526001600160a01b03838116602083015284168183015290517fa0670378b7d4511893529175129417ed82867197a3ea18eb2743483bd4f00c2a9181900360600190a15061ffff91909116600090815260046020526040902080546001600160a01b0319166001600160a01b03909216919091179055565b60085461010090046001600160a01b03163314611c9957604051633bfe162b60e01b815260040160405180910390fd5b600c546001600160a01b0384811691161415611d2757600b60009054906101000a90046001600160a01b03166001600160a01b031663d0e30db0836040518263ffffffff1660e01b81526004016000604051808303818588803b158015611cff57600080fd5b505af1158015611d13573d6000803e3d6000fd5b5050600b546001600160a01b031695505050505b6000611d338682612968565b90506001600160a01b0381161580611d6a575061ffff87166000908152600460205260409020546001600160a01b03828116911614155b15611d8857604051637ab628f960e01b815260040160405180910390fd5b6000611d93836129cd565b905060ff811660011415611db157611dac8585856131dc565b611dc9565b60ff811660021415610c2457611dac8886868661329f565b5050505050505050565b600260009054906101000a90046001600160a01b03166001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b158015611e2157600080fd5b505afa158015611e35573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e5991906142f9565b6001600160a01b0316336001600160a01b031614611e8a57604051634b98449160e11b815260040160405180910390fd5b6007546001600160401b03908116908216811415611ebb57604051630333a68160e41b815260040160405180910390fd5b604080516001600160401b038084168252841660208201527f1701885e1db4da3ff923033aa465855dde857275866d4f132af5384aa880554f910160405180910390a1506007805467ffffffffffffffff19166001600160401b0392909216919091179055565b600260009054906101000a90046001600160a01b03166001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b158015611f7057600080fd5b505afa158015611f84573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa891906142f9565b6001600160a01b0316336001600160a01b031614611fd957604051634b98449160e11b815260040160405180910390fd5b61ffff81166000908152600a602090815260409182902054915160ff90921615808352917f0269774d3426d7e61b04b7d5129948b9f4edf9b937bb0c657fbb32a94a7996ec910160405180910390a161ffff919091166000908152600a60205260409020805460ff1916911515919091179055565b600260009054906101000a90046001600160a01b03166001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b15801561209c57600080fd5b505afa1580156120b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120d491906142f9565b6001600160a01b0316336001600160a01b03161461210557604051634b98449160e11b815260040160405180910390fd5b6007546001600160401b03600160401b909104811690821681141561213d57604051630333a68160e41b815260040160405180910390fd5b604080516001600160401b038084168252841660208201527f8dbd2ecaaca80db9e2e655edc0f1b4df2c87f441eaedf46e0b7b00358d97ad30910160405180910390a150600780546001600160401b03909216600160401b026fffffffffffffffff000000000000000019909216919091179055565b600260015414156121d65760405162461bcd60e51b81526004016106df906142c2565b6002600181905550600080600061222286868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061353492505050565b509450509350935050612234836127cd565b61225157604051637c6953f960e01b815260040160405180910390fd5b336001600160a01b0382161415612292578361228057604051634c3ce71f60e11b815260040160405180910390fd5b60008281526003602052604090208490555b61ffff8b1660009081526004602090815260408083205490516122c1926001600160a01b039092169101614338565b6040516020818303038152906040529050836001600160a01b031663cfd6528e8d8d8d8d86308f8f8f6040518a63ffffffff1660e01b815260040161230e9998979695949392919061443c565b600060405180830381600087803b15801561232857600080fd5b505af115801561233c573d6000803e3d6000fd5b5050600180555050505050505050505050505050565b600061235e600161357e565b90508015612376576000805461ff0019166101001790555b6001600160a01b03841661239d5760405163fb7566d760e01b815260040160405180910390fd5b6123a5613606565b600280546001600160a01b038087166001600160a01b031992831617909255603260065562030d406005557a0b71b000000000000b71b0000000000007a12000000000000b71b0600755600b8054868416908316179055600c8054928516929091169190911790558015612453576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b6001600160a01b03163b151590565b60008060008380602001905181019061248191906144b6565b9250925092509193909250565b604080516001600160a01b038781166020830152868116828401526060808301879052908516608083015260a08083018590528351808403909101815260c08301909352916124e3916002919060e0016144ee565b604051602081830303815290604052905095945050505050565b61252160405180606001604052806000815260200160008152602001606081525090565b60208083015161ffff1660009081526004825260408082205490519192612554926001600160a01b039092169101614338565b60408051601f19818403018152919052905060006125728282612968565b6001600160a01b0316141561259a5760405163fb7566d760e01b815260040160405180910390fd5b60405180606001604052808460c001516001600160401b031681526020018460e00151815260200160008560e00151116125ee576040805160006020820152016040516020818303038152906040526125f0565b825b905283516001600160a01b03166000908152600960205260409020549092508061262d5760405163029c545360e41b815260040160405180910390fd5b60006127106006546127106126429190614520565b86604001516126519190614537565b61265b9190614556565b6080860151600854600b54885193945091926001600160a01b036101009092048216929082169116141561271057600b546040808901519051632e1a7d4d60e01b81526001600160a01b0390921691632e1a7d4d916126c09160040190815260200190565b600060405180830381600087803b1580156126da57600080fd5b505af11580156126ee573d6000803e3d6000fd5b505050508660400151876060018181516127089190614578565b905250612745565b8651612727906001600160a01b0316826000613637565b60408701518751612745916001600160a01b03909116908390613637565b806001600160a01b0316639fbf10fc8860600151896020015187888c60a001518d604001518a8e8e8c6040518b63ffffffff1660e01b815260040161279299989796959493929190614590565b6000604051808303818588803b1580156127ab57600080fd5b505af11580156127bf573d6000803e3d6000fd5b505050505050505050505050565b600080826001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b15801561280957600080fd5b505afa15801561281d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061284191906142f9565b600254604051631a0dd00b60e01b81526001600160a01b038084166004830152929350911690631a0dd00b9060240160206040518083038186803b15801561288857600080fd5b505afa15801561289c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128c09190614316565b6128cd5750600092915050565b806001600160a01b0316636d1bb8f76040518163ffffffff1660e01b815260040160206040518083038186803b15801561290657600080fd5b505afa15801561291a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061293e91906142f9565b6001600160a01b0316836001600160a01b03161461295f5750600092915050565b50600192915050565b6000612975826014614578565b835110156129bd5760405162461bcd60e51b8152602060048201526015602482015274746f416464726573735f6f75744f66426f756e647360581b60448201526064016106df565b500160200151600160601b900490565b6000818060200190518101906129e3919061461e565b5092915050565b6000806000612a2e85858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061378292505050565b9250925092506000836001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b158015612a6f57600080fd5b505afa158015612a83573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612aa791906142f9565b9050612abe6001600160a01b038216846000613637565b612ad26001600160a01b0382168489613637565b604051636455bf6f60e01b815260048101839052602481018890526001600160a01b03841690636455bf6f90604401602060405180830381600087803b158015612b1b57600080fd5b505af1158015612b2f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dc991906146b0565b600080600080600080612b9b88888080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061353492505050565b9550955095509550955095506000600860019054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015612bf757600080fd5b505afa158015612c0b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c2f91906142f9565b6001600160a01b031663068bcd8d856040518263ffffffff1660e01b8152600401612c5c91815260200190565b60206040518083038186803b158015612c7457600080fd5b505afa158015612c88573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612cac91906142f9565b6001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b158015612ce457600080fd5b505afa158015612cf8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d1c91906142f9565b600c549091506001600160a01b0380831691161415612d435750600b546001600160a01b03165b612dc085876001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b158015612d8057600080fd5b505afa158015612d94573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612db891906142f9565b838d866137b4565b995060008b90506127bf604051806101000160405280846001600160a01b031681526020018361ffff1681526020018d8152602001600260009054906101000a90046001600160a01b03166001600160a01b031663c6bbd5a76040518163ffffffff1660e01b815260040160206040518083038186803b158015612e4357600080fd5b505afa158015612e57573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e7b91906142f9565b60405163d81e47d360e01b815261ffff861660048201526001600160a01b03919091169063d81e47d39060240160206040518083038186803b158015612ec057600080fd5b505afa158015612ed4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ef891906146b0565b8152602001612f078b8a613927565b81526001600160a01b0387166020820152600754600160801b90046001600160401b0316604082015260006060909101526124fd565b604080516001600160a01b0388811660208301528781168284015260608083018890526080830187905290851660a083015260c08083018590528351808403909101815260e0830190935291612f9a9160019190610100016144ee565b60405160208183030381529060405290509695505050505050565b60208082015161ffff166000908152600490915260409020546001600160a01b031680612ff55760405163fb7566d760e01b815260040160405180910390fd5b600060028360c001516001600160401b03166005546130149190614578565b60e085015180613025576000613027565b845b604051602001613071949392919060f09490941b6001600160f01b03191684526002840192909252602283015260601b6bffffffffffffffffffffffff1916604282015260560190565b604051602081830303815290604052905082600001516001600160a01b0316636d1bb8f76040518163ffffffff1660e01b815260040160206040518083038186803b1580156130bf57600080fd5b505afa1580156130d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130f791906142f9565b6001600160a01b031663e7f0c59f8460600151308660200151866040516020016131219190614338565b60408051601f19818403018152828252908a015160808b015160c08c015160a08d01516001600160e01b031960e08b901b1686526131689796956000908d906004016146c9565b6000604051808303818588803b15801561318157600080fd5b505af1158015611dc9573d6000803e3d6000fd5b6000806000806000858060200190518101906131b1919061461e565b80519097506131ca915087016020908101908801614747565b939a9299509097509550909350915050565b6000806131e883613978565b90925090506132026001600160a01b038616836000613637565b6132166001600160a01b0386168386613637565b6040516320159ddd60e21b815260048101829052602481018590526001600160a01b03831690638056777490604401602060405180830381600087803b15801561325f57600080fd5b505af1158015613273573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061329791906146b0565b505050505050565b60008060008060006132b086613195565b945094509450945094506000846001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b1580156132f557600080fd5b505afa158015613309573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061332d91906142f9565b905061333c848a838b866137b4565b6040516001627dd58f60e11b0319815261ffff8c1660048201529098508a906000906001600160a01b0388169063ff0454e29060240160206040518083038186803b15801561338a57600080fd5b505afa15801561339e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133c291906142f9565b90506127bf604051806101000160405280856001600160a01b031681526020018461ffff1681526020018c8152602001600260009054906101000a90046001600160a01b03166001600160a01b031663c6bbd5a76040518163ffffffff1660e01b815260040160206040518083038186803b15801561344057600080fd5b505afa158015613454573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061347891906142f9565b60405163665471cd60e11b815261ffff871660048201526001600160a01b03919091169063cca8e39a9060240160206040518083038186803b1580156134bd57600080fd5b505afa1580156134d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906134f591906146b0565b8152602001613505848c8b6139b1565b81526001600160a01b03881660208201526007546001600160401b031660408201526000606090910152612fb5565b60008060008060008086806020019051810190613551919061461e565b805190985061356a9150880160209081019089016147a8565b949c939b5091995097509550909350915050565b60008054610100900460ff16156135c5578160ff1660011480156135a15750303b155b6135bd5760405162461bcd60e51b81526004016106df90614812565b506000919050565b60005460ff8084169116106135ec5760405162461bcd60e51b81526004016106df90614812565b506000805460ff191660ff92909216919091179055600190565b600054610100900460ff1661362d5760405162461bcd60e51b81526004016106df90614860565b613635613a0d565b565b8015806136c05750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b15801561368657600080fd5b505afa15801561369a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136be91906146b0565b155b61372b5760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b60648201526084016106df565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b17905261377d908490613a3a565b505050565b60008060008380602001905181019061379b919061461e565b80519095506124819150850160209081019086016148ab565b60008581526003602052604081205480156137dc576000878152600360205260408120559150815b60025460408051632b3297f960e01b815290516000926001600160a01b031691632b3297f9916004808301926020929190829003018186803b15801561382157600080fd5b505afa158015613835573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061385991906142f9565b90506138706001600160a01b038816826000613637565b6138846001600160a01b0388168287613637565b604051636ccb2b0160e01b81526001600160a01b03888116600483015287811660248301526044820187905260648201869052306084830152821690636ccb2b019060a401602060405180830381600087803b1580156138e357600080fd5b505af11580156138f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061391b91906146b0565b98975050505050505050565b604080516001600160a01b0384166020820152808201839052815180820383018152606080830190935261396191600191906080016144ee565b604051602081830303815290604052905092915050565b6000808280602001905181019061398f919061461e565b80519094506139a89150840160209081019085016148ee565b91509150915091565b604080516001600160a01b038581166020830152841681830152606080820184905282518083038201815260808301909352916139f4916002919060a0016144ee565b60405160208183030381529060405290505b9392505050565b600054610100900460ff16613a345760405162461bcd60e51b81526004016106df90614860565b60018055565b6000613a8f826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316613b0c9092919063ffffffff16565b80519091501561377d5780806020019051810190613aad9190614316565b61377d5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016106df565b6060613b1b8484600085613b23565b949350505050565b606082471015613b845760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016106df565b6001600160a01b0385163b613bdb5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016106df565b600080866001600160a01b03168587604051613bf7919061491c565b60006040518083038185875af1925050503d8060008114613c34576040519150601f19603f3d011682016040523d82523d6000602084013e613c39565b606091505b5091509150613c49828286613c54565b979650505050505050565b60608315613c63575081613a06565b825115613c735782518084602001fd5b8160405162461bcd60e51b81526004016106df91906142af565b6001600160a01b0381168114613ca257600080fd5b50565b60008083601f840112613cb757600080fd5b5081356001600160401b03811115613cce57600080fd5b602083019150836020828501011115613ce657600080fd5b9250929050565b60008060008060008060008060e0898b031215613d0957600080fd5b883597506020890135613d1b81613c8d565b96506040890135613d2b81613c8d565b95506060890135613d3b81613c8d565b94506080890135935060a0890135925060c08901356001600160401b03811115613d6457600080fd5b613d708b828c01613ca5565b999c989b5096995094979396929594505050565b61ffff81168114613ca257600080fd5b6001600160401b0381168114613ca257600080fd5b600080600080600080600080600060c08a8c031215613dc757600080fd5b8935613dd281613d84565b985060208a01356001600160401b0380821115613dee57600080fd5b613dfa8d838e01613ca5565b909a50985060408c01359150613e0f82613d94565b90965060608b01359080821115613e2557600080fd5b613e318d838e01613ca5565b909750955060808c0135945060a08c0135915080821115613e5157600080fd5b50613e5e8c828d01613ca5565b915080935050809150509295985092959850929598565b600060208284031215613e8757600080fd5b5035919050565b600060208284031215613ea057600080fd5b8135613a0681613d94565b600060208284031215613ebd57600080fd5b8135613a0681613c8d565b60008060408385031215613edb57600080fd5b8235613ee681613c8d565b946020939093013593505050565b600080600080600080600080600060e08a8c031215613f1257600080fd5b8935613f1d81613d84565b985060208a01356001600160401b0380821115613f3957600080fd5b613f458d838e01613ca5565b909a50985060408c01359150613f5a82613d94565b90965060608b013590613f6c82613c8d565b90955060808b0135945060a08b01359080821115613f8957600080fd5b50613f968c828d01613ca5565b9a9d999c50979a9699959894979660c00135949350505050565b60008060408385031215613fc357600080fd5b8235613fce81613d84565b91506020830135613fde81613c8d565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561402757614027613fe9565b604052919050565b60006001600160401b0382111561404857614048613fe9565b50601f01601f191660200190565b600082601f83011261406757600080fd5b813561407a6140758261402f565b613fff565b81815284602083860101111561408f57600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060008060c087890312156140c557600080fd5b86356140d081613d84565b955060208701356001600160401b03808211156140ec57600080fd5b6140f88a838b01614056565b9650604089013595506060890135915061411182613c8d565b9093506080880135925060a0880135908082111561412e57600080fd5b5061413b89828a01614056565b9150509295509295509295565b60006020828403121561415a57600080fd5b8135613a0681613d84565b60008060008060008060008060c0898b03121561418157600080fd5b883561418c81613d84565b975060208901356001600160401b03808211156141a857600080fd5b6141b48c838d01613ca5565b909950975060408b013591506141c982613d94565b90955060608a0135945060808a013590808211156141e657600080fd5b506141f38b828c01613ca5565b999c989b50969995989497949560a00135949350505050565b60008060006060848603121561422157600080fd5b833561422c81613c8d565b9250602084013561423c81613c8d565b9150604084013561424c81613c8d565b809150509250925092565b60005b8381101561427257818101518382015260200161425a565b838111156124535750506000910152565b6000815180845261429b816020860160208601614257565b601f01601f19169290920160200192915050565b602081526000613a066020830184614283565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60006020828403121561430b57600080fd5b8151613a0681613c8d565b60006020828403121561432857600080fd5b81518015158114613a0657600080fd5b60609190911b6bffffffffffffffffffffffff1916815260140190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b61ffff8816815260c06020820152600061439b60c0830189614283565b6001600160401b03881660408401526001600160a01b03871660608401526080830186905282810360a08401526143d3818587614355565b9a9950505050505050505050565b61ffff8716815260a0602082015260006143ff60a083018789614355565b6001600160401b03861660408401526001600160a01b0385166060840152828103608084015261442f8185614283565b9998505050505050505050565b61ffff8a16815260e06020820152600061445a60e083018a8c614355565b6001600160401b0389166040840152828103606084015261447b8189614283565b6001600160a01b038816608085015260a0840187905283810360c085015290506144a6818587614355565b9c9b505050505050505050505050565b6000806000606084860312156144cb57600080fd5b83516144d681613d84565b60208501516040860151919450925061424c81613d94565b60ff83168152604060208201526000613b1b6040830184614283565b634e487b7160e01b600052601160045260246000fd5b6000828210156145325761453261450a565b500390565b60008160001904831182151516156145515761455161450a565b500290565b60008261457357634e487b7160e01b600052601260045260246000fd5b500490565b6000821982111561458b5761458b61450a565b500190565b600061012061ffff8c1683528a602084015289604084015260018060a01b03891660608401528760808401528660a08401528060c0840152855181840152506020850151610140830152604085015160606101608401526145f5610180840182614283565b905082810360e08401526146098186614283565b90508281036101008401526144a68185614283565b6000806040838503121561463157600080fd5b825160ff8116811461464257600080fd5b60208401519092506001600160401b0381111561465e57600080fd5b8301601f8101851361466f57600080fd5b805161467d6140758261402f565b81815286602083850101111561469257600080fd5b6146a3826020830160208601614257565b8093505050509250929050565b6000602082840312156146c257600080fd5b5051919050565b6001600160a01b038a8116825261ffff8a166020830152610120604083018190526000916146f98483018c614283565b91508960608501528382036080850152614713828a614283565b6001600160401b03891660a086015287821660c086015290861660e085015283810361010085015290506144a68185614283565b600080600080600060a0868803121561475f57600080fd5b855161476a81613c8d565b602087015190955061477b81613c8d565b60408701516060880151919550935061479381613c8d565b80925050608086015190509295509295909350565b60008060008060008060c087890312156147c157600080fd5b86516147cc81613c8d565b60208801519096506147dd81613c8d565b80955050604087015193506060870151925060808701516147fd81613c8d565b8092505060a087015190509295509295509295565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6000806000606084860312156148c057600080fd5b83516148cb81613c8d565b60208501519093506148dc81613c8d565b80925050604084015190509250925092565b6000806040838503121561490157600080fd5b825161490c81613c8d565b6020939093015192949293505050565b6000825161492e818460208701614257565b919091019291505056fea264697066735822122007f55616bd1062d673137a0ef2561584d4b67250440180d783da3b45dfcd90d464736f6c63430008090033496e697469616c697a61626c653a20636f6e747261637420697320616c726561", - "deployedBytecode": "0x6080604052600436106101fc5760003560e01c80638a9cadaf1161010d578063b71b42ec116100a0578063dfda255f1161006f578063dfda255f146105ca578063e3499aa414610600578063e3d47ece14610630578063e7f4c16b14610657578063ffa1ad741461067e57600080fd5b8063b71b42ec1461054a578063b9d817201461056a578063c0c53b8b1461057d578063d89921cb1461059d57600080fd5b8063ab8236f3116100dc578063ab8236f3146104ca578063ac18fce6146104ea578063afcff50f1461050a578063b2d083c11461052a57600080fd5b80638a9cadaf1461044a5780638ece68571461045d578063a761f5f01461047d578063ab4193e21461049d57600080fd5b80633413f1c1116101905780636a46aa381161015f5780636a46aa38146103bf5780636c77d24f146103df5780636e406753146103f55780637b7305d314610415578063833667df1461043557600080fd5b80633413f1c11461034857806339f648bf1461036c5780633fc8cef31461037f57806362491b351461039f57600080fd5b80631e492d56116101cc5780631e492d56146102a15780632b80cc52146102c15780632e369cf2146102eb5780633352b6081461030b57600080fd5b8062bc9db9146102085780630b211f0f1461021d578063147a7d71146102615780631a607f9a1461028157600080fd5b3661020357005b600080fd5b61021b610216366004613ced565b6106bc565b005b34801561022957600080fd5b5060075461024490600160801b90046001600160401b031681565b6040516001600160401b0390911681526020015b60405180910390f35b34801561026d57600080fd5b5061021b61027c366004613da9565b610aec565b34801561028d57600080fd5b5061021b61029c366004613e75565b610c4a565b3480156102ad57600080fd5b5061021b6102bc366004613e8e565b610d64565b3480156102cd57600080fd5b506008546102db9060ff1681565b6040519015158152602001610258565b3480156102f757600080fd5b5061021b610306366004613eab565b610ebf565b34801561031757600080fd5b506008546103309061010090046001600160a01b031681565b6040516001600160a01b039091168152602001610258565b34801561035457600080fd5b5061035e60065481565b604051908152602001610258565b61021b61037a366004613ced565b611018565b34801561038b57600080fd5b50600b54610330906001600160a01b031681565b3480156103ab57600080fd5b50600754610244906001600160401b031681565b3480156103cb57600080fd5b5061021b6103da366004613e75565b61144b565b3480156103eb57600080fd5b5061035e60055481565b34801561040157600080fd5b5061021b610410366004613e8e565b611565565b34801561042157600080fd5b5061021b610430366004613ec8565b6116c5565b34801561044157600080fd5b5061021b611817565b61021b610458366004613ef4565b61191e565b34801561046957600080fd5b5061021b610478366004613fb0565b611aee565b34801561048957600080fd5b50600c54610330906001600160a01b031681565b3480156104a957600080fd5b5061035e6104b8366004613e75565b60036020526000908152604090205481565b3480156104d657600080fd5b5061021b6104e53660046140ac565b611c69565b3480156104f657600080fd5b5061021b610505366004613e8e565b611dd3565b34801561051657600080fd5b50600254610330906001600160a01b031681565b34801561053657600080fd5b5061021b610545366004614148565b611f22565b34801561055657600080fd5b5061021b610565366004613e8e565b61204e565b61021b610578366004614165565b6121b3565b34801561058957600080fd5b5061021b61059836600461420c565b612352565b3480156105a957600080fd5b5061035e6105b8366004613eab565b60096020526000908152604090205481565b3480156105d657600080fd5b506103306105e5366004614148565b6004602052600090815260409020546001600160a01b031681565b34801561060c57600080fd5b506102db61061b366004614148565b600a6020526000908152604090205460ff1681565b34801561063c57600080fd5b5060075461024490600160c01b90046001600160401b031681565b34801561066357600080fd5b5060075461024490600160401b90046001600160401b031681565b34801561068a57600080fd5b506106af604051806040016040528060058152602001640312e332e360dc1b81525081565b60405161025891906142af565b600260015414156106e85760405162461bcd60e51b81526004016106df906142c2565b60405180910390fd5b60026001819055506000336001600160a01b03166316f0115b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561072b57600080fd5b505afa15801561073f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061076391906142f9565b60025460405163c673bdaf60e01b81526001600160a01b03808416600483015292935091169063c673bdaf9060240160206040518083038186803b1580156107aa57600080fd5b505afa1580156107be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107e29190614316565b6107ff57604051633bfe162b60e01b815260040160405180910390fd5b806001600160a01b03166396aaccfe6040518163ffffffff1660e01b815260040160206040518083038186803b15801561083857600080fd5b505afa15801561084c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061087091906142f9565b6001600160a01b0316336001600160a01b0316146108a157604051633bfe162b60e01b815260040160405180910390fd5b60085460ff166108c457604051635621fccf60e01b815260040160405180910390fd5b6000889050600080600061090d87878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061246892505050565b925092509250606060008b6001600160a01b0316636d1bb8f76040518163ffffffff1660e01b815260040160206040518083038186803b15801561095057600080fd5b505afa158015610964573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061098891906142f9565b6040516001627dd58f60e11b0319815261ffff871660048201526001600160a01b03919091169063ff0454e29060240160206040518083038186803b1580156109d057600080fd5b505afa1580156109e4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a0891906142f9565b90506001600160a01b038116610a315760405163fb7566d760e01b815260040160405180910390fd5b61ffff85166000908152600a602052604090205460ff16610a655760405163334dc1fd60e01b815260040160405180910390fd5b8e610a733383838a8f61248e565b92505050610ad86040518061010001604052808e6001600160a01b031681526020018661ffff1681526020018c8152602001348152602001838152602001876001600160a01b03168152602001846001600160401b03168152602001858152506124fd565b505060018055505050505050505050505050565b610af5336127cd565b610b1257604051633bfe162b60e01b815260040160405180910390fd5b6000610b58600087878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092939250506129689050565b90506001600160a01b0381161580610b8f575061ffff8a166000908152600460205260409020546001600160a01b03828116911614155b15610bad57604051637ab628f960e01b815260040160405180910390fd5b6000610bee84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506129cd92505050565b905060ff811660021415610c0c57610c078585856129ea565b610c3d565b60ff811660011415610c2457610c078b868686612b53565b604051630ead561960e11b815260040160405180910390fd5b5050505050505050505050565b600260009054906101000a90046001600160a01b03166001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b158015610c9857600080fd5b505afa158015610cac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cd091906142f9565b6001600160a01b0316336001600160a01b031614610d0157604051634b98449160e11b815260040160405180910390fd5b60065481811415610d2557604051630333a68160e41b815260040160405180910390fd5b60408051828152602081018490527f5cac1093ddd8c1e9cbcd89b2f36fa1889e966cc257753af2d160888564fd9818910160405180910390a150600655565b600260009054906101000a90046001600160a01b03166001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b158015610db257600080fd5b505afa158015610dc6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dea91906142f9565b6001600160a01b0316336001600160a01b031614610e1b57604051634b98449160e11b815260040160405180910390fd5b6007546001600160401b03600160c01b9091048116908216811415610e5357604051630333a68160e41b815260040160405180910390fd5b604080516001600160401b038084168252841660208201527f7dd9d7c71da5859a7d6e34c00f4889cb529dbbc009a358db124855baa125a4dc910160405180910390a150600780546001600160401b03909216600160c01b026001600160c01b03909216919091179055565b600260009054906101000a90046001600160a01b03166001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b158015610f0d57600080fd5b505afa158015610f21573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f4591906142f9565b6001600160a01b0316336001600160a01b031614610f7657604051634b98449160e11b815260040160405180910390fd5b6008546001600160a01b036101009091048116908216811415610fac57604051630333a68160e41b815260040160405180910390fd5b604080516001600160a01b038084168252841660208201527f398baf83f237e7e1e1ce6637c69193c52e8b6382036ceb3c6eba08401e327667910160405180910390a150600880546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b6002600154141561103b5760405162461bcd60e51b81526004016106df906142c2565b60026001819055506000336001600160a01b03166316f0115b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561107e57600080fd5b505afa158015611092573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110b691906142f9565b60025460405163c673bdaf60e01b81526001600160a01b03808416600483015292935091169063c673bdaf9060240160206040518083038186803b1580156110fd57600080fd5b505afa158015611111573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111359190614316565b61115257604051633bfe162b60e01b815260040160405180910390fd5b806001600160a01b03166396aaccfe6040518163ffffffff1660e01b815260040160206040518083038186803b15801561118b57600080fd5b505afa15801561119f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111c391906142f9565b6001600160a01b0316336001600160a01b0316146111f457604051633bfe162b60e01b815260040160405180910390fd5b6000889050600080600061123d87878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061246892505050565b925092509250606060008b905060008f905060008b905060008f6001600160a01b0316636d1bb8f76040518163ffffffff1660e01b815260040160206040518083038186803b15801561128f57600080fd5b505afa1580156112a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112c791906142f9565b6040516001627dd58f60e11b0319815261ffff8a1660048201526001600160a01b03919091169063ff0454e29060240160206040518083038186803b15801561130f57600080fd5b505afa158015611323573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061134791906142f9565b6001600160a01b0380861660009081526009602052604090205491925082166113835760405163fb7566d760e01b815260040160405180910390fd5b61ffff89166000908152600a602052604090205460ff166113b75760405163334dc1fd60e01b815260040160405180910390fd5b806113d55760405163029c545360e41b815260040160405180910390fd5b6113e3338386848e88612f3d565b95505050505050610ad86040518061010001604052808e6001600160a01b031681526020018661ffff1681526020018c8152602001348152602001838152602001876001600160a01b03168152602001846001600160401b0316815260200185815250612fb5565b600260009054906101000a90046001600160a01b03166001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b15801561149957600080fd5b505afa1580156114ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114d191906142f9565b6001600160a01b0316336001600160a01b03161461150257604051634b98449160e11b815260040160405180910390fd5b6005548181141561152657604051630333a68160e41b815260040160405180910390fd5b60408051828152602081018490527f83c9ee8eed7101992146d1c75610cc54c1db740210cde12e135fa657a7850854910160405180910390a150600555565b600260009054906101000a90046001600160a01b03166001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b1580156115b357600080fd5b505afa1580156115c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115eb91906142f9565b6001600160a01b0316336001600160a01b03161461161c57604051634b98449160e11b815260040160405180910390fd5b6007546001600160401b03600160801b909104811690821681141561165457604051630333a68160e41b815260040160405180910390fd5b604080516001600160401b038084168252841660208201527fce0317145f704f138aad728eeb9d95c91260950871930acca6e659f1b0883364910160405180910390a150600780546001600160401b03909216600160801b0267ffffffffffffffff60801b19909216919091179055565b600260009054906101000a90046001600160a01b03166001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b15801561171357600080fd5b505afa158015611727573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061174b91906142f9565b6001600160a01b0316336001600160a01b03161461177c57604051634b98449160e11b815260040160405180910390fd5b6001600160a01b038216600090815260096020526040902054818114156117b657604051630333a68160e41b815260040160405180910390fd5b60408051828152602081018490526001600160a01b038516917ffa622ae921e227a42afec644139331c019f4157c54e93c82dd5f811ba210ac15910160405180910390a2506001600160a01b03909116600090815260096020526040902055565b600260009054906101000a90046001600160a01b03166001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b15801561186557600080fd5b505afa158015611879573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061189d91906142f9565b6001600160a01b0316336001600160a01b0316146118ce57604051634b98449160e11b815260040160405180910390fd5b60085460405160ff90911615808252907f0269774d3426d7e61b04b7d5129948b9f4edf9b937bb0c657fbb32a94a7996ec9060200160405180910390a16008805460ff1916911515919091179055565b600260015414156119415760405162461bcd60e51b81526004016106df906142c2565b600260015560085461ffff8a1660009081526004602090815260408083205490516001600160a01b0361010090950485169463ab8236f360e01b938f9361198b9392169101614338565b60408051601f19818403018152908290526119b392918c908c908c908c908c9060240161437e565b604051602081830303815290604052906001600160e01b0319166020820180516001600160e01b0383818316178352505050509050600080611a2a87878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061319592505050565b5090945092505050336001600160a01b0382161415611a735784611a6157604051634c3ce71f60e11b815260040160405180910390fd5b60008281526003602052604090208590555b836001600160a01b031663c0e6ac6c8e8e8e8e30896040518763ffffffff1660e01b8152600401611aa9969594939291906143e1565b600060405180830381600087803b158015611ac357600080fd5b505af1158015611ad7573d6000803e3d6000fd5b505060018055505050505050505050505050505050565b600260009054906101000a90046001600160a01b03166001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b158015611b3c57600080fd5b505afa158015611b50573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b7491906142f9565b6001600160a01b0316336001600160a01b031614611ba557604051634b98449160e11b815260040160405180910390fd5b61ffff82166000908152600460205260409020546001600160a01b03908116908216811415611be757604051630333a68160e41b815260040160405180910390fd5b6040805161ffff851681526001600160a01b03838116602083015284168183015290517fa0670378b7d4511893529175129417ed82867197a3ea18eb2743483bd4f00c2a9181900360600190a15061ffff91909116600090815260046020526040902080546001600160a01b0319166001600160a01b03909216919091179055565b60085461010090046001600160a01b03163314611c9957604051633bfe162b60e01b815260040160405180910390fd5b600c546001600160a01b0384811691161415611d2757600b60009054906101000a90046001600160a01b03166001600160a01b031663d0e30db0836040518263ffffffff1660e01b81526004016000604051808303818588803b158015611cff57600080fd5b505af1158015611d13573d6000803e3d6000fd5b5050600b546001600160a01b031695505050505b6000611d338682612968565b90506001600160a01b0381161580611d6a575061ffff87166000908152600460205260409020546001600160a01b03828116911614155b15611d8857604051637ab628f960e01b815260040160405180910390fd5b6000611d93836129cd565b905060ff811660011415611db157611dac8585856131dc565b611dc9565b60ff811660021415610c2457611dac8886868661329f565b5050505050505050565b600260009054906101000a90046001600160a01b03166001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b158015611e2157600080fd5b505afa158015611e35573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e5991906142f9565b6001600160a01b0316336001600160a01b031614611e8a57604051634b98449160e11b815260040160405180910390fd5b6007546001600160401b03908116908216811415611ebb57604051630333a68160e41b815260040160405180910390fd5b604080516001600160401b038084168252841660208201527f1701885e1db4da3ff923033aa465855dde857275866d4f132af5384aa880554f910160405180910390a1506007805467ffffffffffffffff19166001600160401b0392909216919091179055565b600260009054906101000a90046001600160a01b03166001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b158015611f7057600080fd5b505afa158015611f84573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa891906142f9565b6001600160a01b0316336001600160a01b031614611fd957604051634b98449160e11b815260040160405180910390fd5b61ffff81166000908152600a602090815260409182902054915160ff90921615808352917f0269774d3426d7e61b04b7d5129948b9f4edf9b937bb0c657fbb32a94a7996ec910160405180910390a161ffff919091166000908152600a60205260409020805460ff1916911515919091179055565b600260009054906101000a90046001600160a01b03166001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b15801561209c57600080fd5b505afa1580156120b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120d491906142f9565b6001600160a01b0316336001600160a01b03161461210557604051634b98449160e11b815260040160405180910390fd5b6007546001600160401b03600160401b909104811690821681141561213d57604051630333a68160e41b815260040160405180910390fd5b604080516001600160401b038084168252841660208201527f8dbd2ecaaca80db9e2e655edc0f1b4df2c87f441eaedf46e0b7b00358d97ad30910160405180910390a150600780546001600160401b03909216600160401b026fffffffffffffffff000000000000000019909216919091179055565b600260015414156121d65760405162461bcd60e51b81526004016106df906142c2565b6002600181905550600080600061222286868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061353492505050565b509450509350935050612234836127cd565b61225157604051637c6953f960e01b815260040160405180910390fd5b336001600160a01b0382161415612292578361228057604051634c3ce71f60e11b815260040160405180910390fd5b60008281526003602052604090208490555b61ffff8b1660009081526004602090815260408083205490516122c1926001600160a01b039092169101614338565b6040516020818303038152906040529050836001600160a01b031663cfd6528e8d8d8d8d86308f8f8f6040518a63ffffffff1660e01b815260040161230e9998979695949392919061443c565b600060405180830381600087803b15801561232857600080fd5b505af115801561233c573d6000803e3d6000fd5b5050600180555050505050505050505050505050565b600061235e600161357e565b90508015612376576000805461ff0019166101001790555b6001600160a01b03841661239d5760405163fb7566d760e01b815260040160405180910390fd5b6123a5613606565b600280546001600160a01b038087166001600160a01b031992831617909255603260065562030d406005557a0b71b000000000000b71b0000000000007a12000000000000b71b0600755600b8054868416908316179055600c8054928516929091169190911790558015612453576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b6001600160a01b03163b151590565b60008060008380602001905181019061248191906144b6565b9250925092509193909250565b604080516001600160a01b038781166020830152868116828401526060808301879052908516608083015260a08083018590528351808403909101815260c08301909352916124e3916002919060e0016144ee565b604051602081830303815290604052905095945050505050565b61252160405180606001604052806000815260200160008152602001606081525090565b60208083015161ffff1660009081526004825260408082205490519192612554926001600160a01b039092169101614338565b60408051601f19818403018152919052905060006125728282612968565b6001600160a01b0316141561259a5760405163fb7566d760e01b815260040160405180910390fd5b60405180606001604052808460c001516001600160401b031681526020018460e00151815260200160008560e00151116125ee576040805160006020820152016040516020818303038152906040526125f0565b825b905283516001600160a01b03166000908152600960205260409020549092508061262d5760405163029c545360e41b815260040160405180910390fd5b60006127106006546127106126429190614520565b86604001516126519190614537565b61265b9190614556565b6080860151600854600b54885193945091926001600160a01b036101009092048216929082169116141561271057600b546040808901519051632e1a7d4d60e01b81526001600160a01b0390921691632e1a7d4d916126c09160040190815260200190565b600060405180830381600087803b1580156126da57600080fd5b505af11580156126ee573d6000803e3d6000fd5b505050508660400151876060018181516127089190614578565b905250612745565b8651612727906001600160a01b0316826000613637565b60408701518751612745916001600160a01b03909116908390613637565b806001600160a01b0316639fbf10fc8860600151896020015187888c60a001518d604001518a8e8e8c6040518b63ffffffff1660e01b815260040161279299989796959493929190614590565b6000604051808303818588803b1580156127ab57600080fd5b505af11580156127bf573d6000803e3d6000fd5b505050505050505050505050565b600080826001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b15801561280957600080fd5b505afa15801561281d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061284191906142f9565b600254604051631a0dd00b60e01b81526001600160a01b038084166004830152929350911690631a0dd00b9060240160206040518083038186803b15801561288857600080fd5b505afa15801561289c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128c09190614316565b6128cd5750600092915050565b806001600160a01b0316636d1bb8f76040518163ffffffff1660e01b815260040160206040518083038186803b15801561290657600080fd5b505afa15801561291a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061293e91906142f9565b6001600160a01b0316836001600160a01b03161461295f5750600092915050565b50600192915050565b6000612975826014614578565b835110156129bd5760405162461bcd60e51b8152602060048201526015602482015274746f416464726573735f6f75744f66426f756e647360581b60448201526064016106df565b500160200151600160601b900490565b6000818060200190518101906129e3919061461e565b5092915050565b6000806000612a2e85858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061378292505050565b9250925092506000836001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b158015612a6f57600080fd5b505afa158015612a83573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612aa791906142f9565b9050612abe6001600160a01b038216846000613637565b612ad26001600160a01b0382168489613637565b604051636455bf6f60e01b815260048101839052602481018890526001600160a01b03841690636455bf6f90604401602060405180830381600087803b158015612b1b57600080fd5b505af1158015612b2f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dc991906146b0565b600080600080600080612b9b88888080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061353492505050565b9550955095509550955095506000600860019054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015612bf757600080fd5b505afa158015612c0b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c2f91906142f9565b6001600160a01b031663068bcd8d856040518263ffffffff1660e01b8152600401612c5c91815260200190565b60206040518083038186803b158015612c7457600080fd5b505afa158015612c88573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612cac91906142f9565b6001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b158015612ce457600080fd5b505afa158015612cf8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d1c91906142f9565b600c549091506001600160a01b0380831691161415612d435750600b546001600160a01b03165b612dc085876001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b158015612d8057600080fd5b505afa158015612d94573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612db891906142f9565b838d866137b4565b995060008b90506127bf604051806101000160405280846001600160a01b031681526020018361ffff1681526020018d8152602001600260009054906101000a90046001600160a01b03166001600160a01b031663c6bbd5a76040518163ffffffff1660e01b815260040160206040518083038186803b158015612e4357600080fd5b505afa158015612e57573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e7b91906142f9565b60405163d81e47d360e01b815261ffff861660048201526001600160a01b03919091169063d81e47d39060240160206040518083038186803b158015612ec057600080fd5b505afa158015612ed4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ef891906146b0565b8152602001612f078b8a613927565b81526001600160a01b0387166020820152600754600160801b90046001600160401b0316604082015260006060909101526124fd565b604080516001600160a01b0388811660208301528781168284015260608083018890526080830187905290851660a083015260c08083018590528351808403909101815260e0830190935291612f9a9160019190610100016144ee565b60405160208183030381529060405290509695505050505050565b60208082015161ffff166000908152600490915260409020546001600160a01b031680612ff55760405163fb7566d760e01b815260040160405180910390fd5b600060028360c001516001600160401b03166005546130149190614578565b60e085015180613025576000613027565b845b604051602001613071949392919060f09490941b6001600160f01b03191684526002840192909252602283015260601b6bffffffffffffffffffffffff1916604282015260560190565b604051602081830303815290604052905082600001516001600160a01b0316636d1bb8f76040518163ffffffff1660e01b815260040160206040518083038186803b1580156130bf57600080fd5b505afa1580156130d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130f791906142f9565b6001600160a01b031663e7f0c59f8460600151308660200151866040516020016131219190614338565b60408051601f19818403018152828252908a015160808b015160c08c015160a08d01516001600160e01b031960e08b901b1686526131689796956000908d906004016146c9565b6000604051808303818588803b15801561318157600080fd5b505af1158015611dc9573d6000803e3d6000fd5b6000806000806000858060200190518101906131b1919061461e565b80519097506131ca915087016020908101908801614747565b939a9299509097509550909350915050565b6000806131e883613978565b90925090506132026001600160a01b038616836000613637565b6132166001600160a01b0386168386613637565b6040516320159ddd60e21b815260048101829052602481018590526001600160a01b03831690638056777490604401602060405180830381600087803b15801561325f57600080fd5b505af1158015613273573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061329791906146b0565b505050505050565b60008060008060006132b086613195565b945094509450945094506000846001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b1580156132f557600080fd5b505afa158015613309573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061332d91906142f9565b905061333c848a838b866137b4565b6040516001627dd58f60e11b0319815261ffff8c1660048201529098508a906000906001600160a01b0388169063ff0454e29060240160206040518083038186803b15801561338a57600080fd5b505afa15801561339e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133c291906142f9565b90506127bf604051806101000160405280856001600160a01b031681526020018461ffff1681526020018c8152602001600260009054906101000a90046001600160a01b03166001600160a01b031663c6bbd5a76040518163ffffffff1660e01b815260040160206040518083038186803b15801561344057600080fd5b505afa158015613454573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061347891906142f9565b60405163665471cd60e11b815261ffff871660048201526001600160a01b03919091169063cca8e39a9060240160206040518083038186803b1580156134bd57600080fd5b505afa1580156134d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906134f591906146b0565b8152602001613505848c8b6139b1565b81526001600160a01b03881660208201526007546001600160401b031660408201526000606090910152612fb5565b60008060008060008086806020019051810190613551919061461e565b805190985061356a9150880160209081019089016147a8565b949c939b5091995097509550909350915050565b60008054610100900460ff16156135c5578160ff1660011480156135a15750303b155b6135bd5760405162461bcd60e51b81526004016106df90614812565b506000919050565b60005460ff8084169116106135ec5760405162461bcd60e51b81526004016106df90614812565b506000805460ff191660ff92909216919091179055600190565b600054610100900460ff1661362d5760405162461bcd60e51b81526004016106df90614860565b613635613a0d565b565b8015806136c05750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b15801561368657600080fd5b505afa15801561369a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136be91906146b0565b155b61372b5760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b60648201526084016106df565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b17905261377d908490613a3a565b505050565b60008060008380602001905181019061379b919061461e565b80519095506124819150850160209081019086016148ab565b60008581526003602052604081205480156137dc576000878152600360205260408120559150815b60025460408051632b3297f960e01b815290516000926001600160a01b031691632b3297f9916004808301926020929190829003018186803b15801561382157600080fd5b505afa158015613835573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061385991906142f9565b90506138706001600160a01b038816826000613637565b6138846001600160a01b0388168287613637565b604051636ccb2b0160e01b81526001600160a01b03888116600483015287811660248301526044820187905260648201869052306084830152821690636ccb2b019060a401602060405180830381600087803b1580156138e357600080fd5b505af11580156138f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061391b91906146b0565b98975050505050505050565b604080516001600160a01b0384166020820152808201839052815180820383018152606080830190935261396191600191906080016144ee565b604051602081830303815290604052905092915050565b6000808280602001905181019061398f919061461e565b80519094506139a89150840160209081019085016148ee565b91509150915091565b604080516001600160a01b038581166020830152841681830152606080820184905282518083038201815260808301909352916139f4916002919060a0016144ee565b60405160208183030381529060405290505b9392505050565b600054610100900460ff16613a345760405162461bcd60e51b81526004016106df90614860565b60018055565b6000613a8f826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316613b0c9092919063ffffffff16565b80519091501561377d5780806020019051810190613aad9190614316565b61377d5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016106df565b6060613b1b8484600085613b23565b949350505050565b606082471015613b845760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016106df565b6001600160a01b0385163b613bdb5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016106df565b600080866001600160a01b03168587604051613bf7919061491c565b60006040518083038185875af1925050503d8060008114613c34576040519150601f19603f3d011682016040523d82523d6000602084013e613c39565b606091505b5091509150613c49828286613c54565b979650505050505050565b60608315613c63575081613a06565b825115613c735782518084602001fd5b8160405162461bcd60e51b81526004016106df91906142af565b6001600160a01b0381168114613ca257600080fd5b50565b60008083601f840112613cb757600080fd5b5081356001600160401b03811115613cce57600080fd5b602083019150836020828501011115613ce657600080fd5b9250929050565b60008060008060008060008060e0898b031215613d0957600080fd5b883597506020890135613d1b81613c8d565b96506040890135613d2b81613c8d565b95506060890135613d3b81613c8d565b94506080890135935060a0890135925060c08901356001600160401b03811115613d6457600080fd5b613d708b828c01613ca5565b999c989b5096995094979396929594505050565b61ffff81168114613ca257600080fd5b6001600160401b0381168114613ca257600080fd5b600080600080600080600080600060c08a8c031215613dc757600080fd5b8935613dd281613d84565b985060208a01356001600160401b0380821115613dee57600080fd5b613dfa8d838e01613ca5565b909a50985060408c01359150613e0f82613d94565b90965060608b01359080821115613e2557600080fd5b613e318d838e01613ca5565b909750955060808c0135945060a08c0135915080821115613e5157600080fd5b50613e5e8c828d01613ca5565b915080935050809150509295985092959850929598565b600060208284031215613e8757600080fd5b5035919050565b600060208284031215613ea057600080fd5b8135613a0681613d94565b600060208284031215613ebd57600080fd5b8135613a0681613c8d565b60008060408385031215613edb57600080fd5b8235613ee681613c8d565b946020939093013593505050565b600080600080600080600080600060e08a8c031215613f1257600080fd5b8935613f1d81613d84565b985060208a01356001600160401b0380821115613f3957600080fd5b613f458d838e01613ca5565b909a50985060408c01359150613f5a82613d94565b90965060608b013590613f6c82613c8d565b90955060808b0135945060a08b01359080821115613f8957600080fd5b50613f968c828d01613ca5565b9a9d999c50979a9699959894979660c00135949350505050565b60008060408385031215613fc357600080fd5b8235613fce81613d84565b91506020830135613fde81613c8d565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561402757614027613fe9565b604052919050565b60006001600160401b0382111561404857614048613fe9565b50601f01601f191660200190565b600082601f83011261406757600080fd5b813561407a6140758261402f565b613fff565b81815284602083860101111561408f57600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060008060c087890312156140c557600080fd5b86356140d081613d84565b955060208701356001600160401b03808211156140ec57600080fd5b6140f88a838b01614056565b9650604089013595506060890135915061411182613c8d565b9093506080880135925060a0880135908082111561412e57600080fd5b5061413b89828a01614056565b9150509295509295509295565b60006020828403121561415a57600080fd5b8135613a0681613d84565b60008060008060008060008060c0898b03121561418157600080fd5b883561418c81613d84565b975060208901356001600160401b03808211156141a857600080fd5b6141b48c838d01613ca5565b909950975060408b013591506141c982613d94565b90955060608a0135945060808a013590808211156141e657600080fd5b506141f38b828c01613ca5565b999c989b50969995989497949560a00135949350505050565b60008060006060848603121561422157600080fd5b833561422c81613c8d565b9250602084013561423c81613c8d565b9150604084013561424c81613c8d565b809150509250925092565b60005b8381101561427257818101518382015260200161425a565b838111156124535750506000910152565b6000815180845261429b816020860160208601614257565b601f01601f19169290920160200192915050565b602081526000613a066020830184614283565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60006020828403121561430b57600080fd5b8151613a0681613c8d565b60006020828403121561432857600080fd5b81518015158114613a0657600080fd5b60609190911b6bffffffffffffffffffffffff1916815260140190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b61ffff8816815260c06020820152600061439b60c0830189614283565b6001600160401b03881660408401526001600160a01b03871660608401526080830186905282810360a08401526143d3818587614355565b9a9950505050505050505050565b61ffff8716815260a0602082015260006143ff60a083018789614355565b6001600160401b03861660408401526001600160a01b0385166060840152828103608084015261442f8185614283565b9998505050505050505050565b61ffff8a16815260e06020820152600061445a60e083018a8c614355565b6001600160401b0389166040840152828103606084015261447b8189614283565b6001600160a01b038816608085015260a0840187905283810360c085015290506144a6818587614355565b9c9b505050505050505050505050565b6000806000606084860312156144cb57600080fd5b83516144d681613d84565b60208501516040860151919450925061424c81613d94565b60ff83168152604060208201526000613b1b6040830184614283565b634e487b7160e01b600052601160045260246000fd5b6000828210156145325761453261450a565b500390565b60008160001904831182151516156145515761455161450a565b500290565b60008261457357634e487b7160e01b600052601260045260246000fd5b500490565b6000821982111561458b5761458b61450a565b500190565b600061012061ffff8c1683528a602084015289604084015260018060a01b03891660608401528760808401528660a08401528060c0840152855181840152506020850151610140830152604085015160606101608401526145f5610180840182614283565b905082810360e08401526146098186614283565b90508281036101008401526144a68185614283565b6000806040838503121561463157600080fd5b825160ff8116811461464257600080fd5b60208401519092506001600160401b0381111561465e57600080fd5b8301601f8101851361466f57600080fd5b805161467d6140758261402f565b81815286602083850101111561469257600080fd5b6146a3826020830160208601614257565b8093505050509250929050565b6000602082840312156146c257600080fd5b5051919050565b6001600160a01b038a8116825261ffff8a166020830152610120604083018190526000916146f98483018c614283565b91508960608501528382036080850152614713828a614283565b6001600160401b03891660a086015287821660c086015290861660e085015283810361010085015290506144a68185614283565b600080600080600060a0868803121561475f57600080fd5b855161476a81613c8d565b602087015190955061477b81613c8d565b60408701516060880151919550935061479381613c8d565b80925050608086015190509295509295909350565b60008060008060008060c087890312156147c157600080fd5b86516147cc81613c8d565b60208801519096506147dd81613c8d565b80955050604087015193506060870151925060808701516147fd81613c8d565b8092505060a087015190509295509295509295565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6000806000606084860312156148c057600080fd5b83516148cb81613c8d565b60208501519093506148dc81613c8d565b80925050604084015190509250925092565b6000806040838503121561490157600080fd5b825161490c81613c8d565b6020939093015192949293505050565b6000825161492e818460208701614257565b919091019291505056fea264697066735822122007f55616bd1062d673137a0ef2561584d4b67250440180d783da3b45dfcd90d464736f6c63430008090033", + "numDeployments": 2, + "solcInputHash": "210845288ae75ad5da12a755a9f52e1f", + "metadata": "{\"compiler\":{\"version\":\"0.8.9+commit.e5eed63a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AddressIsNull\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BridgeTokenNotSupported\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BridgingIsPaused\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DestinationChainNotAllowed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidFromAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidMsgSender\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidOperationType\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidPayload\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSlippageParam\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NewValueIsSameAsCurrent\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SenderIsNotGovernor\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"newIsActive\",\"type\":\"bool\"}],\"name\":\"BridgingIsActiveUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"chainId\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldCrossChainDispatcher\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newCrossChainDispatcher\",\"type\":\"address\"}],\"name\":\"CrossChainDispatcherUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"chainId\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"newIsSupported\",\"type\":\"bool\"}],\"name\":\"DestinationChainIsSupportedUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"oldCallbackTxGasLimit\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"newCallbackTxGasLimit\",\"type\":\"uint64\"}],\"name\":\"FlashRepayCallbackTxGasLimitUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"oldSwapTxGasLimit\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"newSwapTxGasLimit\",\"type\":\"uint64\"}],\"name\":\"FlashRepaySwapTxGasLimitUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"oldCallbackTxGasLimit\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"newCallbackTxGasLimit\",\"type\":\"uint64\"}],\"name\":\"LeverageCallbackTxGasLimitUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"oldSwapTxGasLimit\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"newSwapTxGasLimit\",\"type\":\"uint64\"}],\"name\":\"LeverageSwapTxGasLimitUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldLzBaseGasLimit\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newLzBaseGasLimit\",\"type\":\"uint256\"}],\"name\":\"LzBaseGasLimitUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"contract IStargateComposer\",\"name\":\"oldStargateComposer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"contract IStargateComposer\",\"name\":\"newStargateComposer\",\"type\":\"address\"}],\"name\":\"StargateComposerUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldPoolId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newPoolId\",\"type\":\"uint256\"}],\"name\":\"StargatePoolIdUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldStargateSlippage\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newStargateSlippage\",\"type\":\"uint256\"}],\"name\":\"StargateSlippageUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"VERSION\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"name\":\"crossChainDispatcherOf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"extraCallbackTxNativeFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"flashRepayCallbackTxGasLimit\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"flashRepaySwapTxGasLimit\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IPoolRegistry\",\"name\":\"poolRegistry_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"weth_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"sgeth_\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isBridgingActive\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"name\":\"isDestinationChainSupported\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"leverageCallbackTxGasLimit\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"leverageSwapTxGasLimit\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lzBaseGasLimit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"srcChainId_\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"from_\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"amount_\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"payload_\",\"type\":\"bytes\"}],\"name\":\"onOFTReceived\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"poolRegistry\",\"outputs\":[{\"internalType\":\"contract IPoolRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"srcChainId_\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"srcAddress_\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"nonce_\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"token_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount_\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"payload_\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"newAmountOutMin_\",\"type\":\"uint256\"}],\"name\":\"retrySwapAndTriggerFlashRepayCallback\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"srcChainId_\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"srcAddress_\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"nonce_\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"amount_\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"payload_\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"newAmountOutMin_\",\"type\":\"uint256\"}],\"name\":\"retrySwapAndTriggerLeverageCallback\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"srcChainId_\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"srcAddress_\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"token_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountLD_\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"payload_\",\"type\":\"bytes\"}],\"name\":\"sgReceive\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sgeth\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"stargateComposer\",\"outputs\":[{\"internalType\":\"contract IStargateComposer\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"stargatePoolIdOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"stargateSlippage\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"swapAmountOutMin\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"toggleBridgingIsActive\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"chainId_\",\"type\":\"uint16\"}],\"name\":\"toggleDestinationChainIsActive\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId_\",\"type\":\"uint256\"},{\"internalType\":\"address payable\",\"name\":\"account_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenIn_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenOut_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountIn_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMin_\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"lzArgs_\",\"type\":\"bytes\"}],\"name\":\"triggerFlashRepaySwap\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId_\",\"type\":\"uint256\"},{\"internalType\":\"address payable\",\"name\":\"account_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenIn_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenOut_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountIn_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMin_\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"lzArgs_\",\"type\":\"bytes\"}],\"name\":\"triggerLeverageSwap\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"chainId_\",\"type\":\"uint16\"},{\"internalType\":\"address\",\"name\":\"crossChainDispatcher_\",\"type\":\"address\"}],\"name\":\"updateCrossChainDispatcherOf\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"newFlashRepayCallbackTxGasLimit_\",\"type\":\"uint64\"}],\"name\":\"updateFlashRepayCallbackTxGasLimit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"newFlashRepaySwapTxGasLimit_\",\"type\":\"uint64\"}],\"name\":\"updateFlashRepaySwapTxGasLimit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"newLeverageCallbackTxGasLimit_\",\"type\":\"uint64\"}],\"name\":\"updateLeverageCallbackTxGasLimit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"newLeverageSwapTxGasLimit_\",\"type\":\"uint64\"}],\"name\":\"updateLeverageSwapTxGasLimit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newLzBaseGasLimit_\",\"type\":\"uint256\"}],\"name\":\"updateLzBaseGasLimit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IStargateComposer\",\"name\":\"newStargateComposer_\",\"type\":\"address\"}],\"name\":\"updateStargateComposer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"newPoolId_\",\"type\":\"uint256\"}],\"name\":\"updateStargatePoolIdOf\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newStargateSlippage_\",\"type\":\"uint256\"}],\"name\":\"updateStargateSlippage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"weth\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"onOFTReceived(uint16,bytes,uint64,bytes,uint256,bytes)\":{\"details\":\"Token received are swapped to another token\",\"params\":{\"amount_\":\"The amount of tokens to transfer.\",\"from_\":\"The address of the account who calls the sendAndCall() on the source chain.\",\"payload_\":\"Additional data with no specified format.\",\"srcChainId_\":\"The chain id of the source chain.\"}},\"retrySwapAndTriggerFlashRepayCallback(uint16,bytes,uint64,address,uint256,bytes,uint256)\":{\"params\":{\"amount_\":\"The amountIn of failed tx\",\"newAmountOutMin_\":\"If swap failed due to slippage, caller may set lower newAmountOutMin_\",\"nonce_\":\"The nonce of failed tx\",\"payload_\":\"The payload of failed tx\",\"srcAddress_\":\"The source path of failed tx\",\"srcChainId_\":\"The source chain of failed tx\",\"token_\":\"The token of failed tx\"}},\"retrySwapAndTriggerLeverageCallback(uint16,bytes,uint64,uint256,bytes,uint256)\":{\"params\":{\"amount_\":\"The amountIn of failed tx\",\"newAmountOutMin_\":\"If swap failed due to slippage, caller may set lower newAmountOutMin_\",\"nonce_\":\"The nonce of failed tx\",\"payload_\":\"The payload of failed tx\",\"srcAddress_\":\"The source path of failed tx\",\"srcChainId_\":\"The source chain of failed tx\"}},\"sgReceive(uint16,bytes,uint256,address,uint256,bytes)\":{\"params\":{\"amountLD_\":\"The qty of local _token contract tokens\",\"payload_\":\"The payload\",\"srcAddress_\":\"The remote Bridge address\",\"srcChainId_\":\"The chain id of the source chain.\",\"token_\":\"The token contract on the local chain\"}},\"toggleDestinationChainIsActive(uint16)\":{\"details\":\"Use LZ chain id\"},\"updateStargatePoolIdOf(address,uint256)\":{\"details\":\"Use LZ ids (https://stargateprotocol.gitbook.io/stargate/developers/pool-ids)\"}},\"stateVariables\":{\"LZ_ADAPTER_PARAMS_VERSION\":{\"details\":\"LayerZero adapter param version See more: https://layerzero.gitbook.io/docs/evm-guides/advanced/relayer-adapter-parameters\"}},\"title\":\"Cross-chain dispatcher\",\"version\":1},\"userdoc\":{\"events\":{\"BridgingIsActiveUpdated(bool)\":{\"notice\":\"Emitted when flag for pause bridge transfer is toggled\"},\"CrossChainDispatcherUpdated(uint16,address,address)\":{\"notice\":\"Emitted when a Cross-chain dispatcher mapping is updated\"},\"DestinationChainIsSupportedUpdated(uint16,bool)\":{\"notice\":\"Emitted when flag for support chain is toggled\"},\"FlashRepayCallbackTxGasLimitUpdated(uint64,uint64)\":{\"notice\":\"Emitted when flash repay callback gas limit is updated\"},\"FlashRepaySwapTxGasLimitUpdated(uint64,uint64)\":{\"notice\":\"Emitted when underlying->synth L1 swap gas limit is updated\"},\"LeverageCallbackTxGasLimitUpdated(uint64,uint64)\":{\"notice\":\"Emitted when leverage callback gas limit is updated\"},\"LeverageSwapTxGasLimitUpdated(uint64,uint64)\":{\"notice\":\"Emitted when synth->underlying L1 swap gas limit is updated\"},\"LzBaseGasLimitUpdated(uint256,uint256)\":{\"notice\":\"Emitted when Lz base gas limit updated\"},\"StargateComposerUpdated(address,address)\":{\"notice\":\"Emitted when Stargate composer is updated\"},\"StargatePoolIdUpdated(address,uint256,uint256)\":{\"notice\":\"Emitted when Stargate pool id is updated\"},\"StargateSlippageUpdated(uint256,uint256)\":{\"notice\":\"Emitted when Stargate slippage is updated\"}},\"kind\":\"user\",\"methods\":{\"crossChainDispatcherOf(uint16)\":{\"notice\":\"Maps other chains `CrossChainDispatcher` contracts\"},\"extraCallbackTxNativeFee(uint256)\":{\"notice\":\"Store extra amount sent when retrying a failed tx due to low native fee\"},\"flashRepayCallbackTxGasLimit()\":{\"notice\":\"The gas limit to cover `_crossChainFlashRepayCallback()` call\"},\"flashRepaySwapTxGasLimit()\":{\"notice\":\"The gas limit to cover `_swapAndTriggerFlashRepayCallback()` call\"},\"isBridgingActive()\":{\"notice\":\"Flag that pause/unpause all cross-chain activities\"},\"isDestinationChainSupported(uint16)\":{\"notice\":\"Maps supported cross-chain routes (i.e. which chains are allowed to be used as source of liquidity)\"},\"leverageCallbackTxGasLimit()\":{\"notice\":\"The gas limit to cover `_crossChainLeverageCallback()` call\"},\"leverageSwapTxGasLimit()\":{\"notice\":\"The gas limit to cover `_swapAndTriggerLeverageCallback()` call\"},\"lzBaseGasLimit()\":{\"notice\":\"The base gas to pay for cross-chain calls\"},\"onOFTReceived(uint16,bytes,uint64,bytes,uint256,bytes)\":{\"notice\":\"Called by the OFT contract when tokens are received from source chain.\"},\"poolRegistry()\":{\"notice\":\"The pool registry contract\"},\"retrySwapAndTriggerFlashRepayCallback(uint16,bytes,uint64,address,uint256,bytes,uint256)\":{\"notice\":\"Retry swap underlying and trigger callback.\"},\"retrySwapAndTriggerLeverageCallback(uint16,bytes,uint64,uint256,bytes,uint256)\":{\"notice\":\"Retry swap and trigger callback.\"},\"sgReceive(uint16,bytes,uint256,address,uint256,bytes)\":{\"notice\":\"Receive token and payload from Stargate\"},\"sgeth()\":{\"notice\":\"SGETH contract\"},\"stargateComposer()\":{\"notice\":\"The Stargate Router contract\"},\"stargatePoolIdOf(address)\":{\"notice\":\"Maps Stargate's token pools\"},\"stargateSlippage()\":{\"notice\":\"The slippage we're willing to accept for SG like:like transfers\"},\"swapAmountOutMin(uint256)\":{\"notice\":\"Overwritten swap slippage params\"},\"toggleBridgingIsActive()\":{\"notice\":\"Pause/Unpause bridge transfers\"},\"toggleDestinationChainIsActive(uint16)\":{\"notice\":\"Allow/Disallow destination chain\"},\"updateCrossChainDispatcherOf(uint16,address)\":{\"notice\":\"Update Cross-chain dispatcher mapping\"},\"updateFlashRepayCallbackTxGasLimit(uint64)\":{\"notice\":\"Update flash repay callback tx gas limit\"},\"updateFlashRepaySwapTxGasLimit(uint64)\":{\"notice\":\"Update flash repay swap tx gas limit\"},\"updateLeverageCallbackTxGasLimit(uint64)\":{\"notice\":\"Update leverage callback tx gas limit\"},\"updateLeverageSwapTxGasLimit(uint64)\":{\"notice\":\"Update leverage swap tx gas limit\"},\"updateLzBaseGasLimit(uint256)\":{\"notice\":\"Update Lz base gas limit\"},\"updateStargateComposer(address)\":{\"notice\":\"Update StargateComposer\"},\"updateStargatePoolIdOf(address,uint256)\":{\"notice\":\"Update Stargate pool id of token.\"},\"updateStargateSlippage(uint256)\":{\"notice\":\"Update Stargate slippage\"},\"weth()\":{\"notice\":\"WETH contract\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/CrossChainDispatcher.sol\":\"CrossChainDispatcher\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/CrossChainDispatcher.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./utils/ReentrancyGuard.sol\\\";\\nimport \\\"./dependencies/@layerzerolabs/solidity-examples/util/BytesLib.sol\\\";\\nimport \\\"./dependencies/openzeppelin/token/ERC20/utils/SafeERC20.sol\\\";\\nimport \\\"./interfaces/external/IStargateComposerWithRetry.sol\\\";\\nimport \\\"./interfaces/external/IWETH.sol\\\";\\nimport \\\"./interfaces/external/IStargatePool.sol\\\";\\nimport \\\"./interfaces/external/IStargateFactory.sol\\\";\\nimport \\\"./storage/CrossChainDispatcherStorage.sol\\\";\\nimport \\\"./interfaces/IProxyOFT.sol\\\";\\nimport \\\"./interfaces/ISmartFarmingManager.sol\\\";\\nimport \\\"./interfaces/ISyntheticToken.sol\\\";\\nimport \\\"./interfaces/external/ISwapper.sol\\\";\\nimport \\\"./lib/CrossChainLib.sol\\\";\\n\\nerror AddressIsNull();\\nerror InvalidMsgSender();\\nerror BridgingIsPaused();\\nerror InvalidFromAddress();\\nerror InvalidToAddress();\\nerror NewValueIsSameAsCurrent();\\nerror SenderIsNotGovernor();\\nerror DestinationChainNotAllowed();\\nerror InvalidOperationType();\\nerror BridgeTokenNotSupported();\\nerror InvalidSlippageParam();\\nerror InvalidPayload();\\n\\n// Note: The `IPool` wasn't updated to avoid changing interface\\n// Refs: https://github.com/autonomoussoftware/metronome-synth/issues/877\\ninterface IPoolV4 is IPool {\\n function isBridgingActive() external view returns (bool);\\n}\\n\\n/**\\n * @title Cross-chain dispatcher\\n */\\ncontract CrossChainDispatcher is ReentrancyGuard, CrossChainDispatcherStorageV2 {\\n using SafeERC20 for IERC20;\\n using BytesLib for bytes;\\n\\n string public constant VERSION = \\\"1.3.0\\\";\\n\\n /**\\n * @dev LayerZero adapter param version\\n * See more: https://layerzero.gitbook.io/docs/evm-guides/advanced/relayer-adapter-parameters\\n */\\n uint16 private constant LZ_ADAPTER_PARAMS_VERSION = 2;\\n\\n uint256 private constant MAX_BPS = 100_00;\\n\\n struct LayerZeroParams {\\n address tokenIn;\\n uint16 dstChainId;\\n uint256 amountIn;\\n uint256 nativeFee;\\n bytes payload;\\n address refundAddress;\\n uint64 dstGasForCall;\\n uint256 dstNativeAmount;\\n }\\n\\n /// @notice Emitted when Lz base gas limit updated\\n event LzBaseGasLimitUpdated(uint256 oldLzBaseGasLimit, uint256 newLzBaseGasLimit);\\n\\n /// @notice Emitted when Stargate composer is updated\\n event StargateComposerUpdated(IStargateComposer oldStargateComposer, IStargateComposer newStargateComposer);\\n\\n /// @notice Emitted when Stargate pool id is updated\\n event StargatePoolIdUpdated(address indexed token, uint256 oldPoolId, uint256 newPoolId);\\n\\n /// @notice Emitted when Stargate slippage is updated\\n event StargateSlippageUpdated(uint256 oldStargateSlippage, uint256 newStargateSlippage);\\n\\n /// @notice Emitted when synth->underlying L1 swap gas limit is updated\\n event LeverageSwapTxGasLimitUpdated(uint64 oldSwapTxGasLimit, uint64 newSwapTxGasLimit);\\n\\n /// @notice Emitted when leverage callback gas limit is updated\\n event LeverageCallbackTxGasLimitUpdated(uint64 oldCallbackTxGasLimit, uint64 newCallbackTxGasLimit);\\n\\n /// @notice Emitted when underlying->synth L1 swap gas limit is updated\\n event FlashRepaySwapTxGasLimitUpdated(uint64 oldSwapTxGasLimit, uint64 newSwapTxGasLimit);\\n\\n /// @notice Emitted when flash repay callback gas limit is updated\\n event FlashRepayCallbackTxGasLimitUpdated(uint64 oldCallbackTxGasLimit, uint64 newCallbackTxGasLimit);\\n\\n /// @notice Emitted when flag for pause bridge transfer is toggled\\n event BridgingIsActiveUpdated(bool newIsActive);\\n\\n /// @notice Emitted when a Cross-chain dispatcher mapping is updated\\n event CrossChainDispatcherUpdated(uint16 chainId, address oldCrossChainDispatcher, address newCrossChainDispatcher);\\n\\n /// @notice Emitted when flag for support chain is toggled\\n event DestinationChainIsSupportedUpdated(uint16 chainId, bool newIsSupported);\\n\\n modifier onlyGovernor() {\\n if (msg.sender != poolRegistry.governor()) revert SenderIsNotGovernor();\\n _;\\n }\\n\\n modifier onlyIfBridgingIsNotPaused() {\\n if (!isBridgingActive || !IPoolV4(address(IManageable(msg.sender).pool())).isBridgingActive())\\n revert BridgingIsPaused();\\n _;\\n }\\n\\n modifier onlyIfSmartFarmingManager() {\\n IPool _pool = IManageable(msg.sender).pool();\\n if (!poolRegistry.isPoolRegistered(address(_pool))) revert InvalidMsgSender();\\n if (msg.sender != address(_pool.smartFarmingManager())) revert InvalidMsgSender();\\n _;\\n }\\n\\n modifier onlyIfStargateComposer() {\\n if (msg.sender != address(stargateComposer)) revert InvalidMsgSender();\\n _;\\n }\\n\\n modifier onlyIfProxyOFT() {\\n if (!_isValidProxyOFT(msg.sender)) revert InvalidMsgSender();\\n _;\\n }\\n\\n constructor() {\\n _disableInitializers();\\n }\\n\\n receive() external payable {}\\n\\n function initialize(IPoolRegistry poolRegistry_, address weth_, address sgeth_) external initializer {\\n if (address(poolRegistry_) == address(0)) revert AddressIsNull();\\n\\n __ReentrancyGuard_init();\\n\\n poolRegistry = poolRegistry_;\\n stargateSlippage = 50; // 0.5%\\n lzBaseGasLimit = 200_000;\\n flashRepayCallbackTxGasLimit = 750_000;\\n flashRepaySwapTxGasLimit = 500_000;\\n leverageCallbackTxGasLimit = 750_000;\\n leverageSwapTxGasLimit = 750_000;\\n weth = weth_;\\n sgeth = sgeth_;\\n }\\n\\n /**\\n * @notice Called by the OFT contract when tokens are received from source chain.\\n * @dev Token received are swapped to another token\\n * @param srcChainId_ The chain id of the source chain.\\n * @param from_ The address of the account who calls the sendAndCall() on the source chain.\\n * @param amount_ The amount of tokens to transfer.\\n * @param payload_ Additional data with no specified format.\\n */\\n function onOFTReceived(\\n uint16 srcChainId_,\\n bytes calldata /*srcAddress_*/,\\n uint64 /*nonce_*/,\\n bytes calldata from_,\\n uint amount_,\\n bytes calldata payload_\\n ) external override onlyIfProxyOFT {\\n address _from = from_.toAddress(0);\\n if (_from == address(0) || _from != crossChainDispatcherOf[srcChainId_]) revert InvalidFromAddress();\\n\\n uint8 _op = CrossChainLib.getOperationType(payload_);\\n\\n if (_op == CrossChainLib.FLASH_REPAY) {\\n _crossChainFlashRepayCallback(amount_, payload_);\\n } else if (_op == CrossChainLib.LEVERAGE) {\\n _swapAndTriggerLeverageCallback(srcChainId_, amount_, payload_);\\n } else {\\n revert InvalidOperationType();\\n }\\n }\\n\\n /**\\n * @dev Finalize cross-chain flash repay process. The callback may fail due to slippage.\\n */\\n function _crossChainFlashRepayCallback(uint amount_, bytes calldata payload_) private {\\n (address proxyOFT_, address _smartFarmingManager, uint256 _requestId) = CrossChainLib\\n .decodeFlashRepayCallbackPayload(payload_);\\n\\n IERC20 _syntheticToken = IERC20(IProxyOFT(proxyOFT_).token());\\n _syntheticToken.safeApprove(_smartFarmingManager, 0);\\n _syntheticToken.safeApprove(_smartFarmingManager, amount_);\\n ISmartFarmingManager(_smartFarmingManager).crossChainFlashRepayCallback(_requestId, amount_);\\n }\\n\\n /**\\n * @dev Swap synthetic token for underlying and trigger callback call\\n */\\n function _swapAndTriggerLeverageCallback(uint16 srcChainId_, uint amountIn_, bytes calldata payload_) private {\\n // 1. Swap\\n (\\n address _srcSmartFarmingManager,\\n address _dstProxyOFT,\\n uint256 _requestId,\\n uint256 _sgPoolId,\\n address _account,\\n uint256 _amountOutMin,\\n uint256 _callbackTxNativeFee\\n ) = CrossChainLib.decodeLeverageSwapPayload(payload_);\\n\\n address _bridgeToken = IStargatePool(IStargateFactory(stargateComposer.factory()).getPool(_sgPoolId)).token();\\n\\n if (_bridgeToken == sgeth) _bridgeToken = weth;\\n\\n amountIn_ = _swap({\\n requestId_: _requestId,\\n tokenIn_: IProxyOFT(_dstProxyOFT).token(),\\n tokenOut_: _bridgeToken,\\n amountIn_: amountIn_,\\n amountOutMin_: _amountOutMin\\n });\\n\\n // 2. Transfer underlying to source chain\\n uint16 _srcChainId = srcChainId_;\\n\\n _sendUsingStargate(\\n LayerZeroParams({\\n tokenIn: _bridgeToken,\\n dstChainId: _srcChainId,\\n amountIn: amountIn_,\\n nativeFee: _callbackTxNativeFee + extraCallbackTxNativeFee[_requestId],\\n payload: CrossChainLib.encodeLeverageCallbackPayload(_srcSmartFarmingManager, _requestId),\\n refundAddress: _account,\\n dstGasForCall: leverageCallbackTxGasLimit,\\n dstNativeAmount: 0\\n })\\n );\\n }\\n\\n /**\\n * @notice Receive token and payload from Stargate\\n * @param srcChainId_ The chain id of the source chain.\\n * @param srcAddress_ The remote Bridge address\\n * @param token_ The token contract on the local chain\\n * @param amountLD_ The qty of local _token contract tokens\\n * @param payload_ The payload\\n */\\n function sgReceive(\\n uint16 srcChainId_,\\n bytes memory srcAddress_,\\n uint256 /*nonce_*/,\\n address token_,\\n uint256 amountLD_,\\n bytes memory payload_\\n ) external override onlyIfStargateComposer {\\n // Note: Stargate uses SGETH as `token_` when receiving native ETH\\n if (token_ == sgeth) {\\n IWETH(weth).deposit{value: amountLD_}();\\n token_ = weth;\\n }\\n\\n address _srcAddress = srcAddress_.toAddress(0);\\n\\n if (_srcAddress == address(0) || _srcAddress != crossChainDispatcherOf[srcChainId_])\\n revert InvalidFromAddress();\\n\\n uint8 _op = CrossChainLib.getOperationType(payload_);\\n\\n if (_op == CrossChainLib.LEVERAGE) {\\n _crossChainLeverageCallback(token_, amountLD_, payload_);\\n } else if (_op == CrossChainLib.FLASH_REPAY) {\\n _swapAndTriggerFlashRepayCallback(srcChainId_, token_, amountLD_, payload_);\\n } else {\\n revert InvalidOperationType();\\n }\\n }\\n\\n /**\\n * @dev Finalize cross-chain leverage process. The callback may fail due to slippage.\\n */\\n function _crossChainLeverageCallback(address bridgeToken_, uint256 amount_, bytes memory payload_) private {\\n (address _smartFarmingManager, uint256 _requestId) = CrossChainLib.decodeLeverageCallbackPayload(payload_);\\n IERC20(bridgeToken_).safeApprove(_smartFarmingManager, 0);\\n IERC20(bridgeToken_).safeApprove(_smartFarmingManager, amount_);\\n ISmartFarmingManager(_smartFarmingManager).crossChainLeverageCallback(_requestId, amount_);\\n }\\n\\n /**\\n * @dev Send synthetic token cross-chain\\n */\\n function _sendUsingLayerZero(LayerZeroParams memory params_) private {\\n address _to = crossChainDispatcherOf[params_.dstChainId];\\n if (_to == address(0)) revert AddressIsNull();\\n\\n bytes memory _adapterParams = abi.encodePacked(\\n LZ_ADAPTER_PARAMS_VERSION,\\n uint256(lzBaseGasLimit + params_.dstGasForCall),\\n params_.dstNativeAmount,\\n (params_.dstNativeAmount > 0) ? _to : address(0)\\n );\\n\\n ISyntheticToken(params_.tokenIn).proxyOFT().sendAndCall{value: params_.nativeFee}({\\n _from: address(this),\\n _dstChainId: params_.dstChainId,\\n _toAddress: abi.encodePacked(_to),\\n _amount: params_.amountIn,\\n _payload: params_.payload,\\n _dstGasForCall: params_.dstGasForCall,\\n _refundAddress: payable(params_.refundAddress),\\n _zroPaymentAddress: address(0),\\n _adapterParams: _adapterParams\\n });\\n }\\n\\n /**\\n * @dev Swap underlying for synthetic token and trigger callback call\\n */\\n function _swapAndTriggerFlashRepayCallback(\\n uint16 srcChainId_,\\n address token_,\\n uint256 amount_,\\n bytes memory payload_\\n ) private {\\n // 1. Swap\\n (\\n address _srcSmartFarmingManager,\\n address _dstProxyOFT,\\n uint256 _requestId,\\n address _account,\\n uint256 _amountOutMin,\\n uint256 _callbackTxNativeFee\\n ) = CrossChainLib.decodeFlashRepaySwapPayload(payload_);\\n\\n address _syntheticToken = IProxyOFT(_dstProxyOFT).token();\\n amount_ = _swap({\\n requestId_: _requestId,\\n tokenIn_: token_,\\n tokenOut_: _syntheticToken,\\n amountIn_: amount_,\\n amountOutMin_: _amountOutMin\\n });\\n\\n // 2. Transfer synthetic token to source chain\\n uint16 _srcChainId = srcChainId_;\\n address _srcProxyOFT = IProxyOFT(_dstProxyOFT).getProxyOFTOf(_srcChainId);\\n\\n _sendUsingLayerZero(\\n LayerZeroParams({\\n tokenIn: _syntheticToken,\\n dstChainId: _srcChainId,\\n amountIn: amount_,\\n payload: CrossChainLib.encodeFlashRepayCallbackPayload(\\n _srcProxyOFT,\\n _srcSmartFarmingManager,\\n _requestId\\n ),\\n refundAddress: _account,\\n dstGasForCall: flashRepayCallbackTxGasLimit,\\n dstNativeAmount: 0,\\n nativeFee: _callbackTxNativeFee + extraCallbackTxNativeFee[_requestId]\\n })\\n );\\n }\\n\\n /**\\n * @notice Retry swap underlying and trigger callback.\\n * @param srcChainId_ The source chain of failed tx\\n * @param srcAddress_ The source path of failed tx\\n * @param nonce_ The nonce of failed tx\\n * @param token_ The token of failed tx\\n * @param amount_ The amountIn of failed tx\\n * @param payload_ The payload of failed tx\\n * @param newAmountOutMin_ If swap failed due to slippage, caller may set lower newAmountOutMin_\\n */\\n function retrySwapAndTriggerFlashRepayCallback(\\n uint16 srcChainId_,\\n bytes calldata srcAddress_,\\n uint64 nonce_,\\n address token_,\\n uint256 amount_,\\n bytes calldata payload_,\\n uint256 newAmountOutMin_\\n ) external payable nonReentrant {\\n IStargateComposerWithRetry _stargateComposer = IStargateComposerWithRetry(address(stargateComposer));\\n\\n bytes memory _sgReceiveCallData = abi.encodeWithSelector(\\n IStargateReceiver.sgReceive.selector,\\n srcChainId_,\\n abi.encodePacked(crossChainDispatcherOf[srcChainId_]),\\n nonce_,\\n token_,\\n amount_,\\n payload_\\n );\\n\\n (, , uint256 _requestId, address _account, , ) = CrossChainLib.decodeFlashRepaySwapPayload(payload_);\\n\\n if (msg.value > 0) {\\n extraCallbackTxNativeFee[_requestId] += msg.value;\\n }\\n\\n if (msg.sender == _account) {\\n // Note: If `swapAmountOutMin[_requestId]` is `0` (default value), swap function will use payload's slippage param\\n if (newAmountOutMin_ == 0) revert InvalidSlippageParam();\\n swapAmountOutMin[_requestId] = newAmountOutMin_;\\n }\\n\\n // Note: `clearCachedSwap()` has checks to ensure that the args are consistent\\n _stargateComposer.clearCachedSwap(srcChainId_, srcAddress_, nonce_, address(this), _sgReceiveCallData);\\n }\\n\\n /**\\n * @notice Retry swap and trigger callback.\\n * @param srcChainId_ The source chain of failed tx\\n * @param srcAddress_ The source path of failed tx\\n * @param nonce_ The nonce of failed tx\\n * @param amount_ The amountIn of failed tx\\n * @param payload_ The payload of failed tx\\n * @param newAmountOutMin_ If swap failed due to slippage, caller may set lower newAmountOutMin_\\n */\\n function retrySwapAndTriggerLeverageCallback(\\n uint16 srcChainId_,\\n bytes calldata srcAddress_,\\n uint64 nonce_,\\n uint256 amount_,\\n bytes calldata payload_,\\n uint256 newAmountOutMin_\\n ) external payable nonReentrant {\\n (, address _dstProxyOFT, uint256 _requestId, , address _account, , ) = CrossChainLib.decodeLeverageSwapPayload(\\n payload_\\n );\\n\\n if (!_isValidProxyOFT(_dstProxyOFT)) revert InvalidPayload();\\n\\n if (msg.value > 0) {\\n extraCallbackTxNativeFee[_requestId] += msg.value;\\n }\\n\\n if (msg.sender == _account) {\\n // Note: If `swapAmountOutMin[_requestId]` is `0` (default value), swap function will use payload's slippage param\\n if (newAmountOutMin_ == 0) revert InvalidSlippageParam();\\n swapAmountOutMin[_requestId] = newAmountOutMin_;\\n }\\n\\n // Note: `retryOFTReceived()` has checks to ensure that the args are consistent\\n bytes memory _from = abi.encodePacked(crossChainDispatcherOf[srcChainId_]);\\n IProxyOFT(_dstProxyOFT).retryOFTReceived(\\n srcChainId_,\\n srcAddress_,\\n nonce_,\\n _from,\\n address(this),\\n amount_,\\n payload_\\n );\\n }\\n\\n /***\\n * @notice Trigger swap using Stargate for flashRepay.\\n * @param requestId_ Request id.\\n * @param account_ User address and also refund address\\n * @param tokenIn_ tokenIn\\n * @param tokenOut_ tokenOut\\n * @param amountIn_ amountIn_\\n * @param amountOutMin_ amountOutMin_\\n * @param lzArgs_ LayerZero method argument\\n */\\n function triggerFlashRepaySwap(\\n uint256 requestId_,\\n address payable account_,\\n address tokenIn_,\\n address tokenOut_,\\n uint256 amountIn_,\\n uint256 amountOutMin_,\\n bytes calldata lzArgs_\\n ) external payable override nonReentrant onlyIfSmartFarmingManager onlyIfBridgingIsNotPaused {\\n address _account = account_; // stack too deep\\n\\n (uint16 _dstChainId, uint256 callbackTxNativeFee_, uint64 flashRepaySwapTxGasLimit_) = CrossChainLib\\n .decodeLzArgs(lzArgs_);\\n\\n bytes memory _payload;\\n {\\n address _dstProxyOFT = ISyntheticToken(tokenOut_).proxyOFT().getProxyOFTOf(_dstChainId);\\n\\n if (_dstProxyOFT == address(0)) revert AddressIsNull();\\n if (!isDestinationChainSupported[_dstChainId]) revert DestinationChainNotAllowed();\\n\\n uint256 _requestId = requestId_; // stack too deep\\n\\n _payload = CrossChainLib.encodeFlashRepaySwapPayload({\\n srcSmartFarmingManager_: msg.sender,\\n dstProxyOFT_: _dstProxyOFT,\\n requestId_: _requestId,\\n account_: _account,\\n amountOutMin_: amountOutMin_,\\n callbackTxNativeFee_: callbackTxNativeFee_\\n });\\n }\\n\\n _sendUsingStargate(\\n LayerZeroParams({\\n tokenIn: tokenIn_,\\n dstChainId: _dstChainId,\\n amountIn: amountIn_,\\n nativeFee: msg.value,\\n payload: _payload,\\n refundAddress: _account,\\n dstGasForCall: flashRepaySwapTxGasLimit_,\\n dstNativeAmount: callbackTxNativeFee_\\n })\\n );\\n }\\n\\n /***\\n * @notice Send synthetic token and trigger swap at destination chain\\n * @dev Not checking if bridging is pause because `ProxyOFT._debitFrom()` does it\\n * @param requestId_ Request id.\\n * @param account_ User address and also refund address\\n * @param tokenOut_ tokenOut\\n * @param amountIn_ amountIn\\n * @param amountOutMin_ amountOutMin\\n * @param lzArgs_ LayerZero method argument\\n */\\n function triggerLeverageSwap(\\n uint256 requestId_,\\n address payable account_,\\n address tokenIn_,\\n address tokenOut_,\\n uint256 amountIn_,\\n uint256 amountOutMin_,\\n bytes calldata lzArgs_\\n ) external payable override nonReentrant onlyIfSmartFarmingManager onlyIfBridgingIsNotPaused {\\n address _account = account_; // stack too deep\\n\\n (uint16 _dstChainId, uint256 _callbackTxNativeFee, uint64 _leverageSwapTxGasLimit) = CrossChainLib.decodeLzArgs(\\n lzArgs_\\n );\\n\\n bytes memory _payload;\\n {\\n address _tokenOut = tokenOut_; // stack too deep\\n uint256 _requestId = requestId_; // stack too deep\\n uint256 _amountOutMin = amountOutMin_; // stack too deep\\n\\n address _dstProxyOFT = ISyntheticToken(tokenIn_).proxyOFT().getProxyOFTOf(_dstChainId);\\n uint256 _sgPoolId = stargatePoolIdOf[_tokenOut];\\n\\n if (_dstProxyOFT == address(0)) revert AddressIsNull();\\n if (!isDestinationChainSupported[_dstChainId]) revert DestinationChainNotAllowed();\\n if (_sgPoolId == 0) revert BridgeTokenNotSupported();\\n\\n _payload = CrossChainLib.encodeLeverageSwapPayload({\\n srcSmartFarmingManager_: msg.sender,\\n dstProxyOFT_: _dstProxyOFT,\\n requestId_: _requestId,\\n sgPoolId_: _sgPoolId,\\n account_: _account,\\n amountOutMin_: _amountOutMin,\\n callbackTxNativeFee_: _callbackTxNativeFee\\n });\\n }\\n\\n _sendUsingLayerZero(\\n LayerZeroParams({\\n tokenIn: tokenIn_,\\n dstChainId: _dstChainId,\\n amountIn: amountIn_,\\n payload: _payload,\\n refundAddress: _account,\\n dstGasForCall: _leverageSwapTxGasLimit,\\n dstNativeAmount: _callbackTxNativeFee,\\n nativeFee: msg.value\\n })\\n );\\n }\\n\\n /**\\n * @dev Check wether an address is a proxyOFT or not\\n */\\n function _isValidProxyOFT(address proxyOFT_) private view returns (bool) {\\n ISyntheticToken _syntheticToken = ISyntheticToken(IProxyOFT(proxyOFT_).token());\\n if (!poolRegistry.doesSyntheticTokenExist(_syntheticToken)) return false;\\n if (proxyOFT_ != address(_syntheticToken.proxyOFT())) return false;\\n\\n return true;\\n }\\n\\n /**\\n * @dev Send underlying token cross-chain\\n */\\n function _sendUsingStargate(LayerZeroParams memory params_) private {\\n IStargateRouter.lzTxObj memory _lzTxParams;\\n bytes memory _to = abi.encodePacked(crossChainDispatcherOf[params_.dstChainId]);\\n {\\n if (_to.toAddress(0) == address(0)) revert AddressIsNull();\\n\\n _lzTxParams = IStargateRouter.lzTxObj({\\n dstGasForCall: params_.dstGasForCall,\\n dstNativeAmount: params_.dstNativeAmount,\\n dstNativeAddr: (params_.dstNativeAmount > 0) ? _to : abi.encode(0)\\n });\\n }\\n\\n uint256 _poolId = stargatePoolIdOf[params_.tokenIn];\\n if (_poolId == 0) revert BridgeTokenNotSupported();\\n uint256 _amountOutMin = (params_.amountIn * (MAX_BPS - stargateSlippage)) / MAX_BPS;\\n bytes memory _payload = params_.payload;\\n\\n IStargateComposer _stargateComposer = stargateComposer;\\n\\n // Note: StargateComposer only accepts native for ETH pool\\n if (params_.tokenIn == weth) {\\n IWETH(weth).withdraw(params_.amountIn);\\n params_.nativeFee += params_.amountIn;\\n } else {\\n IERC20(params_.tokenIn).safeApprove(address(_stargateComposer), 0);\\n IERC20(params_.tokenIn).safeApprove(address(_stargateComposer), params_.amountIn);\\n }\\n\\n _stargateComposer.swap{value: params_.nativeFee}({\\n _dstChainId: params_.dstChainId,\\n _srcPoolId: _poolId,\\n _dstPoolId: _poolId,\\n _refundAddress: payable(params_.refundAddress),\\n _amountLD: params_.amountIn,\\n _minAmountLD: _amountOutMin,\\n _lzTxParams: _lzTxParams,\\n _to: _to,\\n _payload: _payload\\n });\\n }\\n\\n /**\\n * @dev Perform a swap considering slippage param from user\\n */\\n function _swap(\\n uint256 requestId_,\\n address tokenIn_,\\n address tokenOut_,\\n uint256 amountIn_,\\n uint256 amountOutMin_\\n ) private returns (uint256 _amountOut) {\\n // 1. Use updated slippage if exist\\n uint256 _storedAmountOutMin = swapAmountOutMin[requestId_];\\n if (_storedAmountOutMin > 0) {\\n // Use stored slippage and clear it\\n amountOutMin_ = _storedAmountOutMin;\\n delete swapAmountOutMin[requestId_];\\n }\\n\\n // 2. Perform swap\\n ISwapper _swapper = poolRegistry.swapper();\\n IERC20(tokenIn_).safeApprove(address(_swapper), 0);\\n IERC20(tokenIn_).safeApprove(address(_swapper), amountIn_);\\n _amountOut = _swapper.swapExactInput({\\n tokenIn_: tokenIn_,\\n tokenOut_: tokenOut_,\\n amountIn_: amountIn_,\\n amountOutMin_: amountOutMin_,\\n receiver_: address(this)\\n });\\n }\\n\\n /**\\n * @notice Update flash repay callback tx gas limit\\n */\\n function updateFlashRepayCallbackTxGasLimit(uint64 newFlashRepayCallbackTxGasLimit_) external onlyGovernor {\\n uint64 _currentFlashRepayCallbackTxGasLimit = flashRepayCallbackTxGasLimit;\\n if (newFlashRepayCallbackTxGasLimit_ == _currentFlashRepayCallbackTxGasLimit) revert NewValueIsSameAsCurrent();\\n emit FlashRepayCallbackTxGasLimitUpdated(\\n _currentFlashRepayCallbackTxGasLimit,\\n newFlashRepayCallbackTxGasLimit_\\n );\\n flashRepayCallbackTxGasLimit = newFlashRepayCallbackTxGasLimit_;\\n }\\n\\n /**\\n * @notice Update flash repay swap tx gas limit\\n */\\n function updateFlashRepaySwapTxGasLimit(uint64 newFlashRepaySwapTxGasLimit_) external onlyGovernor {\\n uint64 _currentFlashRepaySwapTxGasLimit = flashRepaySwapTxGasLimit;\\n if (newFlashRepaySwapTxGasLimit_ == _currentFlashRepaySwapTxGasLimit) revert NewValueIsSameAsCurrent();\\n emit FlashRepaySwapTxGasLimitUpdated(_currentFlashRepaySwapTxGasLimit, newFlashRepaySwapTxGasLimit_);\\n flashRepaySwapTxGasLimit = newFlashRepaySwapTxGasLimit_;\\n }\\n\\n /**\\n * @notice Update leverage callback tx gas limit\\n */\\n function updateLeverageCallbackTxGasLimit(uint64 newLeverageCallbackTxGasLimit_) external onlyGovernor {\\n uint64 _currentLeverageCallbackTxGasLimit = leverageCallbackTxGasLimit;\\n if (newLeverageCallbackTxGasLimit_ == _currentLeverageCallbackTxGasLimit) revert NewValueIsSameAsCurrent();\\n emit LeverageCallbackTxGasLimitUpdated(_currentLeverageCallbackTxGasLimit, newLeverageCallbackTxGasLimit_);\\n leverageCallbackTxGasLimit = newLeverageCallbackTxGasLimit_;\\n }\\n\\n /**\\n * @notice Update leverage swap tx gas limit\\n */\\n function updateLeverageSwapTxGasLimit(uint64 newLeverageSwapTxGasLimit_) external onlyGovernor {\\n uint64 _currentSwapTxGasLimit = leverageSwapTxGasLimit;\\n if (newLeverageSwapTxGasLimit_ == _currentSwapTxGasLimit) revert NewValueIsSameAsCurrent();\\n emit LeverageSwapTxGasLimitUpdated(_currentSwapTxGasLimit, newLeverageSwapTxGasLimit_);\\n leverageSwapTxGasLimit = newLeverageSwapTxGasLimit_;\\n }\\n\\n /**\\n * @notice Update Lz base gas limit\\n */\\n function updateLzBaseGasLimit(uint256 newLzBaseGasLimit_) external onlyGovernor {\\n uint256 _currentBaseGasLimit = lzBaseGasLimit;\\n if (newLzBaseGasLimit_ == _currentBaseGasLimit) revert NewValueIsSameAsCurrent();\\n emit LzBaseGasLimitUpdated(_currentBaseGasLimit, newLzBaseGasLimit_);\\n lzBaseGasLimit = newLzBaseGasLimit_;\\n }\\n\\n /**\\n * @notice Update Stargate pool id of token.\\n * @dev Use LZ ids (https://stargateprotocol.gitbook.io/stargate/developers/pool-ids)\\n */\\n function updateStargatePoolIdOf(address token_, uint256 newPoolId_) external onlyGovernor {\\n uint256 _currentPoolId = stargatePoolIdOf[token_];\\n if (newPoolId_ == _currentPoolId) revert NewValueIsSameAsCurrent();\\n emit StargatePoolIdUpdated(token_, _currentPoolId, newPoolId_);\\n stargatePoolIdOf[token_] = newPoolId_;\\n }\\n\\n /**\\n * @notice Update Stargate slippage\\n */\\n function updateStargateSlippage(uint256 newStargateSlippage_) external onlyGovernor {\\n uint256 _currentStargateSlippage = stargateSlippage;\\n if (newStargateSlippage_ == _currentStargateSlippage) revert NewValueIsSameAsCurrent();\\n emit StargateSlippageUpdated(_currentStargateSlippage, newStargateSlippage_);\\n stargateSlippage = newStargateSlippage_;\\n }\\n\\n /**\\n * @notice Update StargateComposer\\n */\\n function updateStargateComposer(IStargateComposer newStargateComposer_) external onlyGovernor {\\n IStargateComposer _currentStargateComposer = stargateComposer;\\n if (newStargateComposer_ == _currentStargateComposer) revert NewValueIsSameAsCurrent();\\n emit StargateComposerUpdated(_currentStargateComposer, newStargateComposer_);\\n stargateComposer = newStargateComposer_;\\n }\\n\\n /**\\n * @notice Pause/Unpause bridge transfers\\n */\\n function toggleBridgingIsActive() external onlyGovernor {\\n bool _newIsBridgingActive = !isBridgingActive;\\n emit BridgingIsActiveUpdated(_newIsBridgingActive);\\n isBridgingActive = _newIsBridgingActive;\\n }\\n\\n /**\\n * @notice Update Cross-chain dispatcher mapping\\n */\\n function updateCrossChainDispatcherOf(uint16 chainId_, address crossChainDispatcher_) external onlyGovernor {\\n address _current = crossChainDispatcherOf[chainId_];\\n if (crossChainDispatcher_ == _current) revert NewValueIsSameAsCurrent();\\n emit CrossChainDispatcherUpdated(chainId_, _current, crossChainDispatcher_);\\n crossChainDispatcherOf[chainId_] = crossChainDispatcher_;\\n }\\n\\n /**\\n * @notice Allow/Disallow destination chain\\n * @dev Use LZ chain id\\n */\\n function toggleDestinationChainIsActive(uint16 chainId_) external onlyGovernor {\\n bool _isDestinationChainSupported = !isDestinationChainSupported[chainId_];\\n emit BridgingIsActiveUpdated(_isDestinationChainSupported);\\n isDestinationChainSupported[chainId_] = _isDestinationChainSupported;\\n }\\n}\\n\",\"keccak256\":\"0xab9f4678c2e440c9c5e991761ef3daf1d8bbee39746027b7b632e0c3ef146c60\",\"license\":\"MIT\"},\"contracts/dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/IOFTCoreUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../../../../openzeppelin-upgradeable/utils/introspection/IERC165Upgradeable.sol\\\";\\n\\n/**\\n * @dev Interface of the IOFT core standard\\n */\\ninterface IOFTCoreUpgradeable is IERC165Upgradeable {\\n /**\\n * @dev estimate send token `_tokenId` to (`_dstChainId`, `_toAddress`)\\n * _dstChainId - L0 defined chain id to send tokens too\\n * _toAddress - dynamic bytes array which contains the address to whom you are sending tokens to on the dstChain\\n * _amount - amount of the tokens to transfer\\n * _useZro - indicates to use zro to pay L0 fees\\n * _adapterParam - flexible bytes array to indicate messaging adapter services in L0\\n */\\n function estimateSendFee(\\n uint16 _dstChainId,\\n bytes calldata _toAddress,\\n uint _amount,\\n bool _useZro,\\n bytes calldata _adapterParams\\n ) external view returns (uint nativeFee, uint zroFee);\\n\\n /**\\n * @dev send `_amount` amount of token to (`_dstChainId`, `_toAddress`) from `_from`\\n * `_from` the owner of token\\n * `_dstChainId` the destination chain identifier\\n * `_toAddress` can be any size depending on the `dstChainId`.\\n * `_amount` the quantity of tokens in wei\\n * `_refundAddress` the address LayerZero refunds if too much message fee is sent\\n * `_zroPaymentAddress` set to address(0x0) if not paying in ZRO (LayerZero Token)\\n * `_adapterParams` is a flexible bytes array to indicate messaging adapter services\\n */\\n function sendFrom(\\n address _from,\\n uint16 _dstChainId,\\n bytes calldata _toAddress,\\n uint _amount,\\n address payable _refundAddress,\\n address _zroPaymentAddress,\\n bytes calldata _adapterParams\\n ) external payable;\\n\\n /**\\n * @dev returns the circulating amount of tokens on current chain\\n */\\n function circulatingSupply() external view returns (uint);\\n\\n /**\\n * @dev returns the address of the ERC20 token\\n */\\n function token() external view returns (address);\\n\\n /**\\n * @dev Emitted when `_amount` tokens are moved from the `_sender` to (`_dstChainId`, `_toAddress`)\\n * `_nonce` is the outbound nonce\\n */\\n event SendToChain(uint16 indexed _dstChainId, address indexed _from, bytes _toAddress, uint _amount);\\n\\n /**\\n * @dev Emitted when `_amount` tokens are received from `_srcChainId` into the `_toAddress` on the local chain.\\n * `_nonce` is the inbound nonce.\\n */\\n event ReceiveFromChain(uint16 indexed _srcChainId, address indexed _to, uint _amount);\\n\\n event SetUseCustomAdapterParams(bool _useCustomAdapterParams);\\n}\\n\",\"keccak256\":\"0x22651924296f8308db8195d7a86a6781023241c53905418f2d3925e3f693f530\",\"license\":\"MIT\"},\"contracts/dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/composable/IComposableOFTCoreUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.5.0;\\n\\nimport \\\"../IOFTCoreUpgradeable.sol\\\";\\n\\n/**\\n * @dev Interface of the composable OFT core standard\\n */\\ninterface IComposableOFTCoreUpgradeable is IOFTCoreUpgradeable {\\n function estimateSendAndCallFee(\\n uint16 _dstChainId,\\n bytes calldata _toAddress,\\n uint _amount,\\n bytes calldata _payload,\\n uint64 _dstGasForCall,\\n bool _useZro,\\n bytes calldata _adapterParams\\n ) external view returns (uint nativeFee, uint zroFee);\\n\\n function sendAndCall(\\n address _from,\\n uint16 _dstChainId,\\n bytes calldata _toAddress,\\n uint _amount,\\n bytes calldata _payload,\\n uint64 _dstGasForCall,\\n address payable _refundAddress,\\n address _zroPaymentAddress,\\n bytes calldata _adapterParams\\n ) external payable;\\n\\n function retryOFTReceived(\\n uint16 _srcChainId,\\n bytes calldata _srcAddress,\\n uint64 _nonce,\\n bytes calldata _from,\\n address _to,\\n uint _amount,\\n bytes calldata _payload\\n ) external;\\n\\n event CallOFTReceivedFailure(\\n uint16 indexed _srcChainId,\\n bytes _srcAddress,\\n uint64 _nonce,\\n bytes _from,\\n address indexed _to,\\n uint _amount,\\n bytes _payload,\\n bytes _reason\\n );\\n\\n event CallOFTReceivedSuccess(uint16 indexed _srcChainId, bytes _srcAddress, uint64 _nonce, bytes32 _hash);\\n\\n event RetryOFTReceivedSuccess(bytes32 _messageHash);\\n\\n event NonContractAddress(address _address);\\n}\\n\",\"keccak256\":\"0x769b9356ad6019bdabdcfc11762f28d15eb9a4e262efc96835725f6862c5d9e9\",\"license\":\"MIT\"},\"contracts/dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/composable/IOFTReceiverUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.5.0;\\n\\ninterface IOFTReceiverUpgradeable {\\n /**\\n * @dev Called by the OFT contract when tokens are received from source chain.\\n * @param _srcChainId The chain id of the source chain.\\n * @param _srcAddress The address of the OFT token contract on the source chain.\\n * @param _nonce The nonce of the transaction on the source chain.\\n * @param _from The address of the account who calls the sendAndCall() on the source chain.\\n * @param _amount The amount of tokens to transfer.\\n * @param _payload Additional data with no specified format.\\n */\\n function onOFTReceived(\\n uint16 _srcChainId,\\n bytes calldata _srcAddress,\\n uint64 _nonce,\\n bytes calldata _from,\\n uint _amount,\\n bytes calldata _payload\\n ) external;\\n}\\n\",\"keccak256\":\"0x287036c704c57e34a6fc3f7e67c8dfaaade6eb3667b570576bc491c0f1f89a5b\",\"license\":\"MIT\"},\"contracts/dependencies/@layerzerolabs/solidity-examples/util/BytesLib.sol\":{\"content\":\"// SPDX-License-Identifier: Unlicense\\n/*\\n * @title Solidity Bytes Arrays Utils\\n * @author Gon\\u00e7alo S\\u00e1 \\n *\\n * @dev Bytes tightly packed arrays utility library for ethereum contracts written in Solidity.\\n * The library lets you concatenate, slice and type cast bytes arrays both in memory and storage.\\n */\\npragma solidity >=0.8.0 <0.9.0;\\n\\nlibrary BytesLib {\\n function concat(bytes memory _preBytes, bytes memory _postBytes) internal pure returns (bytes memory) {\\n bytes memory tempBytes;\\n\\n assembly {\\n // Get a location of some free memory and store it in tempBytes as\\n // Solidity does for memory variables.\\n tempBytes := mload(0x40)\\n\\n // Store the length of the first bytes array at the beginning of\\n // the memory for tempBytes.\\n let length := mload(_preBytes)\\n mstore(tempBytes, length)\\n\\n // Maintain a memory counter for the current write location in the\\n // temp bytes array by adding the 32 bytes for the array length to\\n // the starting location.\\n let mc := add(tempBytes, 0x20)\\n // Stop copying when the memory counter reaches the length of the\\n // first bytes array.\\n let end := add(mc, length)\\n\\n for {\\n // Initialize a copy counter to the start of the _preBytes data,\\n // 32 bytes into its memory.\\n let cc := add(_preBytes, 0x20)\\n } lt(mc, end) {\\n // Increase both counters by 32 bytes each iteration.\\n mc := add(mc, 0x20)\\n cc := add(cc, 0x20)\\n } {\\n // Write the _preBytes data into the tempBytes memory 32 bytes\\n // at a time.\\n mstore(mc, mload(cc))\\n }\\n\\n // Add the length of _postBytes to the current length of tempBytes\\n // and store it as the new length in the first 32 bytes of the\\n // tempBytes memory.\\n length := mload(_postBytes)\\n mstore(tempBytes, add(length, mload(tempBytes)))\\n\\n // Move the memory counter back from a multiple of 0x20 to the\\n // actual end of the _preBytes data.\\n mc := end\\n // Stop copying when the memory counter reaches the new combined\\n // length of the arrays.\\n end := add(mc, length)\\n\\n for {\\n let cc := add(_postBytes, 0x20)\\n } lt(mc, end) {\\n mc := add(mc, 0x20)\\n cc := add(cc, 0x20)\\n } {\\n mstore(mc, mload(cc))\\n }\\n\\n // Update the free-memory pointer by padding our last write location\\n // to 32 bytes: add 31 bytes to the end of tempBytes to move to the\\n // next 32 byte block, then round down to the nearest multiple of\\n // 32. If the sum of the length of the two arrays is zero then add\\n // one before rounding down to leave a blank 32 bytes (the length block with 0).\\n mstore(\\n 0x40,\\n and(\\n add(add(end, iszero(add(length, mload(_preBytes)))), 31),\\n not(31) // Round down to the nearest 32 bytes.\\n )\\n )\\n }\\n\\n return tempBytes;\\n }\\n\\n function concatStorage(bytes storage _preBytes, bytes memory _postBytes) internal {\\n assembly {\\n // Read the first 32 bytes of _preBytes storage, which is the length\\n // of the array. (We don't need to use the offset into the slot\\n // because arrays use the entire slot.)\\n let fslot := sload(_preBytes.slot)\\n // Arrays of 31 bytes or less have an even value in their slot,\\n // while longer arrays have an odd value. The actual length is\\n // the slot divided by two for odd values, and the lowest order\\n // byte divided by two for even values.\\n // If the slot is even, bitwise and the slot with 255 and divide by\\n // two to get the length. If the slot is odd, bitwise and the slot\\n // with -1 and divide by two.\\n let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2)\\n let mlength := mload(_postBytes)\\n let newlength := add(slength, mlength)\\n // slength can contain both the length and contents of the array\\n // if length < 32 bytes so let's prepare for that\\n // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage\\n switch add(lt(slength, 32), lt(newlength, 32))\\n case 2 {\\n // Since the new array still fits in the slot, we just need to\\n // update the contents of the slot.\\n // uint256(bytes_storage) = uint256(bytes_storage) + uint256(bytes_memory) + new_length\\n sstore(\\n _preBytes.slot,\\n // all the modifications to the slot are inside this\\n // next block\\n add(\\n // we can just add to the slot contents because the\\n // bytes we want to change are the LSBs\\n fslot,\\n add(\\n mul(\\n div(\\n // load the bytes from memory\\n mload(add(_postBytes, 0x20)),\\n // zero all bytes to the right\\n exp(0x100, sub(32, mlength))\\n ),\\n // and now shift left the number of bytes to\\n // leave space for the length in the slot\\n exp(0x100, sub(32, newlength))\\n ),\\n // increase length by the double of the memory\\n // bytes length\\n mul(mlength, 2)\\n )\\n )\\n )\\n }\\n case 1 {\\n // The stored value fits in the slot, but the combined value\\n // will exceed it.\\n // get the keccak hash to get the contents of the array\\n mstore(0x0, _preBytes.slot)\\n let sc := add(keccak256(0x0, 0x20), div(slength, 32))\\n\\n // save new length\\n sstore(_preBytes.slot, add(mul(newlength, 2), 1))\\n\\n // The contents of the _postBytes array start 32 bytes into\\n // the structure. Our first read should obtain the `submod`\\n // bytes that can fit into the unused space in the last word\\n // of the stored array. To get this, we read 32 bytes starting\\n // from `submod`, so the data we read overlaps with the array\\n // contents by `submod` bytes. Masking the lowest-order\\n // `submod` bytes allows us to add that value directly to the\\n // stored value.\\n\\n let submod := sub(32, slength)\\n let mc := add(_postBytes, submod)\\n let end := add(_postBytes, mlength)\\n let mask := sub(exp(0x100, submod), 1)\\n\\n sstore(\\n sc,\\n add(\\n and(fslot, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00),\\n and(mload(mc), mask)\\n )\\n )\\n\\n for {\\n mc := add(mc, 0x20)\\n sc := add(sc, 1)\\n } lt(mc, end) {\\n sc := add(sc, 1)\\n mc := add(mc, 0x20)\\n } {\\n sstore(sc, mload(mc))\\n }\\n\\n mask := exp(0x100, sub(mc, end))\\n\\n sstore(sc, mul(div(mload(mc), mask), mask))\\n }\\n default {\\n // get the keccak hash to get the contents of the array\\n mstore(0x0, _preBytes.slot)\\n // Start copying to the last used word of the stored array.\\n let sc := add(keccak256(0x0, 0x20), div(slength, 32))\\n\\n // save new length\\n sstore(_preBytes.slot, add(mul(newlength, 2), 1))\\n\\n // Copy over the first `submod` bytes of the new data as in\\n // case 1 above.\\n let slengthmod := mod(slength, 32)\\n let mlengthmod := mod(mlength, 32)\\n let submod := sub(32, slengthmod)\\n let mc := add(_postBytes, submod)\\n let end := add(_postBytes, mlength)\\n let mask := sub(exp(0x100, submod), 1)\\n\\n sstore(sc, add(sload(sc), and(mload(mc), mask)))\\n\\n for {\\n sc := add(sc, 1)\\n mc := add(mc, 0x20)\\n } lt(mc, end) {\\n sc := add(sc, 1)\\n mc := add(mc, 0x20)\\n } {\\n sstore(sc, mload(mc))\\n }\\n\\n mask := exp(0x100, sub(mc, end))\\n\\n sstore(sc, mul(div(mload(mc), mask), mask))\\n }\\n }\\n }\\n\\n function slice(bytes memory _bytes, uint256 _start, uint256 _length) internal pure returns (bytes memory) {\\n require(_length + 31 >= _length, \\\"slice_overflow\\\");\\n require(_bytes.length >= _start + _length, \\\"slice_outOfBounds\\\");\\n\\n bytes memory tempBytes;\\n\\n assembly {\\n switch iszero(_length)\\n case 0 {\\n // Get a location of some free memory and store it in tempBytes as\\n // Solidity does for memory variables.\\n tempBytes := mload(0x40)\\n\\n // The first word of the slice result is potentially a partial\\n // word read from the original array. To read it, we calculate\\n // the length of that partial word and start copying that many\\n // bytes into the array. The first word we copy will start with\\n // data we don't care about, but the last `lengthmod` bytes will\\n // land at the beginning of the contents of the new array. When\\n // we're done copying, we overwrite the full first word with\\n // the actual length of the slice.\\n let lengthmod := and(_length, 31)\\n\\n // The multiplication in the next line is necessary\\n // because when slicing multiples of 32 bytes (lengthmod == 0)\\n // the following copy loop was copying the origin's length\\n // and then ending prematurely not copying everything it should.\\n let mc := add(add(tempBytes, lengthmod), mul(0x20, iszero(lengthmod)))\\n let end := add(mc, _length)\\n\\n for {\\n // The multiplication in the next line has the same exact purpose\\n // as the one above.\\n let cc := add(add(add(_bytes, lengthmod), mul(0x20, iszero(lengthmod))), _start)\\n } lt(mc, end) {\\n mc := add(mc, 0x20)\\n cc := add(cc, 0x20)\\n } {\\n mstore(mc, mload(cc))\\n }\\n\\n mstore(tempBytes, _length)\\n\\n //update free-memory pointer\\n //allocating the array padded to 32 bytes like the compiler does now\\n mstore(0x40, and(add(mc, 31), not(31)))\\n }\\n //if we want a zero-length slice let's just return a zero-length array\\n default {\\n tempBytes := mload(0x40)\\n //zero out the 32 bytes slice we are about to return\\n //we need to do it because Solidity does not garbage collect\\n mstore(tempBytes, 0)\\n\\n mstore(0x40, add(tempBytes, 0x20))\\n }\\n }\\n\\n return tempBytes;\\n }\\n\\n function toAddress(bytes memory _bytes, uint256 _start) internal pure returns (address) {\\n require(_bytes.length >= _start + 20, \\\"toAddress_outOfBounds\\\");\\n address tempAddress;\\n\\n assembly {\\n tempAddress := div(mload(add(add(_bytes, 0x20), _start)), 0x1000000000000000000000000)\\n }\\n\\n return tempAddress;\\n }\\n\\n function toUint8(bytes memory _bytes, uint256 _start) internal pure returns (uint8) {\\n require(_bytes.length >= _start + 1, \\\"toUint8_outOfBounds\\\");\\n uint8 tempUint;\\n\\n assembly {\\n tempUint := mload(add(add(_bytes, 0x1), _start))\\n }\\n\\n return tempUint;\\n }\\n\\n function toUint16(bytes memory _bytes, uint256 _start) internal pure returns (uint16) {\\n require(_bytes.length >= _start + 2, \\\"toUint16_outOfBounds\\\");\\n uint16 tempUint;\\n\\n assembly {\\n tempUint := mload(add(add(_bytes, 0x2), _start))\\n }\\n\\n return tempUint;\\n }\\n\\n function toUint32(bytes memory _bytes, uint256 _start) internal pure returns (uint32) {\\n require(_bytes.length >= _start + 4, \\\"toUint32_outOfBounds\\\");\\n uint32 tempUint;\\n\\n assembly {\\n tempUint := mload(add(add(_bytes, 0x4), _start))\\n }\\n\\n return tempUint;\\n }\\n\\n function toUint64(bytes memory _bytes, uint256 _start) internal pure returns (uint64) {\\n require(_bytes.length >= _start + 8, \\\"toUint64_outOfBounds\\\");\\n uint64 tempUint;\\n\\n assembly {\\n tempUint := mload(add(add(_bytes, 0x8), _start))\\n }\\n\\n return tempUint;\\n }\\n\\n function toUint96(bytes memory _bytes, uint256 _start) internal pure returns (uint96) {\\n require(_bytes.length >= _start + 12, \\\"toUint96_outOfBounds\\\");\\n uint96 tempUint;\\n\\n assembly {\\n tempUint := mload(add(add(_bytes, 0xc), _start))\\n }\\n\\n return tempUint;\\n }\\n\\n function toUint128(bytes memory _bytes, uint256 _start) internal pure returns (uint128) {\\n require(_bytes.length >= _start + 16, \\\"toUint128_outOfBounds\\\");\\n uint128 tempUint;\\n\\n assembly {\\n tempUint := mload(add(add(_bytes, 0x10), _start))\\n }\\n\\n return tempUint;\\n }\\n\\n function toUint256(bytes memory _bytes, uint256 _start) internal pure returns (uint256) {\\n require(_bytes.length >= _start + 32, \\\"toUint256_outOfBounds\\\");\\n uint256 tempUint;\\n\\n assembly {\\n tempUint := mload(add(add(_bytes, 0x20), _start))\\n }\\n\\n return tempUint;\\n }\\n\\n function toBytes32(bytes memory _bytes, uint256 _start) internal pure returns (bytes32) {\\n require(_bytes.length >= _start + 32, \\\"toBytes32_outOfBounds\\\");\\n bytes32 tempBytes32;\\n\\n assembly {\\n tempBytes32 := mload(add(add(_bytes, 0x20), _start))\\n }\\n\\n return tempBytes32;\\n }\\n\\n function equal(bytes memory _preBytes, bytes memory _postBytes) internal pure returns (bool) {\\n bool success = true;\\n\\n assembly {\\n let length := mload(_preBytes)\\n\\n // if lengths don't match the arrays are not equal\\n switch eq(length, mload(_postBytes))\\n case 1 {\\n // cb is a circuit breaker in the for loop since there's\\n // no said feature for inline assembly loops\\n // cb = 1 - don't breaker\\n // cb = 0 - break\\n let cb := 1\\n\\n let mc := add(_preBytes, 0x20)\\n let end := add(mc, length)\\n\\n for {\\n let cc := add(_postBytes, 0x20)\\n // the next line is the loop condition:\\n // while(uint256(mc < end) + cb == 2)\\n } eq(add(lt(mc, end), cb), 2) {\\n mc := add(mc, 0x20)\\n cc := add(cc, 0x20)\\n } {\\n // if any of these checks fails then arrays are not equal\\n if iszero(eq(mload(mc), mload(cc))) {\\n // unsuccess:\\n success := 0\\n cb := 0\\n }\\n }\\n }\\n default {\\n // unsuccess:\\n success := 0\\n }\\n }\\n\\n return success;\\n }\\n\\n function equalStorage(bytes storage _preBytes, bytes memory _postBytes) internal view returns (bool) {\\n bool success = true;\\n\\n assembly {\\n // we know _preBytes_offset is 0\\n let fslot := sload(_preBytes.slot)\\n // Decode the length of the stored array like in concatStorage().\\n let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2)\\n let mlength := mload(_postBytes)\\n\\n // if lengths don't match the arrays are not equal\\n switch eq(slength, mlength)\\n case 1 {\\n // slength can contain both the length and contents of the array\\n // if length < 32 bytes so let's prepare for that\\n // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage\\n if iszero(iszero(slength)) {\\n switch lt(slength, 32)\\n case 1 {\\n // blank the last byte which is the length\\n fslot := mul(div(fslot, 0x100), 0x100)\\n\\n if iszero(eq(fslot, mload(add(_postBytes, 0x20)))) {\\n // unsuccess:\\n success := 0\\n }\\n }\\n default {\\n // cb is a circuit breaker in the for loop since there's\\n // no said feature for inline assembly loops\\n // cb = 1 - don't breaker\\n // cb = 0 - break\\n let cb := 1\\n\\n // get the keccak hash to get the contents of the array\\n mstore(0x0, _preBytes.slot)\\n let sc := keccak256(0x0, 0x20)\\n\\n let mc := add(_postBytes, 0x20)\\n let end := add(mc, mlength)\\n\\n // the next line is the loop condition:\\n // while(uint256(mc < end) + cb == 2)\\n for {\\n\\n } eq(add(lt(mc, end), cb), 2) {\\n sc := add(sc, 1)\\n mc := add(mc, 0x20)\\n } {\\n if iszero(eq(sload(sc), mload(mc))) {\\n // unsuccess:\\n success := 0\\n cb := 0\\n }\\n }\\n }\\n }\\n }\\n default {\\n // unsuccess:\\n success := 0\\n }\\n }\\n\\n return success;\\n }\\n}\\n\",\"keccak256\":\"0xaa1c57864bd8483bb17f2fa96a0cbebb39006ca7aab1a28ff85e52e487437c4c\",\"license\":\"Unlicense\"},\"contracts/dependencies/openzeppelin-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.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 * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\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. Equivalent to `reinitializer(1)`.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = _setInitializedVersion(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 * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original\\n * initialization step. This is essential to configure modules that are added through upgrades and that require\\n * initialization.\\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 modifier reinitializer(uint8 version) {\\n bool isTopLevelCall = _setInitializedVersion(version);\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(version);\\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} 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 function _disableInitializers() internal virtual {\\n _setInitializedVersion(type(uint8).max);\\n }\\n\\n function _setInitializedVersion(uint8 version) private returns (bool) {\\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, and for the lowest level\\n // of initializers, because in other contexts the contract may have been reentered.\\n if (_initializing) {\\n require(\\n version == 1 && !AddressUpgradeable.isContract(address(this)),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n return false;\\n } else {\\n require(_initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n return true;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x7454006cccb737612b00104d2f606d728e2818b778e7e55542f063c614ce46ba\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin-upgradeable/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.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 *\\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 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\":\"0x55cf2bd9fc76704ddcdc19834cd288b7de00fc0f298a40ea16a954ae8991db2d\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin-upgradeable/utils/introspection/IERC165Upgradeable.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 IERC165Upgradeable {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0xc6cef87559d0aeffdf0a99803de655938a7779ec0a3cd5d4383483ad85565a09\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\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 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 `recipient`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address recipient, 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 `sender` to `recipient` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address sender,\\n address recipient,\\n uint256 amount\\n ) external returns (bool);\\n\\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\",\"keccak256\":\"0x027b891937d20ccf213fdb9c31531574256de774bda99d3a70ecef6e1913ed2a\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\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\":\"0x83fe24f5c04a56091e50f4a345ff504c8bff658a76d4c43b16878c8f940c53b2\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin/token/ERC20/utils/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\nimport \\\"../../../utils/Address.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n using Address for address;\\n\\n function safeTransfer(\\n IERC20 token,\\n address to,\\n uint256 value\\n ) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n function safeTransferFrom(\\n IERC20 token,\\n address from,\\n address to,\\n uint256 value\\n ) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\\n }\\n\\n /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\n */\\n function safeApprove(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n // safeApprove should only be called when setting an initial allowance,\\n // or when resetting it to zero. To increase and decrease it, use\\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\\n require(\\n (value == 0) || (token.allowance(address(this), spender) == 0),\\n \\\"SafeERC20: approve from non-zero to non-zero allowance\\\"\\n );\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\\n }\\n\\n function safeIncreaseAllowance(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n uint256 newAllowance = token.allowance(address(this), spender) + value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n unchecked {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n require(oldAllowance >= value, \\\"SafeERC20: decreased allowance below zero\\\");\\n uint256 newAllowance = oldAllowance - value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\n if (returndata.length > 0) {\\n // Return data is optional\\n require(abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0x02348b2e4b9f3200c7e3907c5c2661643a6d8520e9f79939fbb9b4005a54894d\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.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\":\"0x2ccf9d2313a313d41a791505f2b5abfdc62191b5d4334f7f7a82691c088a1c87\",\"license\":\"MIT\"},\"contracts/dependencies/stargate-protocol/interfaces/IStargateComposer.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./IStargateRouter.sol\\\";\\n\\ninterface IStargateComposer {\\n function swap(\\n uint16 _dstChainId,\\n uint256 _srcPoolId,\\n uint256 _dstPoolId,\\n address payable _refundAddress,\\n uint256 _amountLD,\\n uint256 _minAmountLD,\\n IStargateRouter.lzTxObj memory _lzTxParams,\\n bytes calldata _to,\\n bytes calldata _payload\\n ) external payable;\\n\\n function factory() external view returns (address);\\n\\n function stargateBridge() external view returns (address);\\n\\n function stargateRouter() external view returns (IStargateRouter);\\n\\n function quoteLayerZeroFee(\\n uint16 _dstChainId,\\n uint8 _functionType,\\n bytes calldata _toAddress,\\n bytes calldata _transferAndCallPayload,\\n IStargateRouter.lzTxObj memory _lzTxParams\\n ) external view returns (uint256, uint256);\\n\\n function peers(uint16 _chainId) external view returns (address);\\n}\\n\",\"keccak256\":\"0xdfdd1690bf176ac05803534a60227be90cc435b4bdd8fce2348f1a9417a9f63a\",\"license\":\"BUSL-1.1\"},\"contracts/dependencies/stargate-protocol/interfaces/IStargateReceiver.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\n\\npragma solidity 0.8.9;\\n\\ninterface IStargateReceiver {\\n function sgReceive(\\n uint16 _chainId,\\n bytes memory _srcAddress,\\n uint256 _nonce,\\n address _token,\\n uint256 amountLD,\\n bytes memory payload\\n ) external;\\n}\\n\",\"keccak256\":\"0xe4d6bf9fa422e5e43dc1b6880f951d06611a4ed12c2dd7dd8c0b6a5d9e06ad0d\",\"license\":\"BUSL-1.1\"},\"contracts/dependencies/stargate-protocol/interfaces/IStargateRouter.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\n\\npragma solidity 0.8.9;\\n\\ninterface IStargateRouter {\\n struct lzTxObj {\\n uint256 dstGasForCall;\\n uint256 dstNativeAmount;\\n bytes dstNativeAddr;\\n }\\n\\n function addLiquidity(uint256 _poolId, uint256 _amountLD, address _to) external;\\n\\n function swap(\\n uint16 _dstChainId,\\n uint256 _srcPoolId,\\n uint256 _dstPoolId,\\n address payable _refundAddress,\\n uint256 _amountLD,\\n uint256 _minAmountLD,\\n lzTxObj memory _lzTxParams,\\n bytes calldata _to,\\n bytes calldata _payload\\n ) external payable;\\n\\n function redeemRemote(\\n uint16 _dstChainId,\\n uint256 _srcPoolId,\\n uint256 _dstPoolId,\\n address payable _refundAddress,\\n uint256 _amountLP,\\n uint256 _minAmountLD,\\n bytes calldata _to,\\n lzTxObj memory _lzTxParams\\n ) external payable;\\n\\n function instantRedeemLocal(uint16 _srcPoolId, uint256 _amountLP, address _to) external returns (uint256);\\n\\n function redeemLocal(\\n uint16 _dstChainId,\\n uint256 _srcPoolId,\\n uint256 _dstPoolId,\\n address payable _refundAddress,\\n uint256 _amountLP,\\n bytes calldata _to,\\n lzTxObj memory _lzTxParams\\n ) external payable;\\n\\n function sendCredits(\\n uint16 _dstChainId,\\n uint256 _srcPoolId,\\n uint256 _dstPoolId,\\n address payable _refundAddress\\n ) external payable;\\n\\n function quoteLayerZeroFee(\\n uint16 _dstChainId,\\n uint8 _functionType,\\n bytes calldata _toAddress,\\n bytes calldata _transferAndCallPayload,\\n lzTxObj memory _lzTxParams\\n ) external view returns (uint256, uint256);\\n\\n function clearCachedSwap(uint16 _srcChainId, bytes calldata _srcAddress, uint256 _nonce) external;\\n\\n function factory() external view returns (address);\\n\\n function bridge() external view returns (address);\\n\\n function cachedSwapLookup(\\n uint16 _chainId_,\\n bytes calldata _srcAddress,\\n uint256 _nonce\\n ) external view returns (address token, uint256 amountLD, address to, bytes memory payload);\\n}\\n\",\"keccak256\":\"0x92126df8e682b2c5647c7b22e7387da69f9e72480af86948ce5ed17dc2c9e0a7\",\"license\":\"BUSL-1.1\"},\"contracts/interfaces/ICrossChainDispatcher.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/composable/IOFTReceiverUpgradeable.sol\\\";\\nimport \\\"../dependencies/stargate-protocol/interfaces/IStargateReceiver.sol\\\";\\nimport \\\"../dependencies/stargate-protocol/interfaces/IStargateRouter.sol\\\";\\nimport \\\"../dependencies/stargate-protocol/interfaces/IStargateComposer.sol\\\";\\nimport \\\"./IProxyOFT.sol\\\";\\n\\ninterface ICrossChainDispatcher is IStargateReceiver, IOFTReceiverUpgradeable {\\n function crossChainDispatcherOf(uint16 chainId_) external view returns (address);\\n\\n function triggerFlashRepaySwap(\\n uint256 id_,\\n address payable account_,\\n address tokenIn_,\\n address tokenOut_,\\n uint256 amountIn_,\\n uint256 amountOutMin_,\\n bytes calldata lzArgs_\\n ) external payable;\\n\\n function triggerLeverageSwap(\\n uint256 id_,\\n address payable account_,\\n address tokenIn_,\\n address tokenOut_,\\n uint256 amountIn_,\\n uint256 amountOutMin,\\n bytes calldata lzArgs_\\n ) external payable;\\n\\n function isBridgingActive() external view returns (bool);\\n\\n function flashRepayCallbackTxGasLimit() external view returns (uint64);\\n\\n function flashRepaySwapTxGasLimit() external view returns (uint64);\\n\\n function leverageCallbackTxGasLimit() external view returns (uint64);\\n\\n function leverageSwapTxGasLimit() external view returns (uint64);\\n\\n function lzBaseGasLimit() external view returns (uint256);\\n\\n function stargateComposer() external view returns (IStargateComposer);\\n\\n function stargateSlippage() external view returns (uint256);\\n\\n function stargatePoolIdOf(address token_) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xcaf05e625588dcfaa5706acc78a35fa46d50baeb2d28f689036963695a4e39cb\",\"license\":\"MIT\"},\"contracts/interfaces/IDebtToken.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/openzeppelin/token/ERC20/extensions/IERC20Metadata.sol\\\";\\nimport \\\"./ISyntheticToken.sol\\\";\\n\\ninterface IDebtToken is IERC20Metadata {\\n function lastTimestampAccrued() external view returns (uint256);\\n\\n function isActive() external view returns (bool);\\n\\n function syntheticToken() external view returns (ISyntheticToken);\\n\\n function accrueInterest() external;\\n\\n function debtIndex() external returns (uint256 debtIndex_);\\n\\n function burn(address from_, uint256 amount_) external;\\n\\n function issue(uint256 amount_, address to_) external returns (uint256 _issued, uint256 _fee);\\n\\n function flashIssue(address to_, uint256 amount_) external returns (uint256 _issued, uint256 _fee);\\n\\n function mint(address to_, uint256 amount_) external;\\n\\n function repay(address onBehalfOf_, uint256 amount_) external returns (uint256 _repaid, uint256 _fee);\\n\\n function repayAll(address onBehalfOf_) external returns (uint256 _repaid, uint256 _fee);\\n\\n function quoteIssueIn(uint256 amountToIssue_) external view returns (uint256 _amount, uint256 _fee);\\n\\n function quoteIssueOut(uint256 amount_) external view returns (uint256 _amountToIssue, uint256 _fee);\\n\\n function quoteRepayIn(uint256 amountToRepay_) external view returns (uint256 _amount, uint256 _fee);\\n\\n function quoteRepayOut(uint256 amount_) external view returns (uint256 _amountToRepay, uint256 _fee);\\n\\n function updateMaxTotalSupply(uint256 newMaxTotalSupply_) external;\\n\\n function updateInterestRate(uint256 newInterestRate_) external;\\n\\n function maxTotalSupply() external view returns (uint256);\\n\\n function interestRate() external view returns (uint256);\\n\\n function interestRatePerSecond() external view returns (uint256);\\n\\n function toggleIsActive() external;\\n}\\n\",\"keccak256\":\"0xd2f04aa1bee06d6991b10aaf7c03c3ee09d85f8e48ba92feac595ad855881380\",\"license\":\"MIT\"},\"contracts/interfaces/IDepositToken.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/openzeppelin/token/ERC20/extensions/IERC20Metadata.sol\\\";\\n\\ninterface IDepositToken is IERC20Metadata {\\n function underlying() external view returns (IERC20);\\n\\n function collateralFactor() external view returns (uint256);\\n\\n function unlockedBalanceOf(address account_) external view returns (uint256);\\n\\n function lockedBalanceOf(address account_) external view returns (uint256);\\n\\n function flashWithdraw(address account_, uint256 amount_) external returns (uint256 _withdrawn, uint256 _fee);\\n\\n function deposit(uint256 amount_, address onBehalfOf_) external returns (uint256 _deposited, uint256 _fee);\\n\\n function quoteDepositIn(uint256 amountToDeposit_) external view returns (uint256 _amount, uint256 _fee);\\n\\n function quoteDepositOut(uint256 amount_) external view returns (uint256 _amountToDeposit, uint256 _fee);\\n\\n function quoteWithdrawIn(uint256 amountToWithdraw_) external view returns (uint256 _amount, uint256 _fee);\\n\\n function quoteWithdrawOut(uint256 amount_) external view returns (uint256 _amountToWithdraw, uint256 _fee);\\n\\n function withdraw(uint256 amount_, address to_) external returns (uint256 _withdrawn, uint256 _fee);\\n\\n function seize(address from_, address to_, uint256 amount_) external;\\n\\n function updateCollateralFactor(uint128 newCollateralFactor_) external;\\n\\n function isActive() external view returns (bool);\\n\\n function toggleIsActive() external;\\n\\n function maxTotalSupply() external view returns (uint256);\\n\\n function updateMaxTotalSupply(uint256 newMaxTotalSupply_) external;\\n\\n function withdrawFrom(address from_, uint256 amount_) external returns (uint256 _withdrawn, uint256 _fee);\\n}\\n\",\"keccak256\":\"0xb27092f9450d9c48c1a215925007ca9c7282cfe6cf257b34ab3dbe6e745b6bd1\",\"license\":\"MIT\"},\"contracts/interfaces/IFeeProvider.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\n/**\\n * @notice FeeProvider interface\\n */\\ninterface IFeeProvider {\\n struct LiquidationFees {\\n uint128 liquidatorIncentive;\\n uint128 protocolFee;\\n }\\n\\n function defaultSwapFee() external view returns (uint256);\\n\\n function depositFee() external view returns (uint256);\\n\\n function issueFee() external view returns (uint256);\\n\\n function liquidationFees() external view returns (uint128 liquidatorIncentive, uint128 protocolFee);\\n\\n function repayFee() external view returns (uint256);\\n\\n function swapFeeFor(address account_) external view returns (uint256);\\n\\n function withdrawFee() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x3b132b42090c167b2c0aef6d78d833c669c43b9e55593a7a21a96ed5d3082700\",\"license\":\"MIT\"},\"contracts/interfaces/IGovernable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\n/**\\n * @notice Governable interface\\n */\\ninterface IGovernable {\\n function governor() external view returns (address _governor);\\n\\n function transferGovernorship(address _proposedGovernor) external;\\n}\\n\",\"keccak256\":\"0xbe84461adf33aec1bf31b6d84a5380aaeb791de9a4b95346dd8270dc6632984e\",\"license\":\"MIT\"},\"contracts/interfaces/IManageable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./IPool.sol\\\";\\n\\n/**\\n * @notice Manageable interface\\n */\\ninterface IManageable {\\n function pool() external view returns (IPool _pool);\\n}\\n\",\"keccak256\":\"0xac88e0997a26942cb9cbda1a7dd9756e28ba2025813e5b07e55939fbf8538ea2\",\"license\":\"MIT\"},\"contracts/interfaces/IPauseable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\ninterface IPauseable {\\n function paused() external view returns (bool);\\n\\n function everythingStopped() external view returns (bool);\\n}\\n\",\"keccak256\":\"0xa768de9fadad05a8104cb407ae6243354e70ffd6e1a50c3e0bb0a6a1dc49d32a\",\"license\":\"MIT\"},\"contracts/interfaces/IPool.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./IDepositToken.sol\\\";\\nimport \\\"./IDebtToken.sol\\\";\\nimport \\\"./ITreasury.sol\\\";\\nimport \\\"./IRewardsDistributor.sol\\\";\\nimport \\\"./IPoolRegistry.sol\\\";\\nimport \\\"./IFeeProvider.sol\\\";\\nimport \\\"./ISmartFarmingManager.sol\\\";\\nimport \\\"./external/ISwapper.sol\\\";\\nimport \\\"../interfaces/IFeeProvider.sol\\\";\\n\\n/**\\n * @notice Pool interface\\n */\\ninterface IPool is IPauseable, IGovernable {\\n function debtFloorInUsd() external view returns (uint256);\\n\\n function feeCollector() external view returns (address);\\n\\n function feeProvider() external view returns (IFeeProvider);\\n\\n function maxLiquidable() external view returns (uint256);\\n\\n function doesSyntheticTokenExist(ISyntheticToken syntheticToken_) external view returns (bool);\\n\\n function doesDebtTokenExist(IDebtToken debtToken_) external view returns (bool);\\n\\n function doesDepositTokenExist(IDepositToken depositToken_) external view returns (bool);\\n\\n function depositTokenOf(IERC20 underlying_) external view returns (IDepositToken);\\n\\n function debtTokenOf(ISyntheticToken syntheticToken_) external view returns (IDebtToken);\\n\\n function getDepositTokens() external view returns (address[] memory);\\n\\n function getDebtTokens() external view returns (address[] memory);\\n\\n function getRewardsDistributors() external view returns (address[] memory);\\n\\n function debtOf(address account_) external view returns (uint256 _debtInUsd);\\n\\n function depositOf(address account_) external view returns (uint256 _depositInUsd, uint256 _issuableLimitInUsd);\\n\\n function debtPositionOf(\\n address account_\\n )\\n external\\n view\\n returns (\\n bool _isHealthy,\\n uint256 _depositInUsd,\\n uint256 _debtInUsd,\\n uint256 _issuableLimitInUsd,\\n uint256 _issuableInUsd\\n );\\n\\n function liquidate(\\n ISyntheticToken syntheticToken_,\\n address account_,\\n uint256 amountToRepay_,\\n IDepositToken depositToken_\\n ) external returns (uint256 _totalSeized, uint256 _toLiquidator, uint256 _fee);\\n\\n function quoteLiquidateIn(\\n ISyntheticToken syntheticToken_,\\n uint256 totalToSeized_,\\n IDepositToken depositToken_\\n ) external view returns (uint256 _amountToRepay, uint256 _toLiquidator, uint256 _fee);\\n\\n function quoteLiquidateMax(\\n ISyntheticToken syntheticToken_,\\n address account_,\\n IDepositToken depositToken_\\n ) external view returns (uint256 _maxAmountToRepay);\\n\\n function quoteLiquidateOut(\\n ISyntheticToken syntheticToken_,\\n uint256 amountToRepay_,\\n IDepositToken depositToken_\\n ) external view returns (uint256 _totalSeized, uint256 _toLiquidator, uint256 _fee);\\n\\n function quoteSwapIn(\\n ISyntheticToken syntheticTokenIn_,\\n ISyntheticToken syntheticTokenOut_,\\n uint256 amountOut_\\n ) external view returns (uint256 _amountIn, uint256 _fee);\\n\\n function quoteSwapOut(\\n ISyntheticToken syntheticTokenIn_,\\n ISyntheticToken syntheticTokenOut_,\\n uint256 amountIn_\\n ) external view returns (uint256 _amountOut, uint256 _fee);\\n\\n function swap(\\n ISyntheticToken syntheticTokenIn_,\\n ISyntheticToken syntheticTokenOut_,\\n uint256 amountIn_\\n ) external returns (uint256 _amountOut, uint256 _fee);\\n\\n function treasury() external view returns (ITreasury);\\n\\n function masterOracle() external view returns (IMasterOracle);\\n\\n function poolRegistry() external view returns (IPoolRegistry);\\n\\n function addToDepositTokensOfAccount(address account_) external;\\n\\n function removeFromDepositTokensOfAccount(address account_) external;\\n\\n function addToDebtTokensOfAccount(address account_) external;\\n\\n function removeFromDebtTokensOfAccount(address account_) external;\\n\\n function getDepositTokensOfAccount(address account_) external view returns (address[] memory);\\n\\n function getDebtTokensOfAccount(address account_) external view returns (address[] memory);\\n\\n function isSwapActive() external view returns (bool);\\n\\n function smartFarmingManager() external view returns (ISmartFarmingManager);\\n}\\n\",\"keccak256\":\"0x0f0a869451cca858ba52b56970db167360fe161f2450557a053c4da938558816\",\"license\":\"MIT\"},\"contracts/interfaces/IPoolRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./external/IMasterOracle.sol\\\";\\nimport \\\"./IPauseable.sol\\\";\\nimport \\\"./IGovernable.sol\\\";\\nimport \\\"./ISyntheticToken.sol\\\";\\nimport \\\"./external/ISwapper.sol\\\";\\nimport \\\"./IQuoter.sol\\\";\\nimport \\\"./ICrossChainDispatcher.sol\\\";\\n\\ninterface IPoolRegistry is IPauseable, IGovernable {\\n function feeCollector() external view returns (address);\\n\\n function isPoolRegistered(address pool_) external view returns (bool);\\n\\n function nativeTokenGateway() external view returns (address);\\n\\n function getPools() external view returns (address[] memory);\\n\\n function registerPool(address pool_) external;\\n\\n function unregisterPool(address pool_) external;\\n\\n function masterOracle() external view returns (IMasterOracle);\\n\\n function updateFeeCollector(address newFeeCollector_) external;\\n\\n function idOfPool(address pool_) external view returns (uint256);\\n\\n function nextPoolId() external view returns (uint256);\\n\\n function swapper() external view returns (ISwapper);\\n\\n function quoter() external view returns (IQuoter);\\n\\n function crossChainDispatcher() external view returns (ICrossChainDispatcher);\\n\\n function doesSyntheticTokenExist(ISyntheticToken syntheticToken_) external view returns (bool _exists);\\n}\\n\",\"keccak256\":\"0x9ffa9e5fd39a48ac2bda561af7fb4fc9df5f8ffb7a602ef1d4da8c068019e723\",\"license\":\"MIT\"},\"contracts/interfaces/IProxyOFT.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/composable/IComposableOFTCoreUpgradeable.sol\\\";\\n\\ninterface IProxyOFT is IComposableOFTCoreUpgradeable {\\n function getProxyOFTOf(uint16 chainId_) external view returns (address _proxyOFT);\\n}\\n\",\"keccak256\":\"0x4041a90eb60de460c9e1631aaedfbf2bff2275b3f91964800b1c774546931cd5\",\"license\":\"MIT\"},\"contracts/interfaces/IQuoter.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./IPoolRegistry.sol\\\";\\nimport \\\"./IProxyOFT.sol\\\";\\n\\ninterface IQuoter {\\n function quoteCrossChainFlashRepayNativeFee(\\n IProxyOFT proxyOFT_,\\n bytes calldata lzArgs_\\n ) external view returns (uint256 _nativeFee);\\n\\n function quoteCrossChainLeverageNativeFee(\\n IProxyOFT proxyOFT_,\\n bytes calldata lzArgs_\\n ) external view returns (uint256 _nativeFee);\\n\\n function quoteLeverageCallbackNativeFee(uint16 dstChainId_) external view returns (uint256 _callbackTxNativeFee);\\n\\n function quoteFlashRepayCallbackNativeFee(uint16 dstChainId_) external view returns (uint256 _callbackTxNativeFee);\\n\\n function getFlashRepaySwapAndCallbackLzArgs(\\n uint16 srcChainId_,\\n uint16 dstChainId_\\n ) external view returns (bytes memory lzArgs_);\\n\\n function getLeverageSwapAndCallbackLzArgs(\\n uint16 srcChainId_,\\n uint16 dstChainId_\\n ) external view returns (bytes memory lzArgs_);\\n}\\n\",\"keccak256\":\"0x1e4d2dd779a09dc8ea6b6c244b167deddca3a48e71b73bf940da04113b40c752\",\"license\":\"MIT\"},\"contracts/interfaces/IRewardsDistributor.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/openzeppelin/token/ERC20/IERC20.sol\\\";\\n\\n/**\\n * @notice Reward Distributor interface\\n */\\ninterface IRewardsDistributor {\\n function rewardToken() external view returns (IERC20);\\n\\n function tokenSpeeds(IERC20 token_) external view returns (uint256);\\n\\n function tokensAccruedOf(address account_) external view returns (uint256);\\n\\n function updateBeforeMintOrBurn(IERC20 token_, address account_) external;\\n\\n function updateBeforeTransfer(IERC20 token_, address from_, address to_) external;\\n\\n function claimable(address account_) external view returns (uint256 _claimable);\\n\\n function claimable(address account_, IERC20 token_) external view returns (uint256 _claimable);\\n\\n function claimRewards(address account_) external;\\n\\n function claimRewards(address account_, IERC20[] memory tokens_) external;\\n\\n function claimRewards(address[] memory accounts_, IERC20[] memory tokens_) external;\\n\\n function updateTokenSpeed(IERC20 token_, uint256 newSpeed_) external;\\n\\n function updateTokenSpeeds(IERC20[] calldata tokens_, uint256[] calldata speeds_) external;\\n\\n function tokens(uint256) external view returns (IERC20);\\n\\n function tokenStates(IERC20) external view returns (uint224 index, uint32 timestamp);\\n\\n function accountIndexOf(IERC20, address) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x4f527eeae61b6a5bff7d3b48037234ef718ae7f71dc452e8cab3b60581f0d810\",\"license\":\"MIT\"},\"contracts/interfaces/ISmartFarmingManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./IManageable.sol\\\";\\nimport \\\"./IDepositToken.sol\\\";\\nimport \\\"./IDebtToken.sol\\\";\\n\\n/**\\n * @notice SmartFarmingManager interface\\n */\\ninterface ISmartFarmingManager {\\n function flashRepay(\\n ISyntheticToken syntheticToken_,\\n IDepositToken depositToken_,\\n uint256 withdrawAmount_,\\n uint256 repayAmountMin_\\n ) external returns (uint256 _withdrawn, uint256 _repaid);\\n\\n function crossChainFlashRepay(\\n ISyntheticToken syntheticToken_,\\n IDepositToken depositToken_,\\n uint256 withdrawAmount_,\\n IERC20 bridgeToken_,\\n uint256 bridgeTokenAmountMin_,\\n uint256 swapAmountOutMin_,\\n uint256 repayAmountMin_,\\n bytes calldata lzArgs_\\n ) external payable;\\n\\n function crossChainLeverage(\\n IERC20 tokenIn_,\\n IDepositToken depositToken_,\\n ISyntheticToken syntheticToken_,\\n uint256 amountIn_,\\n uint256 leverage_,\\n uint256 swapAmountOutMin_,\\n uint256 depositAmountMin_,\\n bytes calldata lzArgs_\\n ) external payable;\\n\\n function crossChainLeverageCallback(uint256 id_, uint256 swapAmountOut_) external returns (uint256 _deposited);\\n\\n function crossChainFlashRepayCallback(uint256 id_, uint256 swapAmountOut_) external returns (uint256 _repaid);\\n\\n function leverage(\\n IERC20 tokenIn_,\\n IDepositToken depositToken_,\\n ISyntheticToken syntheticToken_,\\n uint256 amountIn_,\\n uint256 leverage_,\\n uint256 depositAmountMin_\\n ) external returns (uint256 _deposited, uint256 _issued);\\n}\\n\",\"keccak256\":\"0x7544a9d308a49e24d6984c3cfcfe2c1cfb7d9ce4655408438e1c12f37175a3b0\",\"license\":\"MIT\"},\"contracts/interfaces/ISyntheticToken.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/openzeppelin/token/ERC20/extensions/IERC20Metadata.sol\\\";\\nimport \\\"./IDebtToken.sol\\\";\\nimport \\\"./IPoolRegistry.sol\\\";\\nimport \\\"../interfaces/IProxyOFT.sol\\\";\\n\\ninterface ISyntheticToken is IERC20Metadata {\\n function isActive() external view returns (bool);\\n\\n function mint(address to_, uint256 amount_) external;\\n\\n function burn(address from_, uint256 amount) external;\\n\\n function poolRegistry() external view returns (IPoolRegistry);\\n\\n function toggleIsActive() external;\\n\\n function seize(address from_, address to_, uint256 amount_) external;\\n\\n function updateMaxTotalSupply(uint256 newMaxTotalSupply_) external;\\n\\n function updateProxyOFT(IProxyOFT newProxyOFT_) external;\\n\\n function maxTotalSupply() external view returns (uint256);\\n\\n function proxyOFT() external view returns (IProxyOFT);\\n}\\n\",\"keccak256\":\"0xfaeb24d1067e85493a5c8818d6de06fc6dbc72c37e85f82811990d0120f8a0cf\",\"license\":\"MIT\"},\"contracts/interfaces/ITreasury.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\ninterface ITreasury {\\n function pull(address to_, uint256 amount_) external;\\n\\n function migrateTo(address newTreasury_) external;\\n}\\n\",\"keccak256\":\"0x9ee0a41cfe7b5bd2ec256441fc7b2ae6407921ed28a65daeaa476cfc9df73c1b\",\"license\":\"MIT\"},\"contracts/interfaces/external/IMasterOracle.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\ninterface IMasterOracle {\\n function quoteTokenToUsd(address _asset, uint256 _amount) external view returns (uint256 _amountInUsd);\\n\\n function quoteUsdToToken(address _asset, uint256 _amountInUsd) external view returns (uint256 _amount);\\n\\n function quote(address _assetIn, address _assetOut, uint256 _amountIn) external view returns (uint256 _amountOut);\\n}\\n\",\"keccak256\":\"0x2f080adc5880151dc4446ef43b54abab8e3711c5f2e526917ef39a05e3c16a00\",\"license\":\"MIT\"},\"contracts/interfaces/external/IStargateComposerWithRetry.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../../dependencies/stargate-protocol/interfaces/IStargateComposer.sol\\\";\\n\\n// Note: Extending interface instead of adding those function to avoid triggering upgrade for other contracts\\n// We may move functions to `IStargateComposer` on the next major upgrade\\n// Refs: https://github.com/autonomoussoftware/metronome-synth/issues/877\\ninterface IStargateComposerWithRetry is IStargateComposer {\\n function payloadHashes(\\n uint16 _srcChainId,\\n bytes calldata _srcAddress,\\n uint256 _nonce\\n ) external view returns (bytes32);\\n\\n function clearCachedSwap(\\n uint16 _srcChainId,\\n bytes calldata _srcAddress,\\n uint64 _nonce,\\n address _receiver,\\n bytes calldata _sgReceiveCallData\\n ) external;\\n}\\n\",\"keccak256\":\"0x92a0df931fd4ffb78085bf1526c0a5b53c78d9ea9a8a9f9b57d7178b14b80508\",\"license\":\"BUSL-1.1\"},\"contracts/interfaces/external/IStargateFactory.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\ninterface IStargateFactory {\\n function getPool(uint256 _id) external view returns (address _pool);\\n}\\n\",\"keccak256\":\"0x2ab62b49b277ee038b0da54659a1347969300f754ec9a5e47a982d9afdf7f495\",\"license\":\"MIT\"},\"contracts/interfaces/external/IStargatePool.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\ninterface IStargatePool {\\n function token() external view returns (address _token);\\n}\\n\",\"keccak256\":\"0xb1991884813f17988846955930b45d7e77edef53063f088e4b9b7ba08d98d27c\",\"license\":\"MIT\"},\"contracts/interfaces/external/ISwapper.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\ninterface ISwapper {\\n function swapExactInput(\\n address tokenIn_,\\n address tokenOut_,\\n uint256 amountIn_,\\n uint256 amountOutMin_,\\n address receiver_\\n ) external returns (uint256 _amountOut);\\n}\\n\",\"keccak256\":\"0x75f04b225d0c310be7e0a09ee4c1aa6eeeb8d94e02fc0e4160a9597ce2d8d446\",\"license\":\"MIT\"},\"contracts/interfaces/external/IWETH.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../../dependencies/openzeppelin/token/ERC20/IERC20.sol\\\";\\n\\ninterface IWETH is IERC20 {\\n function deposit() external payable;\\n\\n function withdraw(uint256) external;\\n}\\n\",\"keccak256\":\"0x35c8fcbe75a63e851c5c213fd9cdf40dc119fd2fd88e8583ce64d424c093edfd\",\"license\":\"MIT\"},\"contracts/lib/CrossChainLib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nlibrary CrossChainLib {\\n /**\\n * @notice Supported cross-chain operations\\n */\\n uint8 public constant LEVERAGE = 1;\\n uint8 public constant FLASH_REPAY = 2;\\n\\n function getOperationType(bytes memory payload_) internal pure returns (uint8 _op) {\\n (_op, ) = abi.decode(payload_, (uint8, bytes));\\n }\\n\\n function encodeLeverageCallbackPayload(\\n address srcSmartFarmingManager_,\\n uint256 requestId_\\n ) internal pure returns (bytes memory _payload) {\\n return abi.encode(LEVERAGE, abi.encode(srcSmartFarmingManager_, requestId_));\\n }\\n\\n function decodeLeverageCallbackPayload(\\n bytes memory payload_\\n ) internal pure returns (address _srcSmartFarmingManager, uint256 _requestId) {\\n (, payload_) = abi.decode(payload_, (uint8, bytes));\\n return abi.decode(payload_, (address, uint256));\\n }\\n\\n function encodeFlashRepayCallbackPayload(\\n address srcProxyOFT_,\\n address srcSmartFarmingManager_,\\n uint256 requestId_\\n ) internal pure returns (bytes memory _payload) {\\n return abi.encode(FLASH_REPAY, abi.encode(srcProxyOFT_, srcSmartFarmingManager_, requestId_));\\n }\\n\\n function decodeFlashRepayCallbackPayload(\\n bytes memory payload_\\n ) internal pure returns (address srcProxyOFT_, address _srcSmartFarmingManager, uint256 _requestId) {\\n (, payload_) = abi.decode(payload_, (uint8, bytes));\\n return abi.decode(payload_, (address, address, uint256));\\n }\\n\\n function encodeFlashRepaySwapPayload(\\n address srcSmartFarmingManager_,\\n address dstProxyOFT_,\\n uint256 requestId_,\\n address account_,\\n uint256 amountOutMin_,\\n uint256 callbackTxNativeFee_\\n ) internal pure returns (bytes memory _payload) {\\n return\\n abi.encode(\\n FLASH_REPAY,\\n abi.encode(\\n srcSmartFarmingManager_,\\n dstProxyOFT_,\\n requestId_,\\n account_,\\n amountOutMin_,\\n callbackTxNativeFee_\\n )\\n );\\n }\\n\\n function decodeFlashRepaySwapPayload(\\n bytes memory payload_\\n )\\n internal\\n pure\\n returns (\\n address _srcSmartFarmingManager,\\n address _dstProxyOFT,\\n uint256 _requestId,\\n address _account,\\n uint256 _amountOutMin,\\n uint256 _callbackTxNativeFee\\n )\\n {\\n (, payload_) = abi.decode(payload_, (uint8, bytes));\\n return abi.decode(payload_, (address, address, uint256, address, uint256, uint256));\\n }\\n\\n function encodeLeverageSwapPayload(\\n address srcSmartFarmingManager_,\\n address dstProxyOFT_,\\n uint256 requestId_,\\n uint256 sgPoolId_,\\n address account_,\\n uint256 amountOutMin_,\\n uint256 callbackTxNativeFee_\\n ) internal pure returns (bytes memory _payload) {\\n return\\n abi.encode(\\n LEVERAGE,\\n abi.encode(\\n srcSmartFarmingManager_,\\n dstProxyOFT_,\\n requestId_,\\n sgPoolId_,\\n account_,\\n amountOutMin_,\\n callbackTxNativeFee_\\n )\\n );\\n }\\n\\n function decodeLeverageSwapPayload(\\n bytes memory payload_\\n )\\n internal\\n pure\\n returns (\\n address _srcSmartFarmingManager,\\n address _dstProxyOFT,\\n uint256 _requestId,\\n uint256 _sgPoolId,\\n address _account,\\n uint256 _amountOutMin,\\n uint256 _callbackTxNativeFee\\n )\\n {\\n (, payload_) = abi.decode(payload_, (uint8, bytes));\\n return abi.decode(payload_, (address, address, uint256, uint256, address, uint256, uint256));\\n }\\n\\n function encodeLzArgs(\\n uint16 dstChainId_,\\n uint256 callbackNativeFee_,\\n uint64 swapTxGasLimit_\\n ) internal pure returns (bytes memory _lzArgs) {\\n return abi.encode(dstChainId_, callbackNativeFee_, swapTxGasLimit_);\\n }\\n\\n function decodeLzArgs(\\n bytes memory lzArgs_\\n ) internal pure returns (uint16 _dstChainId, uint256 _callbackNativeFee, uint64 _swapTxGasLimit) {\\n return abi.decode(lzArgs_, (uint16, uint256, uint64));\\n }\\n}\\n\",\"keccak256\":\"0x15b84cfe132b4641c5b8a6f04eed6a5a88fbbb0bd89ad7c167d98ad653ff1043\",\"license\":\"MIT\"},\"contracts/storage/CrossChainDispatcherStorage.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../interfaces/ICrossChainDispatcher.sol\\\";\\nimport \\\"../interfaces/IPoolRegistry.sol\\\";\\n\\nabstract contract CrossChainDispatcherStorageV1 is ICrossChainDispatcher {\\n /**\\n * @notice The pool registry contract\\n */\\n IPoolRegistry public poolRegistry;\\n\\n /**\\n * @notice Overwritten swap slippage params\\n * @dev Used by retry functions in case of swap failure due to slippage (See: `_swap()`)\\n */\\n mapping(uint256 => uint256) public swapAmountOutMin;\\n\\n /**\\n * @notice Maps other chains `CrossChainDispatcher` contracts\\n */\\n mapping(uint16 => address) public crossChainDispatcherOf;\\n\\n /**\\n * @notice The base gas to pay for cross-chain calls\\n * @dev This limit covers basic token transfer LZ cost\\n */\\n uint256 public lzBaseGasLimit;\\n\\n /**\\n * @notice The slippage we're willing to accept for SG like:like transfers\\n */\\n uint256 public stargateSlippage;\\n\\n /**\\n * @notice The gas limit to cover `_crossChainFlashRepayCallback()` call\\n */\\n uint64 public flashRepayCallbackTxGasLimit;\\n\\n /**\\n * @notice The gas limit to cover `_swapAndTriggerFlashRepayCallback()` call\\n */\\n uint64 public flashRepaySwapTxGasLimit;\\n\\n /**\\n * @notice The gas limit to cover `_crossChainLeverageCallback()` call\\n */\\n uint64 public leverageCallbackTxGasLimit;\\n\\n /**\\n * @notice The gas limit to cover `_swapAndTriggerLeverageCallback()` call\\n */\\n uint64 public leverageSwapTxGasLimit;\\n\\n /**\\n * @notice Flag that pause/unpause all cross-chain activities\\n */\\n bool public isBridgingActive;\\n\\n /**\\n * @notice The Stargate Router contract\\n */\\n IStargateComposer public stargateComposer;\\n\\n /**\\n * @notice Maps Stargate's token pools\\n */\\n mapping(address => uint256) public stargatePoolIdOf;\\n\\n /**\\n * @notice Maps supported cross-chain routes (i.e. which chains are allowed to be used as source of liquidity)\\n */\\n mapping(uint16 => bool) public isDestinationChainSupported;\\n\\n /**\\n * @notice WETH contract\\n */\\n address public weth;\\n\\n /**\\n * @notice SGETH contract\\n */\\n address public sgeth;\\n}\\n\\nabstract contract CrossChainDispatcherStorageV2 is CrossChainDispatcherStorageV1 {\\n /**\\n * @notice Store extra amount sent when retrying a failed tx due to low native fee\\n */\\n mapping(uint256 => uint256) public extraCallbackTxNativeFee;\\n}\\n\",\"keccak256\":\"0x3daaf2d3400d3c09bfd05165296c4f5328d8b4e0530493f5e36b52993102a481\",\"license\":\"MIT\"},\"contracts/utils/ReentrancyGuard.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../dependencies/openzeppelin-upgradeable/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 ReentrancyGuard 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 // On the first call to nonReentrant, _notEntered will be true\\n require(_status != _ENTERED, \\\"ReentrancyGuard: reentrant call\\\");\\n\\n // Any calls to nonReentrant after this point will fail\\n _status = _ENTERED;\\n\\n _;\\n\\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\",\"keccak256\":\"0x3bf3c3de5a638ca101f25dfcaec5268e9c8a1c29a9a278d70be4459768fb41fe\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60806040523480156200001157600080fd5b506200001c62000022565b62000152565b6200002e60ff62000031565b50565b60008054610100900460ff1615620000ca578160ff1660011480156200006a575062000068306200014360201b620026e41760201c565b155b620000c25760405162461bcd60e51b815260206004820152602e602482015260008051602062004bd683398151915260448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b506000919050565b60005460ff808416911610620001295760405162461bcd60e51b815260206004820152602e602482015260008051602062004bd683398151915260448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401620000b9565b506000805460ff191660ff92909216919091179055600190565b6001600160a01b03163b151590565b614a7480620001626000396000f3fe6080604052600436106102075760003560e01c80638a9cadaf11610118578063b71b42ec116100a0578063dfda255f1161006f578063dfda255f14610602578063e3499aa414610638578063e3d47ece14610668578063e7f4c16b1461068f578063ffa1ad74146106b657600080fd5b8063b71b42ec14610582578063b9d81720146105a2578063c0c53b8b146105b5578063d89921cb146105d557600080fd5b8063ab4193e2116100e7578063ab4193e2146104d5578063ab8236f314610502578063ac18fce614610522578063afcff50f14610542578063b2d083c11461056257600080fd5b80638a9cadaf146104555780638ece685714610468578063a6bd364614610488578063a761f5f0146104b557600080fd5b80633413f1c11161019b5780636a46aa381161016a5780636a46aa38146103ca5780636c77d24f146103ea5780636e406753146104005780637b7305d314610420578063833667df1461044057600080fd5b80633413f1c11461035357806339f648bf146103775780633fc8cef31461038a57806362491b35146103aa57600080fd5b80631e492d56116101d75780631e492d56146102ac5780632b80cc52146102cc5780632e369cf2146102f65780633352b6081461031657600080fd5b8062bc9db9146102135780630b211f0f14610228578063147a7d711461026c5780631a607f9a1461028c57600080fd5b3661020e57005b600080fd5b610226610221366004613de0565b6106f4565b005b34801561023457600080fd5b5060075461024f90600160801b90046001600160401b031681565b6040516001600160401b0390911681526020015b60405180910390f35b34801561027857600080fd5b50610226610287366004613e9c565b610c10565b34801561029857600080fd5b506102266102a7366004613f68565b610d6e565b3480156102b857600080fd5b506102266102c7366004613f81565b610e88565b3480156102d857600080fd5b506008546102e69060ff1681565b6040519015158152602001610263565b34801561030257600080fd5b50610226610311366004613f9e565b610fe3565b34801561032257600080fd5b5060085461033b9061010090046001600160a01b031681565b6040516001600160a01b039091168152602001610263565b34801561035f57600080fd5b5061036960065481565b604051908152602001610263565b610226610385366004613de0565b61113c565b34801561039657600080fd5b50600b5461033b906001600160a01b031681565b3480156103b657600080fd5b5060075461024f906001600160401b031681565b3480156103d657600080fd5b506102266103e5366004613f68565b61167e565b3480156103f657600080fd5b5061036960055481565b34801561040c57600080fd5b5061022661041b366004613f81565b611798565b34801561042c57600080fd5b5061022661043b366004613fbb565b6118f8565b34801561044c57600080fd5b50610226611a4a565b610226610463366004613fe7565b611b51565b34801561047457600080fd5b506102266104833660046140a3565b611d4e565b34801561049457600080fd5b506103696104a3366004613f68565b600d6020526000908152604090205481565b3480156104c157600080fd5b50600c5461033b906001600160a01b031681565b3480156104e157600080fd5b506103696104f0366004613f68565b60036020526000908152604090205481565b34801561050e57600080fd5b5061022661051d36600461419f565b611ec9565b34801561052e57600080fd5b5061022661053d366004613f81565b612033565b34801561054e57600080fd5b5060025461033b906001600160a01b031681565b34801561056e57600080fd5b5061022661057d36600461423b565b612182565b34801561058e57600080fd5b5061022661059d366004613f81565b6122ae565b6102266105b0366004614258565b612413565b3480156105c157600080fd5b506102266105d03660046142ff565b6125dd565b3480156105e157600080fd5b506103696105f0366004613f9e565b60096020526000908152604090205481565b34801561060e57600080fd5b5061033b61061d36600461423b565b6004602052600090815260409020546001600160a01b031681565b34801561064457600080fd5b506102e661065336600461423b565b600a6020526000908152604090205460ff1681565b34801561067457600080fd5b5060075461024f90600160c01b90046001600160401b031681565b34801561069b57600080fd5b5060075461024f90600160401b90046001600160401b031681565b3480156106c257600080fd5b506106e7604051806040016040528060058152602001640312e332e360dc1b81525081565b60405161026391906143a2565b600260015414156107205760405162461bcd60e51b8152600401610717906143b5565b60405180910390fd5b60026001819055506000336001600160a01b03166316f0115b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561076357600080fd5b505afa158015610777573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079b91906143ec565b60025460405163c673bdaf60e01b81526001600160a01b03808416600483015292935091169063c673bdaf9060240160206040518083038186803b1580156107e257600080fd5b505afa1580156107f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061081a9190614409565b61083757604051633bfe162b60e01b815260040160405180910390fd5b806001600160a01b03166396aaccfe6040518163ffffffff1660e01b815260040160206040518083038186803b15801561087057600080fd5b505afa158015610884573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a891906143ec565b6001600160a01b0316336001600160a01b0316146108d957604051633bfe162b60e01b815260040160405180910390fd5b60085460ff1615806109c95750336001600160a01b03166316f0115b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561091f57600080fd5b505afa158015610933573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061095791906143ec565b6001600160a01b0316632b80cc526040518163ffffffff1660e01b815260040160206040518083038186803b15801561098f57600080fd5b505afa1580156109a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c79190614409565b155b156109e757604051635621fccf60e01b815260040160405180910390fd5b60008890506000806000610a3087878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506126f392505050565b925092509250606060008b6001600160a01b0316636d1bb8f76040518163ffffffff1660e01b815260040160206040518083038186803b158015610a7357600080fd5b505afa158015610a87573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aab91906143ec565b6040516001627dd58f60e11b0319815261ffff871660048201526001600160a01b03919091169063ff0454e29060240160206040518083038186803b158015610af357600080fd5b505afa158015610b07573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b2b91906143ec565b90506001600160a01b038116610b545760405163fb7566d760e01b815260040160405180910390fd5b61ffff85166000908152600a602052604090205460ff16610b885760405163334dc1fd60e01b815260040160405180910390fd5b8e610b973383838a8f8a612719565b92505050610bfc6040518061010001604052808e6001600160a01b031681526020018661ffff1681526020018c8152602001348152602001838152602001876001600160a01b03168152602001846001600160401b0316815260200185815250612791565b505060018055505050505050505050505050565b610c1933612a61565b610c3657604051633bfe162b60e01b815260040160405180910390fd5b6000610c7c600087878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509293925050612bfc9050565b90506001600160a01b0381161580610cb3575061ffff8a166000908152600460205260409020546001600160a01b03828116911614155b15610cd157604051637ab628f960e01b815260040160405180910390fd5b6000610d1284848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612c6192505050565b905060ff811660021415610d3057610d2b858585612c7e565b610d61565b60ff811660011415610d4857610d2b8b868686612de7565b604051630ead561960e11b815260040160405180910390fd5b5050505050505050505050565b600260009054906101000a90046001600160a01b03166001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b158015610dbc57600080fd5b505afa158015610dd0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610df491906143ec565b6001600160a01b0316336001600160a01b031614610e2557604051634b98449160e11b815260040160405180910390fd5b60065481811415610e4957604051630333a68160e41b815260040160405180910390fd5b60408051828152602081018490527f5cac1093ddd8c1e9cbcd89b2f36fa1889e966cc257753af2d160888564fd9818910160405180910390a150600655565b600260009054906101000a90046001600160a01b03166001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b158015610ed657600080fd5b505afa158015610eea573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f0e91906143ec565b6001600160a01b0316336001600160a01b031614610f3f57604051634b98449160e11b815260040160405180910390fd5b6007546001600160401b03600160c01b9091048116908216811415610f7757604051630333a68160e41b815260040160405180910390fd5b604080516001600160401b038084168252841660208201527f7dd9d7c71da5859a7d6e34c00f4889cb529dbbc009a358db124855baa125a4dc910160405180910390a150600780546001600160401b03909216600160c01b026001600160c01b03909216919091179055565b600260009054906101000a90046001600160a01b03166001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b15801561103157600080fd5b505afa158015611045573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061106991906143ec565b6001600160a01b0316336001600160a01b03161461109a57604051634b98449160e11b815260040160405180910390fd5b6008546001600160a01b0361010090910481169082168114156110d057604051630333a68160e41b815260040160405180910390fd5b604080516001600160a01b038084168252841660208201527f398baf83f237e7e1e1ce6637c69193c52e8b6382036ceb3c6eba08401e327667910160405180910390a150600880546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b6002600154141561115f5760405162461bcd60e51b8152600401610717906143b5565b60026001819055506000336001600160a01b03166316f0115b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156111a257600080fd5b505afa1580156111b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111da91906143ec565b60025460405163c673bdaf60e01b81526001600160a01b03808416600483015292935091169063c673bdaf9060240160206040518083038186803b15801561122157600080fd5b505afa158015611235573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112599190614409565b61127657604051633bfe162b60e01b815260040160405180910390fd5b806001600160a01b03166396aaccfe6040518163ffffffff1660e01b815260040160206040518083038186803b1580156112af57600080fd5b505afa1580156112c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112e791906143ec565b6001600160a01b0316336001600160a01b03161461131857604051633bfe162b60e01b815260040160405180910390fd5b60085460ff1615806114085750336001600160a01b03166316f0115b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561135e57600080fd5b505afa158015611372573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061139691906143ec565b6001600160a01b0316632b80cc526040518163ffffffff1660e01b815260040160206040518083038186803b1580156113ce57600080fd5b505afa1580156113e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114069190614409565b155b1561142657604051635621fccf60e01b815260040160405180910390fd5b6000889050600080600061146f87878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506126f392505050565b925092509250606060008b905060008f905060008b905060008f6001600160a01b0316636d1bb8f76040518163ffffffff1660e01b815260040160206040518083038186803b1580156114c157600080fd5b505afa1580156114d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114f991906143ec565b6040516001627dd58f60e11b0319815261ffff8a1660048201526001600160a01b03919091169063ff0454e29060240160206040518083038186803b15801561154157600080fd5b505afa158015611555573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061157991906143ec565b6001600160a01b0380861660009081526009602052604090205491925082166115b55760405163fb7566d760e01b815260040160405180910390fd5b61ffff89166000908152600a602052604090205460ff166115e95760405163334dc1fd60e01b815260040160405180910390fd5b806116075760405163029c545360e41b815260040160405180910390fd5b611616338386848e888e613100565b95505050505050610bfc6040518061010001604052808e6001600160a01b031681526020018661ffff1681526020018c8152602001348152602001838152602001876001600160a01b03168152602001846001600160401b0316815260200185815250613181565b600260009054906101000a90046001600160a01b03166001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b1580156116cc57600080fd5b505afa1580156116e0573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061170491906143ec565b6001600160a01b0316336001600160a01b03161461173557604051634b98449160e11b815260040160405180910390fd5b6005548181141561175957604051630333a68160e41b815260040160405180910390fd5b60408051828152602081018490527f83c9ee8eed7101992146d1c75610cc54c1db740210cde12e135fa657a7850854910160405180910390a150600555565b600260009054906101000a90046001600160a01b03166001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b1580156117e657600080fd5b505afa1580156117fa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061181e91906143ec565b6001600160a01b0316336001600160a01b03161461184f57604051634b98449160e11b815260040160405180910390fd5b6007546001600160401b03600160801b909104811690821681141561188757604051630333a68160e41b815260040160405180910390fd5b604080516001600160401b038084168252841660208201527fce0317145f704f138aad728eeb9d95c91260950871930acca6e659f1b0883364910160405180910390a150600780546001600160401b03909216600160801b0267ffffffffffffffff60801b19909216919091179055565b600260009054906101000a90046001600160a01b03166001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b15801561194657600080fd5b505afa15801561195a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061197e91906143ec565b6001600160a01b0316336001600160a01b0316146119af57604051634b98449160e11b815260040160405180910390fd5b6001600160a01b038216600090815260096020526040902054818114156119e957604051630333a68160e41b815260040160405180910390fd5b60408051828152602081018490526001600160a01b038516917ffa622ae921e227a42afec644139331c019f4157c54e93c82dd5f811ba210ac15910160405180910390a2506001600160a01b03909116600090815260096020526040902055565b600260009054906101000a90046001600160a01b03166001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b158015611a9857600080fd5b505afa158015611aac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ad091906143ec565b6001600160a01b0316336001600160a01b031614611b0157604051634b98449160e11b815260040160405180910390fd5b60085460405160ff90911615808252907f0269774d3426d7e61b04b7d5129948b9f4edf9b937bb0c657fbb32a94a7996ec9060200160405180910390a16008805460ff1916911515919091179055565b60026001541415611b745760405162461bcd60e51b8152600401610717906143b5565b600260015560085461ffff8a1660009081526004602090815260408083205490516001600160a01b0361010090950485169463ab8236f360e01b938f93611bbe939216910161442b565b60408051601f1981840301815290829052611be692918c908c908c908c908c90602401614471565b604051602081830303815290604052906001600160e01b0319166020820180516001600160e01b0383818316178352505050509050600080611c5d87878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061336192505050565b50509350935050506000341115611c92576000828152600d602052604081208054349290611c8c9084906144ea565b90915550505b336001600160a01b0382161415611cd35784611cc157604051634c3ce71f60e11b815260040160405180910390fd5b60008281526003602052604090208590555b836001600160a01b031663c0e6ac6c8e8e8e8e30896040518763ffffffff1660e01b8152600401611d0996959493929190614502565b600060405180830381600087803b158015611d2357600080fd5b505af1158015611d37573d6000803e3d6000fd5b505060018055505050505050505050505050505050565b600260009054906101000a90046001600160a01b03166001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b158015611d9c57600080fd5b505afa158015611db0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dd491906143ec565b6001600160a01b0316336001600160a01b031614611e0557604051634b98449160e11b815260040160405180910390fd5b61ffff82166000908152600460205260409020546001600160a01b03908116908216811415611e4757604051630333a68160e41b815260040160405180910390fd5b6040805161ffff851681526001600160a01b03838116602083015284168183015290517fa0670378b7d4511893529175129417ed82867197a3ea18eb2743483bd4f00c2a9181900360600190a15061ffff91909116600090815260046020526040902080546001600160a01b0319166001600160a01b03909216919091179055565b60085461010090046001600160a01b03163314611ef957604051633bfe162b60e01b815260040160405180910390fd5b600c546001600160a01b0384811691161415611f8757600b60009054906101000a90046001600160a01b03166001600160a01b031663d0e30db0836040518263ffffffff1660e01b81526004016000604051808303818588803b158015611f5f57600080fd5b505af1158015611f73573d6000803e3d6000fd5b5050600b546001600160a01b031695505050505b6000611f938682612bfc565b90506001600160a01b0381161580611fca575061ffff87166000908152600460205260409020546001600160a01b03828116911614155b15611fe857604051637ab628f960e01b815260040160405180910390fd5b6000611ff383612c61565b905060ff8116600114156120115761200c8585856133ab565b612029565b60ff811660021415610d485761200c8886868661346e565b5050505050505050565b600260009054906101000a90046001600160a01b03166001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b15801561208157600080fd5b505afa158015612095573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120b991906143ec565b6001600160a01b0316336001600160a01b0316146120ea57604051634b98449160e11b815260040160405180910390fd5b6007546001600160401b0390811690821681141561211b57604051630333a68160e41b815260040160405180910390fd5b604080516001600160401b038084168252841660208201527f1701885e1db4da3ff923033aa465855dde857275866d4f132af5384aa880554f910160405180910390a1506007805467ffffffffffffffff19166001600160401b0392909216919091179055565b600260009054906101000a90046001600160a01b03166001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b1580156121d057600080fd5b505afa1580156121e4573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061220891906143ec565b6001600160a01b0316336001600160a01b03161461223957604051634b98449160e11b815260040160405180910390fd5b61ffff81166000908152600a602090815260409182902054915160ff90921615808352917f0269774d3426d7e61b04b7d5129948b9f4edf9b937bb0c657fbb32a94a7996ec910160405180910390a161ffff919091166000908152600a60205260409020805460ff1916911515919091179055565b600260009054906101000a90046001600160a01b03166001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b1580156122fc57600080fd5b505afa158015612310573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061233491906143ec565b6001600160a01b0316336001600160a01b03161461236557604051634b98449160e11b815260040160405180910390fd5b6007546001600160401b03600160401b909104811690821681141561239d57604051630333a68160e41b815260040160405180910390fd5b604080516001600160401b038084168252841660208201527f8dbd2ecaaca80db9e2e655edc0f1b4df2c87f441eaedf46e0b7b00358d97ad30910160405180910390a150600780546001600160401b03909216600160401b026fffffffffffffffff000000000000000019909216919091179055565b600260015414156124365760405162461bcd60e51b8152600401610717906143b5565b6002600181905550600080600061248286868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061362292505050565b5050945050935093505061249583612a61565b6124b257604051637c6953f960e01b815260040160405180910390fd5b34156124dc576000828152600d6020526040812080543492906124d69084906144ea565b90915550505b336001600160a01b038216141561251d578361250b57604051634c3ce71f60e11b815260040160405180910390fd5b60008281526003602052604090208490555b61ffff8b16600090815260046020908152604080832054905161254c926001600160a01b03909216910161442b565b6040516020818303038152906040529050836001600160a01b031663cfd6528e8d8d8d8d86308f8f8f6040518a63ffffffff1660e01b81526004016125999998979695949392919061455d565b600060405180830381600087803b1580156125b357600080fd5b505af11580156125c7573d6000803e3d6000fd5b5050600180555050505050505050505050505050565b60006125e96001613671565b90508015612601576000805461ff0019166101001790555b6001600160a01b0384166126285760405163fb7566d760e01b815260040160405180910390fd5b6126306136f9565b600280546001600160a01b038087166001600160a01b031992831617909255603260065562030d406005557a0b71b000000000000b71b0000000000007a12000000000000b71b0600755600b8054868416908316179055600c80549285169290911691909117905580156126de576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b6001600160a01b03163b151590565b60008060008380602001905181019061270c91906145d7565b9250925092509193909250565b604080516001600160a01b038881166020830152878116828401526060808301889052908616608083015260a0820185905260c08083018590528351808403909101815260e083019093529161277691600291906101000161460f565b60405160208183030381529060405290509695505050505050565b6127b560405180606001604052806000815260200160008152602001606081525090565b60208083015161ffff16600090815260048252604080822054905191926127e8926001600160a01b03909216910161442b565b60408051601f19818403018152919052905060006128068282612bfc565b6001600160a01b0316141561282e5760405163fb7566d760e01b815260040160405180910390fd5b60405180606001604052808460c001516001600160401b031681526020018460e00151815260200160008560e001511161288257604080516000602082015201604051602081830303815290604052612884565b825b905283516001600160a01b0316600090815260096020526040902054909250806128c15760405163029c545360e41b815260040160405180910390fd5b60006127106006546127106128d6919061462b565b86604001516128e59190614642565b6128ef9190614661565b6080860151600854600b54885193945091926001600160a01b03610100909204821692908216911614156129a457600b546040808901519051632e1a7d4d60e01b81526001600160a01b0390921691632e1a7d4d916129549160040190815260200190565b600060405180830381600087803b15801561296e57600080fd5b505af1158015612982573d6000803e3d6000fd5b5050505086604001518760600181815161299c91906144ea565b9052506129d9565b86516129bb906001600160a01b031682600061372a565b604087015187516129d9916001600160a01b0390911690839061372a565b806001600160a01b0316639fbf10fc8860600151896020015187888c60a001518d604001518a8e8e8c6040518b63ffffffff1660e01b8152600401612a2699989796959493929190614683565b6000604051808303818588803b158015612a3f57600080fd5b505af1158015612a53573d6000803e3d6000fd5b505050505050505050505050565b600080826001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b158015612a9d57600080fd5b505afa158015612ab1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ad591906143ec565b600254604051631a0dd00b60e01b81526001600160a01b038084166004830152929350911690631a0dd00b9060240160206040518083038186803b158015612b1c57600080fd5b505afa158015612b30573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b549190614409565b612b615750600092915050565b806001600160a01b0316636d1bb8f76040518163ffffffff1660e01b815260040160206040518083038186803b158015612b9a57600080fd5b505afa158015612bae573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bd291906143ec565b6001600160a01b0316836001600160a01b031614612bf35750600092915050565b50600192915050565b6000612c098260146144ea565b83511015612c515760405162461bcd60e51b8152602060048201526015602482015274746f416464726573735f6f75744f66426f756e647360581b6044820152606401610717565b500160200151600160601b900490565b600081806020019051810190612c779190614711565b5092915050565b6000806000612cc285858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061387592505050565b9250925092506000836001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b158015612d0357600080fd5b505afa158015612d17573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d3b91906143ec565b9050612d526001600160a01b03821684600061372a565b612d666001600160a01b038216848961372a565b604051636455bf6f60e01b815260048101839052602481018890526001600160a01b03841690636455bf6f90604401602060405180830381600087803b158015612daf57600080fd5b505af1158015612dc3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061202991906147a3565b6000806000806000806000612e3189898080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061362292505050565b96509650965096509650965096506000600860019054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015612e8f57600080fd5b505afa158015612ea3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ec791906143ec565b6001600160a01b031663068bcd8d866040518263ffffffff1660e01b8152600401612ef491815260200190565b60206040518083038186803b158015612f0c57600080fd5b505afa158015612f20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f4491906143ec565b6001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b158015612f7c57600080fd5b505afa158015612f90573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612fb491906143ec565b600c549091506001600160a01b0380831691161415612fdb5750600b546001600160a01b03165b61305886886001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b15801561301857600080fd5b505afa15801561302c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061305091906143ec565b838e876138a7565b9a5060008c90506130f1604051806101000160405280846001600160a01b031681526020018361ffff1681526020018e8152602001600d60008b815260200190815260200160002054866130ac91906144ea565b81526020016130bb8c8b613a1a565b81526001600160a01b0388166020820152600754600160801b90046001600160401b031660408201526000606090910152612791565b50505050505050505050505050565b604080516001600160a01b0389811660208301528881168284015260608083018990526080830188905290861660a083015260c0820185905260e08083018590528351808403909101815261010083019093529161316591600191906101200161460f565b6040516020818303038152906040529050979650505050505050565b60208082015161ffff166000908152600490915260409020546001600160a01b0316806131c15760405163fb7566d760e01b815260040160405180910390fd5b600060028360c001516001600160401b03166005546131e091906144ea565b60e0850151806131f15760006131f3565b845b60405160200161323d949392919060f09490941b6001600160f01b03191684526002840192909252602283015260601b6bffffffffffffffffffffffff1916604282015260560190565b604051602081830303815290604052905082600001516001600160a01b0316636d1bb8f76040518163ffffffff1660e01b815260040160206040518083038186803b15801561328b57600080fd5b505afa15801561329f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132c391906143ec565b6001600160a01b031663e7f0c59f8460600151308660200151866040516020016132ed919061442b565b60408051601f19818403018152828252908a015160808b015160c08c015160a08d01516001600160e01b031960e08b901b1686526133349796956000908d906004016147bc565b6000604051808303818588803b15801561334d57600080fd5b505af1158015612029573d6000803e3d6000fd5b6000806000806000808680602001905181019061337e9190614711565b805190985061339791508801602090810190890161483a565b949c939b5091995097509550909350915050565b6000806133b783613a6b565b90925090506133d16001600160a01b03861683600061372a565b6133e56001600160a01b038616838661372a565b6040516320159ddd60e21b815260048101829052602481018590526001600160a01b03831690638056777490604401602060405180830381600087803b15801561342e57600080fd5b505af1158015613442573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061346691906147a3565b505050505050565b60008060008060008061348087613361565b9550955095509550955095506000856001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b1580156134c757600080fd5b505afa1580156134db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906134ff91906143ec565b905061350e858b838c876138a7565b6040516001627dd58f60e11b0319815261ffff8d1660048201529099508b906000906001600160a01b0389169063ff0454e29060240160206040518083038186803b15801561355c57600080fd5b505afa158015613570573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061359491906143ec565b90506130f1604051806101000160405280856001600160a01b031681526020018461ffff1681526020018d8152602001600d60008b815260200190815260200160002054876135e391906144ea565b81526020016135f3848d8c613aa4565b81526001600160a01b03891660208201526007546001600160401b031660408201526000606090910152613181565b6000806000806000806000878060200190518101906136419190614711565b805190995061365a915089016020908101908a016148a3565b959e949d50929b5090995097509550909350915050565b60008054610100900460ff16156136b8578160ff1660011480156136945750303b155b6136b05760405162461bcd60e51b815260040161071790614918565b506000919050565b60005460ff8084169116106136df5760405162461bcd60e51b815260040161071790614918565b506000805460ff191660ff92909216919091179055600190565b600054610100900460ff166137205760405162461bcd60e51b815260040161071790614966565b613728613b00565b565b8015806137b35750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b15801561377957600080fd5b505afa15801561378d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137b191906147a3565b155b61381e5760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b6064820152608401610717565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b179052613870908490613b2d565b505050565b60008060008380602001905181019061388e9190614711565b805190955061270c9150850160209081019086016149b1565b60008581526003602052604081205480156138cf576000878152600360205260408120559150815b60025460408051632b3297f960e01b815290516000926001600160a01b031691632b3297f9916004808301926020929190829003018186803b15801561391457600080fd5b505afa158015613928573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061394c91906143ec565b90506139636001600160a01b03881682600061372a565b6139776001600160a01b038816828761372a565b604051636ccb2b0160e01b81526001600160a01b03888116600483015287811660248301526044820187905260648201869052306084830152821690636ccb2b019060a401602060405180830381600087803b1580156139d657600080fd5b505af11580156139ea573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a0e91906147a3565b98975050505050505050565b604080516001600160a01b03841660208201528082018390528151808203830181526060808301909352613a54916001919060800161460f565b604051602081830303815290604052905092915050565b60008082806020019051810190613a829190614711565b8051909450613a9b9150840160209081019085016149f4565b91509150915091565b604080516001600160a01b03858116602083015284168183015260608082018490528251808303820181526080830190935291613ae7916002919060a00161460f565b60405160208183030381529060405290505b9392505050565b600054610100900460ff16613b275760405162461bcd60e51b815260040161071790614966565b60018055565b6000613b82826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316613bff9092919063ffffffff16565b8051909150156138705780806020019051810190613ba09190614409565b6138705760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610717565b6060613c0e8484600085613c16565b949350505050565b606082471015613c775760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610717565b6001600160a01b0385163b613cce5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610717565b600080866001600160a01b03168587604051613cea9190614a22565b60006040518083038185875af1925050503d8060008114613d27576040519150601f19603f3d011682016040523d82523d6000602084013e613d2c565b606091505b5091509150613d3c828286613d47565b979650505050505050565b60608315613d56575081613af9565b825115613d665782518084602001fd5b8160405162461bcd60e51b815260040161071791906143a2565b6001600160a01b0381168114613d9557600080fd5b50565b60008083601f840112613daa57600080fd5b5081356001600160401b03811115613dc157600080fd5b602083019150836020828501011115613dd957600080fd5b9250929050565b60008060008060008060008060e0898b031215613dfc57600080fd5b883597506020890135613e0e81613d80565b96506040890135613e1e81613d80565b95506060890135613e2e81613d80565b94506080890135935060a0890135925060c08901356001600160401b03811115613e5757600080fd5b613e638b828c01613d98565b999c989b5096995094979396929594505050565b61ffff81168114613d9557600080fd5b6001600160401b0381168114613d9557600080fd5b600080600080600080600080600060c08a8c031215613eba57600080fd5b8935613ec581613e77565b985060208a01356001600160401b0380821115613ee157600080fd5b613eed8d838e01613d98565b909a50985060408c01359150613f0282613e87565b90965060608b01359080821115613f1857600080fd5b613f248d838e01613d98565b909750955060808c0135945060a08c0135915080821115613f4457600080fd5b50613f518c828d01613d98565b915080935050809150509295985092959850929598565b600060208284031215613f7a57600080fd5b5035919050565b600060208284031215613f9357600080fd5b8135613af981613e87565b600060208284031215613fb057600080fd5b8135613af981613d80565b60008060408385031215613fce57600080fd5b8235613fd981613d80565b946020939093013593505050565b600080600080600080600080600060e08a8c03121561400557600080fd5b893561401081613e77565b985060208a01356001600160401b038082111561402c57600080fd5b6140388d838e01613d98565b909a50985060408c0135915061404d82613e87565b90965060608b01359061405f82613d80565b90955060808b0135945060a08b0135908082111561407c57600080fd5b506140898c828d01613d98565b9a9d999c50979a9699959894979660c00135949350505050565b600080604083850312156140b657600080fd5b82356140c181613e77565b915060208301356140d181613d80565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561411a5761411a6140dc565b604052919050565b60006001600160401b0382111561413b5761413b6140dc565b50601f01601f191660200190565b600082601f83011261415a57600080fd5b813561416d61416882614122565b6140f2565b81815284602083860101111561418257600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060008060c087890312156141b857600080fd5b86356141c381613e77565b955060208701356001600160401b03808211156141df57600080fd5b6141eb8a838b01614149565b9650604089013595506060890135915061420482613d80565b9093506080880135925060a0880135908082111561422157600080fd5b5061422e89828a01614149565b9150509295509295509295565b60006020828403121561424d57600080fd5b8135613af981613e77565b60008060008060008060008060c0898b03121561427457600080fd5b883561427f81613e77565b975060208901356001600160401b038082111561429b57600080fd5b6142a78c838d01613d98565b909950975060408b013591506142bc82613e87565b90955060608a0135945060808a013590808211156142d957600080fd5b506142e68b828c01613d98565b999c989b50969995989497949560a00135949350505050565b60008060006060848603121561431457600080fd5b833561431f81613d80565b9250602084013561432f81613d80565b9150604084013561433f81613d80565b809150509250925092565b60005b8381101561436557818101518382015260200161434d565b838111156126de5750506000910152565b6000815180845261438e81602086016020860161434a565b601f01601f19169290920160200192915050565b602081526000613af96020830184614376565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6000602082840312156143fe57600080fd5b8151613af981613d80565b60006020828403121561441b57600080fd5b81518015158114613af957600080fd5b60609190911b6bffffffffffffffffffffffff1916815260140190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b61ffff8816815260c06020820152600061448e60c0830189614376565b6001600160401b03881660408401526001600160a01b03871660608401526080830186905282810360a08401526144c6818587614448565b9a9950505050505050505050565b634e487b7160e01b600052601160045260246000fd5b600082198211156144fd576144fd6144d4565b500190565b61ffff8716815260a06020820152600061452060a083018789614448565b6001600160401b03861660408401526001600160a01b038516606084015282810360808401526145508185614376565b9998505050505050505050565b61ffff8a16815260e06020820152600061457b60e083018a8c614448565b6001600160401b0389166040840152828103606084015261459c8189614376565b6001600160a01b038816608085015260a0840187905283810360c085015290506145c7818587614448565b9c9b505050505050505050505050565b6000806000606084860312156145ec57600080fd5b83516145f781613e77565b60208501516040860151919450925061433f81613e87565b60ff83168152604060208201526000613c0e6040830184614376565b60008282101561463d5761463d6144d4565b500390565b600081600019048311821515161561465c5761465c6144d4565b500290565b60008261467e57634e487b7160e01b600052601260045260246000fd5b500490565b600061012061ffff8c1683528a602084015289604084015260018060a01b03891660608401528760808401528660a08401528060c0840152855181840152506020850151610140830152604085015160606101608401526146e8610180840182614376565b905082810360e08401526146fc8186614376565b90508281036101008401526145c78185614376565b6000806040838503121561472457600080fd5b825160ff8116811461473557600080fd5b60208401519092506001600160401b0381111561475157600080fd5b8301601f8101851361476257600080fd5b805161477061416882614122565b81815286602083850101111561478557600080fd5b61479682602083016020860161434a565b8093505050509250929050565b6000602082840312156147b557600080fd5b5051919050565b6001600160a01b038a8116825261ffff8a166020830152610120604083018190526000916147ec8483018c614376565b91508960608501528382036080850152614806828a614376565b6001600160401b03891660a086015287821660c086015290861660e085015283810361010085015290506145c78185614376565b60008060008060008060c0878903121561485357600080fd5b865161485e81613d80565b602088015190965061486f81613d80565b60408801516060890151919650945061488781613d80565b809350506080870151915060a087015190509295509295509295565b600080600080600080600060e0888a0312156148be57600080fd5b87516148c981613d80565b60208901519097506148da81613d80565b80965050604088015194506060880151935060808801516148fa81613d80565b8093505060a0880151915060c0880151905092959891949750929550565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6000806000606084860312156149c657600080fd5b83516149d181613d80565b60208501519093506149e281613d80565b80925050604084015190509250925092565b60008060408385031215614a0757600080fd5b8251614a1281613d80565b6020939093015192949293505050565b60008251614a3481846020870161434a565b919091019291505056fea2646970667358221220046653a5ba87dfd7d7659ec799417395545c9a8c022207679388dbea325b0e6564736f6c63430008090033496e697469616c697a61626c653a20636f6e747261637420697320616c726561", + "deployedBytecode": "0x6080604052600436106102075760003560e01c80638a9cadaf11610118578063b71b42ec116100a0578063dfda255f1161006f578063dfda255f14610602578063e3499aa414610638578063e3d47ece14610668578063e7f4c16b1461068f578063ffa1ad74146106b657600080fd5b8063b71b42ec14610582578063b9d81720146105a2578063c0c53b8b146105b5578063d89921cb146105d557600080fd5b8063ab4193e2116100e7578063ab4193e2146104d5578063ab8236f314610502578063ac18fce614610522578063afcff50f14610542578063b2d083c11461056257600080fd5b80638a9cadaf146104555780638ece685714610468578063a6bd364614610488578063a761f5f0146104b557600080fd5b80633413f1c11161019b5780636a46aa381161016a5780636a46aa38146103ca5780636c77d24f146103ea5780636e406753146104005780637b7305d314610420578063833667df1461044057600080fd5b80633413f1c11461035357806339f648bf146103775780633fc8cef31461038a57806362491b35146103aa57600080fd5b80631e492d56116101d75780631e492d56146102ac5780632b80cc52146102cc5780632e369cf2146102f65780633352b6081461031657600080fd5b8062bc9db9146102135780630b211f0f14610228578063147a7d711461026c5780631a607f9a1461028c57600080fd5b3661020e57005b600080fd5b610226610221366004613de0565b6106f4565b005b34801561023457600080fd5b5060075461024f90600160801b90046001600160401b031681565b6040516001600160401b0390911681526020015b60405180910390f35b34801561027857600080fd5b50610226610287366004613e9c565b610c10565b34801561029857600080fd5b506102266102a7366004613f68565b610d6e565b3480156102b857600080fd5b506102266102c7366004613f81565b610e88565b3480156102d857600080fd5b506008546102e69060ff1681565b6040519015158152602001610263565b34801561030257600080fd5b50610226610311366004613f9e565b610fe3565b34801561032257600080fd5b5060085461033b9061010090046001600160a01b031681565b6040516001600160a01b039091168152602001610263565b34801561035f57600080fd5b5061036960065481565b604051908152602001610263565b610226610385366004613de0565b61113c565b34801561039657600080fd5b50600b5461033b906001600160a01b031681565b3480156103b657600080fd5b5060075461024f906001600160401b031681565b3480156103d657600080fd5b506102266103e5366004613f68565b61167e565b3480156103f657600080fd5b5061036960055481565b34801561040c57600080fd5b5061022661041b366004613f81565b611798565b34801561042c57600080fd5b5061022661043b366004613fbb565b6118f8565b34801561044c57600080fd5b50610226611a4a565b610226610463366004613fe7565b611b51565b34801561047457600080fd5b506102266104833660046140a3565b611d4e565b34801561049457600080fd5b506103696104a3366004613f68565b600d6020526000908152604090205481565b3480156104c157600080fd5b50600c5461033b906001600160a01b031681565b3480156104e157600080fd5b506103696104f0366004613f68565b60036020526000908152604090205481565b34801561050e57600080fd5b5061022661051d36600461419f565b611ec9565b34801561052e57600080fd5b5061022661053d366004613f81565b612033565b34801561054e57600080fd5b5060025461033b906001600160a01b031681565b34801561056e57600080fd5b5061022661057d36600461423b565b612182565b34801561058e57600080fd5b5061022661059d366004613f81565b6122ae565b6102266105b0366004614258565b612413565b3480156105c157600080fd5b506102266105d03660046142ff565b6125dd565b3480156105e157600080fd5b506103696105f0366004613f9e565b60096020526000908152604090205481565b34801561060e57600080fd5b5061033b61061d36600461423b565b6004602052600090815260409020546001600160a01b031681565b34801561064457600080fd5b506102e661065336600461423b565b600a6020526000908152604090205460ff1681565b34801561067457600080fd5b5060075461024f90600160c01b90046001600160401b031681565b34801561069b57600080fd5b5060075461024f90600160401b90046001600160401b031681565b3480156106c257600080fd5b506106e7604051806040016040528060058152602001640312e332e360dc1b81525081565b60405161026391906143a2565b600260015414156107205760405162461bcd60e51b8152600401610717906143b5565b60405180910390fd5b60026001819055506000336001600160a01b03166316f0115b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561076357600080fd5b505afa158015610777573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079b91906143ec565b60025460405163c673bdaf60e01b81526001600160a01b03808416600483015292935091169063c673bdaf9060240160206040518083038186803b1580156107e257600080fd5b505afa1580156107f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061081a9190614409565b61083757604051633bfe162b60e01b815260040160405180910390fd5b806001600160a01b03166396aaccfe6040518163ffffffff1660e01b815260040160206040518083038186803b15801561087057600080fd5b505afa158015610884573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a891906143ec565b6001600160a01b0316336001600160a01b0316146108d957604051633bfe162b60e01b815260040160405180910390fd5b60085460ff1615806109c95750336001600160a01b03166316f0115b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561091f57600080fd5b505afa158015610933573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061095791906143ec565b6001600160a01b0316632b80cc526040518163ffffffff1660e01b815260040160206040518083038186803b15801561098f57600080fd5b505afa1580156109a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c79190614409565b155b156109e757604051635621fccf60e01b815260040160405180910390fd5b60008890506000806000610a3087878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506126f392505050565b925092509250606060008b6001600160a01b0316636d1bb8f76040518163ffffffff1660e01b815260040160206040518083038186803b158015610a7357600080fd5b505afa158015610a87573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aab91906143ec565b6040516001627dd58f60e11b0319815261ffff871660048201526001600160a01b03919091169063ff0454e29060240160206040518083038186803b158015610af357600080fd5b505afa158015610b07573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b2b91906143ec565b90506001600160a01b038116610b545760405163fb7566d760e01b815260040160405180910390fd5b61ffff85166000908152600a602052604090205460ff16610b885760405163334dc1fd60e01b815260040160405180910390fd5b8e610b973383838a8f8a612719565b92505050610bfc6040518061010001604052808e6001600160a01b031681526020018661ffff1681526020018c8152602001348152602001838152602001876001600160a01b03168152602001846001600160401b0316815260200185815250612791565b505060018055505050505050505050505050565b610c1933612a61565b610c3657604051633bfe162b60e01b815260040160405180910390fd5b6000610c7c600087878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509293925050612bfc9050565b90506001600160a01b0381161580610cb3575061ffff8a166000908152600460205260409020546001600160a01b03828116911614155b15610cd157604051637ab628f960e01b815260040160405180910390fd5b6000610d1284848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612c6192505050565b905060ff811660021415610d3057610d2b858585612c7e565b610d61565b60ff811660011415610d4857610d2b8b868686612de7565b604051630ead561960e11b815260040160405180910390fd5b5050505050505050505050565b600260009054906101000a90046001600160a01b03166001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b158015610dbc57600080fd5b505afa158015610dd0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610df491906143ec565b6001600160a01b0316336001600160a01b031614610e2557604051634b98449160e11b815260040160405180910390fd5b60065481811415610e4957604051630333a68160e41b815260040160405180910390fd5b60408051828152602081018490527f5cac1093ddd8c1e9cbcd89b2f36fa1889e966cc257753af2d160888564fd9818910160405180910390a150600655565b600260009054906101000a90046001600160a01b03166001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b158015610ed657600080fd5b505afa158015610eea573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f0e91906143ec565b6001600160a01b0316336001600160a01b031614610f3f57604051634b98449160e11b815260040160405180910390fd5b6007546001600160401b03600160c01b9091048116908216811415610f7757604051630333a68160e41b815260040160405180910390fd5b604080516001600160401b038084168252841660208201527f7dd9d7c71da5859a7d6e34c00f4889cb529dbbc009a358db124855baa125a4dc910160405180910390a150600780546001600160401b03909216600160c01b026001600160c01b03909216919091179055565b600260009054906101000a90046001600160a01b03166001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b15801561103157600080fd5b505afa158015611045573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061106991906143ec565b6001600160a01b0316336001600160a01b03161461109a57604051634b98449160e11b815260040160405180910390fd5b6008546001600160a01b0361010090910481169082168114156110d057604051630333a68160e41b815260040160405180910390fd5b604080516001600160a01b038084168252841660208201527f398baf83f237e7e1e1ce6637c69193c52e8b6382036ceb3c6eba08401e327667910160405180910390a150600880546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b6002600154141561115f5760405162461bcd60e51b8152600401610717906143b5565b60026001819055506000336001600160a01b03166316f0115b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156111a257600080fd5b505afa1580156111b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111da91906143ec565b60025460405163c673bdaf60e01b81526001600160a01b03808416600483015292935091169063c673bdaf9060240160206040518083038186803b15801561122157600080fd5b505afa158015611235573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112599190614409565b61127657604051633bfe162b60e01b815260040160405180910390fd5b806001600160a01b03166396aaccfe6040518163ffffffff1660e01b815260040160206040518083038186803b1580156112af57600080fd5b505afa1580156112c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112e791906143ec565b6001600160a01b0316336001600160a01b03161461131857604051633bfe162b60e01b815260040160405180910390fd5b60085460ff1615806114085750336001600160a01b03166316f0115b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561135e57600080fd5b505afa158015611372573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061139691906143ec565b6001600160a01b0316632b80cc526040518163ffffffff1660e01b815260040160206040518083038186803b1580156113ce57600080fd5b505afa1580156113e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114069190614409565b155b1561142657604051635621fccf60e01b815260040160405180910390fd5b6000889050600080600061146f87878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506126f392505050565b925092509250606060008b905060008f905060008b905060008f6001600160a01b0316636d1bb8f76040518163ffffffff1660e01b815260040160206040518083038186803b1580156114c157600080fd5b505afa1580156114d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114f991906143ec565b6040516001627dd58f60e11b0319815261ffff8a1660048201526001600160a01b03919091169063ff0454e29060240160206040518083038186803b15801561154157600080fd5b505afa158015611555573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061157991906143ec565b6001600160a01b0380861660009081526009602052604090205491925082166115b55760405163fb7566d760e01b815260040160405180910390fd5b61ffff89166000908152600a602052604090205460ff166115e95760405163334dc1fd60e01b815260040160405180910390fd5b806116075760405163029c545360e41b815260040160405180910390fd5b611616338386848e888e613100565b95505050505050610bfc6040518061010001604052808e6001600160a01b031681526020018661ffff1681526020018c8152602001348152602001838152602001876001600160a01b03168152602001846001600160401b0316815260200185815250613181565b600260009054906101000a90046001600160a01b03166001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b1580156116cc57600080fd5b505afa1580156116e0573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061170491906143ec565b6001600160a01b0316336001600160a01b03161461173557604051634b98449160e11b815260040160405180910390fd5b6005548181141561175957604051630333a68160e41b815260040160405180910390fd5b60408051828152602081018490527f83c9ee8eed7101992146d1c75610cc54c1db740210cde12e135fa657a7850854910160405180910390a150600555565b600260009054906101000a90046001600160a01b03166001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b1580156117e657600080fd5b505afa1580156117fa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061181e91906143ec565b6001600160a01b0316336001600160a01b03161461184f57604051634b98449160e11b815260040160405180910390fd5b6007546001600160401b03600160801b909104811690821681141561188757604051630333a68160e41b815260040160405180910390fd5b604080516001600160401b038084168252841660208201527fce0317145f704f138aad728eeb9d95c91260950871930acca6e659f1b0883364910160405180910390a150600780546001600160401b03909216600160801b0267ffffffffffffffff60801b19909216919091179055565b600260009054906101000a90046001600160a01b03166001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b15801561194657600080fd5b505afa15801561195a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061197e91906143ec565b6001600160a01b0316336001600160a01b0316146119af57604051634b98449160e11b815260040160405180910390fd5b6001600160a01b038216600090815260096020526040902054818114156119e957604051630333a68160e41b815260040160405180910390fd5b60408051828152602081018490526001600160a01b038516917ffa622ae921e227a42afec644139331c019f4157c54e93c82dd5f811ba210ac15910160405180910390a2506001600160a01b03909116600090815260096020526040902055565b600260009054906101000a90046001600160a01b03166001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b158015611a9857600080fd5b505afa158015611aac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ad091906143ec565b6001600160a01b0316336001600160a01b031614611b0157604051634b98449160e11b815260040160405180910390fd5b60085460405160ff90911615808252907f0269774d3426d7e61b04b7d5129948b9f4edf9b937bb0c657fbb32a94a7996ec9060200160405180910390a16008805460ff1916911515919091179055565b60026001541415611b745760405162461bcd60e51b8152600401610717906143b5565b600260015560085461ffff8a1660009081526004602090815260408083205490516001600160a01b0361010090950485169463ab8236f360e01b938f93611bbe939216910161442b565b60408051601f1981840301815290829052611be692918c908c908c908c908c90602401614471565b604051602081830303815290604052906001600160e01b0319166020820180516001600160e01b0383818316178352505050509050600080611c5d87878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061336192505050565b50509350935050506000341115611c92576000828152600d602052604081208054349290611c8c9084906144ea565b90915550505b336001600160a01b0382161415611cd35784611cc157604051634c3ce71f60e11b815260040160405180910390fd5b60008281526003602052604090208590555b836001600160a01b031663c0e6ac6c8e8e8e8e30896040518763ffffffff1660e01b8152600401611d0996959493929190614502565b600060405180830381600087803b158015611d2357600080fd5b505af1158015611d37573d6000803e3d6000fd5b505060018055505050505050505050505050505050565b600260009054906101000a90046001600160a01b03166001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b158015611d9c57600080fd5b505afa158015611db0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dd491906143ec565b6001600160a01b0316336001600160a01b031614611e0557604051634b98449160e11b815260040160405180910390fd5b61ffff82166000908152600460205260409020546001600160a01b03908116908216811415611e4757604051630333a68160e41b815260040160405180910390fd5b6040805161ffff851681526001600160a01b03838116602083015284168183015290517fa0670378b7d4511893529175129417ed82867197a3ea18eb2743483bd4f00c2a9181900360600190a15061ffff91909116600090815260046020526040902080546001600160a01b0319166001600160a01b03909216919091179055565b60085461010090046001600160a01b03163314611ef957604051633bfe162b60e01b815260040160405180910390fd5b600c546001600160a01b0384811691161415611f8757600b60009054906101000a90046001600160a01b03166001600160a01b031663d0e30db0836040518263ffffffff1660e01b81526004016000604051808303818588803b158015611f5f57600080fd5b505af1158015611f73573d6000803e3d6000fd5b5050600b546001600160a01b031695505050505b6000611f938682612bfc565b90506001600160a01b0381161580611fca575061ffff87166000908152600460205260409020546001600160a01b03828116911614155b15611fe857604051637ab628f960e01b815260040160405180910390fd5b6000611ff383612c61565b905060ff8116600114156120115761200c8585856133ab565b612029565b60ff811660021415610d485761200c8886868661346e565b5050505050505050565b600260009054906101000a90046001600160a01b03166001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b15801561208157600080fd5b505afa158015612095573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120b991906143ec565b6001600160a01b0316336001600160a01b0316146120ea57604051634b98449160e11b815260040160405180910390fd5b6007546001600160401b0390811690821681141561211b57604051630333a68160e41b815260040160405180910390fd5b604080516001600160401b038084168252841660208201527f1701885e1db4da3ff923033aa465855dde857275866d4f132af5384aa880554f910160405180910390a1506007805467ffffffffffffffff19166001600160401b0392909216919091179055565b600260009054906101000a90046001600160a01b03166001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b1580156121d057600080fd5b505afa1580156121e4573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061220891906143ec565b6001600160a01b0316336001600160a01b03161461223957604051634b98449160e11b815260040160405180910390fd5b61ffff81166000908152600a602090815260409182902054915160ff90921615808352917f0269774d3426d7e61b04b7d5129948b9f4edf9b937bb0c657fbb32a94a7996ec910160405180910390a161ffff919091166000908152600a60205260409020805460ff1916911515919091179055565b600260009054906101000a90046001600160a01b03166001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b1580156122fc57600080fd5b505afa158015612310573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061233491906143ec565b6001600160a01b0316336001600160a01b03161461236557604051634b98449160e11b815260040160405180910390fd5b6007546001600160401b03600160401b909104811690821681141561239d57604051630333a68160e41b815260040160405180910390fd5b604080516001600160401b038084168252841660208201527f8dbd2ecaaca80db9e2e655edc0f1b4df2c87f441eaedf46e0b7b00358d97ad30910160405180910390a150600780546001600160401b03909216600160401b026fffffffffffffffff000000000000000019909216919091179055565b600260015414156124365760405162461bcd60e51b8152600401610717906143b5565b6002600181905550600080600061248286868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061362292505050565b5050945050935093505061249583612a61565b6124b257604051637c6953f960e01b815260040160405180910390fd5b34156124dc576000828152600d6020526040812080543492906124d69084906144ea565b90915550505b336001600160a01b038216141561251d578361250b57604051634c3ce71f60e11b815260040160405180910390fd5b60008281526003602052604090208490555b61ffff8b16600090815260046020908152604080832054905161254c926001600160a01b03909216910161442b565b6040516020818303038152906040529050836001600160a01b031663cfd6528e8d8d8d8d86308f8f8f6040518a63ffffffff1660e01b81526004016125999998979695949392919061455d565b600060405180830381600087803b1580156125b357600080fd5b505af11580156125c7573d6000803e3d6000fd5b5050600180555050505050505050505050505050565b60006125e96001613671565b90508015612601576000805461ff0019166101001790555b6001600160a01b0384166126285760405163fb7566d760e01b815260040160405180910390fd5b6126306136f9565b600280546001600160a01b038087166001600160a01b031992831617909255603260065562030d406005557a0b71b000000000000b71b0000000000007a12000000000000b71b0600755600b8054868416908316179055600c80549285169290911691909117905580156126de576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b6001600160a01b03163b151590565b60008060008380602001905181019061270c91906145d7565b9250925092509193909250565b604080516001600160a01b038881166020830152878116828401526060808301889052908616608083015260a0820185905260c08083018590528351808403909101815260e083019093529161277691600291906101000161460f565b60405160208183030381529060405290509695505050505050565b6127b560405180606001604052806000815260200160008152602001606081525090565b60208083015161ffff16600090815260048252604080822054905191926127e8926001600160a01b03909216910161442b565b60408051601f19818403018152919052905060006128068282612bfc565b6001600160a01b0316141561282e5760405163fb7566d760e01b815260040160405180910390fd5b60405180606001604052808460c001516001600160401b031681526020018460e00151815260200160008560e001511161288257604080516000602082015201604051602081830303815290604052612884565b825b905283516001600160a01b0316600090815260096020526040902054909250806128c15760405163029c545360e41b815260040160405180910390fd5b60006127106006546127106128d6919061462b565b86604001516128e59190614642565b6128ef9190614661565b6080860151600854600b54885193945091926001600160a01b03610100909204821692908216911614156129a457600b546040808901519051632e1a7d4d60e01b81526001600160a01b0390921691632e1a7d4d916129549160040190815260200190565b600060405180830381600087803b15801561296e57600080fd5b505af1158015612982573d6000803e3d6000fd5b5050505086604001518760600181815161299c91906144ea565b9052506129d9565b86516129bb906001600160a01b031682600061372a565b604087015187516129d9916001600160a01b0390911690839061372a565b806001600160a01b0316639fbf10fc8860600151896020015187888c60a001518d604001518a8e8e8c6040518b63ffffffff1660e01b8152600401612a2699989796959493929190614683565b6000604051808303818588803b158015612a3f57600080fd5b505af1158015612a53573d6000803e3d6000fd5b505050505050505050505050565b600080826001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b158015612a9d57600080fd5b505afa158015612ab1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ad591906143ec565b600254604051631a0dd00b60e01b81526001600160a01b038084166004830152929350911690631a0dd00b9060240160206040518083038186803b158015612b1c57600080fd5b505afa158015612b30573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b549190614409565b612b615750600092915050565b806001600160a01b0316636d1bb8f76040518163ffffffff1660e01b815260040160206040518083038186803b158015612b9a57600080fd5b505afa158015612bae573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bd291906143ec565b6001600160a01b0316836001600160a01b031614612bf35750600092915050565b50600192915050565b6000612c098260146144ea565b83511015612c515760405162461bcd60e51b8152602060048201526015602482015274746f416464726573735f6f75744f66426f756e647360581b6044820152606401610717565b500160200151600160601b900490565b600081806020019051810190612c779190614711565b5092915050565b6000806000612cc285858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061387592505050565b9250925092506000836001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b158015612d0357600080fd5b505afa158015612d17573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d3b91906143ec565b9050612d526001600160a01b03821684600061372a565b612d666001600160a01b038216848961372a565b604051636455bf6f60e01b815260048101839052602481018890526001600160a01b03841690636455bf6f90604401602060405180830381600087803b158015612daf57600080fd5b505af1158015612dc3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061202991906147a3565b6000806000806000806000612e3189898080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061362292505050565b96509650965096509650965096506000600860019054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015612e8f57600080fd5b505afa158015612ea3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ec791906143ec565b6001600160a01b031663068bcd8d866040518263ffffffff1660e01b8152600401612ef491815260200190565b60206040518083038186803b158015612f0c57600080fd5b505afa158015612f20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f4491906143ec565b6001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b158015612f7c57600080fd5b505afa158015612f90573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612fb491906143ec565b600c549091506001600160a01b0380831691161415612fdb5750600b546001600160a01b03165b61305886886001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b15801561301857600080fd5b505afa15801561302c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061305091906143ec565b838e876138a7565b9a5060008c90506130f1604051806101000160405280846001600160a01b031681526020018361ffff1681526020018e8152602001600d60008b815260200190815260200160002054866130ac91906144ea565b81526020016130bb8c8b613a1a565b81526001600160a01b0388166020820152600754600160801b90046001600160401b031660408201526000606090910152612791565b50505050505050505050505050565b604080516001600160a01b0389811660208301528881168284015260608083018990526080830188905290861660a083015260c0820185905260e08083018590528351808403909101815261010083019093529161316591600191906101200161460f565b6040516020818303038152906040529050979650505050505050565b60208082015161ffff166000908152600490915260409020546001600160a01b0316806131c15760405163fb7566d760e01b815260040160405180910390fd5b600060028360c001516001600160401b03166005546131e091906144ea565b60e0850151806131f15760006131f3565b845b60405160200161323d949392919060f09490941b6001600160f01b03191684526002840192909252602283015260601b6bffffffffffffffffffffffff1916604282015260560190565b604051602081830303815290604052905082600001516001600160a01b0316636d1bb8f76040518163ffffffff1660e01b815260040160206040518083038186803b15801561328b57600080fd5b505afa15801561329f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132c391906143ec565b6001600160a01b031663e7f0c59f8460600151308660200151866040516020016132ed919061442b565b60408051601f19818403018152828252908a015160808b015160c08c015160a08d01516001600160e01b031960e08b901b1686526133349796956000908d906004016147bc565b6000604051808303818588803b15801561334d57600080fd5b505af1158015612029573d6000803e3d6000fd5b6000806000806000808680602001905181019061337e9190614711565b805190985061339791508801602090810190890161483a565b949c939b5091995097509550909350915050565b6000806133b783613a6b565b90925090506133d16001600160a01b03861683600061372a565b6133e56001600160a01b038616838661372a565b6040516320159ddd60e21b815260048101829052602481018590526001600160a01b03831690638056777490604401602060405180830381600087803b15801561342e57600080fd5b505af1158015613442573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061346691906147a3565b505050505050565b60008060008060008061348087613361565b9550955095509550955095506000856001600160a01b031663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b1580156134c757600080fd5b505afa1580156134db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906134ff91906143ec565b905061350e858b838c876138a7565b6040516001627dd58f60e11b0319815261ffff8d1660048201529099508b906000906001600160a01b0389169063ff0454e29060240160206040518083038186803b15801561355c57600080fd5b505afa158015613570573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061359491906143ec565b90506130f1604051806101000160405280856001600160a01b031681526020018461ffff1681526020018d8152602001600d60008b815260200190815260200160002054876135e391906144ea565b81526020016135f3848d8c613aa4565b81526001600160a01b03891660208201526007546001600160401b031660408201526000606090910152613181565b6000806000806000806000878060200190518101906136419190614711565b805190995061365a915089016020908101908a016148a3565b959e949d50929b5090995097509550909350915050565b60008054610100900460ff16156136b8578160ff1660011480156136945750303b155b6136b05760405162461bcd60e51b815260040161071790614918565b506000919050565b60005460ff8084169116106136df5760405162461bcd60e51b815260040161071790614918565b506000805460ff191660ff92909216919091179055600190565b600054610100900460ff166137205760405162461bcd60e51b815260040161071790614966565b613728613b00565b565b8015806137b35750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b15801561377957600080fd5b505afa15801561378d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137b191906147a3565b155b61381e5760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b6064820152608401610717565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b179052613870908490613b2d565b505050565b60008060008380602001905181019061388e9190614711565b805190955061270c9150850160209081019086016149b1565b60008581526003602052604081205480156138cf576000878152600360205260408120559150815b60025460408051632b3297f960e01b815290516000926001600160a01b031691632b3297f9916004808301926020929190829003018186803b15801561391457600080fd5b505afa158015613928573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061394c91906143ec565b90506139636001600160a01b03881682600061372a565b6139776001600160a01b038816828761372a565b604051636ccb2b0160e01b81526001600160a01b03888116600483015287811660248301526044820187905260648201869052306084830152821690636ccb2b019060a401602060405180830381600087803b1580156139d657600080fd5b505af11580156139ea573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a0e91906147a3565b98975050505050505050565b604080516001600160a01b03841660208201528082018390528151808203830181526060808301909352613a54916001919060800161460f565b604051602081830303815290604052905092915050565b60008082806020019051810190613a829190614711565b8051909450613a9b9150840160209081019085016149f4565b91509150915091565b604080516001600160a01b03858116602083015284168183015260608082018490528251808303820181526080830190935291613ae7916002919060a00161460f565b60405160208183030381529060405290505b9392505050565b600054610100900460ff16613b275760405162461bcd60e51b815260040161071790614966565b60018055565b6000613b82826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316613bff9092919063ffffffff16565b8051909150156138705780806020019051810190613ba09190614409565b6138705760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610717565b6060613c0e8484600085613c16565b949350505050565b606082471015613c775760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610717565b6001600160a01b0385163b613cce5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610717565b600080866001600160a01b03168587604051613cea9190614a22565b60006040518083038185875af1925050503d8060008114613d27576040519150601f19603f3d011682016040523d82523d6000602084013e613d2c565b606091505b5091509150613d3c828286613d47565b979650505050505050565b60608315613d56575081613af9565b825115613d665782518084602001fd5b8160405162461bcd60e51b815260040161071791906143a2565b6001600160a01b0381168114613d9557600080fd5b50565b60008083601f840112613daa57600080fd5b5081356001600160401b03811115613dc157600080fd5b602083019150836020828501011115613dd957600080fd5b9250929050565b60008060008060008060008060e0898b031215613dfc57600080fd5b883597506020890135613e0e81613d80565b96506040890135613e1e81613d80565b95506060890135613e2e81613d80565b94506080890135935060a0890135925060c08901356001600160401b03811115613e5757600080fd5b613e638b828c01613d98565b999c989b5096995094979396929594505050565b61ffff81168114613d9557600080fd5b6001600160401b0381168114613d9557600080fd5b600080600080600080600080600060c08a8c031215613eba57600080fd5b8935613ec581613e77565b985060208a01356001600160401b0380821115613ee157600080fd5b613eed8d838e01613d98565b909a50985060408c01359150613f0282613e87565b90965060608b01359080821115613f1857600080fd5b613f248d838e01613d98565b909750955060808c0135945060a08c0135915080821115613f4457600080fd5b50613f518c828d01613d98565b915080935050809150509295985092959850929598565b600060208284031215613f7a57600080fd5b5035919050565b600060208284031215613f9357600080fd5b8135613af981613e87565b600060208284031215613fb057600080fd5b8135613af981613d80565b60008060408385031215613fce57600080fd5b8235613fd981613d80565b946020939093013593505050565b600080600080600080600080600060e08a8c03121561400557600080fd5b893561401081613e77565b985060208a01356001600160401b038082111561402c57600080fd5b6140388d838e01613d98565b909a50985060408c0135915061404d82613e87565b90965060608b01359061405f82613d80565b90955060808b0135945060a08b0135908082111561407c57600080fd5b506140898c828d01613d98565b9a9d999c50979a9699959894979660c00135949350505050565b600080604083850312156140b657600080fd5b82356140c181613e77565b915060208301356140d181613d80565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561411a5761411a6140dc565b604052919050565b60006001600160401b0382111561413b5761413b6140dc565b50601f01601f191660200190565b600082601f83011261415a57600080fd5b813561416d61416882614122565b6140f2565b81815284602083860101111561418257600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060008060c087890312156141b857600080fd5b86356141c381613e77565b955060208701356001600160401b03808211156141df57600080fd5b6141eb8a838b01614149565b9650604089013595506060890135915061420482613d80565b9093506080880135925060a0880135908082111561422157600080fd5b5061422e89828a01614149565b9150509295509295509295565b60006020828403121561424d57600080fd5b8135613af981613e77565b60008060008060008060008060c0898b03121561427457600080fd5b883561427f81613e77565b975060208901356001600160401b038082111561429b57600080fd5b6142a78c838d01613d98565b909950975060408b013591506142bc82613e87565b90955060608a0135945060808a013590808211156142d957600080fd5b506142e68b828c01613d98565b999c989b50969995989497949560a00135949350505050565b60008060006060848603121561431457600080fd5b833561431f81613d80565b9250602084013561432f81613d80565b9150604084013561433f81613d80565b809150509250925092565b60005b8381101561436557818101518382015260200161434d565b838111156126de5750506000910152565b6000815180845261438e81602086016020860161434a565b601f01601f19169290920160200192915050565b602081526000613af96020830184614376565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6000602082840312156143fe57600080fd5b8151613af981613d80565b60006020828403121561441b57600080fd5b81518015158114613af957600080fd5b60609190911b6bffffffffffffffffffffffff1916815260140190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b61ffff8816815260c06020820152600061448e60c0830189614376565b6001600160401b03881660408401526001600160a01b03871660608401526080830186905282810360a08401526144c6818587614448565b9a9950505050505050505050565b634e487b7160e01b600052601160045260246000fd5b600082198211156144fd576144fd6144d4565b500190565b61ffff8716815260a06020820152600061452060a083018789614448565b6001600160401b03861660408401526001600160a01b038516606084015282810360808401526145508185614376565b9998505050505050505050565b61ffff8a16815260e06020820152600061457b60e083018a8c614448565b6001600160401b0389166040840152828103606084015261459c8189614376565b6001600160a01b038816608085015260a0840187905283810360c085015290506145c7818587614448565b9c9b505050505050505050505050565b6000806000606084860312156145ec57600080fd5b83516145f781613e77565b60208501516040860151919450925061433f81613e87565b60ff83168152604060208201526000613c0e6040830184614376565b60008282101561463d5761463d6144d4565b500390565b600081600019048311821515161561465c5761465c6144d4565b500290565b60008261467e57634e487b7160e01b600052601260045260246000fd5b500490565b600061012061ffff8c1683528a602084015289604084015260018060a01b03891660608401528760808401528660a08401528060c0840152855181840152506020850151610140830152604085015160606101608401526146e8610180840182614376565b905082810360e08401526146fc8186614376565b90508281036101008401526145c78185614376565b6000806040838503121561472457600080fd5b825160ff8116811461473557600080fd5b60208401519092506001600160401b0381111561475157600080fd5b8301601f8101851361476257600080fd5b805161477061416882614122565b81815286602083850101111561478557600080fd5b61479682602083016020860161434a565b8093505050509250929050565b6000602082840312156147b557600080fd5b5051919050565b6001600160a01b038a8116825261ffff8a166020830152610120604083018190526000916147ec8483018c614376565b91508960608501528382036080850152614806828a614376565b6001600160401b03891660a086015287821660c086015290861660e085015283810361010085015290506145c78185614376565b60008060008060008060c0878903121561485357600080fd5b865161485e81613d80565b602088015190965061486f81613d80565b60408801516060890151919650945061488781613d80565b809350506080870151915060a087015190509295509295509295565b600080600080600080600060e0888a0312156148be57600080fd5b87516148c981613d80565b60208901519097506148da81613d80565b80965050604088015194506060880151935060808801516148fa81613d80565b8093505060a0880151915060c0880151905092959891949750929550565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6000806000606084860312156149c657600080fd5b83516149d181613d80565b60208501519093506149e281613d80565b80925050604084015190509250925092565b60008060408385031215614a0757600080fd5b8251614a1281613d80565b6020939093015192949293505050565b60008251614a3481846020870161434a565b919091019291505056fea2646970667358221220046653a5ba87dfd7d7659ec799417395545c9a8c022207679388dbea325b0e6564736f6c63430008090033", "devdoc": { "kind": "dev", "methods": { @@ -1059,6 +1078,9 @@ "crossChainDispatcherOf(uint16)": { "notice": "Maps other chains `CrossChainDispatcher` contracts" }, + "extraCallbackTxNativeFee(uint256)": { + "notice": "Store extra amount sent when retrying a failed tx due to low native fee" + }, "flashRepayCallbackTxGasLimit()": { "notice": "The gas limit to cover `_crossChainFlashRepayCallback()` call" }, @@ -1152,7 +1174,7 @@ "storageLayout": { "storage": [ { - "astId": 19718, + "astId": 19848, "contract": "contracts/CrossChainDispatcher.sol:CrossChainDispatcher", "label": "_initialized", "offset": 0, @@ -1160,7 +1182,7 @@ "type": "t_uint8" }, { - "astId": 19721, + "astId": 19851, "contract": "contracts/CrossChainDispatcher.sol:CrossChainDispatcher", "label": "_initializing", "offset": 1, @@ -1168,7 +1190,7 @@ "type": "t_bool" }, { - "astId": 33546, + "astId": 33742, "contract": "contracts/CrossChainDispatcher.sol:CrossChainDispatcher", "label": "_status", "offset": 0, @@ -1176,15 +1198,15 @@ "type": "t_uint256" }, { - "astId": 30789, + "astId": 30933, "contract": "contracts/CrossChainDispatcher.sol:CrossChainDispatcher", "label": "poolRegistry", "offset": 0, "slot": "2", - "type": "t_contract(IPoolRegistry)27964" + "type": "t_contract(IPoolRegistry)28094" }, { - "astId": 30794, + "astId": 30938, "contract": "contracts/CrossChainDispatcher.sol:CrossChainDispatcher", "label": "swapAmountOutMin", "offset": 0, @@ -1192,7 +1214,7 @@ "type": "t_mapping(t_uint256,t_uint256)" }, { - "astId": 30799, + "astId": 30943, "contract": "contracts/CrossChainDispatcher.sol:CrossChainDispatcher", "label": "crossChainDispatcherOf", "offset": 0, @@ -1200,7 +1222,7 @@ "type": "t_mapping(t_uint16,t_address)" }, { - "astId": 30802, + "astId": 30946, "contract": "contracts/CrossChainDispatcher.sol:CrossChainDispatcher", "label": "lzBaseGasLimit", "offset": 0, @@ -1208,7 +1230,7 @@ "type": "t_uint256" }, { - "astId": 30805, + "astId": 30949, "contract": "contracts/CrossChainDispatcher.sol:CrossChainDispatcher", "label": "stargateSlippage", "offset": 0, @@ -1216,7 +1238,7 @@ "type": "t_uint256" }, { - "astId": 30808, + "astId": 30952, "contract": "contracts/CrossChainDispatcher.sol:CrossChainDispatcher", "label": "flashRepayCallbackTxGasLimit", "offset": 0, @@ -1224,7 +1246,7 @@ "type": "t_uint64" }, { - "astId": 30811, + "astId": 30955, "contract": "contracts/CrossChainDispatcher.sol:CrossChainDispatcher", "label": "flashRepaySwapTxGasLimit", "offset": 8, @@ -1232,7 +1254,7 @@ "type": "t_uint64" }, { - "astId": 30814, + "astId": 30958, "contract": "contracts/CrossChainDispatcher.sol:CrossChainDispatcher", "label": "leverageCallbackTxGasLimit", "offset": 16, @@ -1240,7 +1262,7 @@ "type": "t_uint64" }, { - "astId": 30817, + "astId": 30961, "contract": "contracts/CrossChainDispatcher.sol:CrossChainDispatcher", "label": "leverageSwapTxGasLimit", "offset": 24, @@ -1248,7 +1270,7 @@ "type": "t_uint64" }, { - "astId": 30820, + "astId": 30964, "contract": "contracts/CrossChainDispatcher.sol:CrossChainDispatcher", "label": "isBridgingActive", "offset": 0, @@ -1256,15 +1278,15 @@ "type": "t_bool" }, { - "astId": 30824, + "astId": 30968, "contract": "contracts/CrossChainDispatcher.sol:CrossChainDispatcher", "label": "stargateComposer", "offset": 1, "slot": "8", - "type": "t_contract(IStargateComposer)26865" + "type": "t_contract(IStargateComposer)26995" }, { - "astId": 30829, + "astId": 30973, "contract": "contracts/CrossChainDispatcher.sol:CrossChainDispatcher", "label": "stargatePoolIdOf", "offset": 0, @@ -1272,7 +1294,7 @@ "type": "t_mapping(t_address,t_uint256)" }, { - "astId": 30834, + "astId": 30978, "contract": "contracts/CrossChainDispatcher.sol:CrossChainDispatcher", "label": "isDestinationChainSupported", "offset": 0, @@ -1280,7 +1302,7 @@ "type": "t_mapping(t_uint16,t_bool)" }, { - "astId": 30837, + "astId": 30981, "contract": "contracts/CrossChainDispatcher.sol:CrossChainDispatcher", "label": "weth", "offset": 0, @@ -1288,12 +1310,20 @@ "type": "t_address" }, { - "astId": 30840, + "astId": 30984, "contract": "contracts/CrossChainDispatcher.sol:CrossChainDispatcher", "label": "sgeth", "offset": 0, "slot": "12", "type": "t_address" + }, + { + "astId": 30992, + "contract": "contracts/CrossChainDispatcher.sol:CrossChainDispatcher", + "label": "extraCallbackTxNativeFee", + "offset": 0, + "slot": "13", + "type": "t_mapping(t_uint256,t_uint256)" } ], "types": { @@ -1307,12 +1337,12 @@ "label": "bool", "numberOfBytes": "1" }, - "t_contract(IPoolRegistry)27964": { + "t_contract(IPoolRegistry)28094": { "encoding": "inplace", "label": "contract IPoolRegistry", "numberOfBytes": "20" }, - "t_contract(IStargateComposer)26865": { + "t_contract(IStargateComposer)26995": { "encoding": "inplace", "label": "contract IStargateComposer", "numberOfBytes": "20" diff --git a/deployments/base/MsETHProxyOFT.json b/deployments/base/MsETHProxyOFT.json index 89e5030..51a9e70 100644 --- a/deployments/base/MsETHProxyOFT.json +++ b/deployments/base/MsETHProxyOFT.json @@ -1,5 +1,5 @@ { - "address": "0xDF2Aa7026bAE7e131D7D5af30345173843D22AFb", + "address": "0x30EAc06D1e495411eE15cB59714Eb9DA29fc200e", "abi": [ { "anonymous": false, @@ -134,6 +134,11 @@ "name": "BridgingIsPaused", "type": "error" }, + { + "inputs": [], + "name": "DestinationChainNotAllowed", + "type": "error" + }, { "inputs": [], "name": "SenderIsNotCrossChainDispatcher", @@ -1492,78 +1497,78 @@ "type": "constructor" } ], - "transactionHash": "0x8d1951992a6c3dad49b6f6dedeb833648fe700438750822c2e1e1556f8440b69", + "transactionHash": "0x9cd697a66c0b8edac90ffaabba02e9f796d615fd540e0642856340655811eb80", "receipt": { "to": null, "from": "0xdf826ff6518e609E4cEE86299d40611C148099d5", - "contractAddress": "0xDF2Aa7026bAE7e131D7D5af30345173843D22AFb", - "transactionIndex": 49, + "contractAddress": "0x30EAc06D1e495411eE15cB59714Eb9DA29fc200e", + "transactionIndex": 30, "gasUsed": "816183", - "logsBloom": "0x00000000000004000000000000000000400000000000000000800001000000000000000000000000000000000000000000000000400000000000000000000000000004000000000000000000000002000001000000000000000000000000000000000000020000000000000000000800000000800000000000000000000000400000000000000000000000000000000000000000000080008000000000800000000000000000000000000000000400000004000000000000000000000000000000100020000000000000002000040000000000000400000000000000000020000000000000000000000000000000000000000000000000400000000000000000", - "blockHash": "0xb05b94175134e648ac24fcefdd731487465af7ad27bfcfef2ac47802234bdc0b", - "transactionHash": "0x8d1951992a6c3dad49b6f6dedeb833648fe700438750822c2e1e1556f8440b69", + "logsBloom": "0x00000000000000000000000000000000400000000000000000800000600000000000000000000000000000000000000010000000400000000000000000000000000000000000000000000000000002000001000000000000000000400000000000000000020000000000000000000800000000800000000000000000000000400000000000000000000000000000000000000000000080000000000000800000000000000002000000000000000400000004000000000000000000000000000000100820000000000000000000040000000000000400000000000000000020000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x1b5ee3e1cf78b44aa77060df94c217b493e057f6040ade7052881076626b3393", + "transactionHash": "0x9cd697a66c0b8edac90ffaabba02e9f796d615fd540e0642856340655811eb80", "logs": [ { - "transactionIndex": 49, - "blockNumber": 14104292, - "transactionHash": "0x8d1951992a6c3dad49b6f6dedeb833648fe700438750822c2e1e1556f8440b69", - "address": "0xDF2Aa7026bAE7e131D7D5af30345173843D22AFb", + "transactionIndex": 30, + "blockNumber": 15108405, + "transactionHash": "0x9cd697a66c0b8edac90ffaabba02e9f796d615fd540e0642856340655811eb80", + "address": "0x30EAc06D1e495411eE15cB59714Eb9DA29fc200e", "topics": [ "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", - "0x000000000000000000000000f3ecd63bb9a4934c85026f8924b49ed7deb69985" + "0x000000000000000000000000ddd9864c68072a4723889644b5e7075452718ded" ], "data": "0x", - "logIndex": 122, - "blockHash": "0xb05b94175134e648ac24fcefdd731487465af7ad27bfcfef2ac47802234bdc0b" + "logIndex": 102, + "blockHash": "0x1b5ee3e1cf78b44aa77060df94c217b493e057f6040ade7052881076626b3393" }, { - "transactionIndex": 49, - "blockNumber": 14104292, - "transactionHash": "0x8d1951992a6c3dad49b6f6dedeb833648fe700438750822c2e1e1556f8440b69", - "address": "0xDF2Aa7026bAE7e131D7D5af30345173843D22AFb", + "transactionIndex": 30, + "blockNumber": 15108405, + "transactionHash": "0x9cd697a66c0b8edac90ffaabba02e9f796d615fd540e0642856340655811eb80", + "address": "0x30EAc06D1e495411eE15cB59714Eb9DA29fc200e", "topics": [ "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x000000000000000000000000df826ff6518e609e4cee86299d40611c148099d5" ], "data": "0x", - "logIndex": 123, - "blockHash": "0xb05b94175134e648ac24fcefdd731487465af7ad27bfcfef2ac47802234bdc0b" + "logIndex": 103, + "blockHash": "0x1b5ee3e1cf78b44aa77060df94c217b493e057f6040ade7052881076626b3393" }, { - "transactionIndex": 49, - "blockNumber": 14104292, - "transactionHash": "0x8d1951992a6c3dad49b6f6dedeb833648fe700438750822c2e1e1556f8440b69", - "address": "0xDF2Aa7026bAE7e131D7D5af30345173843D22AFb", + "transactionIndex": 30, + "blockNumber": 15108405, + "transactionHash": "0x9cd697a66c0b8edac90ffaabba02e9f796d615fd540e0642856340655811eb80", + "address": "0x30EAc06D1e495411eE15cB59714Eb9DA29fc200e", "topics": [ "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000001", - "logIndex": 124, - "blockHash": "0xb05b94175134e648ac24fcefdd731487465af7ad27bfcfef2ac47802234bdc0b" + "logIndex": 104, + "blockHash": "0x1b5ee3e1cf78b44aa77060df94c217b493e057f6040ade7052881076626b3393" }, { - "transactionIndex": 49, - "blockNumber": 14104292, - "transactionHash": "0x8d1951992a6c3dad49b6f6dedeb833648fe700438750822c2e1e1556f8440b69", - "address": "0xDF2Aa7026bAE7e131D7D5af30345173843D22AFb", + "transactionIndex": 30, + "blockNumber": 15108405, + "transactionHash": "0x9cd697a66c0b8edac90ffaabba02e9f796d615fd540e0642856340655811eb80", + "address": "0x30EAc06D1e495411eE15cB59714Eb9DA29fc200e", "topics": [ "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000305b30dc978e931642d243852b4aa5d31a0da8c4", - "logIndex": 125, - "blockHash": "0xb05b94175134e648ac24fcefdd731487465af7ad27bfcfef2ac47802234bdc0b" + "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ecfe7634abcd2140bede1fb34753a7f5d412c881", + "logIndex": 105, + "blockHash": "0x1b5ee3e1cf78b44aa77060df94c217b493e057f6040ade7052881076626b3393" } ], - "blockNumber": 14104292, - "cumulativeGasUsed": "7281626", + "blockNumber": 15108405, + "cumulativeGasUsed": "5005821", "status": 1, "byzantium": true }, "args": [ - "0xF3ecd63bb9A4934C85026F8924b49ed7Deb69985", - "0x305b30dC978e931642D243852b4AA5D31a0dA8c4", - "0x485cc9550000000000000000000000001a44076050125825900e736c501f859c50fe728c0000000000000000000000007ba6f01772924a82d9626c126347a28299e98c98" + "0xdDd9864C68072a4723889644b5E7075452718deD", + "0xecfE7634aBCd2140bede1fb34753A7F5d412c881", + "0x485cc955000000000000000000000000b6319cc6c8c27a8f5daf0dd3df91ea35c4720dd70000000000000000000000007ba6f01772924a82d9626c126347a28299e98c98" ], "numDeployments": 1, "solcInputHash": "0e89febeebc7444140de8e67c9067d2c", @@ -1573,11 +1578,11 @@ "execute": { "methodName": "initialize", "args": [ - "0x1a44076050125825900e736c501f859c50fE728c", + "0xb6319cC6c8c27A8F5dAF0dD3DF91EA35C4720dd7", "0x7Ba6F01772924a82D9626c126347A28299E98c98" ] }, - "implementation": "0xF3ecd63bb9A4934C85026F8924b49ed7Deb69985", + "implementation": "0xdDd9864C68072a4723889644b5E7075452718deD", "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", diff --git a/deployments/base/MsETHProxyOFT_Proxy.json b/deployments/base/MsETHProxyOFT_Proxy.json index bfbb7cd..26d1851 100644 --- a/deployments/base/MsETHProxyOFT_Proxy.json +++ b/deployments/base/MsETHProxyOFT_Proxy.json @@ -1,5 +1,5 @@ { - "address": "0xDF2Aa7026bAE7e131D7D5af30345173843D22AFb", + "address": "0x30EAc06D1e495411eE15cB59714Eb9DA29fc200e", "abi": [ { "inputs": [ @@ -146,78 +146,78 @@ "type": "receive" } ], - "transactionHash": "0x8d1951992a6c3dad49b6f6dedeb833648fe700438750822c2e1e1556f8440b69", + "transactionHash": "0x9cd697a66c0b8edac90ffaabba02e9f796d615fd540e0642856340655811eb80", "receipt": { "to": null, "from": "0xdf826ff6518e609E4cEE86299d40611C148099d5", - "contractAddress": "0xDF2Aa7026bAE7e131D7D5af30345173843D22AFb", - "transactionIndex": 49, + "contractAddress": "0x30EAc06D1e495411eE15cB59714Eb9DA29fc200e", + "transactionIndex": 30, "gasUsed": "816183", - "logsBloom": "0x00000000000004000000000000000000400000000000000000800001000000000000000000000000000000000000000000000000400000000000000000000000000004000000000000000000000002000001000000000000000000000000000000000000020000000000000000000800000000800000000000000000000000400000000000000000000000000000000000000000000080008000000000800000000000000000000000000000000400000004000000000000000000000000000000100020000000000000002000040000000000000400000000000000000020000000000000000000000000000000000000000000000000400000000000000000", - "blockHash": "0xb05b94175134e648ac24fcefdd731487465af7ad27bfcfef2ac47802234bdc0b", - "transactionHash": "0x8d1951992a6c3dad49b6f6dedeb833648fe700438750822c2e1e1556f8440b69", + "logsBloom": "0x00000000000000000000000000000000400000000000000000800000600000000000000000000000000000000000000010000000400000000000000000000000000000000000000000000000000002000001000000000000000000400000000000000000020000000000000000000800000000800000000000000000000000400000000000000000000000000000000000000000000080000000000000800000000000000002000000000000000400000004000000000000000000000000000000100820000000000000000000040000000000000400000000000000000020000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x1b5ee3e1cf78b44aa77060df94c217b493e057f6040ade7052881076626b3393", + "transactionHash": "0x9cd697a66c0b8edac90ffaabba02e9f796d615fd540e0642856340655811eb80", "logs": [ { - "transactionIndex": 49, - "blockNumber": 14104292, - "transactionHash": "0x8d1951992a6c3dad49b6f6dedeb833648fe700438750822c2e1e1556f8440b69", - "address": "0xDF2Aa7026bAE7e131D7D5af30345173843D22AFb", + "transactionIndex": 30, + "blockNumber": 15108405, + "transactionHash": "0x9cd697a66c0b8edac90ffaabba02e9f796d615fd540e0642856340655811eb80", + "address": "0x30EAc06D1e495411eE15cB59714Eb9DA29fc200e", "topics": [ "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", - "0x000000000000000000000000f3ecd63bb9a4934c85026f8924b49ed7deb69985" + "0x000000000000000000000000ddd9864c68072a4723889644b5e7075452718ded" ], "data": "0x", - "logIndex": 122, - "blockHash": "0xb05b94175134e648ac24fcefdd731487465af7ad27bfcfef2ac47802234bdc0b" + "logIndex": 102, + "blockHash": "0x1b5ee3e1cf78b44aa77060df94c217b493e057f6040ade7052881076626b3393" }, { - "transactionIndex": 49, - "blockNumber": 14104292, - "transactionHash": "0x8d1951992a6c3dad49b6f6dedeb833648fe700438750822c2e1e1556f8440b69", - "address": "0xDF2Aa7026bAE7e131D7D5af30345173843D22AFb", + "transactionIndex": 30, + "blockNumber": 15108405, + "transactionHash": "0x9cd697a66c0b8edac90ffaabba02e9f796d615fd540e0642856340655811eb80", + "address": "0x30EAc06D1e495411eE15cB59714Eb9DA29fc200e", "topics": [ "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x000000000000000000000000df826ff6518e609e4cee86299d40611c148099d5" ], "data": "0x", - "logIndex": 123, - "blockHash": "0xb05b94175134e648ac24fcefdd731487465af7ad27bfcfef2ac47802234bdc0b" + "logIndex": 103, + "blockHash": "0x1b5ee3e1cf78b44aa77060df94c217b493e057f6040ade7052881076626b3393" }, { - "transactionIndex": 49, - "blockNumber": 14104292, - "transactionHash": "0x8d1951992a6c3dad49b6f6dedeb833648fe700438750822c2e1e1556f8440b69", - "address": "0xDF2Aa7026bAE7e131D7D5af30345173843D22AFb", + "transactionIndex": 30, + "blockNumber": 15108405, + "transactionHash": "0x9cd697a66c0b8edac90ffaabba02e9f796d615fd540e0642856340655811eb80", + "address": "0x30EAc06D1e495411eE15cB59714Eb9DA29fc200e", "topics": [ "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000001", - "logIndex": 124, - "blockHash": "0xb05b94175134e648ac24fcefdd731487465af7ad27bfcfef2ac47802234bdc0b" + "logIndex": 104, + "blockHash": "0x1b5ee3e1cf78b44aa77060df94c217b493e057f6040ade7052881076626b3393" }, { - "transactionIndex": 49, - "blockNumber": 14104292, - "transactionHash": "0x8d1951992a6c3dad49b6f6dedeb833648fe700438750822c2e1e1556f8440b69", - "address": "0xDF2Aa7026bAE7e131D7D5af30345173843D22AFb", + "transactionIndex": 30, + "blockNumber": 15108405, + "transactionHash": "0x9cd697a66c0b8edac90ffaabba02e9f796d615fd540e0642856340655811eb80", + "address": "0x30EAc06D1e495411eE15cB59714Eb9DA29fc200e", "topics": [ "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000305b30dc978e931642d243852b4aa5d31a0da8c4", - "logIndex": 125, - "blockHash": "0xb05b94175134e648ac24fcefdd731487465af7ad27bfcfef2ac47802234bdc0b" + "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ecfe7634abcd2140bede1fb34753a7f5d412c881", + "logIndex": 105, + "blockHash": "0x1b5ee3e1cf78b44aa77060df94c217b493e057f6040ade7052881076626b3393" } ], - "blockNumber": 14104292, - "cumulativeGasUsed": "7281626", + "blockNumber": 15108405, + "cumulativeGasUsed": "5005821", "status": 1, "byzantium": true }, "args": [ - "0xF3ecd63bb9A4934C85026F8924b49ed7Deb69985", - "0x305b30dC978e931642D243852b4AA5D31a0dA8c4", - "0x485cc9550000000000000000000000001a44076050125825900e736c501f859c50fe728c0000000000000000000000007ba6f01772924a82d9626c126347a28299e98c98" + "0xdDd9864C68072a4723889644b5E7075452718deD", + "0xecfE7634aBCd2140bede1fb34753A7F5d412c881", + "0x485cc955000000000000000000000000b6319cc6c8c27a8f5daf0dd3df91ea35c4720dd70000000000000000000000007ba6f01772924a82d9626c126347a28299e98c98" ], "numDeployments": 1, "solcInputHash": "0e89febeebc7444140de8e67c9067d2c", diff --git a/deployments/base/MsUSDProxyOFT.json b/deployments/base/MsUSDProxyOFT.json index 931a07b..0723301 100644 --- a/deployments/base/MsUSDProxyOFT.json +++ b/deployments/base/MsUSDProxyOFT.json @@ -1,5 +1,5 @@ { - "address": "0xf014336Fd2e817b1e7F62baD1Aef5908809c9c07", + "address": "0x2AF13BF84F8B452cB86839330F514Cc5c2899217", "abi": [ { "anonymous": false, @@ -134,6 +134,11 @@ "name": "BridgingIsPaused", "type": "error" }, + { + "inputs": [], + "name": "DestinationChainNotAllowed", + "type": "error" + }, { "inputs": [], "name": "SenderIsNotCrossChainDispatcher", @@ -1492,78 +1497,78 @@ "type": "constructor" } ], - "transactionHash": "0x9794ec1f45c6c544b8cdfa11abb40481f81001416c0629e67630191a1cd58742", + "transactionHash": "0x5a6938884d9aed93263fd7beaf0732b2843c3d82c2671461f8afae44d2772d07", "receipt": { "to": null, "from": "0xdf826ff6518e609E4cEE86299d40611C148099d5", - "contractAddress": "0xf014336Fd2e817b1e7F62baD1Aef5908809c9c07", - "transactionIndex": 30, + "contractAddress": "0x2AF13BF84F8B452cB86839330F514Cc5c2899217", + "transactionIndex": 37, "gasUsed": "816183", - "logsBloom": "0x00000800000004000000000000000000400000000000000000800001000000000000000000000000400000000000000000000000400000000000000000000000000000000000000000000000000002400001000000000000000000000000000000000000020000000000000000000800000000800000000000000000000000400000000000000000000000000000000000000000000080000000000000800000000000000000000000000000000400000004000000000000000000000000000000100020000000000000000000040000000000000400000000000000000020000000000000000000000000000000000000000000000000400000000000000000", - "blockHash": "0xb4d897328bb3accee9fa2852ec1fc64a4de65d567782b127e4363d4f369bf3ba", - "transactionHash": "0x9794ec1f45c6c544b8cdfa11abb40481f81001416c0629e67630191a1cd58742", + "logsBloom": "0x00000000000000000000000000000000400000000000000000800000600000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000002000001000000000000000000000000000000000000020000000000000000000800000000800000000000000000000000400000000800000000000000000000000000000000400080000000000000800000000000000000000000000000001400000004000000000000000000000000000000100820000000000000000000040000000000000400000000000000000020000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x633238eb4892a84b42d5d9e70e0db055785d70fec6f99fb4ef853d25e903f9b1", + "transactionHash": "0x5a6938884d9aed93263fd7beaf0732b2843c3d82c2671461f8afae44d2772d07", "logs": [ { - "transactionIndex": 30, - "blockNumber": 14104253, - "transactionHash": "0x9794ec1f45c6c544b8cdfa11abb40481f81001416c0629e67630191a1cd58742", - "address": "0xf014336Fd2e817b1e7F62baD1Aef5908809c9c07", + "transactionIndex": 37, + "blockNumber": 15108384, + "transactionHash": "0x5a6938884d9aed93263fd7beaf0732b2843c3d82c2671461f8afae44d2772d07", + "address": "0x2AF13BF84F8B452cB86839330F514Cc5c2899217", "topics": [ "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", - "0x000000000000000000000000f3ecd63bb9a4934c85026f8924b49ed7deb69985" + "0x000000000000000000000000ddd9864c68072a4723889644b5e7075452718ded" ], "data": "0x", - "logIndex": 97, - "blockHash": "0xb4d897328bb3accee9fa2852ec1fc64a4de65d567782b127e4363d4f369bf3ba" + "logIndex": 136, + "blockHash": "0x633238eb4892a84b42d5d9e70e0db055785d70fec6f99fb4ef853d25e903f9b1" }, { - "transactionIndex": 30, - "blockNumber": 14104253, - "transactionHash": "0x9794ec1f45c6c544b8cdfa11abb40481f81001416c0629e67630191a1cd58742", - "address": "0xf014336Fd2e817b1e7F62baD1Aef5908809c9c07", + "transactionIndex": 37, + "blockNumber": 15108384, + "transactionHash": "0x5a6938884d9aed93263fd7beaf0732b2843c3d82c2671461f8afae44d2772d07", + "address": "0x2AF13BF84F8B452cB86839330F514Cc5c2899217", "topics": [ "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x000000000000000000000000df826ff6518e609e4cee86299d40611c148099d5" ], "data": "0x", - "logIndex": 98, - "blockHash": "0xb4d897328bb3accee9fa2852ec1fc64a4de65d567782b127e4363d4f369bf3ba" + "logIndex": 137, + "blockHash": "0x633238eb4892a84b42d5d9e70e0db055785d70fec6f99fb4ef853d25e903f9b1" }, { - "transactionIndex": 30, - "blockNumber": 14104253, - "transactionHash": "0x9794ec1f45c6c544b8cdfa11abb40481f81001416c0629e67630191a1cd58742", - "address": "0xf014336Fd2e817b1e7F62baD1Aef5908809c9c07", + "transactionIndex": 37, + "blockNumber": 15108384, + "transactionHash": "0x5a6938884d9aed93263fd7beaf0732b2843c3d82c2671461f8afae44d2772d07", + "address": "0x2AF13BF84F8B452cB86839330F514Cc5c2899217", "topics": [ "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000001", - "logIndex": 99, - "blockHash": "0xb4d897328bb3accee9fa2852ec1fc64a4de65d567782b127e4363d4f369bf3ba" + "logIndex": 138, + "blockHash": "0x633238eb4892a84b42d5d9e70e0db055785d70fec6f99fb4ef853d25e903f9b1" }, { - "transactionIndex": 30, - "blockNumber": 14104253, - "transactionHash": "0x9794ec1f45c6c544b8cdfa11abb40481f81001416c0629e67630191a1cd58742", - "address": "0xf014336Fd2e817b1e7F62baD1Aef5908809c9c07", + "transactionIndex": 37, + "blockNumber": 15108384, + "transactionHash": "0x5a6938884d9aed93263fd7beaf0732b2843c3d82c2671461f8afae44d2772d07", + "address": "0x2AF13BF84F8B452cB86839330F514Cc5c2899217", "topics": [ "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000305b30dc978e931642d243852b4aa5d31a0da8c4", - "logIndex": 100, - "blockHash": "0xb4d897328bb3accee9fa2852ec1fc64a4de65d567782b127e4363d4f369bf3ba" + "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ecfe7634abcd2140bede1fb34753a7f5d412c881", + "logIndex": 139, + "blockHash": "0x633238eb4892a84b42d5d9e70e0db055785d70fec6f99fb4ef853d25e903f9b1" } ], - "blockNumber": 14104253, - "cumulativeGasUsed": "4189202", + "blockNumber": 15108384, + "cumulativeGasUsed": "6699357", "status": 1, "byzantium": true }, "args": [ - "0xF3ecd63bb9A4934C85026F8924b49ed7Deb69985", - "0x305b30dC978e931642D243852b4AA5D31a0dA8c4", - "0x485cc9550000000000000000000000001a44076050125825900e736c501f859c50fe728c000000000000000000000000526728dbc96689597f85ae4cd716d4f7fccbae9d" + "0xdDd9864C68072a4723889644b5E7075452718deD", + "0xecfE7634aBCd2140bede1fb34753A7F5d412c881", + "0x485cc955000000000000000000000000b6319cc6c8c27a8f5daf0dd3df91ea35c4720dd7000000000000000000000000526728dbc96689597f85ae4cd716d4f7fccbae9d" ], "numDeployments": 1, "solcInputHash": "0e89febeebc7444140de8e67c9067d2c", @@ -1573,11 +1578,11 @@ "execute": { "methodName": "initialize", "args": [ - "0x1a44076050125825900e736c501f859c50fE728c", + "0xb6319cC6c8c27A8F5dAF0dD3DF91EA35C4720dd7", "0x526728DBc96689597F85ae4cd716d4f7fCcBAE9d" ] }, - "implementation": "0xF3ecd63bb9A4934C85026F8924b49ed7Deb69985", + "implementation": "0xdDd9864C68072a4723889644b5E7075452718deD", "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", diff --git a/deployments/base/MsUSDProxyOFT_Proxy.json b/deployments/base/MsUSDProxyOFT_Proxy.json index f57181f..924fdf7 100644 --- a/deployments/base/MsUSDProxyOFT_Proxy.json +++ b/deployments/base/MsUSDProxyOFT_Proxy.json @@ -1,5 +1,5 @@ { - "address": "0xf014336Fd2e817b1e7F62baD1Aef5908809c9c07", + "address": "0x2AF13BF84F8B452cB86839330F514Cc5c2899217", "abi": [ { "inputs": [ @@ -146,78 +146,78 @@ "type": "receive" } ], - "transactionHash": "0x9794ec1f45c6c544b8cdfa11abb40481f81001416c0629e67630191a1cd58742", + "transactionHash": "0x5a6938884d9aed93263fd7beaf0732b2843c3d82c2671461f8afae44d2772d07", "receipt": { "to": null, "from": "0xdf826ff6518e609E4cEE86299d40611C148099d5", - "contractAddress": "0xf014336Fd2e817b1e7F62baD1Aef5908809c9c07", - "transactionIndex": 30, + "contractAddress": "0x2AF13BF84F8B452cB86839330F514Cc5c2899217", + "transactionIndex": 37, "gasUsed": "816183", - "logsBloom": "0x00000800000004000000000000000000400000000000000000800001000000000000000000000000400000000000000000000000400000000000000000000000000000000000000000000000000002400001000000000000000000000000000000000000020000000000000000000800000000800000000000000000000000400000000000000000000000000000000000000000000080000000000000800000000000000000000000000000000400000004000000000000000000000000000000100020000000000000000000040000000000000400000000000000000020000000000000000000000000000000000000000000000000400000000000000000", - "blockHash": "0xb4d897328bb3accee9fa2852ec1fc64a4de65d567782b127e4363d4f369bf3ba", - "transactionHash": "0x9794ec1f45c6c544b8cdfa11abb40481f81001416c0629e67630191a1cd58742", + "logsBloom": "0x00000000000000000000000000000000400000000000000000800000600000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000002000001000000000000000000000000000000000000020000000000000000000800000000800000000000000000000000400000000800000000000000000000000000000000400080000000000000800000000000000000000000000000001400000004000000000000000000000000000000100820000000000000000000040000000000000400000000000000000020000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x633238eb4892a84b42d5d9e70e0db055785d70fec6f99fb4ef853d25e903f9b1", + "transactionHash": "0x5a6938884d9aed93263fd7beaf0732b2843c3d82c2671461f8afae44d2772d07", "logs": [ { - "transactionIndex": 30, - "blockNumber": 14104253, - "transactionHash": "0x9794ec1f45c6c544b8cdfa11abb40481f81001416c0629e67630191a1cd58742", - "address": "0xf014336Fd2e817b1e7F62baD1Aef5908809c9c07", + "transactionIndex": 37, + "blockNumber": 15108384, + "transactionHash": "0x5a6938884d9aed93263fd7beaf0732b2843c3d82c2671461f8afae44d2772d07", + "address": "0x2AF13BF84F8B452cB86839330F514Cc5c2899217", "topics": [ "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", - "0x000000000000000000000000f3ecd63bb9a4934c85026f8924b49ed7deb69985" + "0x000000000000000000000000ddd9864c68072a4723889644b5e7075452718ded" ], "data": "0x", - "logIndex": 97, - "blockHash": "0xb4d897328bb3accee9fa2852ec1fc64a4de65d567782b127e4363d4f369bf3ba" + "logIndex": 136, + "blockHash": "0x633238eb4892a84b42d5d9e70e0db055785d70fec6f99fb4ef853d25e903f9b1" }, { - "transactionIndex": 30, - "blockNumber": 14104253, - "transactionHash": "0x9794ec1f45c6c544b8cdfa11abb40481f81001416c0629e67630191a1cd58742", - "address": "0xf014336Fd2e817b1e7F62baD1Aef5908809c9c07", + "transactionIndex": 37, + "blockNumber": 15108384, + "transactionHash": "0x5a6938884d9aed93263fd7beaf0732b2843c3d82c2671461f8afae44d2772d07", + "address": "0x2AF13BF84F8B452cB86839330F514Cc5c2899217", "topics": [ "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x000000000000000000000000df826ff6518e609e4cee86299d40611c148099d5" ], "data": "0x", - "logIndex": 98, - "blockHash": "0xb4d897328bb3accee9fa2852ec1fc64a4de65d567782b127e4363d4f369bf3ba" + "logIndex": 137, + "blockHash": "0x633238eb4892a84b42d5d9e70e0db055785d70fec6f99fb4ef853d25e903f9b1" }, { - "transactionIndex": 30, - "blockNumber": 14104253, - "transactionHash": "0x9794ec1f45c6c544b8cdfa11abb40481f81001416c0629e67630191a1cd58742", - "address": "0xf014336Fd2e817b1e7F62baD1Aef5908809c9c07", + "transactionIndex": 37, + "blockNumber": 15108384, + "transactionHash": "0x5a6938884d9aed93263fd7beaf0732b2843c3d82c2671461f8afae44d2772d07", + "address": "0x2AF13BF84F8B452cB86839330F514Cc5c2899217", "topics": [ "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000001", - "logIndex": 99, - "blockHash": "0xb4d897328bb3accee9fa2852ec1fc64a4de65d567782b127e4363d4f369bf3ba" + "logIndex": 138, + "blockHash": "0x633238eb4892a84b42d5d9e70e0db055785d70fec6f99fb4ef853d25e903f9b1" }, { - "transactionIndex": 30, - "blockNumber": 14104253, - "transactionHash": "0x9794ec1f45c6c544b8cdfa11abb40481f81001416c0629e67630191a1cd58742", - "address": "0xf014336Fd2e817b1e7F62baD1Aef5908809c9c07", + "transactionIndex": 37, + "blockNumber": 15108384, + "transactionHash": "0x5a6938884d9aed93263fd7beaf0732b2843c3d82c2671461f8afae44d2772d07", + "address": "0x2AF13BF84F8B452cB86839330F514Cc5c2899217", "topics": [ "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000305b30dc978e931642d243852b4aa5d31a0da8c4", - "logIndex": 100, - "blockHash": "0xb4d897328bb3accee9fa2852ec1fc64a4de65d567782b127e4363d4f369bf3ba" + "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ecfe7634abcd2140bede1fb34753a7f5d412c881", + "logIndex": 139, + "blockHash": "0x633238eb4892a84b42d5d9e70e0db055785d70fec6f99fb4ef853d25e903f9b1" } ], - "blockNumber": 14104253, - "cumulativeGasUsed": "4189202", + "blockNumber": 15108384, + "cumulativeGasUsed": "6699357", "status": 1, "byzantium": true }, "args": [ - "0xF3ecd63bb9A4934C85026F8924b49ed7Deb69985", - "0x305b30dC978e931642D243852b4AA5D31a0dA8c4", - "0x485cc9550000000000000000000000001a44076050125825900e736c501f859c50fe728c000000000000000000000000526728dbc96689597f85ae4cd716d4f7fccbae9d" + "0xdDd9864C68072a4723889644b5E7075452718deD", + "0xecfE7634aBCd2140bede1fb34753A7F5d412c881", + "0x485cc955000000000000000000000000b6319cc6c8c27a8f5daf0dd3df91ea35c4720dd7000000000000000000000000526728dbc96689597f85ae4cd716d4f7fccbae9d" ], "numDeployments": 1, "solcInputHash": "0e89febeebc7444140de8e67c9067d2c", diff --git a/deployments/base/Pool.json b/deployments/base/Pool.json index 7086b41..21feb4c 100644 --- a/deployments/base/Pool.json +++ b/deployments/base/Pool.json @@ -1,5 +1,5 @@ { - "address": "0x7c18646ac536d5186B6F6Fc47D593E4127216C39", + "address": "0x2144B696bEbA98f077531e96023A7DF821Bc4586", "abi": [ { "inputs": [], @@ -186,6 +186,19 @@ "name": "UserReachedMaxTokens", "type": "error" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "newIsActive", + "type": "bool" + } + ], + "name": "BridgingIsActiveUpdated", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -976,6 +989,19 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "isBridgingActive", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "isSwapActive", @@ -1429,6 +1455,13 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "toggleBridgingIsActive", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [], "name": "toggleIsSwapActive", @@ -1539,43 +1572,43 @@ "type": "receive" } ], - "transactionHash": "0xc131c2ef53f4cc818746ccbaf8c124c4d0969c532a549a34c54bb03b4dec3c24", + "transactionHash": "0x6129cd5eb37ae1c1623f22f6609cbad4012be0184baafe06df104de9b8916351", "receipt": { "to": null, "from": "0xdf826ff6518e609E4cEE86299d40611C148099d5", - "contractAddress": "0x7c18646ac536d5186B6F6Fc47D593E4127216C39", - "transactionIndex": 35, - "gasUsed": "4104297", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000800040000000000000000000000400000000000000000000000000000000000000000000000000000000020002000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000004000000000000000000000000000000100000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000020000000000000000000", - "blockHash": "0x5970a01a0da4976e7333de1be5c2e21d7582cc3a2ec8c2e12c55c11d3e897935", - "transactionHash": "0xc131c2ef53f4cc818746ccbaf8c124c4d0969c532a549a34c54bb03b4dec3c24", + "contractAddress": "0x2144B696bEbA98f077531e96023A7DF821Bc4586", + "transactionIndex": 33, + "gasUsed": "4150977", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000800000000000000000000000000400000000000000000000000000000000000000000000000000000000020000000000000000000800000010000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000008000020004000000000000000000000000000000100000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xce31ce72f71ae24c480f55416832bfb6518ff8803ddbd54c67ff0d72d63b8366", + "transactionHash": "0x6129cd5eb37ae1c1623f22f6609cbad4012be0184baafe06df104de9b8916351", "logs": [ { - "transactionIndex": 35, - "blockNumber": 14104098, - "transactionHash": "0xc131c2ef53f4cc818746ccbaf8c124c4d0969c532a549a34c54bb03b4dec3c24", - "address": "0x7c18646ac536d5186B6F6Fc47D593E4127216C39", + "transactionIndex": 33, + "blockNumber": 15058329, + "transactionHash": "0x6129cd5eb37ae1c1623f22f6609cbad4012be0184baafe06df104de9b8916351", + "address": "0x2144B696bEbA98f077531e96023A7DF821Bc4586", "topics": [ "0xd4459d5b8b913cab0244230fd9b1c08b6ceace7fe9230e60d0f74cbffdf849d0", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x000000000000000000000000df826ff6518e609e4cee86299d40611c148099d5" ], "data": "0x", - "logIndex": 108, - "blockHash": "0x5970a01a0da4976e7333de1be5c2e21d7582cc3a2ec8c2e12c55c11d3e897935" + "logIndex": 110, + "blockHash": "0xce31ce72f71ae24c480f55416832bfb6518ff8803ddbd54c67ff0d72d63b8366" } ], - "blockNumber": 14104098, - "cumulativeGasUsed": "8768436", + "blockNumber": 15058329, + "cumulativeGasUsed": "8304663", "status": 1, "byzantium": true }, "args": [], - "numDeployments": 1, - "solcInputHash": "05e4492217f7bda719dac100afeac118", - "metadata": "{\"compiler\":{\"version\":\"0.8.9+commit.e5eed63a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AddressIsNull\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AmountGreaterThanMaxLiquidable\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AmountInIsInvalid\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AmountIsTooHigh\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AmountIsZero\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CanNotLiquidateOwnPosition\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DebtTokenAlreadyExists\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DebtTokenDoesNotExist\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DepositTokenAlreadyExists\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DepositTokenDoesNotExist\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FallbackIsNotAllowed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IsNotPaused\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IsNotShutdown\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IsPaused\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IsShutdown\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MaxLiquidableTooHigh\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NewValueIsSameAsCurrent\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PoolRegistryIsNull\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PositionIsHealthy\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ProposedGovernorIsNull\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ReachedMaxDepositTokens\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ReceiveIsNotAllowed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RemainingDebtIsLowerThanTheFloor\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RewardDistributorAlreadyExists\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RewardDistributorDoesNotExist\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SenderIsNotDebtToken\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SenderIsNotDepositToken\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SenderIsNotGovernor\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SenderIsNotTheProposedGovernor\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SwapFeatureIsInactive\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SyntheticDoesNotExist\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SyntheticIsInUse\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SyntheticIsNull\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TotalSupplyIsNotZero\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnderlyingAssetInUse\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UserReachedMaxTokens\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldDebtFloorInUsd\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newDebtFloorInUsd\",\"type\":\"uint256\"}],\"name\":\"DebtFloorUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IDebtToken\",\"name\":\"debtToken\",\"type\":\"address\"}],\"name\":\"DebtTokenAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IDebtToken\",\"name\":\"debtToken\",\"type\":\"address\"}],\"name\":\"DebtTokenRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"depositToken\",\"type\":\"address\"}],\"name\":\"DepositTokenAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IDepositToken\",\"name\":\"depositToken\",\"type\":\"address\"}],\"name\":\"DepositTokenRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IFeeProvider\",\"name\":\"oldFeeProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"contract IFeeProvider\",\"name\":\"newFeeProvider\",\"type\":\"address\"}],\"name\":\"FeeProviderUpdated\",\"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\":\"oldMaxLiquidable\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newMaxLiquidable\",\"type\":\"uint256\"}],\"name\":\"MaxLiquidableUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"Open\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"Paused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"liquidator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"contract ISyntheticToken\",\"name\":\"syntheticToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountRepaid\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"depositSeized\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"fee\",\"type\":\"uint256\"}],\"name\":\"PositionLiquidated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IRewardsDistributor\",\"name\":\"_distributor\",\"type\":\"address\"}],\"name\":\"RewardsDistributorAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"contract IRewardsDistributor\",\"name\":\"_distributor\",\"type\":\"address\"}],\"name\":\"RewardsDistributorRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"Shutdown\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"contract ISmartFarmingManager\",\"name\":\"oldSmartFarmingManager\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"contract ISmartFarmingManager\",\"name\":\"newSmartFarmingManager\",\"type\":\"address\"}],\"name\":\"SmartFarmingManagerUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"newActive\",\"type\":\"bool\"}],\"name\":\"SwapActiveUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"contract ISyntheticToken\",\"name\":\"syntheticTokenIn\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"contract ISyntheticToken\",\"name\":\"syntheticTokenOut\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"fee\",\"type\":\"uint256\"}],\"name\":\"SyntheticTokenSwapped\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract ITreasury\",\"name\":\"oldTreasury\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"contract ITreasury\",\"name\":\"newTreasury\",\"type\":\"address\"}],\"name\":\"TreasuryUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"Unpaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousGovernor\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"proposedGovernor\",\"type\":\"address\"}],\"name\":\"UpdatedGovernor\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"MAX_TOKENS_PER_USER\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"VERSION\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"acceptGovernorship\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IDebtToken\",\"name\":\"debtToken_\",\"type\":\"address\"}],\"name\":\"addDebtToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"depositToken_\",\"type\":\"address\"}],\"name\":\"addDepositToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IRewardsDistributor\",\"name\":\"distributor_\",\"type\":\"address\"}],\"name\":\"addRewardsDistributor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account_\",\"type\":\"address\"}],\"name\":\"addToDebtTokensOfAccount\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account_\",\"type\":\"address\"}],\"name\":\"addToDepositTokensOfAccount\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"debtFloorInUsd\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account_\",\"type\":\"address\"}],\"name\":\"debtOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_debtInUsd\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account_\",\"type\":\"address\"}],\"name\":\"debtPositionOf\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"_isHealthy\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"_depositInUsd\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_debtInUsd\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_issuableLimitInUsd\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_issuableInUsd\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ISyntheticToken\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"debtTokenOf\",\"outputs\":[{\"internalType\":\"contract IDebtToken\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account_\",\"type\":\"address\"}],\"name\":\"depositOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_depositInUsd\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_issuableLimitInUsd\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"depositTokenOf\",\"outputs\":[{\"internalType\":\"contract IDepositToken\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IDebtToken\",\"name\":\"debtToken_\",\"type\":\"address\"}],\"name\":\"doesDebtTokenExist\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IDepositToken\",\"name\":\"depositToken_\",\"type\":\"address\"}],\"name\":\"doesDepositTokenExist\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ISyntheticToken\",\"name\":\"syntheticToken_\",\"type\":\"address\"}],\"name\":\"doesSyntheticTokenExist\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"everythingStopped\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"feeCollector\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"feeProvider\",\"outputs\":[{\"internalType\":\"contract IFeeProvider\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDebtTokens\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account_\",\"type\":\"address\"}],\"name\":\"getDebtTokensOfAccount\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDepositTokens\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account_\",\"type\":\"address\"}],\"name\":\"getDepositTokensOfAccount\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRewardsDistributors\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IPoolRegistry\",\"name\":\"poolRegistry_\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isSwapActive\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ISyntheticToken\",\"name\":\"syntheticToken_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"account_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountToRepay_\",\"type\":\"uint256\"},{\"internalType\":\"contract IDepositToken\",\"name\":\"depositToken_\",\"type\":\"address\"}],\"name\":\"liquidate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_totalSeized\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_toLiquidator\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_fee\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"masterOracle\",\"outputs\":[{\"internalType\":\"contract IMasterOracle\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maxLiquidable\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"open\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"poolRegistry\",\"outputs\":[{\"internalType\":\"contract IPoolRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proposedGovernor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ISyntheticToken\",\"name\":\"syntheticToken_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"totalToSeize_\",\"type\":\"uint256\"},{\"internalType\":\"contract IDepositToken\",\"name\":\"depositToken_\",\"type\":\"address\"}],\"name\":\"quoteLiquidateIn\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_amountToRepay\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_toLiquidator\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_fee\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ISyntheticToken\",\"name\":\"syntheticToken_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"account_\",\"type\":\"address\"},{\"internalType\":\"contract IDepositToken\",\"name\":\"depositToken_\",\"type\":\"address\"}],\"name\":\"quoteLiquidateMax\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_maxAmountToRepay\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ISyntheticToken\",\"name\":\"syntheticToken_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountToRepay_\",\"type\":\"uint256\"},{\"internalType\":\"contract IDepositToken\",\"name\":\"depositToken_\",\"type\":\"address\"}],\"name\":\"quoteLiquidateOut\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_totalToSeize\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_toLiquidator\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_fee\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ISyntheticToken\",\"name\":\"syntheticTokenIn_\",\"type\":\"address\"},{\"internalType\":\"contract ISyntheticToken\",\"name\":\"syntheticTokenOut_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountOut_\",\"type\":\"uint256\"}],\"name\":\"quoteSwapIn\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_amountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_fee\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ISyntheticToken\",\"name\":\"syntheticTokenIn_\",\"type\":\"address\"},{\"internalType\":\"contract ISyntheticToken\",\"name\":\"syntheticTokenOut_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountIn_\",\"type\":\"uint256\"}],\"name\":\"quoteSwapOut\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_amountOut\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_fee\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IDebtToken\",\"name\":\"debtToken_\",\"type\":\"address\"}],\"name\":\"removeDebtToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IDepositToken\",\"name\":\"depositToken_\",\"type\":\"address\"}],\"name\":\"removeDepositToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account_\",\"type\":\"address\"}],\"name\":\"removeFromDebtTokensOfAccount\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account_\",\"type\":\"address\"}],\"name\":\"removeFromDepositTokensOfAccount\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IRewardsDistributor\",\"name\":\"distributor_\",\"type\":\"address\"}],\"name\":\"removeRewardsDistributor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"shutdown\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"smartFarmingManager\",\"outputs\":[{\"internalType\":\"contract ISmartFarmingManager\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ISyntheticToken\",\"name\":\"syntheticTokenIn_\",\"type\":\"address\"},{\"internalType\":\"contract ISyntheticToken\",\"name\":\"syntheticTokenOut_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountIn_\",\"type\":\"uint256\"}],\"name\":\"swap\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_amountOut\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_fee\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"token_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount_\",\"type\":\"uint256\"}],\"name\":\"sweep\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"toggleIsSwapActive\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"proposedGovernor_\",\"type\":\"address\"}],\"name\":\"transferGovernorship\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"treasury\",\"outputs\":[{\"internalType\":\"contract ITreasury\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unpause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newDebtFloorInUsd_\",\"type\":\"uint256\"}],\"name\":\"updateDebtFloor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IFeeProvider\",\"name\":\"feeProvider_\",\"type\":\"address\"}],\"name\":\"updateFeeProvider\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newMaxLiquidable_\",\"type\":\"uint256\"}],\"name\":\"updateMaxLiquidable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ISmartFarmingManager\",\"name\":\"newSmartFarmingManager_\",\"type\":\"address\"}],\"name\":\"updateSmartFarmingManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ITreasury\",\"name\":\"newTreasury_\",\"type\":\"address\"}],\"name\":\"updateTreasury\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"addDebtToken(address)\":{\"details\":\"Must keep `debtTokenOf` mapping updated\"},\"addToDebtTokensOfAccount(address)\":{\"details\":\"This function is called from `DebtToken` when user's balance changes from `0`The caller should ensure to not pass `address(0)` as `_account`\",\"params\":{\"account_\":\"The account address\"}},\"addToDepositTokensOfAccount(address)\":{\"details\":\"This function is called from `DepositToken` when user's balance changes from `0`The caller should ensure to not pass `address(0)` as `_account`\",\"params\":{\"account_\":\"The account address\"}},\"debtOf(address)\":{\"params\":{\"account_\":\"The account to check\"},\"returns\":{\"_debtInUsd\":\"The debt value in USD\"}},\"debtPositionOf(address)\":{\"params\":{\"account_\":\"The account to check\"},\"returns\":{\"_debtInUsd\":\"The total debt in USD\",\"_depositInUsd\":\"The total collateral deposited in USD\",\"_isHealthy\":\"Whether the account's position is healthy\",\"_issuableInUsd\":\"The amount of debt (is USD) that is free (i.e. can be used to issue synthetic tokens)\",\"_issuableLimitInUsd\":\"The max amount of debt (is USD) that can be created (considering collateral factors)\"}},\"depositOf(address)\":{\"params\":{\"account_\":\"The account to check\"},\"returns\":{\"_depositInUsd\":\"The total deposit value in USD among all collaterals\",\"_issuableLimitInUsd\":\"The max value in USD that can be used to issue synthetic tokens\"}},\"doesDebtTokenExist(address)\":{\"params\":{\"debtToken_\":\"Asset to check\"},\"returns\":{\"_0\":\"true if exist\"}},\"doesDepositTokenExist(address)\":{\"params\":{\"depositToken_\":\"Asset to check\"},\"returns\":{\"_0\":\"true if exist\"}},\"doesSyntheticTokenExist(address)\":{\"params\":{\"syntheticToken_\":\"Asset to check\"},\"returns\":{\"_0\":\"true if exist\"}},\"getDebtTokens()\":{\"details\":\"WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed to mostly be used by view accessors that are queried without any gas fees.\"},\"getDebtTokensOfAccount(address)\":{\"details\":\"WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed to mostly be used by view accessors that are queried without any gas fees.\"},\"getDepositTokens()\":{\"details\":\"WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed to mostly be used by view accessors that are queried without any gas fees.\"},\"getDepositTokensOfAccount(address)\":{\"details\":\"WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed to mostly be used by view accessors that are queried without any gas fees.\"},\"liquidate(address,address,uint256,address)\":{\"params\":{\"account_\":\"The account with an unhealthy position\",\"amountToRepay_\":\"The amount to repay in synthetic token\",\"depositToken_\":\"The collateral to seize from\",\"syntheticToken_\":\"The msAsset to use for repayment\"},\"returns\":{\"_fee\":\"Share of `_totalSeized` collected as fee\",\"_toLiquidator\":\"Share of `_totalSeized` sent to the liquidator\",\"_totalSeized\":\"Total deposit amount seized from the liquidated account\"}},\"open()\":{\"details\":\"Open contract operations, if contract is in shutdown state\"},\"pause()\":{\"details\":\"Suspend deposit feature, if contract is not paused.\"},\"quoteLiquidateIn(address,uint256,address)\":{\"params\":{\"depositToken_\":\"Collateral's deposit token\",\"syntheticToken_\":\"Synth for repayment\",\"totalToSeize_\":\"Collateral total amount to size\"},\"returns\":{\"_amountToRepay\":\"Synth amount to burn\",\"_fee\":\"The fee amount to collect\",\"_toLiquidator\":\"Seized amount to the liquidator\"}},\"quoteLiquidateMax(address,address,address)\":{\"details\":\"I.e. Considers the min amount between collateral's balance and `maxLiquidable` param\",\"params\":{\"account_\":\"The account to liquidate\",\"depositToken_\":\"Collateral's deposit token\",\"syntheticToken_\":\"Synth for repayment\"},\"returns\":{\"_maxAmountToRepay\":\"Synth amount to burn\"}},\"quoteLiquidateOut(address,uint256,address)\":{\"params\":{\"amountToRepay_\":\"Synth amount to burn\",\"depositToken_\":\"Collateral's deposit token\",\"syntheticToken_\":\"Synth for repayment\"},\"returns\":{\"_fee\":\"The fee amount to collect\",\"_toLiquidator\":\"Seized amount to the liquidator\",\"_totalToSeize\":\"Collateral total amount to size\"}},\"quoteSwapIn(address,address,uint256)\":{\"params\":{\"amountOut_\":\"Amount out\",\"syntheticTokenIn_\":\"Synth in\",\"syntheticTokenOut_\":\"Synth out\"},\"returns\":{\"_amountIn\":\"Amount in\",\"_fee\":\"Fee to charge in `syntheticTokenOut_`\"}},\"quoteSwapOut(address,address,uint256)\":{\"params\":{\"amountIn_\":\"Amount in\",\"syntheticTokenIn_\":\"Synth in\",\"syntheticTokenOut_\":\"Synth out\"},\"returns\":{\"_amountOut\":\"Amount out\",\"_fee\":\"Fee to charge in `syntheticTokenOut_`\"}},\"removeDebtToken(address)\":{\"details\":\"Must keep `debtTokenOf` mapping updated\"},\"removeFromDebtTokensOfAccount(address)\":{\"details\":\"This function is called from `DebtToken` when user's balance changes to `0`The caller should ensure to not pass `address(0)` as `_account`\",\"params\":{\"account_\":\"The account address\"}},\"removeFromDepositTokensOfAccount(address)\":{\"details\":\"This function is called from `DepositToken` when user's balance changes to `0`The caller should ensure to not pass `address(0)` as `_account`\",\"params\":{\"account_\":\"The account address\"}},\"shutdown()\":{\"details\":\"Suspend all features (issue, repay, deposit, withdraw, liquidate and swap), if not already shutdown.\"},\"swap(address,address,uint256)\":{\"params\":{\"amountIn_\":\"Amount to swap\",\"syntheticTokenIn_\":\"Synthetic token to sell\",\"syntheticTokenOut_\":\"Synthetic token to buy\"}},\"sweep(address,address,uint256)\":{\"params\":{\"amount_\":\"The amount to send\",\"to_\":\"The recipient of the transfer\",\"token_\":\"The token to transfer\"}},\"transferGovernorship(address)\":{\"details\":\"Can only be called by the current owner.\",\"params\":{\"proposedGovernor_\":\"The new proposed governor\"}},\"unpause()\":{\"details\":\"Unpause contract operations, allow only if contract is paused and not shutdown.\"}},\"title\":\"Pool contract\",\"version\":1},\"userdoc\":{\"events\":{\"DebtFloorUpdated(uint256,uint256)\":{\"notice\":\"Emitted when protocol liquidation fee is updated\"},\"DebtTokenAdded(address)\":{\"notice\":\"Emitted when debt token is enabled\"},\"DebtTokenRemoved(address)\":{\"notice\":\"Emitted when debt token is disabled\"},\"DepositTokenAdded(address)\":{\"notice\":\"Emitted when deposit token is enabled\"},\"DepositTokenRemoved(address)\":{\"notice\":\"Emitted when deposit token is disabled\"},\"FeeProviderUpdated(address,address)\":{\"notice\":\"Emitted when fee provider contract is updated\"},\"MaxLiquidableUpdated(uint256,uint256)\":{\"notice\":\"Emitted when maxLiquidable (liquidation cap) is updated\"},\"Open(address)\":{\"notice\":\"Emitted when contract is turned on\"},\"Paused(address)\":{\"notice\":\"Emitted when contract is paused\"},\"PositionLiquidated(address,address,address,uint256,uint256,uint256)\":{\"notice\":\"Emitted when a position is liquidated\"},\"RewardsDistributorAdded(address)\":{\"notice\":\"Emitted when rewards distributor contract is added\"},\"RewardsDistributorRemoved(address)\":{\"notice\":\"Emitted when rewards distributor contract is removed\"},\"Shutdown(address)\":{\"notice\":\"Emitted when contract is shuted down\"},\"SmartFarmingManagerUpdated(address,address)\":{\"notice\":\"Emitted when SmartFarmingManager contract is updated\"},\"SwapActiveUpdated(bool)\":{\"notice\":\"Emitted when the swap active flag is updated\"},\"SyntheticTokenSwapped(address,address,address,uint256,uint256,uint256)\":{\"notice\":\"Emitted when synthetic token is swapped\"},\"TreasuryUpdated(address,address)\":{\"notice\":\"Emitted when treasury contract is updated\"},\"Unpaused(address)\":{\"notice\":\"Emitted when contract is unpaused\"}},\"kind\":\"user\",\"methods\":{\"MAX_TOKENS_PER_USER()\":{\"notice\":\"Maximum tokens per pool a user may have\"},\"acceptGovernorship()\":{\"notice\":\"Allows new governor to accept governorship of the contract.\"},\"addDebtToken(address)\":{\"notice\":\"Add debt token to offerings\"},\"addDepositToken(address)\":{\"notice\":\"Add deposit token (i.e. collateral) to Synth\"},\"addRewardsDistributor(address)\":{\"notice\":\"Add a RewardsDistributor contract\"},\"addToDebtTokensOfAccount(address)\":{\"notice\":\"Add a debt token to the per-account list\"},\"addToDepositTokensOfAccount(address)\":{\"notice\":\"Add a deposit token to the per-account list\"},\"debtFloorInUsd()\":{\"notice\":\"The debt floor (in USD) for each synthetic token This parameters is used to keep incentive for liquidators (i.e. cover gas and provide enough profit)\"},\"debtOf(address)\":{\"notice\":\"Get account's debt by querying latest prices from oracles\"},\"debtPositionOf(address)\":{\"notice\":\"Returns whether the debt position from an account is healthy\"},\"debtTokenOf(address)\":{\"notice\":\"Get the debt token's address from given synthetic asset\"},\"depositOf(address)\":{\"notice\":\"Get account's total collateral deposited by querying latest prices from oracles\"},\"depositTokenOf(address)\":{\"notice\":\"Get the deposit token's address from given underlying asset\"},\"doesDebtTokenExist(address)\":{\"notice\":\"Check if token is part of the debt offerings\"},\"doesDepositTokenExist(address)\":{\"notice\":\"Check if collateral is supported\"},\"doesSyntheticTokenExist(address)\":{\"notice\":\"Check if token is part of the synthetic offerings\"},\"everythingStopped()\":{\"notice\":\"Return `true` if contract is shutdown\"},\"feeCollector()\":{\"notice\":\"Returns fee collector address\"},\"feeProvider()\":{\"notice\":\"FeeProvider contract\"},\"getDebtTokens()\":{\"notice\":\"Get all debt tokens\"},\"getDebtTokensOfAccount(address)\":{\"notice\":\"Get all debt tokens\"},\"getDepositTokens()\":{\"notice\":\"Get all deposit tokens\"},\"getDepositTokensOfAccount(address)\":{\"notice\":\"Get deposit tokens of an account\"},\"getRewardsDistributors()\":{\"notice\":\"Get all rewards distributors\"},\"governor()\":{\"notice\":\"The governor\"},\"isSwapActive()\":{\"notice\":\"Swap feature on/off flag\"},\"liquidate(address,address,uint256,address)\":{\"notice\":\"Burn synthetic token, unlock deposit token and send liquidator incentive\"},\"masterOracle()\":{\"notice\":\"Get MasterOracle contract\"},\"maxLiquidable()\":{\"notice\":\"The max percent of the debt allowed to liquidate\"},\"paused()\":{\"notice\":\"Return `true` if contract is paused\"},\"poolRegistry()\":{\"notice\":\"PoolRegistry\"},\"proposedGovernor()\":{\"notice\":\"The proposed governor\"},\"quoteLiquidateIn(address,uint256,address)\":{\"notice\":\"Quote synth `_amountToRepay` in order to seize `totalToSeized_`\"},\"quoteLiquidateMax(address,address,address)\":{\"notice\":\"Quote max allowed synth to repay\"},\"quoteLiquidateOut(address,uint256,address)\":{\"notice\":\"Quote collateral `totalToSeized_` by repaying `amountToRepay_`\"},\"quoteSwapIn(address,address,uint256)\":{\"notice\":\"Quote `_amountIn` to get `amountOut_`\"},\"quoteSwapOut(address,address,uint256)\":{\"notice\":\"Quote `amountOut_` get from `amountIn_`\"},\"removeDebtToken(address)\":{\"notice\":\"Remove debt token from offerings\"},\"removeDepositToken(address)\":{\"notice\":\"Remove deposit token (i.e. collateral) from Synth\"},\"removeFromDebtTokensOfAccount(address)\":{\"notice\":\"Remove a debt token from the per-account list\"},\"removeFromDepositTokensOfAccount(address)\":{\"notice\":\"Remove a deposit token from the per-account list\"},\"removeRewardsDistributor(address)\":{\"notice\":\"Remove a RewardsDistributor contract\"},\"smartFarmingManager()\":{\"notice\":\"SmartFarmingManager contract\"},\"swap(address,address,uint256)\":{\"notice\":\"Swap synthetic tokens\"},\"sweep(address,address,uint256)\":{\"notice\":\"ERC20 recovery in case of stuck tokens due direct transfers to the contract address.\"},\"toggleIsSwapActive()\":{\"notice\":\"Turn swap on/off\"},\"transferGovernorship(address)\":{\"notice\":\"Transfers governorship of the contract to a new account (`proposedGovernor`).\"},\"treasury()\":{\"notice\":\"Treasury contract\"},\"updateDebtFloor(uint256)\":{\"notice\":\"Update debt floor\"},\"updateFeeProvider(address)\":{\"notice\":\"Update FeeProvider contract\"},\"updateMaxLiquidable(uint256)\":{\"notice\":\"Update maxLiquidable (liquidation cap)\"},\"updateSmartFarmingManager(address)\":{\"notice\":\"Update SmartFarmingManager contract\"},\"updateTreasury(address)\":{\"notice\":\"Update treasury contract - will migrate funds to the new contract\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/Pool.sol\":\"Pool\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/Pool.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./utils/ReentrancyGuard.sol\\\";\\nimport \\\"./storage/PoolStorage.sol\\\";\\nimport \\\"./lib/WadRayMath.sol\\\";\\nimport \\\"./utils/Pauseable.sol\\\";\\n\\nerror SyntheticDoesNotExist();\\nerror SenderIsNotDebtToken();\\nerror SenderIsNotDepositToken();\\nerror UserReachedMaxTokens();\\nerror PoolRegistryIsNull();\\nerror DebtTokenAlreadyExists();\\nerror DepositTokenAlreadyExists();\\nerror AmountIsZero();\\nerror CanNotLiquidateOwnPosition();\\nerror PositionIsHealthy();\\nerror AmountGreaterThanMaxLiquidable();\\nerror RemainingDebtIsLowerThanTheFloor();\\nerror AmountIsTooHigh();\\nerror DebtTokenDoesNotExist();\\nerror DepositTokenDoesNotExist();\\nerror SwapFeatureIsInactive();\\nerror AmountInIsInvalid();\\nerror AddressIsNull();\\nerror SyntheticIsNull();\\nerror SyntheticIsInUse();\\nerror UnderlyingAssetInUse();\\nerror ReachedMaxDepositTokens();\\nerror RewardDistributorAlreadyExists();\\nerror RewardDistributorDoesNotExist();\\nerror TotalSupplyIsNotZero();\\nerror NewValueIsSameAsCurrent();\\nerror MaxLiquidableTooHigh();\\n\\n/**\\n * @title Pool contract\\n */\\ncontract Pool is ReentrancyGuard, Pauseable, PoolStorageV3 {\\n using SafeERC20 for IERC20;\\n using SafeERC20 for ISyntheticToken;\\n using WadRayMath for uint256;\\n using EnumerableSet for EnumerableSet.AddressSet;\\n using MappedEnumerableSet for MappedEnumerableSet.AddressSet;\\n\\n string public constant VERSION = \\\"1.3.0\\\";\\n\\n /**\\n * @notice Maximum tokens per pool a user may have\\n */\\n uint256 public constant MAX_TOKENS_PER_USER = 30;\\n\\n /// @notice Emitted when protocol liquidation fee is updated\\n event DebtFloorUpdated(uint256 oldDebtFloorInUsd, uint256 newDebtFloorInUsd);\\n\\n /// @notice Emitted when debt token is enabled\\n event DebtTokenAdded(IDebtToken indexed debtToken);\\n\\n /// @notice Emitted when debt token is disabled\\n event DebtTokenRemoved(IDebtToken indexed debtToken);\\n\\n /// @notice Emitted when deposit token is enabled\\n event DepositTokenAdded(address indexed depositToken);\\n\\n /// @notice Emitted when deposit token is disabled\\n event DepositTokenRemoved(IDepositToken indexed depositToken);\\n\\n /// @notice Emitted when fee provider contract is updated\\n event FeeProviderUpdated(IFeeProvider indexed oldFeeProvider, IFeeProvider indexed newFeeProvider);\\n\\n /// @notice Emitted when maxLiquidable (liquidation cap) is updated\\n event MaxLiquidableUpdated(uint256 oldMaxLiquidable, uint256 newMaxLiquidable);\\n\\n /// @notice Emitted when a position is liquidated\\n event PositionLiquidated(\\n address indexed liquidator,\\n address indexed account,\\n ISyntheticToken indexed syntheticToken,\\n uint256 amountRepaid,\\n uint256 depositSeized,\\n uint256 fee\\n );\\n\\n /// @notice Emitted when rewards distributor contract is added\\n event RewardsDistributorAdded(IRewardsDistributor indexed _distributor);\\n\\n /// @notice Emitted when rewards distributor contract is removed\\n event RewardsDistributorRemoved(IRewardsDistributor _distributor);\\n\\n /// @notice Emitted when SmartFarmingManager contract is updated\\n event SmartFarmingManagerUpdated(\\n ISmartFarmingManager oldSmartFarmingManager,\\n ISmartFarmingManager newSmartFarmingManager\\n );\\n\\n /// @notice Emitted when the swap active flag is updated\\n event SwapActiveUpdated(bool newActive);\\n\\n /// @notice Emitted when synthetic token is swapped\\n event SyntheticTokenSwapped(\\n address indexed account,\\n ISyntheticToken indexed syntheticTokenIn,\\n ISyntheticToken indexed syntheticTokenOut,\\n uint256 amountIn,\\n uint256 amountOut,\\n uint256 fee\\n );\\n\\n /// @notice Emitted when treasury contract is updated\\n event TreasuryUpdated(ITreasury indexed oldTreasury, ITreasury indexed newTreasury);\\n\\n /**\\n * @dev Throws if token addition will reach the `account_`'s max\\n */\\n modifier onlyIfAdditionWillNotReachMaxTokens(address account_) {\\n if (debtTokensOfAccount.length(account_) + depositTokensOfAccount.length(account_) >= MAX_TOKENS_PER_USER) {\\n revert UserReachedMaxTokens();\\n }\\n _;\\n }\\n\\n /**\\n * @dev Throws if deposit token doesn't exist\\n */\\n modifier onlyIfDepositTokenExists(IDepositToken depositToken_) {\\n if (!doesDepositTokenExist(depositToken_)) revert DepositTokenDoesNotExist();\\n _;\\n }\\n\\n /**\\n * @dev Throws if synthetic token doesn't exist\\n */\\n modifier onlyIfSyntheticTokenExists(ISyntheticToken syntheticToken_) {\\n if (!doesSyntheticTokenExist(syntheticToken_)) revert SyntheticDoesNotExist();\\n _;\\n }\\n\\n /**\\n * @dev Throws if `msg.sender` isn't a debt token\\n */\\n modifier onlyIfMsgSenderIsDebtToken() {\\n if (!doesDebtTokenExist(IDebtToken(msg.sender))) revert SenderIsNotDebtToken();\\n _;\\n }\\n\\n /**\\n * @dev Throws if `msg.sender` isn't a deposit token\\n */\\n modifier onlyIfMsgSenderIsDepositToken() {\\n if (!doesDepositTokenExist(IDepositToken(msg.sender))) revert SenderIsNotDepositToken();\\n _;\\n }\\n\\n constructor() {\\n _disableInitializers();\\n }\\n\\n function initialize(IPoolRegistry poolRegistry_) public initializer {\\n if (address(poolRegistry_) == address(0)) revert PoolRegistryIsNull();\\n __ReentrancyGuard_init();\\n __Pauseable_init();\\n\\n poolRegistry = poolRegistry_;\\n isSwapActive = true;\\n maxLiquidable = 0.5e18; // 50%\\n }\\n\\n /**\\n * @notice Add a debt token to the per-account list\\n * @dev This function is called from `DebtToken` when user's balance changes from `0`\\n * @dev The caller should ensure to not pass `address(0)` as `_account`\\n * @param account_ The account address\\n */\\n function addToDebtTokensOfAccount(\\n address account_\\n ) external onlyIfMsgSenderIsDebtToken onlyIfAdditionWillNotReachMaxTokens(account_) {\\n if (!debtTokensOfAccount.add(account_, msg.sender)) revert DebtTokenAlreadyExists();\\n }\\n\\n /**\\n * @notice Add a deposit token to the per-account list\\n * @dev This function is called from `DepositToken` when user's balance changes from `0`\\n * @dev The caller should ensure to not pass `address(0)` as `_account`\\n * @param account_ The account address\\n */\\n function addToDepositTokensOfAccount(\\n address account_\\n ) external onlyIfMsgSenderIsDepositToken onlyIfAdditionWillNotReachMaxTokens(account_) {\\n if (!depositTokensOfAccount.add(account_, msg.sender)) revert DepositTokenAlreadyExists();\\n }\\n\\n /**\\n * @notice Get account's debt by querying latest prices from oracles\\n * @param account_ The account to check\\n * @return _debtInUsd The debt value in USD\\n */\\n function debtOf(address account_) public view override returns (uint256 _debtInUsd) {\\n IMasterOracle _masterOracle = masterOracle();\\n uint256 _length = debtTokensOfAccount.length(account_);\\n for (uint256 i; i < _length; ++i) {\\n IDebtToken _debtToken = IDebtToken(debtTokensOfAccount.at(account_, i));\\n _debtInUsd += _masterOracle.quoteTokenToUsd(\\n address(_debtToken.syntheticToken()),\\n _debtToken.balanceOf(account_)\\n );\\n }\\n }\\n\\n /**\\n * @notice Returns whether the debt position from an account is healthy\\n * @param account_ The account to check\\n * @return _isHealthy Whether the account's position is healthy\\n * @return _depositInUsd The total collateral deposited in USD\\n * @return _debtInUsd The total debt in USD\\n * @return _issuableLimitInUsd The max amount of debt (is USD) that can be created (considering collateral factors)\\n * @return _issuableInUsd The amount of debt (is USD) that is free (i.e. can be used to issue synthetic tokens)\\n */\\n function debtPositionOf(\\n address account_\\n )\\n public\\n view\\n override\\n returns (\\n bool _isHealthy,\\n uint256 _depositInUsd,\\n uint256 _debtInUsd,\\n uint256 _issuableLimitInUsd,\\n uint256 _issuableInUsd\\n )\\n {\\n _debtInUsd = debtOf(account_);\\n (_depositInUsd, _issuableLimitInUsd) = depositOf(account_);\\n _isHealthy = _debtInUsd <= _issuableLimitInUsd;\\n _issuableInUsd = _debtInUsd < _issuableLimitInUsd ? _issuableLimitInUsd - _debtInUsd : 0;\\n }\\n\\n /**\\n * @notice Get account's total collateral deposited by querying latest prices from oracles\\n * @param account_ The account to check\\n * @return _depositInUsd The total deposit value in USD among all collaterals\\n * @return _issuableLimitInUsd The max value in USD that can be used to issue synthetic tokens\\n */\\n function depositOf(\\n address account_\\n ) public view override returns (uint256 _depositInUsd, uint256 _issuableLimitInUsd) {\\n IMasterOracle _masterOracle = masterOracle();\\n uint256 _length = depositTokensOfAccount.length(account_);\\n for (uint256 i; i < _length; ++i) {\\n IDepositToken _depositToken = IDepositToken(depositTokensOfAccount.at(account_, i));\\n uint256 _amountInUsd = _masterOracle.quoteTokenToUsd(\\n address(_depositToken.underlying()),\\n _depositToken.balanceOf(account_)\\n );\\n _depositInUsd += _amountInUsd;\\n _issuableLimitInUsd += _amountInUsd.wadMul(_depositToken.collateralFactor());\\n }\\n }\\n\\n /**\\n * @inheritdoc Pauseable\\n */\\n function everythingStopped() public view override(IPauseable, Pauseable) returns (bool) {\\n return super.everythingStopped() || poolRegistry.everythingStopped();\\n }\\n\\n /**\\n * @notice Returns fee collector address\\n */\\n function feeCollector() external view override returns (address) {\\n return poolRegistry.feeCollector();\\n }\\n\\n /**\\n * @notice Get all debt tokens\\n * @dev WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees.\\n */\\n function getDebtTokens() external view override returns (address[] memory) {\\n return debtTokens.values();\\n }\\n\\n /**\\n * @notice Get all debt tokens\\n * @dev WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees.\\n */\\n function getDebtTokensOfAccount(address account_) external view override returns (address[] memory) {\\n return debtTokensOfAccount.values(account_);\\n }\\n\\n /**\\n * @notice Get all deposit tokens\\n * @dev WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees.\\n */\\n function getDepositTokens() external view override returns (address[] memory) {\\n return depositTokens.values();\\n }\\n\\n /**\\n * @notice Get deposit tokens of an account\\n * @dev WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees.\\n */\\n function getDepositTokensOfAccount(address account_) external view override returns (address[] memory) {\\n return depositTokensOfAccount.values(account_);\\n }\\n\\n /**\\n * @notice Get all rewards distributors\\n */\\n function getRewardsDistributors() external view override returns (address[] memory) {\\n return rewardsDistributors.values();\\n }\\n\\n /**\\n * @notice Check if token is part of the debt offerings\\n * @param debtToken_ Asset to check\\n * @return true if exist\\n */\\n function doesDebtTokenExist(IDebtToken debtToken_) public view override returns (bool) {\\n return debtTokens.contains(address(debtToken_));\\n }\\n\\n /**\\n * @notice Check if collateral is supported\\n * @param depositToken_ Asset to check\\n * @return true if exist\\n */\\n function doesDepositTokenExist(IDepositToken depositToken_) public view override returns (bool) {\\n return depositTokens.contains(address(depositToken_));\\n }\\n\\n /**\\n * @notice Check if token is part of the synthetic offerings\\n * @param syntheticToken_ Asset to check\\n * @return true if exist\\n */\\n function doesSyntheticTokenExist(ISyntheticToken syntheticToken_) public view override returns (bool) {\\n return address(debtTokenOf[syntheticToken_]) != address(0);\\n }\\n\\n /**\\n * @notice Quote synth `_amountToRepay` in order to seize `totalToSeized_`\\n * @param syntheticToken_ Synth for repayment\\n * @param totalToSeize_ Collateral total amount to size\\n * @param depositToken_ Collateral's deposit token\\n * @return _amountToRepay Synth amount to burn\\n * @return _toLiquidator Seized amount to the liquidator\\n * @return _fee The fee amount to collect\\n */\\n function quoteLiquidateIn(\\n ISyntheticToken syntheticToken_,\\n uint256 totalToSeize_,\\n IDepositToken depositToken_\\n ) public view override returns (uint256 _amountToRepay, uint256 _toLiquidator, uint256 _fee) {\\n (uint128 _liquidatorIncentive, uint128 _protocolFee) = feeProvider.liquidationFees();\\n uint256 _totalFees = _protocolFee + _liquidatorIncentive;\\n uint256 _repayAmountInCollateral = totalToSeize_;\\n\\n if (_totalFees > 0) {\\n _repayAmountInCollateral = _repayAmountInCollateral.wadDiv(1e18 + _totalFees);\\n }\\n\\n _amountToRepay = masterOracle().quote(\\n address(depositToken_.underlying()),\\n address(syntheticToken_),\\n _repayAmountInCollateral\\n );\\n\\n if (_protocolFee > 0) {\\n _fee = _repayAmountInCollateral.wadMul(_protocolFee);\\n }\\n\\n if (_liquidatorIncentive > 0) {\\n _toLiquidator = _repayAmountInCollateral.wadMul(1e18 + _liquidatorIncentive);\\n }\\n }\\n\\n /**\\n * @notice Quote max allowed synth to repay\\n * @dev I.e. Considers the min amount between collateral's balance and `maxLiquidable` param\\n * @param syntheticToken_ Synth for repayment\\n * @param account_ The account to liquidate\\n * @param depositToken_ Collateral's deposit token\\n * @return _maxAmountToRepay Synth amount to burn\\n */\\n function quoteLiquidateMax(\\n ISyntheticToken syntheticToken_,\\n address account_,\\n IDepositToken depositToken_\\n ) external view override returns (uint256 _maxAmountToRepay) {\\n (bool _isHealthy, , , , ) = debtPositionOf(account_);\\n if (_isHealthy) {\\n return 0;\\n }\\n\\n (uint256 _amountToRepay, , ) = quoteLiquidateIn(\\n syntheticToken_,\\n depositToken_.balanceOf(account_),\\n depositToken_\\n );\\n\\n _maxAmountToRepay = debtTokenOf[syntheticToken_].balanceOf(account_).wadMul(maxLiquidable);\\n\\n if (_amountToRepay < _maxAmountToRepay) {\\n _maxAmountToRepay = _amountToRepay;\\n }\\n }\\n\\n /**\\n * @notice Quote collateral `totalToSeized_` by repaying `amountToRepay_`\\n * @param syntheticToken_ Synth for repayment\\n * @param amountToRepay_ Synth amount to burn\\n * @param depositToken_ Collateral's deposit token\\n * @return _totalToSeize Collateral total amount to size\\n * @return _toLiquidator Seized amount to the liquidator\\n * @return _fee The fee amount to collect\\n */\\n function quoteLiquidateOut(\\n ISyntheticToken syntheticToken_,\\n uint256 amountToRepay_,\\n IDepositToken depositToken_\\n ) public view override returns (uint256 _totalToSeize, uint256 _toLiquidator, uint256 _fee) {\\n _toLiquidator = masterOracle().quote(\\n address(syntheticToken_),\\n address(depositToken_.underlying()),\\n amountToRepay_\\n );\\n\\n (uint128 _liquidatorIncentive, uint128 _protocolFee) = feeProvider.liquidationFees();\\n\\n if (_protocolFee > 0) {\\n _fee = _toLiquidator.wadMul(_protocolFee);\\n }\\n if (_liquidatorIncentive > 0) {\\n _toLiquidator += _toLiquidator.wadMul(_liquidatorIncentive);\\n }\\n\\n _totalToSeize = _fee + _toLiquidator;\\n }\\n\\n /**\\n * @notice Quote `_amountIn` to get `amountOut_`\\n * @param syntheticTokenIn_ Synth in\\n * @param syntheticTokenOut_ Synth out\\n * @param amountOut_ Amount out\\n * @return _amountIn Amount in\\n * @return _fee Fee to charge in `syntheticTokenOut_`\\n */\\n function quoteSwapIn(\\n ISyntheticToken syntheticTokenIn_,\\n ISyntheticToken syntheticTokenOut_,\\n uint256 amountOut_\\n ) external view override returns (uint256 _amountIn, uint256 _fee) {\\n uint256 _swapFee = feeProvider.swapFeeFor(msg.sender);\\n if (_swapFee > 0) {\\n amountOut_ = amountOut_.wadDiv(1e18 - _swapFee);\\n _fee = amountOut_.wadMul(_swapFee);\\n }\\n\\n _amountIn = poolRegistry.masterOracle().quote(\\n address(syntheticTokenOut_),\\n address(syntheticTokenIn_),\\n amountOut_\\n );\\n }\\n\\n /**\\n * @notice Quote `amountOut_` get from `amountIn_`\\n * @param syntheticTokenIn_ Synth in\\n * @param syntheticTokenOut_ Synth out\\n * @param amountIn_ Amount in\\n * @return _amountOut Amount out\\n * @return _fee Fee to charge in `syntheticTokenOut_`\\n */\\n function quoteSwapOut(\\n ISyntheticToken syntheticTokenIn_,\\n ISyntheticToken syntheticTokenOut_,\\n uint256 amountIn_\\n ) public view override returns (uint256 _amountOut, uint256 _fee) {\\n _amountOut = poolRegistry.masterOracle().quote(\\n address(syntheticTokenIn_),\\n address(syntheticTokenOut_),\\n amountIn_\\n );\\n\\n uint256 _swapFee = feeProvider.swapFeeFor(msg.sender);\\n if (_swapFee > 0) {\\n _fee = _amountOut.wadMul(_swapFee);\\n _amountOut -= _fee;\\n }\\n }\\n\\n /**\\n * @notice Burn synthetic token, unlock deposit token and send liquidator incentive\\n * @param syntheticToken_ The msAsset to use for repayment\\n * @param account_ The account with an unhealthy position\\n * @param amountToRepay_ The amount to repay in synthetic token\\n * @param depositToken_ The collateral to seize from\\n * @return _totalSeized Total deposit amount seized from the liquidated account\\n * @return _toLiquidator Share of `_totalSeized` sent to the liquidator\\n * @return _fee Share of `_totalSeized` collected as fee\\n */\\n function liquidate(\\n ISyntheticToken syntheticToken_,\\n address account_,\\n uint256 amountToRepay_,\\n IDepositToken depositToken_\\n )\\n external\\n override\\n whenNotShutdown\\n nonReentrant\\n onlyIfSyntheticTokenExists(syntheticToken_)\\n onlyIfDepositTokenExists(depositToken_)\\n returns (uint256 _totalSeized, uint256 _toLiquidator, uint256 _fee)\\n {\\n if (amountToRepay_ == 0) revert AmountIsZero();\\n if (msg.sender == account_) revert CanNotLiquidateOwnPosition();\\n\\n IDebtToken _debtToken = debtTokenOf[syntheticToken_];\\n _debtToken.accrueInterest();\\n\\n (bool _isHealthy, , , , ) = debtPositionOf(account_);\\n\\n if (_isHealthy) {\\n revert PositionIsHealthy();\\n }\\n\\n uint256 _debtTokenBalance = _debtToken.balanceOf(account_);\\n\\n if (amountToRepay_.wadDiv(_debtTokenBalance) > maxLiquidable) {\\n revert AmountGreaterThanMaxLiquidable();\\n }\\n\\n IMasterOracle _masterOracle = masterOracle();\\n\\n if (debtFloorInUsd > 0) {\\n uint256 _newDebtInUsd = _masterOracle.quoteTokenToUsd(\\n address(syntheticToken_),\\n _debtTokenBalance - amountToRepay_\\n );\\n if (_newDebtInUsd > 0 && _newDebtInUsd < debtFloorInUsd) {\\n revert RemainingDebtIsLowerThanTheFloor();\\n }\\n }\\n\\n (_totalSeized, _toLiquidator, _fee) = quoteLiquidateOut(syntheticToken_, amountToRepay_, depositToken_);\\n\\n if (_totalSeized > depositToken_.balanceOf(account_)) {\\n revert AmountIsTooHigh();\\n }\\n\\n syntheticToken_.burn(msg.sender, amountToRepay_);\\n _debtToken.burn(account_, amountToRepay_);\\n depositToken_.seize(account_, msg.sender, _toLiquidator);\\n\\n if (_fee > 0) {\\n depositToken_.seize(account_, poolRegistry.feeCollector(), _fee);\\n }\\n\\n emit PositionLiquidated(msg.sender, account_, syntheticToken_, amountToRepay_, _totalSeized, _fee);\\n }\\n\\n /**\\n * @notice Get MasterOracle contract\\n */\\n function masterOracle() public view override returns (IMasterOracle) {\\n return poolRegistry.masterOracle();\\n }\\n\\n /**\\n * @inheritdoc Pauseable\\n */\\n function paused() public view override(IPauseable, Pauseable) returns (bool) {\\n return super.paused() || poolRegistry.paused();\\n }\\n\\n /**\\n * @notice Remove a debt token from the per-account list\\n * @dev This function is called from `DebtToken` when user's balance changes to `0`\\n * @dev The caller should ensure to not pass `address(0)` as `_account`\\n * @param account_ The account address\\n */\\n function removeFromDebtTokensOfAccount(address account_) external onlyIfMsgSenderIsDebtToken {\\n if (!debtTokensOfAccount.remove(account_, msg.sender)) revert DebtTokenDoesNotExist();\\n }\\n\\n /**\\n * @notice Remove a deposit token from the per-account list\\n * @dev This function is called from `DepositToken` when user's balance changes to `0`\\n * @dev The caller should ensure to not pass `address(0)` as `_account`\\n * @param account_ The account address\\n */\\n function removeFromDepositTokensOfAccount(address account_) external onlyIfMsgSenderIsDepositToken {\\n if (!depositTokensOfAccount.remove(account_, msg.sender)) revert DepositTokenDoesNotExist();\\n }\\n\\n /**\\n * @notice Swap synthetic tokens\\n * @param syntheticTokenIn_ Synthetic token to sell\\n * @param syntheticTokenOut_ Synthetic token to buy\\n * @param amountIn_ Amount to swap\\n */\\n function swap(\\n ISyntheticToken syntheticTokenIn_,\\n ISyntheticToken syntheticTokenOut_,\\n uint256 amountIn_\\n )\\n external\\n override\\n whenNotShutdown\\n nonReentrant\\n onlyIfSyntheticTokenExists(syntheticTokenIn_)\\n onlyIfSyntheticTokenExists(syntheticTokenOut_)\\n returns (uint256 _amountOut, uint256 _fee)\\n {\\n if (!isSwapActive) revert SwapFeatureIsInactive();\\n if (amountIn_ == 0 || amountIn_ > syntheticTokenIn_.balanceOf(msg.sender)) revert AmountInIsInvalid();\\n\\n syntheticTokenIn_.burn(msg.sender, amountIn_);\\n\\n (_amountOut, _fee) = quoteSwapOut(syntheticTokenIn_, syntheticTokenOut_, amountIn_);\\n\\n if (_fee > 0) {\\n syntheticTokenOut_.mint(poolRegistry.feeCollector(), _fee);\\n }\\n\\n syntheticTokenOut_.mint(msg.sender, _amountOut);\\n\\n emit SyntheticTokenSwapped(msg.sender, syntheticTokenIn_, syntheticTokenOut_, amountIn_, _amountOut, _fee);\\n }\\n\\n /**\\n * @notice Add debt token to offerings\\n * @dev Must keep `debtTokenOf` mapping updated\\n */\\n function addDebtToken(IDebtToken debtToken_) external onlyGovernor {\\n if (address(debtToken_) == address(0)) revert AddressIsNull();\\n ISyntheticToken _syntheticToken = debtToken_.syntheticToken();\\n if (address(_syntheticToken) == address(0)) revert SyntheticIsNull();\\n if (address(debtTokenOf[_syntheticToken]) != address(0)) revert SyntheticIsInUse();\\n\\n if (!debtTokens.add(address(debtToken_))) revert DebtTokenAlreadyExists();\\n\\n debtTokenOf[_syntheticToken] = debtToken_;\\n\\n emit DebtTokenAdded(debtToken_);\\n }\\n\\n /**\\n * @notice Add deposit token (i.e. collateral) to Synth\\n */\\n function addDepositToken(address depositToken_) external onlyGovernor {\\n if (depositToken_ == address(0)) revert AddressIsNull();\\n IERC20 _underlying = IDepositToken(depositToken_).underlying();\\n if (address(depositTokenOf[_underlying]) != address(0)) revert UnderlyingAssetInUse();\\n // Note: Fee collector collects deposit tokens as fee\\n if (depositTokens.length() >= MAX_TOKENS_PER_USER) revert ReachedMaxDepositTokens();\\n\\n if (!depositTokens.add(depositToken_)) revert DepositTokenAlreadyExists();\\n\\n depositTokenOf[_underlying] = IDepositToken(depositToken_);\\n\\n emit DepositTokenAdded(depositToken_);\\n }\\n\\n /**\\n * @notice Add a RewardsDistributor contract\\n */\\n function addRewardsDistributor(IRewardsDistributor distributor_) external onlyGovernor {\\n if (address(distributor_) == address(0)) revert AddressIsNull();\\n if (!rewardsDistributors.add(address(distributor_))) revert RewardDistributorAlreadyExists();\\n emit RewardsDistributorAdded(distributor_);\\n }\\n\\n /**\\n * @notice Remove debt token from offerings\\n * @dev Must keep `debtTokenOf` mapping updated\\n */\\n function removeDebtToken(IDebtToken debtToken_) external onlyGovernor {\\n if (debtToken_.totalSupply() > 0) revert TotalSupplyIsNotZero();\\n if (!debtTokens.remove(address(debtToken_))) revert DebtTokenDoesNotExist();\\n\\n delete debtTokenOf[debtToken_.syntheticToken()];\\n\\n emit DebtTokenRemoved(debtToken_);\\n }\\n\\n /**\\n * @notice Remove deposit token (i.e. collateral) from Synth\\n */\\n function removeDepositToken(IDepositToken depositToken_) external onlyGovernor {\\n if (depositToken_.totalSupply() > 0) revert TotalSupplyIsNotZero();\\n\\n if (!depositTokens.remove(address(depositToken_))) revert DepositTokenDoesNotExist();\\n delete depositTokenOf[depositToken_.underlying()];\\n\\n emit DepositTokenRemoved(depositToken_);\\n }\\n\\n /**\\n * @notice Remove a RewardsDistributor contract\\n */\\n function removeRewardsDistributor(IRewardsDistributor distributor_) external onlyGovernor {\\n if (address(distributor_) == address(0)) revert AddressIsNull();\\n if (!rewardsDistributors.remove(address(distributor_))) revert RewardDistributorDoesNotExist();\\n\\n emit RewardsDistributorRemoved(distributor_);\\n }\\n\\n /**\\n * @notice Turn swap on/off\\n */\\n function toggleIsSwapActive() external onlyGovernor {\\n bool _newIsSwapActive = !isSwapActive;\\n emit SwapActiveUpdated(_newIsSwapActive);\\n isSwapActive = _newIsSwapActive;\\n }\\n\\n /**\\n * @notice Update debt floor\\n */\\n function updateDebtFloor(uint256 newDebtFloorInUsd_) external onlyGovernor {\\n uint256 _currentDebtFloorInUsd = debtFloorInUsd;\\n if (newDebtFloorInUsd_ == _currentDebtFloorInUsd) revert NewValueIsSameAsCurrent();\\n emit DebtFloorUpdated(_currentDebtFloorInUsd, newDebtFloorInUsd_);\\n debtFloorInUsd = newDebtFloorInUsd_;\\n }\\n\\n /**\\n * @notice Update maxLiquidable (liquidation cap)\\n */\\n function updateMaxLiquidable(uint256 newMaxLiquidable_) external onlyGovernor {\\n if (newMaxLiquidable_ > 1e18) revert MaxLiquidableTooHigh();\\n uint256 _currentMaxLiquidable = maxLiquidable;\\n if (newMaxLiquidable_ == _currentMaxLiquidable) revert NewValueIsSameAsCurrent();\\n emit MaxLiquidableUpdated(_currentMaxLiquidable, newMaxLiquidable_);\\n maxLiquidable = newMaxLiquidable_;\\n }\\n\\n /**\\n * @notice Update treasury contract - will migrate funds to the new contract\\n */\\n function updateTreasury(ITreasury newTreasury_) external onlyGovernor {\\n if (address(newTreasury_) == address(0)) revert AddressIsNull();\\n ITreasury _currentTreasury = treasury;\\n if (newTreasury_ == _currentTreasury) revert NewValueIsSameAsCurrent();\\n\\n if (address(_currentTreasury) != address(0)) {\\n _currentTreasury.migrateTo(address(newTreasury_));\\n }\\n\\n emit TreasuryUpdated(_currentTreasury, newTreasury_);\\n treasury = newTreasury_;\\n }\\n\\n /**\\n * @notice Update FeeProvider contract\\n */\\n function updateFeeProvider(IFeeProvider feeProvider_) external onlyGovernor {\\n if (address(feeProvider_) == address(0)) revert AddressIsNull();\\n IFeeProvider _current = feeProvider;\\n if (feeProvider_ == _current) revert NewValueIsSameAsCurrent();\\n emit FeeProviderUpdated(_current, feeProvider_);\\n feeProvider = feeProvider_;\\n }\\n\\n /**\\n * @notice Update SmartFarmingManager contract\\n */\\n function updateSmartFarmingManager(ISmartFarmingManager newSmartFarmingManager_) external onlyGovernor {\\n if (address(newSmartFarmingManager_) == address(0)) revert AddressIsNull();\\n ISmartFarmingManager _current = smartFarmingManager;\\n if (newSmartFarmingManager_ == _current) revert NewValueIsSameAsCurrent();\\n\\n emit SmartFarmingManagerUpdated(_current, newSmartFarmingManager_);\\n smartFarmingManager = newSmartFarmingManager_;\\n }\\n}\\n\",\"keccak256\":\"0xb481286865ed971cde2969438250ec58d3b80541c4cd9b61e14a56cca265e740\",\"license\":\"MIT\"},\"contracts/access/Governable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/openzeppelin-upgradeable/proxy/utils/Initializable.sol\\\";\\nimport \\\"../utils/TokenHolder.sol\\\";\\nimport \\\"../interfaces/IGovernable.sol\\\";\\n\\nerror SenderIsNotGovernor();\\nerror ProposedGovernorIsNull();\\nerror SenderIsNotTheProposedGovernor();\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (governor) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the governor account will be the one that deploys the contract. This\\n * can later be changed with {transferGovernorship}.\\n *\\n */\\nabstract contract Governable is IGovernable, TokenHolder, Initializable {\\n /**\\n * @notice The governor\\n * @dev By default the contract deployer is the initial governor\\n */\\n address public governor;\\n\\n /**\\n * @notice The proposed governor\\n * @dev It will be empty (address(0)) if there isn't a proposed governor\\n */\\n address public proposedGovernor;\\n\\n event UpdatedGovernor(address indexed previousGovernor, address indexed proposedGovernor);\\n\\n constructor() {\\n governor = msg.sender;\\n emit UpdatedGovernor(address(0), msg.sender);\\n }\\n\\n /**\\n * @dev If inheriting child is using proxy then child contract can use\\n * __Governable_init() function to initialization this contract\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function __Governable_init() internal onlyInitializing {\\n governor = msg.sender;\\n emit UpdatedGovernor(address(0), msg.sender);\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the governor.\\n */\\n modifier onlyGovernor() {\\n if (governor != msg.sender) revert SenderIsNotGovernor();\\n _;\\n }\\n\\n /// @inheritdoc TokenHolder\\n // solhint-disable-next-line no-empty-blocks\\n function _requireCanSweep() internal view override onlyGovernor {}\\n\\n /**\\n * @notice Transfers governorship of the contract to a new account (`proposedGovernor`).\\n * @dev Can only be called by the current owner.\\n * @param proposedGovernor_ The new proposed governor\\n */\\n function transferGovernorship(address proposedGovernor_) external onlyGovernor {\\n if (proposedGovernor_ == address(0)) revert ProposedGovernorIsNull();\\n proposedGovernor = proposedGovernor_;\\n }\\n\\n /**\\n * @notice Allows new governor to accept governorship of the contract.\\n */\\n function acceptGovernorship() external {\\n address _proposedGovernor = proposedGovernor;\\n if (msg.sender != _proposedGovernor) revert SenderIsNotTheProposedGovernor();\\n emit UpdatedGovernor(governor, _proposedGovernor);\\n governor = _proposedGovernor;\\n proposedGovernor = address(0);\\n }\\n}\\n\",\"keccak256\":\"0xbe892a132fcf0794df788324b569bc3eca8dde2e66f860bdb4aa3a2483d07988\",\"license\":\"MIT\"},\"contracts/dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/IOFTCoreUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../../../../openzeppelin-upgradeable/utils/introspection/IERC165Upgradeable.sol\\\";\\n\\n/**\\n * @dev Interface of the IOFT core standard\\n */\\ninterface IOFTCoreUpgradeable is IERC165Upgradeable {\\n /**\\n * @dev estimate send token `_tokenId` to (`_dstChainId`, `_toAddress`)\\n * _dstChainId - L0 defined chain id to send tokens too\\n * _toAddress - dynamic bytes array which contains the address to whom you are sending tokens to on the dstChain\\n * _amount - amount of the tokens to transfer\\n * _useZro - indicates to use zro to pay L0 fees\\n * _adapterParam - flexible bytes array to indicate messaging adapter services in L0\\n */\\n function estimateSendFee(\\n uint16 _dstChainId,\\n bytes calldata _toAddress,\\n uint _amount,\\n bool _useZro,\\n bytes calldata _adapterParams\\n ) external view returns (uint nativeFee, uint zroFee);\\n\\n /**\\n * @dev send `_amount` amount of token to (`_dstChainId`, `_toAddress`) from `_from`\\n * `_from` the owner of token\\n * `_dstChainId` the destination chain identifier\\n * `_toAddress` can be any size depending on the `dstChainId`.\\n * `_amount` the quantity of tokens in wei\\n * `_refundAddress` the address LayerZero refunds if too much message fee is sent\\n * `_zroPaymentAddress` set to address(0x0) if not paying in ZRO (LayerZero Token)\\n * `_adapterParams` is a flexible bytes array to indicate messaging adapter services\\n */\\n function sendFrom(\\n address _from,\\n uint16 _dstChainId,\\n bytes calldata _toAddress,\\n uint _amount,\\n address payable _refundAddress,\\n address _zroPaymentAddress,\\n bytes calldata _adapterParams\\n ) external payable;\\n\\n /**\\n * @dev returns the circulating amount of tokens on current chain\\n */\\n function circulatingSupply() external view returns (uint);\\n\\n /**\\n * @dev returns the address of the ERC20 token\\n */\\n function token() external view returns (address);\\n\\n /**\\n * @dev Emitted when `_amount` tokens are moved from the `_sender` to (`_dstChainId`, `_toAddress`)\\n * `_nonce` is the outbound nonce\\n */\\n event SendToChain(uint16 indexed _dstChainId, address indexed _from, bytes _toAddress, uint _amount);\\n\\n /**\\n * @dev Emitted when `_amount` tokens are received from `_srcChainId` into the `_toAddress` on the local chain.\\n * `_nonce` is the inbound nonce.\\n */\\n event ReceiveFromChain(uint16 indexed _srcChainId, address indexed _to, uint _amount);\\n\\n event SetUseCustomAdapterParams(bool _useCustomAdapterParams);\\n}\\n\",\"keccak256\":\"0x22651924296f8308db8195d7a86a6781023241c53905418f2d3925e3f693f530\",\"license\":\"MIT\"},\"contracts/dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/composable/IComposableOFTCoreUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.5.0;\\n\\nimport \\\"../IOFTCoreUpgradeable.sol\\\";\\n\\n/**\\n * @dev Interface of the composable OFT core standard\\n */\\ninterface IComposableOFTCoreUpgradeable is IOFTCoreUpgradeable {\\n function estimateSendAndCallFee(\\n uint16 _dstChainId,\\n bytes calldata _toAddress,\\n uint _amount,\\n bytes calldata _payload,\\n uint64 _dstGasForCall,\\n bool _useZro,\\n bytes calldata _adapterParams\\n ) external view returns (uint nativeFee, uint zroFee);\\n\\n function sendAndCall(\\n address _from,\\n uint16 _dstChainId,\\n bytes calldata _toAddress,\\n uint _amount,\\n bytes calldata _payload,\\n uint64 _dstGasForCall,\\n address payable _refundAddress,\\n address _zroPaymentAddress,\\n bytes calldata _adapterParams\\n ) external payable;\\n\\n function retryOFTReceived(\\n uint16 _srcChainId,\\n bytes calldata _srcAddress,\\n uint64 _nonce,\\n bytes calldata _from,\\n address _to,\\n uint _amount,\\n bytes calldata _payload\\n ) external;\\n\\n event CallOFTReceivedFailure(\\n uint16 indexed _srcChainId,\\n bytes _srcAddress,\\n uint64 _nonce,\\n bytes _from,\\n address indexed _to,\\n uint _amount,\\n bytes _payload,\\n bytes _reason\\n );\\n\\n event CallOFTReceivedSuccess(uint16 indexed _srcChainId, bytes _srcAddress, uint64 _nonce, bytes32 _hash);\\n\\n event RetryOFTReceivedSuccess(bytes32 _messageHash);\\n\\n event NonContractAddress(address _address);\\n}\\n\",\"keccak256\":\"0x769b9356ad6019bdabdcfc11762f28d15eb9a4e262efc96835725f6862c5d9e9\",\"license\":\"MIT\"},\"contracts/dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/composable/IOFTReceiverUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.5.0;\\n\\ninterface IOFTReceiverUpgradeable {\\n /**\\n * @dev Called by the OFT contract when tokens are received from source chain.\\n * @param _srcChainId The chain id of the source chain.\\n * @param _srcAddress The address of the OFT token contract on the source chain.\\n * @param _nonce The nonce of the transaction on the source chain.\\n * @param _from The address of the account who calls the sendAndCall() on the source chain.\\n * @param _amount The amount of tokens to transfer.\\n * @param _payload Additional data with no specified format.\\n */\\n function onOFTReceived(\\n uint16 _srcChainId,\\n bytes calldata _srcAddress,\\n uint64 _nonce,\\n bytes calldata _from,\\n uint _amount,\\n bytes calldata _payload\\n ) external;\\n}\\n\",\"keccak256\":\"0x287036c704c57e34a6fc3f7e67c8dfaaade6eb3667b570576bc491c0f1f89a5b\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.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 * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\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. Equivalent to `reinitializer(1)`.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = _setInitializedVersion(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 * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original\\n * initialization step. This is essential to configure modules that are added through upgrades and that require\\n * initialization.\\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 modifier reinitializer(uint8 version) {\\n bool isTopLevelCall = _setInitializedVersion(version);\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(version);\\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} 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 function _disableInitializers() internal virtual {\\n _setInitializedVersion(type(uint8).max);\\n }\\n\\n function _setInitializedVersion(uint8 version) private returns (bool) {\\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, and for the lowest level\\n // of initializers, because in other contexts the contract may have been reentered.\\n if (_initializing) {\\n require(\\n version == 1 && !AddressUpgradeable.isContract(address(this)),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n return false;\\n } else {\\n require(_initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n return true;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x7454006cccb737612b00104d2f606d728e2818b778e7e55542f063c614ce46ba\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin-upgradeable/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.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 *\\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 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\":\"0x55cf2bd9fc76704ddcdc19834cd288b7de00fc0f298a40ea16a954ae8991db2d\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin-upgradeable/utils/introspection/IERC165Upgradeable.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 IERC165Upgradeable {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0xc6cef87559d0aeffdf0a99803de655938a7779ec0a3cd5d4383483ad85565a09\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\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 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 `recipient`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address recipient, 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 `sender` to `recipient` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address sender,\\n address recipient,\\n uint256 amount\\n ) external returns (bool);\\n\\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\",\"keccak256\":\"0x027b891937d20ccf213fdb9c31531574256de774bda99d3a70ecef6e1913ed2a\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\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\":\"0x83fe24f5c04a56091e50f4a345ff504c8bff658a76d4c43b16878c8f940c53b2\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin/token/ERC20/utils/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\nimport \\\"../../../utils/Address.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n using Address for address;\\n\\n function safeTransfer(\\n IERC20 token,\\n address to,\\n uint256 value\\n ) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n function safeTransferFrom(\\n IERC20 token,\\n address from,\\n address to,\\n uint256 value\\n ) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\\n }\\n\\n /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\n */\\n function safeApprove(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n // safeApprove should only be called when setting an initial allowance,\\n // or when resetting it to zero. To increase and decrease it, use\\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\\n require(\\n (value == 0) || (token.allowance(address(this), spender) == 0),\\n \\\"SafeERC20: approve from non-zero to non-zero allowance\\\"\\n );\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\\n }\\n\\n function safeIncreaseAllowance(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n uint256 newAllowance = token.allowance(address(this), spender) + value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n unchecked {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n require(oldAllowance >= value, \\\"SafeERC20: decreased allowance below zero\\\");\\n uint256 newAllowance = oldAllowance - value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\n if (returndata.length > 0) {\\n // Return data is optional\\n require(abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0x02348b2e4b9f3200c7e3907c5c2661643a6d8520e9f79939fbb9b4005a54894d\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.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\":\"0x2ccf9d2313a313d41a791505f2b5abfdc62191b5d4334f7f7a82691c088a1c87\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin/utils/structs/EnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (utils/structs/EnumerableSet.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for managing\\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\\n * types.\\n *\\n * Sets have the following properties:\\n *\\n * - Elements are added, removed, and checked for existence in constant time\\n * (O(1)).\\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\\n *\\n * ```\\n * contract Example {\\n * // Add the library methods\\n * using EnumerableSet for EnumerableSet.AddressSet;\\n *\\n * // Declare a set state variable\\n * EnumerableSet.AddressSet private mySet;\\n * }\\n * ```\\n *\\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\\n * and `uint256` (`UintSet`) are supported.\\n */\\nlibrary EnumerableSet {\\n // To implement this library for multiple types with as little code\\n // repetition as possible, we write it in terms of a generic Set type with\\n // bytes32 values.\\n // The Set implementation uses private functions, and user-facing\\n // implementations (such as AddressSet) are just wrappers around the\\n // underlying Set.\\n // This means that we can only create new EnumerableSets for types that fit\\n // in bytes32.\\n\\n struct Set {\\n // Storage of set values\\n bytes32[] _values;\\n // Position of the value in the `values` array, plus 1 because index 0\\n // means a value is not in the set.\\n mapping(bytes32 => uint256) _indexes;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function _add(Set storage set, bytes32 value) private returns (bool) {\\n if (!_contains(set, value)) {\\n set._values.push(value);\\n // The value is stored at length-1, but we add 1 to all indexes\\n // and use 0 as a sentinel value\\n set._indexes[value] = set._values.length;\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function _remove(Set storage set, bytes32 value) private returns (bool) {\\n // We read and store the value's index to prevent multiple reads from the same storage slot\\n uint256 valueIndex = set._indexes[value];\\n\\n if (valueIndex != 0) {\\n // Equivalent to contains(set, value)\\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\\n // the array, and then remove the last element (sometimes called as 'swap and pop').\\n // This modifies the order of the array, as noted in {at}.\\n\\n uint256 toDeleteIndex = valueIndex - 1;\\n uint256 lastIndex = set._values.length - 1;\\n\\n if (lastIndex != toDeleteIndex) {\\n bytes32 lastValue = set._values[lastIndex];\\n\\n // Move the last value to the index where the value to delete is\\n set._values[toDeleteIndex] = lastValue;\\n // Update the index for the moved value\\n set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex\\n }\\n\\n // Delete the slot where the moved value was stored\\n set._values.pop();\\n\\n // Delete the index for the deleted slot\\n delete set._indexes[value];\\n\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\\n return set._indexes[value] != 0;\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function _length(Set storage set) private view returns (uint256) {\\n return set._values.length;\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\\n return set._values[index];\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function _values(Set storage set) private view returns (bytes32[] memory) {\\n return set._values;\\n }\\n\\n // Bytes32Set\\n\\n struct Bytes32Set {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _add(set._inner, value);\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _remove(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\\n return _contains(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(Bytes32Set storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\\n return _at(set._inner, index);\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\\n return _values(set._inner);\\n }\\n\\n // AddressSet\\n\\n struct AddressSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(AddressSet storage set, address value) internal returns (bool) {\\n return _add(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(AddressSet storage set, address value) internal returns (bool) {\\n return _remove(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(AddressSet storage set, address value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(AddressSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\\n return address(uint160(uint256(_at(set._inner, index))));\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(AddressSet storage set) internal view returns (address[] memory) {\\n bytes32[] memory store = _values(set._inner);\\n address[] memory result;\\n\\n assembly {\\n result := store\\n }\\n\\n return result;\\n }\\n\\n // UintSet\\n\\n struct UintSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(UintSet storage set, uint256 value) internal returns (bool) {\\n return _add(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\\n return _remove(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function length(UintSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\\n return uint256(_at(set._inner, index));\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(UintSet storage set) internal view returns (uint256[] memory) {\\n bytes32[] memory store = _values(set._inner);\\n uint256[] memory result;\\n\\n assembly {\\n result := store\\n }\\n\\n return result;\\n }\\n}\\n\",\"keccak256\":\"0xacac2065b3ed1facff1163435890d4a6bcdc474e857e8e2c91ae5fb50418f723\",\"license\":\"MIT\"},\"contracts/dependencies/stargate-protocol/interfaces/IStargateComposer.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./IStargateRouter.sol\\\";\\n\\ninterface IStargateComposer {\\n function swap(\\n uint16 _dstChainId,\\n uint256 _srcPoolId,\\n uint256 _dstPoolId,\\n address payable _refundAddress,\\n uint256 _amountLD,\\n uint256 _minAmountLD,\\n IStargateRouter.lzTxObj memory _lzTxParams,\\n bytes calldata _to,\\n bytes calldata _payload\\n ) external payable;\\n\\n function factory() external view returns (address);\\n\\n function stargateBridge() external view returns (address);\\n\\n function stargateRouter() external view returns (IStargateRouter);\\n\\n function quoteLayerZeroFee(\\n uint16 _dstChainId,\\n uint8 _functionType,\\n bytes calldata _toAddress,\\n bytes calldata _transferAndCallPayload,\\n IStargateRouter.lzTxObj memory _lzTxParams\\n ) external view returns (uint256, uint256);\\n\\n function peers(uint16 _chainId) external view returns (address);\\n}\\n\",\"keccak256\":\"0xdfdd1690bf176ac05803534a60227be90cc435b4bdd8fce2348f1a9417a9f63a\",\"license\":\"BUSL-1.1\"},\"contracts/dependencies/stargate-protocol/interfaces/IStargateReceiver.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\n\\npragma solidity 0.8.9;\\n\\ninterface IStargateReceiver {\\n function sgReceive(\\n uint16 _chainId,\\n bytes memory _srcAddress,\\n uint256 _nonce,\\n address _token,\\n uint256 amountLD,\\n bytes memory payload\\n ) external;\\n}\\n\",\"keccak256\":\"0xe4d6bf9fa422e5e43dc1b6880f951d06611a4ed12c2dd7dd8c0b6a5d9e06ad0d\",\"license\":\"BUSL-1.1\"},\"contracts/dependencies/stargate-protocol/interfaces/IStargateRouter.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\n\\npragma solidity 0.8.9;\\n\\ninterface IStargateRouter {\\n struct lzTxObj {\\n uint256 dstGasForCall;\\n uint256 dstNativeAmount;\\n bytes dstNativeAddr;\\n }\\n\\n function addLiquidity(uint256 _poolId, uint256 _amountLD, address _to) external;\\n\\n function swap(\\n uint16 _dstChainId,\\n uint256 _srcPoolId,\\n uint256 _dstPoolId,\\n address payable _refundAddress,\\n uint256 _amountLD,\\n uint256 _minAmountLD,\\n lzTxObj memory _lzTxParams,\\n bytes calldata _to,\\n bytes calldata _payload\\n ) external payable;\\n\\n function redeemRemote(\\n uint16 _dstChainId,\\n uint256 _srcPoolId,\\n uint256 _dstPoolId,\\n address payable _refundAddress,\\n uint256 _amountLP,\\n uint256 _minAmountLD,\\n bytes calldata _to,\\n lzTxObj memory _lzTxParams\\n ) external payable;\\n\\n function instantRedeemLocal(uint16 _srcPoolId, uint256 _amountLP, address _to) external returns (uint256);\\n\\n function redeemLocal(\\n uint16 _dstChainId,\\n uint256 _srcPoolId,\\n uint256 _dstPoolId,\\n address payable _refundAddress,\\n uint256 _amountLP,\\n bytes calldata _to,\\n lzTxObj memory _lzTxParams\\n ) external payable;\\n\\n function sendCredits(\\n uint16 _dstChainId,\\n uint256 _srcPoolId,\\n uint256 _dstPoolId,\\n address payable _refundAddress\\n ) external payable;\\n\\n function quoteLayerZeroFee(\\n uint16 _dstChainId,\\n uint8 _functionType,\\n bytes calldata _toAddress,\\n bytes calldata _transferAndCallPayload,\\n lzTxObj memory _lzTxParams\\n ) external view returns (uint256, uint256);\\n\\n function clearCachedSwap(uint16 _srcChainId, bytes calldata _srcAddress, uint256 _nonce) external;\\n\\n function factory() external view returns (address);\\n\\n function bridge() external view returns (address);\\n\\n function cachedSwapLookup(\\n uint16 _chainId_,\\n bytes calldata _srcAddress,\\n uint256 _nonce\\n ) external view returns (address token, uint256 amountLD, address to, bytes memory payload);\\n}\\n\",\"keccak256\":\"0x92126df8e682b2c5647c7b22e7387da69f9e72480af86948ce5ed17dc2c9e0a7\",\"license\":\"BUSL-1.1\"},\"contracts/interfaces/ICrossChainDispatcher.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/composable/IOFTReceiverUpgradeable.sol\\\";\\nimport \\\"../dependencies/stargate-protocol/interfaces/IStargateReceiver.sol\\\";\\nimport \\\"../dependencies/stargate-protocol/interfaces/IStargateRouter.sol\\\";\\nimport \\\"../dependencies/stargate-protocol/interfaces/IStargateComposer.sol\\\";\\nimport \\\"./IProxyOFT.sol\\\";\\n\\ninterface ICrossChainDispatcher is IStargateReceiver, IOFTReceiverUpgradeable {\\n function crossChainDispatcherOf(uint16 chainId_) external view returns (address);\\n\\n function triggerFlashRepaySwap(\\n uint256 id_,\\n address payable account_,\\n address tokenIn_,\\n address tokenOut_,\\n uint256 amountIn_,\\n uint256 amountOutMin_,\\n bytes calldata lzArgs_\\n ) external payable;\\n\\n function triggerLeverageSwap(\\n uint256 id_,\\n address payable account_,\\n address tokenIn_,\\n address tokenOut_,\\n uint256 amountIn_,\\n uint256 amountOutMin,\\n bytes calldata lzArgs_\\n ) external payable;\\n\\n function isBridgingActive() external view returns (bool);\\n\\n function flashRepayCallbackTxGasLimit() external view returns (uint64);\\n\\n function flashRepaySwapTxGasLimit() external view returns (uint64);\\n\\n function leverageCallbackTxGasLimit() external view returns (uint64);\\n\\n function leverageSwapTxGasLimit() external view returns (uint64);\\n\\n function lzBaseGasLimit() external view returns (uint256);\\n\\n function stargateComposer() external view returns (IStargateComposer);\\n\\n function stargateSlippage() external view returns (uint256);\\n\\n function stargatePoolIdOf(address token_) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xcaf05e625588dcfaa5706acc78a35fa46d50baeb2d28f689036963695a4e39cb\",\"license\":\"MIT\"},\"contracts/interfaces/IDebtToken.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/openzeppelin/token/ERC20/extensions/IERC20Metadata.sol\\\";\\nimport \\\"./ISyntheticToken.sol\\\";\\n\\ninterface IDebtToken is IERC20Metadata {\\n function lastTimestampAccrued() external view returns (uint256);\\n\\n function isActive() external view returns (bool);\\n\\n function syntheticToken() external view returns (ISyntheticToken);\\n\\n function accrueInterest() external;\\n\\n function debtIndex() external returns (uint256 debtIndex_);\\n\\n function burn(address from_, uint256 amount_) external;\\n\\n function issue(uint256 amount_, address to_) external returns (uint256 _issued, uint256 _fee);\\n\\n function flashIssue(address to_, uint256 amount_) external returns (uint256 _issued, uint256 _fee);\\n\\n function mint(address to_, uint256 amount_) external;\\n\\n function repay(address onBehalfOf_, uint256 amount_) external returns (uint256 _repaid, uint256 _fee);\\n\\n function repayAll(address onBehalfOf_) external returns (uint256 _repaid, uint256 _fee);\\n\\n function quoteIssueIn(uint256 amountToIssue_) external view returns (uint256 _amount, uint256 _fee);\\n\\n function quoteIssueOut(uint256 amount_) external view returns (uint256 _amountToIssue, uint256 _fee);\\n\\n function quoteRepayIn(uint256 amountToRepay_) external view returns (uint256 _amount, uint256 _fee);\\n\\n function quoteRepayOut(uint256 amount_) external view returns (uint256 _amountToRepay, uint256 _fee);\\n\\n function updateMaxTotalSupply(uint256 newMaxTotalSupply_) external;\\n\\n function updateInterestRate(uint256 newInterestRate_) external;\\n\\n function maxTotalSupply() external view returns (uint256);\\n\\n function interestRate() external view returns (uint256);\\n\\n function interestRatePerSecond() external view returns (uint256);\\n\\n function toggleIsActive() external;\\n}\\n\",\"keccak256\":\"0xd2f04aa1bee06d6991b10aaf7c03c3ee09d85f8e48ba92feac595ad855881380\",\"license\":\"MIT\"},\"contracts/interfaces/IDepositToken.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/openzeppelin/token/ERC20/extensions/IERC20Metadata.sol\\\";\\n\\ninterface IDepositToken is IERC20Metadata {\\n function underlying() external view returns (IERC20);\\n\\n function collateralFactor() external view returns (uint256);\\n\\n function unlockedBalanceOf(address account_) external view returns (uint256);\\n\\n function lockedBalanceOf(address account_) external view returns (uint256);\\n\\n function flashWithdraw(address account_, uint256 amount_) external returns (uint256 _withdrawn, uint256 _fee);\\n\\n function deposit(uint256 amount_, address onBehalfOf_) external returns (uint256 _deposited, uint256 _fee);\\n\\n function quoteDepositIn(uint256 amountToDeposit_) external view returns (uint256 _amount, uint256 _fee);\\n\\n function quoteDepositOut(uint256 amount_) external view returns (uint256 _amountToDeposit, uint256 _fee);\\n\\n function quoteWithdrawIn(uint256 amountToWithdraw_) external view returns (uint256 _amount, uint256 _fee);\\n\\n function quoteWithdrawOut(uint256 amount_) external view returns (uint256 _amountToWithdraw, uint256 _fee);\\n\\n function withdraw(uint256 amount_, address to_) external returns (uint256 _withdrawn, uint256 _fee);\\n\\n function seize(address from_, address to_, uint256 amount_) external;\\n\\n function updateCollateralFactor(uint128 newCollateralFactor_) external;\\n\\n function isActive() external view returns (bool);\\n\\n function toggleIsActive() external;\\n\\n function maxTotalSupply() external view returns (uint256);\\n\\n function updateMaxTotalSupply(uint256 newMaxTotalSupply_) external;\\n\\n function withdrawFrom(address from_, uint256 amount_) external returns (uint256 _withdrawn, uint256 _fee);\\n}\\n\",\"keccak256\":\"0xb27092f9450d9c48c1a215925007ca9c7282cfe6cf257b34ab3dbe6e745b6bd1\",\"license\":\"MIT\"},\"contracts/interfaces/IFeeProvider.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\n/**\\n * @notice FeeProvider interface\\n */\\ninterface IFeeProvider {\\n struct LiquidationFees {\\n uint128 liquidatorIncentive;\\n uint128 protocolFee;\\n }\\n\\n function defaultSwapFee() external view returns (uint256);\\n\\n function depositFee() external view returns (uint256);\\n\\n function issueFee() external view returns (uint256);\\n\\n function liquidationFees() external view returns (uint128 liquidatorIncentive, uint128 protocolFee);\\n\\n function repayFee() external view returns (uint256);\\n\\n function swapFeeFor(address account_) external view returns (uint256);\\n\\n function withdrawFee() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x3b132b42090c167b2c0aef6d78d833c669c43b9e55593a7a21a96ed5d3082700\",\"license\":\"MIT\"},\"contracts/interfaces/IGovernable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\n/**\\n * @notice Governable interface\\n */\\ninterface IGovernable {\\n function governor() external view returns (address _governor);\\n\\n function transferGovernorship(address _proposedGovernor) external;\\n}\\n\",\"keccak256\":\"0xbe84461adf33aec1bf31b6d84a5380aaeb791de9a4b95346dd8270dc6632984e\",\"license\":\"MIT\"},\"contracts/interfaces/IManageable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./IPool.sol\\\";\\n\\n/**\\n * @notice Manageable interface\\n */\\ninterface IManageable {\\n function pool() external view returns (IPool _pool);\\n}\\n\",\"keccak256\":\"0xac88e0997a26942cb9cbda1a7dd9756e28ba2025813e5b07e55939fbf8538ea2\",\"license\":\"MIT\"},\"contracts/interfaces/IPauseable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\ninterface IPauseable {\\n function paused() external view returns (bool);\\n\\n function everythingStopped() external view returns (bool);\\n}\\n\",\"keccak256\":\"0xa768de9fadad05a8104cb407ae6243354e70ffd6e1a50c3e0bb0a6a1dc49d32a\",\"license\":\"MIT\"},\"contracts/interfaces/IPool.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./IDepositToken.sol\\\";\\nimport \\\"./IDebtToken.sol\\\";\\nimport \\\"./ITreasury.sol\\\";\\nimport \\\"./IRewardsDistributor.sol\\\";\\nimport \\\"./IPoolRegistry.sol\\\";\\nimport \\\"./IFeeProvider.sol\\\";\\nimport \\\"./ISmartFarmingManager.sol\\\";\\nimport \\\"./external/ISwapper.sol\\\";\\nimport \\\"../interfaces/IFeeProvider.sol\\\";\\n\\n/**\\n * @notice Pool interface\\n */\\ninterface IPool is IPauseable, IGovernable {\\n function debtFloorInUsd() external view returns (uint256);\\n\\n function feeCollector() external view returns (address);\\n\\n function feeProvider() external view returns (IFeeProvider);\\n\\n function maxLiquidable() external view returns (uint256);\\n\\n function doesSyntheticTokenExist(ISyntheticToken syntheticToken_) external view returns (bool);\\n\\n function doesDebtTokenExist(IDebtToken debtToken_) external view returns (bool);\\n\\n function doesDepositTokenExist(IDepositToken depositToken_) external view returns (bool);\\n\\n function depositTokenOf(IERC20 underlying_) external view returns (IDepositToken);\\n\\n function debtTokenOf(ISyntheticToken syntheticToken_) external view returns (IDebtToken);\\n\\n function getDepositTokens() external view returns (address[] memory);\\n\\n function getDebtTokens() external view returns (address[] memory);\\n\\n function getRewardsDistributors() external view returns (address[] memory);\\n\\n function debtOf(address account_) external view returns (uint256 _debtInUsd);\\n\\n function depositOf(address account_) external view returns (uint256 _depositInUsd, uint256 _issuableLimitInUsd);\\n\\n function debtPositionOf(\\n address account_\\n )\\n external\\n view\\n returns (\\n bool _isHealthy,\\n uint256 _depositInUsd,\\n uint256 _debtInUsd,\\n uint256 _issuableLimitInUsd,\\n uint256 _issuableInUsd\\n );\\n\\n function liquidate(\\n ISyntheticToken syntheticToken_,\\n address account_,\\n uint256 amountToRepay_,\\n IDepositToken depositToken_\\n ) external returns (uint256 _totalSeized, uint256 _toLiquidator, uint256 _fee);\\n\\n function quoteLiquidateIn(\\n ISyntheticToken syntheticToken_,\\n uint256 totalToSeized_,\\n IDepositToken depositToken_\\n ) external view returns (uint256 _amountToRepay, uint256 _toLiquidator, uint256 _fee);\\n\\n function quoteLiquidateMax(\\n ISyntheticToken syntheticToken_,\\n address account_,\\n IDepositToken depositToken_\\n ) external view returns (uint256 _maxAmountToRepay);\\n\\n function quoteLiquidateOut(\\n ISyntheticToken syntheticToken_,\\n uint256 amountToRepay_,\\n IDepositToken depositToken_\\n ) external view returns (uint256 _totalSeized, uint256 _toLiquidator, uint256 _fee);\\n\\n function quoteSwapIn(\\n ISyntheticToken syntheticTokenIn_,\\n ISyntheticToken syntheticTokenOut_,\\n uint256 amountOut_\\n ) external view returns (uint256 _amountIn, uint256 _fee);\\n\\n function quoteSwapOut(\\n ISyntheticToken syntheticTokenIn_,\\n ISyntheticToken syntheticTokenOut_,\\n uint256 amountIn_\\n ) external view returns (uint256 _amountOut, uint256 _fee);\\n\\n function swap(\\n ISyntheticToken syntheticTokenIn_,\\n ISyntheticToken syntheticTokenOut_,\\n uint256 amountIn_\\n ) external returns (uint256 _amountOut, uint256 _fee);\\n\\n function treasury() external view returns (ITreasury);\\n\\n function masterOracle() external view returns (IMasterOracle);\\n\\n function poolRegistry() external view returns (IPoolRegistry);\\n\\n function addToDepositTokensOfAccount(address account_) external;\\n\\n function removeFromDepositTokensOfAccount(address account_) external;\\n\\n function addToDebtTokensOfAccount(address account_) external;\\n\\n function removeFromDebtTokensOfAccount(address account_) external;\\n\\n function getDepositTokensOfAccount(address account_) external view returns (address[] memory);\\n\\n function getDebtTokensOfAccount(address account_) external view returns (address[] memory);\\n\\n function isSwapActive() external view returns (bool);\\n\\n function smartFarmingManager() external view returns (ISmartFarmingManager);\\n}\\n\",\"keccak256\":\"0x0f0a869451cca858ba52b56970db167360fe161f2450557a053c4da938558816\",\"license\":\"MIT\"},\"contracts/interfaces/IPoolRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./external/IMasterOracle.sol\\\";\\nimport \\\"./IPauseable.sol\\\";\\nimport \\\"./IGovernable.sol\\\";\\nimport \\\"./ISyntheticToken.sol\\\";\\nimport \\\"./external/ISwapper.sol\\\";\\nimport \\\"./IQuoter.sol\\\";\\nimport \\\"./ICrossChainDispatcher.sol\\\";\\n\\ninterface IPoolRegistry is IPauseable, IGovernable {\\n function feeCollector() external view returns (address);\\n\\n function isPoolRegistered(address pool_) external view returns (bool);\\n\\n function nativeTokenGateway() external view returns (address);\\n\\n function getPools() external view returns (address[] memory);\\n\\n function registerPool(address pool_) external;\\n\\n function unregisterPool(address pool_) external;\\n\\n function masterOracle() external view returns (IMasterOracle);\\n\\n function updateFeeCollector(address newFeeCollector_) external;\\n\\n function idOfPool(address pool_) external view returns (uint256);\\n\\n function nextPoolId() external view returns (uint256);\\n\\n function swapper() external view returns (ISwapper);\\n\\n function quoter() external view returns (IQuoter);\\n\\n function crossChainDispatcher() external view returns (ICrossChainDispatcher);\\n\\n function doesSyntheticTokenExist(ISyntheticToken syntheticToken_) external view returns (bool _exists);\\n}\\n\",\"keccak256\":\"0x9ffa9e5fd39a48ac2bda561af7fb4fc9df5f8ffb7a602ef1d4da8c068019e723\",\"license\":\"MIT\"},\"contracts/interfaces/IProxyOFT.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/composable/IComposableOFTCoreUpgradeable.sol\\\";\\n\\ninterface IProxyOFT is IComposableOFTCoreUpgradeable {\\n function getProxyOFTOf(uint16 chainId_) external view returns (address _proxyOFT);\\n}\\n\",\"keccak256\":\"0x4041a90eb60de460c9e1631aaedfbf2bff2275b3f91964800b1c774546931cd5\",\"license\":\"MIT\"},\"contracts/interfaces/IQuoter.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./IPoolRegistry.sol\\\";\\nimport \\\"./IProxyOFT.sol\\\";\\n\\ninterface IQuoter {\\n function quoteCrossChainFlashRepayNativeFee(\\n IProxyOFT proxyOFT_,\\n bytes calldata lzArgs_\\n ) external view returns (uint256 _nativeFee);\\n\\n function quoteCrossChainLeverageNativeFee(\\n IProxyOFT proxyOFT_,\\n bytes calldata lzArgs_\\n ) external view returns (uint256 _nativeFee);\\n\\n function quoteLeverageCallbackNativeFee(uint16 dstChainId_) external view returns (uint256 _callbackTxNativeFee);\\n\\n function quoteFlashRepayCallbackNativeFee(uint16 dstChainId_) external view returns (uint256 _callbackTxNativeFee);\\n\\n function getFlashRepaySwapAndCallbackLzArgs(\\n uint16 srcChainId_,\\n uint16 dstChainId_\\n ) external view returns (bytes memory lzArgs_);\\n\\n function getLeverageSwapAndCallbackLzArgs(\\n uint16 srcChainId_,\\n uint16 dstChainId_\\n ) external view returns (bytes memory lzArgs_);\\n}\\n\",\"keccak256\":\"0x1e4d2dd779a09dc8ea6b6c244b167deddca3a48e71b73bf940da04113b40c752\",\"license\":\"MIT\"},\"contracts/interfaces/IRewardsDistributor.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/openzeppelin/token/ERC20/IERC20.sol\\\";\\n\\n/**\\n * @notice Reward Distributor interface\\n */\\ninterface IRewardsDistributor {\\n function rewardToken() external view returns (IERC20);\\n\\n function tokenSpeeds(IERC20 token_) external view returns (uint256);\\n\\n function tokensAccruedOf(address account_) external view returns (uint256);\\n\\n function updateBeforeMintOrBurn(IERC20 token_, address account_) external;\\n\\n function updateBeforeTransfer(IERC20 token_, address from_, address to_) external;\\n\\n function claimable(address account_) external view returns (uint256 _claimable);\\n\\n function claimable(address account_, IERC20 token_) external view returns (uint256 _claimable);\\n\\n function claimRewards(address account_) external;\\n\\n function claimRewards(address account_, IERC20[] memory tokens_) external;\\n\\n function claimRewards(address[] memory accounts_, IERC20[] memory tokens_) external;\\n\\n function updateTokenSpeed(IERC20 token_, uint256 newSpeed_) external;\\n\\n function updateTokenSpeeds(IERC20[] calldata tokens_, uint256[] calldata speeds_) external;\\n\\n function tokens(uint256) external view returns (IERC20);\\n\\n function tokenStates(IERC20) external view returns (uint224 index, uint32 timestamp);\\n\\n function accountIndexOf(IERC20, address) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x4f527eeae61b6a5bff7d3b48037234ef718ae7f71dc452e8cab3b60581f0d810\",\"license\":\"MIT\"},\"contracts/interfaces/ISmartFarmingManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./IManageable.sol\\\";\\nimport \\\"./IDepositToken.sol\\\";\\nimport \\\"./IDebtToken.sol\\\";\\n\\n/**\\n * @notice SmartFarmingManager interface\\n */\\ninterface ISmartFarmingManager {\\n function flashRepay(\\n ISyntheticToken syntheticToken_,\\n IDepositToken depositToken_,\\n uint256 withdrawAmount_,\\n uint256 repayAmountMin_\\n ) external returns (uint256 _withdrawn, uint256 _repaid);\\n\\n function crossChainFlashRepay(\\n ISyntheticToken syntheticToken_,\\n IDepositToken depositToken_,\\n uint256 withdrawAmount_,\\n IERC20 bridgeToken_,\\n uint256 bridgeTokenAmountMin_,\\n uint256 swapAmountOutMin_,\\n uint256 repayAmountMin_,\\n bytes calldata lzArgs_\\n ) external payable;\\n\\n function crossChainLeverage(\\n IERC20 tokenIn_,\\n IDepositToken depositToken_,\\n ISyntheticToken syntheticToken_,\\n uint256 amountIn_,\\n uint256 leverage_,\\n uint256 swapAmountOutMin_,\\n uint256 depositAmountMin_,\\n bytes calldata lzArgs_\\n ) external payable;\\n\\n function crossChainLeverageCallback(uint256 id_, uint256 swapAmountOut_) external returns (uint256 _deposited);\\n\\n function crossChainFlashRepayCallback(uint256 id_, uint256 swapAmountOut_) external returns (uint256 _repaid);\\n\\n function leverage(\\n IERC20 tokenIn_,\\n IDepositToken depositToken_,\\n ISyntheticToken syntheticToken_,\\n uint256 amountIn_,\\n uint256 leverage_,\\n uint256 depositAmountMin_\\n ) external returns (uint256 _deposited, uint256 _issued);\\n}\\n\",\"keccak256\":\"0x7544a9d308a49e24d6984c3cfcfe2c1cfb7d9ce4655408438e1c12f37175a3b0\",\"license\":\"MIT\"},\"contracts/interfaces/ISyntheticToken.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/openzeppelin/token/ERC20/extensions/IERC20Metadata.sol\\\";\\nimport \\\"./IDebtToken.sol\\\";\\nimport \\\"./IPoolRegistry.sol\\\";\\nimport \\\"../interfaces/IProxyOFT.sol\\\";\\n\\ninterface ISyntheticToken is IERC20Metadata {\\n function isActive() external view returns (bool);\\n\\n function mint(address to_, uint256 amount_) external;\\n\\n function burn(address from_, uint256 amount) external;\\n\\n function poolRegistry() external view returns (IPoolRegistry);\\n\\n function toggleIsActive() external;\\n\\n function seize(address from_, address to_, uint256 amount_) external;\\n\\n function updateMaxTotalSupply(uint256 newMaxTotalSupply_) external;\\n\\n function updateProxyOFT(IProxyOFT newProxyOFT_) external;\\n\\n function maxTotalSupply() external view returns (uint256);\\n\\n function proxyOFT() external view returns (IProxyOFT);\\n}\\n\",\"keccak256\":\"0xfaeb24d1067e85493a5c8818d6de06fc6dbc72c37e85f82811990d0120f8a0cf\",\"license\":\"MIT\"},\"contracts/interfaces/ITreasury.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\ninterface ITreasury {\\n function pull(address to_, uint256 amount_) external;\\n\\n function migrateTo(address newTreasury_) external;\\n}\\n\",\"keccak256\":\"0x9ee0a41cfe7b5bd2ec256441fc7b2ae6407921ed28a65daeaa476cfc9df73c1b\",\"license\":\"MIT\"},\"contracts/interfaces/external/IMasterOracle.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\ninterface IMasterOracle {\\n function quoteTokenToUsd(address _asset, uint256 _amount) external view returns (uint256 _amountInUsd);\\n\\n function quoteUsdToToken(address _asset, uint256 _amountInUsd) external view returns (uint256 _amount);\\n\\n function quote(address _assetIn, address _assetOut, uint256 _amountIn) external view returns (uint256 _amountOut);\\n}\\n\",\"keccak256\":\"0x2f080adc5880151dc4446ef43b54abab8e3711c5f2e526917ef39a05e3c16a00\",\"license\":\"MIT\"},\"contracts/interfaces/external/ISwapper.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\ninterface ISwapper {\\n function swapExactInput(\\n address tokenIn_,\\n address tokenOut_,\\n uint256 amountIn_,\\n uint256 amountOutMin_,\\n address receiver_\\n ) external returns (uint256 _amountOut);\\n}\\n\",\"keccak256\":\"0x75f04b225d0c310be7e0a09ee4c1aa6eeeb8d94e02fc0e4160a9597ce2d8d446\",\"license\":\"MIT\"},\"contracts/lib/MappedEnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\n/**\\n * @dev EnumerableSet fork to support `address => address[]` mapping\\n * @dev Forked from OZ 4.3.2\\n */\\nlibrary MappedEnumerableSet {\\n struct Set {\\n // Storage of set values\\n address[] _values;\\n // Position of the value in the `values` array, plus 1 because index 0\\n // means a value is not in the set.\\n mapping(address => uint256) _indexes;\\n }\\n\\n struct AddressSet {\\n mapping(address => Set) _ofAddress;\\n }\\n\\n function _add(AddressSet storage set, address _key, address value) private returns (bool) {\\n if (!_contains(set, _key, value)) {\\n set._ofAddress[_key]._values.push(value);\\n // The value is stored at length-1, but we add 1 to all indexes\\n // and use 0 as a sentinel value\\n set._ofAddress[_key]._indexes[value] = set._ofAddress[_key]._values.length;\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n function _remove(AddressSet storage set, address _key, address value) private returns (bool) {\\n // We read and store the value's index to prevent multiple reads from the same storage slot\\n uint256 valueIndex = set._ofAddress[_key]._indexes[value];\\n\\n if (valueIndex != 0) {\\n // Equivalent to contains(set, value)\\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\\n // the array, and then remove the last element (sometimes called as 'swap and pop').\\n // This modifies the order of the array, as noted in {at}.\\n\\n uint256 toDeleteIndex = valueIndex - 1;\\n uint256 lastIndex = set._ofAddress[_key]._values.length - 1;\\n\\n if (lastIndex != toDeleteIndex) {\\n address lastvalue = set._ofAddress[_key]._values[lastIndex];\\n\\n // Move the last value to the index where the value to delete is\\n set._ofAddress[_key]._values[toDeleteIndex] = lastvalue;\\n // Update the index for the moved value\\n set._ofAddress[_key]._indexes[lastvalue] = valueIndex; // Replace lastvalue's index to valueIndex\\n }\\n\\n // Delete the slot where the moved value was stored\\n set._ofAddress[_key]._values.pop();\\n\\n // Delete the index for the deleted slot\\n delete set._ofAddress[_key]._indexes[value];\\n\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n function _contains(AddressSet storage set, address _key, address value) private view returns (bool) {\\n return set._ofAddress[_key]._indexes[value] != 0;\\n }\\n\\n function _length(AddressSet storage set, address _key) private view returns (uint256) {\\n return set._ofAddress[_key]._values.length;\\n }\\n\\n function _at(AddressSet storage set, address _key, uint256 index) private view returns (address) {\\n return set._ofAddress[_key]._values[index];\\n }\\n\\n function _values(AddressSet storage set, address _key) private view returns (address[] memory) {\\n return set._ofAddress[_key]._values;\\n }\\n\\n function add(AddressSet storage set, address key, address value) internal returns (bool) {\\n return _add(set, key, value);\\n }\\n\\n function remove(AddressSet storage set, address key, address value) internal returns (bool) {\\n return _remove(set, key, value);\\n }\\n\\n function contains(AddressSet storage set, address key, address value) internal view returns (bool) {\\n return _contains(set, key, value);\\n }\\n\\n function length(AddressSet storage set, address key) internal view returns (uint256) {\\n return _length(set, key);\\n }\\n\\n function at(AddressSet storage set, address key, uint256 index) internal view returns (address) {\\n return _at(set, key, index);\\n }\\n\\n function values(AddressSet storage set, address key) internal view returns (address[] memory) {\\n address[] memory store = _values(set, key);\\n address[] memory result;\\n\\n assembly {\\n result := store\\n }\\n\\n return result;\\n }\\n}\\n\",\"keccak256\":\"0x73a56244f6f1284bbafb7de23a3422fea10556b4bf54ee768c4768c23fdc03fe\",\"license\":\"MIT\"},\"contracts/lib/WadRayMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\n/**\\n * @title Math library\\n * @dev Provides mul and div function for wads (decimal numbers with 18 digits precision) and rays (decimals with 27 digits)\\n * @dev Based on https://github.com/dapphub/ds-math/blob/master/src/math.sol\\n */\\nlibrary WadRayMath {\\n uint256 internal constant WAD = 1e18;\\n uint256 internal constant HALF_WAD = WAD / 2;\\n\\n uint256 internal constant RAY = 1e27;\\n uint256 internal constant HALF_RAY = RAY / 2;\\n\\n uint256 internal constant WAD_RAY_RATIO = 1e9;\\n\\n /**\\n * @dev Multiplies two wad, rounding half up to the nearest wad\\n * @param a Wad\\n * @param b Wad\\n * @return The result of a*b, in wad\\n */\\n function wadMul(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (a == 0 || b == 0) {\\n return 0;\\n }\\n\\n return (a * b + HALF_WAD) / WAD;\\n }\\n\\n /**\\n * @dev Divides two wad, rounding half up to the nearest wad\\n * @param a Wad\\n * @param b Wad\\n * @return The result of a/b, in wad\\n */\\n function wadDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n return (a * WAD + b / 2) / b;\\n }\\n}\\n\",\"keccak256\":\"0xd971282b7b02c2121f64a13df8b40f427dbda36a770d0d391a3102947a743071\",\"license\":\"MIT\"},\"contracts/storage/PoolStorage.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/openzeppelin/utils/structs/EnumerableSet.sol\\\";\\nimport \\\"../lib/MappedEnumerableSet.sol\\\";\\nimport \\\"../interfaces/IPool.sol\\\";\\nimport \\\"../interfaces/ISmartFarmingManager.sol\\\";\\n\\n// solhint-disable var-name-mixedcase, max-states-count\\nabstract contract PoolStorageV1 is IPool {\\n /**\\n * @notice The debt floor (in USD) for each synthetic token\\n * This parameters is used to keep incentive for liquidators (i.e. cover gas and provide enough profit)\\n */\\n uint256 public override debtFloorInUsd;\\n\\n uint256 private depositFee__DEPRECATED;\\n\\n uint256 private issueFee__DEPRECATED;\\n\\n uint256 private withdrawFee__DEPRECATED;\\n\\n uint256 private repayFee__DEPRECATED;\\n\\n uint256 private swapFee__DEPRECATED;\\n\\n uint256 private liquidationFees__DEPRECATED;\\n\\n /**\\n * @notice The max percent of the debt allowed to liquidate\\n * @dev Use 18 decimals (e.g. 1e16 = 1%)\\n */\\n uint256 public override maxLiquidable;\\n\\n /**\\n * @notice PoolRegistry\\n */\\n IPoolRegistry public override poolRegistry;\\n\\n /**\\n * @notice Swap feature on/off flag\\n */\\n bool public override isSwapActive;\\n\\n /**\\n * @notice Treasury contract\\n */\\n ITreasury public override treasury;\\n\\n /**\\n * @notice Represents collateral's deposits\\n */\\n EnumerableSet.AddressSet internal depositTokens;\\n\\n /**\\n * @notice Get the deposit token's address from given underlying asset\\n */\\n mapping(IERC20 => IDepositToken) public override depositTokenOf;\\n\\n /**\\n * @notice Available debt tokens\\n */\\n EnumerableSet.AddressSet internal debtTokens;\\n\\n /**\\n * @notice Per-account deposit tokens (i.e. tokens that user has balance > 0)\\n */\\n MappedEnumerableSet.AddressSet internal depositTokensOfAccount;\\n\\n /**\\n * @notice Per-account debt tokens (i.e. tokens that user has balance > 0)\\n */\\n MappedEnumerableSet.AddressSet internal debtTokensOfAccount;\\n\\n /**\\n * @notice RewardsDistributor contracts\\n */\\n IRewardsDistributor[] internal rewardsDistributors__DEPRECATED;\\n\\n /**\\n * @notice Get the debt token's address from given synthetic asset\\n */\\n mapping(ISyntheticToken => IDebtToken) public override debtTokenOf;\\n}\\n\\nabstract contract PoolStorageV2 is PoolStorageV1 {\\n ISwapper private swapper__DEPRECATED;\\n\\n /**\\n * @notice FeeProvider contract\\n */\\n IFeeProvider public override feeProvider;\\n\\n /**\\n * @notice RewardsDistributor contracts\\n */\\n EnumerableSet.AddressSet internal rewardsDistributors;\\n}\\n\\nabstract contract PoolStorageV3 is PoolStorageV2 {\\n /**\\n * @notice SmartFarmingManager contract\\n */\\n ISmartFarmingManager public smartFarmingManager;\\n}\\n\",\"keccak256\":\"0xfe4304c525dfafba2ab7dd83c6458e7a88ad778b065c631fb7b53efe2884dad7\",\"license\":\"MIT\"},\"contracts/utils/Pauseable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../interfaces/IPauseable.sol\\\";\\nimport \\\"../access/Governable.sol\\\";\\n\\nerror IsPaused();\\nerror IsShutdown();\\nerror IsNotPaused();\\nerror IsNotShutdown();\\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 */\\nabstract contract Pauseable is IPauseable, Governable {\\n /// @notice Emitted when contract is turned on\\n event Open(address indexed caller);\\n\\n /// @notice Emitted when contract is paused\\n event Paused(address indexed caller);\\n\\n /// @notice Emitted when contract is shuted down\\n event Shutdown(address indexed caller);\\n\\n /// @notice Emitted when contract is unpaused\\n event Unpaused(address indexed caller);\\n\\n bool private _paused;\\n bool private _everythingStopped;\\n\\n /**\\n * @dev Throws if contract is paused\\n */\\n modifier whenNotPaused() {\\n if (paused()) revert IsPaused();\\n _;\\n }\\n\\n /**\\n * @dev Throws if contract is shutdown\\n */\\n modifier whenNotShutdown() {\\n if (everythingStopped()) revert IsShutdown();\\n _;\\n }\\n\\n /**\\n * @dev Throws if contract is not paused\\n */\\n modifier whenPaused() {\\n if (!paused()) revert IsNotPaused();\\n _;\\n }\\n\\n /**\\n * @dev Throws if contract is not shutdown\\n */\\n modifier whenShutdown() {\\n if (!everythingStopped()) revert IsNotShutdown();\\n _;\\n }\\n\\n /**\\n * @dev If inheriting child is using proxy then child contract can use\\n * __Pauseable_init() function to initialization this contract\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function __Pauseable_init() internal onlyInitializing {\\n __Governable_init();\\n }\\n\\n /**\\n * @notice Return `true` if contract is shutdown\\n */\\n function everythingStopped() public view virtual returns (bool) {\\n return _everythingStopped;\\n }\\n\\n /**\\n * @notice Return `true` if contract is paused\\n */\\n function paused() public view virtual returns (bool) {\\n return _paused;\\n }\\n\\n /**\\n * @dev Open contract operations, if contract is in shutdown state\\n */\\n function open() external virtual whenShutdown onlyGovernor {\\n _everythingStopped = false;\\n emit Open(msg.sender);\\n }\\n\\n /**\\n * @dev Suspend deposit feature, if contract is not paused.\\n */\\n function pause() external virtual whenNotPaused onlyGovernor {\\n _paused = true;\\n emit Paused(msg.sender);\\n }\\n\\n /**\\n * @dev Suspend all features (issue, repay, deposit, withdraw, liquidate and swap), if not already shutdown.\\n */\\n function shutdown() external virtual whenNotShutdown onlyGovernor {\\n _everythingStopped = true;\\n _paused = true;\\n emit Shutdown(msg.sender);\\n }\\n\\n /**\\n * @dev Unpause contract operations, allow only if contract is paused and not shutdown.\\n */\\n function unpause() external virtual whenPaused whenNotShutdown onlyGovernor {\\n _paused = false;\\n emit Unpaused(msg.sender);\\n }\\n}\\n\",\"keccak256\":\"0x562f6b2a2d06f443b1c7e6b7e3dd45b5c658c86eee448f10bc63c145f2c86bc6\",\"license\":\"MIT\"},\"contracts/utils/ReentrancyGuard.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../dependencies/openzeppelin-upgradeable/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 ReentrancyGuard 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 // On the first call to nonReentrant, _notEntered will be true\\n require(_status != _ENTERED, \\\"ReentrancyGuard: reentrant call\\\");\\n\\n // Any calls to nonReentrant after this point will fail\\n _status = _ENTERED;\\n\\n _;\\n\\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\",\"keccak256\":\"0x3bf3c3de5a638ca101f25dfcaec5268e9c8a1c29a9a278d70be4459768fb41fe\",\"license\":\"MIT\"},\"contracts/utils/TokenHolder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/openzeppelin/token/ERC20/utils/SafeERC20.sol\\\";\\n\\nerror FallbackIsNotAllowed();\\nerror ReceiveIsNotAllowed();\\n\\n/**\\n * @title Utils contract that handles tokens sent to it\\n */\\nabstract contract TokenHolder {\\n using SafeERC20 for IERC20;\\n\\n /**\\n * @dev Revert fallback calls\\n */\\n fallback() external payable {\\n revert FallbackIsNotAllowed();\\n }\\n\\n /**\\n * @dev Revert when receiving by default\\n */\\n receive() external payable virtual {\\n revert ReceiveIsNotAllowed();\\n }\\n\\n /**\\n * @notice ERC20 recovery in case of stuck tokens due direct transfers to the contract address.\\n * @param token_ The token to transfer\\n * @param to_ The recipient of the transfer\\n * @param amount_ The amount to send\\n */\\n function sweep(IERC20 token_, address to_, uint256 amount_) external {\\n _requireCanSweep();\\n\\n if (address(token_) == address(0)) {\\n Address.sendValue(payable(to_), amount_);\\n } else {\\n token_.safeTransfer(to_, amount_);\\n }\\n }\\n\\n /**\\n * @notice Function that reverts if the caller isn't allowed to sweep tokens\\n * @dev Usually requires the owner or governor as the caller\\n */\\n function _requireCanSweep() internal view virtual;\\n}\\n\",\"keccak256\":\"0x50e56ed45d496b188d90494d08122fe9621d9e6c8f655679ef334447801ea50d\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x60806040523480156200001157600080fd5b50600280546001600160a01b031916339081179091556040516000907fd4459d5b8b913cab0244230fd9b1c08b6ceace7fe9230e60d0f74cbffdf849d0908290a36200005c62000062565b62000192565b6200006e60ff62000071565b50565b60008054610100900460ff16156200010a578160ff166001148015620000aa5750620000a8306200018360201b620038c91760201c565b155b620001025760405162461bcd60e51b815260206004820152602e6024820152600080516020620049f283398151915260448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b506000919050565b60005460ff808416911610620001695760405162461bcd60e51b815260206004820152602e6024820152600080516020620049f283398151915260448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401620000f9565b506000805460ff191660ff92909216919091179055600190565b6001600160a01b03163b151590565b61485080620001a26000396000f3fe6080604052600436106103905760003560e01c80637f51bb1f116101dc578063d283e75f11610102578063f0c80d3b116100a0578063fb01600d1161006f578063fb01600d14610b06578063fc0e74d114610b1b578063fcfff16f14610b30578063ffa1ad7414610b45576103ae565b8063f0c80d3b14610a9b578063f3b27bc314610abb578063f609280914610ad0578063f8977b8414610ae6576103ae565b8063df791e50116100dc578063df791e5014610a30578063e35bff9614610a50578063eaada38214610a71578063ecf3a3f914610a86576103ae565b8063d283e75f146109a6578063dbe466b1146109c6578063dde3ab95146109e6576103ae565b80639ab620dd1161017a578063c415b95c11610149578063c415b95c14610931578063c4d66de814610946578063c4d68a1a14610966578063d176e05f14610986576103ae565b80639ab620dd146108a65780639f8f0fa8146108bb578063afcff50f146108f1578063b6aa515b14610911576103ae565b8063892d522a116101b6578063892d522a146108265780638a11a3701461084657806396aaccfe14610866578063984a68b514610886576103ae565b80637f51bb1f146107bb5780638456cb59146107db57806387cddc86146107f0576103ae565b80634066fdea116102c157806363c56d421161025f57806375c6f8ec1161022e57806375c6f8ec1461073b578063770b69b41461075b57806379e40cba1461077b5780637d3551631461079b576103ae565b806363c56d42146106c657806369c5dfd8146106e65780636b4f41af146106fb5780636c3393671461071b576103ae565b806356aaee2d1161029b57806356aaee2d146106515780635c975abb1461067157806361d027b31461068657806362c06767146106a6576103ae565b80634066fdea146105fc578063450058f81461061c5780634ff9b74a1461063c576103ae565b80632bcb849c1161032e5780633c2dc254116103085780633c2dc2541461056c5780633de2f6b2146105a75780633f4ba83a146105c75780633f5fc131146105dc576103ae565b80632bcb849c146105065780632dd6adb5146105265780633605b51b1461054a576103ae565b80631ccfbc4f1161036a5780631ccfbc4f1461047157806323e3fbd5146104a6578063275038d0146104c65780632adcb0c6146104e6576103ae565b80630c340a24146103c75780631a0dd00b146104045780631a4660ce1461044f576103ae565b366103ae57604051636436c22d60e11b815260040160405180910390fd5b60405163a0152e6360e01b815260040160405180910390fd5b3480156103d357600080fd5b506002546103e7906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561041057600080fd5b5061043f61041f3660046143ab565b6001600160a01b0390811660009081526016602052604090205416151590565b60405190151581526020016103fb565b34801561045b57600080fd5b5061046f61046a3660046143c8565b610b83565b005b34801561047d57600080fd5b5061049161048c3660046143e1565b610c11565b604080519283526020830191909152016103fb565b3480156104b257600080fd5b506104916104c13660046143ab565b610dd4565b3480156104d257600080fd5b5061046f6104e13660046143ab565b611034565b3480156104f257600080fd5b506104916105013660046143e1565b611086565b34801561051257600080fd5b5061046f6105213660046143ab565b611236565b34801561053257600080fd5b5061053c600b5481565b6040519081526020016103fb565b34801561055657600080fd5b5061055f61131c565b6040516103fb9190614422565b34801561057857600080fd5b5061058c61058736600461446f565b61132d565b604080519384526020840192909252908201526060016103fb565b3480156105b357600080fd5b5061058c6105c23660046144b1565b611552565b3480156105d357600080fd5b5061046f611be4565b3480156105e857600080fd5b5061046f6105f73660046143ab565b611c94565b34801561060857600080fd5b506018546103e7906001600160a01b031681565b34801561062857600080fd5b5061043f6106373660046143ab565b611d28565b34801561064857600080fd5b5061055f611d3b565b34801561065d57600080fd5b5061046f61066c3660046143ab565b611d47565b34801561067d57600080fd5b5061043f611df8565b34801561069257600080fd5b50600d546103e7906001600160a01b031681565b3480156106b257600080fd5b5061046f6106c13660046143e1565b611e94565b3480156106d257600080fd5b5061046f6106e13660046143ab565b611ecd565b3480156106f257600080fd5b5061053c601e81565b34801561070757600080fd5b5061046f6107163660046143ab565b611f86565b34801561072757600080fd5b5061058c61073636600461446f565b61212c565b34801561074757600080fd5b5061046f6107563660046143ab565b612316565b34801561076757600080fd5b5061046f6107763660046143ab565b612365565b34801561078757600080fd5b5061046f6107963660046143ab565b6123f5565b3480156107a757600080fd5b5061055f6107b63660046143ab565b61259f565b3480156107c757600080fd5b5061046f6107d63660046143ab565b6125ac565b3480156107e757600080fd5b5061046f6126fd565b3480156107fc57600080fd5b506103e761080b3660046143ab565b6010602052600090815260409020546001600160a01b031681565b34801561083257600080fd5b5061046f6108413660046143ab565b61278e565b34801561085257600080fd5b506003546103e7906001600160a01b031681565b34801561087257600080fd5b50601b546103e7906001600160a01b031681565b34801561089257600080fd5b5061053c6108a1366004614504565b612877565b3480156108b257600080fd5b5061046f6129d8565b3480156108c757600080fd5b506103e76108d63660046143ab565b6016602052600090815260409020546001600160a01b031681565b3480156108fd57600080fd5b50600c546103e7906001600160a01b031681565b34801561091d57600080fd5b5061046f61092c3660046143ab565b612a64565b34801561093d57600080fd5b506103e7612ad8565b34801561095257600080fd5b5061046f6109613660046143ab565b612b55565b34801561097257600080fd5b5061046f6109813660046143ab565b612c26565b34801561099257600080fd5b5061055f6109a13660046143ab565b612dda565b3480156109b257600080fd5b5061053c6109c13660046143ab565b612de7565b3480156109d257600080fd5b5061046f6109e13660046143ab565b612fb9565b3480156109f257600080fd5b50610a06610a013660046143ab565b61316d565b6040805195151586526020860194909452928401919091526060830152608082015260a0016103fb565b348015610a3c57600080fd5b50610491610a4b3660046143e1565b6131b7565b348015610a5c57600080fd5b50600c5461043f90600160a01b900460ff1681565b348015610a7d57600080fd5b506103e76135a4565b348015610a9257600080fd5b5061043f6135e9565b348015610aa757600080fd5b5061046f610ab63660046143c8565b61364d565b348015610ac757600080fd5b5061046f613704565b348015610adc57600080fd5b5061053c60045481565b348015610af257600080fd5b5061043f610b013660046143ab565b613793565b348015610b1257600080fd5b5061055f6137a0565b348015610b2757600080fd5b5061046f6137ac565b348015610b3c57600080fd5b5061046f61383f565b348015610b5157600080fd5b50610b76604051806040016040528060058152602001640312e332e360dc1b81525081565b6040516103fb9190614574565b6002546001600160a01b03163314610bae57604051634b98449160e11b815260040160405180910390fd5b60045481811415610bd257604051630333a68160e41b815260040160405180910390fd5b60408051828152602081018490527f0662703672e57800b9439de3a419c9155283ad25ea7776c139c876bd8b93bb98910160405180910390a150600455565b60185460405163d2d6b5a360e01b8152336004820152600091829182916001600160a01b03169063d2d6b5a39060240160206040518083038186803b158015610c5957600080fd5b505afa158015610c6d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c9191906145a7565b90508015610cc457610cb5610cae82670de0b6b3a76400006145d6565b85906138d8565b9350610cc1848261390c565b91505b600c60009054906101000a90046001600160a01b03166001600160a01b031663eaada3826040518163ffffffff1660e01b815260040160206040518083038186803b158015610d1257600080fd5b505afa158015610d26573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4a91906145ed565b6001600160a01b031663b64663848688876040518463ffffffff1660e01b8152600401610d799392919061460a565b60206040518083038186803b158015610d9157600080fd5b505afa158015610da5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc991906145a7565b925050935093915050565b6000806000610de16135a4565b90506000610df0601386613944565b905060005b8181101561102c576000610e0b60138884613962565b90506000846001600160a01b0316638d0dba00836001600160a01b0316636f307dc36040518163ffffffff1660e01b815260040160206040518083038186803b158015610e5757600080fd5b505afa158015610e6b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e8f91906145ed565b6040516370a0823160e01b81526001600160a01b038c811660048301528616906370a082319060240160206040518083038186803b158015610ed057600080fd5b505afa158015610ee4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f0891906145a7565b6040516001600160e01b031960e085901b1681526001600160a01b039092166004830152602482015260440160206040518083038186803b158015610f4c57600080fd5b505afa158015610f60573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f8491906145a7565b9050610f90818861462e565b965061100d826001600160a01b031663df011c416040518163ffffffff1660e01b815260040160206040518083038186803b158015610fce57600080fd5b505afa158015610fe2573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061100691906145a7565b829061390c565b611017908761462e565b955050508061102590614646565b9050610df5565b505050915091565b61103d33613793565b61105a576040516326688ebb60e11b815260040160405180910390fd5b61106660138233613977565b6110835760405163a67d528360e01b815260040160405180910390fd5b50565b600080600c60009054906101000a90046001600160a01b03166001600160a01b031663eaada3826040518163ffffffff1660e01b815260040160206040518083038186803b1580156110d757600080fd5b505afa1580156110eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061110f91906145ed565b6001600160a01b031663b64663848686866040518463ffffffff1660e01b815260040161113e9392919061460a565b60206040518083038186803b15801561115657600080fd5b505afa15801561116a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061118e91906145a7565b60185460405163d2d6b5a360e01b81523360048201529193506000916001600160a01b039091169063d2d6b5a39060240160206040518083038186803b1580156111d757600080fd5b505afa1580156111eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061120f91906145a7565b9050801561122d57611221838261390c565b9150610dc982846145d6565b50935093915050565b6002546001600160a01b0316331461126157604051634b98449160e11b815260040160405180910390fd5b6001600160a01b0381166112885760405163fb7566d760e01b815260040160405180910390fd5b6018546001600160a01b039081169082168114156112b957604051630333a68160e41b815260040160405180910390fd5b816001600160a01b0316816001600160a01b03167f66fa9df7ccacf7a0c110fd7dd4591f59c76a798409b4aeaf850002679baca45560405160405180910390a350601880546001600160a01b0319166001600160a01b0392909216919091179055565b60606113286019613984565b905090565b6018546040805163cfc0c69f60e01b8152815160009384938493849384936001600160a01b03169263cfc0c69f9260048082019391829003018186803b15801561137657600080fd5b505afa15801561138a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ae9190614678565b909250905060006113bf83836146ab565b6001600160801b031690508781156113f0576113ed6113e683670de0b6b3a764000061462e565b82906138d8565b90505b6113f86135a4565b6001600160a01b031663b6466384896001600160a01b0316636f307dc36040518163ffffffff1660e01b815260040160206040518083038186803b15801561143f57600080fd5b505afa158015611453573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061147791906145ed565b8c846040518463ffffffff1660e01b81526004016114979392919061460a565b60206040518083038186803b1580156114af57600080fd5b505afa1580156114c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114e791906145a7565b96506001600160801b0383161561150e5761150b816001600160801b03851661390c565b94505b6001600160801b038416156115455761154261153285670de0b6b3a76400006146ab565b82906001600160801b031661390c565b95505b5050505093509350939050565b600080600061155f6135e9565b1561157d57604051631b0e923f60e11b815260040160405180910390fd5b600260015414156115d55760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b60026001556001600160a01b038088166000908152601660205260409020548891166116145760405163a596698b60e01b815260040160405180910390fd5b8461161e81613793565b61163b5760405163a67d528360e01b815260040160405180910390fd5b86611659576040516310eb483f60e21b815260040160405180910390fd5b336001600160a01b038916141561168357604051630ecda8a760e01b815260040160405180910390fd5b6001600160a01b03808a1660009081526016602052604080822054815163a6afed9560e01b81529151931692839263a6afed95926004808201939182900301818387803b1580156116d357600080fd5b505af11580156116e7573d6000803e3d6000fd5b5050505060006116f68a61316d565b505050509050801561171b5760405163202881bd60e11b815260040160405180910390fd5b6040516370a0823160e01b81526001600160a01b038b81166004830152600091908416906370a082319060240160206040518083038186803b15801561176057600080fd5b505afa158015611774573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061179891906145a7565b600b549091506117a88b836138d8565b11156117c75760405163e292f24f60e01b815260040160405180910390fd5b60006117d16135a4565b600454909150156118a75760006001600160a01b038216638d0dba008f6117f88f876145d6565b6040516001600160e01b031960e085901b1681526001600160a01b039092166004830152602482015260440160206040518083038186803b15801561183c57600080fd5b505afa158015611850573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061187491906145a7565b9050600081118015611887575060045481105b156118a5576040516332b9d47360e01b815260040160405180910390fd5b505b6118b28d8c8c61212c565b6040516370a0823160e01b8152929b5090995097506001600160a01b038b16906370a08231906118f5908f906004016001600160a01b0391909116815260200190565b60206040518083038186803b15801561190d57600080fd5b505afa158015611921573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061194591906145a7565b89111561196557604051635de1e54160e01b815260040160405180910390fd5b604051632770a7eb60e21b8152336004820152602481018c90526001600160a01b038e1690639dc29fac90604401600060405180830381600087803b1580156119ad57600080fd5b505af11580156119c1573d6000803e3d6000fd5b5050604051632770a7eb60e21b81526001600160a01b038f81166004830152602482018f905287169250639dc29fac9150604401600060405180830381600087803b158015611a0f57600080fd5b505af1158015611a23573d6000803e3d6000fd5b505060405163b2a02ff160e01b81526001600160a01b038d16925063b2a02ff19150611a57908f9033908d9060040161460a565b600060405180830381600087803b158015611a7157600080fd5b505af1158015611a85573d6000803e3d6000fd5b505050506000871115611b7a57896001600160a01b031663b2a02ff18d600c60009054906101000a90046001600160a01b03166001600160a01b031663c415b95c6040518163ffffffff1660e01b815260040160206040518083038186803b158015611af057600080fd5b505afa158015611b04573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b2891906145ed565b8a6040518463ffffffff1660e01b8152600401611b479392919061460a565b600060405180830381600087803b158015611b6157600080fd5b505af1158015611b75573d6000803e3d6000fd5b505050505b604080518c8152602081018b90529081018890526001600160a01b03808f1691908e169033907fe1c3870e3d7d5199a16d200133088e6e3f7012d28571e442a110b4c83b5e3b949060600160405180910390a4505050505050600180819055509450945094915050565b611bec611df8565b611c095760405163bc871ce560e01b815260040160405180910390fd5b611c116135e9565b15611c2f57604051631b0e923f60e11b815260040160405180910390fd5b6002546001600160a01b03163314611c5a57604051634b98449160e11b815260040160405180910390fd5b6003805460ff60a01b1916905560405133907f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa90600090a2565b611c9d33613793565b611cba576040516326688ebb60e11b815260040160405180910390fd5b80601e611cc8601383613944565b611cd3601484613944565b611cdd919061462e565b10611cfb576040516306ceeb8360e21b815260040160405180910390fd5b611d0760138333613991565b611d245760405163dd40dad960e01b815260040160405180910390fd5b5050565b6000611d3560118361399e565b92915050565b60606113286011613984565b6002546001600160a01b03163314611d7257604051634b98449160e11b815260040160405180910390fd5b6001600160a01b038116611d995760405163fb7566d760e01b815260040160405180910390fd5b611da46019826139c0565b611dc157604051631e577fa560e31b815260040160405180910390fd5b6040516001600160a01b038216907f5579b1eead2d904c2b05255a92f5a4a4f3e234ae0a4efe538adef3c1794e1cea90600090a250565b600354600090600160a01b900460ff16806113285750600c60009054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b815260040160206040518083038186803b158015611e5c57600080fd5b505afa158015611e70573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061132891906146d6565b611e9c6139d5565b6001600160a01b038316611eb957611eb48282613a02565b505050565b611eb46001600160a01b0384168383613b1b565b6002546001600160a01b03163314611ef857604051634b98449160e11b815260040160405180910390fd5b6001600160a01b038116611f1f5760405163fb7566d760e01b815260040160405180910390fd5b611f2a601982613b6d565b611f47576040516362c4c75f60e01b815260040160405180910390fd5b6040516001600160a01b03821681527f5412e32b52c11e4b232ab59f3660d55b48eb20735ccb2c67a0a1ebea0d6fe0199060200160405180910390a150565b6002546001600160a01b03163314611fb157604051634b98449160e11b815260040160405180910390fd5b6001600160a01b038116611fd85760405163fb7566d760e01b815260040160405180910390fd5b6000816001600160a01b0316638230ecd66040518163ffffffff1660e01b815260040160206040518083038186803b15801561201357600080fd5b505afa158015612027573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061204b91906145ed565b90506001600160a01b0381166120745760405163013a1b4360e51b815260040160405180910390fd5b6001600160a01b0381811660009081526016602052604090205416156120ad5760405163fa9b809960e01b815260040160405180910390fd5b6120b86011836139c0565b6120d557604051631f477b5760e11b815260040160405180910390fd5b6001600160a01b0381811660009081526016602052604080822080546001600160a01b0319169386169384179055517fad48bee6bbb1b8ece321157ad29afc3c6baa177f8dc043132d65038cc601cdd69190a25050565b60008060006121396135a4565b6001600160a01b031663b646638487866001600160a01b0316636f307dc36040518163ffffffff1660e01b815260040160206040518083038186803b15801561218157600080fd5b505afa158015612195573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121b991906145ed565b886040518463ffffffff1660e01b81526004016121d89392919061460a565b60206040518083038186803b1580156121f057600080fd5b505afa158015612204573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061222891906145a7565b6018546040805163cfc0c69f60e01b8152815193955060009384936001600160a01b03169263cfc0c69f9260048082019391829003018186803b15801561226e57600080fd5b505afa158015612282573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122a69190614678565b90925090506001600160801b038116156122d0576122cd846001600160801b03831661390c565b92505b6001600160801b038216156122ff576122f2846001600160801b03841661390c565b6122fc908561462e565b93505b612309848461462e565b9450505093509350939050565b61231f33611d28565b61233c576040516304f8b91760e51b815260040160405180910390fd5b61234860148233613977565b611083576040516359c937f160e01b815260040160405180910390fd5b61236e33611d28565b61238b576040516304f8b91760e51b815260040160405180910390fd5b80601e612399601383613944565b6123a4601484613944565b6123ae919061462e565b106123cc576040516306ceeb8360e21b815260040160405180910390fd5b6123d860148333613991565b611d2457604051631f477b5760e11b815260040160405180910390fd5b6002546001600160a01b0316331461242057604051634b98449160e11b815260040160405180910390fd5b6001600160a01b0381166124475760405163fb7566d760e01b815260040160405180910390fd5b6000816001600160a01b0316636f307dc36040518163ffffffff1660e01b815260040160206040518083038186803b15801561248257600080fd5b505afa158015612496573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124ba91906145ed565b6001600160a01b0380821660009081526010602052604090205491925016156124f65760405163374f601360e11b815260040160405180910390fd5b601e612502600e613b82565b106125205760405163225b605b60e21b815260040160405180910390fd5b61252b600e836139c0565b6125485760405163dd40dad960e01b815260040160405180910390fd5b6001600160a01b0381811660009081526010602052604080822080546001600160a01b0319169386169384179055517fdc705e658c7b6c6c01f5802457bf4ffb99f204bf1603e7b1ae3d4c7536611bc29190a25050565b6060611d35601383613b8c565b6002546001600160a01b031633146125d757604051634b98449160e11b815260040160405180910390fd5b6001600160a01b0381166125fe5760405163fb7566d760e01b815260040160405180910390fd5b600d546001600160a01b0390811690821681141561262f57604051630333a68160e41b815260040160405180910390fd5b6001600160a01b0381161561269a576040516326ed7c7960e11b81526001600160a01b038381166004830152821690634ddaf8f290602401600060405180830381600087803b15801561268157600080fd5b505af1158015612695573d6000803e3d6000fd5b505050505b816001600160a01b0316816001600160a01b03167f4ab5be82436d353e61ca18726e984e561f5c1cc7c6d38b29d2553c790434705a60405160405180910390a350600d80546001600160a01b0319166001600160a01b0392909216919091179055565b612705611df8565b1561272357604051631309a56360e01b815260040160405180910390fd5b6002546001600160a01b0316331461274e57604051634b98449160e11b815260040160405180910390fd5b6003805460ff60a01b1916600160a01b17905560405133907f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25890600090a2565b6002546001600160a01b031633146127b957604051634b98449160e11b815260040160405180910390fd5b6001600160a01b0381166127e05760405163fb7566d760e01b815260040160405180910390fd5b601b546001600160a01b0390811690821681141561281157604051630333a68160e41b815260040160405180910390fd5b604080516001600160a01b038084168252841660208201527f01b723df71593f812e405dc433f7dcf4134ff941def9d2e189a31f3cb1b1963b910160405180910390a150601b80546001600160a01b0319166001600160a01b0392909216919091179055565b6000806128838461316d565b50505050905080156128995760009150506129d1565b6040516370a0823160e01b81526001600160a01b038581166004830152600091612922918891908716906370a082319060240160206040518083038186803b1580156128e457600080fd5b505afa1580156128f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061291c91906145a7565b8661132d565b5050600b546001600160a01b03888116600090815260166020526040908190205490516370a0823160e01b815289831660048201529394506129c0939116906370a082319060240160206040518083038186803b15801561298257600080fd5b505afa158015612996573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129ba91906145a7565b9061390c565b9250828110156129ce578092505b50505b9392505050565b6002546001600160a01b03163314612a0357604051634b98449160e11b815260040160405180910390fd5b600c54604051600160a01b90910460ff1615808252907fc8011ac148e14ab1e8f93a022ebc29088beedc705027c8eb9514d6d69c5b23639060200160405180910390a1600c8054911515600160a01b0260ff60a01b19909216919091179055565b6002546001600160a01b03163314612a8f57604051634b98449160e11b815260040160405180910390fd5b6001600160a01b038116612ab657604051634c267bfb60e01b815260040160405180910390fd5b600380546001600160a01b0319166001600160a01b0392909216919091179055565b600c54604080516331056e5760e21b815290516000926001600160a01b03169163c415b95c916004808301926020929190829003018186803b158015612b1d57600080fd5b505afa158015612b31573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061132891906145ed565b6000612b616001613b9a565b90508015612b79576000805461ff0019166101001790555b6001600160a01b038216612ba057604051637cb62f2b60e11b815260040160405180910390fd5b612ba8613c27565b612bb0613c56565b600c80546001600160a81b0319166001600160a01b03841617600160a01b1790556706f05b59d3b20000600b558015611d24576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050565b6002546001600160a01b03163314612c5157604051634b98449160e11b815260040160405180910390fd5b6000816001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015612c8c57600080fd5b505afa158015612ca0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612cc491906145a7565b1115612ce35760405163066097f160e31b815260040160405180910390fd5b612cee601182613b6d565b612d0b576040516359c937f160e01b815260040160405180910390fd5b60166000826001600160a01b0316638230ecd66040518163ffffffff1660e01b815260040160206040518083038186803b158015612d4857600080fd5b505afa158015612d5c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d8091906145ed565b6001600160a01b03908116825260208201929092526040908101600090812080546001600160a01b03191690559051918316917f81e9205ee5a9e1289fad5baa5e74bd49d4613652eb4626bb15925bf9fdbc0feb9190a250565b6060611d35601483613b8c565b600080612df26135a4565b90506000612e01601485613944565b905060005b81811015612fb1576000612e1c60148784613962565b9050836001600160a01b0316638d0dba00826001600160a01b0316638230ecd66040518163ffffffff1660e01b815260040160206040518083038186803b158015612e6657600080fd5b505afa158015612e7a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e9e91906145ed565b6040516370a0823160e01b81526001600160a01b038a811660048301528516906370a082319060240160206040518083038186803b158015612edf57600080fd5b505afa158015612ef3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f1791906145a7565b6040516001600160e01b031960e085901b1681526001600160a01b039092166004830152602482015260440160206040518083038186803b158015612f5b57600080fd5b505afa158015612f6f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f9391906145a7565b612f9d908661462e565b94505080612faa90614646565b9050612e06565b505050919050565b6002546001600160a01b03163314612fe457604051634b98449160e11b815260040160405180910390fd5b6000816001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561301f57600080fd5b505afa158015613033573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061305791906145a7565b11156130765760405163066097f160e31b815260040160405180910390fd5b613081600e82613b6d565b61309e5760405163a67d528360e01b815260040160405180910390fd5b60106000826001600160a01b0316636f307dc36040518163ffffffff1660e01b815260040160206040518083038186803b1580156130db57600080fd5b505afa1580156130ef573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061311391906145ed565b6001600160a01b03908116825260208201929092526040908101600090812080546001600160a01b03191690559051918316917fe5a19a76470297a1f85f9a38f3ff148b4c8cdc1209e074dbe59db5e22eb31a3a9190a250565b600080600080600061317e86612de7565b925061318986610dd4565b80851115965090945091508183106131a25760006131ac565b6131ac83836145d6565b905091939590929450565b6000806131c26135e9565b156131e057604051631b0e923f60e11b815260040160405180910390fd5b600260015414156132335760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016115cc565b60026001556001600160a01b038086166000908152601660205260409020548691166132725760405163a596698b60e01b815260040160405180910390fd5b6001600160a01b038086166000908152601660205260409020548691166132ac5760405163a596698b60e01b815260040160405180910390fd5b600c54600160a01b900460ff166132d657604051633840404b60e21b815260040160405180910390fd5b84158061335857506040516370a0823160e01b81523360048201526001600160a01b038816906370a082319060240160206040518083038186803b15801561331d57600080fd5b505afa158015613331573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061335591906145a7565b85115b156133765760405163ca99073960e01b815260040160405180910390fd5b604051632770a7eb60e21b8152336004820152602481018690526001600160a01b03881690639dc29fac90604401600060405180830381600087803b1580156133be57600080fd5b505af11580156133d2573d6000803e3d6000fd5b505050506133e1878787611086565b909450925082156134e257856001600160a01b03166340c10f19600c60009054906101000a90046001600160a01b03166001600160a01b031663c415b95c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561344957600080fd5b505afa15801561345d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061348191906145ed565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101869052604401600060405180830381600087803b1580156134c957600080fd5b505af11580156134dd573d6000803e3d6000fd5b505050505b6040516340c10f1960e01b8152336004820152602481018590526001600160a01b038716906340c10f1990604401600060405180830381600087803b15801561352a57600080fd5b505af115801561353e573d6000803e3d6000fd5b505060408051888152602081018890529081018690526001600160a01b03808a1693508a16915033907fafd74f009c0ff7627726f24b568ee5529cd297f6a7a1e43ec363443a13a584209060600160405180910390a45050600180559094909350915050565b600c5460408051637556d1c160e11b815290516000926001600160a01b03169163eaada382916004808301926020929190829003018186803b158015612b1d57600080fd5b600354600090600160a81b900460ff16806113285750600c60009054906101000a90046001600160a01b03166001600160a01b031663ecf3a3f96040518163ffffffff1660e01b815260040160206040518083038186803b158015611e5c57600080fd5b6002546001600160a01b0316331461367857604051634b98449160e11b815260040160405180910390fd5b670de0b6b3a76400008111156136a157604051633c2c00b560e21b815260040160405180910390fd5b600b54818114156136c557604051630333a68160e41b815260040160405180910390fd5b60408051828152602081018490527f6d8ed4ad9ba67058e16e32fc3c8da2e3358da6cd1599e0e0fb2630d0a19fd49c910160405180910390a150600b55565b6003546001600160a01b03163381146137305760405163038cdbad60e31b815260040160405180910390fd5b6002546040516001600160a01b038084169216907fd4459d5b8b913cab0244230fd9b1c08b6ceace7fe9230e60d0f74cbffdf849d090600090a3600280546001600160a01b039092166001600160a01b0319928316179055600380549091169055565b6000611d35600e8361399e565b6060611328600e613984565b6137b46135e9565b156137d257604051631b0e923f60e11b815260040160405180910390fd5b6002546001600160a01b031633146137fd57604051634b98449160e11b815260040160405180910390fd5b6003805461ffff60a01b191661010160a01b17905560405133907f28b4c24cb1012c094cd2f59f98e89d791973295f8fda6eaa118022d6d318960a90600090a2565b6138476135e9565b61386457604051636e2cff4560e01b815260040160405180910390fd5b6002546001600160a01b0316331461388f57604051634b98449160e11b815260040160405180910390fd5b6003805460ff60a81b1916905560405133907fece7583a70a505ef0e36d4dec768f5ae597713e09c26011022599ee01abdabfc90600090a2565b6001600160a01b03163b151590565b6000816138e66002826146f8565b6138f8670de0b6b3a76400008661471a565b613902919061462e565b6129d191906146f8565b6000821580613919575081155b1561392657506000611d35565b670de0b6b3a764000061393a6002826146f8565b6138f8848661471a565b6001600160a01b0381166000908152602083905260408120546129d1565b600061396f848484613c85565b949350505050565b600061396f848484613ccc565b606060006129d183613e79565b600061396f848484613ed5565b6001600160a01b038116600090815260018301602052604081205415156129d1565b60006129d1836001600160a01b038416613f63565b6002546001600160a01b03163314613a0057604051634b98449160e11b815260040160405180910390fd5b565b80471015613a525760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e636500000060448201526064016115cc565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114613a9f576040519150601f19603f3d011682016040523d82523d6000602084013e613aa4565b606091505b5050905080611eb45760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d6179206861766520726576657274656400000000000060648201526084016115cc565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052611eb4908490613fb2565b60006129d1836001600160a01b038416614084565b6000611d35825490565b6060600061396f8484614177565b60008054610100900460ff1615613be1578160ff166001148015613bbd5750303b155b613bd95760405162461bcd60e51b81526004016115cc90614739565b506000919050565b60005460ff808416911610613c085760405162461bcd60e51b81526004016115cc90614739565b506000805460ff191660ff92909216919091179055600190565b919050565b600054610100900460ff16613c4e5760405162461bcd60e51b81526004016115cc90614787565b613a006141ec565b600054610100900460ff16613c7d5760405162461bcd60e51b81526004016115cc90614787565b613a00614219565b6001600160a01b0382166000908152602084905260408120805483908110613caf57613caf6147d2565b6000918252602090912001546001600160a01b0316949350505050565b6001600160a01b03808316600090815260208581526040808320938516835260019093019052908120548015613e6f576000613d096001836145d6565b6001600160a01b03861660009081526020889052604081205491925090613d32906001906145d6565b9050818114613dee576001600160a01b0386166000908152602088905260408120805483908110613d6557613d656147d2565b60009182526020808320909101546001600160a01b038a81168452918b90526040909220805491909216925082919085908110613da457613da46147d2565b600091825260208083209190910180546001600160a01b0319166001600160a01b0394851617905589831682528a8152604080832094909316825260019390930190925290208390555b6001600160a01b0386166000908152602088905260409020805480613e1557613e156147e8565b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b0388811683528982526040808420918916845260019182019092529082209190915593506129d192505050565b60009150506129d1565b606081600001805480602002602001604051908101604052809291908181526020018280548015613ec957602002820191906000526020600020905b815481526020019060010190808311613eb5575b50505050509050919050565b6001600160a01b0380831660009081526020858152604080832093851683526001909301905290812054613f5b57506001600160a01b0382811660009081526020858152604080832080546001808201835582865284862090910180546001600160a01b03191696881696871790558154958552908101909252909120919091556129d1565b5060006129d1565b6000818152600183016020526040812054613faa57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155611d35565b506000611d35565b6000614007826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166142829092919063ffffffff16565b805190915015611eb4578080602001905181019061402591906146d6565b611eb45760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016115cc565b6000818152600183016020526040812054801561416d5760006140a86001836145d6565b85549091506000906140bc906001906145d6565b90508181146141215760008660000182815481106140dc576140dc6147d2565b90600052602060002001549050808760000184815481106140ff576140ff6147d2565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080614132576141326147e8565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050611d35565b6000915050611d35565b6001600160a01b038116600090815260208381526040918290208054835181840281018401909452808452606093928301828280156141df57602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116141c1575b5050505050905092915050565b600054610100900460ff166142135760405162461bcd60e51b81526004016115cc90614787565b60018055565b600054610100900460ff166142405760405162461bcd60e51b81526004016115cc90614787565b600280546001600160a01b031916339081179091556040516000907fd4459d5b8b913cab0244230fd9b1c08b6ceace7fe9230e60d0f74cbffdf849d0908290a3565b606061396f8484600085856001600160a01b0385163b6142e45760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016115cc565b600080866001600160a01b0316858760405161430091906147fe565b60006040518083038185875af1925050503d806000811461433d576040519150601f19603f3d011682016040523d82523d6000602084013e614342565b606091505b509150915061435282828661435d565b979650505050505050565b6060831561436c5750816129d1565b82511561437c5782518084602001fd5b8160405162461bcd60e51b81526004016115cc9190614574565b6001600160a01b038116811461108357600080fd5b6000602082840312156143bd57600080fd5b81356129d181614396565b6000602082840312156143da57600080fd5b5035919050565b6000806000606084860312156143f657600080fd5b833561440181614396565b9250602084013561441181614396565b929592945050506040919091013590565b6020808252825182820181905260009190848201906040850190845b818110156144635783516001600160a01b03168352928401929184019160010161443e565b50909695505050505050565b60008060006060848603121561448457600080fd5b833561448f81614396565b92506020840135915060408401356144a681614396565b809150509250925092565b600080600080608085870312156144c757600080fd5b84356144d281614396565b935060208501356144e281614396565b92506040850135915060608501356144f981614396565b939692955090935050565b60008060006060848603121561451957600080fd5b833561452481614396565b9250602084013561453481614396565b915060408401356144a681614396565b60005b8381101561455f578181015183820152602001614547565b8381111561456e576000848401525b50505050565b6020815260008251806020840152614593816040850160208701614544565b601f01601f19169190910160400192915050565b6000602082840312156145b957600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b6000828210156145e8576145e86145c0565b500390565b6000602082840312156145ff57600080fd5b81516129d181614396565b6001600160a01b039384168152919092166020820152604081019190915260600190565b60008219821115614641576146416145c0565b500190565b600060001982141561465a5761465a6145c0565b5060010190565b80516001600160801b0381168114613c2257600080fd5b6000806040838503121561468b57600080fd5b61469483614661565b91506146a260208401614661565b90509250929050565b60006001600160801b038083168185168083038211156146cd576146cd6145c0565b01949350505050565b6000602082840312156146e857600080fd5b815180151581146129d157600080fd5b60008261471557634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615614734576147346145c0565b500290565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b60008251614810818460208701614544565b919091019291505056fea2646970667358221220c806aa72c8ef680cc368bfee726d1dd28a830a5c43fa4605100487131e51f7eb64736f6c63430008090033496e697469616c697a61626c653a20636f6e747261637420697320616c726561", - "deployedBytecode": "0x6080604052600436106103905760003560e01c80637f51bb1f116101dc578063d283e75f11610102578063f0c80d3b116100a0578063fb01600d1161006f578063fb01600d14610b06578063fc0e74d114610b1b578063fcfff16f14610b30578063ffa1ad7414610b45576103ae565b8063f0c80d3b14610a9b578063f3b27bc314610abb578063f609280914610ad0578063f8977b8414610ae6576103ae565b8063df791e50116100dc578063df791e5014610a30578063e35bff9614610a50578063eaada38214610a71578063ecf3a3f914610a86576103ae565b8063d283e75f146109a6578063dbe466b1146109c6578063dde3ab95146109e6576103ae565b80639ab620dd1161017a578063c415b95c11610149578063c415b95c14610931578063c4d66de814610946578063c4d68a1a14610966578063d176e05f14610986576103ae565b80639ab620dd146108a65780639f8f0fa8146108bb578063afcff50f146108f1578063b6aa515b14610911576103ae565b8063892d522a116101b6578063892d522a146108265780638a11a3701461084657806396aaccfe14610866578063984a68b514610886576103ae565b80637f51bb1f146107bb5780638456cb59146107db57806387cddc86146107f0576103ae565b80634066fdea116102c157806363c56d421161025f57806375c6f8ec1161022e57806375c6f8ec1461073b578063770b69b41461075b57806379e40cba1461077b5780637d3551631461079b576103ae565b806363c56d42146106c657806369c5dfd8146106e65780636b4f41af146106fb5780636c3393671461071b576103ae565b806356aaee2d1161029b57806356aaee2d146106515780635c975abb1461067157806361d027b31461068657806362c06767146106a6576103ae565b80634066fdea146105fc578063450058f81461061c5780634ff9b74a1461063c576103ae565b80632bcb849c1161032e5780633c2dc254116103085780633c2dc2541461056c5780633de2f6b2146105a75780633f4ba83a146105c75780633f5fc131146105dc576103ae565b80632bcb849c146105065780632dd6adb5146105265780633605b51b1461054a576103ae565b80631ccfbc4f1161036a5780631ccfbc4f1461047157806323e3fbd5146104a6578063275038d0146104c65780632adcb0c6146104e6576103ae565b80630c340a24146103c75780631a0dd00b146104045780631a4660ce1461044f576103ae565b366103ae57604051636436c22d60e11b815260040160405180910390fd5b60405163a0152e6360e01b815260040160405180910390fd5b3480156103d357600080fd5b506002546103e7906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561041057600080fd5b5061043f61041f3660046143ab565b6001600160a01b0390811660009081526016602052604090205416151590565b60405190151581526020016103fb565b34801561045b57600080fd5b5061046f61046a3660046143c8565b610b83565b005b34801561047d57600080fd5b5061049161048c3660046143e1565b610c11565b604080519283526020830191909152016103fb565b3480156104b257600080fd5b506104916104c13660046143ab565b610dd4565b3480156104d257600080fd5b5061046f6104e13660046143ab565b611034565b3480156104f257600080fd5b506104916105013660046143e1565b611086565b34801561051257600080fd5b5061046f6105213660046143ab565b611236565b34801561053257600080fd5b5061053c600b5481565b6040519081526020016103fb565b34801561055657600080fd5b5061055f61131c565b6040516103fb9190614422565b34801561057857600080fd5b5061058c61058736600461446f565b61132d565b604080519384526020840192909252908201526060016103fb565b3480156105b357600080fd5b5061058c6105c23660046144b1565b611552565b3480156105d357600080fd5b5061046f611be4565b3480156105e857600080fd5b5061046f6105f73660046143ab565b611c94565b34801561060857600080fd5b506018546103e7906001600160a01b031681565b34801561062857600080fd5b5061043f6106373660046143ab565b611d28565b34801561064857600080fd5b5061055f611d3b565b34801561065d57600080fd5b5061046f61066c3660046143ab565b611d47565b34801561067d57600080fd5b5061043f611df8565b34801561069257600080fd5b50600d546103e7906001600160a01b031681565b3480156106b257600080fd5b5061046f6106c13660046143e1565b611e94565b3480156106d257600080fd5b5061046f6106e13660046143ab565b611ecd565b3480156106f257600080fd5b5061053c601e81565b34801561070757600080fd5b5061046f6107163660046143ab565b611f86565b34801561072757600080fd5b5061058c61073636600461446f565b61212c565b34801561074757600080fd5b5061046f6107563660046143ab565b612316565b34801561076757600080fd5b5061046f6107763660046143ab565b612365565b34801561078757600080fd5b5061046f6107963660046143ab565b6123f5565b3480156107a757600080fd5b5061055f6107b63660046143ab565b61259f565b3480156107c757600080fd5b5061046f6107d63660046143ab565b6125ac565b3480156107e757600080fd5b5061046f6126fd565b3480156107fc57600080fd5b506103e761080b3660046143ab565b6010602052600090815260409020546001600160a01b031681565b34801561083257600080fd5b5061046f6108413660046143ab565b61278e565b34801561085257600080fd5b506003546103e7906001600160a01b031681565b34801561087257600080fd5b50601b546103e7906001600160a01b031681565b34801561089257600080fd5b5061053c6108a1366004614504565b612877565b3480156108b257600080fd5b5061046f6129d8565b3480156108c757600080fd5b506103e76108d63660046143ab565b6016602052600090815260409020546001600160a01b031681565b3480156108fd57600080fd5b50600c546103e7906001600160a01b031681565b34801561091d57600080fd5b5061046f61092c3660046143ab565b612a64565b34801561093d57600080fd5b506103e7612ad8565b34801561095257600080fd5b5061046f6109613660046143ab565b612b55565b34801561097257600080fd5b5061046f6109813660046143ab565b612c26565b34801561099257600080fd5b5061055f6109a13660046143ab565b612dda565b3480156109b257600080fd5b5061053c6109c13660046143ab565b612de7565b3480156109d257600080fd5b5061046f6109e13660046143ab565b612fb9565b3480156109f257600080fd5b50610a06610a013660046143ab565b61316d565b6040805195151586526020860194909452928401919091526060830152608082015260a0016103fb565b348015610a3c57600080fd5b50610491610a4b3660046143e1565b6131b7565b348015610a5c57600080fd5b50600c5461043f90600160a01b900460ff1681565b348015610a7d57600080fd5b506103e76135a4565b348015610a9257600080fd5b5061043f6135e9565b348015610aa757600080fd5b5061046f610ab63660046143c8565b61364d565b348015610ac757600080fd5b5061046f613704565b348015610adc57600080fd5b5061053c60045481565b348015610af257600080fd5b5061043f610b013660046143ab565b613793565b348015610b1257600080fd5b5061055f6137a0565b348015610b2757600080fd5b5061046f6137ac565b348015610b3c57600080fd5b5061046f61383f565b348015610b5157600080fd5b50610b76604051806040016040528060058152602001640312e332e360dc1b81525081565b6040516103fb9190614574565b6002546001600160a01b03163314610bae57604051634b98449160e11b815260040160405180910390fd5b60045481811415610bd257604051630333a68160e41b815260040160405180910390fd5b60408051828152602081018490527f0662703672e57800b9439de3a419c9155283ad25ea7776c139c876bd8b93bb98910160405180910390a150600455565b60185460405163d2d6b5a360e01b8152336004820152600091829182916001600160a01b03169063d2d6b5a39060240160206040518083038186803b158015610c5957600080fd5b505afa158015610c6d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c9191906145a7565b90508015610cc457610cb5610cae82670de0b6b3a76400006145d6565b85906138d8565b9350610cc1848261390c565b91505b600c60009054906101000a90046001600160a01b03166001600160a01b031663eaada3826040518163ffffffff1660e01b815260040160206040518083038186803b158015610d1257600080fd5b505afa158015610d26573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4a91906145ed565b6001600160a01b031663b64663848688876040518463ffffffff1660e01b8152600401610d799392919061460a565b60206040518083038186803b158015610d9157600080fd5b505afa158015610da5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc991906145a7565b925050935093915050565b6000806000610de16135a4565b90506000610df0601386613944565b905060005b8181101561102c576000610e0b60138884613962565b90506000846001600160a01b0316638d0dba00836001600160a01b0316636f307dc36040518163ffffffff1660e01b815260040160206040518083038186803b158015610e5757600080fd5b505afa158015610e6b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e8f91906145ed565b6040516370a0823160e01b81526001600160a01b038c811660048301528616906370a082319060240160206040518083038186803b158015610ed057600080fd5b505afa158015610ee4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f0891906145a7565b6040516001600160e01b031960e085901b1681526001600160a01b039092166004830152602482015260440160206040518083038186803b158015610f4c57600080fd5b505afa158015610f60573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f8491906145a7565b9050610f90818861462e565b965061100d826001600160a01b031663df011c416040518163ffffffff1660e01b815260040160206040518083038186803b158015610fce57600080fd5b505afa158015610fe2573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061100691906145a7565b829061390c565b611017908761462e565b955050508061102590614646565b9050610df5565b505050915091565b61103d33613793565b61105a576040516326688ebb60e11b815260040160405180910390fd5b61106660138233613977565b6110835760405163a67d528360e01b815260040160405180910390fd5b50565b600080600c60009054906101000a90046001600160a01b03166001600160a01b031663eaada3826040518163ffffffff1660e01b815260040160206040518083038186803b1580156110d757600080fd5b505afa1580156110eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061110f91906145ed565b6001600160a01b031663b64663848686866040518463ffffffff1660e01b815260040161113e9392919061460a565b60206040518083038186803b15801561115657600080fd5b505afa15801561116a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061118e91906145a7565b60185460405163d2d6b5a360e01b81523360048201529193506000916001600160a01b039091169063d2d6b5a39060240160206040518083038186803b1580156111d757600080fd5b505afa1580156111eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061120f91906145a7565b9050801561122d57611221838261390c565b9150610dc982846145d6565b50935093915050565b6002546001600160a01b0316331461126157604051634b98449160e11b815260040160405180910390fd5b6001600160a01b0381166112885760405163fb7566d760e01b815260040160405180910390fd5b6018546001600160a01b039081169082168114156112b957604051630333a68160e41b815260040160405180910390fd5b816001600160a01b0316816001600160a01b03167f66fa9df7ccacf7a0c110fd7dd4591f59c76a798409b4aeaf850002679baca45560405160405180910390a350601880546001600160a01b0319166001600160a01b0392909216919091179055565b60606113286019613984565b905090565b6018546040805163cfc0c69f60e01b8152815160009384938493849384936001600160a01b03169263cfc0c69f9260048082019391829003018186803b15801561137657600080fd5b505afa15801561138a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ae9190614678565b909250905060006113bf83836146ab565b6001600160801b031690508781156113f0576113ed6113e683670de0b6b3a764000061462e565b82906138d8565b90505b6113f86135a4565b6001600160a01b031663b6466384896001600160a01b0316636f307dc36040518163ffffffff1660e01b815260040160206040518083038186803b15801561143f57600080fd5b505afa158015611453573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061147791906145ed565b8c846040518463ffffffff1660e01b81526004016114979392919061460a565b60206040518083038186803b1580156114af57600080fd5b505afa1580156114c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114e791906145a7565b96506001600160801b0383161561150e5761150b816001600160801b03851661390c565b94505b6001600160801b038416156115455761154261153285670de0b6b3a76400006146ab565b82906001600160801b031661390c565b95505b5050505093509350939050565b600080600061155f6135e9565b1561157d57604051631b0e923f60e11b815260040160405180910390fd5b600260015414156115d55760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b60026001556001600160a01b038088166000908152601660205260409020548891166116145760405163a596698b60e01b815260040160405180910390fd5b8461161e81613793565b61163b5760405163a67d528360e01b815260040160405180910390fd5b86611659576040516310eb483f60e21b815260040160405180910390fd5b336001600160a01b038916141561168357604051630ecda8a760e01b815260040160405180910390fd5b6001600160a01b03808a1660009081526016602052604080822054815163a6afed9560e01b81529151931692839263a6afed95926004808201939182900301818387803b1580156116d357600080fd5b505af11580156116e7573d6000803e3d6000fd5b5050505060006116f68a61316d565b505050509050801561171b5760405163202881bd60e11b815260040160405180910390fd5b6040516370a0823160e01b81526001600160a01b038b81166004830152600091908416906370a082319060240160206040518083038186803b15801561176057600080fd5b505afa158015611774573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061179891906145a7565b600b549091506117a88b836138d8565b11156117c75760405163e292f24f60e01b815260040160405180910390fd5b60006117d16135a4565b600454909150156118a75760006001600160a01b038216638d0dba008f6117f88f876145d6565b6040516001600160e01b031960e085901b1681526001600160a01b039092166004830152602482015260440160206040518083038186803b15801561183c57600080fd5b505afa158015611850573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061187491906145a7565b9050600081118015611887575060045481105b156118a5576040516332b9d47360e01b815260040160405180910390fd5b505b6118b28d8c8c61212c565b6040516370a0823160e01b8152929b5090995097506001600160a01b038b16906370a08231906118f5908f906004016001600160a01b0391909116815260200190565b60206040518083038186803b15801561190d57600080fd5b505afa158015611921573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061194591906145a7565b89111561196557604051635de1e54160e01b815260040160405180910390fd5b604051632770a7eb60e21b8152336004820152602481018c90526001600160a01b038e1690639dc29fac90604401600060405180830381600087803b1580156119ad57600080fd5b505af11580156119c1573d6000803e3d6000fd5b5050604051632770a7eb60e21b81526001600160a01b038f81166004830152602482018f905287169250639dc29fac9150604401600060405180830381600087803b158015611a0f57600080fd5b505af1158015611a23573d6000803e3d6000fd5b505060405163b2a02ff160e01b81526001600160a01b038d16925063b2a02ff19150611a57908f9033908d9060040161460a565b600060405180830381600087803b158015611a7157600080fd5b505af1158015611a85573d6000803e3d6000fd5b505050506000871115611b7a57896001600160a01b031663b2a02ff18d600c60009054906101000a90046001600160a01b03166001600160a01b031663c415b95c6040518163ffffffff1660e01b815260040160206040518083038186803b158015611af057600080fd5b505afa158015611b04573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b2891906145ed565b8a6040518463ffffffff1660e01b8152600401611b479392919061460a565b600060405180830381600087803b158015611b6157600080fd5b505af1158015611b75573d6000803e3d6000fd5b505050505b604080518c8152602081018b90529081018890526001600160a01b03808f1691908e169033907fe1c3870e3d7d5199a16d200133088e6e3f7012d28571e442a110b4c83b5e3b949060600160405180910390a4505050505050600180819055509450945094915050565b611bec611df8565b611c095760405163bc871ce560e01b815260040160405180910390fd5b611c116135e9565b15611c2f57604051631b0e923f60e11b815260040160405180910390fd5b6002546001600160a01b03163314611c5a57604051634b98449160e11b815260040160405180910390fd5b6003805460ff60a01b1916905560405133907f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa90600090a2565b611c9d33613793565b611cba576040516326688ebb60e11b815260040160405180910390fd5b80601e611cc8601383613944565b611cd3601484613944565b611cdd919061462e565b10611cfb576040516306ceeb8360e21b815260040160405180910390fd5b611d0760138333613991565b611d245760405163dd40dad960e01b815260040160405180910390fd5b5050565b6000611d3560118361399e565b92915050565b60606113286011613984565b6002546001600160a01b03163314611d7257604051634b98449160e11b815260040160405180910390fd5b6001600160a01b038116611d995760405163fb7566d760e01b815260040160405180910390fd5b611da46019826139c0565b611dc157604051631e577fa560e31b815260040160405180910390fd5b6040516001600160a01b038216907f5579b1eead2d904c2b05255a92f5a4a4f3e234ae0a4efe538adef3c1794e1cea90600090a250565b600354600090600160a01b900460ff16806113285750600c60009054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b815260040160206040518083038186803b158015611e5c57600080fd5b505afa158015611e70573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061132891906146d6565b611e9c6139d5565b6001600160a01b038316611eb957611eb48282613a02565b505050565b611eb46001600160a01b0384168383613b1b565b6002546001600160a01b03163314611ef857604051634b98449160e11b815260040160405180910390fd5b6001600160a01b038116611f1f5760405163fb7566d760e01b815260040160405180910390fd5b611f2a601982613b6d565b611f47576040516362c4c75f60e01b815260040160405180910390fd5b6040516001600160a01b03821681527f5412e32b52c11e4b232ab59f3660d55b48eb20735ccb2c67a0a1ebea0d6fe0199060200160405180910390a150565b6002546001600160a01b03163314611fb157604051634b98449160e11b815260040160405180910390fd5b6001600160a01b038116611fd85760405163fb7566d760e01b815260040160405180910390fd5b6000816001600160a01b0316638230ecd66040518163ffffffff1660e01b815260040160206040518083038186803b15801561201357600080fd5b505afa158015612027573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061204b91906145ed565b90506001600160a01b0381166120745760405163013a1b4360e51b815260040160405180910390fd5b6001600160a01b0381811660009081526016602052604090205416156120ad5760405163fa9b809960e01b815260040160405180910390fd5b6120b86011836139c0565b6120d557604051631f477b5760e11b815260040160405180910390fd5b6001600160a01b0381811660009081526016602052604080822080546001600160a01b0319169386169384179055517fad48bee6bbb1b8ece321157ad29afc3c6baa177f8dc043132d65038cc601cdd69190a25050565b60008060006121396135a4565b6001600160a01b031663b646638487866001600160a01b0316636f307dc36040518163ffffffff1660e01b815260040160206040518083038186803b15801561218157600080fd5b505afa158015612195573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121b991906145ed565b886040518463ffffffff1660e01b81526004016121d89392919061460a565b60206040518083038186803b1580156121f057600080fd5b505afa158015612204573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061222891906145a7565b6018546040805163cfc0c69f60e01b8152815193955060009384936001600160a01b03169263cfc0c69f9260048082019391829003018186803b15801561226e57600080fd5b505afa158015612282573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122a69190614678565b90925090506001600160801b038116156122d0576122cd846001600160801b03831661390c565b92505b6001600160801b038216156122ff576122f2846001600160801b03841661390c565b6122fc908561462e565b93505b612309848461462e565b9450505093509350939050565b61231f33611d28565b61233c576040516304f8b91760e51b815260040160405180910390fd5b61234860148233613977565b611083576040516359c937f160e01b815260040160405180910390fd5b61236e33611d28565b61238b576040516304f8b91760e51b815260040160405180910390fd5b80601e612399601383613944565b6123a4601484613944565b6123ae919061462e565b106123cc576040516306ceeb8360e21b815260040160405180910390fd5b6123d860148333613991565b611d2457604051631f477b5760e11b815260040160405180910390fd5b6002546001600160a01b0316331461242057604051634b98449160e11b815260040160405180910390fd5b6001600160a01b0381166124475760405163fb7566d760e01b815260040160405180910390fd5b6000816001600160a01b0316636f307dc36040518163ffffffff1660e01b815260040160206040518083038186803b15801561248257600080fd5b505afa158015612496573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124ba91906145ed565b6001600160a01b0380821660009081526010602052604090205491925016156124f65760405163374f601360e11b815260040160405180910390fd5b601e612502600e613b82565b106125205760405163225b605b60e21b815260040160405180910390fd5b61252b600e836139c0565b6125485760405163dd40dad960e01b815260040160405180910390fd5b6001600160a01b0381811660009081526010602052604080822080546001600160a01b0319169386169384179055517fdc705e658c7b6c6c01f5802457bf4ffb99f204bf1603e7b1ae3d4c7536611bc29190a25050565b6060611d35601383613b8c565b6002546001600160a01b031633146125d757604051634b98449160e11b815260040160405180910390fd5b6001600160a01b0381166125fe5760405163fb7566d760e01b815260040160405180910390fd5b600d546001600160a01b0390811690821681141561262f57604051630333a68160e41b815260040160405180910390fd5b6001600160a01b0381161561269a576040516326ed7c7960e11b81526001600160a01b038381166004830152821690634ddaf8f290602401600060405180830381600087803b15801561268157600080fd5b505af1158015612695573d6000803e3d6000fd5b505050505b816001600160a01b0316816001600160a01b03167f4ab5be82436d353e61ca18726e984e561f5c1cc7c6d38b29d2553c790434705a60405160405180910390a350600d80546001600160a01b0319166001600160a01b0392909216919091179055565b612705611df8565b1561272357604051631309a56360e01b815260040160405180910390fd5b6002546001600160a01b0316331461274e57604051634b98449160e11b815260040160405180910390fd5b6003805460ff60a01b1916600160a01b17905560405133907f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25890600090a2565b6002546001600160a01b031633146127b957604051634b98449160e11b815260040160405180910390fd5b6001600160a01b0381166127e05760405163fb7566d760e01b815260040160405180910390fd5b601b546001600160a01b0390811690821681141561281157604051630333a68160e41b815260040160405180910390fd5b604080516001600160a01b038084168252841660208201527f01b723df71593f812e405dc433f7dcf4134ff941def9d2e189a31f3cb1b1963b910160405180910390a150601b80546001600160a01b0319166001600160a01b0392909216919091179055565b6000806128838461316d565b50505050905080156128995760009150506129d1565b6040516370a0823160e01b81526001600160a01b038581166004830152600091612922918891908716906370a082319060240160206040518083038186803b1580156128e457600080fd5b505afa1580156128f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061291c91906145a7565b8661132d565b5050600b546001600160a01b03888116600090815260166020526040908190205490516370a0823160e01b815289831660048201529394506129c0939116906370a082319060240160206040518083038186803b15801561298257600080fd5b505afa158015612996573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129ba91906145a7565b9061390c565b9250828110156129ce578092505b50505b9392505050565b6002546001600160a01b03163314612a0357604051634b98449160e11b815260040160405180910390fd5b600c54604051600160a01b90910460ff1615808252907fc8011ac148e14ab1e8f93a022ebc29088beedc705027c8eb9514d6d69c5b23639060200160405180910390a1600c8054911515600160a01b0260ff60a01b19909216919091179055565b6002546001600160a01b03163314612a8f57604051634b98449160e11b815260040160405180910390fd5b6001600160a01b038116612ab657604051634c267bfb60e01b815260040160405180910390fd5b600380546001600160a01b0319166001600160a01b0392909216919091179055565b600c54604080516331056e5760e21b815290516000926001600160a01b03169163c415b95c916004808301926020929190829003018186803b158015612b1d57600080fd5b505afa158015612b31573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061132891906145ed565b6000612b616001613b9a565b90508015612b79576000805461ff0019166101001790555b6001600160a01b038216612ba057604051637cb62f2b60e11b815260040160405180910390fd5b612ba8613c27565b612bb0613c56565b600c80546001600160a81b0319166001600160a01b03841617600160a01b1790556706f05b59d3b20000600b558015611d24576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050565b6002546001600160a01b03163314612c5157604051634b98449160e11b815260040160405180910390fd5b6000816001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015612c8c57600080fd5b505afa158015612ca0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612cc491906145a7565b1115612ce35760405163066097f160e31b815260040160405180910390fd5b612cee601182613b6d565b612d0b576040516359c937f160e01b815260040160405180910390fd5b60166000826001600160a01b0316638230ecd66040518163ffffffff1660e01b815260040160206040518083038186803b158015612d4857600080fd5b505afa158015612d5c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d8091906145ed565b6001600160a01b03908116825260208201929092526040908101600090812080546001600160a01b03191690559051918316917f81e9205ee5a9e1289fad5baa5e74bd49d4613652eb4626bb15925bf9fdbc0feb9190a250565b6060611d35601483613b8c565b600080612df26135a4565b90506000612e01601485613944565b905060005b81811015612fb1576000612e1c60148784613962565b9050836001600160a01b0316638d0dba00826001600160a01b0316638230ecd66040518163ffffffff1660e01b815260040160206040518083038186803b158015612e6657600080fd5b505afa158015612e7a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e9e91906145ed565b6040516370a0823160e01b81526001600160a01b038a811660048301528516906370a082319060240160206040518083038186803b158015612edf57600080fd5b505afa158015612ef3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f1791906145a7565b6040516001600160e01b031960e085901b1681526001600160a01b039092166004830152602482015260440160206040518083038186803b158015612f5b57600080fd5b505afa158015612f6f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f9391906145a7565b612f9d908661462e565b94505080612faa90614646565b9050612e06565b505050919050565b6002546001600160a01b03163314612fe457604051634b98449160e11b815260040160405180910390fd5b6000816001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561301f57600080fd5b505afa158015613033573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061305791906145a7565b11156130765760405163066097f160e31b815260040160405180910390fd5b613081600e82613b6d565b61309e5760405163a67d528360e01b815260040160405180910390fd5b60106000826001600160a01b0316636f307dc36040518163ffffffff1660e01b815260040160206040518083038186803b1580156130db57600080fd5b505afa1580156130ef573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061311391906145ed565b6001600160a01b03908116825260208201929092526040908101600090812080546001600160a01b03191690559051918316917fe5a19a76470297a1f85f9a38f3ff148b4c8cdc1209e074dbe59db5e22eb31a3a9190a250565b600080600080600061317e86612de7565b925061318986610dd4565b80851115965090945091508183106131a25760006131ac565b6131ac83836145d6565b905091939590929450565b6000806131c26135e9565b156131e057604051631b0e923f60e11b815260040160405180910390fd5b600260015414156132335760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016115cc565b60026001556001600160a01b038086166000908152601660205260409020548691166132725760405163a596698b60e01b815260040160405180910390fd5b6001600160a01b038086166000908152601660205260409020548691166132ac5760405163a596698b60e01b815260040160405180910390fd5b600c54600160a01b900460ff166132d657604051633840404b60e21b815260040160405180910390fd5b84158061335857506040516370a0823160e01b81523360048201526001600160a01b038816906370a082319060240160206040518083038186803b15801561331d57600080fd5b505afa158015613331573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061335591906145a7565b85115b156133765760405163ca99073960e01b815260040160405180910390fd5b604051632770a7eb60e21b8152336004820152602481018690526001600160a01b03881690639dc29fac90604401600060405180830381600087803b1580156133be57600080fd5b505af11580156133d2573d6000803e3d6000fd5b505050506133e1878787611086565b909450925082156134e257856001600160a01b03166340c10f19600c60009054906101000a90046001600160a01b03166001600160a01b031663c415b95c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561344957600080fd5b505afa15801561345d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061348191906145ed565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101869052604401600060405180830381600087803b1580156134c957600080fd5b505af11580156134dd573d6000803e3d6000fd5b505050505b6040516340c10f1960e01b8152336004820152602481018590526001600160a01b038716906340c10f1990604401600060405180830381600087803b15801561352a57600080fd5b505af115801561353e573d6000803e3d6000fd5b505060408051888152602081018890529081018690526001600160a01b03808a1693508a16915033907fafd74f009c0ff7627726f24b568ee5529cd297f6a7a1e43ec363443a13a584209060600160405180910390a45050600180559094909350915050565b600c5460408051637556d1c160e11b815290516000926001600160a01b03169163eaada382916004808301926020929190829003018186803b158015612b1d57600080fd5b600354600090600160a81b900460ff16806113285750600c60009054906101000a90046001600160a01b03166001600160a01b031663ecf3a3f96040518163ffffffff1660e01b815260040160206040518083038186803b158015611e5c57600080fd5b6002546001600160a01b0316331461367857604051634b98449160e11b815260040160405180910390fd5b670de0b6b3a76400008111156136a157604051633c2c00b560e21b815260040160405180910390fd5b600b54818114156136c557604051630333a68160e41b815260040160405180910390fd5b60408051828152602081018490527f6d8ed4ad9ba67058e16e32fc3c8da2e3358da6cd1599e0e0fb2630d0a19fd49c910160405180910390a150600b55565b6003546001600160a01b03163381146137305760405163038cdbad60e31b815260040160405180910390fd5b6002546040516001600160a01b038084169216907fd4459d5b8b913cab0244230fd9b1c08b6ceace7fe9230e60d0f74cbffdf849d090600090a3600280546001600160a01b039092166001600160a01b0319928316179055600380549091169055565b6000611d35600e8361399e565b6060611328600e613984565b6137b46135e9565b156137d257604051631b0e923f60e11b815260040160405180910390fd5b6002546001600160a01b031633146137fd57604051634b98449160e11b815260040160405180910390fd5b6003805461ffff60a01b191661010160a01b17905560405133907f28b4c24cb1012c094cd2f59f98e89d791973295f8fda6eaa118022d6d318960a90600090a2565b6138476135e9565b61386457604051636e2cff4560e01b815260040160405180910390fd5b6002546001600160a01b0316331461388f57604051634b98449160e11b815260040160405180910390fd5b6003805460ff60a81b1916905560405133907fece7583a70a505ef0e36d4dec768f5ae597713e09c26011022599ee01abdabfc90600090a2565b6001600160a01b03163b151590565b6000816138e66002826146f8565b6138f8670de0b6b3a76400008661471a565b613902919061462e565b6129d191906146f8565b6000821580613919575081155b1561392657506000611d35565b670de0b6b3a764000061393a6002826146f8565b6138f8848661471a565b6001600160a01b0381166000908152602083905260408120546129d1565b600061396f848484613c85565b949350505050565b600061396f848484613ccc565b606060006129d183613e79565b600061396f848484613ed5565b6001600160a01b038116600090815260018301602052604081205415156129d1565b60006129d1836001600160a01b038416613f63565b6002546001600160a01b03163314613a0057604051634b98449160e11b815260040160405180910390fd5b565b80471015613a525760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e636500000060448201526064016115cc565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114613a9f576040519150601f19603f3d011682016040523d82523d6000602084013e613aa4565b606091505b5050905080611eb45760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d6179206861766520726576657274656400000000000060648201526084016115cc565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052611eb4908490613fb2565b60006129d1836001600160a01b038416614084565b6000611d35825490565b6060600061396f8484614177565b60008054610100900460ff1615613be1578160ff166001148015613bbd5750303b155b613bd95760405162461bcd60e51b81526004016115cc90614739565b506000919050565b60005460ff808416911610613c085760405162461bcd60e51b81526004016115cc90614739565b506000805460ff191660ff92909216919091179055600190565b919050565b600054610100900460ff16613c4e5760405162461bcd60e51b81526004016115cc90614787565b613a006141ec565b600054610100900460ff16613c7d5760405162461bcd60e51b81526004016115cc90614787565b613a00614219565b6001600160a01b0382166000908152602084905260408120805483908110613caf57613caf6147d2565b6000918252602090912001546001600160a01b0316949350505050565b6001600160a01b03808316600090815260208581526040808320938516835260019093019052908120548015613e6f576000613d096001836145d6565b6001600160a01b03861660009081526020889052604081205491925090613d32906001906145d6565b9050818114613dee576001600160a01b0386166000908152602088905260408120805483908110613d6557613d656147d2565b60009182526020808320909101546001600160a01b038a81168452918b90526040909220805491909216925082919085908110613da457613da46147d2565b600091825260208083209190910180546001600160a01b0319166001600160a01b0394851617905589831682528a8152604080832094909316825260019390930190925290208390555b6001600160a01b0386166000908152602088905260409020805480613e1557613e156147e8565b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b0388811683528982526040808420918916845260019182019092529082209190915593506129d192505050565b60009150506129d1565b606081600001805480602002602001604051908101604052809291908181526020018280548015613ec957602002820191906000526020600020905b815481526020019060010190808311613eb5575b50505050509050919050565b6001600160a01b0380831660009081526020858152604080832093851683526001909301905290812054613f5b57506001600160a01b0382811660009081526020858152604080832080546001808201835582865284862090910180546001600160a01b03191696881696871790558154958552908101909252909120919091556129d1565b5060006129d1565b6000818152600183016020526040812054613faa57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155611d35565b506000611d35565b6000614007826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166142829092919063ffffffff16565b805190915015611eb4578080602001905181019061402591906146d6565b611eb45760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016115cc565b6000818152600183016020526040812054801561416d5760006140a86001836145d6565b85549091506000906140bc906001906145d6565b90508181146141215760008660000182815481106140dc576140dc6147d2565b90600052602060002001549050808760000184815481106140ff576140ff6147d2565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080614132576141326147e8565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050611d35565b6000915050611d35565b6001600160a01b038116600090815260208381526040918290208054835181840281018401909452808452606093928301828280156141df57602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116141c1575b5050505050905092915050565b600054610100900460ff166142135760405162461bcd60e51b81526004016115cc90614787565b60018055565b600054610100900460ff166142405760405162461bcd60e51b81526004016115cc90614787565b600280546001600160a01b031916339081179091556040516000907fd4459d5b8b913cab0244230fd9b1c08b6ceace7fe9230e60d0f74cbffdf849d0908290a3565b606061396f8484600085856001600160a01b0385163b6142e45760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016115cc565b600080866001600160a01b0316858760405161430091906147fe565b60006040518083038185875af1925050503d806000811461433d576040519150601f19603f3d011682016040523d82523d6000602084013e614342565b606091505b509150915061435282828661435d565b979650505050505050565b6060831561436c5750816129d1565b82511561437c5782518084602001fd5b8160405162461bcd60e51b81526004016115cc9190614574565b6001600160a01b038116811461108357600080fd5b6000602082840312156143bd57600080fd5b81356129d181614396565b6000602082840312156143da57600080fd5b5035919050565b6000806000606084860312156143f657600080fd5b833561440181614396565b9250602084013561441181614396565b929592945050506040919091013590565b6020808252825182820181905260009190848201906040850190845b818110156144635783516001600160a01b03168352928401929184019160010161443e565b50909695505050505050565b60008060006060848603121561448457600080fd5b833561448f81614396565b92506020840135915060408401356144a681614396565b809150509250925092565b600080600080608085870312156144c757600080fd5b84356144d281614396565b935060208501356144e281614396565b92506040850135915060608501356144f981614396565b939692955090935050565b60008060006060848603121561451957600080fd5b833561452481614396565b9250602084013561453481614396565b915060408401356144a681614396565b60005b8381101561455f578181015183820152602001614547565b8381111561456e576000848401525b50505050565b6020815260008251806020840152614593816040850160208701614544565b601f01601f19169190910160400192915050565b6000602082840312156145b957600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b6000828210156145e8576145e86145c0565b500390565b6000602082840312156145ff57600080fd5b81516129d181614396565b6001600160a01b039384168152919092166020820152604081019190915260600190565b60008219821115614641576146416145c0565b500190565b600060001982141561465a5761465a6145c0565b5060010190565b80516001600160801b0381168114613c2257600080fd5b6000806040838503121561468b57600080fd5b61469483614661565b91506146a260208401614661565b90509250929050565b60006001600160801b038083168185168083038211156146cd576146cd6145c0565b01949350505050565b6000602082840312156146e857600080fd5b815180151581146129d157600080fd5b60008261471557634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615614734576147346145c0565b500290565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b60008251614810818460208701614544565b919091019291505056fea2646970667358221220c806aa72c8ef680cc368bfee726d1dd28a830a5c43fa4605100487131e51f7eb64736f6c63430008090033", + "numDeployments": 2, + "solcInputHash": "210845288ae75ad5da12a755a9f52e1f", + "metadata": "{\"compiler\":{\"version\":\"0.8.9+commit.e5eed63a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AddressIsNull\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AmountGreaterThanMaxLiquidable\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AmountInIsInvalid\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AmountIsTooHigh\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AmountIsZero\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CanNotLiquidateOwnPosition\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DebtTokenAlreadyExists\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DebtTokenDoesNotExist\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DepositTokenAlreadyExists\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DepositTokenDoesNotExist\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FallbackIsNotAllowed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IsNotPaused\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IsNotShutdown\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IsPaused\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IsShutdown\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MaxLiquidableTooHigh\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NewValueIsSameAsCurrent\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PoolRegistryIsNull\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PositionIsHealthy\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ProposedGovernorIsNull\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ReachedMaxDepositTokens\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ReceiveIsNotAllowed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RemainingDebtIsLowerThanTheFloor\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RewardDistributorAlreadyExists\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RewardDistributorDoesNotExist\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SenderIsNotDebtToken\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SenderIsNotDepositToken\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SenderIsNotGovernor\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SenderIsNotTheProposedGovernor\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SwapFeatureIsInactive\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SyntheticDoesNotExist\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SyntheticIsInUse\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SyntheticIsNull\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TotalSupplyIsNotZero\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnderlyingAssetInUse\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UserReachedMaxTokens\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"newIsActive\",\"type\":\"bool\"}],\"name\":\"BridgingIsActiveUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldDebtFloorInUsd\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newDebtFloorInUsd\",\"type\":\"uint256\"}],\"name\":\"DebtFloorUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IDebtToken\",\"name\":\"debtToken\",\"type\":\"address\"}],\"name\":\"DebtTokenAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IDebtToken\",\"name\":\"debtToken\",\"type\":\"address\"}],\"name\":\"DebtTokenRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"depositToken\",\"type\":\"address\"}],\"name\":\"DepositTokenAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IDepositToken\",\"name\":\"depositToken\",\"type\":\"address\"}],\"name\":\"DepositTokenRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IFeeProvider\",\"name\":\"oldFeeProvider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"contract IFeeProvider\",\"name\":\"newFeeProvider\",\"type\":\"address\"}],\"name\":\"FeeProviderUpdated\",\"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\":\"oldMaxLiquidable\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newMaxLiquidable\",\"type\":\"uint256\"}],\"name\":\"MaxLiquidableUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"Open\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"Paused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"liquidator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"contract ISyntheticToken\",\"name\":\"syntheticToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountRepaid\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"depositSeized\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"fee\",\"type\":\"uint256\"}],\"name\":\"PositionLiquidated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IRewardsDistributor\",\"name\":\"_distributor\",\"type\":\"address\"}],\"name\":\"RewardsDistributorAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"contract IRewardsDistributor\",\"name\":\"_distributor\",\"type\":\"address\"}],\"name\":\"RewardsDistributorRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"Shutdown\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"contract ISmartFarmingManager\",\"name\":\"oldSmartFarmingManager\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"contract ISmartFarmingManager\",\"name\":\"newSmartFarmingManager\",\"type\":\"address\"}],\"name\":\"SmartFarmingManagerUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"newActive\",\"type\":\"bool\"}],\"name\":\"SwapActiveUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"contract ISyntheticToken\",\"name\":\"syntheticTokenIn\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"contract ISyntheticToken\",\"name\":\"syntheticTokenOut\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"fee\",\"type\":\"uint256\"}],\"name\":\"SyntheticTokenSwapped\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract ITreasury\",\"name\":\"oldTreasury\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"contract ITreasury\",\"name\":\"newTreasury\",\"type\":\"address\"}],\"name\":\"TreasuryUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"Unpaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousGovernor\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"proposedGovernor\",\"type\":\"address\"}],\"name\":\"UpdatedGovernor\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"MAX_TOKENS_PER_USER\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"VERSION\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"acceptGovernorship\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IDebtToken\",\"name\":\"debtToken_\",\"type\":\"address\"}],\"name\":\"addDebtToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"depositToken_\",\"type\":\"address\"}],\"name\":\"addDepositToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IRewardsDistributor\",\"name\":\"distributor_\",\"type\":\"address\"}],\"name\":\"addRewardsDistributor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account_\",\"type\":\"address\"}],\"name\":\"addToDebtTokensOfAccount\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account_\",\"type\":\"address\"}],\"name\":\"addToDepositTokensOfAccount\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"debtFloorInUsd\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account_\",\"type\":\"address\"}],\"name\":\"debtOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_debtInUsd\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account_\",\"type\":\"address\"}],\"name\":\"debtPositionOf\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"_isHealthy\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"_depositInUsd\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_debtInUsd\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_issuableLimitInUsd\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_issuableInUsd\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ISyntheticToken\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"debtTokenOf\",\"outputs\":[{\"internalType\":\"contract IDebtToken\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account_\",\"type\":\"address\"}],\"name\":\"depositOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_depositInUsd\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_issuableLimitInUsd\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"depositTokenOf\",\"outputs\":[{\"internalType\":\"contract IDepositToken\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IDebtToken\",\"name\":\"debtToken_\",\"type\":\"address\"}],\"name\":\"doesDebtTokenExist\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IDepositToken\",\"name\":\"depositToken_\",\"type\":\"address\"}],\"name\":\"doesDepositTokenExist\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ISyntheticToken\",\"name\":\"syntheticToken_\",\"type\":\"address\"}],\"name\":\"doesSyntheticTokenExist\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"everythingStopped\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"feeCollector\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"feeProvider\",\"outputs\":[{\"internalType\":\"contract IFeeProvider\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDebtTokens\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account_\",\"type\":\"address\"}],\"name\":\"getDebtTokensOfAccount\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDepositTokens\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account_\",\"type\":\"address\"}],\"name\":\"getDepositTokensOfAccount\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRewardsDistributors\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IPoolRegistry\",\"name\":\"poolRegistry_\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isBridgingActive\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isSwapActive\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ISyntheticToken\",\"name\":\"syntheticToken_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"account_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountToRepay_\",\"type\":\"uint256\"},{\"internalType\":\"contract IDepositToken\",\"name\":\"depositToken_\",\"type\":\"address\"}],\"name\":\"liquidate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_totalSeized\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_toLiquidator\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_fee\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"masterOracle\",\"outputs\":[{\"internalType\":\"contract IMasterOracle\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maxLiquidable\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"open\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"poolRegistry\",\"outputs\":[{\"internalType\":\"contract IPoolRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proposedGovernor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ISyntheticToken\",\"name\":\"syntheticToken_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"totalToSeize_\",\"type\":\"uint256\"},{\"internalType\":\"contract IDepositToken\",\"name\":\"depositToken_\",\"type\":\"address\"}],\"name\":\"quoteLiquidateIn\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_amountToRepay\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_toLiquidator\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_fee\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ISyntheticToken\",\"name\":\"syntheticToken_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"account_\",\"type\":\"address\"},{\"internalType\":\"contract IDepositToken\",\"name\":\"depositToken_\",\"type\":\"address\"}],\"name\":\"quoteLiquidateMax\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_maxAmountToRepay\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ISyntheticToken\",\"name\":\"syntheticToken_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountToRepay_\",\"type\":\"uint256\"},{\"internalType\":\"contract IDepositToken\",\"name\":\"depositToken_\",\"type\":\"address\"}],\"name\":\"quoteLiquidateOut\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_totalToSeize\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_toLiquidator\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_fee\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ISyntheticToken\",\"name\":\"syntheticTokenIn_\",\"type\":\"address\"},{\"internalType\":\"contract ISyntheticToken\",\"name\":\"syntheticTokenOut_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountOut_\",\"type\":\"uint256\"}],\"name\":\"quoteSwapIn\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_amountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_fee\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ISyntheticToken\",\"name\":\"syntheticTokenIn_\",\"type\":\"address\"},{\"internalType\":\"contract ISyntheticToken\",\"name\":\"syntheticTokenOut_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountIn_\",\"type\":\"uint256\"}],\"name\":\"quoteSwapOut\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_amountOut\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_fee\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IDebtToken\",\"name\":\"debtToken_\",\"type\":\"address\"}],\"name\":\"removeDebtToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IDepositToken\",\"name\":\"depositToken_\",\"type\":\"address\"}],\"name\":\"removeDepositToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account_\",\"type\":\"address\"}],\"name\":\"removeFromDebtTokensOfAccount\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account_\",\"type\":\"address\"}],\"name\":\"removeFromDepositTokensOfAccount\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IRewardsDistributor\",\"name\":\"distributor_\",\"type\":\"address\"}],\"name\":\"removeRewardsDistributor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"shutdown\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"smartFarmingManager\",\"outputs\":[{\"internalType\":\"contract ISmartFarmingManager\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ISyntheticToken\",\"name\":\"syntheticTokenIn_\",\"type\":\"address\"},{\"internalType\":\"contract ISyntheticToken\",\"name\":\"syntheticTokenOut_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountIn_\",\"type\":\"uint256\"}],\"name\":\"swap\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_amountOut\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_fee\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"token_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount_\",\"type\":\"uint256\"}],\"name\":\"sweep\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"toggleBridgingIsActive\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"toggleIsSwapActive\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"proposedGovernor_\",\"type\":\"address\"}],\"name\":\"transferGovernorship\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"treasury\",\"outputs\":[{\"internalType\":\"contract ITreasury\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unpause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newDebtFloorInUsd_\",\"type\":\"uint256\"}],\"name\":\"updateDebtFloor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IFeeProvider\",\"name\":\"feeProvider_\",\"type\":\"address\"}],\"name\":\"updateFeeProvider\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newMaxLiquidable_\",\"type\":\"uint256\"}],\"name\":\"updateMaxLiquidable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ISmartFarmingManager\",\"name\":\"newSmartFarmingManager_\",\"type\":\"address\"}],\"name\":\"updateSmartFarmingManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ITreasury\",\"name\":\"newTreasury_\",\"type\":\"address\"}],\"name\":\"updateTreasury\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"addDebtToken(address)\":{\"details\":\"Must keep `debtTokenOf` mapping updated\"},\"addToDebtTokensOfAccount(address)\":{\"details\":\"This function is called from `DebtToken` when user's balance changes from `0`The caller should ensure to not pass `address(0)` as `_account`\",\"params\":{\"account_\":\"The account address\"}},\"addToDepositTokensOfAccount(address)\":{\"details\":\"This function is called from `DepositToken` when user's balance changes from `0`The caller should ensure to not pass `address(0)` as `_account`\",\"params\":{\"account_\":\"The account address\"}},\"debtOf(address)\":{\"params\":{\"account_\":\"The account to check\"},\"returns\":{\"_debtInUsd\":\"The debt value in USD\"}},\"debtPositionOf(address)\":{\"params\":{\"account_\":\"The account to check\"},\"returns\":{\"_debtInUsd\":\"The total debt in USD\",\"_depositInUsd\":\"The total collateral deposited in USD\",\"_isHealthy\":\"Whether the account's position is healthy\",\"_issuableInUsd\":\"The amount of debt (is USD) that is free (i.e. can be used to issue synthetic tokens)\",\"_issuableLimitInUsd\":\"The max amount of debt (is USD) that can be created (considering collateral factors)\"}},\"depositOf(address)\":{\"params\":{\"account_\":\"The account to check\"},\"returns\":{\"_depositInUsd\":\"The total deposit value in USD among all collaterals\",\"_issuableLimitInUsd\":\"The max value in USD that can be used to issue synthetic tokens\"}},\"doesDebtTokenExist(address)\":{\"params\":{\"debtToken_\":\"Asset to check\"},\"returns\":{\"_0\":\"true if exist\"}},\"doesDepositTokenExist(address)\":{\"params\":{\"depositToken_\":\"Asset to check\"},\"returns\":{\"_0\":\"true if exist\"}},\"doesSyntheticTokenExist(address)\":{\"params\":{\"syntheticToken_\":\"Asset to check\"},\"returns\":{\"_0\":\"true if exist\"}},\"getDebtTokens()\":{\"details\":\"WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed to mostly be used by view accessors that are queried without any gas fees.\"},\"getDebtTokensOfAccount(address)\":{\"details\":\"WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed to mostly be used by view accessors that are queried without any gas fees.\"},\"getDepositTokens()\":{\"details\":\"WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed to mostly be used by view accessors that are queried without any gas fees.\"},\"getDepositTokensOfAccount(address)\":{\"details\":\"WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed to mostly be used by view accessors that are queried without any gas fees.\"},\"liquidate(address,address,uint256,address)\":{\"params\":{\"account_\":\"The account with an unhealthy position\",\"amountToRepay_\":\"The amount to repay in synthetic token\",\"depositToken_\":\"The collateral to seize from\",\"syntheticToken_\":\"The msAsset to use for repayment\"},\"returns\":{\"_fee\":\"Share of `_totalSeized` collected as fee\",\"_toLiquidator\":\"Share of `_totalSeized` sent to the liquidator\",\"_totalSeized\":\"Total deposit amount seized from the liquidated account\"}},\"open()\":{\"details\":\"Open contract operations, if contract is in shutdown state\"},\"pause()\":{\"details\":\"Suspend deposit feature, if contract is not paused.\"},\"quoteLiquidateIn(address,uint256,address)\":{\"params\":{\"depositToken_\":\"Collateral's deposit token\",\"syntheticToken_\":\"Synth for repayment\",\"totalToSeize_\":\"Collateral total amount to size\"},\"returns\":{\"_amountToRepay\":\"Synth amount to burn\",\"_fee\":\"The fee amount to collect\",\"_toLiquidator\":\"Seized amount to the liquidator\"}},\"quoteLiquidateMax(address,address,address)\":{\"details\":\"I.e. Considers the min amount between collateral's balance and `maxLiquidable` param\",\"params\":{\"account_\":\"The account to liquidate\",\"depositToken_\":\"Collateral's deposit token\",\"syntheticToken_\":\"Synth for repayment\"},\"returns\":{\"_maxAmountToRepay\":\"Synth amount to burn\"}},\"quoteLiquidateOut(address,uint256,address)\":{\"params\":{\"amountToRepay_\":\"Synth amount to burn\",\"depositToken_\":\"Collateral's deposit token\",\"syntheticToken_\":\"Synth for repayment\"},\"returns\":{\"_fee\":\"The fee amount to collect\",\"_toLiquidator\":\"Seized amount to the liquidator\",\"_totalToSeize\":\"Collateral total amount to size\"}},\"quoteSwapIn(address,address,uint256)\":{\"params\":{\"amountOut_\":\"Amount out\",\"syntheticTokenIn_\":\"Synth in\",\"syntheticTokenOut_\":\"Synth out\"},\"returns\":{\"_amountIn\":\"Amount in\",\"_fee\":\"Fee to charge in `syntheticTokenOut_`\"}},\"quoteSwapOut(address,address,uint256)\":{\"params\":{\"amountIn_\":\"Amount in\",\"syntheticTokenIn_\":\"Synth in\",\"syntheticTokenOut_\":\"Synth out\"},\"returns\":{\"_amountOut\":\"Amount out\",\"_fee\":\"Fee to charge in `syntheticTokenOut_`\"}},\"removeDebtToken(address)\":{\"details\":\"Must keep `debtTokenOf` mapping updated\"},\"removeFromDebtTokensOfAccount(address)\":{\"details\":\"This function is called from `DebtToken` when user's balance changes to `0`The caller should ensure to not pass `address(0)` as `_account`\",\"params\":{\"account_\":\"The account address\"}},\"removeFromDepositTokensOfAccount(address)\":{\"details\":\"This function is called from `DepositToken` when user's balance changes to `0`The caller should ensure to not pass `address(0)` as `_account`\",\"params\":{\"account_\":\"The account address\"}},\"shutdown()\":{\"details\":\"Suspend all features (issue, repay, deposit, withdraw, liquidate and swap), if not already shutdown.\"},\"swap(address,address,uint256)\":{\"params\":{\"amountIn_\":\"Amount to swap\",\"syntheticTokenIn_\":\"Synthetic token to sell\",\"syntheticTokenOut_\":\"Synthetic token to buy\"}},\"sweep(address,address,uint256)\":{\"params\":{\"amount_\":\"The amount to send\",\"to_\":\"The recipient of the transfer\",\"token_\":\"The token to transfer\"}},\"transferGovernorship(address)\":{\"details\":\"Can only be called by the current owner.\",\"params\":{\"proposedGovernor_\":\"The new proposed governor\"}},\"unpause()\":{\"details\":\"Unpause contract operations, allow only if contract is paused and not shutdown.\"}},\"title\":\"Pool contract\",\"version\":1},\"userdoc\":{\"events\":{\"BridgingIsActiveUpdated(bool)\":{\"notice\":\"Emitted when flag for pause bridge transfer is toggled\"},\"DebtFloorUpdated(uint256,uint256)\":{\"notice\":\"Emitted when protocol liquidation fee is updated\"},\"DebtTokenAdded(address)\":{\"notice\":\"Emitted when debt token is enabled\"},\"DebtTokenRemoved(address)\":{\"notice\":\"Emitted when debt token is disabled\"},\"DepositTokenAdded(address)\":{\"notice\":\"Emitted when deposit token is enabled\"},\"DepositTokenRemoved(address)\":{\"notice\":\"Emitted when deposit token is disabled\"},\"FeeProviderUpdated(address,address)\":{\"notice\":\"Emitted when fee provider contract is updated\"},\"MaxLiquidableUpdated(uint256,uint256)\":{\"notice\":\"Emitted when maxLiquidable (liquidation cap) is updated\"},\"Open(address)\":{\"notice\":\"Emitted when contract is turned on\"},\"Paused(address)\":{\"notice\":\"Emitted when contract is paused\"},\"PositionLiquidated(address,address,address,uint256,uint256,uint256)\":{\"notice\":\"Emitted when a position is liquidated\"},\"RewardsDistributorAdded(address)\":{\"notice\":\"Emitted when rewards distributor contract is added\"},\"RewardsDistributorRemoved(address)\":{\"notice\":\"Emitted when rewards distributor contract is removed\"},\"Shutdown(address)\":{\"notice\":\"Emitted when contract is shuted down\"},\"SmartFarmingManagerUpdated(address,address)\":{\"notice\":\"Emitted when SmartFarmingManager contract is updated\"},\"SwapActiveUpdated(bool)\":{\"notice\":\"Emitted when the swap active flag is updated\"},\"SyntheticTokenSwapped(address,address,address,uint256,uint256,uint256)\":{\"notice\":\"Emitted when synthetic token is swapped\"},\"TreasuryUpdated(address,address)\":{\"notice\":\"Emitted when treasury contract is updated\"},\"Unpaused(address)\":{\"notice\":\"Emitted when contract is unpaused\"}},\"kind\":\"user\",\"methods\":{\"MAX_TOKENS_PER_USER()\":{\"notice\":\"Maximum tokens per pool a user may have\"},\"acceptGovernorship()\":{\"notice\":\"Allows new governor to accept governorship of the contract.\"},\"addDebtToken(address)\":{\"notice\":\"Add debt token to offerings\"},\"addDepositToken(address)\":{\"notice\":\"Add deposit token (i.e. collateral) to Synth\"},\"addRewardsDistributor(address)\":{\"notice\":\"Add a RewardsDistributor contract\"},\"addToDebtTokensOfAccount(address)\":{\"notice\":\"Add a debt token to the per-account list\"},\"addToDepositTokensOfAccount(address)\":{\"notice\":\"Add a deposit token to the per-account list\"},\"debtFloorInUsd()\":{\"notice\":\"The debt floor (in USD) for each synthetic token This parameters is used to keep incentive for liquidators (i.e. cover gas and provide enough profit)\"},\"debtOf(address)\":{\"notice\":\"Get account's debt by querying latest prices from oracles\"},\"debtPositionOf(address)\":{\"notice\":\"Returns whether the debt position from an account is healthy\"},\"debtTokenOf(address)\":{\"notice\":\"Get the debt token's address from given synthetic asset\"},\"depositOf(address)\":{\"notice\":\"Get account's total collateral deposited by querying latest prices from oracles\"},\"depositTokenOf(address)\":{\"notice\":\"Get the deposit token's address from given underlying asset\"},\"doesDebtTokenExist(address)\":{\"notice\":\"Check if token is part of the debt offerings\"},\"doesDepositTokenExist(address)\":{\"notice\":\"Check if collateral is supported\"},\"doesSyntheticTokenExist(address)\":{\"notice\":\"Check if token is part of the synthetic offerings\"},\"everythingStopped()\":{\"notice\":\"Return `true` if contract is shutdown\"},\"feeCollector()\":{\"notice\":\"Returns fee collector address\"},\"feeProvider()\":{\"notice\":\"FeeProvider contract\"},\"getDebtTokens()\":{\"notice\":\"Get all debt tokens\"},\"getDebtTokensOfAccount(address)\":{\"notice\":\"Get all debt tokens\"},\"getDepositTokens()\":{\"notice\":\"Get all deposit tokens\"},\"getDepositTokensOfAccount(address)\":{\"notice\":\"Get deposit tokens of an account\"},\"getRewardsDistributors()\":{\"notice\":\"Get all rewards distributors\"},\"governor()\":{\"notice\":\"The governor\"},\"isBridgingActive()\":{\"notice\":\"Flag that pause/unpause pool's cross-chain activities\"},\"isSwapActive()\":{\"notice\":\"Swap feature on/off flag\"},\"liquidate(address,address,uint256,address)\":{\"notice\":\"Burn synthetic token, unlock deposit token and send liquidator incentive\"},\"masterOracle()\":{\"notice\":\"Get MasterOracle contract\"},\"maxLiquidable()\":{\"notice\":\"The max percent of the debt allowed to liquidate\"},\"paused()\":{\"notice\":\"Return `true` if contract is paused\"},\"poolRegistry()\":{\"notice\":\"PoolRegistry\"},\"proposedGovernor()\":{\"notice\":\"The proposed governor\"},\"quoteLiquidateIn(address,uint256,address)\":{\"notice\":\"Quote synth `_amountToRepay` in order to seize `totalToSeized_`\"},\"quoteLiquidateMax(address,address,address)\":{\"notice\":\"Quote max allowed synth to repay\"},\"quoteLiquidateOut(address,uint256,address)\":{\"notice\":\"Quote collateral `totalToSeized_` by repaying `amountToRepay_`\"},\"quoteSwapIn(address,address,uint256)\":{\"notice\":\"Quote `_amountIn` to get `amountOut_`\"},\"quoteSwapOut(address,address,uint256)\":{\"notice\":\"Quote `amountOut_` get from `amountIn_`\"},\"removeDebtToken(address)\":{\"notice\":\"Remove debt token from offerings\"},\"removeDepositToken(address)\":{\"notice\":\"Remove deposit token (i.e. collateral) from Synth\"},\"removeFromDebtTokensOfAccount(address)\":{\"notice\":\"Remove a debt token from the per-account list\"},\"removeFromDepositTokensOfAccount(address)\":{\"notice\":\"Remove a deposit token from the per-account list\"},\"removeRewardsDistributor(address)\":{\"notice\":\"Remove a RewardsDistributor contract\"},\"smartFarmingManager()\":{\"notice\":\"SmartFarmingManager contract\"},\"swap(address,address,uint256)\":{\"notice\":\"Swap synthetic tokens\"},\"sweep(address,address,uint256)\":{\"notice\":\"ERC20 recovery in case of stuck tokens due direct transfers to the contract address.\"},\"toggleBridgingIsActive()\":{\"notice\":\"Pause/Unpause bridge transfers\"},\"toggleIsSwapActive()\":{\"notice\":\"Turn swap on/off\"},\"transferGovernorship(address)\":{\"notice\":\"Transfers governorship of the contract to a new account (`proposedGovernor`).\"},\"treasury()\":{\"notice\":\"Treasury contract\"},\"updateDebtFloor(uint256)\":{\"notice\":\"Update debt floor\"},\"updateFeeProvider(address)\":{\"notice\":\"Update FeeProvider contract\"},\"updateMaxLiquidable(uint256)\":{\"notice\":\"Update maxLiquidable (liquidation cap)\"},\"updateSmartFarmingManager(address)\":{\"notice\":\"Update SmartFarmingManager contract\"},\"updateTreasury(address)\":{\"notice\":\"Update treasury contract - will migrate funds to the new contract\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/Pool.sol\":\"Pool\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/Pool.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./utils/ReentrancyGuard.sol\\\";\\nimport \\\"./storage/PoolStorage.sol\\\";\\nimport \\\"./lib/WadRayMath.sol\\\";\\nimport \\\"./utils/Pauseable.sol\\\";\\n\\nerror SyntheticDoesNotExist();\\nerror SenderIsNotDebtToken();\\nerror SenderIsNotDepositToken();\\nerror UserReachedMaxTokens();\\nerror PoolRegistryIsNull();\\nerror DebtTokenAlreadyExists();\\nerror DepositTokenAlreadyExists();\\nerror AmountIsZero();\\nerror CanNotLiquidateOwnPosition();\\nerror PositionIsHealthy();\\nerror AmountGreaterThanMaxLiquidable();\\nerror RemainingDebtIsLowerThanTheFloor();\\nerror AmountIsTooHigh();\\nerror DebtTokenDoesNotExist();\\nerror DepositTokenDoesNotExist();\\nerror SwapFeatureIsInactive();\\nerror AmountInIsInvalid();\\nerror AddressIsNull();\\nerror SyntheticIsNull();\\nerror SyntheticIsInUse();\\nerror UnderlyingAssetInUse();\\nerror ReachedMaxDepositTokens();\\nerror RewardDistributorAlreadyExists();\\nerror RewardDistributorDoesNotExist();\\nerror TotalSupplyIsNotZero();\\nerror NewValueIsSameAsCurrent();\\nerror MaxLiquidableTooHigh();\\n\\n/**\\n * @title Pool contract\\n */\\ncontract Pool is ReentrancyGuard, Pauseable, PoolStorageV4 {\\n using SafeERC20 for IERC20;\\n using SafeERC20 for ISyntheticToken;\\n using WadRayMath for uint256;\\n using EnumerableSet for EnumerableSet.AddressSet;\\n using MappedEnumerableSet for MappedEnumerableSet.AddressSet;\\n\\n string public constant VERSION = \\\"1.3.0\\\";\\n\\n /**\\n * @notice Maximum tokens per pool a user may have\\n */\\n uint256 public constant MAX_TOKENS_PER_USER = 30;\\n\\n /// @notice Emitted when flag for pause bridge transfer is toggled\\n event BridgingIsActiveUpdated(bool newIsActive);\\n\\n /// @notice Emitted when protocol liquidation fee is updated\\n event DebtFloorUpdated(uint256 oldDebtFloorInUsd, uint256 newDebtFloorInUsd);\\n\\n /// @notice Emitted when debt token is enabled\\n event DebtTokenAdded(IDebtToken indexed debtToken);\\n\\n /// @notice Emitted when debt token is disabled\\n event DebtTokenRemoved(IDebtToken indexed debtToken);\\n\\n /// @notice Emitted when deposit token is enabled\\n event DepositTokenAdded(address indexed depositToken);\\n\\n /// @notice Emitted when deposit token is disabled\\n event DepositTokenRemoved(IDepositToken indexed depositToken);\\n\\n /// @notice Emitted when fee provider contract is updated\\n event FeeProviderUpdated(IFeeProvider indexed oldFeeProvider, IFeeProvider indexed newFeeProvider);\\n\\n /// @notice Emitted when maxLiquidable (liquidation cap) is updated\\n event MaxLiquidableUpdated(uint256 oldMaxLiquidable, uint256 newMaxLiquidable);\\n\\n /// @notice Emitted when a position is liquidated\\n event PositionLiquidated(\\n address indexed liquidator,\\n address indexed account,\\n ISyntheticToken indexed syntheticToken,\\n uint256 amountRepaid,\\n uint256 depositSeized,\\n uint256 fee\\n );\\n\\n /// @notice Emitted when rewards distributor contract is added\\n event RewardsDistributorAdded(IRewardsDistributor indexed _distributor);\\n\\n /// @notice Emitted when rewards distributor contract is removed\\n event RewardsDistributorRemoved(IRewardsDistributor _distributor);\\n\\n /// @notice Emitted when SmartFarmingManager contract is updated\\n event SmartFarmingManagerUpdated(\\n ISmartFarmingManager oldSmartFarmingManager,\\n ISmartFarmingManager newSmartFarmingManager\\n );\\n\\n /// @notice Emitted when the swap active flag is updated\\n event SwapActiveUpdated(bool newActive);\\n\\n /// @notice Emitted when synthetic token is swapped\\n event SyntheticTokenSwapped(\\n address indexed account,\\n ISyntheticToken indexed syntheticTokenIn,\\n ISyntheticToken indexed syntheticTokenOut,\\n uint256 amountIn,\\n uint256 amountOut,\\n uint256 fee\\n );\\n\\n /// @notice Emitted when treasury contract is updated\\n event TreasuryUpdated(ITreasury indexed oldTreasury, ITreasury indexed newTreasury);\\n\\n /**\\n * @dev Throws if token addition will reach the `account_`'s max\\n */\\n modifier onlyIfAdditionWillNotReachMaxTokens(address account_) {\\n if (debtTokensOfAccount.length(account_) + depositTokensOfAccount.length(account_) >= MAX_TOKENS_PER_USER) {\\n revert UserReachedMaxTokens();\\n }\\n _;\\n }\\n\\n /**\\n * @dev Throws if deposit token doesn't exist\\n */\\n modifier onlyIfDepositTokenExists(IDepositToken depositToken_) {\\n if (!doesDepositTokenExist(depositToken_)) revert DepositTokenDoesNotExist();\\n _;\\n }\\n\\n /**\\n * @dev Throws if synthetic token doesn't exist\\n */\\n modifier onlyIfSyntheticTokenExists(ISyntheticToken syntheticToken_) {\\n if (!doesSyntheticTokenExist(syntheticToken_)) revert SyntheticDoesNotExist();\\n _;\\n }\\n\\n /**\\n * @dev Throws if `msg.sender` isn't a debt token\\n */\\n modifier onlyIfMsgSenderIsDebtToken() {\\n if (!doesDebtTokenExist(IDebtToken(msg.sender))) revert SenderIsNotDebtToken();\\n _;\\n }\\n\\n /**\\n * @dev Throws if `msg.sender` isn't a deposit token\\n */\\n modifier onlyIfMsgSenderIsDepositToken() {\\n if (!doesDepositTokenExist(IDepositToken(msg.sender))) revert SenderIsNotDepositToken();\\n _;\\n }\\n\\n constructor() {\\n _disableInitializers();\\n }\\n\\n function initialize(IPoolRegistry poolRegistry_) public initializer {\\n if (address(poolRegistry_) == address(0)) revert PoolRegistryIsNull();\\n __ReentrancyGuard_init();\\n __Pauseable_init();\\n\\n poolRegistry = poolRegistry_;\\n isSwapActive = true;\\n maxLiquidable = 0.5e18; // 50%\\n }\\n\\n /**\\n * @notice Add a debt token to the per-account list\\n * @dev This function is called from `DebtToken` when user's balance changes from `0`\\n * @dev The caller should ensure to not pass `address(0)` as `_account`\\n * @param account_ The account address\\n */\\n function addToDebtTokensOfAccount(\\n address account_\\n ) external onlyIfMsgSenderIsDebtToken onlyIfAdditionWillNotReachMaxTokens(account_) {\\n if (!debtTokensOfAccount.add(account_, msg.sender)) revert DebtTokenAlreadyExists();\\n }\\n\\n /**\\n * @notice Add a deposit token to the per-account list\\n * @dev This function is called from `DepositToken` when user's balance changes from `0`\\n * @dev The caller should ensure to not pass `address(0)` as `_account`\\n * @param account_ The account address\\n */\\n function addToDepositTokensOfAccount(\\n address account_\\n ) external onlyIfMsgSenderIsDepositToken onlyIfAdditionWillNotReachMaxTokens(account_) {\\n if (!depositTokensOfAccount.add(account_, msg.sender)) revert DepositTokenAlreadyExists();\\n }\\n\\n /**\\n * @notice Get account's debt by querying latest prices from oracles\\n * @param account_ The account to check\\n * @return _debtInUsd The debt value in USD\\n */\\n function debtOf(address account_) public view override returns (uint256 _debtInUsd) {\\n IMasterOracle _masterOracle = masterOracle();\\n uint256 _length = debtTokensOfAccount.length(account_);\\n for (uint256 i; i < _length; ++i) {\\n IDebtToken _debtToken = IDebtToken(debtTokensOfAccount.at(account_, i));\\n _debtInUsd += _masterOracle.quoteTokenToUsd(\\n address(_debtToken.syntheticToken()),\\n _debtToken.balanceOf(account_)\\n );\\n }\\n }\\n\\n /**\\n * @notice Returns whether the debt position from an account is healthy\\n * @param account_ The account to check\\n * @return _isHealthy Whether the account's position is healthy\\n * @return _depositInUsd The total collateral deposited in USD\\n * @return _debtInUsd The total debt in USD\\n * @return _issuableLimitInUsd The max amount of debt (is USD) that can be created (considering collateral factors)\\n * @return _issuableInUsd The amount of debt (is USD) that is free (i.e. can be used to issue synthetic tokens)\\n */\\n function debtPositionOf(\\n address account_\\n )\\n public\\n view\\n override\\n returns (\\n bool _isHealthy,\\n uint256 _depositInUsd,\\n uint256 _debtInUsd,\\n uint256 _issuableLimitInUsd,\\n uint256 _issuableInUsd\\n )\\n {\\n _debtInUsd = debtOf(account_);\\n (_depositInUsd, _issuableLimitInUsd) = depositOf(account_);\\n _isHealthy = _debtInUsd <= _issuableLimitInUsd;\\n _issuableInUsd = _debtInUsd < _issuableLimitInUsd ? _issuableLimitInUsd - _debtInUsd : 0;\\n }\\n\\n /**\\n * @notice Get account's total collateral deposited by querying latest prices from oracles\\n * @param account_ The account to check\\n * @return _depositInUsd The total deposit value in USD among all collaterals\\n * @return _issuableLimitInUsd The max value in USD that can be used to issue synthetic tokens\\n */\\n function depositOf(\\n address account_\\n ) public view override returns (uint256 _depositInUsd, uint256 _issuableLimitInUsd) {\\n IMasterOracle _masterOracle = masterOracle();\\n uint256 _length = depositTokensOfAccount.length(account_);\\n for (uint256 i; i < _length; ++i) {\\n IDepositToken _depositToken = IDepositToken(depositTokensOfAccount.at(account_, i));\\n uint256 _amountInUsd = _masterOracle.quoteTokenToUsd(\\n address(_depositToken.underlying()),\\n _depositToken.balanceOf(account_)\\n );\\n _depositInUsd += _amountInUsd;\\n _issuableLimitInUsd += _amountInUsd.wadMul(_depositToken.collateralFactor());\\n }\\n }\\n\\n /**\\n * @inheritdoc Pauseable\\n */\\n function everythingStopped() public view override(IPauseable, Pauseable) returns (bool) {\\n return super.everythingStopped() || poolRegistry.everythingStopped();\\n }\\n\\n /**\\n * @notice Returns fee collector address\\n */\\n function feeCollector() external view override returns (address) {\\n return poolRegistry.feeCollector();\\n }\\n\\n /**\\n * @notice Get all debt tokens\\n * @dev WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees.\\n */\\n function getDebtTokens() external view override returns (address[] memory) {\\n return debtTokens.values();\\n }\\n\\n /**\\n * @notice Get all debt tokens\\n * @dev WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees.\\n */\\n function getDebtTokensOfAccount(address account_) external view override returns (address[] memory) {\\n return debtTokensOfAccount.values(account_);\\n }\\n\\n /**\\n * @notice Get all deposit tokens\\n * @dev WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees.\\n */\\n function getDepositTokens() external view override returns (address[] memory) {\\n return depositTokens.values();\\n }\\n\\n /**\\n * @notice Get deposit tokens of an account\\n * @dev WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees.\\n */\\n function getDepositTokensOfAccount(address account_) external view override returns (address[] memory) {\\n return depositTokensOfAccount.values(account_);\\n }\\n\\n /**\\n * @notice Get all rewards distributors\\n */\\n function getRewardsDistributors() external view override returns (address[] memory) {\\n return rewardsDistributors.values();\\n }\\n\\n /**\\n * @notice Check if token is part of the debt offerings\\n * @param debtToken_ Asset to check\\n * @return true if exist\\n */\\n function doesDebtTokenExist(IDebtToken debtToken_) public view override returns (bool) {\\n return debtTokens.contains(address(debtToken_));\\n }\\n\\n /**\\n * @notice Check if collateral is supported\\n * @param depositToken_ Asset to check\\n * @return true if exist\\n */\\n function doesDepositTokenExist(IDepositToken depositToken_) public view override returns (bool) {\\n return depositTokens.contains(address(depositToken_));\\n }\\n\\n /**\\n * @notice Check if token is part of the synthetic offerings\\n * @param syntheticToken_ Asset to check\\n * @return true if exist\\n */\\n function doesSyntheticTokenExist(ISyntheticToken syntheticToken_) public view override returns (bool) {\\n return address(debtTokenOf[syntheticToken_]) != address(0);\\n }\\n\\n /**\\n * @notice Quote synth `_amountToRepay` in order to seize `totalToSeized_`\\n * @param syntheticToken_ Synth for repayment\\n * @param totalToSeize_ Collateral total amount to size\\n * @param depositToken_ Collateral's deposit token\\n * @return _amountToRepay Synth amount to burn\\n * @return _toLiquidator Seized amount to the liquidator\\n * @return _fee The fee amount to collect\\n */\\n function quoteLiquidateIn(\\n ISyntheticToken syntheticToken_,\\n uint256 totalToSeize_,\\n IDepositToken depositToken_\\n ) public view override returns (uint256 _amountToRepay, uint256 _toLiquidator, uint256 _fee) {\\n (uint128 _liquidatorIncentive, uint128 _protocolFee) = feeProvider.liquidationFees();\\n uint256 _totalFees = _protocolFee + _liquidatorIncentive;\\n uint256 _repayAmountInCollateral = totalToSeize_;\\n\\n if (_totalFees > 0) {\\n _repayAmountInCollateral = _repayAmountInCollateral.wadDiv(1e18 + _totalFees);\\n }\\n\\n _amountToRepay = masterOracle().quote(\\n address(depositToken_.underlying()),\\n address(syntheticToken_),\\n _repayAmountInCollateral\\n );\\n\\n if (_protocolFee > 0) {\\n _fee = _repayAmountInCollateral.wadMul(_protocolFee);\\n }\\n\\n if (_liquidatorIncentive > 0) {\\n _toLiquidator = _repayAmountInCollateral.wadMul(1e18 + _liquidatorIncentive);\\n }\\n }\\n\\n /**\\n * @notice Quote max allowed synth to repay\\n * @dev I.e. Considers the min amount between collateral's balance and `maxLiquidable` param\\n * @param syntheticToken_ Synth for repayment\\n * @param account_ The account to liquidate\\n * @param depositToken_ Collateral's deposit token\\n * @return _maxAmountToRepay Synth amount to burn\\n */\\n function quoteLiquidateMax(\\n ISyntheticToken syntheticToken_,\\n address account_,\\n IDepositToken depositToken_\\n ) external view override returns (uint256 _maxAmountToRepay) {\\n (bool _isHealthy, , , , ) = debtPositionOf(account_);\\n if (_isHealthy) {\\n return 0;\\n }\\n\\n (uint256 _amountToRepay, , ) = quoteLiquidateIn(\\n syntheticToken_,\\n depositToken_.balanceOf(account_),\\n depositToken_\\n );\\n\\n _maxAmountToRepay = debtTokenOf[syntheticToken_].balanceOf(account_).wadMul(maxLiquidable);\\n\\n if (_amountToRepay < _maxAmountToRepay) {\\n _maxAmountToRepay = _amountToRepay;\\n }\\n }\\n\\n /**\\n * @notice Quote collateral `totalToSeized_` by repaying `amountToRepay_`\\n * @param syntheticToken_ Synth for repayment\\n * @param amountToRepay_ Synth amount to burn\\n * @param depositToken_ Collateral's deposit token\\n * @return _totalToSeize Collateral total amount to size\\n * @return _toLiquidator Seized amount to the liquidator\\n * @return _fee The fee amount to collect\\n */\\n function quoteLiquidateOut(\\n ISyntheticToken syntheticToken_,\\n uint256 amountToRepay_,\\n IDepositToken depositToken_\\n ) public view override returns (uint256 _totalToSeize, uint256 _toLiquidator, uint256 _fee) {\\n _toLiquidator = masterOracle().quote(\\n address(syntheticToken_),\\n address(depositToken_.underlying()),\\n amountToRepay_\\n );\\n\\n (uint128 _liquidatorIncentive, uint128 _protocolFee) = feeProvider.liquidationFees();\\n\\n if (_protocolFee > 0) {\\n _fee = _toLiquidator.wadMul(_protocolFee);\\n }\\n if (_liquidatorIncentive > 0) {\\n _toLiquidator += _toLiquidator.wadMul(_liquidatorIncentive);\\n }\\n\\n _totalToSeize = _fee + _toLiquidator;\\n }\\n\\n /**\\n * @notice Quote `_amountIn` to get `amountOut_`\\n * @param syntheticTokenIn_ Synth in\\n * @param syntheticTokenOut_ Synth out\\n * @param amountOut_ Amount out\\n * @return _amountIn Amount in\\n * @return _fee Fee to charge in `syntheticTokenOut_`\\n */\\n function quoteSwapIn(\\n ISyntheticToken syntheticTokenIn_,\\n ISyntheticToken syntheticTokenOut_,\\n uint256 amountOut_\\n ) external view override returns (uint256 _amountIn, uint256 _fee) {\\n uint256 _swapFee = feeProvider.swapFeeFor(msg.sender);\\n if (_swapFee > 0) {\\n amountOut_ = amountOut_.wadDiv(1e18 - _swapFee);\\n _fee = amountOut_.wadMul(_swapFee);\\n }\\n\\n _amountIn = poolRegistry.masterOracle().quote(\\n address(syntheticTokenOut_),\\n address(syntheticTokenIn_),\\n amountOut_\\n );\\n }\\n\\n /**\\n * @notice Quote `amountOut_` get from `amountIn_`\\n * @param syntheticTokenIn_ Synth in\\n * @param syntheticTokenOut_ Synth out\\n * @param amountIn_ Amount in\\n * @return _amountOut Amount out\\n * @return _fee Fee to charge in `syntheticTokenOut_`\\n */\\n function quoteSwapOut(\\n ISyntheticToken syntheticTokenIn_,\\n ISyntheticToken syntheticTokenOut_,\\n uint256 amountIn_\\n ) public view override returns (uint256 _amountOut, uint256 _fee) {\\n _amountOut = poolRegistry.masterOracle().quote(\\n address(syntheticTokenIn_),\\n address(syntheticTokenOut_),\\n amountIn_\\n );\\n\\n uint256 _swapFee = feeProvider.swapFeeFor(msg.sender);\\n if (_swapFee > 0) {\\n _fee = _amountOut.wadMul(_swapFee);\\n _amountOut -= _fee;\\n }\\n }\\n\\n /**\\n * @notice Burn synthetic token, unlock deposit token and send liquidator incentive\\n * @param syntheticToken_ The msAsset to use for repayment\\n * @param account_ The account with an unhealthy position\\n * @param amountToRepay_ The amount to repay in synthetic token\\n * @param depositToken_ The collateral to seize from\\n * @return _totalSeized Total deposit amount seized from the liquidated account\\n * @return _toLiquidator Share of `_totalSeized` sent to the liquidator\\n * @return _fee Share of `_totalSeized` collected as fee\\n */\\n function liquidate(\\n ISyntheticToken syntheticToken_,\\n address account_,\\n uint256 amountToRepay_,\\n IDepositToken depositToken_\\n )\\n external\\n override\\n whenNotShutdown\\n nonReentrant\\n onlyIfSyntheticTokenExists(syntheticToken_)\\n onlyIfDepositTokenExists(depositToken_)\\n returns (uint256 _totalSeized, uint256 _toLiquidator, uint256 _fee)\\n {\\n if (amountToRepay_ == 0) revert AmountIsZero();\\n if (msg.sender == account_) revert CanNotLiquidateOwnPosition();\\n\\n IDebtToken _debtToken = debtTokenOf[syntheticToken_];\\n _debtToken.accrueInterest();\\n\\n (bool _isHealthy, , , , ) = debtPositionOf(account_);\\n\\n if (_isHealthy) {\\n revert PositionIsHealthy();\\n }\\n\\n uint256 _debtTokenBalance = _debtToken.balanceOf(account_);\\n\\n if (amountToRepay_.wadDiv(_debtTokenBalance) > maxLiquidable) {\\n revert AmountGreaterThanMaxLiquidable();\\n }\\n\\n IMasterOracle _masterOracle = masterOracle();\\n\\n if (debtFloorInUsd > 0) {\\n uint256 _newDebtInUsd = _masterOracle.quoteTokenToUsd(\\n address(syntheticToken_),\\n _debtTokenBalance - amountToRepay_\\n );\\n if (_newDebtInUsd > 0 && _newDebtInUsd < debtFloorInUsd) {\\n revert RemainingDebtIsLowerThanTheFloor();\\n }\\n }\\n\\n (_totalSeized, _toLiquidator, _fee) = quoteLiquidateOut(syntheticToken_, amountToRepay_, depositToken_);\\n\\n if (_totalSeized > depositToken_.balanceOf(account_)) {\\n revert AmountIsTooHigh();\\n }\\n\\n syntheticToken_.burn(msg.sender, amountToRepay_);\\n _debtToken.burn(account_, amountToRepay_);\\n depositToken_.seize(account_, msg.sender, _toLiquidator);\\n\\n if (_fee > 0) {\\n depositToken_.seize(account_, poolRegistry.feeCollector(), _fee);\\n }\\n\\n emit PositionLiquidated(msg.sender, account_, syntheticToken_, amountToRepay_, _totalSeized, _fee);\\n }\\n\\n /**\\n * @notice Get MasterOracle contract\\n */\\n function masterOracle() public view override returns (IMasterOracle) {\\n return poolRegistry.masterOracle();\\n }\\n\\n /**\\n * @inheritdoc Pauseable\\n */\\n function paused() public view override(IPauseable, Pauseable) returns (bool) {\\n return super.paused() || poolRegistry.paused();\\n }\\n\\n /**\\n * @notice Remove a debt token from the per-account list\\n * @dev This function is called from `DebtToken` when user's balance changes to `0`\\n * @dev The caller should ensure to not pass `address(0)` as `_account`\\n * @param account_ The account address\\n */\\n function removeFromDebtTokensOfAccount(address account_) external onlyIfMsgSenderIsDebtToken {\\n if (!debtTokensOfAccount.remove(account_, msg.sender)) revert DebtTokenDoesNotExist();\\n }\\n\\n /**\\n * @notice Remove a deposit token from the per-account list\\n * @dev This function is called from `DepositToken` when user's balance changes to `0`\\n * @dev The caller should ensure to not pass `address(0)` as `_account`\\n * @param account_ The account address\\n */\\n function removeFromDepositTokensOfAccount(address account_) external onlyIfMsgSenderIsDepositToken {\\n if (!depositTokensOfAccount.remove(account_, msg.sender)) revert DepositTokenDoesNotExist();\\n }\\n\\n /**\\n * @notice Swap synthetic tokens\\n * @param syntheticTokenIn_ Synthetic token to sell\\n * @param syntheticTokenOut_ Synthetic token to buy\\n * @param amountIn_ Amount to swap\\n */\\n function swap(\\n ISyntheticToken syntheticTokenIn_,\\n ISyntheticToken syntheticTokenOut_,\\n uint256 amountIn_\\n )\\n external\\n override\\n whenNotShutdown\\n nonReentrant\\n onlyIfSyntheticTokenExists(syntheticTokenIn_)\\n onlyIfSyntheticTokenExists(syntheticTokenOut_)\\n returns (uint256 _amountOut, uint256 _fee)\\n {\\n if (!isSwapActive) revert SwapFeatureIsInactive();\\n if (amountIn_ == 0 || amountIn_ > syntheticTokenIn_.balanceOf(msg.sender)) revert AmountInIsInvalid();\\n\\n syntheticTokenIn_.burn(msg.sender, amountIn_);\\n\\n (_amountOut, _fee) = quoteSwapOut(syntheticTokenIn_, syntheticTokenOut_, amountIn_);\\n\\n if (_fee > 0) {\\n syntheticTokenOut_.mint(poolRegistry.feeCollector(), _fee);\\n }\\n\\n syntheticTokenOut_.mint(msg.sender, _amountOut);\\n\\n emit SyntheticTokenSwapped(msg.sender, syntheticTokenIn_, syntheticTokenOut_, amountIn_, _amountOut, _fee);\\n }\\n\\n /**\\n * @notice Add debt token to offerings\\n * @dev Must keep `debtTokenOf` mapping updated\\n */\\n function addDebtToken(IDebtToken debtToken_) external onlyGovernor {\\n if (address(debtToken_) == address(0)) revert AddressIsNull();\\n ISyntheticToken _syntheticToken = debtToken_.syntheticToken();\\n if (address(_syntheticToken) == address(0)) revert SyntheticIsNull();\\n if (address(debtTokenOf[_syntheticToken]) != address(0)) revert SyntheticIsInUse();\\n\\n if (!debtTokens.add(address(debtToken_))) revert DebtTokenAlreadyExists();\\n\\n debtTokenOf[_syntheticToken] = debtToken_;\\n\\n emit DebtTokenAdded(debtToken_);\\n }\\n\\n /**\\n * @notice Add deposit token (i.e. collateral) to Synth\\n */\\n function addDepositToken(address depositToken_) external onlyGovernor {\\n if (depositToken_ == address(0)) revert AddressIsNull();\\n IERC20 _underlying = IDepositToken(depositToken_).underlying();\\n if (address(depositTokenOf[_underlying]) != address(0)) revert UnderlyingAssetInUse();\\n // Note: Fee collector collects deposit tokens as fee\\n if (depositTokens.length() >= MAX_TOKENS_PER_USER) revert ReachedMaxDepositTokens();\\n\\n if (!depositTokens.add(depositToken_)) revert DepositTokenAlreadyExists();\\n\\n depositTokenOf[_underlying] = IDepositToken(depositToken_);\\n\\n emit DepositTokenAdded(depositToken_);\\n }\\n\\n /**\\n * @notice Add a RewardsDistributor contract\\n */\\n function addRewardsDistributor(IRewardsDistributor distributor_) external onlyGovernor {\\n if (address(distributor_) == address(0)) revert AddressIsNull();\\n if (!rewardsDistributors.add(address(distributor_))) revert RewardDistributorAlreadyExists();\\n emit RewardsDistributorAdded(distributor_);\\n }\\n\\n /**\\n * @notice Remove debt token from offerings\\n * @dev Must keep `debtTokenOf` mapping updated\\n */\\n function removeDebtToken(IDebtToken debtToken_) external onlyGovernor {\\n if (debtToken_.totalSupply() > 0) revert TotalSupplyIsNotZero();\\n if (!debtTokens.remove(address(debtToken_))) revert DebtTokenDoesNotExist();\\n\\n delete debtTokenOf[debtToken_.syntheticToken()];\\n\\n emit DebtTokenRemoved(debtToken_);\\n }\\n\\n /**\\n * @notice Remove deposit token (i.e. collateral) from Synth\\n */\\n function removeDepositToken(IDepositToken depositToken_) external onlyGovernor {\\n if (depositToken_.totalSupply() > 0) revert TotalSupplyIsNotZero();\\n\\n if (!depositTokens.remove(address(depositToken_))) revert DepositTokenDoesNotExist();\\n delete depositTokenOf[depositToken_.underlying()];\\n\\n emit DepositTokenRemoved(depositToken_);\\n }\\n\\n /**\\n * @notice Remove a RewardsDistributor contract\\n */\\n function removeRewardsDistributor(IRewardsDistributor distributor_) external onlyGovernor {\\n if (address(distributor_) == address(0)) revert AddressIsNull();\\n if (!rewardsDistributors.remove(address(distributor_))) revert RewardDistributorDoesNotExist();\\n\\n emit RewardsDistributorRemoved(distributor_);\\n }\\n\\n /**\\n * @notice Turn swap on/off\\n */\\n function toggleIsSwapActive() external onlyGovernor {\\n bool _newIsSwapActive = !isSwapActive;\\n emit SwapActiveUpdated(_newIsSwapActive);\\n isSwapActive = _newIsSwapActive;\\n }\\n\\n /**\\n * @notice Update debt floor\\n */\\n function updateDebtFloor(uint256 newDebtFloorInUsd_) external onlyGovernor {\\n uint256 _currentDebtFloorInUsd = debtFloorInUsd;\\n if (newDebtFloorInUsd_ == _currentDebtFloorInUsd) revert NewValueIsSameAsCurrent();\\n emit DebtFloorUpdated(_currentDebtFloorInUsd, newDebtFloorInUsd_);\\n debtFloorInUsd = newDebtFloorInUsd_;\\n }\\n\\n /**\\n * @notice Update maxLiquidable (liquidation cap)\\n */\\n function updateMaxLiquidable(uint256 newMaxLiquidable_) external onlyGovernor {\\n if (newMaxLiquidable_ > 1e18) revert MaxLiquidableTooHigh();\\n uint256 _currentMaxLiquidable = maxLiquidable;\\n if (newMaxLiquidable_ == _currentMaxLiquidable) revert NewValueIsSameAsCurrent();\\n emit MaxLiquidableUpdated(_currentMaxLiquidable, newMaxLiquidable_);\\n maxLiquidable = newMaxLiquidable_;\\n }\\n\\n /**\\n * @notice Update treasury contract - will migrate funds to the new contract\\n */\\n function updateTreasury(ITreasury newTreasury_) external onlyGovernor {\\n if (address(newTreasury_) == address(0)) revert AddressIsNull();\\n ITreasury _currentTreasury = treasury;\\n if (newTreasury_ == _currentTreasury) revert NewValueIsSameAsCurrent();\\n\\n if (address(_currentTreasury) != address(0)) {\\n _currentTreasury.migrateTo(address(newTreasury_));\\n }\\n\\n emit TreasuryUpdated(_currentTreasury, newTreasury_);\\n treasury = newTreasury_;\\n }\\n\\n /**\\n * @notice Update FeeProvider contract\\n */\\n function updateFeeProvider(IFeeProvider feeProvider_) external onlyGovernor {\\n if (address(feeProvider_) == address(0)) revert AddressIsNull();\\n IFeeProvider _current = feeProvider;\\n if (feeProvider_ == _current) revert NewValueIsSameAsCurrent();\\n emit FeeProviderUpdated(_current, feeProvider_);\\n feeProvider = feeProvider_;\\n }\\n\\n /**\\n * @notice Update SmartFarmingManager contract\\n */\\n function updateSmartFarmingManager(ISmartFarmingManager newSmartFarmingManager_) external onlyGovernor {\\n if (address(newSmartFarmingManager_) == address(0)) revert AddressIsNull();\\n ISmartFarmingManager _current = smartFarmingManager;\\n if (newSmartFarmingManager_ == _current) revert NewValueIsSameAsCurrent();\\n\\n emit SmartFarmingManagerUpdated(_current, newSmartFarmingManager_);\\n smartFarmingManager = newSmartFarmingManager_;\\n }\\n\\n /**\\n * @notice Pause/Unpause bridge transfers\\n */\\n function toggleBridgingIsActive() external onlyGovernor {\\n bool _newIsBridgingActive = !isBridgingActive;\\n emit BridgingIsActiveUpdated(_newIsBridgingActive);\\n isBridgingActive = _newIsBridgingActive;\\n }\\n}\\n\",\"keccak256\":\"0xd7f4c2937e58f6183c1840f49f2e763044c57bfc9a0e89f5429f7ebb058a8c25\",\"license\":\"MIT\"},\"contracts/access/Governable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/openzeppelin-upgradeable/proxy/utils/Initializable.sol\\\";\\nimport \\\"../utils/TokenHolder.sol\\\";\\nimport \\\"../interfaces/IGovernable.sol\\\";\\n\\nerror SenderIsNotGovernor();\\nerror ProposedGovernorIsNull();\\nerror SenderIsNotTheProposedGovernor();\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (governor) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the governor account will be the one that deploys the contract. This\\n * can later be changed with {transferGovernorship}.\\n *\\n */\\nabstract contract Governable is IGovernable, TokenHolder, Initializable {\\n /**\\n * @notice The governor\\n * @dev By default the contract deployer is the initial governor\\n */\\n address public governor;\\n\\n /**\\n * @notice The proposed governor\\n * @dev It will be empty (address(0)) if there isn't a proposed governor\\n */\\n address public proposedGovernor;\\n\\n event UpdatedGovernor(address indexed previousGovernor, address indexed proposedGovernor);\\n\\n constructor() {\\n governor = msg.sender;\\n emit UpdatedGovernor(address(0), msg.sender);\\n }\\n\\n /**\\n * @dev If inheriting child is using proxy then child contract can use\\n * __Governable_init() function to initialization this contract\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function __Governable_init() internal onlyInitializing {\\n governor = msg.sender;\\n emit UpdatedGovernor(address(0), msg.sender);\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the governor.\\n */\\n modifier onlyGovernor() {\\n if (governor != msg.sender) revert SenderIsNotGovernor();\\n _;\\n }\\n\\n /// @inheritdoc TokenHolder\\n // solhint-disable-next-line no-empty-blocks\\n function _requireCanSweep() internal view override onlyGovernor {}\\n\\n /**\\n * @notice Transfers governorship of the contract to a new account (`proposedGovernor`).\\n * @dev Can only be called by the current owner.\\n * @param proposedGovernor_ The new proposed governor\\n */\\n function transferGovernorship(address proposedGovernor_) external onlyGovernor {\\n if (proposedGovernor_ == address(0)) revert ProposedGovernorIsNull();\\n proposedGovernor = proposedGovernor_;\\n }\\n\\n /**\\n * @notice Allows new governor to accept governorship of the contract.\\n */\\n function acceptGovernorship() external {\\n address _proposedGovernor = proposedGovernor;\\n if (msg.sender != _proposedGovernor) revert SenderIsNotTheProposedGovernor();\\n emit UpdatedGovernor(governor, _proposedGovernor);\\n governor = _proposedGovernor;\\n proposedGovernor = address(0);\\n }\\n}\\n\",\"keccak256\":\"0xbe892a132fcf0794df788324b569bc3eca8dde2e66f860bdb4aa3a2483d07988\",\"license\":\"MIT\"},\"contracts/dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/IOFTCoreUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../../../../openzeppelin-upgradeable/utils/introspection/IERC165Upgradeable.sol\\\";\\n\\n/**\\n * @dev Interface of the IOFT core standard\\n */\\ninterface IOFTCoreUpgradeable is IERC165Upgradeable {\\n /**\\n * @dev estimate send token `_tokenId` to (`_dstChainId`, `_toAddress`)\\n * _dstChainId - L0 defined chain id to send tokens too\\n * _toAddress - dynamic bytes array which contains the address to whom you are sending tokens to on the dstChain\\n * _amount - amount of the tokens to transfer\\n * _useZro - indicates to use zro to pay L0 fees\\n * _adapterParam - flexible bytes array to indicate messaging adapter services in L0\\n */\\n function estimateSendFee(\\n uint16 _dstChainId,\\n bytes calldata _toAddress,\\n uint _amount,\\n bool _useZro,\\n bytes calldata _adapterParams\\n ) external view returns (uint nativeFee, uint zroFee);\\n\\n /**\\n * @dev send `_amount` amount of token to (`_dstChainId`, `_toAddress`) from `_from`\\n * `_from` the owner of token\\n * `_dstChainId` the destination chain identifier\\n * `_toAddress` can be any size depending on the `dstChainId`.\\n * `_amount` the quantity of tokens in wei\\n * `_refundAddress` the address LayerZero refunds if too much message fee is sent\\n * `_zroPaymentAddress` set to address(0x0) if not paying in ZRO (LayerZero Token)\\n * `_adapterParams` is a flexible bytes array to indicate messaging adapter services\\n */\\n function sendFrom(\\n address _from,\\n uint16 _dstChainId,\\n bytes calldata _toAddress,\\n uint _amount,\\n address payable _refundAddress,\\n address _zroPaymentAddress,\\n bytes calldata _adapterParams\\n ) external payable;\\n\\n /**\\n * @dev returns the circulating amount of tokens on current chain\\n */\\n function circulatingSupply() external view returns (uint);\\n\\n /**\\n * @dev returns the address of the ERC20 token\\n */\\n function token() external view returns (address);\\n\\n /**\\n * @dev Emitted when `_amount` tokens are moved from the `_sender` to (`_dstChainId`, `_toAddress`)\\n * `_nonce` is the outbound nonce\\n */\\n event SendToChain(uint16 indexed _dstChainId, address indexed _from, bytes _toAddress, uint _amount);\\n\\n /**\\n * @dev Emitted when `_amount` tokens are received from `_srcChainId` into the `_toAddress` on the local chain.\\n * `_nonce` is the inbound nonce.\\n */\\n event ReceiveFromChain(uint16 indexed _srcChainId, address indexed _to, uint _amount);\\n\\n event SetUseCustomAdapterParams(bool _useCustomAdapterParams);\\n}\\n\",\"keccak256\":\"0x22651924296f8308db8195d7a86a6781023241c53905418f2d3925e3f693f530\",\"license\":\"MIT\"},\"contracts/dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/composable/IComposableOFTCoreUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.5.0;\\n\\nimport \\\"../IOFTCoreUpgradeable.sol\\\";\\n\\n/**\\n * @dev Interface of the composable OFT core standard\\n */\\ninterface IComposableOFTCoreUpgradeable is IOFTCoreUpgradeable {\\n function estimateSendAndCallFee(\\n uint16 _dstChainId,\\n bytes calldata _toAddress,\\n uint _amount,\\n bytes calldata _payload,\\n uint64 _dstGasForCall,\\n bool _useZro,\\n bytes calldata _adapterParams\\n ) external view returns (uint nativeFee, uint zroFee);\\n\\n function sendAndCall(\\n address _from,\\n uint16 _dstChainId,\\n bytes calldata _toAddress,\\n uint _amount,\\n bytes calldata _payload,\\n uint64 _dstGasForCall,\\n address payable _refundAddress,\\n address _zroPaymentAddress,\\n bytes calldata _adapterParams\\n ) external payable;\\n\\n function retryOFTReceived(\\n uint16 _srcChainId,\\n bytes calldata _srcAddress,\\n uint64 _nonce,\\n bytes calldata _from,\\n address _to,\\n uint _amount,\\n bytes calldata _payload\\n ) external;\\n\\n event CallOFTReceivedFailure(\\n uint16 indexed _srcChainId,\\n bytes _srcAddress,\\n uint64 _nonce,\\n bytes _from,\\n address indexed _to,\\n uint _amount,\\n bytes _payload,\\n bytes _reason\\n );\\n\\n event CallOFTReceivedSuccess(uint16 indexed _srcChainId, bytes _srcAddress, uint64 _nonce, bytes32 _hash);\\n\\n event RetryOFTReceivedSuccess(bytes32 _messageHash);\\n\\n event NonContractAddress(address _address);\\n}\\n\",\"keccak256\":\"0x769b9356ad6019bdabdcfc11762f28d15eb9a4e262efc96835725f6862c5d9e9\",\"license\":\"MIT\"},\"contracts/dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/composable/IOFTReceiverUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.5.0;\\n\\ninterface IOFTReceiverUpgradeable {\\n /**\\n * @dev Called by the OFT contract when tokens are received from source chain.\\n * @param _srcChainId The chain id of the source chain.\\n * @param _srcAddress The address of the OFT token contract on the source chain.\\n * @param _nonce The nonce of the transaction on the source chain.\\n * @param _from The address of the account who calls the sendAndCall() on the source chain.\\n * @param _amount The amount of tokens to transfer.\\n * @param _payload Additional data with no specified format.\\n */\\n function onOFTReceived(\\n uint16 _srcChainId,\\n bytes calldata _srcAddress,\\n uint64 _nonce,\\n bytes calldata _from,\\n uint _amount,\\n bytes calldata _payload\\n ) external;\\n}\\n\",\"keccak256\":\"0x287036c704c57e34a6fc3f7e67c8dfaaade6eb3667b570576bc491c0f1f89a5b\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.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 * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\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. Equivalent to `reinitializer(1)`.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = _setInitializedVersion(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 * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original\\n * initialization step. This is essential to configure modules that are added through upgrades and that require\\n * initialization.\\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 modifier reinitializer(uint8 version) {\\n bool isTopLevelCall = _setInitializedVersion(version);\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(version);\\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} 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 function _disableInitializers() internal virtual {\\n _setInitializedVersion(type(uint8).max);\\n }\\n\\n function _setInitializedVersion(uint8 version) private returns (bool) {\\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, and for the lowest level\\n // of initializers, because in other contexts the contract may have been reentered.\\n if (_initializing) {\\n require(\\n version == 1 && !AddressUpgradeable.isContract(address(this)),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n return false;\\n } else {\\n require(_initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n return true;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x7454006cccb737612b00104d2f606d728e2818b778e7e55542f063c614ce46ba\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin-upgradeable/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.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 *\\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 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\":\"0x55cf2bd9fc76704ddcdc19834cd288b7de00fc0f298a40ea16a954ae8991db2d\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin-upgradeable/utils/introspection/IERC165Upgradeable.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 IERC165Upgradeable {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0xc6cef87559d0aeffdf0a99803de655938a7779ec0a3cd5d4383483ad85565a09\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\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 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 `recipient`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address recipient, 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 `sender` to `recipient` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address sender,\\n address recipient,\\n uint256 amount\\n ) external returns (bool);\\n\\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\",\"keccak256\":\"0x027b891937d20ccf213fdb9c31531574256de774bda99d3a70ecef6e1913ed2a\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\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\":\"0x83fe24f5c04a56091e50f4a345ff504c8bff658a76d4c43b16878c8f940c53b2\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin/token/ERC20/utils/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\nimport \\\"../../../utils/Address.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n using Address for address;\\n\\n function safeTransfer(\\n IERC20 token,\\n address to,\\n uint256 value\\n ) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n function safeTransferFrom(\\n IERC20 token,\\n address from,\\n address to,\\n uint256 value\\n ) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\\n }\\n\\n /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\n */\\n function safeApprove(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n // safeApprove should only be called when setting an initial allowance,\\n // or when resetting it to zero. To increase and decrease it, use\\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\\n require(\\n (value == 0) || (token.allowance(address(this), spender) == 0),\\n \\\"SafeERC20: approve from non-zero to non-zero allowance\\\"\\n );\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\\n }\\n\\n function safeIncreaseAllowance(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n uint256 newAllowance = token.allowance(address(this), spender) + value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n unchecked {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n require(oldAllowance >= value, \\\"SafeERC20: decreased allowance below zero\\\");\\n uint256 newAllowance = oldAllowance - value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\n if (returndata.length > 0) {\\n // Return data is optional\\n require(abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0x02348b2e4b9f3200c7e3907c5c2661643a6d8520e9f79939fbb9b4005a54894d\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.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\":\"0x2ccf9d2313a313d41a791505f2b5abfdc62191b5d4334f7f7a82691c088a1c87\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin/utils/structs/EnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (utils/structs/EnumerableSet.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for managing\\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\\n * types.\\n *\\n * Sets have the following properties:\\n *\\n * - Elements are added, removed, and checked for existence in constant time\\n * (O(1)).\\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\\n *\\n * ```\\n * contract Example {\\n * // Add the library methods\\n * using EnumerableSet for EnumerableSet.AddressSet;\\n *\\n * // Declare a set state variable\\n * EnumerableSet.AddressSet private mySet;\\n * }\\n * ```\\n *\\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\\n * and `uint256` (`UintSet`) are supported.\\n */\\nlibrary EnumerableSet {\\n // To implement this library for multiple types with as little code\\n // repetition as possible, we write it in terms of a generic Set type with\\n // bytes32 values.\\n // The Set implementation uses private functions, and user-facing\\n // implementations (such as AddressSet) are just wrappers around the\\n // underlying Set.\\n // This means that we can only create new EnumerableSets for types that fit\\n // in bytes32.\\n\\n struct Set {\\n // Storage of set values\\n bytes32[] _values;\\n // Position of the value in the `values` array, plus 1 because index 0\\n // means a value is not in the set.\\n mapping(bytes32 => uint256) _indexes;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function _add(Set storage set, bytes32 value) private returns (bool) {\\n if (!_contains(set, value)) {\\n set._values.push(value);\\n // The value is stored at length-1, but we add 1 to all indexes\\n // and use 0 as a sentinel value\\n set._indexes[value] = set._values.length;\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function _remove(Set storage set, bytes32 value) private returns (bool) {\\n // We read and store the value's index to prevent multiple reads from the same storage slot\\n uint256 valueIndex = set._indexes[value];\\n\\n if (valueIndex != 0) {\\n // Equivalent to contains(set, value)\\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\\n // the array, and then remove the last element (sometimes called as 'swap and pop').\\n // This modifies the order of the array, as noted in {at}.\\n\\n uint256 toDeleteIndex = valueIndex - 1;\\n uint256 lastIndex = set._values.length - 1;\\n\\n if (lastIndex != toDeleteIndex) {\\n bytes32 lastValue = set._values[lastIndex];\\n\\n // Move the last value to the index where the value to delete is\\n set._values[toDeleteIndex] = lastValue;\\n // Update the index for the moved value\\n set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex\\n }\\n\\n // Delete the slot where the moved value was stored\\n set._values.pop();\\n\\n // Delete the index for the deleted slot\\n delete set._indexes[value];\\n\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\\n return set._indexes[value] != 0;\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function _length(Set storage set) private view returns (uint256) {\\n return set._values.length;\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\\n return set._values[index];\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function _values(Set storage set) private view returns (bytes32[] memory) {\\n return set._values;\\n }\\n\\n // Bytes32Set\\n\\n struct Bytes32Set {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _add(set._inner, value);\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _remove(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\\n return _contains(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(Bytes32Set storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\\n return _at(set._inner, index);\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\\n return _values(set._inner);\\n }\\n\\n // AddressSet\\n\\n struct AddressSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(AddressSet storage set, address value) internal returns (bool) {\\n return _add(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(AddressSet storage set, address value) internal returns (bool) {\\n return _remove(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(AddressSet storage set, address value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(AddressSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\\n return address(uint160(uint256(_at(set._inner, index))));\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(AddressSet storage set) internal view returns (address[] memory) {\\n bytes32[] memory store = _values(set._inner);\\n address[] memory result;\\n\\n assembly {\\n result := store\\n }\\n\\n return result;\\n }\\n\\n // UintSet\\n\\n struct UintSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(UintSet storage set, uint256 value) internal returns (bool) {\\n return _add(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\\n return _remove(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function length(UintSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\\n return uint256(_at(set._inner, index));\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(UintSet storage set) internal view returns (uint256[] memory) {\\n bytes32[] memory store = _values(set._inner);\\n uint256[] memory result;\\n\\n assembly {\\n result := store\\n }\\n\\n return result;\\n }\\n}\\n\",\"keccak256\":\"0xacac2065b3ed1facff1163435890d4a6bcdc474e857e8e2c91ae5fb50418f723\",\"license\":\"MIT\"},\"contracts/dependencies/stargate-protocol/interfaces/IStargateComposer.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./IStargateRouter.sol\\\";\\n\\ninterface IStargateComposer {\\n function swap(\\n uint16 _dstChainId,\\n uint256 _srcPoolId,\\n uint256 _dstPoolId,\\n address payable _refundAddress,\\n uint256 _amountLD,\\n uint256 _minAmountLD,\\n IStargateRouter.lzTxObj memory _lzTxParams,\\n bytes calldata _to,\\n bytes calldata _payload\\n ) external payable;\\n\\n function factory() external view returns (address);\\n\\n function stargateBridge() external view returns (address);\\n\\n function stargateRouter() external view returns (IStargateRouter);\\n\\n function quoteLayerZeroFee(\\n uint16 _dstChainId,\\n uint8 _functionType,\\n bytes calldata _toAddress,\\n bytes calldata _transferAndCallPayload,\\n IStargateRouter.lzTxObj memory _lzTxParams\\n ) external view returns (uint256, uint256);\\n\\n function peers(uint16 _chainId) external view returns (address);\\n}\\n\",\"keccak256\":\"0xdfdd1690bf176ac05803534a60227be90cc435b4bdd8fce2348f1a9417a9f63a\",\"license\":\"BUSL-1.1\"},\"contracts/dependencies/stargate-protocol/interfaces/IStargateReceiver.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\n\\npragma solidity 0.8.9;\\n\\ninterface IStargateReceiver {\\n function sgReceive(\\n uint16 _chainId,\\n bytes memory _srcAddress,\\n uint256 _nonce,\\n address _token,\\n uint256 amountLD,\\n bytes memory payload\\n ) external;\\n}\\n\",\"keccak256\":\"0xe4d6bf9fa422e5e43dc1b6880f951d06611a4ed12c2dd7dd8c0b6a5d9e06ad0d\",\"license\":\"BUSL-1.1\"},\"contracts/dependencies/stargate-protocol/interfaces/IStargateRouter.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\n\\npragma solidity 0.8.9;\\n\\ninterface IStargateRouter {\\n struct lzTxObj {\\n uint256 dstGasForCall;\\n uint256 dstNativeAmount;\\n bytes dstNativeAddr;\\n }\\n\\n function addLiquidity(uint256 _poolId, uint256 _amountLD, address _to) external;\\n\\n function swap(\\n uint16 _dstChainId,\\n uint256 _srcPoolId,\\n uint256 _dstPoolId,\\n address payable _refundAddress,\\n uint256 _amountLD,\\n uint256 _minAmountLD,\\n lzTxObj memory _lzTxParams,\\n bytes calldata _to,\\n bytes calldata _payload\\n ) external payable;\\n\\n function redeemRemote(\\n uint16 _dstChainId,\\n uint256 _srcPoolId,\\n uint256 _dstPoolId,\\n address payable _refundAddress,\\n uint256 _amountLP,\\n uint256 _minAmountLD,\\n bytes calldata _to,\\n lzTxObj memory _lzTxParams\\n ) external payable;\\n\\n function instantRedeemLocal(uint16 _srcPoolId, uint256 _amountLP, address _to) external returns (uint256);\\n\\n function redeemLocal(\\n uint16 _dstChainId,\\n uint256 _srcPoolId,\\n uint256 _dstPoolId,\\n address payable _refundAddress,\\n uint256 _amountLP,\\n bytes calldata _to,\\n lzTxObj memory _lzTxParams\\n ) external payable;\\n\\n function sendCredits(\\n uint16 _dstChainId,\\n uint256 _srcPoolId,\\n uint256 _dstPoolId,\\n address payable _refundAddress\\n ) external payable;\\n\\n function quoteLayerZeroFee(\\n uint16 _dstChainId,\\n uint8 _functionType,\\n bytes calldata _toAddress,\\n bytes calldata _transferAndCallPayload,\\n lzTxObj memory _lzTxParams\\n ) external view returns (uint256, uint256);\\n\\n function clearCachedSwap(uint16 _srcChainId, bytes calldata _srcAddress, uint256 _nonce) external;\\n\\n function factory() external view returns (address);\\n\\n function bridge() external view returns (address);\\n\\n function cachedSwapLookup(\\n uint16 _chainId_,\\n bytes calldata _srcAddress,\\n uint256 _nonce\\n ) external view returns (address token, uint256 amountLD, address to, bytes memory payload);\\n}\\n\",\"keccak256\":\"0x92126df8e682b2c5647c7b22e7387da69f9e72480af86948ce5ed17dc2c9e0a7\",\"license\":\"BUSL-1.1\"},\"contracts/interfaces/ICrossChainDispatcher.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/composable/IOFTReceiverUpgradeable.sol\\\";\\nimport \\\"../dependencies/stargate-protocol/interfaces/IStargateReceiver.sol\\\";\\nimport \\\"../dependencies/stargate-protocol/interfaces/IStargateRouter.sol\\\";\\nimport \\\"../dependencies/stargate-protocol/interfaces/IStargateComposer.sol\\\";\\nimport \\\"./IProxyOFT.sol\\\";\\n\\ninterface ICrossChainDispatcher is IStargateReceiver, IOFTReceiverUpgradeable {\\n function crossChainDispatcherOf(uint16 chainId_) external view returns (address);\\n\\n function triggerFlashRepaySwap(\\n uint256 id_,\\n address payable account_,\\n address tokenIn_,\\n address tokenOut_,\\n uint256 amountIn_,\\n uint256 amountOutMin_,\\n bytes calldata lzArgs_\\n ) external payable;\\n\\n function triggerLeverageSwap(\\n uint256 id_,\\n address payable account_,\\n address tokenIn_,\\n address tokenOut_,\\n uint256 amountIn_,\\n uint256 amountOutMin,\\n bytes calldata lzArgs_\\n ) external payable;\\n\\n function isBridgingActive() external view returns (bool);\\n\\n function flashRepayCallbackTxGasLimit() external view returns (uint64);\\n\\n function flashRepaySwapTxGasLimit() external view returns (uint64);\\n\\n function leverageCallbackTxGasLimit() external view returns (uint64);\\n\\n function leverageSwapTxGasLimit() external view returns (uint64);\\n\\n function lzBaseGasLimit() external view returns (uint256);\\n\\n function stargateComposer() external view returns (IStargateComposer);\\n\\n function stargateSlippage() external view returns (uint256);\\n\\n function stargatePoolIdOf(address token_) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xcaf05e625588dcfaa5706acc78a35fa46d50baeb2d28f689036963695a4e39cb\",\"license\":\"MIT\"},\"contracts/interfaces/IDebtToken.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/openzeppelin/token/ERC20/extensions/IERC20Metadata.sol\\\";\\nimport \\\"./ISyntheticToken.sol\\\";\\n\\ninterface IDebtToken is IERC20Metadata {\\n function lastTimestampAccrued() external view returns (uint256);\\n\\n function isActive() external view returns (bool);\\n\\n function syntheticToken() external view returns (ISyntheticToken);\\n\\n function accrueInterest() external;\\n\\n function debtIndex() external returns (uint256 debtIndex_);\\n\\n function burn(address from_, uint256 amount_) external;\\n\\n function issue(uint256 amount_, address to_) external returns (uint256 _issued, uint256 _fee);\\n\\n function flashIssue(address to_, uint256 amount_) external returns (uint256 _issued, uint256 _fee);\\n\\n function mint(address to_, uint256 amount_) external;\\n\\n function repay(address onBehalfOf_, uint256 amount_) external returns (uint256 _repaid, uint256 _fee);\\n\\n function repayAll(address onBehalfOf_) external returns (uint256 _repaid, uint256 _fee);\\n\\n function quoteIssueIn(uint256 amountToIssue_) external view returns (uint256 _amount, uint256 _fee);\\n\\n function quoteIssueOut(uint256 amount_) external view returns (uint256 _amountToIssue, uint256 _fee);\\n\\n function quoteRepayIn(uint256 amountToRepay_) external view returns (uint256 _amount, uint256 _fee);\\n\\n function quoteRepayOut(uint256 amount_) external view returns (uint256 _amountToRepay, uint256 _fee);\\n\\n function updateMaxTotalSupply(uint256 newMaxTotalSupply_) external;\\n\\n function updateInterestRate(uint256 newInterestRate_) external;\\n\\n function maxTotalSupply() external view returns (uint256);\\n\\n function interestRate() external view returns (uint256);\\n\\n function interestRatePerSecond() external view returns (uint256);\\n\\n function toggleIsActive() external;\\n}\\n\",\"keccak256\":\"0xd2f04aa1bee06d6991b10aaf7c03c3ee09d85f8e48ba92feac595ad855881380\",\"license\":\"MIT\"},\"contracts/interfaces/IDepositToken.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/openzeppelin/token/ERC20/extensions/IERC20Metadata.sol\\\";\\n\\ninterface IDepositToken is IERC20Metadata {\\n function underlying() external view returns (IERC20);\\n\\n function collateralFactor() external view returns (uint256);\\n\\n function unlockedBalanceOf(address account_) external view returns (uint256);\\n\\n function lockedBalanceOf(address account_) external view returns (uint256);\\n\\n function flashWithdraw(address account_, uint256 amount_) external returns (uint256 _withdrawn, uint256 _fee);\\n\\n function deposit(uint256 amount_, address onBehalfOf_) external returns (uint256 _deposited, uint256 _fee);\\n\\n function quoteDepositIn(uint256 amountToDeposit_) external view returns (uint256 _amount, uint256 _fee);\\n\\n function quoteDepositOut(uint256 amount_) external view returns (uint256 _amountToDeposit, uint256 _fee);\\n\\n function quoteWithdrawIn(uint256 amountToWithdraw_) external view returns (uint256 _amount, uint256 _fee);\\n\\n function quoteWithdrawOut(uint256 amount_) external view returns (uint256 _amountToWithdraw, uint256 _fee);\\n\\n function withdraw(uint256 amount_, address to_) external returns (uint256 _withdrawn, uint256 _fee);\\n\\n function seize(address from_, address to_, uint256 amount_) external;\\n\\n function updateCollateralFactor(uint128 newCollateralFactor_) external;\\n\\n function isActive() external view returns (bool);\\n\\n function toggleIsActive() external;\\n\\n function maxTotalSupply() external view returns (uint256);\\n\\n function updateMaxTotalSupply(uint256 newMaxTotalSupply_) external;\\n\\n function withdrawFrom(address from_, uint256 amount_) external returns (uint256 _withdrawn, uint256 _fee);\\n}\\n\",\"keccak256\":\"0xb27092f9450d9c48c1a215925007ca9c7282cfe6cf257b34ab3dbe6e745b6bd1\",\"license\":\"MIT\"},\"contracts/interfaces/IFeeProvider.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\n/**\\n * @notice FeeProvider interface\\n */\\ninterface IFeeProvider {\\n struct LiquidationFees {\\n uint128 liquidatorIncentive;\\n uint128 protocolFee;\\n }\\n\\n function defaultSwapFee() external view returns (uint256);\\n\\n function depositFee() external view returns (uint256);\\n\\n function issueFee() external view returns (uint256);\\n\\n function liquidationFees() external view returns (uint128 liquidatorIncentive, uint128 protocolFee);\\n\\n function repayFee() external view returns (uint256);\\n\\n function swapFeeFor(address account_) external view returns (uint256);\\n\\n function withdrawFee() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x3b132b42090c167b2c0aef6d78d833c669c43b9e55593a7a21a96ed5d3082700\",\"license\":\"MIT\"},\"contracts/interfaces/IGovernable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\n/**\\n * @notice Governable interface\\n */\\ninterface IGovernable {\\n function governor() external view returns (address _governor);\\n\\n function transferGovernorship(address _proposedGovernor) external;\\n}\\n\",\"keccak256\":\"0xbe84461adf33aec1bf31b6d84a5380aaeb791de9a4b95346dd8270dc6632984e\",\"license\":\"MIT\"},\"contracts/interfaces/IManageable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./IPool.sol\\\";\\n\\n/**\\n * @notice Manageable interface\\n */\\ninterface IManageable {\\n function pool() external view returns (IPool _pool);\\n}\\n\",\"keccak256\":\"0xac88e0997a26942cb9cbda1a7dd9756e28ba2025813e5b07e55939fbf8538ea2\",\"license\":\"MIT\"},\"contracts/interfaces/IPauseable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\ninterface IPauseable {\\n function paused() external view returns (bool);\\n\\n function everythingStopped() external view returns (bool);\\n}\\n\",\"keccak256\":\"0xa768de9fadad05a8104cb407ae6243354e70ffd6e1a50c3e0bb0a6a1dc49d32a\",\"license\":\"MIT\"},\"contracts/interfaces/IPool.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./IDepositToken.sol\\\";\\nimport \\\"./IDebtToken.sol\\\";\\nimport \\\"./ITreasury.sol\\\";\\nimport \\\"./IRewardsDistributor.sol\\\";\\nimport \\\"./IPoolRegistry.sol\\\";\\nimport \\\"./IFeeProvider.sol\\\";\\nimport \\\"./ISmartFarmingManager.sol\\\";\\nimport \\\"./external/ISwapper.sol\\\";\\nimport \\\"../interfaces/IFeeProvider.sol\\\";\\n\\n/**\\n * @notice Pool interface\\n */\\ninterface IPool is IPauseable, IGovernable {\\n function debtFloorInUsd() external view returns (uint256);\\n\\n function feeCollector() external view returns (address);\\n\\n function feeProvider() external view returns (IFeeProvider);\\n\\n function maxLiquidable() external view returns (uint256);\\n\\n function doesSyntheticTokenExist(ISyntheticToken syntheticToken_) external view returns (bool);\\n\\n function doesDebtTokenExist(IDebtToken debtToken_) external view returns (bool);\\n\\n function doesDepositTokenExist(IDepositToken depositToken_) external view returns (bool);\\n\\n function depositTokenOf(IERC20 underlying_) external view returns (IDepositToken);\\n\\n function debtTokenOf(ISyntheticToken syntheticToken_) external view returns (IDebtToken);\\n\\n function getDepositTokens() external view returns (address[] memory);\\n\\n function getDebtTokens() external view returns (address[] memory);\\n\\n function getRewardsDistributors() external view returns (address[] memory);\\n\\n function debtOf(address account_) external view returns (uint256 _debtInUsd);\\n\\n function depositOf(address account_) external view returns (uint256 _depositInUsd, uint256 _issuableLimitInUsd);\\n\\n function debtPositionOf(\\n address account_\\n )\\n external\\n view\\n returns (\\n bool _isHealthy,\\n uint256 _depositInUsd,\\n uint256 _debtInUsd,\\n uint256 _issuableLimitInUsd,\\n uint256 _issuableInUsd\\n );\\n\\n function liquidate(\\n ISyntheticToken syntheticToken_,\\n address account_,\\n uint256 amountToRepay_,\\n IDepositToken depositToken_\\n ) external returns (uint256 _totalSeized, uint256 _toLiquidator, uint256 _fee);\\n\\n function quoteLiquidateIn(\\n ISyntheticToken syntheticToken_,\\n uint256 totalToSeized_,\\n IDepositToken depositToken_\\n ) external view returns (uint256 _amountToRepay, uint256 _toLiquidator, uint256 _fee);\\n\\n function quoteLiquidateMax(\\n ISyntheticToken syntheticToken_,\\n address account_,\\n IDepositToken depositToken_\\n ) external view returns (uint256 _maxAmountToRepay);\\n\\n function quoteLiquidateOut(\\n ISyntheticToken syntheticToken_,\\n uint256 amountToRepay_,\\n IDepositToken depositToken_\\n ) external view returns (uint256 _totalSeized, uint256 _toLiquidator, uint256 _fee);\\n\\n function quoteSwapIn(\\n ISyntheticToken syntheticTokenIn_,\\n ISyntheticToken syntheticTokenOut_,\\n uint256 amountOut_\\n ) external view returns (uint256 _amountIn, uint256 _fee);\\n\\n function quoteSwapOut(\\n ISyntheticToken syntheticTokenIn_,\\n ISyntheticToken syntheticTokenOut_,\\n uint256 amountIn_\\n ) external view returns (uint256 _amountOut, uint256 _fee);\\n\\n function swap(\\n ISyntheticToken syntheticTokenIn_,\\n ISyntheticToken syntheticTokenOut_,\\n uint256 amountIn_\\n ) external returns (uint256 _amountOut, uint256 _fee);\\n\\n function treasury() external view returns (ITreasury);\\n\\n function masterOracle() external view returns (IMasterOracle);\\n\\n function poolRegistry() external view returns (IPoolRegistry);\\n\\n function addToDepositTokensOfAccount(address account_) external;\\n\\n function removeFromDepositTokensOfAccount(address account_) external;\\n\\n function addToDebtTokensOfAccount(address account_) external;\\n\\n function removeFromDebtTokensOfAccount(address account_) external;\\n\\n function getDepositTokensOfAccount(address account_) external view returns (address[] memory);\\n\\n function getDebtTokensOfAccount(address account_) external view returns (address[] memory);\\n\\n function isSwapActive() external view returns (bool);\\n\\n function smartFarmingManager() external view returns (ISmartFarmingManager);\\n}\\n\",\"keccak256\":\"0x0f0a869451cca858ba52b56970db167360fe161f2450557a053c4da938558816\",\"license\":\"MIT\"},\"contracts/interfaces/IPoolRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./external/IMasterOracle.sol\\\";\\nimport \\\"./IPauseable.sol\\\";\\nimport \\\"./IGovernable.sol\\\";\\nimport \\\"./ISyntheticToken.sol\\\";\\nimport \\\"./external/ISwapper.sol\\\";\\nimport \\\"./IQuoter.sol\\\";\\nimport \\\"./ICrossChainDispatcher.sol\\\";\\n\\ninterface IPoolRegistry is IPauseable, IGovernable {\\n function feeCollector() external view returns (address);\\n\\n function isPoolRegistered(address pool_) external view returns (bool);\\n\\n function nativeTokenGateway() external view returns (address);\\n\\n function getPools() external view returns (address[] memory);\\n\\n function registerPool(address pool_) external;\\n\\n function unregisterPool(address pool_) external;\\n\\n function masterOracle() external view returns (IMasterOracle);\\n\\n function updateFeeCollector(address newFeeCollector_) external;\\n\\n function idOfPool(address pool_) external view returns (uint256);\\n\\n function nextPoolId() external view returns (uint256);\\n\\n function swapper() external view returns (ISwapper);\\n\\n function quoter() external view returns (IQuoter);\\n\\n function crossChainDispatcher() external view returns (ICrossChainDispatcher);\\n\\n function doesSyntheticTokenExist(ISyntheticToken syntheticToken_) external view returns (bool _exists);\\n}\\n\",\"keccak256\":\"0x9ffa9e5fd39a48ac2bda561af7fb4fc9df5f8ffb7a602ef1d4da8c068019e723\",\"license\":\"MIT\"},\"contracts/interfaces/IProxyOFT.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/composable/IComposableOFTCoreUpgradeable.sol\\\";\\n\\ninterface IProxyOFT is IComposableOFTCoreUpgradeable {\\n function getProxyOFTOf(uint16 chainId_) external view returns (address _proxyOFT);\\n}\\n\",\"keccak256\":\"0x4041a90eb60de460c9e1631aaedfbf2bff2275b3f91964800b1c774546931cd5\",\"license\":\"MIT\"},\"contracts/interfaces/IQuoter.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./IPoolRegistry.sol\\\";\\nimport \\\"./IProxyOFT.sol\\\";\\n\\ninterface IQuoter {\\n function quoteCrossChainFlashRepayNativeFee(\\n IProxyOFT proxyOFT_,\\n bytes calldata lzArgs_\\n ) external view returns (uint256 _nativeFee);\\n\\n function quoteCrossChainLeverageNativeFee(\\n IProxyOFT proxyOFT_,\\n bytes calldata lzArgs_\\n ) external view returns (uint256 _nativeFee);\\n\\n function quoteLeverageCallbackNativeFee(uint16 dstChainId_) external view returns (uint256 _callbackTxNativeFee);\\n\\n function quoteFlashRepayCallbackNativeFee(uint16 dstChainId_) external view returns (uint256 _callbackTxNativeFee);\\n\\n function getFlashRepaySwapAndCallbackLzArgs(\\n uint16 srcChainId_,\\n uint16 dstChainId_\\n ) external view returns (bytes memory lzArgs_);\\n\\n function getLeverageSwapAndCallbackLzArgs(\\n uint16 srcChainId_,\\n uint16 dstChainId_\\n ) external view returns (bytes memory lzArgs_);\\n}\\n\",\"keccak256\":\"0x1e4d2dd779a09dc8ea6b6c244b167deddca3a48e71b73bf940da04113b40c752\",\"license\":\"MIT\"},\"contracts/interfaces/IRewardsDistributor.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/openzeppelin/token/ERC20/IERC20.sol\\\";\\n\\n/**\\n * @notice Reward Distributor interface\\n */\\ninterface IRewardsDistributor {\\n function rewardToken() external view returns (IERC20);\\n\\n function tokenSpeeds(IERC20 token_) external view returns (uint256);\\n\\n function tokensAccruedOf(address account_) external view returns (uint256);\\n\\n function updateBeforeMintOrBurn(IERC20 token_, address account_) external;\\n\\n function updateBeforeTransfer(IERC20 token_, address from_, address to_) external;\\n\\n function claimable(address account_) external view returns (uint256 _claimable);\\n\\n function claimable(address account_, IERC20 token_) external view returns (uint256 _claimable);\\n\\n function claimRewards(address account_) external;\\n\\n function claimRewards(address account_, IERC20[] memory tokens_) external;\\n\\n function claimRewards(address[] memory accounts_, IERC20[] memory tokens_) external;\\n\\n function updateTokenSpeed(IERC20 token_, uint256 newSpeed_) external;\\n\\n function updateTokenSpeeds(IERC20[] calldata tokens_, uint256[] calldata speeds_) external;\\n\\n function tokens(uint256) external view returns (IERC20);\\n\\n function tokenStates(IERC20) external view returns (uint224 index, uint32 timestamp);\\n\\n function accountIndexOf(IERC20, address) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x4f527eeae61b6a5bff7d3b48037234ef718ae7f71dc452e8cab3b60581f0d810\",\"license\":\"MIT\"},\"contracts/interfaces/ISmartFarmingManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./IManageable.sol\\\";\\nimport \\\"./IDepositToken.sol\\\";\\nimport \\\"./IDebtToken.sol\\\";\\n\\n/**\\n * @notice SmartFarmingManager interface\\n */\\ninterface ISmartFarmingManager {\\n function flashRepay(\\n ISyntheticToken syntheticToken_,\\n IDepositToken depositToken_,\\n uint256 withdrawAmount_,\\n uint256 repayAmountMin_\\n ) external returns (uint256 _withdrawn, uint256 _repaid);\\n\\n function crossChainFlashRepay(\\n ISyntheticToken syntheticToken_,\\n IDepositToken depositToken_,\\n uint256 withdrawAmount_,\\n IERC20 bridgeToken_,\\n uint256 bridgeTokenAmountMin_,\\n uint256 swapAmountOutMin_,\\n uint256 repayAmountMin_,\\n bytes calldata lzArgs_\\n ) external payable;\\n\\n function crossChainLeverage(\\n IERC20 tokenIn_,\\n IDepositToken depositToken_,\\n ISyntheticToken syntheticToken_,\\n uint256 amountIn_,\\n uint256 leverage_,\\n uint256 swapAmountOutMin_,\\n uint256 depositAmountMin_,\\n bytes calldata lzArgs_\\n ) external payable;\\n\\n function crossChainLeverageCallback(uint256 id_, uint256 swapAmountOut_) external returns (uint256 _deposited);\\n\\n function crossChainFlashRepayCallback(uint256 id_, uint256 swapAmountOut_) external returns (uint256 _repaid);\\n\\n function leverage(\\n IERC20 tokenIn_,\\n IDepositToken depositToken_,\\n ISyntheticToken syntheticToken_,\\n uint256 amountIn_,\\n uint256 leverage_,\\n uint256 depositAmountMin_\\n ) external returns (uint256 _deposited, uint256 _issued);\\n}\\n\",\"keccak256\":\"0x7544a9d308a49e24d6984c3cfcfe2c1cfb7d9ce4655408438e1c12f37175a3b0\",\"license\":\"MIT\"},\"contracts/interfaces/ISyntheticToken.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/openzeppelin/token/ERC20/extensions/IERC20Metadata.sol\\\";\\nimport \\\"./IDebtToken.sol\\\";\\nimport \\\"./IPoolRegistry.sol\\\";\\nimport \\\"../interfaces/IProxyOFT.sol\\\";\\n\\ninterface ISyntheticToken is IERC20Metadata {\\n function isActive() external view returns (bool);\\n\\n function mint(address to_, uint256 amount_) external;\\n\\n function burn(address from_, uint256 amount) external;\\n\\n function poolRegistry() external view returns (IPoolRegistry);\\n\\n function toggleIsActive() external;\\n\\n function seize(address from_, address to_, uint256 amount_) external;\\n\\n function updateMaxTotalSupply(uint256 newMaxTotalSupply_) external;\\n\\n function updateProxyOFT(IProxyOFT newProxyOFT_) external;\\n\\n function maxTotalSupply() external view returns (uint256);\\n\\n function proxyOFT() external view returns (IProxyOFT);\\n}\\n\",\"keccak256\":\"0xfaeb24d1067e85493a5c8818d6de06fc6dbc72c37e85f82811990d0120f8a0cf\",\"license\":\"MIT\"},\"contracts/interfaces/ITreasury.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\ninterface ITreasury {\\n function pull(address to_, uint256 amount_) external;\\n\\n function migrateTo(address newTreasury_) external;\\n}\\n\",\"keccak256\":\"0x9ee0a41cfe7b5bd2ec256441fc7b2ae6407921ed28a65daeaa476cfc9df73c1b\",\"license\":\"MIT\"},\"contracts/interfaces/external/IMasterOracle.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\ninterface IMasterOracle {\\n function quoteTokenToUsd(address _asset, uint256 _amount) external view returns (uint256 _amountInUsd);\\n\\n function quoteUsdToToken(address _asset, uint256 _amountInUsd) external view returns (uint256 _amount);\\n\\n function quote(address _assetIn, address _assetOut, uint256 _amountIn) external view returns (uint256 _amountOut);\\n}\\n\",\"keccak256\":\"0x2f080adc5880151dc4446ef43b54abab8e3711c5f2e526917ef39a05e3c16a00\",\"license\":\"MIT\"},\"contracts/interfaces/external/ISwapper.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\ninterface ISwapper {\\n function swapExactInput(\\n address tokenIn_,\\n address tokenOut_,\\n uint256 amountIn_,\\n uint256 amountOutMin_,\\n address receiver_\\n ) external returns (uint256 _amountOut);\\n}\\n\",\"keccak256\":\"0x75f04b225d0c310be7e0a09ee4c1aa6eeeb8d94e02fc0e4160a9597ce2d8d446\",\"license\":\"MIT\"},\"contracts/lib/MappedEnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\n/**\\n * @dev EnumerableSet fork to support `address => address[]` mapping\\n * @dev Forked from OZ 4.3.2\\n */\\nlibrary MappedEnumerableSet {\\n struct Set {\\n // Storage of set values\\n address[] _values;\\n // Position of the value in the `values` array, plus 1 because index 0\\n // means a value is not in the set.\\n mapping(address => uint256) _indexes;\\n }\\n\\n struct AddressSet {\\n mapping(address => Set) _ofAddress;\\n }\\n\\n function _add(AddressSet storage set, address _key, address value) private returns (bool) {\\n if (!_contains(set, _key, value)) {\\n set._ofAddress[_key]._values.push(value);\\n // The value is stored at length-1, but we add 1 to all indexes\\n // and use 0 as a sentinel value\\n set._ofAddress[_key]._indexes[value] = set._ofAddress[_key]._values.length;\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n function _remove(AddressSet storage set, address _key, address value) private returns (bool) {\\n // We read and store the value's index to prevent multiple reads from the same storage slot\\n uint256 valueIndex = set._ofAddress[_key]._indexes[value];\\n\\n if (valueIndex != 0) {\\n // Equivalent to contains(set, value)\\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\\n // the array, and then remove the last element (sometimes called as 'swap and pop').\\n // This modifies the order of the array, as noted in {at}.\\n\\n uint256 toDeleteIndex = valueIndex - 1;\\n uint256 lastIndex = set._ofAddress[_key]._values.length - 1;\\n\\n if (lastIndex != toDeleteIndex) {\\n address lastvalue = set._ofAddress[_key]._values[lastIndex];\\n\\n // Move the last value to the index where the value to delete is\\n set._ofAddress[_key]._values[toDeleteIndex] = lastvalue;\\n // Update the index for the moved value\\n set._ofAddress[_key]._indexes[lastvalue] = valueIndex; // Replace lastvalue's index to valueIndex\\n }\\n\\n // Delete the slot where the moved value was stored\\n set._ofAddress[_key]._values.pop();\\n\\n // Delete the index for the deleted slot\\n delete set._ofAddress[_key]._indexes[value];\\n\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n function _contains(AddressSet storage set, address _key, address value) private view returns (bool) {\\n return set._ofAddress[_key]._indexes[value] != 0;\\n }\\n\\n function _length(AddressSet storage set, address _key) private view returns (uint256) {\\n return set._ofAddress[_key]._values.length;\\n }\\n\\n function _at(AddressSet storage set, address _key, uint256 index) private view returns (address) {\\n return set._ofAddress[_key]._values[index];\\n }\\n\\n function _values(AddressSet storage set, address _key) private view returns (address[] memory) {\\n return set._ofAddress[_key]._values;\\n }\\n\\n function add(AddressSet storage set, address key, address value) internal returns (bool) {\\n return _add(set, key, value);\\n }\\n\\n function remove(AddressSet storage set, address key, address value) internal returns (bool) {\\n return _remove(set, key, value);\\n }\\n\\n function contains(AddressSet storage set, address key, address value) internal view returns (bool) {\\n return _contains(set, key, value);\\n }\\n\\n function length(AddressSet storage set, address key) internal view returns (uint256) {\\n return _length(set, key);\\n }\\n\\n function at(AddressSet storage set, address key, uint256 index) internal view returns (address) {\\n return _at(set, key, index);\\n }\\n\\n function values(AddressSet storage set, address key) internal view returns (address[] memory) {\\n address[] memory store = _values(set, key);\\n address[] memory result;\\n\\n assembly {\\n result := store\\n }\\n\\n return result;\\n }\\n}\\n\",\"keccak256\":\"0x73a56244f6f1284bbafb7de23a3422fea10556b4bf54ee768c4768c23fdc03fe\",\"license\":\"MIT\"},\"contracts/lib/WadRayMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\n/**\\n * @title Math library\\n * @dev Provides mul and div function for wads (decimal numbers with 18 digits precision) and rays (decimals with 27 digits)\\n * @dev Based on https://github.com/dapphub/ds-math/blob/master/src/math.sol\\n */\\nlibrary WadRayMath {\\n uint256 internal constant WAD = 1e18;\\n uint256 internal constant HALF_WAD = WAD / 2;\\n\\n uint256 internal constant RAY = 1e27;\\n uint256 internal constant HALF_RAY = RAY / 2;\\n\\n uint256 internal constant WAD_RAY_RATIO = 1e9;\\n\\n /**\\n * @dev Multiplies two wad, rounding half up to the nearest wad\\n * @param a Wad\\n * @param b Wad\\n * @return The result of a*b, in wad\\n */\\n function wadMul(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (a == 0 || b == 0) {\\n return 0;\\n }\\n\\n return (a * b + HALF_WAD) / WAD;\\n }\\n\\n /**\\n * @dev Divides two wad, rounding half up to the nearest wad\\n * @param a Wad\\n * @param b Wad\\n * @return The result of a/b, in wad\\n */\\n function wadDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n return (a * WAD + b / 2) / b;\\n }\\n}\\n\",\"keccak256\":\"0xd971282b7b02c2121f64a13df8b40f427dbda36a770d0d391a3102947a743071\",\"license\":\"MIT\"},\"contracts/storage/PoolStorage.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/openzeppelin/utils/structs/EnumerableSet.sol\\\";\\nimport \\\"../lib/MappedEnumerableSet.sol\\\";\\nimport \\\"../interfaces/IPool.sol\\\";\\nimport \\\"../interfaces/ISmartFarmingManager.sol\\\";\\n\\n// solhint-disable var-name-mixedcase, max-states-count\\nabstract contract PoolStorageV1 is IPool {\\n /**\\n * @notice The debt floor (in USD) for each synthetic token\\n * This parameters is used to keep incentive for liquidators (i.e. cover gas and provide enough profit)\\n */\\n uint256 public override debtFloorInUsd;\\n\\n uint256 private depositFee__DEPRECATED;\\n\\n uint256 private issueFee__DEPRECATED;\\n\\n uint256 private withdrawFee__DEPRECATED;\\n\\n uint256 private repayFee__DEPRECATED;\\n\\n uint256 private swapFee__DEPRECATED;\\n\\n uint256 private liquidationFees__DEPRECATED;\\n\\n /**\\n * @notice The max percent of the debt allowed to liquidate\\n * @dev Use 18 decimals (e.g. 1e16 = 1%)\\n */\\n uint256 public override maxLiquidable;\\n\\n /**\\n * @notice PoolRegistry\\n */\\n IPoolRegistry public override poolRegistry;\\n\\n /**\\n * @notice Swap feature on/off flag\\n */\\n bool public override isSwapActive;\\n\\n /**\\n * @notice Treasury contract\\n */\\n ITreasury public override treasury;\\n\\n /**\\n * @notice Represents collateral's deposits\\n */\\n EnumerableSet.AddressSet internal depositTokens;\\n\\n /**\\n * @notice Get the deposit token's address from given underlying asset\\n */\\n mapping(IERC20 => IDepositToken) public override depositTokenOf;\\n\\n /**\\n * @notice Available debt tokens\\n */\\n EnumerableSet.AddressSet internal debtTokens;\\n\\n /**\\n * @notice Per-account deposit tokens (i.e. tokens that user has balance > 0)\\n */\\n MappedEnumerableSet.AddressSet internal depositTokensOfAccount;\\n\\n /**\\n * @notice Per-account debt tokens (i.e. tokens that user has balance > 0)\\n */\\n MappedEnumerableSet.AddressSet internal debtTokensOfAccount;\\n\\n /**\\n * @notice RewardsDistributor contracts\\n */\\n IRewardsDistributor[] internal rewardsDistributors__DEPRECATED;\\n\\n /**\\n * @notice Get the debt token's address from given synthetic asset\\n */\\n mapping(ISyntheticToken => IDebtToken) public override debtTokenOf;\\n}\\n\\nabstract contract PoolStorageV2 is PoolStorageV1 {\\n ISwapper private swapper__DEPRECATED;\\n\\n /**\\n * @notice FeeProvider contract\\n */\\n IFeeProvider public override feeProvider;\\n\\n /**\\n * @notice RewardsDistributor contracts\\n */\\n EnumerableSet.AddressSet internal rewardsDistributors;\\n}\\n\\nabstract contract PoolStorageV3 is PoolStorageV2 {\\n /**\\n * @notice SmartFarmingManager contract\\n */\\n ISmartFarmingManager public smartFarmingManager;\\n}\\n\\nabstract contract PoolStorageV4 is PoolStorageV3 {\\n /**\\n * @notice Flag that pause/unpause pool's cross-chain activities\\n */\\n bool public isBridgingActive;\\n}\\n\",\"keccak256\":\"0xfe44ba1b3a72f6025252aa79ff5130a3590bc163225db6941f79831da9b629d1\",\"license\":\"MIT\"},\"contracts/utils/Pauseable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../interfaces/IPauseable.sol\\\";\\nimport \\\"../access/Governable.sol\\\";\\n\\nerror IsPaused();\\nerror IsShutdown();\\nerror IsNotPaused();\\nerror IsNotShutdown();\\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 */\\nabstract contract Pauseable is IPauseable, Governable {\\n /// @notice Emitted when contract is turned on\\n event Open(address indexed caller);\\n\\n /// @notice Emitted when contract is paused\\n event Paused(address indexed caller);\\n\\n /// @notice Emitted when contract is shuted down\\n event Shutdown(address indexed caller);\\n\\n /// @notice Emitted when contract is unpaused\\n event Unpaused(address indexed caller);\\n\\n bool private _paused;\\n bool private _everythingStopped;\\n\\n /**\\n * @dev Throws if contract is paused\\n */\\n modifier whenNotPaused() {\\n if (paused()) revert IsPaused();\\n _;\\n }\\n\\n /**\\n * @dev Throws if contract is shutdown\\n */\\n modifier whenNotShutdown() {\\n if (everythingStopped()) revert IsShutdown();\\n _;\\n }\\n\\n /**\\n * @dev Throws if contract is not paused\\n */\\n modifier whenPaused() {\\n if (!paused()) revert IsNotPaused();\\n _;\\n }\\n\\n /**\\n * @dev Throws if contract is not shutdown\\n */\\n modifier whenShutdown() {\\n if (!everythingStopped()) revert IsNotShutdown();\\n _;\\n }\\n\\n /**\\n * @dev If inheriting child is using proxy then child contract can use\\n * __Pauseable_init() function to initialization this contract\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function __Pauseable_init() internal onlyInitializing {\\n __Governable_init();\\n }\\n\\n /**\\n * @notice Return `true` if contract is shutdown\\n */\\n function everythingStopped() public view virtual returns (bool) {\\n return _everythingStopped;\\n }\\n\\n /**\\n * @notice Return `true` if contract is paused\\n */\\n function paused() public view virtual returns (bool) {\\n return _paused;\\n }\\n\\n /**\\n * @dev Open contract operations, if contract is in shutdown state\\n */\\n function open() external virtual whenShutdown onlyGovernor {\\n _everythingStopped = false;\\n emit Open(msg.sender);\\n }\\n\\n /**\\n * @dev Suspend deposit feature, if contract is not paused.\\n */\\n function pause() external virtual whenNotPaused onlyGovernor {\\n _paused = true;\\n emit Paused(msg.sender);\\n }\\n\\n /**\\n * @dev Suspend all features (issue, repay, deposit, withdraw, liquidate and swap), if not already shutdown.\\n */\\n function shutdown() external virtual whenNotShutdown onlyGovernor {\\n _everythingStopped = true;\\n _paused = true;\\n emit Shutdown(msg.sender);\\n }\\n\\n /**\\n * @dev Unpause contract operations, allow only if contract is paused and not shutdown.\\n */\\n function unpause() external virtual whenPaused whenNotShutdown onlyGovernor {\\n _paused = false;\\n emit Unpaused(msg.sender);\\n }\\n}\\n\",\"keccak256\":\"0x562f6b2a2d06f443b1c7e6b7e3dd45b5c658c86eee448f10bc63c145f2c86bc6\",\"license\":\"MIT\"},\"contracts/utils/ReentrancyGuard.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../dependencies/openzeppelin-upgradeable/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 ReentrancyGuard 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 // On the first call to nonReentrant, _notEntered will be true\\n require(_status != _ENTERED, \\\"ReentrancyGuard: reentrant call\\\");\\n\\n // Any calls to nonReentrant after this point will fail\\n _status = _ENTERED;\\n\\n _;\\n\\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\",\"keccak256\":\"0x3bf3c3de5a638ca101f25dfcaec5268e9c8a1c29a9a278d70be4459768fb41fe\",\"license\":\"MIT\"},\"contracts/utils/TokenHolder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/openzeppelin/token/ERC20/utils/SafeERC20.sol\\\";\\n\\nerror FallbackIsNotAllowed();\\nerror ReceiveIsNotAllowed();\\n\\n/**\\n * @title Utils contract that handles tokens sent to it\\n */\\nabstract contract TokenHolder {\\n using SafeERC20 for IERC20;\\n\\n /**\\n * @dev Revert fallback calls\\n */\\n fallback() external payable {\\n revert FallbackIsNotAllowed();\\n }\\n\\n /**\\n * @dev Revert when receiving by default\\n */\\n receive() external payable virtual {\\n revert ReceiveIsNotAllowed();\\n }\\n\\n /**\\n * @notice ERC20 recovery in case of stuck tokens due direct transfers to the contract address.\\n * @param token_ The token to transfer\\n * @param to_ The recipient of the transfer\\n * @param amount_ The amount to send\\n */\\n function sweep(IERC20 token_, address to_, uint256 amount_) external {\\n _requireCanSweep();\\n\\n if (address(token_) == address(0)) {\\n Address.sendValue(payable(to_), amount_);\\n } else {\\n token_.safeTransfer(to_, amount_);\\n }\\n }\\n\\n /**\\n * @notice Function that reverts if the caller isn't allowed to sweep tokens\\n * @dev Usually requires the owner or governor as the caller\\n */\\n function _requireCanSweep() internal view virtual;\\n}\\n\",\"keccak256\":\"0x50e56ed45d496b188d90494d08122fe9621d9e6c8f655679ef334447801ea50d\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60806040523480156200001157600080fd5b50600280546001600160a01b031916339081179091556040516000907fd4459d5b8b913cab0244230fd9b1c08b6ceace7fe9230e60d0f74cbffdf849d0908290a36200005c62000062565b62000192565b6200006e60ff62000071565b50565b60008054610100900460ff16156200010a578160ff166001148015620000aa5750620000a8306200018360201b620039a11760201c565b155b620001025760405162461bcd60e51b815260206004820152602e602482015260008051602062004aca83398151915260448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b506000919050565b60005460ff808416911610620001695760405162461bcd60e51b815260206004820152602e602482015260008051602062004aca83398151915260448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401620000f9565b506000805460ff191660ff92909216919091179055600190565b6001600160a01b03163b151590565b61492880620001a26000396000f3fe6080604052600436106103a65760003560e01c80637f51bb1f116101e7578063d176e05f1161010d578063f0c80d3b116100a0578063fb01600d1161006f578063fb01600d14610b52578063fc0e74d114610b67578063fcfff16f14610b7c578063ffa1ad7414610b91576103c4565b8063f0c80d3b14610ae7578063f3b27bc314610b07578063f609280914610b1c578063f8977b8414610b32576103c4565b8063df791e50116100dc578063df791e5014610a7c578063e35bff9614610a9c578063eaada38214610abd578063ecf3a3f914610ad2576103c4565b8063d176e05f146109d2578063d283e75f146109f2578063dbe466b114610a12578063dde3ab9514610a32576103c4565b8063984a68b511610185578063b6aa515b11610154578063b6aa515b1461095d578063c415b95c1461097d578063c4d66de814610992578063c4d68a1a146109b2576103c4565b8063984a68b5146108d25780639ab620dd146108f25780639f8f0fa814610907578063afcff50f1461093d576103c4565b806387cddc86116101c157806387cddc861461083c578063892d522a146108725780638a11a3701461089257806396aaccfe146108b2576103c4565b80637f51bb1f146107f2578063833667df146108125780638456cb5914610827576103c4565b80634066fdea116102cc57806363c56d421161026a57806375c6f8ec1161023957806375c6f8ec14610772578063770b69b41461079257806379e40cba146107b25780637d355163146107d2576103c4565b806363c56d42146106fd57806369c5dfd81461071d5780636b4f41af146107325780636c33936714610752576103c4565b806356aaee2d116102a657806356aaee2d146106885780635c975abb146106a857806361d027b3146106bd57806362c06767146106dd576103c4565b80634066fdea14610633578063450058f8146106535780634ff9b74a14610673576103c4565b80632b80cc52116103445780633c2dc254116103135780633c2dc254146105a35780633de2f6b2146105de5780633f4ba83a146105fe5780633f5fc13114610613576103c4565b80632b80cc521461051c5780632bcb849c1461053d5780632dd6adb51461055d5780633605b51b14610581576103c4565b80631ccfbc4f116103805780631ccfbc4f1461048757806323e3fbd5146104bc578063275038d0146104dc5780632adcb0c6146104fc576103c4565b80630c340a24146103dd5780631a0dd00b1461041a5780631a4660ce14610465576103c4565b366103c457604051636436c22d60e11b815260040160405180910390fd5b60405163a0152e6360e01b815260040160405180910390fd5b3480156103e957600080fd5b506002546103fd906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561042657600080fd5b50610455610435366004614483565b6001600160a01b0390811660009081526016602052604090205416151590565b6040519015158152602001610411565b34801561047157600080fd5b506104856104803660046144a0565b610bcf565b005b34801561049357600080fd5b506104a76104a23660046144b9565b610c5d565b60408051928352602083019190915201610411565b3480156104c857600080fd5b506104a76104d7366004614483565b610e20565b3480156104e857600080fd5b506104856104f7366004614483565b611080565b34801561050857600080fd5b506104a76105173660046144b9565b6110d2565b34801561052857600080fd5b50601b5461045590600160a01b900460ff1681565b34801561054957600080fd5b50610485610558366004614483565b611282565b34801561056957600080fd5b50610573600b5481565b604051908152602001610411565b34801561058d57600080fd5b50610596611368565b60405161041191906144fa565b3480156105af57600080fd5b506105c36105be366004614547565b611379565b60408051938452602084019290925290820152606001610411565b3480156105ea57600080fd5b506105c36105f9366004614589565b61159e565b34801561060a57600080fd5b50610485611c30565b34801561061f57600080fd5b5061048561062e366004614483565b611ce0565b34801561063f57600080fd5b506018546103fd906001600160a01b031681565b34801561065f57600080fd5b5061045561066e366004614483565b611d74565b34801561067f57600080fd5b50610596611d87565b34801561069457600080fd5b506104856106a3366004614483565b611d93565b3480156106b457600080fd5b50610455611e44565b3480156106c957600080fd5b50600d546103fd906001600160a01b031681565b3480156106e957600080fd5b506104856106f83660046144b9565b611ee0565b34801561070957600080fd5b50610485610718366004614483565b611f19565b34801561072957600080fd5b50610573601e81565b34801561073e57600080fd5b5061048561074d366004614483565b611fd2565b34801561075e57600080fd5b506105c361076d366004614547565b612178565b34801561077e57600080fd5b5061048561078d366004614483565b612362565b34801561079e57600080fd5b506104856107ad366004614483565b6123b1565b3480156107be57600080fd5b506104856107cd366004614483565b612441565b3480156107de57600080fd5b506105966107ed366004614483565b6125eb565b3480156107fe57600080fd5b5061048561080d366004614483565b6125f8565b34801561081e57600080fd5b50610485612749565b34801561083357600080fd5b506104856127d5565b34801561084857600080fd5b506103fd610857366004614483565b6010602052600090815260409020546001600160a01b031681565b34801561087e57600080fd5b5061048561088d366004614483565b612866565b34801561089e57600080fd5b506003546103fd906001600160a01b031681565b3480156108be57600080fd5b50601b546103fd906001600160a01b031681565b3480156108de57600080fd5b506105736108ed3660046145dc565b61294f565b3480156108fe57600080fd5b50610485612ab0565b34801561091357600080fd5b506103fd610922366004614483565b6016602052600090815260409020546001600160a01b031681565b34801561094957600080fd5b50600c546103fd906001600160a01b031681565b34801561096957600080fd5b50610485610978366004614483565b612b3c565b34801561098957600080fd5b506103fd612bb0565b34801561099e57600080fd5b506104856109ad366004614483565b612c2d565b3480156109be57600080fd5b506104856109cd366004614483565b612cfe565b3480156109de57600080fd5b506105966109ed366004614483565b612eb2565b3480156109fe57600080fd5b50610573610a0d366004614483565b612ebf565b348015610a1e57600080fd5b50610485610a2d366004614483565b613091565b348015610a3e57600080fd5b50610a52610a4d366004614483565b613245565b6040805195151586526020860194909452928401919091526060830152608082015260a001610411565b348015610a8857600080fd5b506104a7610a973660046144b9565b61328f565b348015610aa857600080fd5b50600c5461045590600160a01b900460ff1681565b348015610ac957600080fd5b506103fd61367c565b348015610ade57600080fd5b506104556136c1565b348015610af357600080fd5b50610485610b023660046144a0565b613725565b348015610b1357600080fd5b506104856137dc565b348015610b2857600080fd5b5061057360045481565b348015610b3e57600080fd5b50610455610b4d366004614483565b61386b565b348015610b5e57600080fd5b50610596613878565b348015610b7357600080fd5b50610485613884565b348015610b8857600080fd5b50610485613917565b348015610b9d57600080fd5b50610bc2604051806040016040528060058152602001640312e332e360dc1b81525081565b604051610411919061464c565b6002546001600160a01b03163314610bfa57604051634b98449160e11b815260040160405180910390fd5b60045481811415610c1e57604051630333a68160e41b815260040160405180910390fd5b60408051828152602081018490527f0662703672e57800b9439de3a419c9155283ad25ea7776c139c876bd8b93bb98910160405180910390a150600455565b60185460405163d2d6b5a360e01b8152336004820152600091829182916001600160a01b03169063d2d6b5a39060240160206040518083038186803b158015610ca557600080fd5b505afa158015610cb9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cdd919061467f565b90508015610d1057610d01610cfa82670de0b6b3a76400006146ae565b85906139b0565b9350610d0d84826139e4565b91505b600c60009054906101000a90046001600160a01b03166001600160a01b031663eaada3826040518163ffffffff1660e01b815260040160206040518083038186803b158015610d5e57600080fd5b505afa158015610d72573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d9691906146c5565b6001600160a01b031663b64663848688876040518463ffffffff1660e01b8152600401610dc5939291906146e2565b60206040518083038186803b158015610ddd57600080fd5b505afa158015610df1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e15919061467f565b925050935093915050565b6000806000610e2d61367c565b90506000610e3c601386613a1c565b905060005b81811015611078576000610e5760138884613a3a565b90506000846001600160a01b0316638d0dba00836001600160a01b0316636f307dc36040518163ffffffff1660e01b815260040160206040518083038186803b158015610ea357600080fd5b505afa158015610eb7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610edb91906146c5565b6040516370a0823160e01b81526001600160a01b038c811660048301528616906370a082319060240160206040518083038186803b158015610f1c57600080fd5b505afa158015610f30573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f54919061467f565b6040516001600160e01b031960e085901b1681526001600160a01b039092166004830152602482015260440160206040518083038186803b158015610f9857600080fd5b505afa158015610fac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fd0919061467f565b9050610fdc8188614706565b9650611059826001600160a01b031663df011c416040518163ffffffff1660e01b815260040160206040518083038186803b15801561101a57600080fd5b505afa15801561102e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611052919061467f565b82906139e4565b6110639087614706565b95505050806110719061471e565b9050610e41565b505050915091565b6110893361386b565b6110a6576040516326688ebb60e11b815260040160405180910390fd5b6110b260138233613a4f565b6110cf5760405163a67d528360e01b815260040160405180910390fd5b50565b600080600c60009054906101000a90046001600160a01b03166001600160a01b031663eaada3826040518163ffffffff1660e01b815260040160206040518083038186803b15801561112357600080fd5b505afa158015611137573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061115b91906146c5565b6001600160a01b031663b64663848686866040518463ffffffff1660e01b815260040161118a939291906146e2565b60206040518083038186803b1580156111a257600080fd5b505afa1580156111b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111da919061467f565b60185460405163d2d6b5a360e01b81523360048201529193506000916001600160a01b039091169063d2d6b5a39060240160206040518083038186803b15801561122357600080fd5b505afa158015611237573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061125b919061467f565b905080156112795761126d83826139e4565b9150610e1582846146ae565b50935093915050565b6002546001600160a01b031633146112ad57604051634b98449160e11b815260040160405180910390fd5b6001600160a01b0381166112d45760405163fb7566d760e01b815260040160405180910390fd5b6018546001600160a01b0390811690821681141561130557604051630333a68160e41b815260040160405180910390fd5b816001600160a01b0316816001600160a01b03167f66fa9df7ccacf7a0c110fd7dd4591f59c76a798409b4aeaf850002679baca45560405160405180910390a350601880546001600160a01b0319166001600160a01b0392909216919091179055565b60606113746019613a5c565b905090565b6018546040805163cfc0c69f60e01b8152815160009384938493849384936001600160a01b03169263cfc0c69f9260048082019391829003018186803b1580156113c257600080fd5b505afa1580156113d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113fa9190614750565b9092509050600061140b8383614783565b6001600160801b0316905087811561143c5761143961143283670de0b6b3a7640000614706565b82906139b0565b90505b61144461367c565b6001600160a01b031663b6466384896001600160a01b0316636f307dc36040518163ffffffff1660e01b815260040160206040518083038186803b15801561148b57600080fd5b505afa15801561149f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114c391906146c5565b8c846040518463ffffffff1660e01b81526004016114e3939291906146e2565b60206040518083038186803b1580156114fb57600080fd5b505afa15801561150f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611533919061467f565b96506001600160801b0383161561155a57611557816001600160801b0385166139e4565b94505b6001600160801b038416156115915761158e61157e85670de0b6b3a7640000614783565b82906001600160801b03166139e4565b95505b5050505093509350939050565b60008060006115ab6136c1565b156115c957604051631b0e923f60e11b815260040160405180910390fd5b600260015414156116215760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b60026001556001600160a01b038088166000908152601660205260409020548891166116605760405163a596698b60e01b815260040160405180910390fd5b8461166a8161386b565b6116875760405163a67d528360e01b815260040160405180910390fd5b866116a5576040516310eb483f60e21b815260040160405180910390fd5b336001600160a01b03891614156116cf57604051630ecda8a760e01b815260040160405180910390fd5b6001600160a01b03808a1660009081526016602052604080822054815163a6afed9560e01b81529151931692839263a6afed95926004808201939182900301818387803b15801561171f57600080fd5b505af1158015611733573d6000803e3d6000fd5b5050505060006117428a613245565b50505050905080156117675760405163202881bd60e11b815260040160405180910390fd5b6040516370a0823160e01b81526001600160a01b038b81166004830152600091908416906370a082319060240160206040518083038186803b1580156117ac57600080fd5b505afa1580156117c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117e4919061467f565b600b549091506117f48b836139b0565b11156118135760405163e292f24f60e01b815260040160405180910390fd5b600061181d61367c565b600454909150156118f35760006001600160a01b038216638d0dba008f6118448f876146ae565b6040516001600160e01b031960e085901b1681526001600160a01b039092166004830152602482015260440160206040518083038186803b15801561188857600080fd5b505afa15801561189c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118c0919061467f565b90506000811180156118d3575060045481105b156118f1576040516332b9d47360e01b815260040160405180910390fd5b505b6118fe8d8c8c612178565b6040516370a0823160e01b8152929b5090995097506001600160a01b038b16906370a0823190611941908f906004016001600160a01b0391909116815260200190565b60206040518083038186803b15801561195957600080fd5b505afa15801561196d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611991919061467f565b8911156119b157604051635de1e54160e01b815260040160405180910390fd5b604051632770a7eb60e21b8152336004820152602481018c90526001600160a01b038e1690639dc29fac90604401600060405180830381600087803b1580156119f957600080fd5b505af1158015611a0d573d6000803e3d6000fd5b5050604051632770a7eb60e21b81526001600160a01b038f81166004830152602482018f905287169250639dc29fac9150604401600060405180830381600087803b158015611a5b57600080fd5b505af1158015611a6f573d6000803e3d6000fd5b505060405163b2a02ff160e01b81526001600160a01b038d16925063b2a02ff19150611aa3908f9033908d906004016146e2565b600060405180830381600087803b158015611abd57600080fd5b505af1158015611ad1573d6000803e3d6000fd5b505050506000871115611bc657896001600160a01b031663b2a02ff18d600c60009054906101000a90046001600160a01b03166001600160a01b031663c415b95c6040518163ffffffff1660e01b815260040160206040518083038186803b158015611b3c57600080fd5b505afa158015611b50573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b7491906146c5565b8a6040518463ffffffff1660e01b8152600401611b93939291906146e2565b600060405180830381600087803b158015611bad57600080fd5b505af1158015611bc1573d6000803e3d6000fd5b505050505b604080518c8152602081018b90529081018890526001600160a01b03808f1691908e169033907fe1c3870e3d7d5199a16d200133088e6e3f7012d28571e442a110b4c83b5e3b949060600160405180910390a4505050505050600180819055509450945094915050565b611c38611e44565b611c555760405163bc871ce560e01b815260040160405180910390fd5b611c5d6136c1565b15611c7b57604051631b0e923f60e11b815260040160405180910390fd5b6002546001600160a01b03163314611ca657604051634b98449160e11b815260040160405180910390fd5b6003805460ff60a01b1916905560405133907f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa90600090a2565b611ce93361386b565b611d06576040516326688ebb60e11b815260040160405180910390fd5b80601e611d14601383613a1c565b611d1f601484613a1c565b611d299190614706565b10611d47576040516306ceeb8360e21b815260040160405180910390fd5b611d5360138333613a69565b611d705760405163dd40dad960e01b815260040160405180910390fd5b5050565b6000611d81601183613a76565b92915050565b60606113746011613a5c565b6002546001600160a01b03163314611dbe57604051634b98449160e11b815260040160405180910390fd5b6001600160a01b038116611de55760405163fb7566d760e01b815260040160405180910390fd5b611df0601982613a98565b611e0d57604051631e577fa560e31b815260040160405180910390fd5b6040516001600160a01b038216907f5579b1eead2d904c2b05255a92f5a4a4f3e234ae0a4efe538adef3c1794e1cea90600090a250565b600354600090600160a01b900460ff16806113745750600c60009054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b815260040160206040518083038186803b158015611ea857600080fd5b505afa158015611ebc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061137491906147ae565b611ee8613aad565b6001600160a01b038316611f0557611f008282613ada565b505050565b611f006001600160a01b0384168383613bf3565b6002546001600160a01b03163314611f4457604051634b98449160e11b815260040160405180910390fd5b6001600160a01b038116611f6b5760405163fb7566d760e01b815260040160405180910390fd5b611f76601982613c45565b611f93576040516362c4c75f60e01b815260040160405180910390fd5b6040516001600160a01b03821681527f5412e32b52c11e4b232ab59f3660d55b48eb20735ccb2c67a0a1ebea0d6fe0199060200160405180910390a150565b6002546001600160a01b03163314611ffd57604051634b98449160e11b815260040160405180910390fd5b6001600160a01b0381166120245760405163fb7566d760e01b815260040160405180910390fd5b6000816001600160a01b0316638230ecd66040518163ffffffff1660e01b815260040160206040518083038186803b15801561205f57600080fd5b505afa158015612073573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061209791906146c5565b90506001600160a01b0381166120c05760405163013a1b4360e51b815260040160405180910390fd5b6001600160a01b0381811660009081526016602052604090205416156120f95760405163fa9b809960e01b815260040160405180910390fd5b612104601183613a98565b61212157604051631f477b5760e11b815260040160405180910390fd5b6001600160a01b0381811660009081526016602052604080822080546001600160a01b0319169386169384179055517fad48bee6bbb1b8ece321157ad29afc3c6baa177f8dc043132d65038cc601cdd69190a25050565b600080600061218561367c565b6001600160a01b031663b646638487866001600160a01b0316636f307dc36040518163ffffffff1660e01b815260040160206040518083038186803b1580156121cd57600080fd5b505afa1580156121e1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061220591906146c5565b886040518463ffffffff1660e01b8152600401612224939291906146e2565b60206040518083038186803b15801561223c57600080fd5b505afa158015612250573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612274919061467f565b6018546040805163cfc0c69f60e01b8152815193955060009384936001600160a01b03169263cfc0c69f9260048082019391829003018186803b1580156122ba57600080fd5b505afa1580156122ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122f29190614750565b90925090506001600160801b0381161561231c57612319846001600160801b0383166139e4565b92505b6001600160801b0382161561234b5761233e846001600160801b0384166139e4565b6123489085614706565b93505b6123558484614706565b9450505093509350939050565b61236b33611d74565b612388576040516304f8b91760e51b815260040160405180910390fd5b61239460148233613a4f565b6110cf576040516359c937f160e01b815260040160405180910390fd5b6123ba33611d74565b6123d7576040516304f8b91760e51b815260040160405180910390fd5b80601e6123e5601383613a1c565b6123f0601484613a1c565b6123fa9190614706565b10612418576040516306ceeb8360e21b815260040160405180910390fd5b61242460148333613a69565b611d7057604051631f477b5760e11b815260040160405180910390fd5b6002546001600160a01b0316331461246c57604051634b98449160e11b815260040160405180910390fd5b6001600160a01b0381166124935760405163fb7566d760e01b815260040160405180910390fd5b6000816001600160a01b0316636f307dc36040518163ffffffff1660e01b815260040160206040518083038186803b1580156124ce57600080fd5b505afa1580156124e2573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061250691906146c5565b6001600160a01b0380821660009081526010602052604090205491925016156125425760405163374f601360e11b815260040160405180910390fd5b601e61254e600e613c5a565b1061256c5760405163225b605b60e21b815260040160405180910390fd5b612577600e83613a98565b6125945760405163dd40dad960e01b815260040160405180910390fd5b6001600160a01b0381811660009081526010602052604080822080546001600160a01b0319169386169384179055517fdc705e658c7b6c6c01f5802457bf4ffb99f204bf1603e7b1ae3d4c7536611bc29190a25050565b6060611d81601383613c64565b6002546001600160a01b0316331461262357604051634b98449160e11b815260040160405180910390fd5b6001600160a01b03811661264a5760405163fb7566d760e01b815260040160405180910390fd5b600d546001600160a01b0390811690821681141561267b57604051630333a68160e41b815260040160405180910390fd5b6001600160a01b038116156126e6576040516326ed7c7960e11b81526001600160a01b038381166004830152821690634ddaf8f290602401600060405180830381600087803b1580156126cd57600080fd5b505af11580156126e1573d6000803e3d6000fd5b505050505b816001600160a01b0316816001600160a01b03167f4ab5be82436d353e61ca18726e984e561f5c1cc7c6d38b29d2553c790434705a60405160405180910390a350600d80546001600160a01b0319166001600160a01b0392909216919091179055565b6002546001600160a01b0316331461277457604051634b98449160e11b815260040160405180910390fd5b601b54604051600160a01b90910460ff1615808252907f0269774d3426d7e61b04b7d5129948b9f4edf9b937bb0c657fbb32a94a7996ec9060200160405180910390a1601b8054911515600160a01b0260ff60a01b19909216919091179055565b6127dd611e44565b156127fb57604051631309a56360e01b815260040160405180910390fd5b6002546001600160a01b0316331461282657604051634b98449160e11b815260040160405180910390fd5b6003805460ff60a01b1916600160a01b17905560405133907f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25890600090a2565b6002546001600160a01b0316331461289157604051634b98449160e11b815260040160405180910390fd5b6001600160a01b0381166128b85760405163fb7566d760e01b815260040160405180910390fd5b601b546001600160a01b039081169082168114156128e957604051630333a68160e41b815260040160405180910390fd5b604080516001600160a01b038084168252841660208201527f01b723df71593f812e405dc433f7dcf4134ff941def9d2e189a31f3cb1b1963b910160405180910390a150601b80546001600160a01b0319166001600160a01b0392909216919091179055565b60008061295b84613245565b5050505090508015612971576000915050612aa9565b6040516370a0823160e01b81526001600160a01b0385811660048301526000916129fa918891908716906370a082319060240160206040518083038186803b1580156129bc57600080fd5b505afa1580156129d0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129f4919061467f565b86611379565b5050600b546001600160a01b03888116600090815260166020526040908190205490516370a0823160e01b81528983166004820152939450612a98939116906370a082319060240160206040518083038186803b158015612a5a57600080fd5b505afa158015612a6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a92919061467f565b906139e4565b925082811015612aa6578092505b50505b9392505050565b6002546001600160a01b03163314612adb57604051634b98449160e11b815260040160405180910390fd5b600c54604051600160a01b90910460ff1615808252907fc8011ac148e14ab1e8f93a022ebc29088beedc705027c8eb9514d6d69c5b23639060200160405180910390a1600c8054911515600160a01b0260ff60a01b19909216919091179055565b6002546001600160a01b03163314612b6757604051634b98449160e11b815260040160405180910390fd5b6001600160a01b038116612b8e57604051634c267bfb60e01b815260040160405180910390fd5b600380546001600160a01b0319166001600160a01b0392909216919091179055565b600c54604080516331056e5760e21b815290516000926001600160a01b03169163c415b95c916004808301926020929190829003018186803b158015612bf557600080fd5b505afa158015612c09573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061137491906146c5565b6000612c396001613c72565b90508015612c51576000805461ff0019166101001790555b6001600160a01b038216612c7857604051637cb62f2b60e11b815260040160405180910390fd5b612c80613cff565b612c88613d2e565b600c80546001600160a81b0319166001600160a01b03841617600160a01b1790556706f05b59d3b20000600b558015611d70576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050565b6002546001600160a01b03163314612d2957604051634b98449160e11b815260040160405180910390fd5b6000816001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015612d6457600080fd5b505afa158015612d78573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d9c919061467f565b1115612dbb5760405163066097f160e31b815260040160405180910390fd5b612dc6601182613c45565b612de3576040516359c937f160e01b815260040160405180910390fd5b60166000826001600160a01b0316638230ecd66040518163ffffffff1660e01b815260040160206040518083038186803b158015612e2057600080fd5b505afa158015612e34573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e5891906146c5565b6001600160a01b03908116825260208201929092526040908101600090812080546001600160a01b03191690559051918316917f81e9205ee5a9e1289fad5baa5e74bd49d4613652eb4626bb15925bf9fdbc0feb9190a250565b6060611d81601483613c64565b600080612eca61367c565b90506000612ed9601485613a1c565b905060005b81811015613089576000612ef460148784613a3a565b9050836001600160a01b0316638d0dba00826001600160a01b0316638230ecd66040518163ffffffff1660e01b815260040160206040518083038186803b158015612f3e57600080fd5b505afa158015612f52573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f7691906146c5565b6040516370a0823160e01b81526001600160a01b038a811660048301528516906370a082319060240160206040518083038186803b158015612fb757600080fd5b505afa158015612fcb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612fef919061467f565b6040516001600160e01b031960e085901b1681526001600160a01b039092166004830152602482015260440160206040518083038186803b15801561303357600080fd5b505afa158015613047573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061306b919061467f565b6130759086614706565b945050806130829061471e565b9050612ede565b505050919050565b6002546001600160a01b031633146130bc57604051634b98449160e11b815260040160405180910390fd5b6000816001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156130f757600080fd5b505afa15801561310b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061312f919061467f565b111561314e5760405163066097f160e31b815260040160405180910390fd5b613159600e82613c45565b6131765760405163a67d528360e01b815260040160405180910390fd5b60106000826001600160a01b0316636f307dc36040518163ffffffff1660e01b815260040160206040518083038186803b1580156131b357600080fd5b505afa1580156131c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131eb91906146c5565b6001600160a01b03908116825260208201929092526040908101600090812080546001600160a01b03191690559051918316917fe5a19a76470297a1f85f9a38f3ff148b4c8cdc1209e074dbe59db5e22eb31a3a9190a250565b600080600080600061325686612ebf565b925061326186610e20565b808511159650909450915081831061327a576000613284565b61328483836146ae565b905091939590929450565b60008061329a6136c1565b156132b857604051631b0e923f60e11b815260040160405180910390fd5b6002600154141561330b5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401611618565b60026001556001600160a01b0380861660009081526016602052604090205486911661334a5760405163a596698b60e01b815260040160405180910390fd5b6001600160a01b038086166000908152601660205260409020548691166133845760405163a596698b60e01b815260040160405180910390fd5b600c54600160a01b900460ff166133ae57604051633840404b60e21b815260040160405180910390fd5b84158061343057506040516370a0823160e01b81523360048201526001600160a01b038816906370a082319060240160206040518083038186803b1580156133f557600080fd5b505afa158015613409573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061342d919061467f565b85115b1561344e5760405163ca99073960e01b815260040160405180910390fd5b604051632770a7eb60e21b8152336004820152602481018690526001600160a01b03881690639dc29fac90604401600060405180830381600087803b15801561349657600080fd5b505af11580156134aa573d6000803e3d6000fd5b505050506134b98787876110d2565b909450925082156135ba57856001600160a01b03166340c10f19600c60009054906101000a90046001600160a01b03166001600160a01b031663c415b95c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561352157600080fd5b505afa158015613535573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061355991906146c5565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101869052604401600060405180830381600087803b1580156135a157600080fd5b505af11580156135b5573d6000803e3d6000fd5b505050505b6040516340c10f1960e01b8152336004820152602481018590526001600160a01b038716906340c10f1990604401600060405180830381600087803b15801561360257600080fd5b505af1158015613616573d6000803e3d6000fd5b505060408051888152602081018890529081018690526001600160a01b03808a1693508a16915033907fafd74f009c0ff7627726f24b568ee5529cd297f6a7a1e43ec363443a13a584209060600160405180910390a45050600180559094909350915050565b600c5460408051637556d1c160e11b815290516000926001600160a01b03169163eaada382916004808301926020929190829003018186803b158015612bf557600080fd5b600354600090600160a81b900460ff16806113745750600c60009054906101000a90046001600160a01b03166001600160a01b031663ecf3a3f96040518163ffffffff1660e01b815260040160206040518083038186803b158015611ea857600080fd5b6002546001600160a01b0316331461375057604051634b98449160e11b815260040160405180910390fd5b670de0b6b3a764000081111561377957604051633c2c00b560e21b815260040160405180910390fd5b600b548181141561379d57604051630333a68160e41b815260040160405180910390fd5b60408051828152602081018490527f6d8ed4ad9ba67058e16e32fc3c8da2e3358da6cd1599e0e0fb2630d0a19fd49c910160405180910390a150600b55565b6003546001600160a01b03163381146138085760405163038cdbad60e31b815260040160405180910390fd5b6002546040516001600160a01b038084169216907fd4459d5b8b913cab0244230fd9b1c08b6ceace7fe9230e60d0f74cbffdf849d090600090a3600280546001600160a01b039092166001600160a01b0319928316179055600380549091169055565b6000611d81600e83613a76565b6060611374600e613a5c565b61388c6136c1565b156138aa57604051631b0e923f60e11b815260040160405180910390fd5b6002546001600160a01b031633146138d557604051634b98449160e11b815260040160405180910390fd5b6003805461ffff60a01b191661010160a01b17905560405133907f28b4c24cb1012c094cd2f59f98e89d791973295f8fda6eaa118022d6d318960a90600090a2565b61391f6136c1565b61393c57604051636e2cff4560e01b815260040160405180910390fd5b6002546001600160a01b0316331461396757604051634b98449160e11b815260040160405180910390fd5b6003805460ff60a81b1916905560405133907fece7583a70a505ef0e36d4dec768f5ae597713e09c26011022599ee01abdabfc90600090a2565b6001600160a01b03163b151590565b6000816139be6002826147d0565b6139d0670de0b6b3a7640000866147f2565b6139da9190614706565b612aa991906147d0565b60008215806139f1575081155b156139fe57506000611d81565b670de0b6b3a7640000613a126002826147d0565b6139d084866147f2565b6001600160a01b038116600090815260208390526040812054612aa9565b6000613a47848484613d5d565b949350505050565b6000613a47848484613da4565b60606000612aa983613f51565b6000613a47848484613fad565b6001600160a01b03811660009081526001830160205260408120541515612aa9565b6000612aa9836001600160a01b03841661403b565b6002546001600160a01b03163314613ad857604051634b98449160e11b815260040160405180910390fd5b565b80471015613b2a5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401611618565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114613b77576040519150601f19603f3d011682016040523d82523d6000602084013e613b7c565b606091505b5050905080611f005760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401611618565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052611f0090849061408a565b6000612aa9836001600160a01b03841661415c565b6000611d81825490565b60606000613a47848461424f565b60008054610100900460ff1615613cb9578160ff166001148015613c955750303b155b613cb15760405162461bcd60e51b815260040161161890614811565b506000919050565b60005460ff808416911610613ce05760405162461bcd60e51b815260040161161890614811565b506000805460ff191660ff92909216919091179055600190565b919050565b600054610100900460ff16613d265760405162461bcd60e51b81526004016116189061485f565b613ad86142c4565b600054610100900460ff16613d555760405162461bcd60e51b81526004016116189061485f565b613ad86142f1565b6001600160a01b0382166000908152602084905260408120805483908110613d8757613d876148aa565b6000918252602090912001546001600160a01b0316949350505050565b6001600160a01b03808316600090815260208581526040808320938516835260019093019052908120548015613f47576000613de16001836146ae565b6001600160a01b03861660009081526020889052604081205491925090613e0a906001906146ae565b9050818114613ec6576001600160a01b0386166000908152602088905260408120805483908110613e3d57613e3d6148aa565b60009182526020808320909101546001600160a01b038a81168452918b90526040909220805491909216925082919085908110613e7c57613e7c6148aa565b600091825260208083209190910180546001600160a01b0319166001600160a01b0394851617905589831682528a8152604080832094909316825260019390930190925290208390555b6001600160a01b0386166000908152602088905260409020805480613eed57613eed6148c0565b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b038881168352898252604080842091891684526001918201909252908220919091559350612aa992505050565b6000915050612aa9565b606081600001805480602002602001604051908101604052809291908181526020018280548015613fa157602002820191906000526020600020905b815481526020019060010190808311613f8d575b50505050509050919050565b6001600160a01b038083166000908152602085815260408083209385168352600190930190529081205461403357506001600160a01b0382811660009081526020858152604080832080546001808201835582865284862090910180546001600160a01b0319169688169687179055815495855290810190925290912091909155612aa9565b506000612aa9565b600081815260018301602052604081205461408257508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155611d81565b506000611d81565b60006140df826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661435a9092919063ffffffff16565b805190915015611f0057808060200190518101906140fd91906147ae565b611f005760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401611618565b600081815260018301602052604081205480156142455760006141806001836146ae565b8554909150600090614194906001906146ae565b90508181146141f95760008660000182815481106141b4576141b46148aa565b90600052602060002001549050808760000184815481106141d7576141d76148aa565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061420a5761420a6148c0565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050611d81565b6000915050611d81565b6001600160a01b038116600090815260208381526040918290208054835181840281018401909452808452606093928301828280156142b757602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311614299575b5050505050905092915050565b600054610100900460ff166142eb5760405162461bcd60e51b81526004016116189061485f565b60018055565b600054610100900460ff166143185760405162461bcd60e51b81526004016116189061485f565b600280546001600160a01b031916339081179091556040516000907fd4459d5b8b913cab0244230fd9b1c08b6ceace7fe9230e60d0f74cbffdf849d0908290a3565b6060613a478484600085856001600160a01b0385163b6143bc5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401611618565b600080866001600160a01b031685876040516143d891906148d6565b60006040518083038185875af1925050503d8060008114614415576040519150601f19603f3d011682016040523d82523d6000602084013e61441a565b606091505b509150915061442a828286614435565b979650505050505050565b60608315614444575081612aa9565b8251156144545782518084602001fd5b8160405162461bcd60e51b8152600401611618919061464c565b6001600160a01b03811681146110cf57600080fd5b60006020828403121561449557600080fd5b8135612aa98161446e565b6000602082840312156144b257600080fd5b5035919050565b6000806000606084860312156144ce57600080fd5b83356144d98161446e565b925060208401356144e98161446e565b929592945050506040919091013590565b6020808252825182820181905260009190848201906040850190845b8181101561453b5783516001600160a01b031683529284019291840191600101614516565b50909695505050505050565b60008060006060848603121561455c57600080fd5b83356145678161446e565b925060208401359150604084013561457e8161446e565b809150509250925092565b6000806000806080858703121561459f57600080fd5b84356145aa8161446e565b935060208501356145ba8161446e565b92506040850135915060608501356145d18161446e565b939692955090935050565b6000806000606084860312156145f157600080fd5b83356145fc8161446e565b9250602084013561460c8161446e565b9150604084013561457e8161446e565b60005b8381101561463757818101518382015260200161461f565b83811115614646576000848401525b50505050565b602081526000825180602084015261466b81604085016020870161461c565b601f01601f19169190910160400192915050565b60006020828403121561469157600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b6000828210156146c0576146c0614698565b500390565b6000602082840312156146d757600080fd5b8151612aa98161446e565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6000821982111561471957614719614698565b500190565b600060001982141561473257614732614698565b5060010190565b80516001600160801b0381168114613cfa57600080fd5b6000806040838503121561476357600080fd5b61476c83614739565b915061477a60208401614739565b90509250929050565b60006001600160801b038083168185168083038211156147a5576147a5614698565b01949350505050565b6000602082840312156147c057600080fd5b81518015158114612aa957600080fd5b6000826147ed57634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561480c5761480c614698565b500290565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b600082516148e881846020870161461c565b919091019291505056fea26469706673582212205ab78b750d90fcb379f22a277fb3b982a66919f2236618f9d242111151f7332564736f6c63430008090033496e697469616c697a61626c653a20636f6e747261637420697320616c726561", + "deployedBytecode": "0x6080604052600436106103a65760003560e01c80637f51bb1f116101e7578063d176e05f1161010d578063f0c80d3b116100a0578063fb01600d1161006f578063fb01600d14610b52578063fc0e74d114610b67578063fcfff16f14610b7c578063ffa1ad7414610b91576103c4565b8063f0c80d3b14610ae7578063f3b27bc314610b07578063f609280914610b1c578063f8977b8414610b32576103c4565b8063df791e50116100dc578063df791e5014610a7c578063e35bff9614610a9c578063eaada38214610abd578063ecf3a3f914610ad2576103c4565b8063d176e05f146109d2578063d283e75f146109f2578063dbe466b114610a12578063dde3ab9514610a32576103c4565b8063984a68b511610185578063b6aa515b11610154578063b6aa515b1461095d578063c415b95c1461097d578063c4d66de814610992578063c4d68a1a146109b2576103c4565b8063984a68b5146108d25780639ab620dd146108f25780639f8f0fa814610907578063afcff50f1461093d576103c4565b806387cddc86116101c157806387cddc861461083c578063892d522a146108725780638a11a3701461089257806396aaccfe146108b2576103c4565b80637f51bb1f146107f2578063833667df146108125780638456cb5914610827576103c4565b80634066fdea116102cc57806363c56d421161026a57806375c6f8ec1161023957806375c6f8ec14610772578063770b69b41461079257806379e40cba146107b25780637d355163146107d2576103c4565b806363c56d42146106fd57806369c5dfd81461071d5780636b4f41af146107325780636c33936714610752576103c4565b806356aaee2d116102a657806356aaee2d146106885780635c975abb146106a857806361d027b3146106bd57806362c06767146106dd576103c4565b80634066fdea14610633578063450058f8146106535780634ff9b74a14610673576103c4565b80632b80cc52116103445780633c2dc254116103135780633c2dc254146105a35780633de2f6b2146105de5780633f4ba83a146105fe5780633f5fc13114610613576103c4565b80632b80cc521461051c5780632bcb849c1461053d5780632dd6adb51461055d5780633605b51b14610581576103c4565b80631ccfbc4f116103805780631ccfbc4f1461048757806323e3fbd5146104bc578063275038d0146104dc5780632adcb0c6146104fc576103c4565b80630c340a24146103dd5780631a0dd00b1461041a5780631a4660ce14610465576103c4565b366103c457604051636436c22d60e11b815260040160405180910390fd5b60405163a0152e6360e01b815260040160405180910390fd5b3480156103e957600080fd5b506002546103fd906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561042657600080fd5b50610455610435366004614483565b6001600160a01b0390811660009081526016602052604090205416151590565b6040519015158152602001610411565b34801561047157600080fd5b506104856104803660046144a0565b610bcf565b005b34801561049357600080fd5b506104a76104a23660046144b9565b610c5d565b60408051928352602083019190915201610411565b3480156104c857600080fd5b506104a76104d7366004614483565b610e20565b3480156104e857600080fd5b506104856104f7366004614483565b611080565b34801561050857600080fd5b506104a76105173660046144b9565b6110d2565b34801561052857600080fd5b50601b5461045590600160a01b900460ff1681565b34801561054957600080fd5b50610485610558366004614483565b611282565b34801561056957600080fd5b50610573600b5481565b604051908152602001610411565b34801561058d57600080fd5b50610596611368565b60405161041191906144fa565b3480156105af57600080fd5b506105c36105be366004614547565b611379565b60408051938452602084019290925290820152606001610411565b3480156105ea57600080fd5b506105c36105f9366004614589565b61159e565b34801561060a57600080fd5b50610485611c30565b34801561061f57600080fd5b5061048561062e366004614483565b611ce0565b34801561063f57600080fd5b506018546103fd906001600160a01b031681565b34801561065f57600080fd5b5061045561066e366004614483565b611d74565b34801561067f57600080fd5b50610596611d87565b34801561069457600080fd5b506104856106a3366004614483565b611d93565b3480156106b457600080fd5b50610455611e44565b3480156106c957600080fd5b50600d546103fd906001600160a01b031681565b3480156106e957600080fd5b506104856106f83660046144b9565b611ee0565b34801561070957600080fd5b50610485610718366004614483565b611f19565b34801561072957600080fd5b50610573601e81565b34801561073e57600080fd5b5061048561074d366004614483565b611fd2565b34801561075e57600080fd5b506105c361076d366004614547565b612178565b34801561077e57600080fd5b5061048561078d366004614483565b612362565b34801561079e57600080fd5b506104856107ad366004614483565b6123b1565b3480156107be57600080fd5b506104856107cd366004614483565b612441565b3480156107de57600080fd5b506105966107ed366004614483565b6125eb565b3480156107fe57600080fd5b5061048561080d366004614483565b6125f8565b34801561081e57600080fd5b50610485612749565b34801561083357600080fd5b506104856127d5565b34801561084857600080fd5b506103fd610857366004614483565b6010602052600090815260409020546001600160a01b031681565b34801561087e57600080fd5b5061048561088d366004614483565b612866565b34801561089e57600080fd5b506003546103fd906001600160a01b031681565b3480156108be57600080fd5b50601b546103fd906001600160a01b031681565b3480156108de57600080fd5b506105736108ed3660046145dc565b61294f565b3480156108fe57600080fd5b50610485612ab0565b34801561091357600080fd5b506103fd610922366004614483565b6016602052600090815260409020546001600160a01b031681565b34801561094957600080fd5b50600c546103fd906001600160a01b031681565b34801561096957600080fd5b50610485610978366004614483565b612b3c565b34801561098957600080fd5b506103fd612bb0565b34801561099e57600080fd5b506104856109ad366004614483565b612c2d565b3480156109be57600080fd5b506104856109cd366004614483565b612cfe565b3480156109de57600080fd5b506105966109ed366004614483565b612eb2565b3480156109fe57600080fd5b50610573610a0d366004614483565b612ebf565b348015610a1e57600080fd5b50610485610a2d366004614483565b613091565b348015610a3e57600080fd5b50610a52610a4d366004614483565b613245565b6040805195151586526020860194909452928401919091526060830152608082015260a001610411565b348015610a8857600080fd5b506104a7610a973660046144b9565b61328f565b348015610aa857600080fd5b50600c5461045590600160a01b900460ff1681565b348015610ac957600080fd5b506103fd61367c565b348015610ade57600080fd5b506104556136c1565b348015610af357600080fd5b50610485610b023660046144a0565b613725565b348015610b1357600080fd5b506104856137dc565b348015610b2857600080fd5b5061057360045481565b348015610b3e57600080fd5b50610455610b4d366004614483565b61386b565b348015610b5e57600080fd5b50610596613878565b348015610b7357600080fd5b50610485613884565b348015610b8857600080fd5b50610485613917565b348015610b9d57600080fd5b50610bc2604051806040016040528060058152602001640312e332e360dc1b81525081565b604051610411919061464c565b6002546001600160a01b03163314610bfa57604051634b98449160e11b815260040160405180910390fd5b60045481811415610c1e57604051630333a68160e41b815260040160405180910390fd5b60408051828152602081018490527f0662703672e57800b9439de3a419c9155283ad25ea7776c139c876bd8b93bb98910160405180910390a150600455565b60185460405163d2d6b5a360e01b8152336004820152600091829182916001600160a01b03169063d2d6b5a39060240160206040518083038186803b158015610ca557600080fd5b505afa158015610cb9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cdd919061467f565b90508015610d1057610d01610cfa82670de0b6b3a76400006146ae565b85906139b0565b9350610d0d84826139e4565b91505b600c60009054906101000a90046001600160a01b03166001600160a01b031663eaada3826040518163ffffffff1660e01b815260040160206040518083038186803b158015610d5e57600080fd5b505afa158015610d72573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d9691906146c5565b6001600160a01b031663b64663848688876040518463ffffffff1660e01b8152600401610dc5939291906146e2565b60206040518083038186803b158015610ddd57600080fd5b505afa158015610df1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e15919061467f565b925050935093915050565b6000806000610e2d61367c565b90506000610e3c601386613a1c565b905060005b81811015611078576000610e5760138884613a3a565b90506000846001600160a01b0316638d0dba00836001600160a01b0316636f307dc36040518163ffffffff1660e01b815260040160206040518083038186803b158015610ea357600080fd5b505afa158015610eb7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610edb91906146c5565b6040516370a0823160e01b81526001600160a01b038c811660048301528616906370a082319060240160206040518083038186803b158015610f1c57600080fd5b505afa158015610f30573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f54919061467f565b6040516001600160e01b031960e085901b1681526001600160a01b039092166004830152602482015260440160206040518083038186803b158015610f9857600080fd5b505afa158015610fac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fd0919061467f565b9050610fdc8188614706565b9650611059826001600160a01b031663df011c416040518163ffffffff1660e01b815260040160206040518083038186803b15801561101a57600080fd5b505afa15801561102e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611052919061467f565b82906139e4565b6110639087614706565b95505050806110719061471e565b9050610e41565b505050915091565b6110893361386b565b6110a6576040516326688ebb60e11b815260040160405180910390fd5b6110b260138233613a4f565b6110cf5760405163a67d528360e01b815260040160405180910390fd5b50565b600080600c60009054906101000a90046001600160a01b03166001600160a01b031663eaada3826040518163ffffffff1660e01b815260040160206040518083038186803b15801561112357600080fd5b505afa158015611137573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061115b91906146c5565b6001600160a01b031663b64663848686866040518463ffffffff1660e01b815260040161118a939291906146e2565b60206040518083038186803b1580156111a257600080fd5b505afa1580156111b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111da919061467f565b60185460405163d2d6b5a360e01b81523360048201529193506000916001600160a01b039091169063d2d6b5a39060240160206040518083038186803b15801561122357600080fd5b505afa158015611237573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061125b919061467f565b905080156112795761126d83826139e4565b9150610e1582846146ae565b50935093915050565b6002546001600160a01b031633146112ad57604051634b98449160e11b815260040160405180910390fd5b6001600160a01b0381166112d45760405163fb7566d760e01b815260040160405180910390fd5b6018546001600160a01b0390811690821681141561130557604051630333a68160e41b815260040160405180910390fd5b816001600160a01b0316816001600160a01b03167f66fa9df7ccacf7a0c110fd7dd4591f59c76a798409b4aeaf850002679baca45560405160405180910390a350601880546001600160a01b0319166001600160a01b0392909216919091179055565b60606113746019613a5c565b905090565b6018546040805163cfc0c69f60e01b8152815160009384938493849384936001600160a01b03169263cfc0c69f9260048082019391829003018186803b1580156113c257600080fd5b505afa1580156113d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113fa9190614750565b9092509050600061140b8383614783565b6001600160801b0316905087811561143c5761143961143283670de0b6b3a7640000614706565b82906139b0565b90505b61144461367c565b6001600160a01b031663b6466384896001600160a01b0316636f307dc36040518163ffffffff1660e01b815260040160206040518083038186803b15801561148b57600080fd5b505afa15801561149f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114c391906146c5565b8c846040518463ffffffff1660e01b81526004016114e3939291906146e2565b60206040518083038186803b1580156114fb57600080fd5b505afa15801561150f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611533919061467f565b96506001600160801b0383161561155a57611557816001600160801b0385166139e4565b94505b6001600160801b038416156115915761158e61157e85670de0b6b3a7640000614783565b82906001600160801b03166139e4565b95505b5050505093509350939050565b60008060006115ab6136c1565b156115c957604051631b0e923f60e11b815260040160405180910390fd5b600260015414156116215760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b60026001556001600160a01b038088166000908152601660205260409020548891166116605760405163a596698b60e01b815260040160405180910390fd5b8461166a8161386b565b6116875760405163a67d528360e01b815260040160405180910390fd5b866116a5576040516310eb483f60e21b815260040160405180910390fd5b336001600160a01b03891614156116cf57604051630ecda8a760e01b815260040160405180910390fd5b6001600160a01b03808a1660009081526016602052604080822054815163a6afed9560e01b81529151931692839263a6afed95926004808201939182900301818387803b15801561171f57600080fd5b505af1158015611733573d6000803e3d6000fd5b5050505060006117428a613245565b50505050905080156117675760405163202881bd60e11b815260040160405180910390fd5b6040516370a0823160e01b81526001600160a01b038b81166004830152600091908416906370a082319060240160206040518083038186803b1580156117ac57600080fd5b505afa1580156117c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117e4919061467f565b600b549091506117f48b836139b0565b11156118135760405163e292f24f60e01b815260040160405180910390fd5b600061181d61367c565b600454909150156118f35760006001600160a01b038216638d0dba008f6118448f876146ae565b6040516001600160e01b031960e085901b1681526001600160a01b039092166004830152602482015260440160206040518083038186803b15801561188857600080fd5b505afa15801561189c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118c0919061467f565b90506000811180156118d3575060045481105b156118f1576040516332b9d47360e01b815260040160405180910390fd5b505b6118fe8d8c8c612178565b6040516370a0823160e01b8152929b5090995097506001600160a01b038b16906370a0823190611941908f906004016001600160a01b0391909116815260200190565b60206040518083038186803b15801561195957600080fd5b505afa15801561196d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611991919061467f565b8911156119b157604051635de1e54160e01b815260040160405180910390fd5b604051632770a7eb60e21b8152336004820152602481018c90526001600160a01b038e1690639dc29fac90604401600060405180830381600087803b1580156119f957600080fd5b505af1158015611a0d573d6000803e3d6000fd5b5050604051632770a7eb60e21b81526001600160a01b038f81166004830152602482018f905287169250639dc29fac9150604401600060405180830381600087803b158015611a5b57600080fd5b505af1158015611a6f573d6000803e3d6000fd5b505060405163b2a02ff160e01b81526001600160a01b038d16925063b2a02ff19150611aa3908f9033908d906004016146e2565b600060405180830381600087803b158015611abd57600080fd5b505af1158015611ad1573d6000803e3d6000fd5b505050506000871115611bc657896001600160a01b031663b2a02ff18d600c60009054906101000a90046001600160a01b03166001600160a01b031663c415b95c6040518163ffffffff1660e01b815260040160206040518083038186803b158015611b3c57600080fd5b505afa158015611b50573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b7491906146c5565b8a6040518463ffffffff1660e01b8152600401611b93939291906146e2565b600060405180830381600087803b158015611bad57600080fd5b505af1158015611bc1573d6000803e3d6000fd5b505050505b604080518c8152602081018b90529081018890526001600160a01b03808f1691908e169033907fe1c3870e3d7d5199a16d200133088e6e3f7012d28571e442a110b4c83b5e3b949060600160405180910390a4505050505050600180819055509450945094915050565b611c38611e44565b611c555760405163bc871ce560e01b815260040160405180910390fd5b611c5d6136c1565b15611c7b57604051631b0e923f60e11b815260040160405180910390fd5b6002546001600160a01b03163314611ca657604051634b98449160e11b815260040160405180910390fd5b6003805460ff60a01b1916905560405133907f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa90600090a2565b611ce93361386b565b611d06576040516326688ebb60e11b815260040160405180910390fd5b80601e611d14601383613a1c565b611d1f601484613a1c565b611d299190614706565b10611d47576040516306ceeb8360e21b815260040160405180910390fd5b611d5360138333613a69565b611d705760405163dd40dad960e01b815260040160405180910390fd5b5050565b6000611d81601183613a76565b92915050565b60606113746011613a5c565b6002546001600160a01b03163314611dbe57604051634b98449160e11b815260040160405180910390fd5b6001600160a01b038116611de55760405163fb7566d760e01b815260040160405180910390fd5b611df0601982613a98565b611e0d57604051631e577fa560e31b815260040160405180910390fd5b6040516001600160a01b038216907f5579b1eead2d904c2b05255a92f5a4a4f3e234ae0a4efe538adef3c1794e1cea90600090a250565b600354600090600160a01b900460ff16806113745750600c60009054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b815260040160206040518083038186803b158015611ea857600080fd5b505afa158015611ebc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061137491906147ae565b611ee8613aad565b6001600160a01b038316611f0557611f008282613ada565b505050565b611f006001600160a01b0384168383613bf3565b6002546001600160a01b03163314611f4457604051634b98449160e11b815260040160405180910390fd5b6001600160a01b038116611f6b5760405163fb7566d760e01b815260040160405180910390fd5b611f76601982613c45565b611f93576040516362c4c75f60e01b815260040160405180910390fd5b6040516001600160a01b03821681527f5412e32b52c11e4b232ab59f3660d55b48eb20735ccb2c67a0a1ebea0d6fe0199060200160405180910390a150565b6002546001600160a01b03163314611ffd57604051634b98449160e11b815260040160405180910390fd5b6001600160a01b0381166120245760405163fb7566d760e01b815260040160405180910390fd5b6000816001600160a01b0316638230ecd66040518163ffffffff1660e01b815260040160206040518083038186803b15801561205f57600080fd5b505afa158015612073573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061209791906146c5565b90506001600160a01b0381166120c05760405163013a1b4360e51b815260040160405180910390fd5b6001600160a01b0381811660009081526016602052604090205416156120f95760405163fa9b809960e01b815260040160405180910390fd5b612104601183613a98565b61212157604051631f477b5760e11b815260040160405180910390fd5b6001600160a01b0381811660009081526016602052604080822080546001600160a01b0319169386169384179055517fad48bee6bbb1b8ece321157ad29afc3c6baa177f8dc043132d65038cc601cdd69190a25050565b600080600061218561367c565b6001600160a01b031663b646638487866001600160a01b0316636f307dc36040518163ffffffff1660e01b815260040160206040518083038186803b1580156121cd57600080fd5b505afa1580156121e1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061220591906146c5565b886040518463ffffffff1660e01b8152600401612224939291906146e2565b60206040518083038186803b15801561223c57600080fd5b505afa158015612250573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612274919061467f565b6018546040805163cfc0c69f60e01b8152815193955060009384936001600160a01b03169263cfc0c69f9260048082019391829003018186803b1580156122ba57600080fd5b505afa1580156122ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122f29190614750565b90925090506001600160801b0381161561231c57612319846001600160801b0383166139e4565b92505b6001600160801b0382161561234b5761233e846001600160801b0384166139e4565b6123489085614706565b93505b6123558484614706565b9450505093509350939050565b61236b33611d74565b612388576040516304f8b91760e51b815260040160405180910390fd5b61239460148233613a4f565b6110cf576040516359c937f160e01b815260040160405180910390fd5b6123ba33611d74565b6123d7576040516304f8b91760e51b815260040160405180910390fd5b80601e6123e5601383613a1c565b6123f0601484613a1c565b6123fa9190614706565b10612418576040516306ceeb8360e21b815260040160405180910390fd5b61242460148333613a69565b611d7057604051631f477b5760e11b815260040160405180910390fd5b6002546001600160a01b0316331461246c57604051634b98449160e11b815260040160405180910390fd5b6001600160a01b0381166124935760405163fb7566d760e01b815260040160405180910390fd5b6000816001600160a01b0316636f307dc36040518163ffffffff1660e01b815260040160206040518083038186803b1580156124ce57600080fd5b505afa1580156124e2573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061250691906146c5565b6001600160a01b0380821660009081526010602052604090205491925016156125425760405163374f601360e11b815260040160405180910390fd5b601e61254e600e613c5a565b1061256c5760405163225b605b60e21b815260040160405180910390fd5b612577600e83613a98565b6125945760405163dd40dad960e01b815260040160405180910390fd5b6001600160a01b0381811660009081526010602052604080822080546001600160a01b0319169386169384179055517fdc705e658c7b6c6c01f5802457bf4ffb99f204bf1603e7b1ae3d4c7536611bc29190a25050565b6060611d81601383613c64565b6002546001600160a01b0316331461262357604051634b98449160e11b815260040160405180910390fd5b6001600160a01b03811661264a5760405163fb7566d760e01b815260040160405180910390fd5b600d546001600160a01b0390811690821681141561267b57604051630333a68160e41b815260040160405180910390fd5b6001600160a01b038116156126e6576040516326ed7c7960e11b81526001600160a01b038381166004830152821690634ddaf8f290602401600060405180830381600087803b1580156126cd57600080fd5b505af11580156126e1573d6000803e3d6000fd5b505050505b816001600160a01b0316816001600160a01b03167f4ab5be82436d353e61ca18726e984e561f5c1cc7c6d38b29d2553c790434705a60405160405180910390a350600d80546001600160a01b0319166001600160a01b0392909216919091179055565b6002546001600160a01b0316331461277457604051634b98449160e11b815260040160405180910390fd5b601b54604051600160a01b90910460ff1615808252907f0269774d3426d7e61b04b7d5129948b9f4edf9b937bb0c657fbb32a94a7996ec9060200160405180910390a1601b8054911515600160a01b0260ff60a01b19909216919091179055565b6127dd611e44565b156127fb57604051631309a56360e01b815260040160405180910390fd5b6002546001600160a01b0316331461282657604051634b98449160e11b815260040160405180910390fd5b6003805460ff60a01b1916600160a01b17905560405133907f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25890600090a2565b6002546001600160a01b0316331461289157604051634b98449160e11b815260040160405180910390fd5b6001600160a01b0381166128b85760405163fb7566d760e01b815260040160405180910390fd5b601b546001600160a01b039081169082168114156128e957604051630333a68160e41b815260040160405180910390fd5b604080516001600160a01b038084168252841660208201527f01b723df71593f812e405dc433f7dcf4134ff941def9d2e189a31f3cb1b1963b910160405180910390a150601b80546001600160a01b0319166001600160a01b0392909216919091179055565b60008061295b84613245565b5050505090508015612971576000915050612aa9565b6040516370a0823160e01b81526001600160a01b0385811660048301526000916129fa918891908716906370a082319060240160206040518083038186803b1580156129bc57600080fd5b505afa1580156129d0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129f4919061467f565b86611379565b5050600b546001600160a01b03888116600090815260166020526040908190205490516370a0823160e01b81528983166004820152939450612a98939116906370a082319060240160206040518083038186803b158015612a5a57600080fd5b505afa158015612a6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a92919061467f565b906139e4565b925082811015612aa6578092505b50505b9392505050565b6002546001600160a01b03163314612adb57604051634b98449160e11b815260040160405180910390fd5b600c54604051600160a01b90910460ff1615808252907fc8011ac148e14ab1e8f93a022ebc29088beedc705027c8eb9514d6d69c5b23639060200160405180910390a1600c8054911515600160a01b0260ff60a01b19909216919091179055565b6002546001600160a01b03163314612b6757604051634b98449160e11b815260040160405180910390fd5b6001600160a01b038116612b8e57604051634c267bfb60e01b815260040160405180910390fd5b600380546001600160a01b0319166001600160a01b0392909216919091179055565b600c54604080516331056e5760e21b815290516000926001600160a01b03169163c415b95c916004808301926020929190829003018186803b158015612bf557600080fd5b505afa158015612c09573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061137491906146c5565b6000612c396001613c72565b90508015612c51576000805461ff0019166101001790555b6001600160a01b038216612c7857604051637cb62f2b60e11b815260040160405180910390fd5b612c80613cff565b612c88613d2e565b600c80546001600160a81b0319166001600160a01b03841617600160a01b1790556706f05b59d3b20000600b558015611d70576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050565b6002546001600160a01b03163314612d2957604051634b98449160e11b815260040160405180910390fd5b6000816001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015612d6457600080fd5b505afa158015612d78573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d9c919061467f565b1115612dbb5760405163066097f160e31b815260040160405180910390fd5b612dc6601182613c45565b612de3576040516359c937f160e01b815260040160405180910390fd5b60166000826001600160a01b0316638230ecd66040518163ffffffff1660e01b815260040160206040518083038186803b158015612e2057600080fd5b505afa158015612e34573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e5891906146c5565b6001600160a01b03908116825260208201929092526040908101600090812080546001600160a01b03191690559051918316917f81e9205ee5a9e1289fad5baa5e74bd49d4613652eb4626bb15925bf9fdbc0feb9190a250565b6060611d81601483613c64565b600080612eca61367c565b90506000612ed9601485613a1c565b905060005b81811015613089576000612ef460148784613a3a565b9050836001600160a01b0316638d0dba00826001600160a01b0316638230ecd66040518163ffffffff1660e01b815260040160206040518083038186803b158015612f3e57600080fd5b505afa158015612f52573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f7691906146c5565b6040516370a0823160e01b81526001600160a01b038a811660048301528516906370a082319060240160206040518083038186803b158015612fb757600080fd5b505afa158015612fcb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612fef919061467f565b6040516001600160e01b031960e085901b1681526001600160a01b039092166004830152602482015260440160206040518083038186803b15801561303357600080fd5b505afa158015613047573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061306b919061467f565b6130759086614706565b945050806130829061471e565b9050612ede565b505050919050565b6002546001600160a01b031633146130bc57604051634b98449160e11b815260040160405180910390fd5b6000816001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156130f757600080fd5b505afa15801561310b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061312f919061467f565b111561314e5760405163066097f160e31b815260040160405180910390fd5b613159600e82613c45565b6131765760405163a67d528360e01b815260040160405180910390fd5b60106000826001600160a01b0316636f307dc36040518163ffffffff1660e01b815260040160206040518083038186803b1580156131b357600080fd5b505afa1580156131c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131eb91906146c5565b6001600160a01b03908116825260208201929092526040908101600090812080546001600160a01b03191690559051918316917fe5a19a76470297a1f85f9a38f3ff148b4c8cdc1209e074dbe59db5e22eb31a3a9190a250565b600080600080600061325686612ebf565b925061326186610e20565b808511159650909450915081831061327a576000613284565b61328483836146ae565b905091939590929450565b60008061329a6136c1565b156132b857604051631b0e923f60e11b815260040160405180910390fd5b6002600154141561330b5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401611618565b60026001556001600160a01b0380861660009081526016602052604090205486911661334a5760405163a596698b60e01b815260040160405180910390fd5b6001600160a01b038086166000908152601660205260409020548691166133845760405163a596698b60e01b815260040160405180910390fd5b600c54600160a01b900460ff166133ae57604051633840404b60e21b815260040160405180910390fd5b84158061343057506040516370a0823160e01b81523360048201526001600160a01b038816906370a082319060240160206040518083038186803b1580156133f557600080fd5b505afa158015613409573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061342d919061467f565b85115b1561344e5760405163ca99073960e01b815260040160405180910390fd5b604051632770a7eb60e21b8152336004820152602481018690526001600160a01b03881690639dc29fac90604401600060405180830381600087803b15801561349657600080fd5b505af11580156134aa573d6000803e3d6000fd5b505050506134b98787876110d2565b909450925082156135ba57856001600160a01b03166340c10f19600c60009054906101000a90046001600160a01b03166001600160a01b031663c415b95c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561352157600080fd5b505afa158015613535573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061355991906146c5565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101869052604401600060405180830381600087803b1580156135a157600080fd5b505af11580156135b5573d6000803e3d6000fd5b505050505b6040516340c10f1960e01b8152336004820152602481018590526001600160a01b038716906340c10f1990604401600060405180830381600087803b15801561360257600080fd5b505af1158015613616573d6000803e3d6000fd5b505060408051888152602081018890529081018690526001600160a01b03808a1693508a16915033907fafd74f009c0ff7627726f24b568ee5529cd297f6a7a1e43ec363443a13a584209060600160405180910390a45050600180559094909350915050565b600c5460408051637556d1c160e11b815290516000926001600160a01b03169163eaada382916004808301926020929190829003018186803b158015612bf557600080fd5b600354600090600160a81b900460ff16806113745750600c60009054906101000a90046001600160a01b03166001600160a01b031663ecf3a3f96040518163ffffffff1660e01b815260040160206040518083038186803b158015611ea857600080fd5b6002546001600160a01b0316331461375057604051634b98449160e11b815260040160405180910390fd5b670de0b6b3a764000081111561377957604051633c2c00b560e21b815260040160405180910390fd5b600b548181141561379d57604051630333a68160e41b815260040160405180910390fd5b60408051828152602081018490527f6d8ed4ad9ba67058e16e32fc3c8da2e3358da6cd1599e0e0fb2630d0a19fd49c910160405180910390a150600b55565b6003546001600160a01b03163381146138085760405163038cdbad60e31b815260040160405180910390fd5b6002546040516001600160a01b038084169216907fd4459d5b8b913cab0244230fd9b1c08b6ceace7fe9230e60d0f74cbffdf849d090600090a3600280546001600160a01b039092166001600160a01b0319928316179055600380549091169055565b6000611d81600e83613a76565b6060611374600e613a5c565b61388c6136c1565b156138aa57604051631b0e923f60e11b815260040160405180910390fd5b6002546001600160a01b031633146138d557604051634b98449160e11b815260040160405180910390fd5b6003805461ffff60a01b191661010160a01b17905560405133907f28b4c24cb1012c094cd2f59f98e89d791973295f8fda6eaa118022d6d318960a90600090a2565b61391f6136c1565b61393c57604051636e2cff4560e01b815260040160405180910390fd5b6002546001600160a01b0316331461396757604051634b98449160e11b815260040160405180910390fd5b6003805460ff60a81b1916905560405133907fece7583a70a505ef0e36d4dec768f5ae597713e09c26011022599ee01abdabfc90600090a2565b6001600160a01b03163b151590565b6000816139be6002826147d0565b6139d0670de0b6b3a7640000866147f2565b6139da9190614706565b612aa991906147d0565b60008215806139f1575081155b156139fe57506000611d81565b670de0b6b3a7640000613a126002826147d0565b6139d084866147f2565b6001600160a01b038116600090815260208390526040812054612aa9565b6000613a47848484613d5d565b949350505050565b6000613a47848484613da4565b60606000612aa983613f51565b6000613a47848484613fad565b6001600160a01b03811660009081526001830160205260408120541515612aa9565b6000612aa9836001600160a01b03841661403b565b6002546001600160a01b03163314613ad857604051634b98449160e11b815260040160405180910390fd5b565b80471015613b2a5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401611618565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114613b77576040519150601f19603f3d011682016040523d82523d6000602084013e613b7c565b606091505b5050905080611f005760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401611618565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052611f0090849061408a565b6000612aa9836001600160a01b03841661415c565b6000611d81825490565b60606000613a47848461424f565b60008054610100900460ff1615613cb9578160ff166001148015613c955750303b155b613cb15760405162461bcd60e51b815260040161161890614811565b506000919050565b60005460ff808416911610613ce05760405162461bcd60e51b815260040161161890614811565b506000805460ff191660ff92909216919091179055600190565b919050565b600054610100900460ff16613d265760405162461bcd60e51b81526004016116189061485f565b613ad86142c4565b600054610100900460ff16613d555760405162461bcd60e51b81526004016116189061485f565b613ad86142f1565b6001600160a01b0382166000908152602084905260408120805483908110613d8757613d876148aa565b6000918252602090912001546001600160a01b0316949350505050565b6001600160a01b03808316600090815260208581526040808320938516835260019093019052908120548015613f47576000613de16001836146ae565b6001600160a01b03861660009081526020889052604081205491925090613e0a906001906146ae565b9050818114613ec6576001600160a01b0386166000908152602088905260408120805483908110613e3d57613e3d6148aa565b60009182526020808320909101546001600160a01b038a81168452918b90526040909220805491909216925082919085908110613e7c57613e7c6148aa565b600091825260208083209190910180546001600160a01b0319166001600160a01b0394851617905589831682528a8152604080832094909316825260019390930190925290208390555b6001600160a01b0386166000908152602088905260409020805480613eed57613eed6148c0565b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b038881168352898252604080842091891684526001918201909252908220919091559350612aa992505050565b6000915050612aa9565b606081600001805480602002602001604051908101604052809291908181526020018280548015613fa157602002820191906000526020600020905b815481526020019060010190808311613f8d575b50505050509050919050565b6001600160a01b038083166000908152602085815260408083209385168352600190930190529081205461403357506001600160a01b0382811660009081526020858152604080832080546001808201835582865284862090910180546001600160a01b0319169688169687179055815495855290810190925290912091909155612aa9565b506000612aa9565b600081815260018301602052604081205461408257508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155611d81565b506000611d81565b60006140df826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661435a9092919063ffffffff16565b805190915015611f0057808060200190518101906140fd91906147ae565b611f005760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401611618565b600081815260018301602052604081205480156142455760006141806001836146ae565b8554909150600090614194906001906146ae565b90508181146141f95760008660000182815481106141b4576141b46148aa565b90600052602060002001549050808760000184815481106141d7576141d76148aa565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061420a5761420a6148c0565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050611d81565b6000915050611d81565b6001600160a01b038116600090815260208381526040918290208054835181840281018401909452808452606093928301828280156142b757602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311614299575b5050505050905092915050565b600054610100900460ff166142eb5760405162461bcd60e51b81526004016116189061485f565b60018055565b600054610100900460ff166143185760405162461bcd60e51b81526004016116189061485f565b600280546001600160a01b031916339081179091556040516000907fd4459d5b8b913cab0244230fd9b1c08b6ceace7fe9230e60d0f74cbffdf849d0908290a3565b6060613a478484600085856001600160a01b0385163b6143bc5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401611618565b600080866001600160a01b031685876040516143d891906148d6565b60006040518083038185875af1925050503d8060008114614415576040519150601f19603f3d011682016040523d82523d6000602084013e61441a565b606091505b509150915061442a828286614435565b979650505050505050565b60608315614444575081612aa9565b8251156144545782518084602001fd5b8160405162461bcd60e51b8152600401611618919061464c565b6001600160a01b03811681146110cf57600080fd5b60006020828403121561449557600080fd5b8135612aa98161446e565b6000602082840312156144b257600080fd5b5035919050565b6000806000606084860312156144ce57600080fd5b83356144d98161446e565b925060208401356144e98161446e565b929592945050506040919091013590565b6020808252825182820181905260009190848201906040850190845b8181101561453b5783516001600160a01b031683529284019291840191600101614516565b50909695505050505050565b60008060006060848603121561455c57600080fd5b83356145678161446e565b925060208401359150604084013561457e8161446e565b809150509250925092565b6000806000806080858703121561459f57600080fd5b84356145aa8161446e565b935060208501356145ba8161446e565b92506040850135915060608501356145d18161446e565b939692955090935050565b6000806000606084860312156145f157600080fd5b83356145fc8161446e565b9250602084013561460c8161446e565b9150604084013561457e8161446e565b60005b8381101561463757818101518382015260200161461f565b83811115614646576000848401525b50505050565b602081526000825180602084015261466b81604085016020870161461c565b601f01601f19169190910160400192915050565b60006020828403121561469157600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b6000828210156146c0576146c0614698565b500390565b6000602082840312156146d757600080fd5b8151612aa98161446e565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6000821982111561471957614719614698565b500190565b600060001982141561473257614732614698565b5060010190565b80516001600160801b0381168114613cfa57600080fd5b6000806040838503121561476357600080fd5b61476c83614739565b915061477a60208401614739565b90509250929050565b60006001600160801b038083168185168083038211156147a5576147a5614698565b01949350505050565b6000602082840312156147c057600080fd5b81518015158114612aa957600080fd5b6000826147ed57634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561480c5761480c614698565b500290565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b600082516148e881846020870161461c565b919091019291505056fea26469706673582212205ab78b750d90fcb379f22a277fb3b982a66919f2236618f9d242111151f7332564736f6c63430008090033", "devdoc": { "kind": "dev", "methods": { @@ -1782,6 +1815,9 @@ }, "userdoc": { "events": { + "BridgingIsActiveUpdated(bool)": { + "notice": "Emitted when flag for pause bridge transfer is toggled" + }, "DebtFloorUpdated(uint256,uint256)": { "notice": "Emitted when protocol liquidation fee is updated" }, @@ -1914,6 +1950,9 @@ "governor()": { "notice": "The governor" }, + "isBridgingActive()": { + "notice": "Flag that pause/unpause pool's cross-chain activities" + }, "isSwapActive()": { "notice": "Swap feature on/off flag" }, @@ -1974,6 +2013,9 @@ "sweep(address,address,uint256)": { "notice": "ERC20 recovery in case of stuck tokens due direct transfers to the contract address." }, + "toggleBridgingIsActive()": { + "notice": "Pause/Unpause bridge transfers" + }, "toggleIsSwapActive()": { "notice": "Turn swap on/off" }, @@ -2004,7 +2046,7 @@ "storageLayout": { "storage": [ { - "astId": 19718, + "astId": 19848, "contract": "contracts/Pool.sol:Pool", "label": "_initialized", "offset": 0, @@ -2012,7 +2054,7 @@ "type": "t_uint8" }, { - "astId": 19721, + "astId": 19851, "contract": "contracts/Pool.sol:Pool", "label": "_initializing", "offset": 1, @@ -2020,7 +2062,7 @@ "type": "t_bool" }, { - "astId": 33546, + "astId": 33742, "contract": "contracts/Pool.sol:Pool", "label": "_status", "offset": 0, @@ -2028,7 +2070,7 @@ "type": "t_uint256" }, { - "astId": 14069, + "astId": 14199, "contract": "contracts/Pool.sol:Pool", "label": "governor", "offset": 0, @@ -2036,7 +2078,7 @@ "type": "t_address" }, { - "astId": 14072, + "astId": 14202, "contract": "contracts/Pool.sol:Pool", "label": "proposedGovernor", "offset": 0, @@ -2044,7 +2086,7 @@ "type": "t_address" }, { - "astId": 33168, + "astId": 33364, "contract": "contracts/Pool.sol:Pool", "label": "_paused", "offset": 20, @@ -2052,7 +2094,7 @@ "type": "t_bool" }, { - "astId": 33170, + "astId": 33366, "contract": "contracts/Pool.sol:Pool", "label": "_everythingStopped", "offset": 21, @@ -2060,7 +2102,7 @@ "type": "t_bool" }, { - "astId": 31074, + "astId": 31226, "contract": "contracts/Pool.sol:Pool", "label": "debtFloorInUsd", "offset": 0, @@ -2068,7 +2110,7 @@ "type": "t_uint256" }, { - "astId": 31076, + "astId": 31228, "contract": "contracts/Pool.sol:Pool", "label": "depositFee__DEPRECATED", "offset": 0, @@ -2076,7 +2118,7 @@ "type": "t_uint256" }, { - "astId": 31078, + "astId": 31230, "contract": "contracts/Pool.sol:Pool", "label": "issueFee__DEPRECATED", "offset": 0, @@ -2084,7 +2126,7 @@ "type": "t_uint256" }, { - "astId": 31080, + "astId": 31232, "contract": "contracts/Pool.sol:Pool", "label": "withdrawFee__DEPRECATED", "offset": 0, @@ -2092,7 +2134,7 @@ "type": "t_uint256" }, { - "astId": 31082, + "astId": 31234, "contract": "contracts/Pool.sol:Pool", "label": "repayFee__DEPRECATED", "offset": 0, @@ -2100,7 +2142,7 @@ "type": "t_uint256" }, { - "astId": 31084, + "astId": 31236, "contract": "contracts/Pool.sol:Pool", "label": "swapFee__DEPRECATED", "offset": 0, @@ -2108,7 +2150,7 @@ "type": "t_uint256" }, { - "astId": 31086, + "astId": 31238, "contract": "contracts/Pool.sol:Pool", "label": "liquidationFees__DEPRECATED", "offset": 0, @@ -2116,7 +2158,7 @@ "type": "t_uint256" }, { - "astId": 31090, + "astId": 31242, "contract": "contracts/Pool.sol:Pool", "label": "maxLiquidable", "offset": 0, @@ -2124,15 +2166,15 @@ "type": "t_uint256" }, { - "astId": 31095, + "astId": 31247, "contract": "contracts/Pool.sol:Pool", "label": "poolRegistry", "offset": 0, "slot": "12", - "type": "t_contract(IPoolRegistry)27964" + "type": "t_contract(IPoolRegistry)28094" }, { - "astId": 31099, + "astId": 31251, "contract": "contracts/Pool.sol:Pool", "label": "isSwapActive", "offset": 20, @@ -2140,100 +2182,108 @@ "type": "t_bool" }, { - "astId": 31104, + "astId": 31256, "contract": "contracts/Pool.sol:Pool", "label": "treasury", "offset": 0, "slot": "13", - "type": "t_contract(ITreasury)28356" + "type": "t_contract(ITreasury)28486" }, { - "astId": 31108, + "astId": 31260, "contract": "contracts/Pool.sol:Pool", "label": "depositTokens", "offset": 0, "slot": "14", - "type": "t_struct(AddressSet)23727_storage" + "type": "t_struct(AddressSet)23857_storage" }, { - "astId": 31116, + "astId": 31268, "contract": "contracts/Pool.sol:Pool", "label": "depositTokenOf", "offset": 0, "slot": "16", - "type": "t_mapping(t_contract(IERC20)21889,t_contract(IDepositToken)27459)" + "type": "t_mapping(t_contract(IERC20)22019,t_contract(IDepositToken)27589)" }, { - "astId": 31120, + "astId": 31272, "contract": "contracts/Pool.sol:Pool", "label": "debtTokens", "offset": 0, "slot": "17", - "type": "t_struct(AddressSet)23727_storage" + "type": "t_struct(AddressSet)23857_storage" }, { - "astId": 31124, + "astId": 31276, "contract": "contracts/Pool.sol:Pool", "label": "depositTokensOfAccount", "offset": 0, "slot": "19", - "type": "t_struct(AddressSet)28983_storage" + "type": "t_struct(AddressSet)29127_storage" }, { - "astId": 31128, + "astId": 31280, "contract": "contracts/Pool.sol:Pool", "label": "debtTokensOfAccount", "offset": 0, "slot": "20", - "type": "t_struct(AddressSet)28983_storage" + "type": "t_struct(AddressSet)29127_storage" }, { - "astId": 31133, + "astId": 31285, "contract": "contracts/Pool.sol:Pool", "label": "rewardsDistributors__DEPRECATED", "offset": 0, "slot": "21", - "type": "t_array(t_contract(IRewardsDistributor)28165)dyn_storage" + "type": "t_array(t_contract(IRewardsDistributor)28295)dyn_storage" }, { - "astId": 31141, + "astId": 31293, "contract": "contracts/Pool.sol:Pool", "label": "debtTokenOf", "offset": 0, "slot": "22", - "type": "t_mapping(t_contract(ISyntheticToken)28341,t_contract(IDebtToken)27316)" + "type": "t_mapping(t_contract(ISyntheticToken)28471,t_contract(IDebtToken)27446)" }, { - "astId": 31147, + "astId": 31299, "contract": "contracts/Pool.sol:Pool", "label": "swapper__DEPRECATED", "offset": 0, "slot": "23", - "type": "t_contract(ISwapper)28584" + "type": "t_contract(ISwapper)28714" }, { - "astId": 31152, + "astId": 31304, "contract": "contracts/Pool.sol:Pool", "label": "feeProvider", "offset": 0, "slot": "24", - "type": "t_contract(IFeeProvider)27507" + "type": "t_contract(IFeeProvider)27637" }, { - "astId": 31156, + "astId": 31308, "contract": "contracts/Pool.sol:Pool", "label": "rewardsDistributors", "offset": 0, "slot": "25", - "type": "t_struct(AddressSet)23727_storage" + "type": "t_struct(AddressSet)23857_storage" }, { - "astId": 31163, + "astId": 31315, "contract": "contracts/Pool.sol:Pool", "label": "smartFarmingManager", "offset": 0, "slot": "27", - "type": "t_contract(ISmartFarmingManager)28273" + "type": "t_contract(ISmartFarmingManager)28403" + }, + { + "astId": 31321, + "contract": "contracts/Pool.sol:Pool", + "label": "isBridgingActive", + "offset": 20, + "slot": "27", + "type": "t_bool" } ], "types": { @@ -2254,8 +2304,8 @@ "label": "bytes32[]", "numberOfBytes": "32" }, - "t_array(t_contract(IRewardsDistributor)28165)dyn_storage": { - "base": "t_contract(IRewardsDistributor)28165", + "t_array(t_contract(IRewardsDistributor)28295)dyn_storage": { + "base": "t_contract(IRewardsDistributor)28295", "encoding": "dynamic_array", "label": "contract IRewardsDistributor[]", "numberOfBytes": "32" @@ -2270,62 +2320,62 @@ "label": "bytes32", "numberOfBytes": "32" }, - "t_contract(IDebtToken)27316": { + "t_contract(IDebtToken)27446": { "encoding": "inplace", "label": "contract IDebtToken", "numberOfBytes": "20" }, - "t_contract(IDepositToken)27459": { + "t_contract(IDepositToken)27589": { "encoding": "inplace", "label": "contract IDepositToken", "numberOfBytes": "20" }, - "t_contract(IERC20)21889": { + "t_contract(IERC20)22019": { "encoding": "inplace", "label": "contract IERC20", "numberOfBytes": "20" }, - "t_contract(IFeeProvider)27507": { + "t_contract(IFeeProvider)27637": { "encoding": "inplace", "label": "contract IFeeProvider", "numberOfBytes": "20" }, - "t_contract(IPoolRegistry)27964": { + "t_contract(IPoolRegistry)28094": { "encoding": "inplace", "label": "contract IPoolRegistry", "numberOfBytes": "20" }, - "t_contract(IRewardsDistributor)28165": { + "t_contract(IRewardsDistributor)28295": { "encoding": "inplace", "label": "contract IRewardsDistributor", "numberOfBytes": "20" }, - "t_contract(ISmartFarmingManager)28273": { + "t_contract(ISmartFarmingManager)28403": { "encoding": "inplace", "label": "contract ISmartFarmingManager", "numberOfBytes": "20" }, - "t_contract(ISwapper)28584": { + "t_contract(ISwapper)28714": { "encoding": "inplace", "label": "contract ISwapper", "numberOfBytes": "20" }, - "t_contract(ISyntheticToken)28341": { + "t_contract(ISyntheticToken)28471": { "encoding": "inplace", "label": "contract ISyntheticToken", "numberOfBytes": "20" }, - "t_contract(ITreasury)28356": { + "t_contract(ITreasury)28486": { "encoding": "inplace", "label": "contract ITreasury", "numberOfBytes": "20" }, - "t_mapping(t_address,t_struct(Set)28977_storage)": { + "t_mapping(t_address,t_struct(Set)29121_storage)": { "encoding": "mapping", "key": "t_address", "label": "mapping(address => struct MappedEnumerableSet.Set)", "numberOfBytes": "32", - "value": "t_struct(Set)28977_storage" + "value": "t_struct(Set)29121_storage" }, "t_mapping(t_address,t_uint256)": { "encoding": "mapping", @@ -2341,56 +2391,56 @@ "numberOfBytes": "32", "value": "t_uint256" }, - "t_mapping(t_contract(IERC20)21889,t_contract(IDepositToken)27459)": { + "t_mapping(t_contract(IERC20)22019,t_contract(IDepositToken)27589)": { "encoding": "mapping", - "key": "t_contract(IERC20)21889", + "key": "t_contract(IERC20)22019", "label": "mapping(contract IERC20 => contract IDepositToken)", "numberOfBytes": "32", - "value": "t_contract(IDepositToken)27459" + "value": "t_contract(IDepositToken)27589" }, - "t_mapping(t_contract(ISyntheticToken)28341,t_contract(IDebtToken)27316)": { + "t_mapping(t_contract(ISyntheticToken)28471,t_contract(IDebtToken)27446)": { "encoding": "mapping", - "key": "t_contract(ISyntheticToken)28341", + "key": "t_contract(ISyntheticToken)28471", "label": "mapping(contract ISyntheticToken => contract IDebtToken)", "numberOfBytes": "32", - "value": "t_contract(IDebtToken)27316" + "value": "t_contract(IDebtToken)27446" }, - "t_struct(AddressSet)23727_storage": { + "t_struct(AddressSet)23857_storage": { "encoding": "inplace", "label": "struct EnumerableSet.AddressSet", "members": [ { - "astId": 23726, + "astId": 23856, "contract": "contracts/Pool.sol:Pool", "label": "_inner", "offset": 0, "slot": "0", - "type": "t_struct(Set)23426_storage" + "type": "t_struct(Set)23556_storage" } ], "numberOfBytes": "64" }, - "t_struct(AddressSet)28983_storage": { + "t_struct(AddressSet)29127_storage": { "encoding": "inplace", "label": "struct MappedEnumerableSet.AddressSet", "members": [ { - "astId": 28982, + "astId": 29126, "contract": "contracts/Pool.sol:Pool", "label": "_ofAddress", "offset": 0, "slot": "0", - "type": "t_mapping(t_address,t_struct(Set)28977_storage)" + "type": "t_mapping(t_address,t_struct(Set)29121_storage)" } ], "numberOfBytes": "32" }, - "t_struct(Set)23426_storage": { + "t_struct(Set)23556_storage": { "encoding": "inplace", "label": "struct EnumerableSet.Set", "members": [ { - "astId": 23421, + "astId": 23551, "contract": "contracts/Pool.sol:Pool", "label": "_values", "offset": 0, @@ -2398,7 +2448,7 @@ "type": "t_array(t_bytes32)dyn_storage" }, { - "astId": 23425, + "astId": 23555, "contract": "contracts/Pool.sol:Pool", "label": "_indexes", "offset": 0, @@ -2408,12 +2458,12 @@ ], "numberOfBytes": "64" }, - "t_struct(Set)28977_storage": { + "t_struct(Set)29121_storage": { "encoding": "inplace", "label": "struct MappedEnumerableSet.Set", "members": [ { - "astId": 28972, + "astId": 29116, "contract": "contracts/Pool.sol:Pool", "label": "_values", "offset": 0, @@ -2421,7 +2471,7 @@ "type": "t_array(t_address)dyn_storage" }, { - "astId": 28976, + "astId": 29120, "contract": "contracts/Pool.sol:Pool", "label": "_indexes", "offset": 0, @@ -2443,4 +2493,4 @@ } } } -} +} \ No newline at end of file diff --git a/deployments/base/Pool1.json b/deployments/base/Pool1.json index 8c6fbb0..ef2a85a 100644 --- a/deployments/base/Pool1.json +++ b/deployments/base/Pool1.json @@ -304,6 +304,19 @@ "name": "UserReachedMaxTokens", "type": "error" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "newIsActive", + "type": "bool" + } + ], + "name": "BridgingIsActiveUpdated", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -1090,6 +1103,19 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "isBridgingActive", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "isSwapActive", @@ -1543,6 +1569,13 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "toggleBridgingIsActive", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [], "name": "toggleIsSwapActive", @@ -1743,18 +1776,12 @@ "0x5A9f5fC7Ee767EAA43688c1822F5352BA19fe735", "0xc4d66de80000000000000000000000004372a2b9304296c06197a823f25cf03119d2fd82" ], - "numDeployments": 1, + "numDeployments": 2, "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": [ - "0x4372A2b9304296c06197a823f25Cf03119d2Fd82" - ] - }, - "implementation": "0x7c18646ac536d5186B6F6Fc47D593E4127216C39", + "implementation": "0x2144B696bEbA98f077531e96023A7DF821Bc4586", "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", diff --git a/deployments/base/ProxyOFT.json b/deployments/base/ProxyOFT.json index f305e86..04fba2a 100644 --- a/deployments/base/ProxyOFT.json +++ b/deployments/base/ProxyOFT.json @@ -1,5 +1,5 @@ { - "address": "0xF3ecd63bb9A4934C85026F8924b49ed7Deb69985", + "address": "0xdDd9864C68072a4723889644b5E7075452718deD", "abi": [ { "inputs": [], @@ -16,6 +16,11 @@ "name": "BridgingIsPaused", "type": "error" }, + { + "inputs": [], + "name": "DestinationChainNotAllowed", + "type": "error" + }, { "inputs": [], "name": "SenderIsNotCrossChainDispatcher", @@ -1353,28 +1358,28 @@ "type": "function" } ], - "transactionHash": "0xe1015603a2a898e6822431642c1e446a990b79d5415cbbe71288ff0d9493d8be", + "transactionHash": "0x3a642713beea5d8f7406b13ed45d3ddf3a39b0f013ba0c76388edefdef67dac8", "receipt": { "to": null, "from": "0xdf826ff6518e609E4cEE86299d40611C148099d5", - "contractAddress": "0xF3ecd63bb9A4934C85026F8924b49ed7Deb69985", - "transactionIndex": 44, - "gasUsed": "4081689", + "contractAddress": "0xdDd9864C68072a4723889644b5E7075452718deD", + "transactionIndex": 14, + "gasUsed": "4117979", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x0c4be2bc4af3af5e67a20311dfccbdc45bad3eebbb12c882a15c268c043a164c", - "transactionHash": "0xe1015603a2a898e6822431642c1e446a990b79d5415cbbe71288ff0d9493d8be", + "blockHash": "0x15fe85d74d1f1366f34887a1936bfee393e6e4140e7e206e975030b9cdf6ec5b", + "transactionHash": "0x3a642713beea5d8f7406b13ed45d3ddf3a39b0f013ba0c76388edefdef67dac8", "logs": [], - "blockNumber": 14104250, - "cumulativeGasUsed": "9310095", + "blockNumber": 15058286, + "cumulativeGasUsed": "5694431", "status": 1, "byzantium": true }, "args": [], - "numDeployments": 1, - "solcInputHash": "05e4492217f7bda719dac100afeac118", - "metadata": "{\"compiler\":{\"version\":\"0.8.9+commit.e5eed63a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AddressIsNull\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BridgingIsPaused\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SenderIsNotCrossChainDispatcher\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SenderIsNotTheOwner\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint16\",\"name\":\"_srcChainId\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_srcAddress\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"_nonce\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_from\",\"type\":\"bytes\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_payload\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_reason\",\"type\":\"bytes\"}],\"name\":\"CallOFTReceivedFailure\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint16\",\"name\":\"_srcChainId\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_srcAddress\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"_nonce\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"_hash\",\"type\":\"bytes32\"}],\"name\":\"CallOFTReceivedSuccess\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"_srcChainId\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_srcAddress\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"_nonce\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_payload\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_reason\",\"type\":\"bytes\"}],\"name\":\"MessageFailed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"}],\"name\":\"NonContractAddress\",\"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\":\"uint16\",\"name\":\"_srcChainId\",\"type\":\"uint16\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"ReceiveFromChain\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"_srcChainId\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_srcAddress\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"_nonce\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"_payloadHash\",\"type\":\"bytes32\"}],\"name\":\"RetryMessageSuccess\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"_messageHash\",\"type\":\"bytes32\"}],\"name\":\"RetryOFTReceivedSuccess\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint16\",\"name\":\"_dstChainId\",\"type\":\"uint16\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_toAddress\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"SendToChain\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"_dstChainId\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"_type\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_minDstGas\",\"type\":\"uint256\"}],\"name\":\"SetMinDstGas\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"precrime\",\"type\":\"address\"}],\"name\":\"SetPrecrime\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"_remoteChainId\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_path\",\"type\":\"bytes\"}],\"name\":\"SetTrustedRemote\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"_remoteChainId\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_remoteAddress\",\"type\":\"bytes\"}],\"name\":\"SetTrustedRemoteAddress\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"_useCustomAdapterParams\",\"type\":\"bool\"}],\"name\":\"SetUseCustomAdapterParams\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DEFAULT_PAYLOAD_SIZE_LIMIT\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"NO_EXTRA_GAS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"PT_SEND\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"PT_SEND_AND_CALL\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"VERSION\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"circulatingSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_dstChainId\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"_toAddress\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_payload\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"_dstGasForCall\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"_useZro\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"_adapterParams\",\"type\":\"bytes\"}],\"name\":\"estimateSendAndCallFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"nativeFee\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"zroFee\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_dstChainId\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"_toAddress\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"_useZro\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"_adapterParams\",\"type\":\"bytes\"}],\"name\":\"estimateSendFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"nativeFee\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"zroFee\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"dstChainId_\",\"type\":\"uint16\"},{\"internalType\":\"address\",\"name\":\"to_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount_\",\"type\":\"uint256\"}],\"name\":\"estimateSendFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_nativeFee\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"name\":\"failedMessages\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"name\":\"failedOFTReceivedMessages\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_srcChainId\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"_srcAddress\",\"type\":\"bytes\"}],\"name\":\"forceResumeReceive\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_version\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"_chainId\",\"type\":\"uint16\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_configType\",\"type\":\"uint256\"}],\"name\":\"getConfig\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"chainId_\",\"type\":\"uint16\"}],\"name\":\"getProxyOFTOf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"_proxyOFT\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_remoteChainId\",\"type\":\"uint16\"}],\"name\":\"getTrustedRemoteAddress\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"lzEndpoint_\",\"type\":\"address\"},{\"internalType\":\"contract ISyntheticToken\",\"name\":\"syntheticToken_\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_srcChainId\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"_srcAddress\",\"type\":\"bytes\"}],\"name\":\"isTrustedRemote\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lzEndpoint\",\"outputs\":[{\"internalType\":\"contract ILayerZeroEndpointUpgradeable\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_srcChainId\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"_srcAddress\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"_nonce\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"_payload\",\"type\":\"bytes\"}],\"name\":\"lzReceive\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"name\":\"minDstGasLookup\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_srcChainId\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"_srcAddress\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"_nonce\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"_payload\",\"type\":\"bytes\"}],\"name\":\"nonblockingLzReceive\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"name\":\"payloadSizeLimitLookup\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"precrime\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_srcChainId\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"_srcAddress\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"_nonce\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"_payload\",\"type\":\"bytes\"}],\"name\":\"retryMessage\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_srcChainId\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"_srcAddress\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"_nonce\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"_from\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_payload\",\"type\":\"bytes\"}],\"name\":\"retryOFTReceived\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from_\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"dstChainId_\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"toAddress_\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"amount_\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"payload_\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"dstGasForCall_\",\"type\":\"uint64\"},{\"internalType\":\"address payable\",\"name\":\"refundAddress_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"zroPaymentAddress_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"adapterParams_\",\"type\":\"bytes\"}],\"name\":\"sendAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_from\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"_dstChainId\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"_toAddress\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"address payable\",\"name\":\"_refundAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_zroPaymentAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_adapterParams\",\"type\":\"bytes\"}],\"name\":\"sendFrom\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from_\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"dstChainId_\",\"type\":\"uint16\"},{\"internalType\":\"address\",\"name\":\"to_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount_\",\"type\":\"uint256\"}],\"name\":\"sendFrom\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_version\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"_chainId\",\"type\":\"uint16\"},{\"internalType\":\"uint256\",\"name\":\"_configType\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_config\",\"type\":\"bytes\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_dstChainId\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"_packetType\",\"type\":\"uint16\"},{\"internalType\":\"uint256\",\"name\":\"_minGas\",\"type\":\"uint256\"}],\"name\":\"setMinDstGas\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_dstChainId\",\"type\":\"uint16\"},{\"internalType\":\"uint256\",\"name\":\"_size\",\"type\":\"uint256\"}],\"name\":\"setPayloadSizeLimit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_precrime\",\"type\":\"address\"}],\"name\":\"setPrecrime\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_version\",\"type\":\"uint16\"}],\"name\":\"setReceiveVersion\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_version\",\"type\":\"uint16\"}],\"name\":\"setSendVersion\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_srcChainId\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"_path\",\"type\":\"bytes\"}],\"name\":\"setTrustedRemote\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_remoteChainId\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"_remoteAddress\",\"type\":\"bytes\"}],\"name\":\"setTrustedRemoteAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"_useCustomAdapterParams\",\"type\":\"bool\"}],\"name\":\"setUseCustomAdapterParams\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"name\":\"trustedRemoteLookup\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"useCustomAdapterParams\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"circulatingSupply()\":{\"details\":\"returns the circulating amount of tokens on current chain\"},\"estimateSendFee(uint16,bytes,uint256,bool,bytes)\":{\"details\":\"estimate send token `_tokenId` to (`_dstChainId`, `_toAddress`) _dstChainId - L0 defined chain id to send tokens too _toAddress - dynamic bytes array which contains the address to whom you are sending tokens to on the dstChain _amount - amount of the tokens to transfer _useZro - indicates to use zro to pay L0 fees _adapterParam - flexible bytes array to indicate messaging adapter services in L0\"},\"getProxyOFTOf(uint16)\":{\"params\":{\"chainId_\":\"the chain to get contract from\"}},\"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 anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"sendFrom(address,uint16,bytes,uint256,address,address,bytes)\":{\"details\":\"send `_amount` amount of token to (`_dstChainId`, `_toAddress`) from `_from` `_from` the owner of token `_dstChainId` the destination chain identifier `_toAddress` can be any size depending on the `dstChainId`. `_amount` the quantity of tokens in wei `_refundAddress` the address LayerZero refunds if too much message fee is sent `_zroPaymentAddress` set to address(0x0) if not paying in ZRO (LayerZero Token) `_adapterParams` is a flexible bytes array to indicate messaging adapter services\"},\"token()\":{\"details\":\"returns the address of the ERC20 token\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"title\":\"The ProxyOFT contract\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"estimateSendFee(uint16,address,uint256)\":{\"notice\":\"User friendly `sendFrom()` function\"},\"getProxyOFTOf(uint16)\":{\"notice\":\"Get other chains Proxy OFT contracts\"},\"sendFrom(address,uint16,address,uint256)\":{\"notice\":\"User friendly `sendFrom()` function\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/ProxyOFT.sol\":\"ProxyOFT\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/ProxyOFT.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/composable/ComposableOFTCoreUpgradeable.sol\\\";\\nimport \\\"./storage/ProxyOFTStorage.sol\\\";\\n\\nerror AddressIsNull();\\nerror SenderIsNotTheOwner();\\nerror BridgingIsPaused();\\nerror SenderIsNotCrossChainDispatcher();\\n\\n/**\\n * @title The ProxyOFT contract\\n */\\ncontract ProxyOFT is ComposableOFTCoreUpgradeable, ProxyOFTStorageV1 {\\n using BytesLib for bytes;\\n\\n string public constant VERSION = \\\"1.3.0\\\";\\n\\n constructor() {\\n _disableInitializers();\\n }\\n\\n function initialize(address lzEndpoint_, ISyntheticToken syntheticToken_) external initializer {\\n if (address(syntheticToken_) == address(0)) revert AddressIsNull();\\n if (address(lzEndpoint_) == address(0)) revert AddressIsNull();\\n\\n __ComposableOFTCoreUpgradeable_init(lzEndpoint_);\\n\\n syntheticToken = syntheticToken_;\\n }\\n\\n /// @inheritdoc IOFTCoreUpgradeable\\n function circulatingSupply() public view override returns (uint) {\\n return syntheticToken.totalSupply();\\n }\\n\\n /**\\n * @notice Get other chains Proxy OFT contracts\\n * @param chainId_ the chain to get contract from\\n */\\n function getProxyOFTOf(uint16 chainId_) public view returns (address _proxyOFT) {\\n return trustedRemoteLookup[chainId_].toAddress(0);\\n }\\n\\n /// @inheritdoc IOFTCoreUpgradeable\\n function token() public view override returns (address) {\\n return address(syntheticToken);\\n }\\n\\n /// @inheritdoc OFTCoreUpgradeable\\n function _debitFrom(\\n address from_,\\n uint16 /*dstChainId_*/,\\n bytes memory /*toAddress_*/,\\n uint amount_\\n ) internal override returns (uint256 _sent) {\\n if (!syntheticToken.poolRegistry().crossChainDispatcher().isBridgingActive()) revert BridgingIsPaused();\\n if (msg.sender != from_) revert SenderIsNotTheOwner();\\n syntheticToken.burn(from_, amount_);\\n return amount_;\\n }\\n\\n /// @inheritdoc OFTCoreUpgradeable\\n function _creditTo(\\n uint16 /*srcChainId_*/,\\n address toAddress_,\\n uint amount_\\n ) internal override returns (uint256 _received) {\\n syntheticToken.mint(toAddress_, amount_);\\n return amount_;\\n }\\n\\n /// @inheritdoc ComposableOFTCoreUpgradeable\\n function sendAndCall(\\n address from_,\\n uint16 dstChainId_,\\n bytes calldata toAddress_,\\n uint amount_,\\n bytes calldata payload_,\\n uint64 dstGasForCall_,\\n address payable refundAddress_,\\n address zroPaymentAddress_,\\n bytes calldata adapterParams_\\n ) public payable override(ComposableOFTCoreUpgradeable, IComposableOFTCoreUpgradeable) {\\n if (msg.sender != address(syntheticToken.poolRegistry().crossChainDispatcher()))\\n revert SenderIsNotCrossChainDispatcher();\\n\\n _sendAndCall(\\n from_,\\n dstChainId_,\\n toAddress_,\\n amount_,\\n payload_,\\n dstGasForCall_,\\n refundAddress_,\\n zroPaymentAddress_,\\n adapterParams_\\n );\\n }\\n\\n /**\\n * @notice User friendly `sendFrom()` function\\n */\\n function sendFrom(address from_, uint16 dstChainId_, address to_, uint256 amount_) external payable {\\n _send({\\n _from: from_,\\n _dstChainId: dstChainId_,\\n _toAddress: abi.encodePacked(to_),\\n _amount: amount_,\\n _refundAddress: payable(from_),\\n _zroPaymentAddress: address(0),\\n _adapterParams: abi.encodePacked(\\n uint16(1), // LZ_ADAPTER_PARAMS_VERSION\\n syntheticToken.poolRegistry().crossChainDispatcher().lzBaseGasLimit()\\n )\\n });\\n }\\n\\n /**\\n * @notice User friendly `sendFrom()` function\\n */\\n function estimateSendFee(\\n uint16 dstChainId_,\\n address to_,\\n uint256 amount_\\n ) external view returns (uint256 _nativeFee) {\\n (_nativeFee, ) = this.estimateSendFee({\\n _dstChainId: dstChainId_,\\n _toAddress: abi.encodePacked(to_),\\n _amount: amount_,\\n _useZro: false,\\n _adapterParams: abi.encodePacked(\\n uint16(1), // LZ_ADAPTER_PARAMS_VERSION\\n syntheticToken.poolRegistry().crossChainDispatcher().lzBaseGasLimit()\\n )\\n });\\n }\\n\\n /// @inheritdoc OwnableUpgradeable\\n function owner() public view override returns (address) {\\n return syntheticToken.poolRegistry().governor();\\n }\\n\\n /// @inheritdoc OwnableUpgradeable\\n function renounceOwnership() public override {\\n revert(\\\"disabled\\\");\\n }\\n\\n /// @inheritdoc OwnableUpgradeable\\n function transferOwnership(address) public override {\\n revert(\\\"disabled\\\");\\n }\\n}\\n\",\"keccak256\":\"0x4b0cab803d5ec80d6c2a6cd7a9f8ca967ee5558e2780e33aed5c7e0267058a48\",\"license\":\"MIT\"},\"contracts/dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/interfaces/ILayerZeroEndpointUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"./ILayerZeroUserApplicationConfigUpgradeable.sol\\\";\\n\\ninterface ILayerZeroEndpointUpgradeable is ILayerZeroUserApplicationConfigUpgradeable {\\n // @notice send a LayerZero message to the specified address at a LayerZero endpoint.\\n // @param _dstChainId - the destination chain identifier\\n // @param _destination - the address on destination chain (in bytes). address length/format may vary by chains\\n // @param _payload - a custom bytes payload to send to the destination contract\\n // @param _refundAddress - if the source transaction is cheaper than the amount of value passed, refund the additional amount to this address\\n // @param _zroPaymentAddress - the address of the ZRO token holder who would pay for the transaction\\n // @param _adapterParams - parameters for custom functionality. e.g. receive airdropped native gas from the relayer on destination\\n function send(uint16 _dstChainId, bytes calldata _destination, bytes calldata _payload, address payable _refundAddress, address _zroPaymentAddress, bytes calldata _adapterParams) external payable;\\n\\n // @notice used by the messaging library to publish verified payload\\n // @param _srcChainId - the source chain identifier\\n // @param _srcAddress - the source contract (as bytes) at the source chain\\n // @param _dstAddress - the address on destination chain\\n // @param _nonce - the unbound message ordering nonce\\n // @param _gasLimit - the gas limit for external contract execution\\n // @param _payload - verified payload to send to the destination contract\\n function receivePayload(uint16 _srcChainId, bytes calldata _srcAddress, address _dstAddress, uint64 _nonce, uint _gasLimit, bytes calldata _payload) external;\\n\\n // @notice get the inboundNonce of a lzApp from a source chain which could be EVM or non-EVM chain\\n // @param _srcChainId - the source chain identifier\\n // @param _srcAddress - the source chain contract address\\n function getInboundNonce(uint16 _srcChainId, bytes calldata _srcAddress) external view returns (uint64);\\n\\n // @notice get the outboundNonce from this source chain which, consequently, is always an EVM\\n // @param _srcAddress - the source chain contract address\\n function getOutboundNonce(uint16 _dstChainId, address _srcAddress) external view returns (uint64);\\n\\n // @notice gets a quote in source native gas, for the amount that send() requires to pay for message delivery\\n // @param _dstChainId - the destination chain identifier\\n // @param _userApplication - the user app address on this EVM chain\\n // @param _payload - the custom message to send over LayerZero\\n // @param _payInZRO - if false, user app pays the protocol fee in native token\\n // @param _adapterParam - parameters for the adapter service, e.g. send some dust native token to dstChain\\n function estimateFees(uint16 _dstChainId, address _userApplication, bytes calldata _payload, bool _payInZRO, bytes calldata _adapterParam) external view returns (uint nativeFee, uint zroFee);\\n\\n // @notice get this Endpoint's immutable source identifier\\n function getChainId() external view returns (uint16);\\n\\n // @notice the interface to retry failed message on this Endpoint destination\\n // @param _srcChainId - the source chain identifier\\n // @param _srcAddress - the source chain contract address\\n // @param _payload - the payload to be retried\\n function retryPayload(uint16 _srcChainId, bytes calldata _srcAddress, bytes calldata _payload) external;\\n\\n // @notice query if any STORED payload (message blocking) at the endpoint.\\n // @param _srcChainId - the source chain identifier\\n // @param _srcAddress - the source chain contract address\\n function hasStoredPayload(uint16 _srcChainId, bytes calldata _srcAddress) external view returns (bool);\\n\\n // @notice query if the _libraryAddress is valid for sending msgs.\\n // @param _userApplication - the user app address on this EVM chain\\n function getSendLibraryAddress(address _userApplication) external view returns (address);\\n\\n // @notice query if the _libraryAddress is valid for receiving msgs.\\n // @param _userApplication - the user app address on this EVM chain\\n function getReceiveLibraryAddress(address _userApplication) external view returns (address);\\n\\n // @notice query if the non-reentrancy guard for send() is on\\n // @return true if the guard is on. false otherwise\\n function isSendingPayload() external view returns (bool);\\n\\n // @notice query if the non-reentrancy guard for receive() is on\\n // @return true if the guard is on. false otherwise\\n function isReceivingPayload() external view returns (bool);\\n\\n // @notice get the configuration of the LayerZero messaging library of the specified version\\n // @param _version - messaging library version\\n // @param _chainId - the chainId for the pending config change\\n // @param _userApplication - the contract address of the user application\\n // @param _configType - type of configuration. every messaging library has its own convention.\\n function getConfig(uint16 _version, uint16 _chainId, address _userApplication, uint _configType) external view returns (bytes memory);\\n\\n // @notice get the send() LayerZero messaging library version\\n // @param _userApplication - the contract address of the user application\\n function getSendVersion(address _userApplication) external view returns (uint16);\\n\\n // @notice get the lzReceive() LayerZero messaging library version\\n // @param _userApplication - the contract address of the user application\\n function getReceiveVersion(address _userApplication) external view returns (uint16);\\n}\\n\",\"keccak256\":\"0x748e7abf8908f264c6fff8ea7730b1766ab5a262be7962404f7d263066b41487\",\"license\":\"MIT\"},\"contracts/dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/interfaces/ILayerZeroReceiverUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.2;\\n\\ninterface ILayerZeroReceiverUpgradeable {\\n // @notice LayerZero endpoint will invoke this function to deliver the message on the destination\\n // @param _srcChainId - the source endpoint identifier\\n // @param _srcAddress - the source sending contract address from the source chain\\n // @param _nonce - the ordered message nonce\\n // @param _payload - the signed payload is the UA bytes has encoded to be sent\\n function lzReceive(uint16 _srcChainId, bytes calldata _srcAddress, uint64 _nonce, bytes calldata _payload) external;\\n}\\n\",\"keccak256\":\"0x6ce5593a1247719f7209cad8068573c249674b41b859c6379ace1baaea0ed2a3\",\"license\":\"MIT\"},\"contracts/dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/interfaces/ILayerZeroUserApplicationConfigUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.2;\\n\\ninterface ILayerZeroUserApplicationConfigUpgradeable {\\n // @notice set the configuration of the LayerZero messaging library of the specified version\\n // @param _version - messaging library version\\n // @param _chainId - the chainId for the pending config change\\n // @param _configType - type of configuration. every messaging library has its own convention.\\n // @param _config - configuration in the bytes. can encode arbitrary content.\\n function setConfig(uint16 _version, uint16 _chainId, uint _configType, bytes calldata _config) external;\\n\\n // @notice set the send() LayerZero messaging library version to _version\\n // @param _version - new messaging library version\\n function setSendVersion(uint16 _version) external;\\n\\n // @notice set the lzReceive() LayerZero messaging library version to _version\\n // @param _version - new messaging library version\\n function setReceiveVersion(uint16 _version) external;\\n\\n // @notice Only when the UA needs to resume the message flow in blocking mode and clear the stored payload\\n // @param _srcChainId - the chainId of the source chain\\n // @param _srcAddress - the contract address of the source contract at the source chain\\n function forceResumeReceive(uint16 _srcChainId, bytes calldata _srcAddress) external;\\n}\\n\",\"keccak256\":\"0xa808baa32db12c453b982320e0c9a8c07aec8c0f3bb36ac2ed26f3ad47476879\",\"license\":\"MIT\"},\"contracts/dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/lzApp/LzAppUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../../../openzeppelin-upgradeable/access/OwnableUpgradeable.sol\\\";\\nimport \\\"../interfaces/ILayerZeroReceiverUpgradeable.sol\\\";\\nimport \\\"../interfaces/ILayerZeroUserApplicationConfigUpgradeable.sol\\\";\\nimport \\\"../interfaces/ILayerZeroEndpointUpgradeable.sol\\\";\\nimport \\\"../../util/BytesLib.sol\\\";\\n\\n/*\\n * a generic LzReceiver implementation\\n */\\nabstract contract LzAppUpgradeable is\\n Initializable,\\n OwnableUpgradeable,\\n ILayerZeroReceiverUpgradeable,\\n ILayerZeroUserApplicationConfigUpgradeable\\n{\\n using BytesLib for bytes;\\n\\n // ua can not send payload larger than this by default, but it can be changed by the ua owner\\n uint public constant DEFAULT_PAYLOAD_SIZE_LIMIT = 10000;\\n\\n ILayerZeroEndpointUpgradeable public lzEndpoint;\\n mapping(uint16 => bytes) public trustedRemoteLookup;\\n mapping(uint16 => mapping(uint16 => uint)) public minDstGasLookup;\\n mapping(uint16 => uint) public payloadSizeLimitLookup;\\n address public precrime;\\n\\n event SetPrecrime(address precrime);\\n event SetTrustedRemote(uint16 _remoteChainId, bytes _path);\\n event SetTrustedRemoteAddress(uint16 _remoteChainId, bytes _remoteAddress);\\n event SetMinDstGas(uint16 _dstChainId, uint16 _type, uint _minDstGas);\\n\\n function __LzAppUpgradeable_init(address _endpoint) internal onlyInitializing {\\n __Ownable_init_unchained();\\n __LzAppUpgradeable_init_unchained(_endpoint);\\n }\\n\\n function __LzAppUpgradeable_init_unchained(address _endpoint) internal onlyInitializing {\\n lzEndpoint = ILayerZeroEndpointUpgradeable(_endpoint);\\n }\\n\\n function lzReceive(\\n uint16 _srcChainId,\\n bytes calldata _srcAddress,\\n uint64 _nonce,\\n bytes calldata _payload\\n ) public virtual override {\\n // lzReceive must be called by the endpoint for security\\n require(_msgSender() == address(lzEndpoint), \\\"LzApp: invalid endpoint caller\\\");\\n\\n bytes memory trustedRemote = trustedRemoteLookup[_srcChainId];\\n // if will still block the message pathway from (srcChainId, srcAddress). should not receive message from untrusted remote.\\n require(\\n _srcAddress.length == trustedRemote.length &&\\n trustedRemote.length > 0 &&\\n keccak256(_srcAddress) == keccak256(trustedRemote),\\n \\\"LzApp: invalid source sending contract\\\"\\n );\\n\\n _blockingLzReceive(_srcChainId, _srcAddress, _nonce, _payload);\\n }\\n\\n // abstract function - the default behaviour of LayerZero is blocking. See: NonblockingLzApp if you dont need to enforce ordered messaging\\n function _blockingLzReceive(\\n uint16 _srcChainId,\\n bytes memory _srcAddress,\\n uint64 _nonce,\\n bytes memory _payload\\n ) internal virtual;\\n\\n function _lzSend(\\n uint16 _dstChainId,\\n bytes memory _payload,\\n address payable _refundAddress,\\n address _zroPaymentAddress,\\n bytes memory _adapterParams,\\n uint _nativeFee\\n ) internal virtual {\\n bytes memory trustedRemote = trustedRemoteLookup[_dstChainId];\\n require(trustedRemote.length != 0, \\\"LzApp: destination chain is not a trusted source\\\");\\n _checkPayloadSize(_dstChainId, _payload.length);\\n lzEndpoint.send{value: _nativeFee}(\\n _dstChainId,\\n trustedRemote,\\n _payload,\\n _refundAddress,\\n _zroPaymentAddress,\\n _adapterParams\\n );\\n }\\n\\n function _checkGasLimit(\\n uint16 _dstChainId,\\n uint16 _type,\\n bytes memory _adapterParams,\\n uint _extraGas\\n ) internal view virtual {\\n uint providedGasLimit = _getGasLimit(_adapterParams);\\n uint minGasLimit = minDstGasLookup[_dstChainId][_type] + _extraGas;\\n require(minGasLimit > 0, \\\"LzApp: minGasLimit not set\\\");\\n require(providedGasLimit >= minGasLimit, \\\"LzApp: gas limit is too low\\\");\\n }\\n\\n function _getGasLimit(bytes memory _adapterParams) internal pure virtual returns (uint gasLimit) {\\n require(_adapterParams.length >= 34, \\\"LzApp: invalid adapterParams\\\");\\n assembly {\\n gasLimit := mload(add(_adapterParams, 34))\\n }\\n }\\n\\n function _checkPayloadSize(uint16 _dstChainId, uint _payloadSize) internal view virtual {\\n uint payloadSizeLimit = payloadSizeLimitLookup[_dstChainId];\\n if (payloadSizeLimit == 0) {\\n // use default if not set\\n payloadSizeLimit = DEFAULT_PAYLOAD_SIZE_LIMIT;\\n }\\n require(_payloadSize <= payloadSizeLimit, \\\"LzApp: payload size is too large\\\");\\n }\\n\\n //---------------------------UserApplication config----------------------------------------\\n function getConfig(\\n uint16 _version,\\n uint16 _chainId,\\n address,\\n uint _configType\\n ) external view returns (bytes memory) {\\n return lzEndpoint.getConfig(_version, _chainId, address(this), _configType);\\n }\\n\\n // generic config for LayerZero user Application\\n function setConfig(\\n uint16 _version,\\n uint16 _chainId,\\n uint _configType,\\n bytes calldata _config\\n ) external override onlyOwner {\\n lzEndpoint.setConfig(_version, _chainId, _configType, _config);\\n }\\n\\n function setSendVersion(uint16 _version) external override onlyOwner {\\n lzEndpoint.setSendVersion(_version);\\n }\\n\\n function setReceiveVersion(uint16 _version) external override onlyOwner {\\n lzEndpoint.setReceiveVersion(_version);\\n }\\n\\n function forceResumeReceive(uint16 _srcChainId, bytes calldata _srcAddress) external override onlyOwner {\\n lzEndpoint.forceResumeReceive(_srcChainId, _srcAddress);\\n }\\n\\n // _path = abi.encodePacked(remoteAddress, localAddress)\\n // this function set the trusted path for the cross-chain communication\\n function setTrustedRemote(uint16 _srcChainId, bytes calldata _path) external onlyOwner {\\n trustedRemoteLookup[_srcChainId] = _path;\\n emit SetTrustedRemote(_srcChainId, _path);\\n }\\n\\n function setTrustedRemoteAddress(uint16 _remoteChainId, bytes calldata _remoteAddress) external onlyOwner {\\n trustedRemoteLookup[_remoteChainId] = abi.encodePacked(_remoteAddress, address(this));\\n emit SetTrustedRemoteAddress(_remoteChainId, _remoteAddress);\\n }\\n\\n function getTrustedRemoteAddress(uint16 _remoteChainId) external view returns (bytes memory) {\\n bytes memory path = trustedRemoteLookup[_remoteChainId];\\n require(path.length != 0, \\\"LzApp: no trusted path record\\\");\\n return path.slice(0, path.length - 20); // the last 20 bytes should be address(this)\\n }\\n\\n function setPrecrime(address _precrime) external onlyOwner {\\n precrime = _precrime;\\n emit SetPrecrime(_precrime);\\n }\\n\\n function setMinDstGas(uint16 _dstChainId, uint16 _packetType, uint _minGas) external onlyOwner {\\n require(_minGas > 0, \\\"LzApp: invalid minGas\\\");\\n minDstGasLookup[_dstChainId][_packetType] = _minGas;\\n emit SetMinDstGas(_dstChainId, _packetType, _minGas);\\n }\\n\\n // if the size is 0, it means default size limit\\n function setPayloadSizeLimit(uint16 _dstChainId, uint _size) external onlyOwner {\\n payloadSizeLimitLookup[_dstChainId] = _size;\\n }\\n\\n //--------------------------- VIEW FUNCTION ----------------------------------------\\n function isTrustedRemote(uint16 _srcChainId, bytes calldata _srcAddress) external view returns (bool) {\\n bytes memory trustedSource = trustedRemoteLookup[_srcChainId];\\n return keccak256(trustedSource) == keccak256(_srcAddress);\\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 uint[45] private __gap;\\n}\\n\",\"keccak256\":\"0x399507f44b1c9355452ba54834eccaa17972334e2b8139015e044244cde17b93\",\"license\":\"MIT\"},\"contracts/dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/lzApp/NonblockingLzAppUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"./LzAppUpgradeable.sol\\\";\\nimport \\\"../../util/ExcessivelySafeCall.sol\\\";\\n\\n/*\\n * the default LayerZero messaging behaviour is blocking, i.e. any failed message will block the channel\\n * this abstract class try-catch all fail messages and store locally for future retry. hence, non-blocking\\n * NOTE: if the srcAddress is not configured properly, it will still block the message pathway from (srcChainId, srcAddress)\\n */\\nabstract contract NonblockingLzAppUpgradeable is Initializable, LzAppUpgradeable {\\n using ExcessivelySafeCall for address;\\n\\n function __NonblockingLzAppUpgradeable_init(address _endpoint) internal onlyInitializing {\\n __Ownable_init_unchained();\\n __LzAppUpgradeable_init_unchained(_endpoint);\\n }\\n\\n function __NonblockingLzAppUpgradeable_init_unchained(address _endpoint) internal onlyInitializing {}\\n\\n mapping(uint16 => mapping(bytes => mapping(uint64 => bytes32))) public failedMessages;\\n\\n event MessageFailed(uint16 _srcChainId, bytes _srcAddress, uint64 _nonce, bytes _payload, bytes _reason);\\n event RetryMessageSuccess(uint16 _srcChainId, bytes _srcAddress, uint64 _nonce, bytes32 _payloadHash);\\n\\n // overriding the virtual function in LzReceiver\\n function _blockingLzReceive(uint16 _srcChainId, bytes memory _srcAddress, uint64 _nonce, bytes memory _payload) internal virtual override {\\n (bool success, bytes memory reason) = address(this).excessivelySafeCall(gasleft(), 150, abi.encodeWithSelector(this.nonblockingLzReceive.selector, _srcChainId, _srcAddress, _nonce, _payload));\\n // try-catch all errors/exceptions\\n if (!success) {\\n _storeFailedMessage(_srcChainId, _srcAddress, _nonce, _payload, reason);\\n }\\n }\\n\\n function _storeFailedMessage(uint16 _srcChainId, bytes memory _srcAddress, uint64 _nonce, bytes memory _payload, bytes memory _reason) internal virtual {\\n failedMessages[_srcChainId][_srcAddress][_nonce] = keccak256(_payload);\\n emit MessageFailed(_srcChainId, _srcAddress, _nonce, _payload, _reason);\\n }\\n\\n function nonblockingLzReceive(uint16 _srcChainId, bytes calldata _srcAddress, uint64 _nonce, bytes calldata _payload) public virtual {\\n // only internal transaction\\n require(_msgSender() == address(this), \\\"NonblockingLzApp: caller must be LzApp\\\");\\n _nonblockingLzReceive(_srcChainId, _srcAddress, _nonce, _payload);\\n }\\n\\n //@notice override this function\\n function _nonblockingLzReceive(uint16 _srcChainId, bytes memory _srcAddress, uint64 _nonce, bytes memory _payload) internal virtual;\\n\\n function retryMessage(uint16 _srcChainId, bytes calldata _srcAddress, uint64 _nonce, bytes calldata _payload) public payable virtual {\\n // assert there is message to retry\\n bytes32 payloadHash = failedMessages[_srcChainId][_srcAddress][_nonce];\\n require(payloadHash != bytes32(0), \\\"NonblockingLzApp: no stored message\\\");\\n require(keccak256(_payload) == payloadHash, \\\"NonblockingLzApp: invalid payload\\\");\\n // clear the stored message\\n failedMessages[_srcChainId][_srcAddress][_nonce] = bytes32(0);\\n // execute the message. revert if it fails again\\n _nonblockingLzReceive(_srcChainId, _srcAddress, _nonce, _payload);\\n emit RetryMessageSuccess(_srcChainId, _srcAddress, _nonce, payloadHash);\\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 uint[49] private __gap;\\n}\\n\",\"keccak256\":\"0x128f7c8d0d1d04c147cea7a2a6c2244387bef408f2a6f0a9c2a01cf54a66eea3\",\"license\":\"MIT\"},\"contracts/dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/IOFTCoreUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../../../../openzeppelin-upgradeable/utils/introspection/IERC165Upgradeable.sol\\\";\\n\\n/**\\n * @dev Interface of the IOFT core standard\\n */\\ninterface IOFTCoreUpgradeable is IERC165Upgradeable {\\n /**\\n * @dev estimate send token `_tokenId` to (`_dstChainId`, `_toAddress`)\\n * _dstChainId - L0 defined chain id to send tokens too\\n * _toAddress - dynamic bytes array which contains the address to whom you are sending tokens to on the dstChain\\n * _amount - amount of the tokens to transfer\\n * _useZro - indicates to use zro to pay L0 fees\\n * _adapterParam - flexible bytes array to indicate messaging adapter services in L0\\n */\\n function estimateSendFee(\\n uint16 _dstChainId,\\n bytes calldata _toAddress,\\n uint _amount,\\n bool _useZro,\\n bytes calldata _adapterParams\\n ) external view returns (uint nativeFee, uint zroFee);\\n\\n /**\\n * @dev send `_amount` amount of token to (`_dstChainId`, `_toAddress`) from `_from`\\n * `_from` the owner of token\\n * `_dstChainId` the destination chain identifier\\n * `_toAddress` can be any size depending on the `dstChainId`.\\n * `_amount` the quantity of tokens in wei\\n * `_refundAddress` the address LayerZero refunds if too much message fee is sent\\n * `_zroPaymentAddress` set to address(0x0) if not paying in ZRO (LayerZero Token)\\n * `_adapterParams` is a flexible bytes array to indicate messaging adapter services\\n */\\n function sendFrom(\\n address _from,\\n uint16 _dstChainId,\\n bytes calldata _toAddress,\\n uint _amount,\\n address payable _refundAddress,\\n address _zroPaymentAddress,\\n bytes calldata _adapterParams\\n ) external payable;\\n\\n /**\\n * @dev returns the circulating amount of tokens on current chain\\n */\\n function circulatingSupply() external view returns (uint);\\n\\n /**\\n * @dev returns the address of the ERC20 token\\n */\\n function token() external view returns (address);\\n\\n /**\\n * @dev Emitted when `_amount` tokens are moved from the `_sender` to (`_dstChainId`, `_toAddress`)\\n * `_nonce` is the outbound nonce\\n */\\n event SendToChain(uint16 indexed _dstChainId, address indexed _from, bytes _toAddress, uint _amount);\\n\\n /**\\n * @dev Emitted when `_amount` tokens are received from `_srcChainId` into the `_toAddress` on the local chain.\\n * `_nonce` is the inbound nonce.\\n */\\n event ReceiveFromChain(uint16 indexed _srcChainId, address indexed _to, uint _amount);\\n\\n event SetUseCustomAdapterParams(bool _useCustomAdapterParams);\\n}\\n\",\"keccak256\":\"0x22651924296f8308db8195d7a86a6781023241c53905418f2d3925e3f693f530\",\"license\":\"MIT\"},\"contracts/dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/OFTCoreUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"./IOFTCoreUpgradeable.sol\\\";\\nimport \\\"../../../../../openzeppelin-upgradeable/utils/introspection/ERC165Upgradeable.sol\\\";\\nimport \\\"../../lzApp/NonblockingLzAppUpgradeable.sol\\\";\\n\\nabstract contract OFTCoreUpgradeable is\\n Initializable,\\n NonblockingLzAppUpgradeable,\\n ERC165Upgradeable,\\n IOFTCoreUpgradeable\\n{\\n using BytesLib for bytes;\\n\\n uint public constant NO_EXTRA_GAS = 0;\\n\\n // packet type\\n uint16 public constant PT_SEND = 0;\\n\\n bool public useCustomAdapterParams;\\n\\n function __OFTCoreUpgradeable_init(address _lzEndpoint) internal onlyInitializing {\\n __Ownable_init_unchained();\\n __LzAppUpgradeable_init_unchained(_lzEndpoint);\\n }\\n\\n function __OFTCoreUpgradeable_init_unchained() internal onlyInitializing {}\\n\\n function supportsInterface(\\n bytes4 interfaceId\\n ) public view virtual override(ERC165Upgradeable, IERC165Upgradeable) returns (bool) {\\n return interfaceId == type(IOFTCoreUpgradeable).interfaceId || super.supportsInterface(interfaceId);\\n }\\n\\n function estimateSendFee(\\n uint16 _dstChainId,\\n bytes calldata _toAddress,\\n uint _amount,\\n bool _useZro,\\n bytes calldata _adapterParams\\n ) public view virtual override returns (uint nativeFee, uint zroFee) {\\n // mock the payload for sendFrom()\\n bytes memory payload = abi.encode(PT_SEND, _toAddress, _amount);\\n return lzEndpoint.estimateFees(_dstChainId, address(this), payload, _useZro, _adapterParams);\\n }\\n\\n function sendFrom(\\n address _from,\\n uint16 _dstChainId,\\n bytes calldata _toAddress,\\n uint _amount,\\n address payable _refundAddress,\\n address _zroPaymentAddress,\\n bytes calldata _adapterParams\\n ) public payable virtual override {\\n _send(_from, _dstChainId, _toAddress, _amount, _refundAddress, _zroPaymentAddress, _adapterParams);\\n }\\n\\n function setUseCustomAdapterParams(bool _useCustomAdapterParams) public virtual onlyOwner {\\n useCustomAdapterParams = _useCustomAdapterParams;\\n emit SetUseCustomAdapterParams(_useCustomAdapterParams);\\n }\\n\\n function _nonblockingLzReceive(\\n uint16 _srcChainId,\\n bytes memory _srcAddress,\\n uint64 _nonce,\\n bytes memory _payload\\n ) internal virtual override {\\n uint16 packetType;\\n assembly {\\n packetType := mload(add(_payload, 32))\\n }\\n\\n if (packetType == PT_SEND) {\\n _sendAck(_srcChainId, _srcAddress, _nonce, _payload);\\n } else {\\n revert(\\\"OFTCore: unknown packet type\\\");\\n }\\n }\\n\\n function _send(\\n address _from,\\n uint16 _dstChainId,\\n bytes memory _toAddress,\\n uint _amount,\\n address payable _refundAddress,\\n address _zroPaymentAddress,\\n bytes memory _adapterParams\\n ) internal virtual {\\n _checkAdapterParams(_dstChainId, PT_SEND, _adapterParams, NO_EXTRA_GAS);\\n\\n uint amount = _debitFrom(_from, _dstChainId, _toAddress, _amount);\\n\\n bytes memory lzPayload = abi.encode(PT_SEND, _toAddress, amount);\\n _lzSend(_dstChainId, lzPayload, _refundAddress, _zroPaymentAddress, _adapterParams, msg.value);\\n\\n emit SendToChain(_dstChainId, _from, _toAddress, amount);\\n }\\n\\n function _sendAck(uint16 _srcChainId, bytes memory, uint64, bytes memory _payload) internal virtual {\\n (, bytes memory toAddressBytes, uint amount) = abi.decode(_payload, (uint16, bytes, uint));\\n\\n address to = toAddressBytes.toAddress(0);\\n\\n amount = _creditTo(_srcChainId, to, amount);\\n emit ReceiveFromChain(_srcChainId, to, amount);\\n }\\n\\n function _checkAdapterParams(\\n uint16 _dstChainId,\\n uint16 _pkType,\\n bytes memory _adapterParams,\\n uint _extraGas\\n ) internal virtual {\\n if (useCustomAdapterParams) {\\n _checkGasLimit(_dstChainId, _pkType, _adapterParams, _extraGas);\\n } else {\\n require(_adapterParams.length == 0, \\\"OFTCore: _adapterParams must be empty.\\\");\\n }\\n }\\n\\n function _debitFrom(\\n address _from,\\n uint16 _dstChainId,\\n bytes memory _toAddress,\\n uint _amount\\n ) internal virtual returns (uint);\\n\\n function _creditTo(uint16 _srcChainId, address _toAddress, uint _amount) internal virtual returns (uint);\\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 uint[49] private __gap;\\n}\\n\",\"keccak256\":\"0xcf88a5e869561adfc3dc333488331033529f7d192f65664806d27e16e172d1ac\",\"license\":\"MIT\"},\"contracts/dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/composable/ComposableOFTCoreUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../OFTCoreUpgradeable.sol\\\";\\nimport \\\"./IOFTReceiverUpgradeable.sol\\\";\\nimport \\\"./IComposableOFTCoreUpgradeable.sol\\\";\\nimport \\\"../../../../util/ExcessivelySafeCall.sol\\\";\\n\\nabstract contract ComposableOFTCoreUpgradeable is OFTCoreUpgradeable, IComposableOFTCoreUpgradeable {\\n using ExcessivelySafeCall for address;\\n using BytesLib for bytes;\\n\\n // packet type\\n uint16 public constant PT_SEND_AND_CALL = 1;\\n\\n mapping(uint16 => mapping(bytes => mapping(uint64 => bytes32))) public failedOFTReceivedMessages;\\n\\n function __ComposableOFTCoreUpgradeable_init(address _lzEndpoint) internal onlyInitializing {\\n __OFTCoreUpgradeable_init(_lzEndpoint);\\n }\\n\\n function __ComposableOFTCoreUpgradeable_init_unchained() internal onlyInitializing {}\\n\\n function supportsInterface(\\n bytes4 interfaceId\\n ) public view virtual override(OFTCoreUpgradeable, IERC165Upgradeable) returns (bool) {\\n return interfaceId == type(IComposableOFTCoreUpgradeable).interfaceId || super.supportsInterface(interfaceId);\\n }\\n\\n function estimateSendAndCallFee(\\n uint16 _dstChainId,\\n bytes calldata _toAddress,\\n uint _amount,\\n bytes calldata _payload,\\n uint64 _dstGasForCall,\\n bool _useZro,\\n bytes calldata _adapterParams\\n ) public view virtual override returns (uint nativeFee, uint zroFee) {\\n // mock the payload for sendAndCall()\\n bytes memory payload = abi.encode(\\n PT_SEND_AND_CALL,\\n abi.encodePacked(msg.sender),\\n _toAddress,\\n _amount,\\n _payload,\\n _dstGasForCall\\n );\\n return lzEndpoint.estimateFees(_dstChainId, address(this), payload, _useZro, _adapterParams);\\n }\\n\\n function sendAndCall(\\n address _from,\\n uint16 _dstChainId,\\n bytes calldata _toAddress,\\n uint _amount,\\n bytes calldata _payload,\\n uint64 _dstGasForCall,\\n address payable _refundAddress,\\n address _zroPaymentAddress,\\n bytes calldata _adapterParams\\n ) public payable virtual override {\\n _sendAndCall(\\n _from,\\n _dstChainId,\\n _toAddress,\\n _amount,\\n _payload,\\n _dstGasForCall,\\n _refundAddress,\\n _zroPaymentAddress,\\n _adapterParams\\n );\\n }\\n\\n function retryOFTReceived(\\n uint16 _srcChainId,\\n bytes calldata _srcAddress,\\n uint64 _nonce,\\n bytes calldata _from,\\n address _to,\\n uint _amount,\\n bytes calldata _payload\\n ) public virtual override {\\n bytes32 msgHash = failedOFTReceivedMessages[_srcChainId][_srcAddress][_nonce];\\n require(msgHash != bytes32(0), \\\"ComposableOFTCore: no failed message to retry\\\");\\n\\n bytes32 hash = keccak256(abi.encode(_from, _to, _amount, _payload));\\n require(hash == msgHash, \\\"ComposableOFTCore: failed message hash mismatch\\\");\\n\\n delete failedOFTReceivedMessages[_srcChainId][_srcAddress][_nonce];\\n IOFTReceiverUpgradeable(_to).onOFTReceived(_srcChainId, _srcAddress, _nonce, _from, _amount, _payload);\\n emit RetryOFTReceivedSuccess(hash);\\n }\\n\\n function _nonblockingLzReceive(\\n uint16 _srcChainId,\\n bytes memory _srcAddress,\\n uint64 _nonce,\\n bytes memory _payload\\n ) internal virtual override {\\n uint16 packetType;\\n assembly {\\n packetType := mload(add(_payload, 32))\\n }\\n\\n if (packetType == PT_SEND) {\\n _sendAck(_srcChainId, _srcAddress, _nonce, _payload);\\n } else if (packetType == PT_SEND_AND_CALL) {\\n _sendAndCallAck(_srcChainId, _srcAddress, _nonce, _payload);\\n } else {\\n revert(\\\"ComposableOFTCore: unknown packet type\\\");\\n }\\n }\\n\\n function _sendAndCall(\\n address _from,\\n uint16 _dstChainId,\\n bytes memory _toAddress,\\n uint _amount,\\n bytes calldata _payload,\\n uint64 _dstGasForCall,\\n address payable _refundAddress,\\n address _zroPaymentAddress,\\n bytes memory _adapterParams\\n ) internal virtual {\\n _checkAdapterParams(_dstChainId, PT_SEND_AND_CALL, _adapterParams, _dstGasForCall);\\n\\n uint amount = _debitFrom(_from, _dstChainId, _toAddress, _amount);\\n\\n bytes memory lzPayload = abi.encode(\\n PT_SEND_AND_CALL,\\n abi.encodePacked(msg.sender),\\n _toAddress,\\n amount,\\n _payload,\\n _dstGasForCall\\n );\\n _lzSend(_dstChainId, lzPayload, _refundAddress, _zroPaymentAddress, _adapterParams, msg.value);\\n\\n emit SendToChain(_dstChainId, _from, _toAddress, amount);\\n }\\n\\n function _sendAndCallAck(\\n uint16 _srcChainId,\\n bytes memory _srcAddress,\\n uint64 _nonce,\\n bytes memory _payload\\n ) internal virtual {\\n (, bytes memory from, bytes memory toAddress, uint amount, bytes memory payload, uint64 gasForCall) = abi\\n .decode(_payload, (uint16, bytes, bytes, uint, bytes, uint64));\\n\\n address to = toAddress.toAddress(0);\\n\\n amount = _creditTo(_srcChainId, to, amount);\\n emit ReceiveFromChain(_srcChainId, to, amount);\\n\\n if (!_isContract(to)) {\\n emit NonContractAddress(to);\\n return;\\n }\\n\\n _safeCallOnOFTReceived(_srcChainId, _srcAddress, _nonce, from, to, amount, payload, gasForCall);\\n }\\n\\n function _safeCallOnOFTReceived(\\n uint16 _srcChainId,\\n bytes memory _srcAddress,\\n uint64 _nonce,\\n bytes memory _from,\\n address _to,\\n uint _amount,\\n bytes memory _payload,\\n uint _gasForCall\\n ) internal virtual {\\n (bool success, bytes memory reason) = _to.excessivelySafeCall(\\n _gasForCall,\\n 150,\\n abi.encodeWithSelector(\\n IOFTReceiverUpgradeable.onOFTReceived.selector,\\n _srcChainId,\\n _srcAddress,\\n _nonce,\\n _from,\\n _amount,\\n _payload\\n )\\n );\\n if (!success) {\\n failedOFTReceivedMessages[_srcChainId][_srcAddress][_nonce] = keccak256(\\n abi.encode(_from, _to, _amount, _payload)\\n );\\n emit CallOFTReceivedFailure(_srcChainId, _srcAddress, _nonce, _from, _to, _amount, _payload, reason);\\n } else {\\n bytes32 hash = keccak256(abi.encode(_from, _to, _amount, _payload));\\n emit CallOFTReceivedSuccess(_srcChainId, _srcAddress, _nonce, hash);\\n }\\n }\\n\\n function _isContract(address _account) internal view returns (bool) {\\n return _account.code.length > 0;\\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 uint[49] private __gap;\\n}\\n\",\"keccak256\":\"0xd48fef107e073a99c155f672be9c4d7430f275388f88e0a2b89dc910b86f157b\",\"license\":\"MIT\"},\"contracts/dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/composable/IComposableOFTCoreUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.5.0;\\n\\nimport \\\"../IOFTCoreUpgradeable.sol\\\";\\n\\n/**\\n * @dev Interface of the composable OFT core standard\\n */\\ninterface IComposableOFTCoreUpgradeable is IOFTCoreUpgradeable {\\n function estimateSendAndCallFee(\\n uint16 _dstChainId,\\n bytes calldata _toAddress,\\n uint _amount,\\n bytes calldata _payload,\\n uint64 _dstGasForCall,\\n bool _useZro,\\n bytes calldata _adapterParams\\n ) external view returns (uint nativeFee, uint zroFee);\\n\\n function sendAndCall(\\n address _from,\\n uint16 _dstChainId,\\n bytes calldata _toAddress,\\n uint _amount,\\n bytes calldata _payload,\\n uint64 _dstGasForCall,\\n address payable _refundAddress,\\n address _zroPaymentAddress,\\n bytes calldata _adapterParams\\n ) external payable;\\n\\n function retryOFTReceived(\\n uint16 _srcChainId,\\n bytes calldata _srcAddress,\\n uint64 _nonce,\\n bytes calldata _from,\\n address _to,\\n uint _amount,\\n bytes calldata _payload\\n ) external;\\n\\n event CallOFTReceivedFailure(\\n uint16 indexed _srcChainId,\\n bytes _srcAddress,\\n uint64 _nonce,\\n bytes _from,\\n address indexed _to,\\n uint _amount,\\n bytes _payload,\\n bytes _reason\\n );\\n\\n event CallOFTReceivedSuccess(uint16 indexed _srcChainId, bytes _srcAddress, uint64 _nonce, bytes32 _hash);\\n\\n event RetryOFTReceivedSuccess(bytes32 _messageHash);\\n\\n event NonContractAddress(address _address);\\n}\\n\",\"keccak256\":\"0x769b9356ad6019bdabdcfc11762f28d15eb9a4e262efc96835725f6862c5d9e9\",\"license\":\"MIT\"},\"contracts/dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/composable/IOFTReceiverUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.5.0;\\n\\ninterface IOFTReceiverUpgradeable {\\n /**\\n * @dev Called by the OFT contract when tokens are received from source chain.\\n * @param _srcChainId The chain id of the source chain.\\n * @param _srcAddress The address of the OFT token contract on the source chain.\\n * @param _nonce The nonce of the transaction on the source chain.\\n * @param _from The address of the account who calls the sendAndCall() on the source chain.\\n * @param _amount The amount of tokens to transfer.\\n * @param _payload Additional data with no specified format.\\n */\\n function onOFTReceived(\\n uint16 _srcChainId,\\n bytes calldata _srcAddress,\\n uint64 _nonce,\\n bytes calldata _from,\\n uint _amount,\\n bytes calldata _payload\\n ) external;\\n}\\n\",\"keccak256\":\"0x287036c704c57e34a6fc3f7e67c8dfaaade6eb3667b570576bc491c0f1f89a5b\",\"license\":\"MIT\"},\"contracts/dependencies/@layerzerolabs/solidity-examples/util/BytesLib.sol\":{\"content\":\"// SPDX-License-Identifier: Unlicense\\n/*\\n * @title Solidity Bytes Arrays Utils\\n * @author Gon\\u00e7alo S\\u00e1 \\n *\\n * @dev Bytes tightly packed arrays utility library for ethereum contracts written in Solidity.\\n * The library lets you concatenate, slice and type cast bytes arrays both in memory and storage.\\n */\\npragma solidity >=0.8.0 <0.9.0;\\n\\nlibrary BytesLib {\\n function concat(bytes memory _preBytes, bytes memory _postBytes) internal pure returns (bytes memory) {\\n bytes memory tempBytes;\\n\\n assembly {\\n // Get a location of some free memory and store it in tempBytes as\\n // Solidity does for memory variables.\\n tempBytes := mload(0x40)\\n\\n // Store the length of the first bytes array at the beginning of\\n // the memory for tempBytes.\\n let length := mload(_preBytes)\\n mstore(tempBytes, length)\\n\\n // Maintain a memory counter for the current write location in the\\n // temp bytes array by adding the 32 bytes for the array length to\\n // the starting location.\\n let mc := add(tempBytes, 0x20)\\n // Stop copying when the memory counter reaches the length of the\\n // first bytes array.\\n let end := add(mc, length)\\n\\n for {\\n // Initialize a copy counter to the start of the _preBytes data,\\n // 32 bytes into its memory.\\n let cc := add(_preBytes, 0x20)\\n } lt(mc, end) {\\n // Increase both counters by 32 bytes each iteration.\\n mc := add(mc, 0x20)\\n cc := add(cc, 0x20)\\n } {\\n // Write the _preBytes data into the tempBytes memory 32 bytes\\n // at a time.\\n mstore(mc, mload(cc))\\n }\\n\\n // Add the length of _postBytes to the current length of tempBytes\\n // and store it as the new length in the first 32 bytes of the\\n // tempBytes memory.\\n length := mload(_postBytes)\\n mstore(tempBytes, add(length, mload(tempBytes)))\\n\\n // Move the memory counter back from a multiple of 0x20 to the\\n // actual end of the _preBytes data.\\n mc := end\\n // Stop copying when the memory counter reaches the new combined\\n // length of the arrays.\\n end := add(mc, length)\\n\\n for {\\n let cc := add(_postBytes, 0x20)\\n } lt(mc, end) {\\n mc := add(mc, 0x20)\\n cc := add(cc, 0x20)\\n } {\\n mstore(mc, mload(cc))\\n }\\n\\n // Update the free-memory pointer by padding our last write location\\n // to 32 bytes: add 31 bytes to the end of tempBytes to move to the\\n // next 32 byte block, then round down to the nearest multiple of\\n // 32. If the sum of the length of the two arrays is zero then add\\n // one before rounding down to leave a blank 32 bytes (the length block with 0).\\n mstore(\\n 0x40,\\n and(\\n add(add(end, iszero(add(length, mload(_preBytes)))), 31),\\n not(31) // Round down to the nearest 32 bytes.\\n )\\n )\\n }\\n\\n return tempBytes;\\n }\\n\\n function concatStorage(bytes storage _preBytes, bytes memory _postBytes) internal {\\n assembly {\\n // Read the first 32 bytes of _preBytes storage, which is the length\\n // of the array. (We don't need to use the offset into the slot\\n // because arrays use the entire slot.)\\n let fslot := sload(_preBytes.slot)\\n // Arrays of 31 bytes or less have an even value in their slot,\\n // while longer arrays have an odd value. The actual length is\\n // the slot divided by two for odd values, and the lowest order\\n // byte divided by two for even values.\\n // If the slot is even, bitwise and the slot with 255 and divide by\\n // two to get the length. If the slot is odd, bitwise and the slot\\n // with -1 and divide by two.\\n let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2)\\n let mlength := mload(_postBytes)\\n let newlength := add(slength, mlength)\\n // slength can contain both the length and contents of the array\\n // if length < 32 bytes so let's prepare for that\\n // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage\\n switch add(lt(slength, 32), lt(newlength, 32))\\n case 2 {\\n // Since the new array still fits in the slot, we just need to\\n // update the contents of the slot.\\n // uint256(bytes_storage) = uint256(bytes_storage) + uint256(bytes_memory) + new_length\\n sstore(\\n _preBytes.slot,\\n // all the modifications to the slot are inside this\\n // next block\\n add(\\n // we can just add to the slot contents because the\\n // bytes we want to change are the LSBs\\n fslot,\\n add(\\n mul(\\n div(\\n // load the bytes from memory\\n mload(add(_postBytes, 0x20)),\\n // zero all bytes to the right\\n exp(0x100, sub(32, mlength))\\n ),\\n // and now shift left the number of bytes to\\n // leave space for the length in the slot\\n exp(0x100, sub(32, newlength))\\n ),\\n // increase length by the double of the memory\\n // bytes length\\n mul(mlength, 2)\\n )\\n )\\n )\\n }\\n case 1 {\\n // The stored value fits in the slot, but the combined value\\n // will exceed it.\\n // get the keccak hash to get the contents of the array\\n mstore(0x0, _preBytes.slot)\\n let sc := add(keccak256(0x0, 0x20), div(slength, 32))\\n\\n // save new length\\n sstore(_preBytes.slot, add(mul(newlength, 2), 1))\\n\\n // The contents of the _postBytes array start 32 bytes into\\n // the structure. Our first read should obtain the `submod`\\n // bytes that can fit into the unused space in the last word\\n // of the stored array. To get this, we read 32 bytes starting\\n // from `submod`, so the data we read overlaps with the array\\n // contents by `submod` bytes. Masking the lowest-order\\n // `submod` bytes allows us to add that value directly to the\\n // stored value.\\n\\n let submod := sub(32, slength)\\n let mc := add(_postBytes, submod)\\n let end := add(_postBytes, mlength)\\n let mask := sub(exp(0x100, submod), 1)\\n\\n sstore(\\n sc,\\n add(\\n and(fslot, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00),\\n and(mload(mc), mask)\\n )\\n )\\n\\n for {\\n mc := add(mc, 0x20)\\n sc := add(sc, 1)\\n } lt(mc, end) {\\n sc := add(sc, 1)\\n mc := add(mc, 0x20)\\n } {\\n sstore(sc, mload(mc))\\n }\\n\\n mask := exp(0x100, sub(mc, end))\\n\\n sstore(sc, mul(div(mload(mc), mask), mask))\\n }\\n default {\\n // get the keccak hash to get the contents of the array\\n mstore(0x0, _preBytes.slot)\\n // Start copying to the last used word of the stored array.\\n let sc := add(keccak256(0x0, 0x20), div(slength, 32))\\n\\n // save new length\\n sstore(_preBytes.slot, add(mul(newlength, 2), 1))\\n\\n // Copy over the first `submod` bytes of the new data as in\\n // case 1 above.\\n let slengthmod := mod(slength, 32)\\n let mlengthmod := mod(mlength, 32)\\n let submod := sub(32, slengthmod)\\n let mc := add(_postBytes, submod)\\n let end := add(_postBytes, mlength)\\n let mask := sub(exp(0x100, submod), 1)\\n\\n sstore(sc, add(sload(sc), and(mload(mc), mask)))\\n\\n for {\\n sc := add(sc, 1)\\n mc := add(mc, 0x20)\\n } lt(mc, end) {\\n sc := add(sc, 1)\\n mc := add(mc, 0x20)\\n } {\\n sstore(sc, mload(mc))\\n }\\n\\n mask := exp(0x100, sub(mc, end))\\n\\n sstore(sc, mul(div(mload(mc), mask), mask))\\n }\\n }\\n }\\n\\n function slice(bytes memory _bytes, uint256 _start, uint256 _length) internal pure returns (bytes memory) {\\n require(_length + 31 >= _length, \\\"slice_overflow\\\");\\n require(_bytes.length >= _start + _length, \\\"slice_outOfBounds\\\");\\n\\n bytes memory tempBytes;\\n\\n assembly {\\n switch iszero(_length)\\n case 0 {\\n // Get a location of some free memory and store it in tempBytes as\\n // Solidity does for memory variables.\\n tempBytes := mload(0x40)\\n\\n // The first word of the slice result is potentially a partial\\n // word read from the original array. To read it, we calculate\\n // the length of that partial word and start copying that many\\n // bytes into the array. The first word we copy will start with\\n // data we don't care about, but the last `lengthmod` bytes will\\n // land at the beginning of the contents of the new array. When\\n // we're done copying, we overwrite the full first word with\\n // the actual length of the slice.\\n let lengthmod := and(_length, 31)\\n\\n // The multiplication in the next line is necessary\\n // because when slicing multiples of 32 bytes (lengthmod == 0)\\n // the following copy loop was copying the origin's length\\n // and then ending prematurely not copying everything it should.\\n let mc := add(add(tempBytes, lengthmod), mul(0x20, iszero(lengthmod)))\\n let end := add(mc, _length)\\n\\n for {\\n // The multiplication in the next line has the same exact purpose\\n // as the one above.\\n let cc := add(add(add(_bytes, lengthmod), mul(0x20, iszero(lengthmod))), _start)\\n } lt(mc, end) {\\n mc := add(mc, 0x20)\\n cc := add(cc, 0x20)\\n } {\\n mstore(mc, mload(cc))\\n }\\n\\n mstore(tempBytes, _length)\\n\\n //update free-memory pointer\\n //allocating the array padded to 32 bytes like the compiler does now\\n mstore(0x40, and(add(mc, 31), not(31)))\\n }\\n //if we want a zero-length slice let's just return a zero-length array\\n default {\\n tempBytes := mload(0x40)\\n //zero out the 32 bytes slice we are about to return\\n //we need to do it because Solidity does not garbage collect\\n mstore(tempBytes, 0)\\n\\n mstore(0x40, add(tempBytes, 0x20))\\n }\\n }\\n\\n return tempBytes;\\n }\\n\\n function toAddress(bytes memory _bytes, uint256 _start) internal pure returns (address) {\\n require(_bytes.length >= _start + 20, \\\"toAddress_outOfBounds\\\");\\n address tempAddress;\\n\\n assembly {\\n tempAddress := div(mload(add(add(_bytes, 0x20), _start)), 0x1000000000000000000000000)\\n }\\n\\n return tempAddress;\\n }\\n\\n function toUint8(bytes memory _bytes, uint256 _start) internal pure returns (uint8) {\\n require(_bytes.length >= _start + 1, \\\"toUint8_outOfBounds\\\");\\n uint8 tempUint;\\n\\n assembly {\\n tempUint := mload(add(add(_bytes, 0x1), _start))\\n }\\n\\n return tempUint;\\n }\\n\\n function toUint16(bytes memory _bytes, uint256 _start) internal pure returns (uint16) {\\n require(_bytes.length >= _start + 2, \\\"toUint16_outOfBounds\\\");\\n uint16 tempUint;\\n\\n assembly {\\n tempUint := mload(add(add(_bytes, 0x2), _start))\\n }\\n\\n return tempUint;\\n }\\n\\n function toUint32(bytes memory _bytes, uint256 _start) internal pure returns (uint32) {\\n require(_bytes.length >= _start + 4, \\\"toUint32_outOfBounds\\\");\\n uint32 tempUint;\\n\\n assembly {\\n tempUint := mload(add(add(_bytes, 0x4), _start))\\n }\\n\\n return tempUint;\\n }\\n\\n function toUint64(bytes memory _bytes, uint256 _start) internal pure returns (uint64) {\\n require(_bytes.length >= _start + 8, \\\"toUint64_outOfBounds\\\");\\n uint64 tempUint;\\n\\n assembly {\\n tempUint := mload(add(add(_bytes, 0x8), _start))\\n }\\n\\n return tempUint;\\n }\\n\\n function toUint96(bytes memory _bytes, uint256 _start) internal pure returns (uint96) {\\n require(_bytes.length >= _start + 12, \\\"toUint96_outOfBounds\\\");\\n uint96 tempUint;\\n\\n assembly {\\n tempUint := mload(add(add(_bytes, 0xc), _start))\\n }\\n\\n return tempUint;\\n }\\n\\n function toUint128(bytes memory _bytes, uint256 _start) internal pure returns (uint128) {\\n require(_bytes.length >= _start + 16, \\\"toUint128_outOfBounds\\\");\\n uint128 tempUint;\\n\\n assembly {\\n tempUint := mload(add(add(_bytes, 0x10), _start))\\n }\\n\\n return tempUint;\\n }\\n\\n function toUint256(bytes memory _bytes, uint256 _start) internal pure returns (uint256) {\\n require(_bytes.length >= _start + 32, \\\"toUint256_outOfBounds\\\");\\n uint256 tempUint;\\n\\n assembly {\\n tempUint := mload(add(add(_bytes, 0x20), _start))\\n }\\n\\n return tempUint;\\n }\\n\\n function toBytes32(bytes memory _bytes, uint256 _start) internal pure returns (bytes32) {\\n require(_bytes.length >= _start + 32, \\\"toBytes32_outOfBounds\\\");\\n bytes32 tempBytes32;\\n\\n assembly {\\n tempBytes32 := mload(add(add(_bytes, 0x20), _start))\\n }\\n\\n return tempBytes32;\\n }\\n\\n function equal(bytes memory _preBytes, bytes memory _postBytes) internal pure returns (bool) {\\n bool success = true;\\n\\n assembly {\\n let length := mload(_preBytes)\\n\\n // if lengths don't match the arrays are not equal\\n switch eq(length, mload(_postBytes))\\n case 1 {\\n // cb is a circuit breaker in the for loop since there's\\n // no said feature for inline assembly loops\\n // cb = 1 - don't breaker\\n // cb = 0 - break\\n let cb := 1\\n\\n let mc := add(_preBytes, 0x20)\\n let end := add(mc, length)\\n\\n for {\\n let cc := add(_postBytes, 0x20)\\n // the next line is the loop condition:\\n // while(uint256(mc < end) + cb == 2)\\n } eq(add(lt(mc, end), cb), 2) {\\n mc := add(mc, 0x20)\\n cc := add(cc, 0x20)\\n } {\\n // if any of these checks fails then arrays are not equal\\n if iszero(eq(mload(mc), mload(cc))) {\\n // unsuccess:\\n success := 0\\n cb := 0\\n }\\n }\\n }\\n default {\\n // unsuccess:\\n success := 0\\n }\\n }\\n\\n return success;\\n }\\n\\n function equalStorage(bytes storage _preBytes, bytes memory _postBytes) internal view returns (bool) {\\n bool success = true;\\n\\n assembly {\\n // we know _preBytes_offset is 0\\n let fslot := sload(_preBytes.slot)\\n // Decode the length of the stored array like in concatStorage().\\n let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2)\\n let mlength := mload(_postBytes)\\n\\n // if lengths don't match the arrays are not equal\\n switch eq(slength, mlength)\\n case 1 {\\n // slength can contain both the length and contents of the array\\n // if length < 32 bytes so let's prepare for that\\n // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage\\n if iszero(iszero(slength)) {\\n switch lt(slength, 32)\\n case 1 {\\n // blank the last byte which is the length\\n fslot := mul(div(fslot, 0x100), 0x100)\\n\\n if iszero(eq(fslot, mload(add(_postBytes, 0x20)))) {\\n // unsuccess:\\n success := 0\\n }\\n }\\n default {\\n // cb is a circuit breaker in the for loop since there's\\n // no said feature for inline assembly loops\\n // cb = 1 - don't breaker\\n // cb = 0 - break\\n let cb := 1\\n\\n // get the keccak hash to get the contents of the array\\n mstore(0x0, _preBytes.slot)\\n let sc := keccak256(0x0, 0x20)\\n\\n let mc := add(_postBytes, 0x20)\\n let end := add(mc, mlength)\\n\\n // the next line is the loop condition:\\n // while(uint256(mc < end) + cb == 2)\\n for {\\n\\n } eq(add(lt(mc, end), cb), 2) {\\n sc := add(sc, 1)\\n mc := add(mc, 0x20)\\n } {\\n if iszero(eq(sload(sc), mload(mc))) {\\n // unsuccess:\\n success := 0\\n cb := 0\\n }\\n }\\n }\\n }\\n }\\n default {\\n // unsuccess:\\n success := 0\\n }\\n }\\n\\n return success;\\n }\\n}\\n\",\"keccak256\":\"0xaa1c57864bd8483bb17f2fa96a0cbebb39006ca7aab1a28ff85e52e487437c4c\",\"license\":\"Unlicense\"},\"contracts/dependencies/@layerzerolabs/solidity-examples/util/ExcessivelySafeCall.sol\":{\"content\":\"// SPDX-License-Identifier: MIT OR Apache-2.0\\npragma solidity >=0.7.6;\\n\\nlibrary ExcessivelySafeCall {\\n uint256 constant LOW_28_MASK = 0x00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff;\\n\\n /// @notice Use when you _really_ really _really_ don't trust the called\\n /// contract. This prevents the called contract from causing reversion of\\n /// the caller in as many ways as we can.\\n /// @dev The main difference between this and a solidity low-level call is\\n /// that we limit the number of bytes that the callee can cause to be\\n /// copied to caller memory. This prevents stupid things like malicious\\n /// contracts returning 10,000,000 bytes causing a local OOG when copying\\n /// to memory.\\n /// @param _target The address to call\\n /// @param _gas The amount of gas to forward to the remote contract\\n /// @param _maxCopy The maximum number of bytes of returndata to copy\\n /// to memory.\\n /// @param _calldata The data to send to the remote contract\\n /// @return success and returndata, as `.call()`. Returndata is capped to\\n /// `_maxCopy` bytes.\\n function excessivelySafeCall(\\n address _target,\\n uint256 _gas,\\n uint16 _maxCopy,\\n bytes memory _calldata\\n ) internal returns (bool, bytes memory) {\\n // set up for assembly call\\n uint256 _toCopy;\\n bool _success;\\n bytes memory _returnData = new bytes(_maxCopy);\\n // dispatch message to recipient\\n // by assembly calling \\\"handle\\\" function\\n // we call via assembly to avoid memcopying a very large returndata\\n // returned by a malicious contract\\n assembly {\\n _success := call(\\n _gas, // gas\\n _target, // recipient\\n 0, // ether value\\n add(_calldata, 0x20), // inloc\\n mload(_calldata), // inlen\\n 0, // outloc\\n 0 // outlen\\n )\\n // limit our copy to 256 bytes\\n _toCopy := returndatasize()\\n if gt(_toCopy, _maxCopy) {\\n _toCopy := _maxCopy\\n }\\n // Store the length of the copied bytes\\n mstore(_returnData, _toCopy)\\n // copy the bytes from returndata[0:_toCopy]\\n returndatacopy(add(_returnData, 0x20), 0, _toCopy)\\n }\\n return (_success, _returnData);\\n }\\n\\n /// @notice Use when you _really_ really _really_ don't trust the called\\n /// contract. This prevents the called contract from causing reversion of\\n /// the caller in as many ways as we can.\\n /// @dev The main difference between this and a solidity low-level call is\\n /// that we limit the number of bytes that the callee can cause to be\\n /// copied to caller memory. This prevents stupid things like malicious\\n /// contracts returning 10,000,000 bytes causing a local OOG when copying\\n /// to memory.\\n /// @param _target The address to call\\n /// @param _gas The amount of gas to forward to the remote contract\\n /// @param _maxCopy The maximum number of bytes of returndata to copy\\n /// to memory.\\n /// @param _calldata The data to send to the remote contract\\n /// @return success and returndata, as `.call()`. Returndata is capped to\\n /// `_maxCopy` bytes.\\n function excessivelySafeStaticCall(\\n address _target,\\n uint256 _gas,\\n uint16 _maxCopy,\\n bytes memory _calldata\\n ) internal view returns (bool, bytes memory) {\\n // set up for assembly call\\n uint256 _toCopy;\\n bool _success;\\n bytes memory _returnData = new bytes(_maxCopy);\\n // dispatch message to recipient\\n // by assembly calling \\\"handle\\\" function\\n // we call via assembly to avoid memcopying a very large returndata\\n // returned by a malicious contract\\n assembly {\\n _success := staticcall(\\n _gas, // gas\\n _target, // recipient\\n add(_calldata, 0x20), // inloc\\n mload(_calldata), // inlen\\n 0, // outloc\\n 0 // outlen\\n )\\n // limit our copy to 256 bytes\\n _toCopy := returndatasize()\\n if gt(_toCopy, _maxCopy) {\\n _toCopy := _maxCopy\\n }\\n // Store the length of the copied bytes\\n mstore(_returnData, _toCopy)\\n // copy the bytes from returndata[0:_toCopy]\\n returndatacopy(add(_returnData, 0x20), 0, _toCopy)\\n }\\n return (_success, _returnData);\\n }\\n\\n /**\\n * @notice Swaps function selectors in encoded contract calls\\n * @dev Allows reuse of encoded calldata for functions with identical\\n * argument types but different names. It simply swaps out the first 4 bytes\\n * for the new selector. This function modifies memory in place, and should\\n * only be used with caution.\\n * @param _newSelector The new 4-byte selector\\n * @param _buf The encoded contract args\\n */\\n function swapSelector(bytes4 _newSelector, bytes memory _buf) internal pure {\\n require(_buf.length >= 4);\\n uint256 _mask = LOW_28_MASK;\\n assembly {\\n // load the first word of\\n let _word := mload(add(_buf, 0x20))\\n // mask out the top 4 bytes\\n // /x\\n _word := and(_word, _mask)\\n _word := or(_newSelector, _word)\\n mstore(add(_buf, 0x20), _word)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x8355680ee3db8c855f77a0cb141eedb68e0894ddb2b7ffafdf78303f6dac23e0\",\"license\":\"MIT OR Apache-2.0\"},\"contracts/dependencies/openzeppelin-upgradeable/access/OwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (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 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 /**\\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\":\"0x652fee292f698d8dba81bf287cb71f1682f6483b67ebe601a5f7387dcfc30b34\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.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 * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\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. Equivalent to `reinitializer(1)`.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = _setInitializedVersion(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 * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original\\n * initialization step. This is essential to configure modules that are added through upgrades and that require\\n * initialization.\\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 modifier reinitializer(uint8 version) {\\n bool isTopLevelCall = _setInitializedVersion(version);\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(version);\\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} 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 function _disableInitializers() internal virtual {\\n _setInitializedVersion(type(uint8).max);\\n }\\n\\n function _setInitializedVersion(uint8 version) private returns (bool) {\\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, and for the lowest level\\n // of initializers, because in other contexts the contract may have been reentered.\\n if (_initializing) {\\n require(\\n version == 1 && !AddressUpgradeable.isContract(address(this)),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n return false;\\n } else {\\n require(_initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n return true;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x7454006cccb737612b00104d2f606d728e2818b778e7e55542f063c614ce46ba\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin-upgradeable/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.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 *\\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 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\":\"0x55cf2bd9fc76704ddcdc19834cd288b7de00fc0f298a40ea16a954ae8991db2d\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin-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\"},\"contracts/dependencies/openzeppelin-upgradeable/utils/introspection/ERC165Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC165Upgradeable.sol\\\";\\nimport \\\"../../proxy/utils/Initializable.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 ERC165Upgradeable is Initializable, IERC165Upgradeable {\\n function __ERC165_init() internal onlyInitializing {\\n }\\n\\n function __ERC165_init_unchained() internal onlyInitializing {\\n }\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IERC165Upgradeable).interfaceId;\\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\":\"0x9a3b990bd56d139df3e454a9edf1c64668530b5a77fc32eb063bc206f958274a\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin-upgradeable/utils/introspection/IERC165Upgradeable.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 IERC165Upgradeable {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0xc6cef87559d0aeffdf0a99803de655938a7779ec0a3cd5d4383483ad85565a09\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\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 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 `recipient`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address recipient, 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 `sender` to `recipient` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address sender,\\n address recipient,\\n uint256 amount\\n ) external returns (bool);\\n\\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\",\"keccak256\":\"0x027b891937d20ccf213fdb9c31531574256de774bda99d3a70ecef6e1913ed2a\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\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\":\"0x83fe24f5c04a56091e50f4a345ff504c8bff658a76d4c43b16878c8f940c53b2\",\"license\":\"MIT\"},\"contracts/dependencies/stargate-protocol/interfaces/IStargateComposer.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./IStargateRouter.sol\\\";\\n\\ninterface IStargateComposer {\\n function swap(\\n uint16 _dstChainId,\\n uint256 _srcPoolId,\\n uint256 _dstPoolId,\\n address payable _refundAddress,\\n uint256 _amountLD,\\n uint256 _minAmountLD,\\n IStargateRouter.lzTxObj memory _lzTxParams,\\n bytes calldata _to,\\n bytes calldata _payload\\n ) external payable;\\n\\n function factory() external view returns (address);\\n\\n function stargateBridge() external view returns (address);\\n\\n function stargateRouter() external view returns (IStargateRouter);\\n\\n function quoteLayerZeroFee(\\n uint16 _dstChainId,\\n uint8 _functionType,\\n bytes calldata _toAddress,\\n bytes calldata _transferAndCallPayload,\\n IStargateRouter.lzTxObj memory _lzTxParams\\n ) external view returns (uint256, uint256);\\n\\n function peers(uint16 _chainId) external view returns (address);\\n}\\n\",\"keccak256\":\"0xdfdd1690bf176ac05803534a60227be90cc435b4bdd8fce2348f1a9417a9f63a\",\"license\":\"BUSL-1.1\"},\"contracts/dependencies/stargate-protocol/interfaces/IStargateReceiver.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\n\\npragma solidity 0.8.9;\\n\\ninterface IStargateReceiver {\\n function sgReceive(\\n uint16 _chainId,\\n bytes memory _srcAddress,\\n uint256 _nonce,\\n address _token,\\n uint256 amountLD,\\n bytes memory payload\\n ) external;\\n}\\n\",\"keccak256\":\"0xe4d6bf9fa422e5e43dc1b6880f951d06611a4ed12c2dd7dd8c0b6a5d9e06ad0d\",\"license\":\"BUSL-1.1\"},\"contracts/dependencies/stargate-protocol/interfaces/IStargateRouter.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\n\\npragma solidity 0.8.9;\\n\\ninterface IStargateRouter {\\n struct lzTxObj {\\n uint256 dstGasForCall;\\n uint256 dstNativeAmount;\\n bytes dstNativeAddr;\\n }\\n\\n function addLiquidity(uint256 _poolId, uint256 _amountLD, address _to) external;\\n\\n function swap(\\n uint16 _dstChainId,\\n uint256 _srcPoolId,\\n uint256 _dstPoolId,\\n address payable _refundAddress,\\n uint256 _amountLD,\\n uint256 _minAmountLD,\\n lzTxObj memory _lzTxParams,\\n bytes calldata _to,\\n bytes calldata _payload\\n ) external payable;\\n\\n function redeemRemote(\\n uint16 _dstChainId,\\n uint256 _srcPoolId,\\n uint256 _dstPoolId,\\n address payable _refundAddress,\\n uint256 _amountLP,\\n uint256 _minAmountLD,\\n bytes calldata _to,\\n lzTxObj memory _lzTxParams\\n ) external payable;\\n\\n function instantRedeemLocal(uint16 _srcPoolId, uint256 _amountLP, address _to) external returns (uint256);\\n\\n function redeemLocal(\\n uint16 _dstChainId,\\n uint256 _srcPoolId,\\n uint256 _dstPoolId,\\n address payable _refundAddress,\\n uint256 _amountLP,\\n bytes calldata _to,\\n lzTxObj memory _lzTxParams\\n ) external payable;\\n\\n function sendCredits(\\n uint16 _dstChainId,\\n uint256 _srcPoolId,\\n uint256 _dstPoolId,\\n address payable _refundAddress\\n ) external payable;\\n\\n function quoteLayerZeroFee(\\n uint16 _dstChainId,\\n uint8 _functionType,\\n bytes calldata _toAddress,\\n bytes calldata _transferAndCallPayload,\\n lzTxObj memory _lzTxParams\\n ) external view returns (uint256, uint256);\\n\\n function clearCachedSwap(uint16 _srcChainId, bytes calldata _srcAddress, uint256 _nonce) external;\\n\\n function factory() external view returns (address);\\n\\n function bridge() external view returns (address);\\n\\n function cachedSwapLookup(\\n uint16 _chainId_,\\n bytes calldata _srcAddress,\\n uint256 _nonce\\n ) external view returns (address token, uint256 amountLD, address to, bytes memory payload);\\n}\\n\",\"keccak256\":\"0x92126df8e682b2c5647c7b22e7387da69f9e72480af86948ce5ed17dc2c9e0a7\",\"license\":\"BUSL-1.1\"},\"contracts/interfaces/ICrossChainDispatcher.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/composable/IOFTReceiverUpgradeable.sol\\\";\\nimport \\\"../dependencies/stargate-protocol/interfaces/IStargateReceiver.sol\\\";\\nimport \\\"../dependencies/stargate-protocol/interfaces/IStargateRouter.sol\\\";\\nimport \\\"../dependencies/stargate-protocol/interfaces/IStargateComposer.sol\\\";\\nimport \\\"./IProxyOFT.sol\\\";\\n\\ninterface ICrossChainDispatcher is IStargateReceiver, IOFTReceiverUpgradeable {\\n function crossChainDispatcherOf(uint16 chainId_) external view returns (address);\\n\\n function triggerFlashRepaySwap(\\n uint256 id_,\\n address payable account_,\\n address tokenIn_,\\n address tokenOut_,\\n uint256 amountIn_,\\n uint256 amountOutMin_,\\n bytes calldata lzArgs_\\n ) external payable;\\n\\n function triggerLeverageSwap(\\n uint256 id_,\\n address payable account_,\\n address tokenIn_,\\n address tokenOut_,\\n uint256 amountIn_,\\n uint256 amountOutMin,\\n bytes calldata lzArgs_\\n ) external payable;\\n\\n function isBridgingActive() external view returns (bool);\\n\\n function flashRepayCallbackTxGasLimit() external view returns (uint64);\\n\\n function flashRepaySwapTxGasLimit() external view returns (uint64);\\n\\n function leverageCallbackTxGasLimit() external view returns (uint64);\\n\\n function leverageSwapTxGasLimit() external view returns (uint64);\\n\\n function lzBaseGasLimit() external view returns (uint256);\\n\\n function stargateComposer() external view returns (IStargateComposer);\\n\\n function stargateSlippage() external view returns (uint256);\\n\\n function stargatePoolIdOf(address token_) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xcaf05e625588dcfaa5706acc78a35fa46d50baeb2d28f689036963695a4e39cb\",\"license\":\"MIT\"},\"contracts/interfaces/IDebtToken.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/openzeppelin/token/ERC20/extensions/IERC20Metadata.sol\\\";\\nimport \\\"./ISyntheticToken.sol\\\";\\n\\ninterface IDebtToken is IERC20Metadata {\\n function lastTimestampAccrued() external view returns (uint256);\\n\\n function isActive() external view returns (bool);\\n\\n function syntheticToken() external view returns (ISyntheticToken);\\n\\n function accrueInterest() external;\\n\\n function debtIndex() external returns (uint256 debtIndex_);\\n\\n function burn(address from_, uint256 amount_) external;\\n\\n function issue(uint256 amount_, address to_) external returns (uint256 _issued, uint256 _fee);\\n\\n function flashIssue(address to_, uint256 amount_) external returns (uint256 _issued, uint256 _fee);\\n\\n function mint(address to_, uint256 amount_) external;\\n\\n function repay(address onBehalfOf_, uint256 amount_) external returns (uint256 _repaid, uint256 _fee);\\n\\n function repayAll(address onBehalfOf_) external returns (uint256 _repaid, uint256 _fee);\\n\\n function quoteIssueIn(uint256 amountToIssue_) external view returns (uint256 _amount, uint256 _fee);\\n\\n function quoteIssueOut(uint256 amount_) external view returns (uint256 _amountToIssue, uint256 _fee);\\n\\n function quoteRepayIn(uint256 amountToRepay_) external view returns (uint256 _amount, uint256 _fee);\\n\\n function quoteRepayOut(uint256 amount_) external view returns (uint256 _amountToRepay, uint256 _fee);\\n\\n function updateMaxTotalSupply(uint256 newMaxTotalSupply_) external;\\n\\n function updateInterestRate(uint256 newInterestRate_) external;\\n\\n function maxTotalSupply() external view returns (uint256);\\n\\n function interestRate() external view returns (uint256);\\n\\n function interestRatePerSecond() external view returns (uint256);\\n\\n function toggleIsActive() external;\\n}\\n\",\"keccak256\":\"0xd2f04aa1bee06d6991b10aaf7c03c3ee09d85f8e48ba92feac595ad855881380\",\"license\":\"MIT\"},\"contracts/interfaces/IGovernable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\n/**\\n * @notice Governable interface\\n */\\ninterface IGovernable {\\n function governor() external view returns (address _governor);\\n\\n function transferGovernorship(address _proposedGovernor) external;\\n}\\n\",\"keccak256\":\"0xbe84461adf33aec1bf31b6d84a5380aaeb791de9a4b95346dd8270dc6632984e\",\"license\":\"MIT\"},\"contracts/interfaces/IPauseable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\ninterface IPauseable {\\n function paused() external view returns (bool);\\n\\n function everythingStopped() external view returns (bool);\\n}\\n\",\"keccak256\":\"0xa768de9fadad05a8104cb407ae6243354e70ffd6e1a50c3e0bb0a6a1dc49d32a\",\"license\":\"MIT\"},\"contracts/interfaces/IPoolRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./external/IMasterOracle.sol\\\";\\nimport \\\"./IPauseable.sol\\\";\\nimport \\\"./IGovernable.sol\\\";\\nimport \\\"./ISyntheticToken.sol\\\";\\nimport \\\"./external/ISwapper.sol\\\";\\nimport \\\"./IQuoter.sol\\\";\\nimport \\\"./ICrossChainDispatcher.sol\\\";\\n\\ninterface IPoolRegistry is IPauseable, IGovernable {\\n function feeCollector() external view returns (address);\\n\\n function isPoolRegistered(address pool_) external view returns (bool);\\n\\n function nativeTokenGateway() external view returns (address);\\n\\n function getPools() external view returns (address[] memory);\\n\\n function registerPool(address pool_) external;\\n\\n function unregisterPool(address pool_) external;\\n\\n function masterOracle() external view returns (IMasterOracle);\\n\\n function updateFeeCollector(address newFeeCollector_) external;\\n\\n function idOfPool(address pool_) external view returns (uint256);\\n\\n function nextPoolId() external view returns (uint256);\\n\\n function swapper() external view returns (ISwapper);\\n\\n function quoter() external view returns (IQuoter);\\n\\n function crossChainDispatcher() external view returns (ICrossChainDispatcher);\\n\\n function doesSyntheticTokenExist(ISyntheticToken syntheticToken_) external view returns (bool _exists);\\n}\\n\",\"keccak256\":\"0x9ffa9e5fd39a48ac2bda561af7fb4fc9df5f8ffb7a602ef1d4da8c068019e723\",\"license\":\"MIT\"},\"contracts/interfaces/IProxyOFT.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/composable/IComposableOFTCoreUpgradeable.sol\\\";\\n\\ninterface IProxyOFT is IComposableOFTCoreUpgradeable {\\n function getProxyOFTOf(uint16 chainId_) external view returns (address _proxyOFT);\\n}\\n\",\"keccak256\":\"0x4041a90eb60de460c9e1631aaedfbf2bff2275b3f91964800b1c774546931cd5\",\"license\":\"MIT\"},\"contracts/interfaces/IQuoter.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./IPoolRegistry.sol\\\";\\nimport \\\"./IProxyOFT.sol\\\";\\n\\ninterface IQuoter {\\n function quoteCrossChainFlashRepayNativeFee(\\n IProxyOFT proxyOFT_,\\n bytes calldata lzArgs_\\n ) external view returns (uint256 _nativeFee);\\n\\n function quoteCrossChainLeverageNativeFee(\\n IProxyOFT proxyOFT_,\\n bytes calldata lzArgs_\\n ) external view returns (uint256 _nativeFee);\\n\\n function quoteLeverageCallbackNativeFee(uint16 dstChainId_) external view returns (uint256 _callbackTxNativeFee);\\n\\n function quoteFlashRepayCallbackNativeFee(uint16 dstChainId_) external view returns (uint256 _callbackTxNativeFee);\\n\\n function getFlashRepaySwapAndCallbackLzArgs(\\n uint16 srcChainId_,\\n uint16 dstChainId_\\n ) external view returns (bytes memory lzArgs_);\\n\\n function getLeverageSwapAndCallbackLzArgs(\\n uint16 srcChainId_,\\n uint16 dstChainId_\\n ) external view returns (bytes memory lzArgs_);\\n}\\n\",\"keccak256\":\"0x1e4d2dd779a09dc8ea6b6c244b167deddca3a48e71b73bf940da04113b40c752\",\"license\":\"MIT\"},\"contracts/interfaces/ISyntheticToken.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/openzeppelin/token/ERC20/extensions/IERC20Metadata.sol\\\";\\nimport \\\"./IDebtToken.sol\\\";\\nimport \\\"./IPoolRegistry.sol\\\";\\nimport \\\"../interfaces/IProxyOFT.sol\\\";\\n\\ninterface ISyntheticToken is IERC20Metadata {\\n function isActive() external view returns (bool);\\n\\n function mint(address to_, uint256 amount_) external;\\n\\n function burn(address from_, uint256 amount) external;\\n\\n function poolRegistry() external view returns (IPoolRegistry);\\n\\n function toggleIsActive() external;\\n\\n function seize(address from_, address to_, uint256 amount_) external;\\n\\n function updateMaxTotalSupply(uint256 newMaxTotalSupply_) external;\\n\\n function updateProxyOFT(IProxyOFT newProxyOFT_) external;\\n\\n function maxTotalSupply() external view returns (uint256);\\n\\n function proxyOFT() external view returns (IProxyOFT);\\n}\\n\",\"keccak256\":\"0xfaeb24d1067e85493a5c8818d6de06fc6dbc72c37e85f82811990d0120f8a0cf\",\"license\":\"MIT\"},\"contracts/interfaces/external/IMasterOracle.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\ninterface IMasterOracle {\\n function quoteTokenToUsd(address _asset, uint256 _amount) external view returns (uint256 _amountInUsd);\\n\\n function quoteUsdToToken(address _asset, uint256 _amountInUsd) external view returns (uint256 _amount);\\n\\n function quote(address _assetIn, address _assetOut, uint256 _amountIn) external view returns (uint256 _amountOut);\\n}\\n\",\"keccak256\":\"0x2f080adc5880151dc4446ef43b54abab8e3711c5f2e526917ef39a05e3c16a00\",\"license\":\"MIT\"},\"contracts/interfaces/external/ISwapper.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\ninterface ISwapper {\\n function swapExactInput(\\n address tokenIn_,\\n address tokenOut_,\\n uint256 amountIn_,\\n uint256 amountOutMin_,\\n address receiver_\\n ) external returns (uint256 _amountOut);\\n}\\n\",\"keccak256\":\"0x75f04b225d0c310be7e0a09ee4c1aa6eeeb8d94e02fc0e4160a9597ce2d8d446\",\"license\":\"MIT\"},\"contracts/storage/ProxyOFTStorage.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../interfaces/ISyntheticToken.sol\\\";\\nimport \\\"../interfaces/IProxyOFT.sol\\\";\\n\\nabstract contract ProxyOFTStorageV1 is IProxyOFT {\\n /**\\n * @notice The synthetic token contract\\n */\\n ISyntheticToken internal syntheticToken;\\n}\\n\",\"keccak256\":\"0x5042de3c712800cbd66633bd9ec331a26f795ea18dbef3addee69ce27c32e80c\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x60806040523480156200001157600080fd5b506200001c62000022565b62000152565b6200002e60ff62000031565b50565b60008054610100900460ff1615620000ca578160ff1660011480156200006a575062000068306200014360201b620023b31760201c565b155b620000c25760405162461bcd60e51b815260206004820152602e6024820152600080516020620049bc83398151915260448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b506000919050565b60005460ff808416911610620001295760405162461bcd60e51b815260206004820152602e6024820152600080516020620049bc83398151915260448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401620000b9565b506000805460ff191660ff92909216919091179055600190565b6001600160a01b03163b151590565b61485a80620001626000396000f3fe6080604052600436106102665760003560e01c8063950c8a7411610144578063df2a5b3b116100b6578063ed629c5c1161007a578063ed629c5c146107a1578063f2fde38b146107bb578063f5ecbdbc146107db578063fc0c546a146107fb578063ff0454e21461081a578063ffa1ad741461083a57600080fd5b8063df2a5b3b14610719578063e6a20ae614610739578063e7f0c59f1461074e578063eab45d9c14610761578063eb8d72b71461078157600080fd5b8063c223533a11610108578063c223533a14610670578063c446183414610690578063c8598dca146106a6578063cbed8b9c146106c6578063cfd6528e146106e6578063d1deba1f1461070657600080fd5b8063950c8a74146105d05780639f38369a146105f0578063a6c3d16514610610578063b353aaa714610630578063baf3292d1461065057600080fd5b80634c42899a116101dd57806366ad5c8a116101a157806366ad5c8a146104f4578063715018a6146105145780637533d788146105295780638cfd8f5c146105565780638da5cb5b1461058e5780639358928b146105bb57600080fd5b80634c42899a14610407578063519056361461042f5780635823f91b146104425780635b8c41e6146104555780636096cc58146104a457600080fd5b80632a205e3d1161022f5780632a205e3d146103225780633d8b38f6146103575780633f1f4fa41461037757806342d65a8d146103b257806344770515146103d2578063485cc955146103e757600080fd5b80621d35671461026b57806301ffc9a71461028d57806307e0db17146102c25780630df37483146102e257806310ddb13714610302575b600080fd5b34801561027757600080fd5b5061028b6102863660046135eb565b61086b565b005b34801561029957600080fd5b506102ad6102a8366004613681565b610a87565b60405190151581526020015b60405180910390f35b3480156102ce57600080fd5b5061028b6102dd3660046136ab565b610ab2565b3480156102ee57600080fd5b5061028b6102fd3660046136c8565b610b46565b34801561030e57600080fd5b5061028b61031d3660046136ab565b610b8c565b34801561032e57600080fd5b5061034261033d36600461370d565b610bef565b604080519283526020830191909152016102b9565b34801561036357600080fd5b506102ad6103723660046137ad565b610cb4565b34801561038357600080fd5b506103a46103923660046136ab565b60686020526000908152604090205481565b6040519081526020016102b9565b3480156103be57600080fd5b5061028b6103cd3660046137ad565b610d80565b3480156103de57600080fd5b506103a4600081565b3480156103f357600080fd5b5061028b610402366004613821565b610e11565b34801561041357600080fd5b5061041c600081565b60405161ffff90911681526020016102b9565b61028b61043d36600461385a565b610ef4565b61028b610450366004613923565b610f79565b34801561046157600080fd5b506103a46104703660046139e1565b6097602090815260009384526040808520845180860184018051928152908401958401959095209452929052825290205481565b3480156104b057600080fd5b506103a46104bf3660046139e1565b61012d602090815260009384526040808520845180860184018051928152908401958401959095209452929052825290205481565b34801561050057600080fd5b5061028b61050f3660046135eb565b611145565b34801561052057600080fd5b5061028b611221565b34801561053557600080fd5b506105496105443660046136ab565b611254565b6040516102b99190613adf565b34801561056257600080fd5b506103a4610571366004613af2565b606760209081526000928352604080842090915290825290205481565b34801561059a57600080fd5b506105a36112ee565b6040516001600160a01b0390911681526020016102b9565b3480156105c757600080fd5b506103a46113e1565b3480156105dc57600080fd5b506069546105a3906001600160a01b031681565b3480156105fc57600080fd5b5061054961060b3660046136ab565b61145f565b34801561061c57600080fd5b5061028b61062b3660046137ad565b611576565b34801561063c57600080fd5b506065546105a3906001600160a01b031681565b34801561065c57600080fd5b5061028b61066b366004613b20565b611623565b34801561067c57600080fd5b506103a461068b366004613b3d565b6116a7565b34801561069c57600080fd5b506103a461271081565b3480156106b257600080fd5b506103426106c1366004613b7e565b6118ec565b3480156106d257600080fd5b5061028b6106e1366004613c5c565b6119ed565b3480156106f257600080fd5b5061028b610701366004613cce565b611a82565b61028b6107143660046135eb565b611cca565b34801561072557600080fd5b5061028b610734366004613d88565b611ee0565b34801561074557600080fd5b5061041c600181565b61028b61075c366004613db8565b611fb9565b34801561076d57600080fd5b5061028b61077c366004613ec1565b612170565b34801561078d57600080fd5b5061028b61079c3660046137ad565b6121e0565b3480156107ad57600080fd5b5060fb546102ad9060ff1681565b3480156107c757600080fd5b5061028b6107d6366004613b20565b611221565b3480156107e757600080fd5b506105496107f6366004613ede565b612261565b34801561080757600080fd5b5061015f546001600160a01b03166105a3565b34801561082657600080fd5b506105a36108353660046136ab565b612303565b34801561084657600080fd5b50610549604051806040016040528060058152602001640312e332e360dc1b81525081565b6065546001600160a01b0316336001600160a01b0316146108d35760405162461bcd60e51b815260206004820152601e60248201527f4c7a4170703a20696e76616c696420656e64706f696e742063616c6c6572000060448201526064015b60405180910390fd5b61ffff8616600090815260666020526040812080546108f190613eff565b80601f016020809104026020016040519081016040528092919081815260200182805461091d90613eff565b801561096a5780601f1061093f5761010080835404028352916020019161096a565b820191906000526020600020905b81548152906001019060200180831161094d57829003601f168201915b50505050509050805186869050148015610985575060008151115b80156109ad5750805160208201206040516109a39088908890613f3a565b6040518091039020145b610a085760405162461bcd60e51b815260206004820152602660248201527f4c7a4170703a20696e76616c696420736f757263652073656e64696e6720636f6044820152651b9d1c9858dd60d21b60648201526084016108ca565b610a7e8787878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8a018190048102820181019092528881528a9350915088908890819084018382808284376000920191909152506123c292505050565b50505050505050565b60006001600160e01b0319821663e07f1adb60e01b1480610aac5750610aac8261243b565b92915050565b33610abb6112ee565b6001600160a01b031614610ae15760405162461bcd60e51b81526004016108ca90613f4a565b6065546040516307e0db1760e01b815261ffff831660048201526001600160a01b03909116906307e0db17906024015b600060405180830381600087803b158015610b2b57600080fd5b505af1158015610b3f573d6000803e3d6000fd5b5050505050565b33610b4f6112ee565b6001600160a01b031614610b755760405162461bcd60e51b81526004016108ca90613f4a565b61ffff909116600090815260686020526040902055565b33610b956112ee565b6001600160a01b031614610bbb5760405162461bcd60e51b81526004016108ca90613f4a565b6065546040516310ddb13760e01b815261ffff831660048201526001600160a01b03909116906310ddb13790602401610b11565b600080600080898989604051602001610c0b9493929190613fa8565b60408051601f198184030181529082905260655463040a7bb160e41b83529092506001600160a01b0316906340a7bb1090610c54908d90309086908c908c908c90600401613fd7565b604080518083038186803b158015610c6b57600080fd5b505afa158015610c7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ca3919061402d565b925092505097509795505050505050565b61ffff831660009081526066602052604081208054829190610cd590613eff565b80601f0160208091040260200160405190810160405280929190818152602001828054610d0190613eff565b8015610d4e5780601f10610d2357610100808354040283529160200191610d4e565b820191906000526020600020905b815481529060010190602001808311610d3157829003601f168201915b505050505090508383604051610d65929190613f3a565b60405180910390208180519060200120149150509392505050565b33610d896112ee565b6001600160a01b031614610daf5760405162461bcd60e51b81526004016108ca90613f4a565b6065546040516342d65a8d60e01b81526001600160a01b03909116906342d65a8d90610de390869086908690600401614051565b600060405180830381600087803b158015610dfd57600080fd5b505af1158015610a7e573d6000803e3d6000fd5b6000610e1d6001612470565b90508015610e35576000805461ff0019166101001790555b6001600160a01b038216610e5c5760405163fb7566d760e01b815260040160405180910390fd5b6001600160a01b038316610e835760405163fb7566d760e01b815260040160405180910390fd5b610e8c836124fd565b61015f80546001600160a01b0319166001600160a01b0384161790558015610eef576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15b505050565b610f6e898989898080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8a018190048102820181019092528881528c93508b92508a918a908a908190840183828082843760009201919091525061253092505050565b505050505050505050565b61113f848484604051602001610f8f919061406f565b60405160208183030381529060405284886000600161015f60009054906101000a90046001600160a01b03166001600160a01b031663afcff50f6040518163ffffffff1660e01b815260040160206040518083038186803b158015610ff357600080fd5b505afa158015611007573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061102b919061408c565b6001600160a01b03166332c615b46040518163ffffffff1660e01b815260040160206040518083038186803b15801561106357600080fd5b505afa158015611077573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061109b919061408c565b6001600160a01b0316636c77d24f6040518163ffffffff1660e01b815260040160206040518083038186803b1580156110d357600080fd5b505afa1580156110e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061110b91906140a9565b60405160f09290921b6001600160f01b03191660208301526022820152604201604051602081830303815290604052612530565b50505050565b3330146111a35760405162461bcd60e51b815260206004820152602660248201527f4e6f6e626c6f636b696e674c7a4170703a2063616c6c6572206d7573742062656044820152650204c7a4170760d41b60648201526084016108ca565b6112198686868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8901819004810282018101909252878152899350915087908790819084018382808284376000920191909152506125d792505050565b505050505050565b60405162461bcd60e51b8152602060048201526008602482015267191a5cd8589b195960c21b60448201526064016108ca565b6066602052600090815260409020805461126d90613eff565b80601f016020809104026020016040519081016040528092919081815260200182805461129990613eff565b80156112e65780601f106112bb576101008083540402835291602001916112e6565b820191906000526020600020905b8154815290600101906020018083116112c957829003601f168201915b505050505081565b61015f546040805163afcff50f60e01b815290516000926001600160a01b03169163afcff50f916004808301926020929190829003018186803b15801561133457600080fd5b505afa158015611348573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061136c919061408c565b6001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b1580156113a457600080fd5b505afa1580156113b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113dc919061408c565b905090565b61015f54604080516318160ddd60e01b815290516000926001600160a01b0316916318160ddd916004808301926020929190829003018186803b15801561142757600080fd5b505afa15801561143b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113dc91906140a9565b61ffff811660009081526066602052604081208054606092919061148290613eff565b80601f01602080910402602001604051908101604052809291908181526020018280546114ae90613eff565b80156114fb5780601f106114d0576101008083540402835291602001916114fb565b820191906000526020600020905b8154815290600101906020018083116114de57829003601f168201915b505050505090508051600014156115545760405162461bcd60e51b815260206004820152601d60248201527f4c7a4170703a206e6f20747275737465642070617468207265636f726400000060448201526064016108ca565b61156f60006014835161156791906140d8565b839190612666565b9392505050565b3361157f6112ee565b6001600160a01b0316146115a55760405162461bcd60e51b81526004016108ca90613f4a565b8181306040516020016115ba939291906140ef565b60408051601f1981840301815291815261ffff851660009081526066602090815291902082516115ef9391929091019061345b565b507f8c0400cfe2d1199b1a725c78960bcc2a344d869b80590d0f2bd005db15a572ce838383604051610ee693929190614051565b3361162c6112ee565b6001600160a01b0316146116525760405162461bcd60e51b81526004016108ca90613f4a565b606980546001600160a01b0319166001600160a01b0383169081179091556040519081527f5db758e995a17ec1ad84bdef7e8c3293a0bd6179bcce400dff5d4c3d87db726b906020015b60405180910390a150565b6000306001600160a01b0316632a205e3d85856040516020016116ca919061406f565b604051602081830303815290604052856000600161015f60009054906101000a90046001600160a01b03166001600160a01b031663afcff50f6040518163ffffffff1660e01b815260040160206040518083038186803b15801561172d57600080fd5b505afa158015611741573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611765919061408c565b6001600160a01b03166332c615b46040518163ffffffff1660e01b815260040160206040518083038186803b15801561179d57600080fd5b505afa1580156117b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117d5919061408c565b6001600160a01b0316636c77d24f6040518163ffffffff1660e01b815260040160206040518083038186803b15801561180d57600080fd5b505afa158015611821573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061184591906140a9565b60405160f09290921b6001600160f01b031916602083015260228201526042016040516020818303038152906040526040518663ffffffff1660e01b8152600401611894959493929190614115565b604080518083038186803b1580156118ab57600080fd5b505afa1580156118bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118e3919061402d565b50949350505050565b6000806000600133604051602001611904919061406f565b60408051601f198184030181529082905261192e92918f908f908f908f908f908f9060200161415e565b6040516020818303038152906040529050606560009054906101000a90046001600160a01b03166001600160a01b03166340a7bb108e30848a8a8a6040518763ffffffff1660e01b815260040161198a96959493929190613fd7565b604080518083038186803b1580156119a157600080fd5b505afa1580156119b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119d9919061402d565b92509250509a509a98505050505050505050565b336119f66112ee565b6001600160a01b031614611a1c5760405162461bcd60e51b81526004016108ca90613f4a565b6065546040516332fb62e760e21b81526001600160a01b039091169063cbed8b9c90611a5490889088908890889088906004016141c8565b600060405180830381600087803b158015611a6e57600080fd5b505af1158015610f6e573d6000803e3d6000fd5b61ffff8a16600090815261012d60205260408082209051611aa6908c908c90613f3a565b90815260408051602092819003830190206001600160401b038b1660009081529252902054905080611b305760405162461bcd60e51b815260206004820152602d60248201527f436f6d706f7361626c654f4654436f72653a206e6f206661696c6564206d657360448201526c7361676520746f20726574727960981b60648201526084016108ca565b6000878787878787604051602001611b4d96959493929190614201565b604051602081830303815290604052805190602001209050818114611bcc5760405162461bcd60e51b815260206004820152602f60248201527f436f6d706f7361626c654f4654436f72653a206661696c6564206d657373616760448201526e0ca40d0c2e6d040dad2e6dac2e8c6d608b1b60648201526084016108ca565b61ffff8c16600090815261012d6020526040908190209051611bf1908d908d90613f3a565b9081526040805191829003602090810183206001600160401b038d16600090815291529081205563147a7d7160e01b81526001600160a01b0387169063147a7d7190611c51908f908f908f908f908f908f908e908e908e9060040161423e565b600060405180830381600087803b158015611c6b57600080fd5b505af1158015611c7f573d6000803e3d6000fd5b505050507f41ea88d75e53240e2c5ace3a3d7263efe6c8f4fe42c0e3ef269f71daef1001c881604051611cb491815260200190565b60405180910390a1505050505050505050505050565b61ffff86166000908152609760205260408082209051611ced9088908890613f3a565b90815260408051602092819003830190206001600160401b03871660009081529252902054905080611d6d5760405162461bcd60e51b815260206004820152602360248201527f4e6f6e626c6f636b696e674c7a4170703a206e6f2073746f726564206d65737360448201526261676560e81b60648201526084016108ca565b808383604051611d7e929190613f3a565b604051809103902014611ddd5760405162461bcd60e51b815260206004820152602160248201527f4e6f6e626c6f636b696e674c7a4170703a20696e76616c6964207061796c6f616044820152601960fa1b60648201526084016108ca565b61ffff87166000908152609760205260408082209051611e009089908990613f3a565b90815260408051602092819003830181206001600160401b038916600090815290845282902093909355601f88018290048202830182019052868252611e98918991899089908190840183828082843760009201919091525050604080516020601f8a018190048102820181019092528881528a9350915088908890819084018382808284376000920191909152506125d792505050565b7fc264d91f3adc5588250e1551f547752ca0cfa8f6b530d243b9f9f4cab10ea8e58787878785604051611ecf9594939291906142a9565b60405180910390a150505050505050565b33611ee96112ee565b6001600160a01b031614611f0f5760405162461bcd60e51b81526004016108ca90613f4a565b60008111611f575760405162461bcd60e51b81526020600482015260156024820152744c7a4170703a20696e76616c6964206d696e47617360581b60448201526064016108ca565b61ffff83811660008181526067602090815260408083209487168084529482529182902085905581519283528201929092529081018290527f9d5c7c0b934da8fefa9c7760c98383778a12dfbfc0c3b3106518f43fb9508ac090606001610ee6565b61015f60009054906101000a90046001600160a01b03166001600160a01b031663afcff50f6040518163ffffffff1660e01b815260040160206040518083038186803b15801561200857600080fd5b505afa15801561201c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612040919061408c565b6001600160a01b03166332c615b46040518163ffffffff1660e01b815260040160206040518083038186803b15801561207857600080fd5b505afa15801561208c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120b0919061408c565b6001600160a01b0316336001600160a01b0316146120e157604051632b78ce1b60e11b815260040160405180910390fd5b6121628c8c8c8c8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8a018190048102820181019092528881528f93508e92508d918d918d918d91908d908d908190840183828082843760009201919091525061277392505050565b505050505050505050505050565b336121796112ee565b6001600160a01b03161461219f5760405162461bcd60e51b81526004016108ca90613f4a565b60fb805460ff19168215159081179091556040519081527f1584ad594a70cbe1e6515592e1272a987d922b097ead875069cebe8b40c004a49060200161169c565b336121e96112ee565b6001600160a01b03161461220f5760405162461bcd60e51b81526004016108ca90613f4a565b61ffff8316600090815260666020526040902061222d9083836134df565b507ffa41487ad5d6728f0b19276fa1eddc16558578f5109fc39d2dc33c3230470dab838383604051610ee693929190614051565b606554604051633d7b2f6f60e21b815261ffff808716600483015285166024820152306044820152606481018390526060916001600160a01b03169063f5ecbdbc9060840160006040518083038186803b1580156122be57600080fd5b505afa1580156122d2573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526122fa9190810190614331565b95945050505050565b61ffff811660009081526066602052604081208054610aac91839161232790613eff565b80601f016020809104026020016040519081016040528092919081815260200182805461235390613eff565b80156123a05780601f10612375576101008083540402835291602001916123a0565b820191906000526020600020905b81548152906001019060200180831161238357829003601f168201915b505050505061284b90919063ffffffff16565b6001600160a01b03163b151590565b6000806124255a60966366ad5c8a60e01b898989896040516024016123ea9493929190614365565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152309291906128b0565b915091508161121957611219868686868561293a565b60006001600160e01b03198216630a72677560e11b1480610aac57506301ffc9a760e01b6001600160e01b0319831614610aac565b60008054610100900460ff16156124b7578160ff1660011480156124935750303b155b6124af5760405162461bcd60e51b81526004016108ca906143a3565b506000919050565b60005460ff8084169116106124de5760405162461bcd60e51b81526004016108ca906143a3565b506000805460ff191660ff92909216919091179055600190565b919050565b600054610100900460ff166125245760405162461bcd60e51b81526004016108ca906143f1565b61252d816129d7565b50565b61253e866000836000612a0f565b600061254c88888888612a89565b905060008087836040516020016125659392919061443c565b6040516020818303038152906040529050612584888287878734612c9d565b886001600160a01b03168861ffff167f39a4c66499bcf4b56d79f0dde8ed7a9d4925a0df55825206b2b8531e202be0d089856040516125c4929190614469565b60405180910390a3505050505050505050565b602081015161ffff81166125f6576125f185858585612e19565b610b3f565b61ffff81166001141561260f576125f185858585612ea3565b60405162461bcd60e51b815260206004820152602660248201527f436f6d706f7361626c654f4654436f72653a20756e6b6e6f776e207061636b6560448201526574207479706560d01b60648201526084016108ca565b60608161267481601f61448b565b10156126b35760405162461bcd60e51b815260206004820152600e60248201526d736c6963655f6f766572666c6f7760901b60448201526064016108ca565b6126bd828461448b565b845110156127015760405162461bcd60e51b8152602060048201526011602482015270736c6963655f6f75744f66426f756e647360781b60448201526064016108ca565b60608215801561272057604051915060008252602082016040526118e3565b6040519150601f8416801560200281840101858101878315602002848b0101015b81831015612759578051835260209283019201612741565b5050858452601f01601f1916604052505090509392505050565b61278989600183876001600160401b0316612a0f565b60006127978b8b8b8b612a89565b905060006001336040516020016127ae919061406f565b60408051601f19818403018152908290526127d692918d9086908d908d908d906020016144a3565b60405160208183030381529060405290506127f58b8287878734612c9d565b8b6001600160a01b03168b61ffff167f39a4c66499bcf4b56d79f0dde8ed7a9d4925a0df55825206b2b8531e202be0d08c85604051612835929190614469565b60405180910390a3505050505050505050505050565b600061285882601461448b565b835110156128a05760405162461bcd60e51b8152602060048201526015602482015274746f416464726573735f6f75744f66426f756e647360581b60448201526064016108ca565b500160200151600160601b900490565b6000606060008060008661ffff166001600160401b038111156128d5576128d5613974565b6040519080825280601f01601f1916602001820160405280156128ff576020820181803683370190505b50905060008087516020890160008d8df191503d925086831115612921578692505b828152826000602083013e909890975095505050505050565b8180519060200120609760008761ffff1661ffff1681526020019081526020016000208560405161296b919061450b565b9081526040805191829003602090810183206001600160401b0388166000908152915220919091557fe183f33de2837795525b4792ca4cd60535bd77c53b7e7030060bfcf5734d6b0c906129c89087908790879087908790614527565b60405180910390a15050505050565b600054610100900460ff166129fe5760405162461bcd60e51b81526004016108ca906143f1565b612a06612fb2565b61252d81612fe4565b60fb5460ff1615612a2b57612a268484848461302d565b61113f565b81511561113f5760405162461bcd60e51b815260206004820152602660248201527f4f4654436f72653a205f61646170746572506172616d73206d7573742062652060448201526532b6b83a3c9760d11b60648201526084016108ca565b61015f546040805163afcff50f60e01b815290516000926001600160a01b03169163afcff50f916004808301926020929190829003018186803b158015612acf57600080fd5b505afa158015612ae3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b07919061408c565b6001600160a01b03166332c615b46040518163ffffffff1660e01b815260040160206040518083038186803b158015612b3f57600080fd5b505afa158015612b53573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b77919061408c565b6001600160a01b0316632b80cc526040518163ffffffff1660e01b815260040160206040518083038186803b158015612baf57600080fd5b505afa158015612bc3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612be79190614579565b612c0457604051635621fccf60e01b815260040160405180910390fd5b336001600160a01b03861614612c2d576040516311fbe4a960e01b815260040160405180910390fd5b61015f54604051632770a7eb60e21b81526001600160a01b0387811660048301526024820185905290911690639dc29fac90604401600060405180830381600087803b158015612c7c57600080fd5b505af1158015612c90573d6000803e3d6000fd5b5093979650505050505050565b61ffff861660009081526066602052604081208054612cbb90613eff565b80601f0160208091040260200160405190810160405280929190818152602001828054612ce790613eff565b8015612d345780601f10612d0957610100808354040283529160200191612d34565b820191906000526020600020905b815481529060010190602001808311612d1757829003601f168201915b50505050509050805160001415612da65760405162461bcd60e51b815260206004820152603060248201527f4c7a4170703a2064657374696e6174696f6e20636861696e206973206e6f742060448201526f61207472757374656420736f7572636560801b60648201526084016108ca565b612db187875161310c565b60655460405162c5803160e81b81526001600160a01b039091169063c5803100908490612dec908b9086908c908c908c908c90600401614596565b6000604051808303818588803b158015612e0557600080fd5b505af1158015612162573d6000803e3d6000fd5b60008082806020019051810190612e3091906145f0565b909350915060009050612e43838261284b565b9050612e5087828461317a565b9150806001600160a01b03168761ffff167fbf551ec93859b170f9b2141bd9298bf3f64322c6f7beb2543a0cb669834118bf84604051612e9291815260200190565b60405180910390a350505050505050565b600080600080600085806020019051810190612ebf9190614649565b95509550955095509550506000612ee060008661284b90919063ffffffff16565b9050612eed8a828661317a565b9350806001600160a01b03168a61ffff167fbf551ec93859b170f9b2141bd9298bf3f64322c6f7beb2543a0cb669834118bf86604051612f2f91815260200190565b60405180910390a36001600160a01b0381163b612f8d576040516001600160a01b03821681527f9aedf5fdba8716db3b6705ca00150643309995d4f818a249ed6dde6677e7792d9060200160405180910390a150505050505061113f565b612fa68a8a8a89858989896001600160401b03166131ea565b50505050505050505050565b600054610100900460ff16612fd95760405162461bcd60e51b81526004016108ca906143f1565b612fe2336133ad565b565b600054610100900460ff1661300b5760405162461bcd60e51b81526004016108ca906143f1565b606580546001600160a01b0319166001600160a01b0392909216919091179055565b6000613038836133ff565b61ffff80871660009081526067602090815260408083209389168352929052908120549192509061306a90849061448b565b9050600081116130bc5760405162461bcd60e51b815260206004820152601a60248201527f4c7a4170703a206d696e4761734c696d6974206e6f742073657400000000000060448201526064016108ca565b808210156112195760405162461bcd60e51b815260206004820152601b60248201527f4c7a4170703a20676173206c696d697420697320746f6f206c6f77000000000060448201526064016108ca565b61ffff82166000908152606860205260409020548061312a57506127105b80821115610eef5760405162461bcd60e51b815260206004820181905260248201527f4c7a4170703a207061796c6f61642073697a6520697320746f6f206c6172676560448201526064016108ca565b61015f546040516340c10f1960e01b81526001600160a01b0384811660048301526024820184905260009216906340c10f1990604401600060405180830381600087803b1580156131ca57600080fd5b505af11580156131de573d6000803e3d6000fd5b50939695505050505050565b60008061325a83609663147a7d7160e01b8d8d8d8d8c8c60405160240161321696959493929190614701565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526001600160a01b038a169291906128b0565b915091508161332f578686868660405160200161327a9493929190614759565b60408051601f19818403018152828252805160209182012061ffff8e16600090815261012d90925291902090916132b2908c9061450b565b9081526040805191829003602090810183206001600160401b038d166000908152915220919091556001600160a01b0387169061ffff8c16907f95c1ad3ef50dd05e668d7b80e9a723079395ac4867a4050552d5d9219e683d7490613322908d908d908d908c908c908a90614794565b60405180910390a3612fa6565b6000878787876040516020016133489493929190614759565b6040516020818303038152906040528051906020012090508a61ffff167fb8890edbfc1c74692f527444645f95489c3703cc2df42e4a366f5d06fa6cd8848b8b84604051613398939291906147f6565b60405180910390a25050505050505050505050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60006022825110156134535760405162461bcd60e51b815260206004820152601c60248201527f4c7a4170703a20696e76616c69642061646170746572506172616d730000000060448201526064016108ca565b506022015190565b82805461346790613eff565b90600052602060002090601f01602090048101928261348957600085556134cf565b82601f106134a257805160ff19168380011785556134cf565b828001600101855582156134cf579182015b828111156134cf5782518255916020019190600101906134b4565b506134db929150613553565b5090565b8280546134eb90613eff565b90600052602060002090601f01602090048101928261350d57600085556134cf565b82601f106135265782800160ff198235161785556134cf565b828001600101855582156134cf579182015b828111156134cf578235825591602001919060010190613538565b5b808211156134db5760008155600101613554565b61ffff8116811461252d57600080fd5b80356124f881613568565b60008083601f84011261359557600080fd5b5081356001600160401b038111156135ac57600080fd5b6020830191508360208285010111156135c457600080fd5b9250929050565b6001600160401b038116811461252d57600080fd5b80356124f8816135cb565b6000806000806000806080878903121561360457600080fd5b863561360f81613568565b955060208701356001600160401b038082111561362b57600080fd5b6136378a838b01613583565b90975095506040890135915061364c826135cb565b9093506060880135908082111561366257600080fd5b5061366f89828a01613583565b979a9699509497509295939492505050565b60006020828403121561369357600080fd5b81356001600160e01b03198116811461156f57600080fd5b6000602082840312156136bd57600080fd5b813561156f81613568565b600080604083850312156136db57600080fd5b82356136e681613568565b946020939093013593505050565b801515811461252d57600080fd5b80356124f8816136f4565b600080600080600080600060a0888a03121561372857600080fd5b873561373381613568565b965060208801356001600160401b038082111561374f57600080fd5b61375b8b838c01613583565b909850965060408a0135955060608a01359150613777826136f4565b9093506080890135908082111561378d57600080fd5b5061379a8a828b01613583565b989b979a50959850939692959293505050565b6000806000604084860312156137c257600080fd5b83356137cd81613568565b925060208401356001600160401b038111156137e857600080fd5b6137f486828701613583565b9497909650939450505050565b6001600160a01b038116811461252d57600080fd5b80356124f881613801565b6000806040838503121561383457600080fd5b823561383f81613801565b9150602083013561384f81613801565b809150509250929050565b600080600080600080600080600060e08a8c03121561387857600080fd5b893561388381613801565b985060208a013561389381613568565b975060408a01356001600160401b03808211156138af57600080fd5b6138bb8d838e01613583565b909950975060608c0135965060808c013591506138d782613801565b90945060a08b0135906138e982613801565b90935060c08b013590808211156138ff57600080fd5b5061390c8c828d01613583565b915080935050809150509295985092959850929598565b6000806000806080858703121561393957600080fd5b843561394481613801565b9350602085013561395481613568565b9250604085013561396481613801565b9396929550929360600135925050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156139b2576139b2613974565b604052919050565b60006001600160401b038211156139d3576139d3613974565b50601f01601f191660200190565b6000806000606084860312156139f657600080fd5b8335613a0181613568565b925060208401356001600160401b03811115613a1c57600080fd5b8401601f81018613613a2d57600080fd5b8035613a40613a3b826139ba565b61398a565b818152876020838501011115613a5557600080fd5b816020840160208301376000602083830101528094505050506040840135613a7c816135cb565b809150509250925092565b60005b83811015613aa2578181015183820152602001613a8a565b8381111561113f5750506000910152565b60008151808452613acb816020860160208601613a87565b601f01601f19169290920160200192915050565b60208152600061156f6020830184613ab3565b60008060408385031215613b0557600080fd5b8235613b1081613568565b9150602083013561384f81613568565b600060208284031215613b3257600080fd5b813561156f81613801565b600080600060608486031215613b5257600080fd5b8335613b5d81613568565b92506020840135613b6d81613801565b929592945050506040919091013590565b60008060008060008060008060008060e08b8d031215613b9d57600080fd5b8a35613ba881613568565b995060208b01356001600160401b0380821115613bc457600080fd5b613bd08e838f01613583565b909b50995060408d0135985060608d0135915080821115613bf057600080fd5b613bfc8e838f01613583565b909850965060808d01359150613c11826135cb565b819550613c2060a08e01613702565b945060c08d0135915080821115613c3657600080fd5b50613c438d828e01613583565b915080935050809150509295989b9194979a5092959850565b600080600080600060808688031215613c7457600080fd5b8535613c7f81613568565b94506020860135613c8f81613568565b93506040860135925060608601356001600160401b03811115613cb157600080fd5b613cbd88828901613583565b969995985093965092949392505050565b60008060008060008060008060008060e08b8d031215613ced57600080fd5b8a35613cf881613568565b995060208b01356001600160401b0380821115613d1457600080fd5b613d208e838f01613583565b909b50995060408d01359150613d35826135cb565b90975060608c01359080821115613d4b57600080fd5b613d578e838f01613583565b9098509650869150613d6b60808e01613816565b955060a08d0135945060c08d0135915080821115613c3657600080fd5b600080600060608486031215613d9d57600080fd5b8335613da881613568565b92506020840135613b6d81613568565b6000806000806000806000806000806000806101208d8f031215613ddb57600080fd5b613de48d613816565b9b50613df260208e01613578565b9a506001600160401b0360408e01351115613e0c57600080fd5b613e1c8e60408f01358f01613583565b909a50985060608d013597506001600160401b0360808e01351115613e4057600080fd5b613e508e60808f01358f01613583565b9097509550613e6160a08e016135e0565b9450613e6f60c08e01613816565b9350613e7d60e08e01613816565b92506001600160401b036101008e01351115613e9857600080fd5b613ea98e6101008f01358f01613583565b81935080925050509295989b509295989b509295989b565b600060208284031215613ed357600080fd5b813561156f816136f4565b60008060008060808587031215613ef457600080fd5b843561394481613568565b600181811c90821680613f1357607f821691505b60208210811415613f3457634e487b7160e01b600052602260045260246000fd5b50919050565b8183823760009101908152919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b61ffff85168152606060208201526000613fc6606083018587613f7f565b905082604083015295945050505050565b61ffff871681526001600160a01b038616602082015260a06040820181905260009061400590830187613ab3565b85151560608401528281036080840152614020818587613f7f565b9998505050505050505050565b6000806040838503121561404057600080fd5b505080516020909101519092909150565b61ffff841681526040602082015260006122fa604083018486613f7f565b60609190911b6bffffffffffffffffffffffff1916815260140190565b60006020828403121561409e57600080fd5b815161156f81613801565b6000602082840312156140bb57600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b6000828210156140ea576140ea6140c2565b500390565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b61ffff8616815260a06020820152600061413260a0830187613ab3565b856040840152841515606084015282810360808401526141528185613ab3565b98975050505050505050565b61ffff8916815260c06020820152600061417b60c083018a613ab3565b828103604084015261418e81898b613f7f565b905086606084015282810360808401526141a9818688613f7f565b9150506001600160401b03831660a08301529998505050505050505050565b600061ffff8088168352808716602084015250846040830152608060608301526141f6608083018486613f7f565b979650505050505050565b60808152600061421560808301888a613f7f565b6001600160a01b0387166020840152604083018690528281036060840152614020818587613f7f565b61ffff8a16815260c06020820152600061425c60c083018a8c613f7f565b6001600160401b0389166040840152828103606084015261427e81888a613f7f565b905085608084015282810360a0840152614299818587613f7f565b9c9b505050505050505050505050565b61ffff861681526080602082015260006142c7608083018688613f7f565b6001600160401b0394909416604083015250606001529392505050565b600082601f8301126142f557600080fd5b8151614303613a3b826139ba565b81815284602083860101111561431857600080fd5b614329826020830160208701613a87565b949350505050565b60006020828403121561434357600080fd5b81516001600160401b0381111561435957600080fd5b614329848285016142e4565b61ffff851681526080602082015260006143826080830186613ab3565b6001600160401b038516604084015282810360608401526141f68185613ab3565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b61ffff841681526060602082015260006144596060830185613ab3565b9050826040830152949350505050565b60408152600061447c6040830185613ab3565b90508260208301529392505050565b6000821982111561449e5761449e6140c2565b500190565b61ffff8816815260c0602082015260006144c060c0830189613ab3565b82810360408401526144d28189613ab3565b905086606084015282810360808401526144ed818688613f7f565b9150506001600160401b03831660a083015298975050505050505050565b6000825161451d818460208701613a87565b9190910192915050565b61ffff8616815260a06020820152600061454460a0830187613ab3565b6001600160401b038616604084015282810360608401526145658186613ab3565b905082810360808401526141528185613ab3565b60006020828403121561458b57600080fd5b815161156f816136f4565b61ffff8716815260c0602082015260006145b360c0830188613ab3565b82810360408401526145c58188613ab3565b6001600160a01b0387811660608601528616608085015283810360a085015290506140208185613ab3565b60008060006060848603121561460557600080fd5b835161461081613568565b60208501519093506001600160401b0381111561462c57600080fd5b614638868287016142e4565b925050604084015190509250925092565b60008060008060008060c0878903121561466257600080fd5b865161466d81613568565b60208801519096506001600160401b038082111561468a57600080fd5b6146968a838b016142e4565b965060408901519150808211156146ac57600080fd5b6146b88a838b016142e4565b95506060890151945060808901519150808211156146d557600080fd5b506146e289828a016142e4565b92505060a08701516146f3816135cb565b809150509295509295509295565b61ffff8716815260c06020820152600061471e60c0830188613ab3565b6001600160401b0387166040840152828103606084015261473f8187613ab3565b905084608084015282810360a08401526140208185613ab3565b60808152600061476c6080830187613ab3565b6001600160a01b03861660208401526040830185905282810360608401526141f68185613ab3565b60c0815260006147a760c0830189613ab3565b6001600160401b038816602084015282810360408401526147c88188613ab3565b905085606084015282810360808401526147e28186613ab3565b905082810360a08401526140208185613ab3565b6060815260006148096060830186613ab3565b6001600160401b03949094166020830152506040015291905056fea26469706673582212204bc8eef6be2e74d81a78b6c777f42dda132af8e265a0460a71121fdd2f9895ad64736f6c63430008090033496e697469616c697a61626c653a20636f6e747261637420697320616c726561", - "deployedBytecode": "0x6080604052600436106102665760003560e01c8063950c8a7411610144578063df2a5b3b116100b6578063ed629c5c1161007a578063ed629c5c146107a1578063f2fde38b146107bb578063f5ecbdbc146107db578063fc0c546a146107fb578063ff0454e21461081a578063ffa1ad741461083a57600080fd5b8063df2a5b3b14610719578063e6a20ae614610739578063e7f0c59f1461074e578063eab45d9c14610761578063eb8d72b71461078157600080fd5b8063c223533a11610108578063c223533a14610670578063c446183414610690578063c8598dca146106a6578063cbed8b9c146106c6578063cfd6528e146106e6578063d1deba1f1461070657600080fd5b8063950c8a74146105d05780639f38369a146105f0578063a6c3d16514610610578063b353aaa714610630578063baf3292d1461065057600080fd5b80634c42899a116101dd57806366ad5c8a116101a157806366ad5c8a146104f4578063715018a6146105145780637533d788146105295780638cfd8f5c146105565780638da5cb5b1461058e5780639358928b146105bb57600080fd5b80634c42899a14610407578063519056361461042f5780635823f91b146104425780635b8c41e6146104555780636096cc58146104a457600080fd5b80632a205e3d1161022f5780632a205e3d146103225780633d8b38f6146103575780633f1f4fa41461037757806342d65a8d146103b257806344770515146103d2578063485cc955146103e757600080fd5b80621d35671461026b57806301ffc9a71461028d57806307e0db17146102c25780630df37483146102e257806310ddb13714610302575b600080fd5b34801561027757600080fd5b5061028b6102863660046135eb565b61086b565b005b34801561029957600080fd5b506102ad6102a8366004613681565b610a87565b60405190151581526020015b60405180910390f35b3480156102ce57600080fd5b5061028b6102dd3660046136ab565b610ab2565b3480156102ee57600080fd5b5061028b6102fd3660046136c8565b610b46565b34801561030e57600080fd5b5061028b61031d3660046136ab565b610b8c565b34801561032e57600080fd5b5061034261033d36600461370d565b610bef565b604080519283526020830191909152016102b9565b34801561036357600080fd5b506102ad6103723660046137ad565b610cb4565b34801561038357600080fd5b506103a46103923660046136ab565b60686020526000908152604090205481565b6040519081526020016102b9565b3480156103be57600080fd5b5061028b6103cd3660046137ad565b610d80565b3480156103de57600080fd5b506103a4600081565b3480156103f357600080fd5b5061028b610402366004613821565b610e11565b34801561041357600080fd5b5061041c600081565b60405161ffff90911681526020016102b9565b61028b61043d36600461385a565b610ef4565b61028b610450366004613923565b610f79565b34801561046157600080fd5b506103a46104703660046139e1565b6097602090815260009384526040808520845180860184018051928152908401958401959095209452929052825290205481565b3480156104b057600080fd5b506103a46104bf3660046139e1565b61012d602090815260009384526040808520845180860184018051928152908401958401959095209452929052825290205481565b34801561050057600080fd5b5061028b61050f3660046135eb565b611145565b34801561052057600080fd5b5061028b611221565b34801561053557600080fd5b506105496105443660046136ab565b611254565b6040516102b99190613adf565b34801561056257600080fd5b506103a4610571366004613af2565b606760209081526000928352604080842090915290825290205481565b34801561059a57600080fd5b506105a36112ee565b6040516001600160a01b0390911681526020016102b9565b3480156105c757600080fd5b506103a46113e1565b3480156105dc57600080fd5b506069546105a3906001600160a01b031681565b3480156105fc57600080fd5b5061054961060b3660046136ab565b61145f565b34801561061c57600080fd5b5061028b61062b3660046137ad565b611576565b34801561063c57600080fd5b506065546105a3906001600160a01b031681565b34801561065c57600080fd5b5061028b61066b366004613b20565b611623565b34801561067c57600080fd5b506103a461068b366004613b3d565b6116a7565b34801561069c57600080fd5b506103a461271081565b3480156106b257600080fd5b506103426106c1366004613b7e565b6118ec565b3480156106d257600080fd5b5061028b6106e1366004613c5c565b6119ed565b3480156106f257600080fd5b5061028b610701366004613cce565b611a82565b61028b6107143660046135eb565b611cca565b34801561072557600080fd5b5061028b610734366004613d88565b611ee0565b34801561074557600080fd5b5061041c600181565b61028b61075c366004613db8565b611fb9565b34801561076d57600080fd5b5061028b61077c366004613ec1565b612170565b34801561078d57600080fd5b5061028b61079c3660046137ad565b6121e0565b3480156107ad57600080fd5b5060fb546102ad9060ff1681565b3480156107c757600080fd5b5061028b6107d6366004613b20565b611221565b3480156107e757600080fd5b506105496107f6366004613ede565b612261565b34801561080757600080fd5b5061015f546001600160a01b03166105a3565b34801561082657600080fd5b506105a36108353660046136ab565b612303565b34801561084657600080fd5b50610549604051806040016040528060058152602001640312e332e360dc1b81525081565b6065546001600160a01b0316336001600160a01b0316146108d35760405162461bcd60e51b815260206004820152601e60248201527f4c7a4170703a20696e76616c696420656e64706f696e742063616c6c6572000060448201526064015b60405180910390fd5b61ffff8616600090815260666020526040812080546108f190613eff565b80601f016020809104026020016040519081016040528092919081815260200182805461091d90613eff565b801561096a5780601f1061093f5761010080835404028352916020019161096a565b820191906000526020600020905b81548152906001019060200180831161094d57829003601f168201915b50505050509050805186869050148015610985575060008151115b80156109ad5750805160208201206040516109a39088908890613f3a565b6040518091039020145b610a085760405162461bcd60e51b815260206004820152602660248201527f4c7a4170703a20696e76616c696420736f757263652073656e64696e6720636f6044820152651b9d1c9858dd60d21b60648201526084016108ca565b610a7e8787878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8a018190048102820181019092528881528a9350915088908890819084018382808284376000920191909152506123c292505050565b50505050505050565b60006001600160e01b0319821663e07f1adb60e01b1480610aac5750610aac8261243b565b92915050565b33610abb6112ee565b6001600160a01b031614610ae15760405162461bcd60e51b81526004016108ca90613f4a565b6065546040516307e0db1760e01b815261ffff831660048201526001600160a01b03909116906307e0db17906024015b600060405180830381600087803b158015610b2b57600080fd5b505af1158015610b3f573d6000803e3d6000fd5b5050505050565b33610b4f6112ee565b6001600160a01b031614610b755760405162461bcd60e51b81526004016108ca90613f4a565b61ffff909116600090815260686020526040902055565b33610b956112ee565b6001600160a01b031614610bbb5760405162461bcd60e51b81526004016108ca90613f4a565b6065546040516310ddb13760e01b815261ffff831660048201526001600160a01b03909116906310ddb13790602401610b11565b600080600080898989604051602001610c0b9493929190613fa8565b60408051601f198184030181529082905260655463040a7bb160e41b83529092506001600160a01b0316906340a7bb1090610c54908d90309086908c908c908c90600401613fd7565b604080518083038186803b158015610c6b57600080fd5b505afa158015610c7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ca3919061402d565b925092505097509795505050505050565b61ffff831660009081526066602052604081208054829190610cd590613eff565b80601f0160208091040260200160405190810160405280929190818152602001828054610d0190613eff565b8015610d4e5780601f10610d2357610100808354040283529160200191610d4e565b820191906000526020600020905b815481529060010190602001808311610d3157829003601f168201915b505050505090508383604051610d65929190613f3a565b60405180910390208180519060200120149150509392505050565b33610d896112ee565b6001600160a01b031614610daf5760405162461bcd60e51b81526004016108ca90613f4a565b6065546040516342d65a8d60e01b81526001600160a01b03909116906342d65a8d90610de390869086908690600401614051565b600060405180830381600087803b158015610dfd57600080fd5b505af1158015610a7e573d6000803e3d6000fd5b6000610e1d6001612470565b90508015610e35576000805461ff0019166101001790555b6001600160a01b038216610e5c5760405163fb7566d760e01b815260040160405180910390fd5b6001600160a01b038316610e835760405163fb7566d760e01b815260040160405180910390fd5b610e8c836124fd565b61015f80546001600160a01b0319166001600160a01b0384161790558015610eef576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15b505050565b610f6e898989898080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8a018190048102820181019092528881528c93508b92508a918a908a908190840183828082843760009201919091525061253092505050565b505050505050505050565b61113f848484604051602001610f8f919061406f565b60405160208183030381529060405284886000600161015f60009054906101000a90046001600160a01b03166001600160a01b031663afcff50f6040518163ffffffff1660e01b815260040160206040518083038186803b158015610ff357600080fd5b505afa158015611007573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061102b919061408c565b6001600160a01b03166332c615b46040518163ffffffff1660e01b815260040160206040518083038186803b15801561106357600080fd5b505afa158015611077573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061109b919061408c565b6001600160a01b0316636c77d24f6040518163ffffffff1660e01b815260040160206040518083038186803b1580156110d357600080fd5b505afa1580156110e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061110b91906140a9565b60405160f09290921b6001600160f01b03191660208301526022820152604201604051602081830303815290604052612530565b50505050565b3330146111a35760405162461bcd60e51b815260206004820152602660248201527f4e6f6e626c6f636b696e674c7a4170703a2063616c6c6572206d7573742062656044820152650204c7a4170760d41b60648201526084016108ca565b6112198686868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8901819004810282018101909252878152899350915087908790819084018382808284376000920191909152506125d792505050565b505050505050565b60405162461bcd60e51b8152602060048201526008602482015267191a5cd8589b195960c21b60448201526064016108ca565b6066602052600090815260409020805461126d90613eff565b80601f016020809104026020016040519081016040528092919081815260200182805461129990613eff565b80156112e65780601f106112bb576101008083540402835291602001916112e6565b820191906000526020600020905b8154815290600101906020018083116112c957829003601f168201915b505050505081565b61015f546040805163afcff50f60e01b815290516000926001600160a01b03169163afcff50f916004808301926020929190829003018186803b15801561133457600080fd5b505afa158015611348573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061136c919061408c565b6001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b1580156113a457600080fd5b505afa1580156113b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113dc919061408c565b905090565b61015f54604080516318160ddd60e01b815290516000926001600160a01b0316916318160ddd916004808301926020929190829003018186803b15801561142757600080fd5b505afa15801561143b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113dc91906140a9565b61ffff811660009081526066602052604081208054606092919061148290613eff565b80601f01602080910402602001604051908101604052809291908181526020018280546114ae90613eff565b80156114fb5780601f106114d0576101008083540402835291602001916114fb565b820191906000526020600020905b8154815290600101906020018083116114de57829003601f168201915b505050505090508051600014156115545760405162461bcd60e51b815260206004820152601d60248201527f4c7a4170703a206e6f20747275737465642070617468207265636f726400000060448201526064016108ca565b61156f60006014835161156791906140d8565b839190612666565b9392505050565b3361157f6112ee565b6001600160a01b0316146115a55760405162461bcd60e51b81526004016108ca90613f4a565b8181306040516020016115ba939291906140ef565b60408051601f1981840301815291815261ffff851660009081526066602090815291902082516115ef9391929091019061345b565b507f8c0400cfe2d1199b1a725c78960bcc2a344d869b80590d0f2bd005db15a572ce838383604051610ee693929190614051565b3361162c6112ee565b6001600160a01b0316146116525760405162461bcd60e51b81526004016108ca90613f4a565b606980546001600160a01b0319166001600160a01b0383169081179091556040519081527f5db758e995a17ec1ad84bdef7e8c3293a0bd6179bcce400dff5d4c3d87db726b906020015b60405180910390a150565b6000306001600160a01b0316632a205e3d85856040516020016116ca919061406f565b604051602081830303815290604052856000600161015f60009054906101000a90046001600160a01b03166001600160a01b031663afcff50f6040518163ffffffff1660e01b815260040160206040518083038186803b15801561172d57600080fd5b505afa158015611741573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611765919061408c565b6001600160a01b03166332c615b46040518163ffffffff1660e01b815260040160206040518083038186803b15801561179d57600080fd5b505afa1580156117b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117d5919061408c565b6001600160a01b0316636c77d24f6040518163ffffffff1660e01b815260040160206040518083038186803b15801561180d57600080fd5b505afa158015611821573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061184591906140a9565b60405160f09290921b6001600160f01b031916602083015260228201526042016040516020818303038152906040526040518663ffffffff1660e01b8152600401611894959493929190614115565b604080518083038186803b1580156118ab57600080fd5b505afa1580156118bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118e3919061402d565b50949350505050565b6000806000600133604051602001611904919061406f565b60408051601f198184030181529082905261192e92918f908f908f908f908f908f9060200161415e565b6040516020818303038152906040529050606560009054906101000a90046001600160a01b03166001600160a01b03166340a7bb108e30848a8a8a6040518763ffffffff1660e01b815260040161198a96959493929190613fd7565b604080518083038186803b1580156119a157600080fd5b505afa1580156119b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119d9919061402d565b92509250509a509a98505050505050505050565b336119f66112ee565b6001600160a01b031614611a1c5760405162461bcd60e51b81526004016108ca90613f4a565b6065546040516332fb62e760e21b81526001600160a01b039091169063cbed8b9c90611a5490889088908890889088906004016141c8565b600060405180830381600087803b158015611a6e57600080fd5b505af1158015610f6e573d6000803e3d6000fd5b61ffff8a16600090815261012d60205260408082209051611aa6908c908c90613f3a565b90815260408051602092819003830190206001600160401b038b1660009081529252902054905080611b305760405162461bcd60e51b815260206004820152602d60248201527f436f6d706f7361626c654f4654436f72653a206e6f206661696c6564206d657360448201526c7361676520746f20726574727960981b60648201526084016108ca565b6000878787878787604051602001611b4d96959493929190614201565b604051602081830303815290604052805190602001209050818114611bcc5760405162461bcd60e51b815260206004820152602f60248201527f436f6d706f7361626c654f4654436f72653a206661696c6564206d657373616760448201526e0ca40d0c2e6d040dad2e6dac2e8c6d608b1b60648201526084016108ca565b61ffff8c16600090815261012d6020526040908190209051611bf1908d908d90613f3a565b9081526040805191829003602090810183206001600160401b038d16600090815291529081205563147a7d7160e01b81526001600160a01b0387169063147a7d7190611c51908f908f908f908f908f908f908e908e908e9060040161423e565b600060405180830381600087803b158015611c6b57600080fd5b505af1158015611c7f573d6000803e3d6000fd5b505050507f41ea88d75e53240e2c5ace3a3d7263efe6c8f4fe42c0e3ef269f71daef1001c881604051611cb491815260200190565b60405180910390a1505050505050505050505050565b61ffff86166000908152609760205260408082209051611ced9088908890613f3a565b90815260408051602092819003830190206001600160401b03871660009081529252902054905080611d6d5760405162461bcd60e51b815260206004820152602360248201527f4e6f6e626c6f636b696e674c7a4170703a206e6f2073746f726564206d65737360448201526261676560e81b60648201526084016108ca565b808383604051611d7e929190613f3a565b604051809103902014611ddd5760405162461bcd60e51b815260206004820152602160248201527f4e6f6e626c6f636b696e674c7a4170703a20696e76616c6964207061796c6f616044820152601960fa1b60648201526084016108ca565b61ffff87166000908152609760205260408082209051611e009089908990613f3a565b90815260408051602092819003830181206001600160401b038916600090815290845282902093909355601f88018290048202830182019052868252611e98918991899089908190840183828082843760009201919091525050604080516020601f8a018190048102820181019092528881528a9350915088908890819084018382808284376000920191909152506125d792505050565b7fc264d91f3adc5588250e1551f547752ca0cfa8f6b530d243b9f9f4cab10ea8e58787878785604051611ecf9594939291906142a9565b60405180910390a150505050505050565b33611ee96112ee565b6001600160a01b031614611f0f5760405162461bcd60e51b81526004016108ca90613f4a565b60008111611f575760405162461bcd60e51b81526020600482015260156024820152744c7a4170703a20696e76616c6964206d696e47617360581b60448201526064016108ca565b61ffff83811660008181526067602090815260408083209487168084529482529182902085905581519283528201929092529081018290527f9d5c7c0b934da8fefa9c7760c98383778a12dfbfc0c3b3106518f43fb9508ac090606001610ee6565b61015f60009054906101000a90046001600160a01b03166001600160a01b031663afcff50f6040518163ffffffff1660e01b815260040160206040518083038186803b15801561200857600080fd5b505afa15801561201c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612040919061408c565b6001600160a01b03166332c615b46040518163ffffffff1660e01b815260040160206040518083038186803b15801561207857600080fd5b505afa15801561208c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120b0919061408c565b6001600160a01b0316336001600160a01b0316146120e157604051632b78ce1b60e11b815260040160405180910390fd5b6121628c8c8c8c8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8a018190048102820181019092528881528f93508e92508d918d918d918d91908d908d908190840183828082843760009201919091525061277392505050565b505050505050505050505050565b336121796112ee565b6001600160a01b03161461219f5760405162461bcd60e51b81526004016108ca90613f4a565b60fb805460ff19168215159081179091556040519081527f1584ad594a70cbe1e6515592e1272a987d922b097ead875069cebe8b40c004a49060200161169c565b336121e96112ee565b6001600160a01b03161461220f5760405162461bcd60e51b81526004016108ca90613f4a565b61ffff8316600090815260666020526040902061222d9083836134df565b507ffa41487ad5d6728f0b19276fa1eddc16558578f5109fc39d2dc33c3230470dab838383604051610ee693929190614051565b606554604051633d7b2f6f60e21b815261ffff808716600483015285166024820152306044820152606481018390526060916001600160a01b03169063f5ecbdbc9060840160006040518083038186803b1580156122be57600080fd5b505afa1580156122d2573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526122fa9190810190614331565b95945050505050565b61ffff811660009081526066602052604081208054610aac91839161232790613eff565b80601f016020809104026020016040519081016040528092919081815260200182805461235390613eff565b80156123a05780601f10612375576101008083540402835291602001916123a0565b820191906000526020600020905b81548152906001019060200180831161238357829003601f168201915b505050505061284b90919063ffffffff16565b6001600160a01b03163b151590565b6000806124255a60966366ad5c8a60e01b898989896040516024016123ea9493929190614365565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152309291906128b0565b915091508161121957611219868686868561293a565b60006001600160e01b03198216630a72677560e11b1480610aac57506301ffc9a760e01b6001600160e01b0319831614610aac565b60008054610100900460ff16156124b7578160ff1660011480156124935750303b155b6124af5760405162461bcd60e51b81526004016108ca906143a3565b506000919050565b60005460ff8084169116106124de5760405162461bcd60e51b81526004016108ca906143a3565b506000805460ff191660ff92909216919091179055600190565b919050565b600054610100900460ff166125245760405162461bcd60e51b81526004016108ca906143f1565b61252d816129d7565b50565b61253e866000836000612a0f565b600061254c88888888612a89565b905060008087836040516020016125659392919061443c565b6040516020818303038152906040529050612584888287878734612c9d565b886001600160a01b03168861ffff167f39a4c66499bcf4b56d79f0dde8ed7a9d4925a0df55825206b2b8531e202be0d089856040516125c4929190614469565b60405180910390a3505050505050505050565b602081015161ffff81166125f6576125f185858585612e19565b610b3f565b61ffff81166001141561260f576125f185858585612ea3565b60405162461bcd60e51b815260206004820152602660248201527f436f6d706f7361626c654f4654436f72653a20756e6b6e6f776e207061636b6560448201526574207479706560d01b60648201526084016108ca565b60608161267481601f61448b565b10156126b35760405162461bcd60e51b815260206004820152600e60248201526d736c6963655f6f766572666c6f7760901b60448201526064016108ca565b6126bd828461448b565b845110156127015760405162461bcd60e51b8152602060048201526011602482015270736c6963655f6f75744f66426f756e647360781b60448201526064016108ca565b60608215801561272057604051915060008252602082016040526118e3565b6040519150601f8416801560200281840101858101878315602002848b0101015b81831015612759578051835260209283019201612741565b5050858452601f01601f1916604052505090509392505050565b61278989600183876001600160401b0316612a0f565b60006127978b8b8b8b612a89565b905060006001336040516020016127ae919061406f565b60408051601f19818403018152908290526127d692918d9086908d908d908d906020016144a3565b60405160208183030381529060405290506127f58b8287878734612c9d565b8b6001600160a01b03168b61ffff167f39a4c66499bcf4b56d79f0dde8ed7a9d4925a0df55825206b2b8531e202be0d08c85604051612835929190614469565b60405180910390a3505050505050505050505050565b600061285882601461448b565b835110156128a05760405162461bcd60e51b8152602060048201526015602482015274746f416464726573735f6f75744f66426f756e647360581b60448201526064016108ca565b500160200151600160601b900490565b6000606060008060008661ffff166001600160401b038111156128d5576128d5613974565b6040519080825280601f01601f1916602001820160405280156128ff576020820181803683370190505b50905060008087516020890160008d8df191503d925086831115612921578692505b828152826000602083013e909890975095505050505050565b8180519060200120609760008761ffff1661ffff1681526020019081526020016000208560405161296b919061450b565b9081526040805191829003602090810183206001600160401b0388166000908152915220919091557fe183f33de2837795525b4792ca4cd60535bd77c53b7e7030060bfcf5734d6b0c906129c89087908790879087908790614527565b60405180910390a15050505050565b600054610100900460ff166129fe5760405162461bcd60e51b81526004016108ca906143f1565b612a06612fb2565b61252d81612fe4565b60fb5460ff1615612a2b57612a268484848461302d565b61113f565b81511561113f5760405162461bcd60e51b815260206004820152602660248201527f4f4654436f72653a205f61646170746572506172616d73206d7573742062652060448201526532b6b83a3c9760d11b60648201526084016108ca565b61015f546040805163afcff50f60e01b815290516000926001600160a01b03169163afcff50f916004808301926020929190829003018186803b158015612acf57600080fd5b505afa158015612ae3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b07919061408c565b6001600160a01b03166332c615b46040518163ffffffff1660e01b815260040160206040518083038186803b158015612b3f57600080fd5b505afa158015612b53573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b77919061408c565b6001600160a01b0316632b80cc526040518163ffffffff1660e01b815260040160206040518083038186803b158015612baf57600080fd5b505afa158015612bc3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612be79190614579565b612c0457604051635621fccf60e01b815260040160405180910390fd5b336001600160a01b03861614612c2d576040516311fbe4a960e01b815260040160405180910390fd5b61015f54604051632770a7eb60e21b81526001600160a01b0387811660048301526024820185905290911690639dc29fac90604401600060405180830381600087803b158015612c7c57600080fd5b505af1158015612c90573d6000803e3d6000fd5b5093979650505050505050565b61ffff861660009081526066602052604081208054612cbb90613eff565b80601f0160208091040260200160405190810160405280929190818152602001828054612ce790613eff565b8015612d345780601f10612d0957610100808354040283529160200191612d34565b820191906000526020600020905b815481529060010190602001808311612d1757829003601f168201915b50505050509050805160001415612da65760405162461bcd60e51b815260206004820152603060248201527f4c7a4170703a2064657374696e6174696f6e20636861696e206973206e6f742060448201526f61207472757374656420736f7572636560801b60648201526084016108ca565b612db187875161310c565b60655460405162c5803160e81b81526001600160a01b039091169063c5803100908490612dec908b9086908c908c908c908c90600401614596565b6000604051808303818588803b158015612e0557600080fd5b505af1158015612162573d6000803e3d6000fd5b60008082806020019051810190612e3091906145f0565b909350915060009050612e43838261284b565b9050612e5087828461317a565b9150806001600160a01b03168761ffff167fbf551ec93859b170f9b2141bd9298bf3f64322c6f7beb2543a0cb669834118bf84604051612e9291815260200190565b60405180910390a350505050505050565b600080600080600085806020019051810190612ebf9190614649565b95509550955095509550506000612ee060008661284b90919063ffffffff16565b9050612eed8a828661317a565b9350806001600160a01b03168a61ffff167fbf551ec93859b170f9b2141bd9298bf3f64322c6f7beb2543a0cb669834118bf86604051612f2f91815260200190565b60405180910390a36001600160a01b0381163b612f8d576040516001600160a01b03821681527f9aedf5fdba8716db3b6705ca00150643309995d4f818a249ed6dde6677e7792d9060200160405180910390a150505050505061113f565b612fa68a8a8a89858989896001600160401b03166131ea565b50505050505050505050565b600054610100900460ff16612fd95760405162461bcd60e51b81526004016108ca906143f1565b612fe2336133ad565b565b600054610100900460ff1661300b5760405162461bcd60e51b81526004016108ca906143f1565b606580546001600160a01b0319166001600160a01b0392909216919091179055565b6000613038836133ff565b61ffff80871660009081526067602090815260408083209389168352929052908120549192509061306a90849061448b565b9050600081116130bc5760405162461bcd60e51b815260206004820152601a60248201527f4c7a4170703a206d696e4761734c696d6974206e6f742073657400000000000060448201526064016108ca565b808210156112195760405162461bcd60e51b815260206004820152601b60248201527f4c7a4170703a20676173206c696d697420697320746f6f206c6f77000000000060448201526064016108ca565b61ffff82166000908152606860205260409020548061312a57506127105b80821115610eef5760405162461bcd60e51b815260206004820181905260248201527f4c7a4170703a207061796c6f61642073697a6520697320746f6f206c6172676560448201526064016108ca565b61015f546040516340c10f1960e01b81526001600160a01b0384811660048301526024820184905260009216906340c10f1990604401600060405180830381600087803b1580156131ca57600080fd5b505af11580156131de573d6000803e3d6000fd5b50939695505050505050565b60008061325a83609663147a7d7160e01b8d8d8d8d8c8c60405160240161321696959493929190614701565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526001600160a01b038a169291906128b0565b915091508161332f578686868660405160200161327a9493929190614759565b60408051601f19818403018152828252805160209182012061ffff8e16600090815261012d90925291902090916132b2908c9061450b565b9081526040805191829003602090810183206001600160401b038d166000908152915220919091556001600160a01b0387169061ffff8c16907f95c1ad3ef50dd05e668d7b80e9a723079395ac4867a4050552d5d9219e683d7490613322908d908d908d908c908c908a90614794565b60405180910390a3612fa6565b6000878787876040516020016133489493929190614759565b6040516020818303038152906040528051906020012090508a61ffff167fb8890edbfc1c74692f527444645f95489c3703cc2df42e4a366f5d06fa6cd8848b8b84604051613398939291906147f6565b60405180910390a25050505050505050505050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60006022825110156134535760405162461bcd60e51b815260206004820152601c60248201527f4c7a4170703a20696e76616c69642061646170746572506172616d730000000060448201526064016108ca565b506022015190565b82805461346790613eff565b90600052602060002090601f01602090048101928261348957600085556134cf565b82601f106134a257805160ff19168380011785556134cf565b828001600101855582156134cf579182015b828111156134cf5782518255916020019190600101906134b4565b506134db929150613553565b5090565b8280546134eb90613eff565b90600052602060002090601f01602090048101928261350d57600085556134cf565b82601f106135265782800160ff198235161785556134cf565b828001600101855582156134cf579182015b828111156134cf578235825591602001919060010190613538565b5b808211156134db5760008155600101613554565b61ffff8116811461252d57600080fd5b80356124f881613568565b60008083601f84011261359557600080fd5b5081356001600160401b038111156135ac57600080fd5b6020830191508360208285010111156135c457600080fd5b9250929050565b6001600160401b038116811461252d57600080fd5b80356124f8816135cb565b6000806000806000806080878903121561360457600080fd5b863561360f81613568565b955060208701356001600160401b038082111561362b57600080fd5b6136378a838b01613583565b90975095506040890135915061364c826135cb565b9093506060880135908082111561366257600080fd5b5061366f89828a01613583565b979a9699509497509295939492505050565b60006020828403121561369357600080fd5b81356001600160e01b03198116811461156f57600080fd5b6000602082840312156136bd57600080fd5b813561156f81613568565b600080604083850312156136db57600080fd5b82356136e681613568565b946020939093013593505050565b801515811461252d57600080fd5b80356124f8816136f4565b600080600080600080600060a0888a03121561372857600080fd5b873561373381613568565b965060208801356001600160401b038082111561374f57600080fd5b61375b8b838c01613583565b909850965060408a0135955060608a01359150613777826136f4565b9093506080890135908082111561378d57600080fd5b5061379a8a828b01613583565b989b979a50959850939692959293505050565b6000806000604084860312156137c257600080fd5b83356137cd81613568565b925060208401356001600160401b038111156137e857600080fd5b6137f486828701613583565b9497909650939450505050565b6001600160a01b038116811461252d57600080fd5b80356124f881613801565b6000806040838503121561383457600080fd5b823561383f81613801565b9150602083013561384f81613801565b809150509250929050565b600080600080600080600080600060e08a8c03121561387857600080fd5b893561388381613801565b985060208a013561389381613568565b975060408a01356001600160401b03808211156138af57600080fd5b6138bb8d838e01613583565b909950975060608c0135965060808c013591506138d782613801565b90945060a08b0135906138e982613801565b90935060c08b013590808211156138ff57600080fd5b5061390c8c828d01613583565b915080935050809150509295985092959850929598565b6000806000806080858703121561393957600080fd5b843561394481613801565b9350602085013561395481613568565b9250604085013561396481613801565b9396929550929360600135925050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156139b2576139b2613974565b604052919050565b60006001600160401b038211156139d3576139d3613974565b50601f01601f191660200190565b6000806000606084860312156139f657600080fd5b8335613a0181613568565b925060208401356001600160401b03811115613a1c57600080fd5b8401601f81018613613a2d57600080fd5b8035613a40613a3b826139ba565b61398a565b818152876020838501011115613a5557600080fd5b816020840160208301376000602083830101528094505050506040840135613a7c816135cb565b809150509250925092565b60005b83811015613aa2578181015183820152602001613a8a565b8381111561113f5750506000910152565b60008151808452613acb816020860160208601613a87565b601f01601f19169290920160200192915050565b60208152600061156f6020830184613ab3565b60008060408385031215613b0557600080fd5b8235613b1081613568565b9150602083013561384f81613568565b600060208284031215613b3257600080fd5b813561156f81613801565b600080600060608486031215613b5257600080fd5b8335613b5d81613568565b92506020840135613b6d81613801565b929592945050506040919091013590565b60008060008060008060008060008060e08b8d031215613b9d57600080fd5b8a35613ba881613568565b995060208b01356001600160401b0380821115613bc457600080fd5b613bd08e838f01613583565b909b50995060408d0135985060608d0135915080821115613bf057600080fd5b613bfc8e838f01613583565b909850965060808d01359150613c11826135cb565b819550613c2060a08e01613702565b945060c08d0135915080821115613c3657600080fd5b50613c438d828e01613583565b915080935050809150509295989b9194979a5092959850565b600080600080600060808688031215613c7457600080fd5b8535613c7f81613568565b94506020860135613c8f81613568565b93506040860135925060608601356001600160401b03811115613cb157600080fd5b613cbd88828901613583565b969995985093965092949392505050565b60008060008060008060008060008060e08b8d031215613ced57600080fd5b8a35613cf881613568565b995060208b01356001600160401b0380821115613d1457600080fd5b613d208e838f01613583565b909b50995060408d01359150613d35826135cb565b90975060608c01359080821115613d4b57600080fd5b613d578e838f01613583565b9098509650869150613d6b60808e01613816565b955060a08d0135945060c08d0135915080821115613c3657600080fd5b600080600060608486031215613d9d57600080fd5b8335613da881613568565b92506020840135613b6d81613568565b6000806000806000806000806000806000806101208d8f031215613ddb57600080fd5b613de48d613816565b9b50613df260208e01613578565b9a506001600160401b0360408e01351115613e0c57600080fd5b613e1c8e60408f01358f01613583565b909a50985060608d013597506001600160401b0360808e01351115613e4057600080fd5b613e508e60808f01358f01613583565b9097509550613e6160a08e016135e0565b9450613e6f60c08e01613816565b9350613e7d60e08e01613816565b92506001600160401b036101008e01351115613e9857600080fd5b613ea98e6101008f01358f01613583565b81935080925050509295989b509295989b509295989b565b600060208284031215613ed357600080fd5b813561156f816136f4565b60008060008060808587031215613ef457600080fd5b843561394481613568565b600181811c90821680613f1357607f821691505b60208210811415613f3457634e487b7160e01b600052602260045260246000fd5b50919050565b8183823760009101908152919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b61ffff85168152606060208201526000613fc6606083018587613f7f565b905082604083015295945050505050565b61ffff871681526001600160a01b038616602082015260a06040820181905260009061400590830187613ab3565b85151560608401528281036080840152614020818587613f7f565b9998505050505050505050565b6000806040838503121561404057600080fd5b505080516020909101519092909150565b61ffff841681526040602082015260006122fa604083018486613f7f565b60609190911b6bffffffffffffffffffffffff1916815260140190565b60006020828403121561409e57600080fd5b815161156f81613801565b6000602082840312156140bb57600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b6000828210156140ea576140ea6140c2565b500390565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b61ffff8616815260a06020820152600061413260a0830187613ab3565b856040840152841515606084015282810360808401526141528185613ab3565b98975050505050505050565b61ffff8916815260c06020820152600061417b60c083018a613ab3565b828103604084015261418e81898b613f7f565b905086606084015282810360808401526141a9818688613f7f565b9150506001600160401b03831660a08301529998505050505050505050565b600061ffff8088168352808716602084015250846040830152608060608301526141f6608083018486613f7f565b979650505050505050565b60808152600061421560808301888a613f7f565b6001600160a01b0387166020840152604083018690528281036060840152614020818587613f7f565b61ffff8a16815260c06020820152600061425c60c083018a8c613f7f565b6001600160401b0389166040840152828103606084015261427e81888a613f7f565b905085608084015282810360a0840152614299818587613f7f565b9c9b505050505050505050505050565b61ffff861681526080602082015260006142c7608083018688613f7f565b6001600160401b0394909416604083015250606001529392505050565b600082601f8301126142f557600080fd5b8151614303613a3b826139ba565b81815284602083860101111561431857600080fd5b614329826020830160208701613a87565b949350505050565b60006020828403121561434357600080fd5b81516001600160401b0381111561435957600080fd5b614329848285016142e4565b61ffff851681526080602082015260006143826080830186613ab3565b6001600160401b038516604084015282810360608401526141f68185613ab3565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b61ffff841681526060602082015260006144596060830185613ab3565b9050826040830152949350505050565b60408152600061447c6040830185613ab3565b90508260208301529392505050565b6000821982111561449e5761449e6140c2565b500190565b61ffff8816815260c0602082015260006144c060c0830189613ab3565b82810360408401526144d28189613ab3565b905086606084015282810360808401526144ed818688613f7f565b9150506001600160401b03831660a083015298975050505050505050565b6000825161451d818460208701613a87565b9190910192915050565b61ffff8616815260a06020820152600061454460a0830187613ab3565b6001600160401b038616604084015282810360608401526145658186613ab3565b905082810360808401526141528185613ab3565b60006020828403121561458b57600080fd5b815161156f816136f4565b61ffff8716815260c0602082015260006145b360c0830188613ab3565b82810360408401526145c58188613ab3565b6001600160a01b0387811660608601528616608085015283810360a085015290506140208185613ab3565b60008060006060848603121561460557600080fd5b835161461081613568565b60208501519093506001600160401b0381111561462c57600080fd5b614638868287016142e4565b925050604084015190509250925092565b60008060008060008060c0878903121561466257600080fd5b865161466d81613568565b60208801519096506001600160401b038082111561468a57600080fd5b6146968a838b016142e4565b965060408901519150808211156146ac57600080fd5b6146b88a838b016142e4565b95506060890151945060808901519150808211156146d557600080fd5b506146e289828a016142e4565b92505060a08701516146f3816135cb565b809150509295509295509295565b61ffff8716815260c06020820152600061471e60c0830188613ab3565b6001600160401b0387166040840152828103606084015261473f8187613ab3565b905084608084015282810360a08401526140208185613ab3565b60808152600061476c6080830187613ab3565b6001600160a01b03861660208401526040830185905282810360608401526141f68185613ab3565b60c0815260006147a760c0830189613ab3565b6001600160401b038816602084015282810360408401526147c88188613ab3565b905085606084015282810360808401526147e28186613ab3565b905082810360a08401526140208185613ab3565b6060815260006148096060830186613ab3565b6001600160401b03949094166020830152506040015291905056fea26469706673582212204bc8eef6be2e74d81a78b6c777f42dda132af8e265a0460a71121fdd2f9895ad64736f6c63430008090033", + "numDeployments": 2, + "solcInputHash": "210845288ae75ad5da12a755a9f52e1f", + "metadata": "{\"compiler\":{\"version\":\"0.8.9+commit.e5eed63a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AddressIsNull\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BridgingIsPaused\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DestinationChainNotAllowed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SenderIsNotCrossChainDispatcher\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SenderIsNotTheOwner\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint16\",\"name\":\"_srcChainId\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_srcAddress\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"_nonce\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_from\",\"type\":\"bytes\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_payload\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_reason\",\"type\":\"bytes\"}],\"name\":\"CallOFTReceivedFailure\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint16\",\"name\":\"_srcChainId\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_srcAddress\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"_nonce\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"_hash\",\"type\":\"bytes32\"}],\"name\":\"CallOFTReceivedSuccess\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"_srcChainId\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_srcAddress\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"_nonce\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_payload\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_reason\",\"type\":\"bytes\"}],\"name\":\"MessageFailed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"}],\"name\":\"NonContractAddress\",\"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\":\"uint16\",\"name\":\"_srcChainId\",\"type\":\"uint16\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"ReceiveFromChain\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"_srcChainId\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_srcAddress\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"_nonce\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"_payloadHash\",\"type\":\"bytes32\"}],\"name\":\"RetryMessageSuccess\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"_messageHash\",\"type\":\"bytes32\"}],\"name\":\"RetryOFTReceivedSuccess\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint16\",\"name\":\"_dstChainId\",\"type\":\"uint16\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_from\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_toAddress\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"SendToChain\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"_dstChainId\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"_type\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_minDstGas\",\"type\":\"uint256\"}],\"name\":\"SetMinDstGas\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"precrime\",\"type\":\"address\"}],\"name\":\"SetPrecrime\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"_remoteChainId\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_path\",\"type\":\"bytes\"}],\"name\":\"SetTrustedRemote\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"_remoteChainId\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_remoteAddress\",\"type\":\"bytes\"}],\"name\":\"SetTrustedRemoteAddress\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"_useCustomAdapterParams\",\"type\":\"bool\"}],\"name\":\"SetUseCustomAdapterParams\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DEFAULT_PAYLOAD_SIZE_LIMIT\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"NO_EXTRA_GAS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"PT_SEND\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"PT_SEND_AND_CALL\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"VERSION\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"circulatingSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_dstChainId\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"_toAddress\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_payload\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"_dstGasForCall\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"_useZro\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"_adapterParams\",\"type\":\"bytes\"}],\"name\":\"estimateSendAndCallFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"nativeFee\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"zroFee\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_dstChainId\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"_toAddress\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"_useZro\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"_adapterParams\",\"type\":\"bytes\"}],\"name\":\"estimateSendFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"nativeFee\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"zroFee\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"dstChainId_\",\"type\":\"uint16\"},{\"internalType\":\"address\",\"name\":\"to_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount_\",\"type\":\"uint256\"}],\"name\":\"estimateSendFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_nativeFee\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"name\":\"failedMessages\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"name\":\"failedOFTReceivedMessages\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_srcChainId\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"_srcAddress\",\"type\":\"bytes\"}],\"name\":\"forceResumeReceive\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_version\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"_chainId\",\"type\":\"uint16\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_configType\",\"type\":\"uint256\"}],\"name\":\"getConfig\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"chainId_\",\"type\":\"uint16\"}],\"name\":\"getProxyOFTOf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"_proxyOFT\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_remoteChainId\",\"type\":\"uint16\"}],\"name\":\"getTrustedRemoteAddress\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"lzEndpoint_\",\"type\":\"address\"},{\"internalType\":\"contract ISyntheticToken\",\"name\":\"syntheticToken_\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_srcChainId\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"_srcAddress\",\"type\":\"bytes\"}],\"name\":\"isTrustedRemote\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lzEndpoint\",\"outputs\":[{\"internalType\":\"contract ILayerZeroEndpointUpgradeable\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_srcChainId\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"_srcAddress\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"_nonce\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"_payload\",\"type\":\"bytes\"}],\"name\":\"lzReceive\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"name\":\"minDstGasLookup\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_srcChainId\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"_srcAddress\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"_nonce\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"_payload\",\"type\":\"bytes\"}],\"name\":\"nonblockingLzReceive\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"name\":\"payloadSizeLimitLookup\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"precrime\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_srcChainId\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"_srcAddress\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"_nonce\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"_payload\",\"type\":\"bytes\"}],\"name\":\"retryMessage\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_srcChainId\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"_srcAddress\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"_nonce\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"_from\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_payload\",\"type\":\"bytes\"}],\"name\":\"retryOFTReceived\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from_\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"dstChainId_\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"toAddress_\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"amount_\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"payload_\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"dstGasForCall_\",\"type\":\"uint64\"},{\"internalType\":\"address payable\",\"name\":\"refundAddress_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"zroPaymentAddress_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"adapterParams_\",\"type\":\"bytes\"}],\"name\":\"sendAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_from\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"_dstChainId\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"_toAddress\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"address payable\",\"name\":\"_refundAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_zroPaymentAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_adapterParams\",\"type\":\"bytes\"}],\"name\":\"sendFrom\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from_\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"dstChainId_\",\"type\":\"uint16\"},{\"internalType\":\"address\",\"name\":\"to_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount_\",\"type\":\"uint256\"}],\"name\":\"sendFrom\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_version\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"_chainId\",\"type\":\"uint16\"},{\"internalType\":\"uint256\",\"name\":\"_configType\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_config\",\"type\":\"bytes\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_dstChainId\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"_packetType\",\"type\":\"uint16\"},{\"internalType\":\"uint256\",\"name\":\"_minGas\",\"type\":\"uint256\"}],\"name\":\"setMinDstGas\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_dstChainId\",\"type\":\"uint16\"},{\"internalType\":\"uint256\",\"name\":\"_size\",\"type\":\"uint256\"}],\"name\":\"setPayloadSizeLimit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_precrime\",\"type\":\"address\"}],\"name\":\"setPrecrime\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_version\",\"type\":\"uint16\"}],\"name\":\"setReceiveVersion\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_version\",\"type\":\"uint16\"}],\"name\":\"setSendVersion\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_srcChainId\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"_path\",\"type\":\"bytes\"}],\"name\":\"setTrustedRemote\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_remoteChainId\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"_remoteAddress\",\"type\":\"bytes\"}],\"name\":\"setTrustedRemoteAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"_useCustomAdapterParams\",\"type\":\"bool\"}],\"name\":\"setUseCustomAdapterParams\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"name\":\"trustedRemoteLookup\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"useCustomAdapterParams\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"circulatingSupply()\":{\"details\":\"returns the circulating amount of tokens on current chain\"},\"estimateSendFee(uint16,bytes,uint256,bool,bytes)\":{\"details\":\"estimate send token `_tokenId` to (`_dstChainId`, `_toAddress`) _dstChainId - L0 defined chain id to send tokens too _toAddress - dynamic bytes array which contains the address to whom you are sending tokens to on the dstChain _amount - amount of the tokens to transfer _useZro - indicates to use zro to pay L0 fees _adapterParam - flexible bytes array to indicate messaging adapter services in L0\"},\"getProxyOFTOf(uint16)\":{\"params\":{\"chainId_\":\"the chain to get contract from\"}},\"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 anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"sendFrom(address,uint16,bytes,uint256,address,address,bytes)\":{\"details\":\"send `_amount` amount of token to (`_dstChainId`, `_toAddress`) from `_from` `_from` the owner of token `_dstChainId` the destination chain identifier `_toAddress` can be any size depending on the `dstChainId`. `_amount` the quantity of tokens in wei `_refundAddress` the address LayerZero refunds if too much message fee is sent `_zroPaymentAddress` set to address(0x0) if not paying in ZRO (LayerZero Token) `_adapterParams` is a flexible bytes array to indicate messaging adapter services\"},\"token()\":{\"details\":\"returns the address of the ERC20 token\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"title\":\"The ProxyOFT contract\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"estimateSendFee(uint16,address,uint256)\":{\"notice\":\"User friendly `sendFrom()` function\"},\"getProxyOFTOf(uint16)\":{\"notice\":\"Get other chains Proxy OFT contracts\"},\"sendFrom(address,uint16,address,uint256)\":{\"notice\":\"User friendly `sendFrom()` function\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/ProxyOFT.sol\":\"ProxyOFT\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/ProxyOFT.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/composable/ComposableOFTCoreUpgradeable.sol\\\";\\nimport \\\"./storage/ProxyOFTStorage.sol\\\";\\nimport \\\"./interfaces/ICrossChainDispatcher.sol\\\";\\n\\nerror AddressIsNull();\\nerror SenderIsNotTheOwner();\\nerror BridgingIsPaused();\\nerror SenderIsNotCrossChainDispatcher();\\nerror DestinationChainNotAllowed();\\n\\n// Note: The `ICrossChainDispatcher` wasn't updated to avoid changing interface\\n// Refs: https://github.com/autonomoussoftware/metronome-synth/issues/877\\ninterface ICrossChainDispatcherExtended is ICrossChainDispatcher {\\n function isDestinationChainSupported(uint16 dstChainId_) external view returns (bool);\\n}\\n\\n/**\\n * @title The ProxyOFT contract\\n */\\ncontract ProxyOFT is ComposableOFTCoreUpgradeable, ProxyOFTStorageV1 {\\n using BytesLib for bytes;\\n\\n string public constant VERSION = \\\"1.3.0\\\";\\n\\n constructor() {\\n _disableInitializers();\\n }\\n\\n function initialize(address lzEndpoint_, ISyntheticToken syntheticToken_) external initializer {\\n if (address(syntheticToken_) == address(0)) revert AddressIsNull();\\n if (address(lzEndpoint_) == address(0)) revert AddressIsNull();\\n\\n __ComposableOFTCoreUpgradeable_init(lzEndpoint_);\\n\\n syntheticToken = syntheticToken_;\\n }\\n\\n /// @inheritdoc IOFTCoreUpgradeable\\n function circulatingSupply() public view override returns (uint) {\\n return syntheticToken.totalSupply();\\n }\\n\\n /**\\n * @notice Get other chains Proxy OFT contracts\\n * @param chainId_ the chain to get contract from\\n */\\n function getProxyOFTOf(uint16 chainId_) public view returns (address _proxyOFT) {\\n return trustedRemoteLookup[chainId_].toAddress(0);\\n }\\n\\n /// @inheritdoc IOFTCoreUpgradeable\\n function token() public view override returns (address) {\\n return address(syntheticToken);\\n }\\n\\n /// @inheritdoc OFTCoreUpgradeable\\n function _debitFrom(\\n address from_,\\n uint16 dstChainId_,\\n bytes memory /*toAddress_*/,\\n uint amount_\\n ) internal override returns (uint256 _sent) {\\n ICrossChainDispatcher _crossChainDispatcher = syntheticToken.poolRegistry().crossChainDispatcher();\\n if (msg.sender != from_) revert SenderIsNotTheOwner();\\n if (!_crossChainDispatcher.isBridgingActive()) revert BridgingIsPaused();\\n if (!ICrossChainDispatcherExtended(address(_crossChainDispatcher)).isDestinationChainSupported(dstChainId_))\\n revert DestinationChainNotAllowed();\\n\\n syntheticToken.burn(from_, amount_);\\n return amount_;\\n }\\n\\n /// @inheritdoc OFTCoreUpgradeable\\n function _creditTo(\\n uint16 /*srcChainId_*/,\\n address toAddress_,\\n uint amount_\\n ) internal override returns (uint256 _received) {\\n syntheticToken.mint(toAddress_, amount_);\\n return amount_;\\n }\\n\\n /// @inheritdoc ComposableOFTCoreUpgradeable\\n function sendAndCall(\\n address from_,\\n uint16 dstChainId_,\\n bytes calldata toAddress_,\\n uint amount_,\\n bytes calldata payload_,\\n uint64 dstGasForCall_,\\n address payable refundAddress_,\\n address zroPaymentAddress_,\\n bytes calldata adapterParams_\\n ) public payable override(ComposableOFTCoreUpgradeable, IComposableOFTCoreUpgradeable) {\\n if (msg.sender != address(syntheticToken.poolRegistry().crossChainDispatcher()))\\n revert SenderIsNotCrossChainDispatcher();\\n\\n _sendAndCall(\\n from_,\\n dstChainId_,\\n toAddress_,\\n amount_,\\n payload_,\\n dstGasForCall_,\\n refundAddress_,\\n zroPaymentAddress_,\\n adapterParams_\\n );\\n }\\n\\n /**\\n * @notice User friendly `sendFrom()` function\\n */\\n function sendFrom(address from_, uint16 dstChainId_, address to_, uint256 amount_) external payable {\\n _send({\\n _from: from_,\\n _dstChainId: dstChainId_,\\n _toAddress: abi.encodePacked(to_),\\n _amount: amount_,\\n _refundAddress: payable(from_),\\n _zroPaymentAddress: address(0),\\n _adapterParams: abi.encodePacked(\\n uint16(1), // LZ_ADAPTER_PARAMS_VERSION\\n syntheticToken.poolRegistry().crossChainDispatcher().lzBaseGasLimit()\\n )\\n });\\n }\\n\\n /**\\n * @notice User friendly `sendFrom()` function\\n */\\n function estimateSendFee(\\n uint16 dstChainId_,\\n address to_,\\n uint256 amount_\\n ) external view returns (uint256 _nativeFee) {\\n (_nativeFee, ) = this.estimateSendFee({\\n _dstChainId: dstChainId_,\\n _toAddress: abi.encodePacked(to_),\\n _amount: amount_,\\n _useZro: false,\\n _adapterParams: abi.encodePacked(\\n uint16(1), // LZ_ADAPTER_PARAMS_VERSION\\n syntheticToken.poolRegistry().crossChainDispatcher().lzBaseGasLimit()\\n )\\n });\\n }\\n\\n /// @inheritdoc OwnableUpgradeable\\n function owner() public view override returns (address) {\\n return syntheticToken.poolRegistry().governor();\\n }\\n\\n /// @inheritdoc OwnableUpgradeable\\n function renounceOwnership() public override {\\n revert(\\\"disabled\\\");\\n }\\n\\n /// @inheritdoc OwnableUpgradeable\\n function transferOwnership(address) public override {\\n revert(\\\"disabled\\\");\\n }\\n}\\n\",\"keccak256\":\"0x076b35ec105f3831661dc29125594f8649fd06219f59caf6eda7c20634170592\",\"license\":\"MIT\"},\"contracts/dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/interfaces/ILayerZeroEndpointUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"./ILayerZeroUserApplicationConfigUpgradeable.sol\\\";\\n\\ninterface ILayerZeroEndpointUpgradeable is ILayerZeroUserApplicationConfigUpgradeable {\\n // @notice send a LayerZero message to the specified address at a LayerZero endpoint.\\n // @param _dstChainId - the destination chain identifier\\n // @param _destination - the address on destination chain (in bytes). address length/format may vary by chains\\n // @param _payload - a custom bytes payload to send to the destination contract\\n // @param _refundAddress - if the source transaction is cheaper than the amount of value passed, refund the additional amount to this address\\n // @param _zroPaymentAddress - the address of the ZRO token holder who would pay for the transaction\\n // @param _adapterParams - parameters for custom functionality. e.g. receive airdropped native gas from the relayer on destination\\n function send(uint16 _dstChainId, bytes calldata _destination, bytes calldata _payload, address payable _refundAddress, address _zroPaymentAddress, bytes calldata _adapterParams) external payable;\\n\\n // @notice used by the messaging library to publish verified payload\\n // @param _srcChainId - the source chain identifier\\n // @param _srcAddress - the source contract (as bytes) at the source chain\\n // @param _dstAddress - the address on destination chain\\n // @param _nonce - the unbound message ordering nonce\\n // @param _gasLimit - the gas limit for external contract execution\\n // @param _payload - verified payload to send to the destination contract\\n function receivePayload(uint16 _srcChainId, bytes calldata _srcAddress, address _dstAddress, uint64 _nonce, uint _gasLimit, bytes calldata _payload) external;\\n\\n // @notice get the inboundNonce of a lzApp from a source chain which could be EVM or non-EVM chain\\n // @param _srcChainId - the source chain identifier\\n // @param _srcAddress - the source chain contract address\\n function getInboundNonce(uint16 _srcChainId, bytes calldata _srcAddress) external view returns (uint64);\\n\\n // @notice get the outboundNonce from this source chain which, consequently, is always an EVM\\n // @param _srcAddress - the source chain contract address\\n function getOutboundNonce(uint16 _dstChainId, address _srcAddress) external view returns (uint64);\\n\\n // @notice gets a quote in source native gas, for the amount that send() requires to pay for message delivery\\n // @param _dstChainId - the destination chain identifier\\n // @param _userApplication - the user app address on this EVM chain\\n // @param _payload - the custom message to send over LayerZero\\n // @param _payInZRO - if false, user app pays the protocol fee in native token\\n // @param _adapterParam - parameters for the adapter service, e.g. send some dust native token to dstChain\\n function estimateFees(uint16 _dstChainId, address _userApplication, bytes calldata _payload, bool _payInZRO, bytes calldata _adapterParam) external view returns (uint nativeFee, uint zroFee);\\n\\n // @notice get this Endpoint's immutable source identifier\\n function getChainId() external view returns (uint16);\\n\\n // @notice the interface to retry failed message on this Endpoint destination\\n // @param _srcChainId - the source chain identifier\\n // @param _srcAddress - the source chain contract address\\n // @param _payload - the payload to be retried\\n function retryPayload(uint16 _srcChainId, bytes calldata _srcAddress, bytes calldata _payload) external;\\n\\n // @notice query if any STORED payload (message blocking) at the endpoint.\\n // @param _srcChainId - the source chain identifier\\n // @param _srcAddress - the source chain contract address\\n function hasStoredPayload(uint16 _srcChainId, bytes calldata _srcAddress) external view returns (bool);\\n\\n // @notice query if the _libraryAddress is valid for sending msgs.\\n // @param _userApplication - the user app address on this EVM chain\\n function getSendLibraryAddress(address _userApplication) external view returns (address);\\n\\n // @notice query if the _libraryAddress is valid for receiving msgs.\\n // @param _userApplication - the user app address on this EVM chain\\n function getReceiveLibraryAddress(address _userApplication) external view returns (address);\\n\\n // @notice query if the non-reentrancy guard for send() is on\\n // @return true if the guard is on. false otherwise\\n function isSendingPayload() external view returns (bool);\\n\\n // @notice query if the non-reentrancy guard for receive() is on\\n // @return true if the guard is on. false otherwise\\n function isReceivingPayload() external view returns (bool);\\n\\n // @notice get the configuration of the LayerZero messaging library of the specified version\\n // @param _version - messaging library version\\n // @param _chainId - the chainId for the pending config change\\n // @param _userApplication - the contract address of the user application\\n // @param _configType - type of configuration. every messaging library has its own convention.\\n function getConfig(uint16 _version, uint16 _chainId, address _userApplication, uint _configType) external view returns (bytes memory);\\n\\n // @notice get the send() LayerZero messaging library version\\n // @param _userApplication - the contract address of the user application\\n function getSendVersion(address _userApplication) external view returns (uint16);\\n\\n // @notice get the lzReceive() LayerZero messaging library version\\n // @param _userApplication - the contract address of the user application\\n function getReceiveVersion(address _userApplication) external view returns (uint16);\\n}\\n\",\"keccak256\":\"0x748e7abf8908f264c6fff8ea7730b1766ab5a262be7962404f7d263066b41487\",\"license\":\"MIT\"},\"contracts/dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/interfaces/ILayerZeroReceiverUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.2;\\n\\ninterface ILayerZeroReceiverUpgradeable {\\n // @notice LayerZero endpoint will invoke this function to deliver the message on the destination\\n // @param _srcChainId - the source endpoint identifier\\n // @param _srcAddress - the source sending contract address from the source chain\\n // @param _nonce - the ordered message nonce\\n // @param _payload - the signed payload is the UA bytes has encoded to be sent\\n function lzReceive(uint16 _srcChainId, bytes calldata _srcAddress, uint64 _nonce, bytes calldata _payload) external;\\n}\\n\",\"keccak256\":\"0x6ce5593a1247719f7209cad8068573c249674b41b859c6379ace1baaea0ed2a3\",\"license\":\"MIT\"},\"contracts/dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/interfaces/ILayerZeroUserApplicationConfigUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.2;\\n\\ninterface ILayerZeroUserApplicationConfigUpgradeable {\\n // @notice set the configuration of the LayerZero messaging library of the specified version\\n // @param _version - messaging library version\\n // @param _chainId - the chainId for the pending config change\\n // @param _configType - type of configuration. every messaging library has its own convention.\\n // @param _config - configuration in the bytes. can encode arbitrary content.\\n function setConfig(uint16 _version, uint16 _chainId, uint _configType, bytes calldata _config) external;\\n\\n // @notice set the send() LayerZero messaging library version to _version\\n // @param _version - new messaging library version\\n function setSendVersion(uint16 _version) external;\\n\\n // @notice set the lzReceive() LayerZero messaging library version to _version\\n // @param _version - new messaging library version\\n function setReceiveVersion(uint16 _version) external;\\n\\n // @notice Only when the UA needs to resume the message flow in blocking mode and clear the stored payload\\n // @param _srcChainId - the chainId of the source chain\\n // @param _srcAddress - the contract address of the source contract at the source chain\\n function forceResumeReceive(uint16 _srcChainId, bytes calldata _srcAddress) external;\\n}\\n\",\"keccak256\":\"0xa808baa32db12c453b982320e0c9a8c07aec8c0f3bb36ac2ed26f3ad47476879\",\"license\":\"MIT\"},\"contracts/dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/lzApp/LzAppUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../../../openzeppelin-upgradeable/access/OwnableUpgradeable.sol\\\";\\nimport \\\"../interfaces/ILayerZeroReceiverUpgradeable.sol\\\";\\nimport \\\"../interfaces/ILayerZeroUserApplicationConfigUpgradeable.sol\\\";\\nimport \\\"../interfaces/ILayerZeroEndpointUpgradeable.sol\\\";\\nimport \\\"../../util/BytesLib.sol\\\";\\n\\n/*\\n * a generic LzReceiver implementation\\n */\\nabstract contract LzAppUpgradeable is\\n Initializable,\\n OwnableUpgradeable,\\n ILayerZeroReceiverUpgradeable,\\n ILayerZeroUserApplicationConfigUpgradeable\\n{\\n using BytesLib for bytes;\\n\\n // ua can not send payload larger than this by default, but it can be changed by the ua owner\\n uint public constant DEFAULT_PAYLOAD_SIZE_LIMIT = 10000;\\n\\n ILayerZeroEndpointUpgradeable public lzEndpoint;\\n mapping(uint16 => bytes) public trustedRemoteLookup;\\n mapping(uint16 => mapping(uint16 => uint)) public minDstGasLookup;\\n mapping(uint16 => uint) public payloadSizeLimitLookup;\\n address public precrime;\\n\\n event SetPrecrime(address precrime);\\n event SetTrustedRemote(uint16 _remoteChainId, bytes _path);\\n event SetTrustedRemoteAddress(uint16 _remoteChainId, bytes _remoteAddress);\\n event SetMinDstGas(uint16 _dstChainId, uint16 _type, uint _minDstGas);\\n\\n function __LzAppUpgradeable_init(address _endpoint) internal onlyInitializing {\\n __Ownable_init_unchained();\\n __LzAppUpgradeable_init_unchained(_endpoint);\\n }\\n\\n function __LzAppUpgradeable_init_unchained(address _endpoint) internal onlyInitializing {\\n lzEndpoint = ILayerZeroEndpointUpgradeable(_endpoint);\\n }\\n\\n function lzReceive(\\n uint16 _srcChainId,\\n bytes calldata _srcAddress,\\n uint64 _nonce,\\n bytes calldata _payload\\n ) public virtual override {\\n // lzReceive must be called by the endpoint for security\\n require(_msgSender() == address(lzEndpoint), \\\"LzApp: invalid endpoint caller\\\");\\n\\n bytes memory trustedRemote = trustedRemoteLookup[_srcChainId];\\n // if will still block the message pathway from (srcChainId, srcAddress). should not receive message from untrusted remote.\\n require(\\n _srcAddress.length == trustedRemote.length &&\\n trustedRemote.length > 0 &&\\n keccak256(_srcAddress) == keccak256(trustedRemote),\\n \\\"LzApp: invalid source sending contract\\\"\\n );\\n\\n _blockingLzReceive(_srcChainId, _srcAddress, _nonce, _payload);\\n }\\n\\n // abstract function - the default behaviour of LayerZero is blocking. See: NonblockingLzApp if you dont need to enforce ordered messaging\\n function _blockingLzReceive(\\n uint16 _srcChainId,\\n bytes memory _srcAddress,\\n uint64 _nonce,\\n bytes memory _payload\\n ) internal virtual;\\n\\n function _lzSend(\\n uint16 _dstChainId,\\n bytes memory _payload,\\n address payable _refundAddress,\\n address _zroPaymentAddress,\\n bytes memory _adapterParams,\\n uint _nativeFee\\n ) internal virtual {\\n bytes memory trustedRemote = trustedRemoteLookup[_dstChainId];\\n require(trustedRemote.length != 0, \\\"LzApp: destination chain is not a trusted source\\\");\\n _checkPayloadSize(_dstChainId, _payload.length);\\n lzEndpoint.send{value: _nativeFee}(\\n _dstChainId,\\n trustedRemote,\\n _payload,\\n _refundAddress,\\n _zroPaymentAddress,\\n _adapterParams\\n );\\n }\\n\\n function _checkGasLimit(\\n uint16 _dstChainId,\\n uint16 _type,\\n bytes memory _adapterParams,\\n uint _extraGas\\n ) internal view virtual {\\n uint providedGasLimit = _getGasLimit(_adapterParams);\\n uint minGasLimit = minDstGasLookup[_dstChainId][_type] + _extraGas;\\n require(minGasLimit > 0, \\\"LzApp: minGasLimit not set\\\");\\n require(providedGasLimit >= minGasLimit, \\\"LzApp: gas limit is too low\\\");\\n }\\n\\n function _getGasLimit(bytes memory _adapterParams) internal pure virtual returns (uint gasLimit) {\\n require(_adapterParams.length >= 34, \\\"LzApp: invalid adapterParams\\\");\\n assembly {\\n gasLimit := mload(add(_adapterParams, 34))\\n }\\n }\\n\\n function _checkPayloadSize(uint16 _dstChainId, uint _payloadSize) internal view virtual {\\n uint payloadSizeLimit = payloadSizeLimitLookup[_dstChainId];\\n if (payloadSizeLimit == 0) {\\n // use default if not set\\n payloadSizeLimit = DEFAULT_PAYLOAD_SIZE_LIMIT;\\n }\\n require(_payloadSize <= payloadSizeLimit, \\\"LzApp: payload size is too large\\\");\\n }\\n\\n //---------------------------UserApplication config----------------------------------------\\n function getConfig(\\n uint16 _version,\\n uint16 _chainId,\\n address,\\n uint _configType\\n ) external view returns (bytes memory) {\\n return lzEndpoint.getConfig(_version, _chainId, address(this), _configType);\\n }\\n\\n // generic config for LayerZero user Application\\n function setConfig(\\n uint16 _version,\\n uint16 _chainId,\\n uint _configType,\\n bytes calldata _config\\n ) external override onlyOwner {\\n lzEndpoint.setConfig(_version, _chainId, _configType, _config);\\n }\\n\\n function setSendVersion(uint16 _version) external override onlyOwner {\\n lzEndpoint.setSendVersion(_version);\\n }\\n\\n function setReceiveVersion(uint16 _version) external override onlyOwner {\\n lzEndpoint.setReceiveVersion(_version);\\n }\\n\\n function forceResumeReceive(uint16 _srcChainId, bytes calldata _srcAddress) external override onlyOwner {\\n lzEndpoint.forceResumeReceive(_srcChainId, _srcAddress);\\n }\\n\\n // _path = abi.encodePacked(remoteAddress, localAddress)\\n // this function set the trusted path for the cross-chain communication\\n function setTrustedRemote(uint16 _srcChainId, bytes calldata _path) external onlyOwner {\\n trustedRemoteLookup[_srcChainId] = _path;\\n emit SetTrustedRemote(_srcChainId, _path);\\n }\\n\\n function setTrustedRemoteAddress(uint16 _remoteChainId, bytes calldata _remoteAddress) external onlyOwner {\\n trustedRemoteLookup[_remoteChainId] = abi.encodePacked(_remoteAddress, address(this));\\n emit SetTrustedRemoteAddress(_remoteChainId, _remoteAddress);\\n }\\n\\n function getTrustedRemoteAddress(uint16 _remoteChainId) external view returns (bytes memory) {\\n bytes memory path = trustedRemoteLookup[_remoteChainId];\\n require(path.length != 0, \\\"LzApp: no trusted path record\\\");\\n return path.slice(0, path.length - 20); // the last 20 bytes should be address(this)\\n }\\n\\n function setPrecrime(address _precrime) external onlyOwner {\\n precrime = _precrime;\\n emit SetPrecrime(_precrime);\\n }\\n\\n function setMinDstGas(uint16 _dstChainId, uint16 _packetType, uint _minGas) external onlyOwner {\\n require(_minGas > 0, \\\"LzApp: invalid minGas\\\");\\n minDstGasLookup[_dstChainId][_packetType] = _minGas;\\n emit SetMinDstGas(_dstChainId, _packetType, _minGas);\\n }\\n\\n // if the size is 0, it means default size limit\\n function setPayloadSizeLimit(uint16 _dstChainId, uint _size) external onlyOwner {\\n payloadSizeLimitLookup[_dstChainId] = _size;\\n }\\n\\n //--------------------------- VIEW FUNCTION ----------------------------------------\\n function isTrustedRemote(uint16 _srcChainId, bytes calldata _srcAddress) external view returns (bool) {\\n bytes memory trustedSource = trustedRemoteLookup[_srcChainId];\\n return keccak256(trustedSource) == keccak256(_srcAddress);\\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 uint[45] private __gap;\\n}\\n\",\"keccak256\":\"0x399507f44b1c9355452ba54834eccaa17972334e2b8139015e044244cde17b93\",\"license\":\"MIT\"},\"contracts/dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/lzApp/NonblockingLzAppUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"./LzAppUpgradeable.sol\\\";\\nimport \\\"../../util/ExcessivelySafeCall.sol\\\";\\n\\n/*\\n * the default LayerZero messaging behaviour is blocking, i.e. any failed message will block the channel\\n * this abstract class try-catch all fail messages and store locally for future retry. hence, non-blocking\\n * NOTE: if the srcAddress is not configured properly, it will still block the message pathway from (srcChainId, srcAddress)\\n */\\nabstract contract NonblockingLzAppUpgradeable is Initializable, LzAppUpgradeable {\\n using ExcessivelySafeCall for address;\\n\\n function __NonblockingLzAppUpgradeable_init(address _endpoint) internal onlyInitializing {\\n __Ownable_init_unchained();\\n __LzAppUpgradeable_init_unchained(_endpoint);\\n }\\n\\n function __NonblockingLzAppUpgradeable_init_unchained(address _endpoint) internal onlyInitializing {}\\n\\n mapping(uint16 => mapping(bytes => mapping(uint64 => bytes32))) public failedMessages;\\n\\n event MessageFailed(uint16 _srcChainId, bytes _srcAddress, uint64 _nonce, bytes _payload, bytes _reason);\\n event RetryMessageSuccess(uint16 _srcChainId, bytes _srcAddress, uint64 _nonce, bytes32 _payloadHash);\\n\\n // overriding the virtual function in LzReceiver\\n function _blockingLzReceive(uint16 _srcChainId, bytes memory _srcAddress, uint64 _nonce, bytes memory _payload) internal virtual override {\\n (bool success, bytes memory reason) = address(this).excessivelySafeCall(gasleft(), 150, abi.encodeWithSelector(this.nonblockingLzReceive.selector, _srcChainId, _srcAddress, _nonce, _payload));\\n // try-catch all errors/exceptions\\n if (!success) {\\n _storeFailedMessage(_srcChainId, _srcAddress, _nonce, _payload, reason);\\n }\\n }\\n\\n function _storeFailedMessage(uint16 _srcChainId, bytes memory _srcAddress, uint64 _nonce, bytes memory _payload, bytes memory _reason) internal virtual {\\n failedMessages[_srcChainId][_srcAddress][_nonce] = keccak256(_payload);\\n emit MessageFailed(_srcChainId, _srcAddress, _nonce, _payload, _reason);\\n }\\n\\n function nonblockingLzReceive(uint16 _srcChainId, bytes calldata _srcAddress, uint64 _nonce, bytes calldata _payload) public virtual {\\n // only internal transaction\\n require(_msgSender() == address(this), \\\"NonblockingLzApp: caller must be LzApp\\\");\\n _nonblockingLzReceive(_srcChainId, _srcAddress, _nonce, _payload);\\n }\\n\\n //@notice override this function\\n function _nonblockingLzReceive(uint16 _srcChainId, bytes memory _srcAddress, uint64 _nonce, bytes memory _payload) internal virtual;\\n\\n function retryMessage(uint16 _srcChainId, bytes calldata _srcAddress, uint64 _nonce, bytes calldata _payload) public payable virtual {\\n // assert there is message to retry\\n bytes32 payloadHash = failedMessages[_srcChainId][_srcAddress][_nonce];\\n require(payloadHash != bytes32(0), \\\"NonblockingLzApp: no stored message\\\");\\n require(keccak256(_payload) == payloadHash, \\\"NonblockingLzApp: invalid payload\\\");\\n // clear the stored message\\n failedMessages[_srcChainId][_srcAddress][_nonce] = bytes32(0);\\n // execute the message. revert if it fails again\\n _nonblockingLzReceive(_srcChainId, _srcAddress, _nonce, _payload);\\n emit RetryMessageSuccess(_srcChainId, _srcAddress, _nonce, payloadHash);\\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 uint[49] private __gap;\\n}\\n\",\"keccak256\":\"0x128f7c8d0d1d04c147cea7a2a6c2244387bef408f2a6f0a9c2a01cf54a66eea3\",\"license\":\"MIT\"},\"contracts/dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/IOFTCoreUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../../../../openzeppelin-upgradeable/utils/introspection/IERC165Upgradeable.sol\\\";\\n\\n/**\\n * @dev Interface of the IOFT core standard\\n */\\ninterface IOFTCoreUpgradeable is IERC165Upgradeable {\\n /**\\n * @dev estimate send token `_tokenId` to (`_dstChainId`, `_toAddress`)\\n * _dstChainId - L0 defined chain id to send tokens too\\n * _toAddress - dynamic bytes array which contains the address to whom you are sending tokens to on the dstChain\\n * _amount - amount of the tokens to transfer\\n * _useZro - indicates to use zro to pay L0 fees\\n * _adapterParam - flexible bytes array to indicate messaging adapter services in L0\\n */\\n function estimateSendFee(\\n uint16 _dstChainId,\\n bytes calldata _toAddress,\\n uint _amount,\\n bool _useZro,\\n bytes calldata _adapterParams\\n ) external view returns (uint nativeFee, uint zroFee);\\n\\n /**\\n * @dev send `_amount` amount of token to (`_dstChainId`, `_toAddress`) from `_from`\\n * `_from` the owner of token\\n * `_dstChainId` the destination chain identifier\\n * `_toAddress` can be any size depending on the `dstChainId`.\\n * `_amount` the quantity of tokens in wei\\n * `_refundAddress` the address LayerZero refunds if too much message fee is sent\\n * `_zroPaymentAddress` set to address(0x0) if not paying in ZRO (LayerZero Token)\\n * `_adapterParams` is a flexible bytes array to indicate messaging adapter services\\n */\\n function sendFrom(\\n address _from,\\n uint16 _dstChainId,\\n bytes calldata _toAddress,\\n uint _amount,\\n address payable _refundAddress,\\n address _zroPaymentAddress,\\n bytes calldata _adapterParams\\n ) external payable;\\n\\n /**\\n * @dev returns the circulating amount of tokens on current chain\\n */\\n function circulatingSupply() external view returns (uint);\\n\\n /**\\n * @dev returns the address of the ERC20 token\\n */\\n function token() external view returns (address);\\n\\n /**\\n * @dev Emitted when `_amount` tokens are moved from the `_sender` to (`_dstChainId`, `_toAddress`)\\n * `_nonce` is the outbound nonce\\n */\\n event SendToChain(uint16 indexed _dstChainId, address indexed _from, bytes _toAddress, uint _amount);\\n\\n /**\\n * @dev Emitted when `_amount` tokens are received from `_srcChainId` into the `_toAddress` on the local chain.\\n * `_nonce` is the inbound nonce.\\n */\\n event ReceiveFromChain(uint16 indexed _srcChainId, address indexed _to, uint _amount);\\n\\n event SetUseCustomAdapterParams(bool _useCustomAdapterParams);\\n}\\n\",\"keccak256\":\"0x22651924296f8308db8195d7a86a6781023241c53905418f2d3925e3f693f530\",\"license\":\"MIT\"},\"contracts/dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/OFTCoreUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"./IOFTCoreUpgradeable.sol\\\";\\nimport \\\"../../../../../openzeppelin-upgradeable/utils/introspection/ERC165Upgradeable.sol\\\";\\nimport \\\"../../lzApp/NonblockingLzAppUpgradeable.sol\\\";\\n\\nabstract contract OFTCoreUpgradeable is\\n Initializable,\\n NonblockingLzAppUpgradeable,\\n ERC165Upgradeable,\\n IOFTCoreUpgradeable\\n{\\n using BytesLib for bytes;\\n\\n uint public constant NO_EXTRA_GAS = 0;\\n\\n // packet type\\n uint16 public constant PT_SEND = 0;\\n\\n bool public useCustomAdapterParams;\\n\\n function __OFTCoreUpgradeable_init(address _lzEndpoint) internal onlyInitializing {\\n __Ownable_init_unchained();\\n __LzAppUpgradeable_init_unchained(_lzEndpoint);\\n }\\n\\n function __OFTCoreUpgradeable_init_unchained() internal onlyInitializing {}\\n\\n function supportsInterface(\\n bytes4 interfaceId\\n ) public view virtual override(ERC165Upgradeable, IERC165Upgradeable) returns (bool) {\\n return interfaceId == type(IOFTCoreUpgradeable).interfaceId || super.supportsInterface(interfaceId);\\n }\\n\\n function estimateSendFee(\\n uint16 _dstChainId,\\n bytes calldata _toAddress,\\n uint _amount,\\n bool _useZro,\\n bytes calldata _adapterParams\\n ) public view virtual override returns (uint nativeFee, uint zroFee) {\\n // mock the payload for sendFrom()\\n bytes memory payload = abi.encode(PT_SEND, _toAddress, _amount);\\n return lzEndpoint.estimateFees(_dstChainId, address(this), payload, _useZro, _adapterParams);\\n }\\n\\n function sendFrom(\\n address _from,\\n uint16 _dstChainId,\\n bytes calldata _toAddress,\\n uint _amount,\\n address payable _refundAddress,\\n address _zroPaymentAddress,\\n bytes calldata _adapterParams\\n ) public payable virtual override {\\n _send(_from, _dstChainId, _toAddress, _amount, _refundAddress, _zroPaymentAddress, _adapterParams);\\n }\\n\\n function setUseCustomAdapterParams(bool _useCustomAdapterParams) public virtual onlyOwner {\\n useCustomAdapterParams = _useCustomAdapterParams;\\n emit SetUseCustomAdapterParams(_useCustomAdapterParams);\\n }\\n\\n function _nonblockingLzReceive(\\n uint16 _srcChainId,\\n bytes memory _srcAddress,\\n uint64 _nonce,\\n bytes memory _payload\\n ) internal virtual override {\\n uint16 packetType;\\n assembly {\\n packetType := mload(add(_payload, 32))\\n }\\n\\n if (packetType == PT_SEND) {\\n _sendAck(_srcChainId, _srcAddress, _nonce, _payload);\\n } else {\\n revert(\\\"OFTCore: unknown packet type\\\");\\n }\\n }\\n\\n function _send(\\n address _from,\\n uint16 _dstChainId,\\n bytes memory _toAddress,\\n uint _amount,\\n address payable _refundAddress,\\n address _zroPaymentAddress,\\n bytes memory _adapterParams\\n ) internal virtual {\\n _checkAdapterParams(_dstChainId, PT_SEND, _adapterParams, NO_EXTRA_GAS);\\n\\n uint amount = _debitFrom(_from, _dstChainId, _toAddress, _amount);\\n\\n bytes memory lzPayload = abi.encode(PT_SEND, _toAddress, amount);\\n _lzSend(_dstChainId, lzPayload, _refundAddress, _zroPaymentAddress, _adapterParams, msg.value);\\n\\n emit SendToChain(_dstChainId, _from, _toAddress, amount);\\n }\\n\\n function _sendAck(uint16 _srcChainId, bytes memory, uint64, bytes memory _payload) internal virtual {\\n (, bytes memory toAddressBytes, uint amount) = abi.decode(_payload, (uint16, bytes, uint));\\n\\n address to = toAddressBytes.toAddress(0);\\n\\n amount = _creditTo(_srcChainId, to, amount);\\n emit ReceiveFromChain(_srcChainId, to, amount);\\n }\\n\\n function _checkAdapterParams(\\n uint16 _dstChainId,\\n uint16 _pkType,\\n bytes memory _adapterParams,\\n uint _extraGas\\n ) internal virtual {\\n if (useCustomAdapterParams) {\\n _checkGasLimit(_dstChainId, _pkType, _adapterParams, _extraGas);\\n } else {\\n require(_adapterParams.length == 0, \\\"OFTCore: _adapterParams must be empty.\\\");\\n }\\n }\\n\\n function _debitFrom(\\n address _from,\\n uint16 _dstChainId,\\n bytes memory _toAddress,\\n uint _amount\\n ) internal virtual returns (uint);\\n\\n function _creditTo(uint16 _srcChainId, address _toAddress, uint _amount) internal virtual returns (uint);\\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 uint[49] private __gap;\\n}\\n\",\"keccak256\":\"0xcf88a5e869561adfc3dc333488331033529f7d192f65664806d27e16e172d1ac\",\"license\":\"MIT\"},\"contracts/dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/composable/ComposableOFTCoreUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../OFTCoreUpgradeable.sol\\\";\\nimport \\\"./IOFTReceiverUpgradeable.sol\\\";\\nimport \\\"./IComposableOFTCoreUpgradeable.sol\\\";\\nimport \\\"../../../../util/ExcessivelySafeCall.sol\\\";\\n\\nabstract contract ComposableOFTCoreUpgradeable is OFTCoreUpgradeable, IComposableOFTCoreUpgradeable {\\n using ExcessivelySafeCall for address;\\n using BytesLib for bytes;\\n\\n // packet type\\n uint16 public constant PT_SEND_AND_CALL = 1;\\n\\n mapping(uint16 => mapping(bytes => mapping(uint64 => bytes32))) public failedOFTReceivedMessages;\\n\\n function __ComposableOFTCoreUpgradeable_init(address _lzEndpoint) internal onlyInitializing {\\n __OFTCoreUpgradeable_init(_lzEndpoint);\\n }\\n\\n function __ComposableOFTCoreUpgradeable_init_unchained() internal onlyInitializing {}\\n\\n function supportsInterface(\\n bytes4 interfaceId\\n ) public view virtual override(OFTCoreUpgradeable, IERC165Upgradeable) returns (bool) {\\n return interfaceId == type(IComposableOFTCoreUpgradeable).interfaceId || super.supportsInterface(interfaceId);\\n }\\n\\n function estimateSendAndCallFee(\\n uint16 _dstChainId,\\n bytes calldata _toAddress,\\n uint _amount,\\n bytes calldata _payload,\\n uint64 _dstGasForCall,\\n bool _useZro,\\n bytes calldata _adapterParams\\n ) public view virtual override returns (uint nativeFee, uint zroFee) {\\n // mock the payload for sendAndCall()\\n bytes memory payload = abi.encode(\\n PT_SEND_AND_CALL,\\n abi.encodePacked(msg.sender),\\n _toAddress,\\n _amount,\\n _payload,\\n _dstGasForCall\\n );\\n return lzEndpoint.estimateFees(_dstChainId, address(this), payload, _useZro, _adapterParams);\\n }\\n\\n function sendAndCall(\\n address _from,\\n uint16 _dstChainId,\\n bytes calldata _toAddress,\\n uint _amount,\\n bytes calldata _payload,\\n uint64 _dstGasForCall,\\n address payable _refundAddress,\\n address _zroPaymentAddress,\\n bytes calldata _adapterParams\\n ) public payable virtual override {\\n _sendAndCall(\\n _from,\\n _dstChainId,\\n _toAddress,\\n _amount,\\n _payload,\\n _dstGasForCall,\\n _refundAddress,\\n _zroPaymentAddress,\\n _adapterParams\\n );\\n }\\n\\n function retryOFTReceived(\\n uint16 _srcChainId,\\n bytes calldata _srcAddress,\\n uint64 _nonce,\\n bytes calldata _from,\\n address _to,\\n uint _amount,\\n bytes calldata _payload\\n ) public virtual override {\\n bytes32 msgHash = failedOFTReceivedMessages[_srcChainId][_srcAddress][_nonce];\\n require(msgHash != bytes32(0), \\\"ComposableOFTCore: no failed message to retry\\\");\\n\\n bytes32 hash = keccak256(abi.encode(_from, _to, _amount, _payload));\\n require(hash == msgHash, \\\"ComposableOFTCore: failed message hash mismatch\\\");\\n\\n delete failedOFTReceivedMessages[_srcChainId][_srcAddress][_nonce];\\n IOFTReceiverUpgradeable(_to).onOFTReceived(_srcChainId, _srcAddress, _nonce, _from, _amount, _payload);\\n emit RetryOFTReceivedSuccess(hash);\\n }\\n\\n function _nonblockingLzReceive(\\n uint16 _srcChainId,\\n bytes memory _srcAddress,\\n uint64 _nonce,\\n bytes memory _payload\\n ) internal virtual override {\\n uint16 packetType;\\n assembly {\\n packetType := mload(add(_payload, 32))\\n }\\n\\n if (packetType == PT_SEND) {\\n _sendAck(_srcChainId, _srcAddress, _nonce, _payload);\\n } else if (packetType == PT_SEND_AND_CALL) {\\n _sendAndCallAck(_srcChainId, _srcAddress, _nonce, _payload);\\n } else {\\n revert(\\\"ComposableOFTCore: unknown packet type\\\");\\n }\\n }\\n\\n function _sendAndCall(\\n address _from,\\n uint16 _dstChainId,\\n bytes memory _toAddress,\\n uint _amount,\\n bytes calldata _payload,\\n uint64 _dstGasForCall,\\n address payable _refundAddress,\\n address _zroPaymentAddress,\\n bytes memory _adapterParams\\n ) internal virtual {\\n _checkAdapterParams(_dstChainId, PT_SEND_AND_CALL, _adapterParams, _dstGasForCall);\\n\\n uint amount = _debitFrom(_from, _dstChainId, _toAddress, _amount);\\n\\n bytes memory lzPayload = abi.encode(\\n PT_SEND_AND_CALL,\\n abi.encodePacked(msg.sender),\\n _toAddress,\\n amount,\\n _payload,\\n _dstGasForCall\\n );\\n _lzSend(_dstChainId, lzPayload, _refundAddress, _zroPaymentAddress, _adapterParams, msg.value);\\n\\n emit SendToChain(_dstChainId, _from, _toAddress, amount);\\n }\\n\\n function _sendAndCallAck(\\n uint16 _srcChainId,\\n bytes memory _srcAddress,\\n uint64 _nonce,\\n bytes memory _payload\\n ) internal virtual {\\n (, bytes memory from, bytes memory toAddress, uint amount, bytes memory payload, uint64 gasForCall) = abi\\n .decode(_payload, (uint16, bytes, bytes, uint, bytes, uint64));\\n\\n address to = toAddress.toAddress(0);\\n\\n amount = _creditTo(_srcChainId, to, amount);\\n emit ReceiveFromChain(_srcChainId, to, amount);\\n\\n if (!_isContract(to)) {\\n emit NonContractAddress(to);\\n return;\\n }\\n\\n _safeCallOnOFTReceived(_srcChainId, _srcAddress, _nonce, from, to, amount, payload, gasForCall);\\n }\\n\\n function _safeCallOnOFTReceived(\\n uint16 _srcChainId,\\n bytes memory _srcAddress,\\n uint64 _nonce,\\n bytes memory _from,\\n address _to,\\n uint _amount,\\n bytes memory _payload,\\n uint _gasForCall\\n ) internal virtual {\\n (bool success, bytes memory reason) = _to.excessivelySafeCall(\\n _gasForCall,\\n 150,\\n abi.encodeWithSelector(\\n IOFTReceiverUpgradeable.onOFTReceived.selector,\\n _srcChainId,\\n _srcAddress,\\n _nonce,\\n _from,\\n _amount,\\n _payload\\n )\\n );\\n if (!success) {\\n failedOFTReceivedMessages[_srcChainId][_srcAddress][_nonce] = keccak256(\\n abi.encode(_from, _to, _amount, _payload)\\n );\\n emit CallOFTReceivedFailure(_srcChainId, _srcAddress, _nonce, _from, _to, _amount, _payload, reason);\\n } else {\\n bytes32 hash = keccak256(abi.encode(_from, _to, _amount, _payload));\\n emit CallOFTReceivedSuccess(_srcChainId, _srcAddress, _nonce, hash);\\n }\\n }\\n\\n function _isContract(address _account) internal view returns (bool) {\\n return _account.code.length > 0;\\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 uint[49] private __gap;\\n}\\n\",\"keccak256\":\"0xd48fef107e073a99c155f672be9c4d7430f275388f88e0a2b89dc910b86f157b\",\"license\":\"MIT\"},\"contracts/dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/composable/IComposableOFTCoreUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.5.0;\\n\\nimport \\\"../IOFTCoreUpgradeable.sol\\\";\\n\\n/**\\n * @dev Interface of the composable OFT core standard\\n */\\ninterface IComposableOFTCoreUpgradeable is IOFTCoreUpgradeable {\\n function estimateSendAndCallFee(\\n uint16 _dstChainId,\\n bytes calldata _toAddress,\\n uint _amount,\\n bytes calldata _payload,\\n uint64 _dstGasForCall,\\n bool _useZro,\\n bytes calldata _adapterParams\\n ) external view returns (uint nativeFee, uint zroFee);\\n\\n function sendAndCall(\\n address _from,\\n uint16 _dstChainId,\\n bytes calldata _toAddress,\\n uint _amount,\\n bytes calldata _payload,\\n uint64 _dstGasForCall,\\n address payable _refundAddress,\\n address _zroPaymentAddress,\\n bytes calldata _adapterParams\\n ) external payable;\\n\\n function retryOFTReceived(\\n uint16 _srcChainId,\\n bytes calldata _srcAddress,\\n uint64 _nonce,\\n bytes calldata _from,\\n address _to,\\n uint _amount,\\n bytes calldata _payload\\n ) external;\\n\\n event CallOFTReceivedFailure(\\n uint16 indexed _srcChainId,\\n bytes _srcAddress,\\n uint64 _nonce,\\n bytes _from,\\n address indexed _to,\\n uint _amount,\\n bytes _payload,\\n bytes _reason\\n );\\n\\n event CallOFTReceivedSuccess(uint16 indexed _srcChainId, bytes _srcAddress, uint64 _nonce, bytes32 _hash);\\n\\n event RetryOFTReceivedSuccess(bytes32 _messageHash);\\n\\n event NonContractAddress(address _address);\\n}\\n\",\"keccak256\":\"0x769b9356ad6019bdabdcfc11762f28d15eb9a4e262efc96835725f6862c5d9e9\",\"license\":\"MIT\"},\"contracts/dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/composable/IOFTReceiverUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.5.0;\\n\\ninterface IOFTReceiverUpgradeable {\\n /**\\n * @dev Called by the OFT contract when tokens are received from source chain.\\n * @param _srcChainId The chain id of the source chain.\\n * @param _srcAddress The address of the OFT token contract on the source chain.\\n * @param _nonce The nonce of the transaction on the source chain.\\n * @param _from The address of the account who calls the sendAndCall() on the source chain.\\n * @param _amount The amount of tokens to transfer.\\n * @param _payload Additional data with no specified format.\\n */\\n function onOFTReceived(\\n uint16 _srcChainId,\\n bytes calldata _srcAddress,\\n uint64 _nonce,\\n bytes calldata _from,\\n uint _amount,\\n bytes calldata _payload\\n ) external;\\n}\\n\",\"keccak256\":\"0x287036c704c57e34a6fc3f7e67c8dfaaade6eb3667b570576bc491c0f1f89a5b\",\"license\":\"MIT\"},\"contracts/dependencies/@layerzerolabs/solidity-examples/util/BytesLib.sol\":{\"content\":\"// SPDX-License-Identifier: Unlicense\\n/*\\n * @title Solidity Bytes Arrays Utils\\n * @author Gon\\u00e7alo S\\u00e1 \\n *\\n * @dev Bytes tightly packed arrays utility library for ethereum contracts written in Solidity.\\n * The library lets you concatenate, slice and type cast bytes arrays both in memory and storage.\\n */\\npragma solidity >=0.8.0 <0.9.0;\\n\\nlibrary BytesLib {\\n function concat(bytes memory _preBytes, bytes memory _postBytes) internal pure returns (bytes memory) {\\n bytes memory tempBytes;\\n\\n assembly {\\n // Get a location of some free memory and store it in tempBytes as\\n // Solidity does for memory variables.\\n tempBytes := mload(0x40)\\n\\n // Store the length of the first bytes array at the beginning of\\n // the memory for tempBytes.\\n let length := mload(_preBytes)\\n mstore(tempBytes, length)\\n\\n // Maintain a memory counter for the current write location in the\\n // temp bytes array by adding the 32 bytes for the array length to\\n // the starting location.\\n let mc := add(tempBytes, 0x20)\\n // Stop copying when the memory counter reaches the length of the\\n // first bytes array.\\n let end := add(mc, length)\\n\\n for {\\n // Initialize a copy counter to the start of the _preBytes data,\\n // 32 bytes into its memory.\\n let cc := add(_preBytes, 0x20)\\n } lt(mc, end) {\\n // Increase both counters by 32 bytes each iteration.\\n mc := add(mc, 0x20)\\n cc := add(cc, 0x20)\\n } {\\n // Write the _preBytes data into the tempBytes memory 32 bytes\\n // at a time.\\n mstore(mc, mload(cc))\\n }\\n\\n // Add the length of _postBytes to the current length of tempBytes\\n // and store it as the new length in the first 32 bytes of the\\n // tempBytes memory.\\n length := mload(_postBytes)\\n mstore(tempBytes, add(length, mload(tempBytes)))\\n\\n // Move the memory counter back from a multiple of 0x20 to the\\n // actual end of the _preBytes data.\\n mc := end\\n // Stop copying when the memory counter reaches the new combined\\n // length of the arrays.\\n end := add(mc, length)\\n\\n for {\\n let cc := add(_postBytes, 0x20)\\n } lt(mc, end) {\\n mc := add(mc, 0x20)\\n cc := add(cc, 0x20)\\n } {\\n mstore(mc, mload(cc))\\n }\\n\\n // Update the free-memory pointer by padding our last write location\\n // to 32 bytes: add 31 bytes to the end of tempBytes to move to the\\n // next 32 byte block, then round down to the nearest multiple of\\n // 32. If the sum of the length of the two arrays is zero then add\\n // one before rounding down to leave a blank 32 bytes (the length block with 0).\\n mstore(\\n 0x40,\\n and(\\n add(add(end, iszero(add(length, mload(_preBytes)))), 31),\\n not(31) // Round down to the nearest 32 bytes.\\n )\\n )\\n }\\n\\n return tempBytes;\\n }\\n\\n function concatStorage(bytes storage _preBytes, bytes memory _postBytes) internal {\\n assembly {\\n // Read the first 32 bytes of _preBytes storage, which is the length\\n // of the array. (We don't need to use the offset into the slot\\n // because arrays use the entire slot.)\\n let fslot := sload(_preBytes.slot)\\n // Arrays of 31 bytes or less have an even value in their slot,\\n // while longer arrays have an odd value. The actual length is\\n // the slot divided by two for odd values, and the lowest order\\n // byte divided by two for even values.\\n // If the slot is even, bitwise and the slot with 255 and divide by\\n // two to get the length. If the slot is odd, bitwise and the slot\\n // with -1 and divide by two.\\n let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2)\\n let mlength := mload(_postBytes)\\n let newlength := add(slength, mlength)\\n // slength can contain both the length and contents of the array\\n // if length < 32 bytes so let's prepare for that\\n // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage\\n switch add(lt(slength, 32), lt(newlength, 32))\\n case 2 {\\n // Since the new array still fits in the slot, we just need to\\n // update the contents of the slot.\\n // uint256(bytes_storage) = uint256(bytes_storage) + uint256(bytes_memory) + new_length\\n sstore(\\n _preBytes.slot,\\n // all the modifications to the slot are inside this\\n // next block\\n add(\\n // we can just add to the slot contents because the\\n // bytes we want to change are the LSBs\\n fslot,\\n add(\\n mul(\\n div(\\n // load the bytes from memory\\n mload(add(_postBytes, 0x20)),\\n // zero all bytes to the right\\n exp(0x100, sub(32, mlength))\\n ),\\n // and now shift left the number of bytes to\\n // leave space for the length in the slot\\n exp(0x100, sub(32, newlength))\\n ),\\n // increase length by the double of the memory\\n // bytes length\\n mul(mlength, 2)\\n )\\n )\\n )\\n }\\n case 1 {\\n // The stored value fits in the slot, but the combined value\\n // will exceed it.\\n // get the keccak hash to get the contents of the array\\n mstore(0x0, _preBytes.slot)\\n let sc := add(keccak256(0x0, 0x20), div(slength, 32))\\n\\n // save new length\\n sstore(_preBytes.slot, add(mul(newlength, 2), 1))\\n\\n // The contents of the _postBytes array start 32 bytes into\\n // the structure. Our first read should obtain the `submod`\\n // bytes that can fit into the unused space in the last word\\n // of the stored array. To get this, we read 32 bytes starting\\n // from `submod`, so the data we read overlaps with the array\\n // contents by `submod` bytes. Masking the lowest-order\\n // `submod` bytes allows us to add that value directly to the\\n // stored value.\\n\\n let submod := sub(32, slength)\\n let mc := add(_postBytes, submod)\\n let end := add(_postBytes, mlength)\\n let mask := sub(exp(0x100, submod), 1)\\n\\n sstore(\\n sc,\\n add(\\n and(fslot, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00),\\n and(mload(mc), mask)\\n )\\n )\\n\\n for {\\n mc := add(mc, 0x20)\\n sc := add(sc, 1)\\n } lt(mc, end) {\\n sc := add(sc, 1)\\n mc := add(mc, 0x20)\\n } {\\n sstore(sc, mload(mc))\\n }\\n\\n mask := exp(0x100, sub(mc, end))\\n\\n sstore(sc, mul(div(mload(mc), mask), mask))\\n }\\n default {\\n // get the keccak hash to get the contents of the array\\n mstore(0x0, _preBytes.slot)\\n // Start copying to the last used word of the stored array.\\n let sc := add(keccak256(0x0, 0x20), div(slength, 32))\\n\\n // save new length\\n sstore(_preBytes.slot, add(mul(newlength, 2), 1))\\n\\n // Copy over the first `submod` bytes of the new data as in\\n // case 1 above.\\n let slengthmod := mod(slength, 32)\\n let mlengthmod := mod(mlength, 32)\\n let submod := sub(32, slengthmod)\\n let mc := add(_postBytes, submod)\\n let end := add(_postBytes, mlength)\\n let mask := sub(exp(0x100, submod), 1)\\n\\n sstore(sc, add(sload(sc), and(mload(mc), mask)))\\n\\n for {\\n sc := add(sc, 1)\\n mc := add(mc, 0x20)\\n } lt(mc, end) {\\n sc := add(sc, 1)\\n mc := add(mc, 0x20)\\n } {\\n sstore(sc, mload(mc))\\n }\\n\\n mask := exp(0x100, sub(mc, end))\\n\\n sstore(sc, mul(div(mload(mc), mask), mask))\\n }\\n }\\n }\\n\\n function slice(bytes memory _bytes, uint256 _start, uint256 _length) internal pure returns (bytes memory) {\\n require(_length + 31 >= _length, \\\"slice_overflow\\\");\\n require(_bytes.length >= _start + _length, \\\"slice_outOfBounds\\\");\\n\\n bytes memory tempBytes;\\n\\n assembly {\\n switch iszero(_length)\\n case 0 {\\n // Get a location of some free memory and store it in tempBytes as\\n // Solidity does for memory variables.\\n tempBytes := mload(0x40)\\n\\n // The first word of the slice result is potentially a partial\\n // word read from the original array. To read it, we calculate\\n // the length of that partial word and start copying that many\\n // bytes into the array. The first word we copy will start with\\n // data we don't care about, but the last `lengthmod` bytes will\\n // land at the beginning of the contents of the new array. When\\n // we're done copying, we overwrite the full first word with\\n // the actual length of the slice.\\n let lengthmod := and(_length, 31)\\n\\n // The multiplication in the next line is necessary\\n // because when slicing multiples of 32 bytes (lengthmod == 0)\\n // the following copy loop was copying the origin's length\\n // and then ending prematurely not copying everything it should.\\n let mc := add(add(tempBytes, lengthmod), mul(0x20, iszero(lengthmod)))\\n let end := add(mc, _length)\\n\\n for {\\n // The multiplication in the next line has the same exact purpose\\n // as the one above.\\n let cc := add(add(add(_bytes, lengthmod), mul(0x20, iszero(lengthmod))), _start)\\n } lt(mc, end) {\\n mc := add(mc, 0x20)\\n cc := add(cc, 0x20)\\n } {\\n mstore(mc, mload(cc))\\n }\\n\\n mstore(tempBytes, _length)\\n\\n //update free-memory pointer\\n //allocating the array padded to 32 bytes like the compiler does now\\n mstore(0x40, and(add(mc, 31), not(31)))\\n }\\n //if we want a zero-length slice let's just return a zero-length array\\n default {\\n tempBytes := mload(0x40)\\n //zero out the 32 bytes slice we are about to return\\n //we need to do it because Solidity does not garbage collect\\n mstore(tempBytes, 0)\\n\\n mstore(0x40, add(tempBytes, 0x20))\\n }\\n }\\n\\n return tempBytes;\\n }\\n\\n function toAddress(bytes memory _bytes, uint256 _start) internal pure returns (address) {\\n require(_bytes.length >= _start + 20, \\\"toAddress_outOfBounds\\\");\\n address tempAddress;\\n\\n assembly {\\n tempAddress := div(mload(add(add(_bytes, 0x20), _start)), 0x1000000000000000000000000)\\n }\\n\\n return tempAddress;\\n }\\n\\n function toUint8(bytes memory _bytes, uint256 _start) internal pure returns (uint8) {\\n require(_bytes.length >= _start + 1, \\\"toUint8_outOfBounds\\\");\\n uint8 tempUint;\\n\\n assembly {\\n tempUint := mload(add(add(_bytes, 0x1), _start))\\n }\\n\\n return tempUint;\\n }\\n\\n function toUint16(bytes memory _bytes, uint256 _start) internal pure returns (uint16) {\\n require(_bytes.length >= _start + 2, \\\"toUint16_outOfBounds\\\");\\n uint16 tempUint;\\n\\n assembly {\\n tempUint := mload(add(add(_bytes, 0x2), _start))\\n }\\n\\n return tempUint;\\n }\\n\\n function toUint32(bytes memory _bytes, uint256 _start) internal pure returns (uint32) {\\n require(_bytes.length >= _start + 4, \\\"toUint32_outOfBounds\\\");\\n uint32 tempUint;\\n\\n assembly {\\n tempUint := mload(add(add(_bytes, 0x4), _start))\\n }\\n\\n return tempUint;\\n }\\n\\n function toUint64(bytes memory _bytes, uint256 _start) internal pure returns (uint64) {\\n require(_bytes.length >= _start + 8, \\\"toUint64_outOfBounds\\\");\\n uint64 tempUint;\\n\\n assembly {\\n tempUint := mload(add(add(_bytes, 0x8), _start))\\n }\\n\\n return tempUint;\\n }\\n\\n function toUint96(bytes memory _bytes, uint256 _start) internal pure returns (uint96) {\\n require(_bytes.length >= _start + 12, \\\"toUint96_outOfBounds\\\");\\n uint96 tempUint;\\n\\n assembly {\\n tempUint := mload(add(add(_bytes, 0xc), _start))\\n }\\n\\n return tempUint;\\n }\\n\\n function toUint128(bytes memory _bytes, uint256 _start) internal pure returns (uint128) {\\n require(_bytes.length >= _start + 16, \\\"toUint128_outOfBounds\\\");\\n uint128 tempUint;\\n\\n assembly {\\n tempUint := mload(add(add(_bytes, 0x10), _start))\\n }\\n\\n return tempUint;\\n }\\n\\n function toUint256(bytes memory _bytes, uint256 _start) internal pure returns (uint256) {\\n require(_bytes.length >= _start + 32, \\\"toUint256_outOfBounds\\\");\\n uint256 tempUint;\\n\\n assembly {\\n tempUint := mload(add(add(_bytes, 0x20), _start))\\n }\\n\\n return tempUint;\\n }\\n\\n function toBytes32(bytes memory _bytes, uint256 _start) internal pure returns (bytes32) {\\n require(_bytes.length >= _start + 32, \\\"toBytes32_outOfBounds\\\");\\n bytes32 tempBytes32;\\n\\n assembly {\\n tempBytes32 := mload(add(add(_bytes, 0x20), _start))\\n }\\n\\n return tempBytes32;\\n }\\n\\n function equal(bytes memory _preBytes, bytes memory _postBytes) internal pure returns (bool) {\\n bool success = true;\\n\\n assembly {\\n let length := mload(_preBytes)\\n\\n // if lengths don't match the arrays are not equal\\n switch eq(length, mload(_postBytes))\\n case 1 {\\n // cb is a circuit breaker in the for loop since there's\\n // no said feature for inline assembly loops\\n // cb = 1 - don't breaker\\n // cb = 0 - break\\n let cb := 1\\n\\n let mc := add(_preBytes, 0x20)\\n let end := add(mc, length)\\n\\n for {\\n let cc := add(_postBytes, 0x20)\\n // the next line is the loop condition:\\n // while(uint256(mc < end) + cb == 2)\\n } eq(add(lt(mc, end), cb), 2) {\\n mc := add(mc, 0x20)\\n cc := add(cc, 0x20)\\n } {\\n // if any of these checks fails then arrays are not equal\\n if iszero(eq(mload(mc), mload(cc))) {\\n // unsuccess:\\n success := 0\\n cb := 0\\n }\\n }\\n }\\n default {\\n // unsuccess:\\n success := 0\\n }\\n }\\n\\n return success;\\n }\\n\\n function equalStorage(bytes storage _preBytes, bytes memory _postBytes) internal view returns (bool) {\\n bool success = true;\\n\\n assembly {\\n // we know _preBytes_offset is 0\\n let fslot := sload(_preBytes.slot)\\n // Decode the length of the stored array like in concatStorage().\\n let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2)\\n let mlength := mload(_postBytes)\\n\\n // if lengths don't match the arrays are not equal\\n switch eq(slength, mlength)\\n case 1 {\\n // slength can contain both the length and contents of the array\\n // if length < 32 bytes so let's prepare for that\\n // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage\\n if iszero(iszero(slength)) {\\n switch lt(slength, 32)\\n case 1 {\\n // blank the last byte which is the length\\n fslot := mul(div(fslot, 0x100), 0x100)\\n\\n if iszero(eq(fslot, mload(add(_postBytes, 0x20)))) {\\n // unsuccess:\\n success := 0\\n }\\n }\\n default {\\n // cb is a circuit breaker in the for loop since there's\\n // no said feature for inline assembly loops\\n // cb = 1 - don't breaker\\n // cb = 0 - break\\n let cb := 1\\n\\n // get the keccak hash to get the contents of the array\\n mstore(0x0, _preBytes.slot)\\n let sc := keccak256(0x0, 0x20)\\n\\n let mc := add(_postBytes, 0x20)\\n let end := add(mc, mlength)\\n\\n // the next line is the loop condition:\\n // while(uint256(mc < end) + cb == 2)\\n for {\\n\\n } eq(add(lt(mc, end), cb), 2) {\\n sc := add(sc, 1)\\n mc := add(mc, 0x20)\\n } {\\n if iszero(eq(sload(sc), mload(mc))) {\\n // unsuccess:\\n success := 0\\n cb := 0\\n }\\n }\\n }\\n }\\n }\\n default {\\n // unsuccess:\\n success := 0\\n }\\n }\\n\\n return success;\\n }\\n}\\n\",\"keccak256\":\"0xaa1c57864bd8483bb17f2fa96a0cbebb39006ca7aab1a28ff85e52e487437c4c\",\"license\":\"Unlicense\"},\"contracts/dependencies/@layerzerolabs/solidity-examples/util/ExcessivelySafeCall.sol\":{\"content\":\"// SPDX-License-Identifier: MIT OR Apache-2.0\\npragma solidity >=0.7.6;\\n\\nlibrary ExcessivelySafeCall {\\n uint256 constant LOW_28_MASK = 0x00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff;\\n\\n /// @notice Use when you _really_ really _really_ don't trust the called\\n /// contract. This prevents the called contract from causing reversion of\\n /// the caller in as many ways as we can.\\n /// @dev The main difference between this and a solidity low-level call is\\n /// that we limit the number of bytes that the callee can cause to be\\n /// copied to caller memory. This prevents stupid things like malicious\\n /// contracts returning 10,000,000 bytes causing a local OOG when copying\\n /// to memory.\\n /// @param _target The address to call\\n /// @param _gas The amount of gas to forward to the remote contract\\n /// @param _maxCopy The maximum number of bytes of returndata to copy\\n /// to memory.\\n /// @param _calldata The data to send to the remote contract\\n /// @return success and returndata, as `.call()`. Returndata is capped to\\n /// `_maxCopy` bytes.\\n function excessivelySafeCall(\\n address _target,\\n uint256 _gas,\\n uint16 _maxCopy,\\n bytes memory _calldata\\n ) internal returns (bool, bytes memory) {\\n // set up for assembly call\\n uint256 _toCopy;\\n bool _success;\\n bytes memory _returnData = new bytes(_maxCopy);\\n // dispatch message to recipient\\n // by assembly calling \\\"handle\\\" function\\n // we call via assembly to avoid memcopying a very large returndata\\n // returned by a malicious contract\\n assembly {\\n _success := call(\\n _gas, // gas\\n _target, // recipient\\n 0, // ether value\\n add(_calldata, 0x20), // inloc\\n mload(_calldata), // inlen\\n 0, // outloc\\n 0 // outlen\\n )\\n // limit our copy to 256 bytes\\n _toCopy := returndatasize()\\n if gt(_toCopy, _maxCopy) {\\n _toCopy := _maxCopy\\n }\\n // Store the length of the copied bytes\\n mstore(_returnData, _toCopy)\\n // copy the bytes from returndata[0:_toCopy]\\n returndatacopy(add(_returnData, 0x20), 0, _toCopy)\\n }\\n return (_success, _returnData);\\n }\\n\\n /// @notice Use when you _really_ really _really_ don't trust the called\\n /// contract. This prevents the called contract from causing reversion of\\n /// the caller in as many ways as we can.\\n /// @dev The main difference between this and a solidity low-level call is\\n /// that we limit the number of bytes that the callee can cause to be\\n /// copied to caller memory. This prevents stupid things like malicious\\n /// contracts returning 10,000,000 bytes causing a local OOG when copying\\n /// to memory.\\n /// @param _target The address to call\\n /// @param _gas The amount of gas to forward to the remote contract\\n /// @param _maxCopy The maximum number of bytes of returndata to copy\\n /// to memory.\\n /// @param _calldata The data to send to the remote contract\\n /// @return success and returndata, as `.call()`. Returndata is capped to\\n /// `_maxCopy` bytes.\\n function excessivelySafeStaticCall(\\n address _target,\\n uint256 _gas,\\n uint16 _maxCopy,\\n bytes memory _calldata\\n ) internal view returns (bool, bytes memory) {\\n // set up for assembly call\\n uint256 _toCopy;\\n bool _success;\\n bytes memory _returnData = new bytes(_maxCopy);\\n // dispatch message to recipient\\n // by assembly calling \\\"handle\\\" function\\n // we call via assembly to avoid memcopying a very large returndata\\n // returned by a malicious contract\\n assembly {\\n _success := staticcall(\\n _gas, // gas\\n _target, // recipient\\n add(_calldata, 0x20), // inloc\\n mload(_calldata), // inlen\\n 0, // outloc\\n 0 // outlen\\n )\\n // limit our copy to 256 bytes\\n _toCopy := returndatasize()\\n if gt(_toCopy, _maxCopy) {\\n _toCopy := _maxCopy\\n }\\n // Store the length of the copied bytes\\n mstore(_returnData, _toCopy)\\n // copy the bytes from returndata[0:_toCopy]\\n returndatacopy(add(_returnData, 0x20), 0, _toCopy)\\n }\\n return (_success, _returnData);\\n }\\n\\n /**\\n * @notice Swaps function selectors in encoded contract calls\\n * @dev Allows reuse of encoded calldata for functions with identical\\n * argument types but different names. It simply swaps out the first 4 bytes\\n * for the new selector. This function modifies memory in place, and should\\n * only be used with caution.\\n * @param _newSelector The new 4-byte selector\\n * @param _buf The encoded contract args\\n */\\n function swapSelector(bytes4 _newSelector, bytes memory _buf) internal pure {\\n require(_buf.length >= 4);\\n uint256 _mask = LOW_28_MASK;\\n assembly {\\n // load the first word of\\n let _word := mload(add(_buf, 0x20))\\n // mask out the top 4 bytes\\n // /x\\n _word := and(_word, _mask)\\n _word := or(_newSelector, _word)\\n mstore(add(_buf, 0x20), _word)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x8355680ee3db8c855f77a0cb141eedb68e0894ddb2b7ffafdf78303f6dac23e0\",\"license\":\"MIT OR Apache-2.0\"},\"contracts/dependencies/openzeppelin-upgradeable/access/OwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (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 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 /**\\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\":\"0x652fee292f698d8dba81bf287cb71f1682f6483b67ebe601a5f7387dcfc30b34\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.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 * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\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. Equivalent to `reinitializer(1)`.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = _setInitializedVersion(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 * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original\\n * initialization step. This is essential to configure modules that are added through upgrades and that require\\n * initialization.\\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 modifier reinitializer(uint8 version) {\\n bool isTopLevelCall = _setInitializedVersion(version);\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(version);\\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} 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 function _disableInitializers() internal virtual {\\n _setInitializedVersion(type(uint8).max);\\n }\\n\\n function _setInitializedVersion(uint8 version) private returns (bool) {\\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, and for the lowest level\\n // of initializers, because in other contexts the contract may have been reentered.\\n if (_initializing) {\\n require(\\n version == 1 && !AddressUpgradeable.isContract(address(this)),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n return false;\\n } else {\\n require(_initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n return true;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x7454006cccb737612b00104d2f606d728e2818b778e7e55542f063c614ce46ba\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin-upgradeable/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.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 *\\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 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\":\"0x55cf2bd9fc76704ddcdc19834cd288b7de00fc0f298a40ea16a954ae8991db2d\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin-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\"},\"contracts/dependencies/openzeppelin-upgradeable/utils/introspection/ERC165Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC165Upgradeable.sol\\\";\\nimport \\\"../../proxy/utils/Initializable.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 ERC165Upgradeable is Initializable, IERC165Upgradeable {\\n function __ERC165_init() internal onlyInitializing {\\n }\\n\\n function __ERC165_init_unchained() internal onlyInitializing {\\n }\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IERC165Upgradeable).interfaceId;\\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\":\"0x9a3b990bd56d139df3e454a9edf1c64668530b5a77fc32eb063bc206f958274a\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin-upgradeable/utils/introspection/IERC165Upgradeable.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 IERC165Upgradeable {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0xc6cef87559d0aeffdf0a99803de655938a7779ec0a3cd5d4383483ad85565a09\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\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 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 `recipient`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address recipient, 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 `sender` to `recipient` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address sender,\\n address recipient,\\n uint256 amount\\n ) external returns (bool);\\n\\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\",\"keccak256\":\"0x027b891937d20ccf213fdb9c31531574256de774bda99d3a70ecef6e1913ed2a\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\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\":\"0x83fe24f5c04a56091e50f4a345ff504c8bff658a76d4c43b16878c8f940c53b2\",\"license\":\"MIT\"},\"contracts/dependencies/stargate-protocol/interfaces/IStargateComposer.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./IStargateRouter.sol\\\";\\n\\ninterface IStargateComposer {\\n function swap(\\n uint16 _dstChainId,\\n uint256 _srcPoolId,\\n uint256 _dstPoolId,\\n address payable _refundAddress,\\n uint256 _amountLD,\\n uint256 _minAmountLD,\\n IStargateRouter.lzTxObj memory _lzTxParams,\\n bytes calldata _to,\\n bytes calldata _payload\\n ) external payable;\\n\\n function factory() external view returns (address);\\n\\n function stargateBridge() external view returns (address);\\n\\n function stargateRouter() external view returns (IStargateRouter);\\n\\n function quoteLayerZeroFee(\\n uint16 _dstChainId,\\n uint8 _functionType,\\n bytes calldata _toAddress,\\n bytes calldata _transferAndCallPayload,\\n IStargateRouter.lzTxObj memory _lzTxParams\\n ) external view returns (uint256, uint256);\\n\\n function peers(uint16 _chainId) external view returns (address);\\n}\\n\",\"keccak256\":\"0xdfdd1690bf176ac05803534a60227be90cc435b4bdd8fce2348f1a9417a9f63a\",\"license\":\"BUSL-1.1\"},\"contracts/dependencies/stargate-protocol/interfaces/IStargateReceiver.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\n\\npragma solidity 0.8.9;\\n\\ninterface IStargateReceiver {\\n function sgReceive(\\n uint16 _chainId,\\n bytes memory _srcAddress,\\n uint256 _nonce,\\n address _token,\\n uint256 amountLD,\\n bytes memory payload\\n ) external;\\n}\\n\",\"keccak256\":\"0xe4d6bf9fa422e5e43dc1b6880f951d06611a4ed12c2dd7dd8c0b6a5d9e06ad0d\",\"license\":\"BUSL-1.1\"},\"contracts/dependencies/stargate-protocol/interfaces/IStargateRouter.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\n\\npragma solidity 0.8.9;\\n\\ninterface IStargateRouter {\\n struct lzTxObj {\\n uint256 dstGasForCall;\\n uint256 dstNativeAmount;\\n bytes dstNativeAddr;\\n }\\n\\n function addLiquidity(uint256 _poolId, uint256 _amountLD, address _to) external;\\n\\n function swap(\\n uint16 _dstChainId,\\n uint256 _srcPoolId,\\n uint256 _dstPoolId,\\n address payable _refundAddress,\\n uint256 _amountLD,\\n uint256 _minAmountLD,\\n lzTxObj memory _lzTxParams,\\n bytes calldata _to,\\n bytes calldata _payload\\n ) external payable;\\n\\n function redeemRemote(\\n uint16 _dstChainId,\\n uint256 _srcPoolId,\\n uint256 _dstPoolId,\\n address payable _refundAddress,\\n uint256 _amountLP,\\n uint256 _minAmountLD,\\n bytes calldata _to,\\n lzTxObj memory _lzTxParams\\n ) external payable;\\n\\n function instantRedeemLocal(uint16 _srcPoolId, uint256 _amountLP, address _to) external returns (uint256);\\n\\n function redeemLocal(\\n uint16 _dstChainId,\\n uint256 _srcPoolId,\\n uint256 _dstPoolId,\\n address payable _refundAddress,\\n uint256 _amountLP,\\n bytes calldata _to,\\n lzTxObj memory _lzTxParams\\n ) external payable;\\n\\n function sendCredits(\\n uint16 _dstChainId,\\n uint256 _srcPoolId,\\n uint256 _dstPoolId,\\n address payable _refundAddress\\n ) external payable;\\n\\n function quoteLayerZeroFee(\\n uint16 _dstChainId,\\n uint8 _functionType,\\n bytes calldata _toAddress,\\n bytes calldata _transferAndCallPayload,\\n lzTxObj memory _lzTxParams\\n ) external view returns (uint256, uint256);\\n\\n function clearCachedSwap(uint16 _srcChainId, bytes calldata _srcAddress, uint256 _nonce) external;\\n\\n function factory() external view returns (address);\\n\\n function bridge() external view returns (address);\\n\\n function cachedSwapLookup(\\n uint16 _chainId_,\\n bytes calldata _srcAddress,\\n uint256 _nonce\\n ) external view returns (address token, uint256 amountLD, address to, bytes memory payload);\\n}\\n\",\"keccak256\":\"0x92126df8e682b2c5647c7b22e7387da69f9e72480af86948ce5ed17dc2c9e0a7\",\"license\":\"BUSL-1.1\"},\"contracts/interfaces/ICrossChainDispatcher.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/composable/IOFTReceiverUpgradeable.sol\\\";\\nimport \\\"../dependencies/stargate-protocol/interfaces/IStargateReceiver.sol\\\";\\nimport \\\"../dependencies/stargate-protocol/interfaces/IStargateRouter.sol\\\";\\nimport \\\"../dependencies/stargate-protocol/interfaces/IStargateComposer.sol\\\";\\nimport \\\"./IProxyOFT.sol\\\";\\n\\ninterface ICrossChainDispatcher is IStargateReceiver, IOFTReceiverUpgradeable {\\n function crossChainDispatcherOf(uint16 chainId_) external view returns (address);\\n\\n function triggerFlashRepaySwap(\\n uint256 id_,\\n address payable account_,\\n address tokenIn_,\\n address tokenOut_,\\n uint256 amountIn_,\\n uint256 amountOutMin_,\\n bytes calldata lzArgs_\\n ) external payable;\\n\\n function triggerLeverageSwap(\\n uint256 id_,\\n address payable account_,\\n address tokenIn_,\\n address tokenOut_,\\n uint256 amountIn_,\\n uint256 amountOutMin,\\n bytes calldata lzArgs_\\n ) external payable;\\n\\n function isBridgingActive() external view returns (bool);\\n\\n function flashRepayCallbackTxGasLimit() external view returns (uint64);\\n\\n function flashRepaySwapTxGasLimit() external view returns (uint64);\\n\\n function leverageCallbackTxGasLimit() external view returns (uint64);\\n\\n function leverageSwapTxGasLimit() external view returns (uint64);\\n\\n function lzBaseGasLimit() external view returns (uint256);\\n\\n function stargateComposer() external view returns (IStargateComposer);\\n\\n function stargateSlippage() external view returns (uint256);\\n\\n function stargatePoolIdOf(address token_) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xcaf05e625588dcfaa5706acc78a35fa46d50baeb2d28f689036963695a4e39cb\",\"license\":\"MIT\"},\"contracts/interfaces/IDebtToken.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/openzeppelin/token/ERC20/extensions/IERC20Metadata.sol\\\";\\nimport \\\"./ISyntheticToken.sol\\\";\\n\\ninterface IDebtToken is IERC20Metadata {\\n function lastTimestampAccrued() external view returns (uint256);\\n\\n function isActive() external view returns (bool);\\n\\n function syntheticToken() external view returns (ISyntheticToken);\\n\\n function accrueInterest() external;\\n\\n function debtIndex() external returns (uint256 debtIndex_);\\n\\n function burn(address from_, uint256 amount_) external;\\n\\n function issue(uint256 amount_, address to_) external returns (uint256 _issued, uint256 _fee);\\n\\n function flashIssue(address to_, uint256 amount_) external returns (uint256 _issued, uint256 _fee);\\n\\n function mint(address to_, uint256 amount_) external;\\n\\n function repay(address onBehalfOf_, uint256 amount_) external returns (uint256 _repaid, uint256 _fee);\\n\\n function repayAll(address onBehalfOf_) external returns (uint256 _repaid, uint256 _fee);\\n\\n function quoteIssueIn(uint256 amountToIssue_) external view returns (uint256 _amount, uint256 _fee);\\n\\n function quoteIssueOut(uint256 amount_) external view returns (uint256 _amountToIssue, uint256 _fee);\\n\\n function quoteRepayIn(uint256 amountToRepay_) external view returns (uint256 _amount, uint256 _fee);\\n\\n function quoteRepayOut(uint256 amount_) external view returns (uint256 _amountToRepay, uint256 _fee);\\n\\n function updateMaxTotalSupply(uint256 newMaxTotalSupply_) external;\\n\\n function updateInterestRate(uint256 newInterestRate_) external;\\n\\n function maxTotalSupply() external view returns (uint256);\\n\\n function interestRate() external view returns (uint256);\\n\\n function interestRatePerSecond() external view returns (uint256);\\n\\n function toggleIsActive() external;\\n}\\n\",\"keccak256\":\"0xd2f04aa1bee06d6991b10aaf7c03c3ee09d85f8e48ba92feac595ad855881380\",\"license\":\"MIT\"},\"contracts/interfaces/IGovernable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\n/**\\n * @notice Governable interface\\n */\\ninterface IGovernable {\\n function governor() external view returns (address _governor);\\n\\n function transferGovernorship(address _proposedGovernor) external;\\n}\\n\",\"keccak256\":\"0xbe84461adf33aec1bf31b6d84a5380aaeb791de9a4b95346dd8270dc6632984e\",\"license\":\"MIT\"},\"contracts/interfaces/IPauseable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\ninterface IPauseable {\\n function paused() external view returns (bool);\\n\\n function everythingStopped() external view returns (bool);\\n}\\n\",\"keccak256\":\"0xa768de9fadad05a8104cb407ae6243354e70ffd6e1a50c3e0bb0a6a1dc49d32a\",\"license\":\"MIT\"},\"contracts/interfaces/IPoolRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./external/IMasterOracle.sol\\\";\\nimport \\\"./IPauseable.sol\\\";\\nimport \\\"./IGovernable.sol\\\";\\nimport \\\"./ISyntheticToken.sol\\\";\\nimport \\\"./external/ISwapper.sol\\\";\\nimport \\\"./IQuoter.sol\\\";\\nimport \\\"./ICrossChainDispatcher.sol\\\";\\n\\ninterface IPoolRegistry is IPauseable, IGovernable {\\n function feeCollector() external view returns (address);\\n\\n function isPoolRegistered(address pool_) external view returns (bool);\\n\\n function nativeTokenGateway() external view returns (address);\\n\\n function getPools() external view returns (address[] memory);\\n\\n function registerPool(address pool_) external;\\n\\n function unregisterPool(address pool_) external;\\n\\n function masterOracle() external view returns (IMasterOracle);\\n\\n function updateFeeCollector(address newFeeCollector_) external;\\n\\n function idOfPool(address pool_) external view returns (uint256);\\n\\n function nextPoolId() external view returns (uint256);\\n\\n function swapper() external view returns (ISwapper);\\n\\n function quoter() external view returns (IQuoter);\\n\\n function crossChainDispatcher() external view returns (ICrossChainDispatcher);\\n\\n function doesSyntheticTokenExist(ISyntheticToken syntheticToken_) external view returns (bool _exists);\\n}\\n\",\"keccak256\":\"0x9ffa9e5fd39a48ac2bda561af7fb4fc9df5f8ffb7a602ef1d4da8c068019e723\",\"license\":\"MIT\"},\"contracts/interfaces/IProxyOFT.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/composable/IComposableOFTCoreUpgradeable.sol\\\";\\n\\ninterface IProxyOFT is IComposableOFTCoreUpgradeable {\\n function getProxyOFTOf(uint16 chainId_) external view returns (address _proxyOFT);\\n}\\n\",\"keccak256\":\"0x4041a90eb60de460c9e1631aaedfbf2bff2275b3f91964800b1c774546931cd5\",\"license\":\"MIT\"},\"contracts/interfaces/IQuoter.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./IPoolRegistry.sol\\\";\\nimport \\\"./IProxyOFT.sol\\\";\\n\\ninterface IQuoter {\\n function quoteCrossChainFlashRepayNativeFee(\\n IProxyOFT proxyOFT_,\\n bytes calldata lzArgs_\\n ) external view returns (uint256 _nativeFee);\\n\\n function quoteCrossChainLeverageNativeFee(\\n IProxyOFT proxyOFT_,\\n bytes calldata lzArgs_\\n ) external view returns (uint256 _nativeFee);\\n\\n function quoteLeverageCallbackNativeFee(uint16 dstChainId_) external view returns (uint256 _callbackTxNativeFee);\\n\\n function quoteFlashRepayCallbackNativeFee(uint16 dstChainId_) external view returns (uint256 _callbackTxNativeFee);\\n\\n function getFlashRepaySwapAndCallbackLzArgs(\\n uint16 srcChainId_,\\n uint16 dstChainId_\\n ) external view returns (bytes memory lzArgs_);\\n\\n function getLeverageSwapAndCallbackLzArgs(\\n uint16 srcChainId_,\\n uint16 dstChainId_\\n ) external view returns (bytes memory lzArgs_);\\n}\\n\",\"keccak256\":\"0x1e4d2dd779a09dc8ea6b6c244b167deddca3a48e71b73bf940da04113b40c752\",\"license\":\"MIT\"},\"contracts/interfaces/ISyntheticToken.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/openzeppelin/token/ERC20/extensions/IERC20Metadata.sol\\\";\\nimport \\\"./IDebtToken.sol\\\";\\nimport \\\"./IPoolRegistry.sol\\\";\\nimport \\\"../interfaces/IProxyOFT.sol\\\";\\n\\ninterface ISyntheticToken is IERC20Metadata {\\n function isActive() external view returns (bool);\\n\\n function mint(address to_, uint256 amount_) external;\\n\\n function burn(address from_, uint256 amount) external;\\n\\n function poolRegistry() external view returns (IPoolRegistry);\\n\\n function toggleIsActive() external;\\n\\n function seize(address from_, address to_, uint256 amount_) external;\\n\\n function updateMaxTotalSupply(uint256 newMaxTotalSupply_) external;\\n\\n function updateProxyOFT(IProxyOFT newProxyOFT_) external;\\n\\n function maxTotalSupply() external view returns (uint256);\\n\\n function proxyOFT() external view returns (IProxyOFT);\\n}\\n\",\"keccak256\":\"0xfaeb24d1067e85493a5c8818d6de06fc6dbc72c37e85f82811990d0120f8a0cf\",\"license\":\"MIT\"},\"contracts/interfaces/external/IMasterOracle.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\ninterface IMasterOracle {\\n function quoteTokenToUsd(address _asset, uint256 _amount) external view returns (uint256 _amountInUsd);\\n\\n function quoteUsdToToken(address _asset, uint256 _amountInUsd) external view returns (uint256 _amount);\\n\\n function quote(address _assetIn, address _assetOut, uint256 _amountIn) external view returns (uint256 _amountOut);\\n}\\n\",\"keccak256\":\"0x2f080adc5880151dc4446ef43b54abab8e3711c5f2e526917ef39a05e3c16a00\",\"license\":\"MIT\"},\"contracts/interfaces/external/ISwapper.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\ninterface ISwapper {\\n function swapExactInput(\\n address tokenIn_,\\n address tokenOut_,\\n uint256 amountIn_,\\n uint256 amountOutMin_,\\n address receiver_\\n ) external returns (uint256 _amountOut);\\n}\\n\",\"keccak256\":\"0x75f04b225d0c310be7e0a09ee4c1aa6eeeb8d94e02fc0e4160a9597ce2d8d446\",\"license\":\"MIT\"},\"contracts/storage/ProxyOFTStorage.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../interfaces/ISyntheticToken.sol\\\";\\nimport \\\"../interfaces/IProxyOFT.sol\\\";\\n\\nabstract contract ProxyOFTStorageV1 is IProxyOFT {\\n /**\\n * @notice The synthetic token contract\\n */\\n ISyntheticToken internal syntheticToken;\\n}\\n\",\"keccak256\":\"0x5042de3c712800cbd66633bd9ec331a26f795ea18dbef3addee69ce27c32e80c\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60806040523480156200001157600080fd5b506200001c62000022565b62000152565b6200002e60ff62000031565b50565b60008054610100900460ff1615620000ca578160ff1660011480156200006a575062000068306200014360201b620023b31760201c565b155b620000c25760405162461bcd60e51b815260206004820152602e602482015260008051602062004a6483398151915260448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b506000919050565b60005460ff808416911610620001295760405162461bcd60e51b815260206004820152602e602482015260008051602062004a6483398151915260448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401620000b9565b506000805460ff191660ff92909216919091179055600190565b6001600160a01b03163b151590565b61490280620001626000396000f3fe6080604052600436106102665760003560e01c8063950c8a7411610144578063df2a5b3b116100b6578063ed629c5c1161007a578063ed629c5c146107a1578063f2fde38b146107bb578063f5ecbdbc146107db578063fc0c546a146107fb578063ff0454e21461081a578063ffa1ad741461083a57600080fd5b8063df2a5b3b14610719578063e6a20ae614610739578063e7f0c59f1461074e578063eab45d9c14610761578063eb8d72b71461078157600080fd5b8063c223533a11610108578063c223533a14610670578063c446183414610690578063c8598dca146106a6578063cbed8b9c146106c6578063cfd6528e146106e6578063d1deba1f1461070657600080fd5b8063950c8a74146105d05780639f38369a146105f0578063a6c3d16514610610578063b353aaa714610630578063baf3292d1461065057600080fd5b80634c42899a116101dd57806366ad5c8a116101a157806366ad5c8a146104f4578063715018a6146105145780637533d788146105295780638cfd8f5c146105565780638da5cb5b1461058e5780639358928b146105bb57600080fd5b80634c42899a14610407578063519056361461042f5780635823f91b146104425780635b8c41e6146104555780636096cc58146104a457600080fd5b80632a205e3d1161022f5780632a205e3d146103225780633d8b38f6146103575780633f1f4fa41461037757806342d65a8d146103b257806344770515146103d2578063485cc955146103e757600080fd5b80621d35671461026b57806301ffc9a71461028d57806307e0db17146102c25780630df37483146102e257806310ddb13714610302575b600080fd5b34801561027757600080fd5b5061028b610286366004613693565b61086b565b005b34801561029957600080fd5b506102ad6102a8366004613729565b610a87565b60405190151581526020015b60405180910390f35b3480156102ce57600080fd5b5061028b6102dd366004613753565b610ab2565b3480156102ee57600080fd5b5061028b6102fd366004613770565b610b46565b34801561030e57600080fd5b5061028b61031d366004613753565b610b8c565b34801561032e57600080fd5b5061034261033d3660046137b5565b610bef565b604080519283526020830191909152016102b9565b34801561036357600080fd5b506102ad610372366004613855565b610cb4565b34801561038357600080fd5b506103a4610392366004613753565b60686020526000908152604090205481565b6040519081526020016102b9565b3480156103be57600080fd5b5061028b6103cd366004613855565b610d80565b3480156103de57600080fd5b506103a4600081565b3480156103f357600080fd5b5061028b6104023660046138c9565b610e11565b34801561041357600080fd5b5061041c600081565b60405161ffff90911681526020016102b9565b61028b61043d366004613902565b610ef4565b61028b6104503660046139cb565b610f79565b34801561046157600080fd5b506103a4610470366004613a89565b6097602090815260009384526040808520845180860184018051928152908401958401959095209452929052825290205481565b3480156104b057600080fd5b506103a46104bf366004613a89565b61012d602090815260009384526040808520845180860184018051928152908401958401959095209452929052825290205481565b34801561050057600080fd5b5061028b61050f366004613693565b611145565b34801561052057600080fd5b5061028b611221565b34801561053557600080fd5b50610549610544366004613753565b611254565b6040516102b99190613b87565b34801561056257600080fd5b506103a4610571366004613b9a565b606760209081526000928352604080842090915290825290205481565b34801561059a57600080fd5b506105a36112ee565b6040516001600160a01b0390911681526020016102b9565b3480156105c757600080fd5b506103a46113e1565b3480156105dc57600080fd5b506069546105a3906001600160a01b031681565b3480156105fc57600080fd5b5061054961060b366004613753565b61145f565b34801561061c57600080fd5b5061028b61062b366004613855565b611576565b34801561063c57600080fd5b506065546105a3906001600160a01b031681565b34801561065c57600080fd5b5061028b61066b366004613bc8565b611623565b34801561067c57600080fd5b506103a461068b366004613be5565b6116a7565b34801561069c57600080fd5b506103a461271081565b3480156106b257600080fd5b506103426106c1366004613c26565b6118ec565b3480156106d257600080fd5b5061028b6106e1366004613d04565b6119ed565b3480156106f257600080fd5b5061028b610701366004613d76565b611a82565b61028b610714366004613693565b611cca565b34801561072557600080fd5b5061028b610734366004613e30565b611ee0565b34801561074557600080fd5b5061041c600181565b61028b61075c366004613e60565b611fb9565b34801561076d57600080fd5b5061028b61077c366004613f69565b612170565b34801561078d57600080fd5b5061028b61079c366004613855565b6121e0565b3480156107ad57600080fd5b5060fb546102ad9060ff1681565b3480156107c757600080fd5b5061028b6107d6366004613bc8565b611221565b3480156107e757600080fd5b506105496107f6366004613f86565b612261565b34801561080757600080fd5b5061015f546001600160a01b03166105a3565b34801561082657600080fd5b506105a3610835366004613753565b612303565b34801561084657600080fd5b50610549604051806040016040528060058152602001640312e332e360dc1b81525081565b6065546001600160a01b0316336001600160a01b0316146108d35760405162461bcd60e51b815260206004820152601e60248201527f4c7a4170703a20696e76616c696420656e64706f696e742063616c6c6572000060448201526064015b60405180910390fd5b61ffff8616600090815260666020526040812080546108f190613fa7565b80601f016020809104026020016040519081016040528092919081815260200182805461091d90613fa7565b801561096a5780601f1061093f5761010080835404028352916020019161096a565b820191906000526020600020905b81548152906001019060200180831161094d57829003601f168201915b50505050509050805186869050148015610985575060008151115b80156109ad5750805160208201206040516109a39088908890613fe2565b6040518091039020145b610a085760405162461bcd60e51b815260206004820152602660248201527f4c7a4170703a20696e76616c696420736f757263652073656e64696e6720636f6044820152651b9d1c9858dd60d21b60648201526084016108ca565b610a7e8787878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8a018190048102820181019092528881528a9350915088908890819084018382808284376000920191909152506123c292505050565b50505050505050565b60006001600160e01b0319821663e07f1adb60e01b1480610aac5750610aac8261243b565b92915050565b33610abb6112ee565b6001600160a01b031614610ae15760405162461bcd60e51b81526004016108ca90613ff2565b6065546040516307e0db1760e01b815261ffff831660048201526001600160a01b03909116906307e0db17906024015b600060405180830381600087803b158015610b2b57600080fd5b505af1158015610b3f573d6000803e3d6000fd5b5050505050565b33610b4f6112ee565b6001600160a01b031614610b755760405162461bcd60e51b81526004016108ca90613ff2565b61ffff909116600090815260686020526040902055565b33610b956112ee565b6001600160a01b031614610bbb5760405162461bcd60e51b81526004016108ca90613ff2565b6065546040516310ddb13760e01b815261ffff831660048201526001600160a01b03909116906310ddb13790602401610b11565b600080600080898989604051602001610c0b9493929190614050565b60408051601f198184030181529082905260655463040a7bb160e41b83529092506001600160a01b0316906340a7bb1090610c54908d90309086908c908c908c9060040161407f565b604080518083038186803b158015610c6b57600080fd5b505afa158015610c7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ca391906140d5565b925092505097509795505050505050565b61ffff831660009081526066602052604081208054829190610cd590613fa7565b80601f0160208091040260200160405190810160405280929190818152602001828054610d0190613fa7565b8015610d4e5780601f10610d2357610100808354040283529160200191610d4e565b820191906000526020600020905b815481529060010190602001808311610d3157829003601f168201915b505050505090508383604051610d65929190613fe2565b60405180910390208180519060200120149150509392505050565b33610d896112ee565b6001600160a01b031614610daf5760405162461bcd60e51b81526004016108ca90613ff2565b6065546040516342d65a8d60e01b81526001600160a01b03909116906342d65a8d90610de3908690869086906004016140f9565b600060405180830381600087803b158015610dfd57600080fd5b505af1158015610a7e573d6000803e3d6000fd5b6000610e1d6001612470565b90508015610e35576000805461ff0019166101001790555b6001600160a01b038216610e5c5760405163fb7566d760e01b815260040160405180910390fd5b6001600160a01b038316610e835760405163fb7566d760e01b815260040160405180910390fd5b610e8c836124fd565b61015f80546001600160a01b0319166001600160a01b0384161790558015610eef576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15b505050565b610f6e898989898080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8a018190048102820181019092528881528c93508b92508a918a908a908190840183828082843760009201919091525061253092505050565b505050505050505050565b61113f848484604051602001610f8f9190614117565b60405160208183030381529060405284886000600161015f60009054906101000a90046001600160a01b03166001600160a01b031663afcff50f6040518163ffffffff1660e01b815260040160206040518083038186803b158015610ff357600080fd5b505afa158015611007573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061102b9190614134565b6001600160a01b03166332c615b46040518163ffffffff1660e01b815260040160206040518083038186803b15801561106357600080fd5b505afa158015611077573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061109b9190614134565b6001600160a01b0316636c77d24f6040518163ffffffff1660e01b815260040160206040518083038186803b1580156110d357600080fd5b505afa1580156110e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061110b9190614151565b60405160f09290921b6001600160f01b03191660208301526022820152604201604051602081830303815290604052612530565b50505050565b3330146111a35760405162461bcd60e51b815260206004820152602660248201527f4e6f6e626c6f636b696e674c7a4170703a2063616c6c6572206d7573742062656044820152650204c7a4170760d41b60648201526084016108ca565b6112198686868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8901819004810282018101909252878152899350915087908790819084018382808284376000920191909152506125d792505050565b505050505050565b60405162461bcd60e51b8152602060048201526008602482015267191a5cd8589b195960c21b60448201526064016108ca565b6066602052600090815260409020805461126d90613fa7565b80601f016020809104026020016040519081016040528092919081815260200182805461129990613fa7565b80156112e65780601f106112bb576101008083540402835291602001916112e6565b820191906000526020600020905b8154815290600101906020018083116112c957829003601f168201915b505050505081565b61015f546040805163afcff50f60e01b815290516000926001600160a01b03169163afcff50f916004808301926020929190829003018186803b15801561133457600080fd5b505afa158015611348573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061136c9190614134565b6001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b1580156113a457600080fd5b505afa1580156113b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113dc9190614134565b905090565b61015f54604080516318160ddd60e01b815290516000926001600160a01b0316916318160ddd916004808301926020929190829003018186803b15801561142757600080fd5b505afa15801561143b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113dc9190614151565b61ffff811660009081526066602052604081208054606092919061148290613fa7565b80601f01602080910402602001604051908101604052809291908181526020018280546114ae90613fa7565b80156114fb5780601f106114d0576101008083540402835291602001916114fb565b820191906000526020600020905b8154815290600101906020018083116114de57829003601f168201915b505050505090508051600014156115545760405162461bcd60e51b815260206004820152601d60248201527f4c7a4170703a206e6f20747275737465642070617468207265636f726400000060448201526064016108ca565b61156f6000601483516115679190614180565b839190612666565b9392505050565b3361157f6112ee565b6001600160a01b0316146115a55760405162461bcd60e51b81526004016108ca90613ff2565b8181306040516020016115ba93929190614197565b60408051601f1981840301815291815261ffff851660009081526066602090815291902082516115ef93919290910190613503565b507f8c0400cfe2d1199b1a725c78960bcc2a344d869b80590d0f2bd005db15a572ce838383604051610ee6939291906140f9565b3361162c6112ee565b6001600160a01b0316146116525760405162461bcd60e51b81526004016108ca90613ff2565b606980546001600160a01b0319166001600160a01b0383169081179091556040519081527f5db758e995a17ec1ad84bdef7e8c3293a0bd6179bcce400dff5d4c3d87db726b906020015b60405180910390a150565b6000306001600160a01b0316632a205e3d85856040516020016116ca9190614117565b604051602081830303815290604052856000600161015f60009054906101000a90046001600160a01b03166001600160a01b031663afcff50f6040518163ffffffff1660e01b815260040160206040518083038186803b15801561172d57600080fd5b505afa158015611741573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117659190614134565b6001600160a01b03166332c615b46040518163ffffffff1660e01b815260040160206040518083038186803b15801561179d57600080fd5b505afa1580156117b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117d59190614134565b6001600160a01b0316636c77d24f6040518163ffffffff1660e01b815260040160206040518083038186803b15801561180d57600080fd5b505afa158015611821573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118459190614151565b60405160f09290921b6001600160f01b031916602083015260228201526042016040516020818303038152906040526040518663ffffffff1660e01b81526004016118949594939291906141bd565b604080518083038186803b1580156118ab57600080fd5b505afa1580156118bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118e391906140d5565b50949350505050565b60008060006001336040516020016119049190614117565b60408051601f198184030181529082905261192e92918f908f908f908f908f908f90602001614206565b6040516020818303038152906040529050606560009054906101000a90046001600160a01b03166001600160a01b03166340a7bb108e30848a8a8a6040518763ffffffff1660e01b815260040161198a9695949392919061407f565b604080518083038186803b1580156119a157600080fd5b505afa1580156119b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119d991906140d5565b92509250509a509a98505050505050505050565b336119f66112ee565b6001600160a01b031614611a1c5760405162461bcd60e51b81526004016108ca90613ff2565b6065546040516332fb62e760e21b81526001600160a01b039091169063cbed8b9c90611a549088908890889088908890600401614270565b600060405180830381600087803b158015611a6e57600080fd5b505af1158015610f6e573d6000803e3d6000fd5b61ffff8a16600090815261012d60205260408082209051611aa6908c908c90613fe2565b90815260408051602092819003830190206001600160401b038b1660009081529252902054905080611b305760405162461bcd60e51b815260206004820152602d60248201527f436f6d706f7361626c654f4654436f72653a206e6f206661696c6564206d657360448201526c7361676520746f20726574727960981b60648201526084016108ca565b6000878787878787604051602001611b4d969594939291906142a9565b604051602081830303815290604052805190602001209050818114611bcc5760405162461bcd60e51b815260206004820152602f60248201527f436f6d706f7361626c654f4654436f72653a206661696c6564206d657373616760448201526e0ca40d0c2e6d040dad2e6dac2e8c6d608b1b60648201526084016108ca565b61ffff8c16600090815261012d6020526040908190209051611bf1908d908d90613fe2565b9081526040805191829003602090810183206001600160401b038d16600090815291529081205563147a7d7160e01b81526001600160a01b0387169063147a7d7190611c51908f908f908f908f908f908f908e908e908e906004016142e6565b600060405180830381600087803b158015611c6b57600080fd5b505af1158015611c7f573d6000803e3d6000fd5b505050507f41ea88d75e53240e2c5ace3a3d7263efe6c8f4fe42c0e3ef269f71daef1001c881604051611cb491815260200190565b60405180910390a1505050505050505050505050565b61ffff86166000908152609760205260408082209051611ced9088908890613fe2565b90815260408051602092819003830190206001600160401b03871660009081529252902054905080611d6d5760405162461bcd60e51b815260206004820152602360248201527f4e6f6e626c6f636b696e674c7a4170703a206e6f2073746f726564206d65737360448201526261676560e81b60648201526084016108ca565b808383604051611d7e929190613fe2565b604051809103902014611ddd5760405162461bcd60e51b815260206004820152602160248201527f4e6f6e626c6f636b696e674c7a4170703a20696e76616c6964207061796c6f616044820152601960fa1b60648201526084016108ca565b61ffff87166000908152609760205260408082209051611e009089908990613fe2565b90815260408051602092819003830181206001600160401b038916600090815290845282902093909355601f88018290048202830182019052868252611e98918991899089908190840183828082843760009201919091525050604080516020601f8a018190048102820181019092528881528a9350915088908890819084018382808284376000920191909152506125d792505050565b7fc264d91f3adc5588250e1551f547752ca0cfa8f6b530d243b9f9f4cab10ea8e58787878785604051611ecf959493929190614351565b60405180910390a150505050505050565b33611ee96112ee565b6001600160a01b031614611f0f5760405162461bcd60e51b81526004016108ca90613ff2565b60008111611f575760405162461bcd60e51b81526020600482015260156024820152744c7a4170703a20696e76616c6964206d696e47617360581b60448201526064016108ca565b61ffff83811660008181526067602090815260408083209487168084529482529182902085905581519283528201929092529081018290527f9d5c7c0b934da8fefa9c7760c98383778a12dfbfc0c3b3106518f43fb9508ac090606001610ee6565b61015f60009054906101000a90046001600160a01b03166001600160a01b031663afcff50f6040518163ffffffff1660e01b815260040160206040518083038186803b15801561200857600080fd5b505afa15801561201c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120409190614134565b6001600160a01b03166332c615b46040518163ffffffff1660e01b815260040160206040518083038186803b15801561207857600080fd5b505afa15801561208c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120b09190614134565b6001600160a01b0316336001600160a01b0316146120e157604051632b78ce1b60e11b815260040160405180910390fd5b6121628c8c8c8c8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8a018190048102820181019092528881528f93508e92508d918d918d918d91908d908d908190840183828082843760009201919091525061277392505050565b505050505050505050505050565b336121796112ee565b6001600160a01b03161461219f5760405162461bcd60e51b81526004016108ca90613ff2565b60fb805460ff19168215159081179091556040519081527f1584ad594a70cbe1e6515592e1272a987d922b097ead875069cebe8b40c004a49060200161169c565b336121e96112ee565b6001600160a01b03161461220f5760405162461bcd60e51b81526004016108ca90613ff2565b61ffff8316600090815260666020526040902061222d908383613587565b507ffa41487ad5d6728f0b19276fa1eddc16558578f5109fc39d2dc33c3230470dab838383604051610ee6939291906140f9565b606554604051633d7b2f6f60e21b815261ffff808716600483015285166024820152306044820152606481018390526060916001600160a01b03169063f5ecbdbc9060840160006040518083038186803b1580156122be57600080fd5b505afa1580156122d2573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526122fa91908101906143d9565b95945050505050565b61ffff811660009081526066602052604081208054610aac91839161232790613fa7565b80601f016020809104026020016040519081016040528092919081815260200182805461235390613fa7565b80156123a05780601f10612375576101008083540402835291602001916123a0565b820191906000526020600020905b81548152906001019060200180831161238357829003601f168201915b505050505061284b90919063ffffffff16565b6001600160a01b03163b151590565b6000806124255a60966366ad5c8a60e01b898989896040516024016123ea949392919061440d565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152309291906128b0565b915091508161121957611219868686868561293a565b60006001600160e01b03198216630a72677560e11b1480610aac57506301ffc9a760e01b6001600160e01b0319831614610aac565b60008054610100900460ff16156124b7578160ff1660011480156124935750303b155b6124af5760405162461bcd60e51b81526004016108ca9061444b565b506000919050565b60005460ff8084169116106124de5760405162461bcd60e51b81526004016108ca9061444b565b506000805460ff191660ff92909216919091179055600190565b919050565b600054610100900460ff166125245760405162461bcd60e51b81526004016108ca90614499565b61252d816129d7565b50565b61253e866000836000612a0f565b600061254c88888888612a89565b90506000808783604051602001612565939291906144e4565b6040516020818303038152906040529050612584888287878734612d45565b886001600160a01b03168861ffff167f39a4c66499bcf4b56d79f0dde8ed7a9d4925a0df55825206b2b8531e202be0d089856040516125c4929190614511565b60405180910390a3505050505050505050565b602081015161ffff81166125f6576125f185858585612ec1565b610b3f565b61ffff81166001141561260f576125f185858585612f4b565b60405162461bcd60e51b815260206004820152602660248201527f436f6d706f7361626c654f4654436f72653a20756e6b6e6f776e207061636b6560448201526574207479706560d01b60648201526084016108ca565b60608161267481601f614533565b10156126b35760405162461bcd60e51b815260206004820152600e60248201526d736c6963655f6f766572666c6f7760901b60448201526064016108ca565b6126bd8284614533565b845110156127015760405162461bcd60e51b8152602060048201526011602482015270736c6963655f6f75744f66426f756e647360781b60448201526064016108ca565b60608215801561272057604051915060008252602082016040526118e3565b6040519150601f8416801560200281840101858101878315602002848b0101015b81831015612759578051835260209283019201612741565b5050858452601f01601f1916604052505090509392505050565b61278989600183876001600160401b0316612a0f565b60006127978b8b8b8b612a89565b905060006001336040516020016127ae9190614117565b60408051601f19818403018152908290526127d692918d9086908d908d908d9060200161454b565b60405160208183030381529060405290506127f58b8287878734612d45565b8b6001600160a01b03168b61ffff167f39a4c66499bcf4b56d79f0dde8ed7a9d4925a0df55825206b2b8531e202be0d08c85604051612835929190614511565b60405180910390a3505050505050505050505050565b6000612858826014614533565b835110156128a05760405162461bcd60e51b8152602060048201526015602482015274746f416464726573735f6f75744f66426f756e647360581b60448201526064016108ca565b500160200151600160601b900490565b6000606060008060008661ffff166001600160401b038111156128d5576128d5613a1c565b6040519080825280601f01601f1916602001820160405280156128ff576020820181803683370190505b50905060008087516020890160008d8df191503d925086831115612921578692505b828152826000602083013e909890975095505050505050565b8180519060200120609760008761ffff1661ffff1681526020019081526020016000208560405161296b91906145b3565b9081526040805191829003602090810183206001600160401b0388166000908152915220919091557fe183f33de2837795525b4792ca4cd60535bd77c53b7e7030060bfcf5734d6b0c906129c890879087908790879087906145cf565b60405180910390a15050505050565b600054610100900460ff166129fe5760405162461bcd60e51b81526004016108ca90614499565b612a0661305a565b61252d8161308c565b60fb5460ff1615612a2b57612a26848484846130d5565b61113f565b81511561113f5760405162461bcd60e51b815260206004820152602660248201527f4f4654436f72653a205f61646170746572506172616d73206d7573742062652060448201526532b6b83a3c9760d11b60648201526084016108ca565b60008061015f60009054906101000a90046001600160a01b03166001600160a01b031663afcff50f6040518163ffffffff1660e01b815260040160206040518083038186803b158015612adb57600080fd5b505afa158015612aef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b139190614134565b6001600160a01b03166332c615b46040518163ffffffff1660e01b815260040160206040518083038186803b158015612b4b57600080fd5b505afa158015612b5f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b839190614134565b9050336001600160a01b03871614612bae576040516311fbe4a960e01b815260040160405180910390fd5b806001600160a01b0316632b80cc526040518163ffffffff1660e01b815260040160206040518083038186803b158015612be757600080fd5b505afa158015612bfb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c1f9190614621565b612c3c57604051635621fccf60e01b815260040160405180910390fd5b6040516338d266a960e21b815261ffff861660048201526001600160a01b0382169063e3499aa49060240160206040518083038186803b158015612c7f57600080fd5b505afa158015612c93573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612cb79190614621565b612cd45760405163334dc1fd60e01b815260040160405180910390fd5b61015f54604051632770a7eb60e21b81526001600160a01b0388811660048301526024820186905290911690639dc29fac90604401600060405180830381600087803b158015612d2357600080fd5b505af1158015612d37573d6000803e3d6000fd5b509498975050505050505050565b61ffff861660009081526066602052604081208054612d6390613fa7565b80601f0160208091040260200160405190810160405280929190818152602001828054612d8f90613fa7565b8015612ddc5780601f10612db157610100808354040283529160200191612ddc565b820191906000526020600020905b815481529060010190602001808311612dbf57829003601f168201915b50505050509050805160001415612e4e5760405162461bcd60e51b815260206004820152603060248201527f4c7a4170703a2064657374696e6174696f6e20636861696e206973206e6f742060448201526f61207472757374656420736f7572636560801b60648201526084016108ca565b612e598787516131b4565b60655460405162c5803160e81b81526001600160a01b039091169063c5803100908490612e94908b9086908c908c908c908c9060040161463e565b6000604051808303818588803b158015612ead57600080fd5b505af1158015612162573d6000803e3d6000fd5b60008082806020019051810190612ed89190614698565b909350915060009050612eeb838261284b565b9050612ef8878284613222565b9150806001600160a01b03168761ffff167fbf551ec93859b170f9b2141bd9298bf3f64322c6f7beb2543a0cb669834118bf84604051612f3a91815260200190565b60405180910390a350505050505050565b600080600080600085806020019051810190612f6791906146f1565b95509550955095509550506000612f8860008661284b90919063ffffffff16565b9050612f958a8286613222565b9350806001600160a01b03168a61ffff167fbf551ec93859b170f9b2141bd9298bf3f64322c6f7beb2543a0cb669834118bf86604051612fd791815260200190565b60405180910390a36001600160a01b0381163b613035576040516001600160a01b03821681527f9aedf5fdba8716db3b6705ca00150643309995d4f818a249ed6dde6677e7792d9060200160405180910390a150505050505061113f565b61304e8a8a8a89858989896001600160401b0316613292565b50505050505050505050565b600054610100900460ff166130815760405162461bcd60e51b81526004016108ca90614499565b61308a33613455565b565b600054610100900460ff166130b35760405162461bcd60e51b81526004016108ca90614499565b606580546001600160a01b0319166001600160a01b0392909216919091179055565b60006130e0836134a7565b61ffff808716600090815260676020908152604080832093891683529290529081205491925090613112908490614533565b9050600081116131645760405162461bcd60e51b815260206004820152601a60248201527f4c7a4170703a206d696e4761734c696d6974206e6f742073657400000000000060448201526064016108ca565b808210156112195760405162461bcd60e51b815260206004820152601b60248201527f4c7a4170703a20676173206c696d697420697320746f6f206c6f77000000000060448201526064016108ca565b61ffff8216600090815260686020526040902054806131d257506127105b80821115610eef5760405162461bcd60e51b815260206004820181905260248201527f4c7a4170703a207061796c6f61642073697a6520697320746f6f206c6172676560448201526064016108ca565b61015f546040516340c10f1960e01b81526001600160a01b0384811660048301526024820184905260009216906340c10f1990604401600060405180830381600087803b15801561327257600080fd5b505af1158015613286573d6000803e3d6000fd5b50939695505050505050565b60008061330283609663147a7d7160e01b8d8d8d8d8c8c6040516024016132be969594939291906147a9565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526001600160a01b038a169291906128b0565b91509150816133d757868686866040516020016133229493929190614801565b60408051601f19818403018152828252805160209182012061ffff8e16600090815261012d909252919020909161335a908c906145b3565b9081526040805191829003602090810183206001600160401b038d166000908152915220919091556001600160a01b0387169061ffff8c16907f95c1ad3ef50dd05e668d7b80e9a723079395ac4867a4050552d5d9219e683d74906133ca908d908d908d908c908c908a9061483c565b60405180910390a361304e565b6000878787876040516020016133f09493929190614801565b6040516020818303038152906040528051906020012090508a61ffff167fb8890edbfc1c74692f527444645f95489c3703cc2df42e4a366f5d06fa6cd8848b8b846040516134409392919061489e565b60405180910390a25050505050505050505050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60006022825110156134fb5760405162461bcd60e51b815260206004820152601c60248201527f4c7a4170703a20696e76616c69642061646170746572506172616d730000000060448201526064016108ca565b506022015190565b82805461350f90613fa7565b90600052602060002090601f0160209004810192826135315760008555613577565b82601f1061354a57805160ff1916838001178555613577565b82800160010185558215613577579182015b8281111561357757825182559160200191906001019061355c565b506135839291506135fb565b5090565b82805461359390613fa7565b90600052602060002090601f0160209004810192826135b55760008555613577565b82601f106135ce5782800160ff19823516178555613577565b82800160010185558215613577579182015b828111156135775782358255916020019190600101906135e0565b5b8082111561358357600081556001016135fc565b61ffff8116811461252d57600080fd5b80356124f881613610565b60008083601f84011261363d57600080fd5b5081356001600160401b0381111561365457600080fd5b60208301915083602082850101111561366c57600080fd5b9250929050565b6001600160401b038116811461252d57600080fd5b80356124f881613673565b600080600080600080608087890312156136ac57600080fd5b86356136b781613610565b955060208701356001600160401b03808211156136d357600080fd5b6136df8a838b0161362b565b9097509550604089013591506136f482613673565b9093506060880135908082111561370a57600080fd5b5061371789828a0161362b565b979a9699509497509295939492505050565b60006020828403121561373b57600080fd5b81356001600160e01b03198116811461156f57600080fd5b60006020828403121561376557600080fd5b813561156f81613610565b6000806040838503121561378357600080fd5b823561378e81613610565b946020939093013593505050565b801515811461252d57600080fd5b80356124f88161379c565b600080600080600080600060a0888a0312156137d057600080fd5b87356137db81613610565b965060208801356001600160401b03808211156137f757600080fd5b6138038b838c0161362b565b909850965060408a0135955060608a0135915061381f8261379c565b9093506080890135908082111561383557600080fd5b506138428a828b0161362b565b989b979a50959850939692959293505050565b60008060006040848603121561386a57600080fd5b833561387581613610565b925060208401356001600160401b0381111561389057600080fd5b61389c8682870161362b565b9497909650939450505050565b6001600160a01b038116811461252d57600080fd5b80356124f8816138a9565b600080604083850312156138dc57600080fd5b82356138e7816138a9565b915060208301356138f7816138a9565b809150509250929050565b600080600080600080600080600060e08a8c03121561392057600080fd5b893561392b816138a9565b985060208a013561393b81613610565b975060408a01356001600160401b038082111561395757600080fd5b6139638d838e0161362b565b909950975060608c0135965060808c0135915061397f826138a9565b90945060a08b013590613991826138a9565b90935060c08b013590808211156139a757600080fd5b506139b48c828d0161362b565b915080935050809150509295985092959850929598565b600080600080608085870312156139e157600080fd5b84356139ec816138a9565b935060208501356139fc81613610565b92506040850135613a0c816138a9565b9396929550929360600135925050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715613a5a57613a5a613a1c565b604052919050565b60006001600160401b03821115613a7b57613a7b613a1c565b50601f01601f191660200190565b600080600060608486031215613a9e57600080fd5b8335613aa981613610565b925060208401356001600160401b03811115613ac457600080fd5b8401601f81018613613ad557600080fd5b8035613ae8613ae382613a62565b613a32565b818152876020838501011115613afd57600080fd5b816020840160208301376000602083830101528094505050506040840135613b2481613673565b809150509250925092565b60005b83811015613b4a578181015183820152602001613b32565b8381111561113f5750506000910152565b60008151808452613b73816020860160208601613b2f565b601f01601f19169290920160200192915050565b60208152600061156f6020830184613b5b565b60008060408385031215613bad57600080fd5b8235613bb881613610565b915060208301356138f781613610565b600060208284031215613bda57600080fd5b813561156f816138a9565b600080600060608486031215613bfa57600080fd5b8335613c0581613610565b92506020840135613c15816138a9565b929592945050506040919091013590565b60008060008060008060008060008060e08b8d031215613c4557600080fd5b8a35613c5081613610565b995060208b01356001600160401b0380821115613c6c57600080fd5b613c788e838f0161362b565b909b50995060408d0135985060608d0135915080821115613c9857600080fd5b613ca48e838f0161362b565b909850965060808d01359150613cb982613673565b819550613cc860a08e016137aa565b945060c08d0135915080821115613cde57600080fd5b50613ceb8d828e0161362b565b915080935050809150509295989b9194979a5092959850565b600080600080600060808688031215613d1c57600080fd5b8535613d2781613610565b94506020860135613d3781613610565b93506040860135925060608601356001600160401b03811115613d5957600080fd5b613d658882890161362b565b969995985093965092949392505050565b60008060008060008060008060008060e08b8d031215613d9557600080fd5b8a35613da081613610565b995060208b01356001600160401b0380821115613dbc57600080fd5b613dc88e838f0161362b565b909b50995060408d01359150613ddd82613673565b90975060608c01359080821115613df357600080fd5b613dff8e838f0161362b565b9098509650869150613e1360808e016138be565b955060a08d0135945060c08d0135915080821115613cde57600080fd5b600080600060608486031215613e4557600080fd5b8335613e5081613610565b92506020840135613c1581613610565b6000806000806000806000806000806000806101208d8f031215613e8357600080fd5b613e8c8d6138be565b9b50613e9a60208e01613620565b9a506001600160401b0360408e01351115613eb457600080fd5b613ec48e60408f01358f0161362b565b909a50985060608d013597506001600160401b0360808e01351115613ee857600080fd5b613ef88e60808f01358f0161362b565b9097509550613f0960a08e01613688565b9450613f1760c08e016138be565b9350613f2560e08e016138be565b92506001600160401b036101008e01351115613f4057600080fd5b613f518e6101008f01358f0161362b565b81935080925050509295989b509295989b509295989b565b600060208284031215613f7b57600080fd5b813561156f8161379c565b60008060008060808587031215613f9c57600080fd5b84356139ec81613610565b600181811c90821680613fbb57607f821691505b60208210811415613fdc57634e487b7160e01b600052602260045260246000fd5b50919050565b8183823760009101908152919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b61ffff8516815260606020820152600061406e606083018587614027565b905082604083015295945050505050565b61ffff871681526001600160a01b038616602082015260a0604082018190526000906140ad90830187613b5b565b851515606084015282810360808401526140c8818587614027565b9998505050505050505050565b600080604083850312156140e857600080fd5b505080516020909101519092909150565b61ffff841681526040602082015260006122fa604083018486614027565b60609190911b6bffffffffffffffffffffffff1916815260140190565b60006020828403121561414657600080fd5b815161156f816138a9565b60006020828403121561416357600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b6000828210156141925761419261416a565b500390565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b61ffff8616815260a0602082015260006141da60a0830187613b5b565b856040840152841515606084015282810360808401526141fa8185613b5b565b98975050505050505050565b61ffff8916815260c06020820152600061422360c083018a613b5b565b828103604084015261423681898b614027565b90508660608401528281036080840152614251818688614027565b9150506001600160401b03831660a08301529998505050505050505050565b600061ffff80881683528087166020840152508460408301526080606083015261429e608083018486614027565b979650505050505050565b6080815260006142bd60808301888a614027565b6001600160a01b03871660208401526040830186905282810360608401526140c8818587614027565b61ffff8a16815260c06020820152600061430460c083018a8c614027565b6001600160401b0389166040840152828103606084015261432681888a614027565b905085608084015282810360a0840152614341818587614027565b9c9b505050505050505050505050565b61ffff8616815260806020820152600061436f608083018688614027565b6001600160401b0394909416604083015250606001529392505050565b600082601f83011261439d57600080fd5b81516143ab613ae382613a62565b8181528460208386010111156143c057600080fd5b6143d1826020830160208701613b2f565b949350505050565b6000602082840312156143eb57600080fd5b81516001600160401b0381111561440157600080fd5b6143d18482850161438c565b61ffff8516815260806020820152600061442a6080830186613b5b565b6001600160401b0385166040840152828103606084015261429e8185613b5b565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b61ffff841681526060602082015260006145016060830185613b5b565b9050826040830152949350505050565b6040815260006145246040830185613b5b565b90508260208301529392505050565b600082198211156145465761454661416a565b500190565b61ffff8816815260c06020820152600061456860c0830189613b5b565b828103604084015261457a8189613b5b565b90508660608401528281036080840152614595818688614027565b9150506001600160401b03831660a083015298975050505050505050565b600082516145c5818460208701613b2f565b9190910192915050565b61ffff8616815260a0602082015260006145ec60a0830187613b5b565b6001600160401b0386166040840152828103606084015261460d8186613b5b565b905082810360808401526141fa8185613b5b565b60006020828403121561463357600080fd5b815161156f8161379c565b61ffff8716815260c06020820152600061465b60c0830188613b5b565b828103604084015261466d8188613b5b565b6001600160a01b0387811660608601528616608085015283810360a085015290506140c88185613b5b565b6000806000606084860312156146ad57600080fd5b83516146b881613610565b60208501519093506001600160401b038111156146d457600080fd5b6146e08682870161438c565b925050604084015190509250925092565b60008060008060008060c0878903121561470a57600080fd5b865161471581613610565b60208801519096506001600160401b038082111561473257600080fd5b61473e8a838b0161438c565b9650604089015191508082111561475457600080fd5b6147608a838b0161438c565b955060608901519450608089015191508082111561477d57600080fd5b5061478a89828a0161438c565b92505060a087015161479b81613673565b809150509295509295509295565b61ffff8716815260c0602082015260006147c660c0830188613b5b565b6001600160401b038716604084015282810360608401526147e78187613b5b565b905084608084015282810360a08401526140c88185613b5b565b6080815260006148146080830187613b5b565b6001600160a01b038616602084015260408301859052828103606084015261429e8185613b5b565b60c08152600061484f60c0830189613b5b565b6001600160401b038816602084015282810360408401526148708188613b5b565b9050856060840152828103608084015261488a8186613b5b565b905082810360a08401526140c88185613b5b565b6060815260006148b16060830186613b5b565b6001600160401b03949094166020830152506040015291905056fea26469706673582212201cea9e1efea156ac443ced363b9a56886a3aaee82de7bc3b0e60cc328bf3975864736f6c63430008090033496e697469616c697a61626c653a20636f6e747261637420697320616c726561", + "deployedBytecode": "0x6080604052600436106102665760003560e01c8063950c8a7411610144578063df2a5b3b116100b6578063ed629c5c1161007a578063ed629c5c146107a1578063f2fde38b146107bb578063f5ecbdbc146107db578063fc0c546a146107fb578063ff0454e21461081a578063ffa1ad741461083a57600080fd5b8063df2a5b3b14610719578063e6a20ae614610739578063e7f0c59f1461074e578063eab45d9c14610761578063eb8d72b71461078157600080fd5b8063c223533a11610108578063c223533a14610670578063c446183414610690578063c8598dca146106a6578063cbed8b9c146106c6578063cfd6528e146106e6578063d1deba1f1461070657600080fd5b8063950c8a74146105d05780639f38369a146105f0578063a6c3d16514610610578063b353aaa714610630578063baf3292d1461065057600080fd5b80634c42899a116101dd57806366ad5c8a116101a157806366ad5c8a146104f4578063715018a6146105145780637533d788146105295780638cfd8f5c146105565780638da5cb5b1461058e5780639358928b146105bb57600080fd5b80634c42899a14610407578063519056361461042f5780635823f91b146104425780635b8c41e6146104555780636096cc58146104a457600080fd5b80632a205e3d1161022f5780632a205e3d146103225780633d8b38f6146103575780633f1f4fa41461037757806342d65a8d146103b257806344770515146103d2578063485cc955146103e757600080fd5b80621d35671461026b57806301ffc9a71461028d57806307e0db17146102c25780630df37483146102e257806310ddb13714610302575b600080fd5b34801561027757600080fd5b5061028b610286366004613693565b61086b565b005b34801561029957600080fd5b506102ad6102a8366004613729565b610a87565b60405190151581526020015b60405180910390f35b3480156102ce57600080fd5b5061028b6102dd366004613753565b610ab2565b3480156102ee57600080fd5b5061028b6102fd366004613770565b610b46565b34801561030e57600080fd5b5061028b61031d366004613753565b610b8c565b34801561032e57600080fd5b5061034261033d3660046137b5565b610bef565b604080519283526020830191909152016102b9565b34801561036357600080fd5b506102ad610372366004613855565b610cb4565b34801561038357600080fd5b506103a4610392366004613753565b60686020526000908152604090205481565b6040519081526020016102b9565b3480156103be57600080fd5b5061028b6103cd366004613855565b610d80565b3480156103de57600080fd5b506103a4600081565b3480156103f357600080fd5b5061028b6104023660046138c9565b610e11565b34801561041357600080fd5b5061041c600081565b60405161ffff90911681526020016102b9565b61028b61043d366004613902565b610ef4565b61028b6104503660046139cb565b610f79565b34801561046157600080fd5b506103a4610470366004613a89565b6097602090815260009384526040808520845180860184018051928152908401958401959095209452929052825290205481565b3480156104b057600080fd5b506103a46104bf366004613a89565b61012d602090815260009384526040808520845180860184018051928152908401958401959095209452929052825290205481565b34801561050057600080fd5b5061028b61050f366004613693565b611145565b34801561052057600080fd5b5061028b611221565b34801561053557600080fd5b50610549610544366004613753565b611254565b6040516102b99190613b87565b34801561056257600080fd5b506103a4610571366004613b9a565b606760209081526000928352604080842090915290825290205481565b34801561059a57600080fd5b506105a36112ee565b6040516001600160a01b0390911681526020016102b9565b3480156105c757600080fd5b506103a46113e1565b3480156105dc57600080fd5b506069546105a3906001600160a01b031681565b3480156105fc57600080fd5b5061054961060b366004613753565b61145f565b34801561061c57600080fd5b5061028b61062b366004613855565b611576565b34801561063c57600080fd5b506065546105a3906001600160a01b031681565b34801561065c57600080fd5b5061028b61066b366004613bc8565b611623565b34801561067c57600080fd5b506103a461068b366004613be5565b6116a7565b34801561069c57600080fd5b506103a461271081565b3480156106b257600080fd5b506103426106c1366004613c26565b6118ec565b3480156106d257600080fd5b5061028b6106e1366004613d04565b6119ed565b3480156106f257600080fd5b5061028b610701366004613d76565b611a82565b61028b610714366004613693565b611cca565b34801561072557600080fd5b5061028b610734366004613e30565b611ee0565b34801561074557600080fd5b5061041c600181565b61028b61075c366004613e60565b611fb9565b34801561076d57600080fd5b5061028b61077c366004613f69565b612170565b34801561078d57600080fd5b5061028b61079c366004613855565b6121e0565b3480156107ad57600080fd5b5060fb546102ad9060ff1681565b3480156107c757600080fd5b5061028b6107d6366004613bc8565b611221565b3480156107e757600080fd5b506105496107f6366004613f86565b612261565b34801561080757600080fd5b5061015f546001600160a01b03166105a3565b34801561082657600080fd5b506105a3610835366004613753565b612303565b34801561084657600080fd5b50610549604051806040016040528060058152602001640312e332e360dc1b81525081565b6065546001600160a01b0316336001600160a01b0316146108d35760405162461bcd60e51b815260206004820152601e60248201527f4c7a4170703a20696e76616c696420656e64706f696e742063616c6c6572000060448201526064015b60405180910390fd5b61ffff8616600090815260666020526040812080546108f190613fa7565b80601f016020809104026020016040519081016040528092919081815260200182805461091d90613fa7565b801561096a5780601f1061093f5761010080835404028352916020019161096a565b820191906000526020600020905b81548152906001019060200180831161094d57829003601f168201915b50505050509050805186869050148015610985575060008151115b80156109ad5750805160208201206040516109a39088908890613fe2565b6040518091039020145b610a085760405162461bcd60e51b815260206004820152602660248201527f4c7a4170703a20696e76616c696420736f757263652073656e64696e6720636f6044820152651b9d1c9858dd60d21b60648201526084016108ca565b610a7e8787878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8a018190048102820181019092528881528a9350915088908890819084018382808284376000920191909152506123c292505050565b50505050505050565b60006001600160e01b0319821663e07f1adb60e01b1480610aac5750610aac8261243b565b92915050565b33610abb6112ee565b6001600160a01b031614610ae15760405162461bcd60e51b81526004016108ca90613ff2565b6065546040516307e0db1760e01b815261ffff831660048201526001600160a01b03909116906307e0db17906024015b600060405180830381600087803b158015610b2b57600080fd5b505af1158015610b3f573d6000803e3d6000fd5b5050505050565b33610b4f6112ee565b6001600160a01b031614610b755760405162461bcd60e51b81526004016108ca90613ff2565b61ffff909116600090815260686020526040902055565b33610b956112ee565b6001600160a01b031614610bbb5760405162461bcd60e51b81526004016108ca90613ff2565b6065546040516310ddb13760e01b815261ffff831660048201526001600160a01b03909116906310ddb13790602401610b11565b600080600080898989604051602001610c0b9493929190614050565b60408051601f198184030181529082905260655463040a7bb160e41b83529092506001600160a01b0316906340a7bb1090610c54908d90309086908c908c908c9060040161407f565b604080518083038186803b158015610c6b57600080fd5b505afa158015610c7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ca391906140d5565b925092505097509795505050505050565b61ffff831660009081526066602052604081208054829190610cd590613fa7565b80601f0160208091040260200160405190810160405280929190818152602001828054610d0190613fa7565b8015610d4e5780601f10610d2357610100808354040283529160200191610d4e565b820191906000526020600020905b815481529060010190602001808311610d3157829003601f168201915b505050505090508383604051610d65929190613fe2565b60405180910390208180519060200120149150509392505050565b33610d896112ee565b6001600160a01b031614610daf5760405162461bcd60e51b81526004016108ca90613ff2565b6065546040516342d65a8d60e01b81526001600160a01b03909116906342d65a8d90610de3908690869086906004016140f9565b600060405180830381600087803b158015610dfd57600080fd5b505af1158015610a7e573d6000803e3d6000fd5b6000610e1d6001612470565b90508015610e35576000805461ff0019166101001790555b6001600160a01b038216610e5c5760405163fb7566d760e01b815260040160405180910390fd5b6001600160a01b038316610e835760405163fb7566d760e01b815260040160405180910390fd5b610e8c836124fd565b61015f80546001600160a01b0319166001600160a01b0384161790558015610eef576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15b505050565b610f6e898989898080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8a018190048102820181019092528881528c93508b92508a918a908a908190840183828082843760009201919091525061253092505050565b505050505050505050565b61113f848484604051602001610f8f9190614117565b60405160208183030381529060405284886000600161015f60009054906101000a90046001600160a01b03166001600160a01b031663afcff50f6040518163ffffffff1660e01b815260040160206040518083038186803b158015610ff357600080fd5b505afa158015611007573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061102b9190614134565b6001600160a01b03166332c615b46040518163ffffffff1660e01b815260040160206040518083038186803b15801561106357600080fd5b505afa158015611077573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061109b9190614134565b6001600160a01b0316636c77d24f6040518163ffffffff1660e01b815260040160206040518083038186803b1580156110d357600080fd5b505afa1580156110e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061110b9190614151565b60405160f09290921b6001600160f01b03191660208301526022820152604201604051602081830303815290604052612530565b50505050565b3330146111a35760405162461bcd60e51b815260206004820152602660248201527f4e6f6e626c6f636b696e674c7a4170703a2063616c6c6572206d7573742062656044820152650204c7a4170760d41b60648201526084016108ca565b6112198686868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8901819004810282018101909252878152899350915087908790819084018382808284376000920191909152506125d792505050565b505050505050565b60405162461bcd60e51b8152602060048201526008602482015267191a5cd8589b195960c21b60448201526064016108ca565b6066602052600090815260409020805461126d90613fa7565b80601f016020809104026020016040519081016040528092919081815260200182805461129990613fa7565b80156112e65780601f106112bb576101008083540402835291602001916112e6565b820191906000526020600020905b8154815290600101906020018083116112c957829003601f168201915b505050505081565b61015f546040805163afcff50f60e01b815290516000926001600160a01b03169163afcff50f916004808301926020929190829003018186803b15801561133457600080fd5b505afa158015611348573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061136c9190614134565b6001600160a01b0316630c340a246040518163ffffffff1660e01b815260040160206040518083038186803b1580156113a457600080fd5b505afa1580156113b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113dc9190614134565b905090565b61015f54604080516318160ddd60e01b815290516000926001600160a01b0316916318160ddd916004808301926020929190829003018186803b15801561142757600080fd5b505afa15801561143b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113dc9190614151565b61ffff811660009081526066602052604081208054606092919061148290613fa7565b80601f01602080910402602001604051908101604052809291908181526020018280546114ae90613fa7565b80156114fb5780601f106114d0576101008083540402835291602001916114fb565b820191906000526020600020905b8154815290600101906020018083116114de57829003601f168201915b505050505090508051600014156115545760405162461bcd60e51b815260206004820152601d60248201527f4c7a4170703a206e6f20747275737465642070617468207265636f726400000060448201526064016108ca565b61156f6000601483516115679190614180565b839190612666565b9392505050565b3361157f6112ee565b6001600160a01b0316146115a55760405162461bcd60e51b81526004016108ca90613ff2565b8181306040516020016115ba93929190614197565b60408051601f1981840301815291815261ffff851660009081526066602090815291902082516115ef93919290910190613503565b507f8c0400cfe2d1199b1a725c78960bcc2a344d869b80590d0f2bd005db15a572ce838383604051610ee6939291906140f9565b3361162c6112ee565b6001600160a01b0316146116525760405162461bcd60e51b81526004016108ca90613ff2565b606980546001600160a01b0319166001600160a01b0383169081179091556040519081527f5db758e995a17ec1ad84bdef7e8c3293a0bd6179bcce400dff5d4c3d87db726b906020015b60405180910390a150565b6000306001600160a01b0316632a205e3d85856040516020016116ca9190614117565b604051602081830303815290604052856000600161015f60009054906101000a90046001600160a01b03166001600160a01b031663afcff50f6040518163ffffffff1660e01b815260040160206040518083038186803b15801561172d57600080fd5b505afa158015611741573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117659190614134565b6001600160a01b03166332c615b46040518163ffffffff1660e01b815260040160206040518083038186803b15801561179d57600080fd5b505afa1580156117b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117d59190614134565b6001600160a01b0316636c77d24f6040518163ffffffff1660e01b815260040160206040518083038186803b15801561180d57600080fd5b505afa158015611821573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118459190614151565b60405160f09290921b6001600160f01b031916602083015260228201526042016040516020818303038152906040526040518663ffffffff1660e01b81526004016118949594939291906141bd565b604080518083038186803b1580156118ab57600080fd5b505afa1580156118bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118e391906140d5565b50949350505050565b60008060006001336040516020016119049190614117565b60408051601f198184030181529082905261192e92918f908f908f908f908f908f90602001614206565b6040516020818303038152906040529050606560009054906101000a90046001600160a01b03166001600160a01b03166340a7bb108e30848a8a8a6040518763ffffffff1660e01b815260040161198a9695949392919061407f565b604080518083038186803b1580156119a157600080fd5b505afa1580156119b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119d991906140d5565b92509250509a509a98505050505050505050565b336119f66112ee565b6001600160a01b031614611a1c5760405162461bcd60e51b81526004016108ca90613ff2565b6065546040516332fb62e760e21b81526001600160a01b039091169063cbed8b9c90611a549088908890889088908890600401614270565b600060405180830381600087803b158015611a6e57600080fd5b505af1158015610f6e573d6000803e3d6000fd5b61ffff8a16600090815261012d60205260408082209051611aa6908c908c90613fe2565b90815260408051602092819003830190206001600160401b038b1660009081529252902054905080611b305760405162461bcd60e51b815260206004820152602d60248201527f436f6d706f7361626c654f4654436f72653a206e6f206661696c6564206d657360448201526c7361676520746f20726574727960981b60648201526084016108ca565b6000878787878787604051602001611b4d969594939291906142a9565b604051602081830303815290604052805190602001209050818114611bcc5760405162461bcd60e51b815260206004820152602f60248201527f436f6d706f7361626c654f4654436f72653a206661696c6564206d657373616760448201526e0ca40d0c2e6d040dad2e6dac2e8c6d608b1b60648201526084016108ca565b61ffff8c16600090815261012d6020526040908190209051611bf1908d908d90613fe2565b9081526040805191829003602090810183206001600160401b038d16600090815291529081205563147a7d7160e01b81526001600160a01b0387169063147a7d7190611c51908f908f908f908f908f908f908e908e908e906004016142e6565b600060405180830381600087803b158015611c6b57600080fd5b505af1158015611c7f573d6000803e3d6000fd5b505050507f41ea88d75e53240e2c5ace3a3d7263efe6c8f4fe42c0e3ef269f71daef1001c881604051611cb491815260200190565b60405180910390a1505050505050505050505050565b61ffff86166000908152609760205260408082209051611ced9088908890613fe2565b90815260408051602092819003830190206001600160401b03871660009081529252902054905080611d6d5760405162461bcd60e51b815260206004820152602360248201527f4e6f6e626c6f636b696e674c7a4170703a206e6f2073746f726564206d65737360448201526261676560e81b60648201526084016108ca565b808383604051611d7e929190613fe2565b604051809103902014611ddd5760405162461bcd60e51b815260206004820152602160248201527f4e6f6e626c6f636b696e674c7a4170703a20696e76616c6964207061796c6f616044820152601960fa1b60648201526084016108ca565b61ffff87166000908152609760205260408082209051611e009089908990613fe2565b90815260408051602092819003830181206001600160401b038916600090815290845282902093909355601f88018290048202830182019052868252611e98918991899089908190840183828082843760009201919091525050604080516020601f8a018190048102820181019092528881528a9350915088908890819084018382808284376000920191909152506125d792505050565b7fc264d91f3adc5588250e1551f547752ca0cfa8f6b530d243b9f9f4cab10ea8e58787878785604051611ecf959493929190614351565b60405180910390a150505050505050565b33611ee96112ee565b6001600160a01b031614611f0f5760405162461bcd60e51b81526004016108ca90613ff2565b60008111611f575760405162461bcd60e51b81526020600482015260156024820152744c7a4170703a20696e76616c6964206d696e47617360581b60448201526064016108ca565b61ffff83811660008181526067602090815260408083209487168084529482529182902085905581519283528201929092529081018290527f9d5c7c0b934da8fefa9c7760c98383778a12dfbfc0c3b3106518f43fb9508ac090606001610ee6565b61015f60009054906101000a90046001600160a01b03166001600160a01b031663afcff50f6040518163ffffffff1660e01b815260040160206040518083038186803b15801561200857600080fd5b505afa15801561201c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120409190614134565b6001600160a01b03166332c615b46040518163ffffffff1660e01b815260040160206040518083038186803b15801561207857600080fd5b505afa15801561208c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120b09190614134565b6001600160a01b0316336001600160a01b0316146120e157604051632b78ce1b60e11b815260040160405180910390fd5b6121628c8c8c8c8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8a018190048102820181019092528881528f93508e92508d918d918d918d91908d908d908190840183828082843760009201919091525061277392505050565b505050505050505050505050565b336121796112ee565b6001600160a01b03161461219f5760405162461bcd60e51b81526004016108ca90613ff2565b60fb805460ff19168215159081179091556040519081527f1584ad594a70cbe1e6515592e1272a987d922b097ead875069cebe8b40c004a49060200161169c565b336121e96112ee565b6001600160a01b03161461220f5760405162461bcd60e51b81526004016108ca90613ff2565b61ffff8316600090815260666020526040902061222d908383613587565b507ffa41487ad5d6728f0b19276fa1eddc16558578f5109fc39d2dc33c3230470dab838383604051610ee6939291906140f9565b606554604051633d7b2f6f60e21b815261ffff808716600483015285166024820152306044820152606481018390526060916001600160a01b03169063f5ecbdbc9060840160006040518083038186803b1580156122be57600080fd5b505afa1580156122d2573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526122fa91908101906143d9565b95945050505050565b61ffff811660009081526066602052604081208054610aac91839161232790613fa7565b80601f016020809104026020016040519081016040528092919081815260200182805461235390613fa7565b80156123a05780601f10612375576101008083540402835291602001916123a0565b820191906000526020600020905b81548152906001019060200180831161238357829003601f168201915b505050505061284b90919063ffffffff16565b6001600160a01b03163b151590565b6000806124255a60966366ad5c8a60e01b898989896040516024016123ea949392919061440d565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152309291906128b0565b915091508161121957611219868686868561293a565b60006001600160e01b03198216630a72677560e11b1480610aac57506301ffc9a760e01b6001600160e01b0319831614610aac565b60008054610100900460ff16156124b7578160ff1660011480156124935750303b155b6124af5760405162461bcd60e51b81526004016108ca9061444b565b506000919050565b60005460ff8084169116106124de5760405162461bcd60e51b81526004016108ca9061444b565b506000805460ff191660ff92909216919091179055600190565b919050565b600054610100900460ff166125245760405162461bcd60e51b81526004016108ca90614499565b61252d816129d7565b50565b61253e866000836000612a0f565b600061254c88888888612a89565b90506000808783604051602001612565939291906144e4565b6040516020818303038152906040529050612584888287878734612d45565b886001600160a01b03168861ffff167f39a4c66499bcf4b56d79f0dde8ed7a9d4925a0df55825206b2b8531e202be0d089856040516125c4929190614511565b60405180910390a3505050505050505050565b602081015161ffff81166125f6576125f185858585612ec1565b610b3f565b61ffff81166001141561260f576125f185858585612f4b565b60405162461bcd60e51b815260206004820152602660248201527f436f6d706f7361626c654f4654436f72653a20756e6b6e6f776e207061636b6560448201526574207479706560d01b60648201526084016108ca565b60608161267481601f614533565b10156126b35760405162461bcd60e51b815260206004820152600e60248201526d736c6963655f6f766572666c6f7760901b60448201526064016108ca565b6126bd8284614533565b845110156127015760405162461bcd60e51b8152602060048201526011602482015270736c6963655f6f75744f66426f756e647360781b60448201526064016108ca565b60608215801561272057604051915060008252602082016040526118e3565b6040519150601f8416801560200281840101858101878315602002848b0101015b81831015612759578051835260209283019201612741565b5050858452601f01601f1916604052505090509392505050565b61278989600183876001600160401b0316612a0f565b60006127978b8b8b8b612a89565b905060006001336040516020016127ae9190614117565b60408051601f19818403018152908290526127d692918d9086908d908d908d9060200161454b565b60405160208183030381529060405290506127f58b8287878734612d45565b8b6001600160a01b03168b61ffff167f39a4c66499bcf4b56d79f0dde8ed7a9d4925a0df55825206b2b8531e202be0d08c85604051612835929190614511565b60405180910390a3505050505050505050505050565b6000612858826014614533565b835110156128a05760405162461bcd60e51b8152602060048201526015602482015274746f416464726573735f6f75744f66426f756e647360581b60448201526064016108ca565b500160200151600160601b900490565b6000606060008060008661ffff166001600160401b038111156128d5576128d5613a1c565b6040519080825280601f01601f1916602001820160405280156128ff576020820181803683370190505b50905060008087516020890160008d8df191503d925086831115612921578692505b828152826000602083013e909890975095505050505050565b8180519060200120609760008761ffff1661ffff1681526020019081526020016000208560405161296b91906145b3565b9081526040805191829003602090810183206001600160401b0388166000908152915220919091557fe183f33de2837795525b4792ca4cd60535bd77c53b7e7030060bfcf5734d6b0c906129c890879087908790879087906145cf565b60405180910390a15050505050565b600054610100900460ff166129fe5760405162461bcd60e51b81526004016108ca90614499565b612a0661305a565b61252d8161308c565b60fb5460ff1615612a2b57612a26848484846130d5565b61113f565b81511561113f5760405162461bcd60e51b815260206004820152602660248201527f4f4654436f72653a205f61646170746572506172616d73206d7573742062652060448201526532b6b83a3c9760d11b60648201526084016108ca565b60008061015f60009054906101000a90046001600160a01b03166001600160a01b031663afcff50f6040518163ffffffff1660e01b815260040160206040518083038186803b158015612adb57600080fd5b505afa158015612aef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b139190614134565b6001600160a01b03166332c615b46040518163ffffffff1660e01b815260040160206040518083038186803b158015612b4b57600080fd5b505afa158015612b5f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b839190614134565b9050336001600160a01b03871614612bae576040516311fbe4a960e01b815260040160405180910390fd5b806001600160a01b0316632b80cc526040518163ffffffff1660e01b815260040160206040518083038186803b158015612be757600080fd5b505afa158015612bfb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c1f9190614621565b612c3c57604051635621fccf60e01b815260040160405180910390fd5b6040516338d266a960e21b815261ffff861660048201526001600160a01b0382169063e3499aa49060240160206040518083038186803b158015612c7f57600080fd5b505afa158015612c93573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612cb79190614621565b612cd45760405163334dc1fd60e01b815260040160405180910390fd5b61015f54604051632770a7eb60e21b81526001600160a01b0388811660048301526024820186905290911690639dc29fac90604401600060405180830381600087803b158015612d2357600080fd5b505af1158015612d37573d6000803e3d6000fd5b509498975050505050505050565b61ffff861660009081526066602052604081208054612d6390613fa7565b80601f0160208091040260200160405190810160405280929190818152602001828054612d8f90613fa7565b8015612ddc5780601f10612db157610100808354040283529160200191612ddc565b820191906000526020600020905b815481529060010190602001808311612dbf57829003601f168201915b50505050509050805160001415612e4e5760405162461bcd60e51b815260206004820152603060248201527f4c7a4170703a2064657374696e6174696f6e20636861696e206973206e6f742060448201526f61207472757374656420736f7572636560801b60648201526084016108ca565b612e598787516131b4565b60655460405162c5803160e81b81526001600160a01b039091169063c5803100908490612e94908b9086908c908c908c908c9060040161463e565b6000604051808303818588803b158015612ead57600080fd5b505af1158015612162573d6000803e3d6000fd5b60008082806020019051810190612ed89190614698565b909350915060009050612eeb838261284b565b9050612ef8878284613222565b9150806001600160a01b03168761ffff167fbf551ec93859b170f9b2141bd9298bf3f64322c6f7beb2543a0cb669834118bf84604051612f3a91815260200190565b60405180910390a350505050505050565b600080600080600085806020019051810190612f6791906146f1565b95509550955095509550506000612f8860008661284b90919063ffffffff16565b9050612f958a8286613222565b9350806001600160a01b03168a61ffff167fbf551ec93859b170f9b2141bd9298bf3f64322c6f7beb2543a0cb669834118bf86604051612fd791815260200190565b60405180910390a36001600160a01b0381163b613035576040516001600160a01b03821681527f9aedf5fdba8716db3b6705ca00150643309995d4f818a249ed6dde6677e7792d9060200160405180910390a150505050505061113f565b61304e8a8a8a89858989896001600160401b0316613292565b50505050505050505050565b600054610100900460ff166130815760405162461bcd60e51b81526004016108ca90614499565b61308a33613455565b565b600054610100900460ff166130b35760405162461bcd60e51b81526004016108ca90614499565b606580546001600160a01b0319166001600160a01b0392909216919091179055565b60006130e0836134a7565b61ffff808716600090815260676020908152604080832093891683529290529081205491925090613112908490614533565b9050600081116131645760405162461bcd60e51b815260206004820152601a60248201527f4c7a4170703a206d696e4761734c696d6974206e6f742073657400000000000060448201526064016108ca565b808210156112195760405162461bcd60e51b815260206004820152601b60248201527f4c7a4170703a20676173206c696d697420697320746f6f206c6f77000000000060448201526064016108ca565b61ffff8216600090815260686020526040902054806131d257506127105b80821115610eef5760405162461bcd60e51b815260206004820181905260248201527f4c7a4170703a207061796c6f61642073697a6520697320746f6f206c6172676560448201526064016108ca565b61015f546040516340c10f1960e01b81526001600160a01b0384811660048301526024820184905260009216906340c10f1990604401600060405180830381600087803b15801561327257600080fd5b505af1158015613286573d6000803e3d6000fd5b50939695505050505050565b60008061330283609663147a7d7160e01b8d8d8d8d8c8c6040516024016132be969594939291906147a9565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526001600160a01b038a169291906128b0565b91509150816133d757868686866040516020016133229493929190614801565b60408051601f19818403018152828252805160209182012061ffff8e16600090815261012d909252919020909161335a908c906145b3565b9081526040805191829003602090810183206001600160401b038d166000908152915220919091556001600160a01b0387169061ffff8c16907f95c1ad3ef50dd05e668d7b80e9a723079395ac4867a4050552d5d9219e683d74906133ca908d908d908d908c908c908a9061483c565b60405180910390a361304e565b6000878787876040516020016133f09493929190614801565b6040516020818303038152906040528051906020012090508a61ffff167fb8890edbfc1c74692f527444645f95489c3703cc2df42e4a366f5d06fa6cd8848b8b846040516134409392919061489e565b60405180910390a25050505050505050505050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60006022825110156134fb5760405162461bcd60e51b815260206004820152601c60248201527f4c7a4170703a20696e76616c69642061646170746572506172616d730000000060448201526064016108ca565b506022015190565b82805461350f90613fa7565b90600052602060002090601f0160209004810192826135315760008555613577565b82601f1061354a57805160ff1916838001178555613577565b82800160010185558215613577579182015b8281111561357757825182559160200191906001019061355c565b506135839291506135fb565b5090565b82805461359390613fa7565b90600052602060002090601f0160209004810192826135b55760008555613577565b82601f106135ce5782800160ff19823516178555613577565b82800160010185558215613577579182015b828111156135775782358255916020019190600101906135e0565b5b8082111561358357600081556001016135fc565b61ffff8116811461252d57600080fd5b80356124f881613610565b60008083601f84011261363d57600080fd5b5081356001600160401b0381111561365457600080fd5b60208301915083602082850101111561366c57600080fd5b9250929050565b6001600160401b038116811461252d57600080fd5b80356124f881613673565b600080600080600080608087890312156136ac57600080fd5b86356136b781613610565b955060208701356001600160401b03808211156136d357600080fd5b6136df8a838b0161362b565b9097509550604089013591506136f482613673565b9093506060880135908082111561370a57600080fd5b5061371789828a0161362b565b979a9699509497509295939492505050565b60006020828403121561373b57600080fd5b81356001600160e01b03198116811461156f57600080fd5b60006020828403121561376557600080fd5b813561156f81613610565b6000806040838503121561378357600080fd5b823561378e81613610565b946020939093013593505050565b801515811461252d57600080fd5b80356124f88161379c565b600080600080600080600060a0888a0312156137d057600080fd5b87356137db81613610565b965060208801356001600160401b03808211156137f757600080fd5b6138038b838c0161362b565b909850965060408a0135955060608a0135915061381f8261379c565b9093506080890135908082111561383557600080fd5b506138428a828b0161362b565b989b979a50959850939692959293505050565b60008060006040848603121561386a57600080fd5b833561387581613610565b925060208401356001600160401b0381111561389057600080fd5b61389c8682870161362b565b9497909650939450505050565b6001600160a01b038116811461252d57600080fd5b80356124f8816138a9565b600080604083850312156138dc57600080fd5b82356138e7816138a9565b915060208301356138f7816138a9565b809150509250929050565b600080600080600080600080600060e08a8c03121561392057600080fd5b893561392b816138a9565b985060208a013561393b81613610565b975060408a01356001600160401b038082111561395757600080fd5b6139638d838e0161362b565b909950975060608c0135965060808c0135915061397f826138a9565b90945060a08b013590613991826138a9565b90935060c08b013590808211156139a757600080fd5b506139b48c828d0161362b565b915080935050809150509295985092959850929598565b600080600080608085870312156139e157600080fd5b84356139ec816138a9565b935060208501356139fc81613610565b92506040850135613a0c816138a9565b9396929550929360600135925050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715613a5a57613a5a613a1c565b604052919050565b60006001600160401b03821115613a7b57613a7b613a1c565b50601f01601f191660200190565b600080600060608486031215613a9e57600080fd5b8335613aa981613610565b925060208401356001600160401b03811115613ac457600080fd5b8401601f81018613613ad557600080fd5b8035613ae8613ae382613a62565b613a32565b818152876020838501011115613afd57600080fd5b816020840160208301376000602083830101528094505050506040840135613b2481613673565b809150509250925092565b60005b83811015613b4a578181015183820152602001613b32565b8381111561113f5750506000910152565b60008151808452613b73816020860160208601613b2f565b601f01601f19169290920160200192915050565b60208152600061156f6020830184613b5b565b60008060408385031215613bad57600080fd5b8235613bb881613610565b915060208301356138f781613610565b600060208284031215613bda57600080fd5b813561156f816138a9565b600080600060608486031215613bfa57600080fd5b8335613c0581613610565b92506020840135613c15816138a9565b929592945050506040919091013590565b60008060008060008060008060008060e08b8d031215613c4557600080fd5b8a35613c5081613610565b995060208b01356001600160401b0380821115613c6c57600080fd5b613c788e838f0161362b565b909b50995060408d0135985060608d0135915080821115613c9857600080fd5b613ca48e838f0161362b565b909850965060808d01359150613cb982613673565b819550613cc860a08e016137aa565b945060c08d0135915080821115613cde57600080fd5b50613ceb8d828e0161362b565b915080935050809150509295989b9194979a5092959850565b600080600080600060808688031215613d1c57600080fd5b8535613d2781613610565b94506020860135613d3781613610565b93506040860135925060608601356001600160401b03811115613d5957600080fd5b613d658882890161362b565b969995985093965092949392505050565b60008060008060008060008060008060e08b8d031215613d9557600080fd5b8a35613da081613610565b995060208b01356001600160401b0380821115613dbc57600080fd5b613dc88e838f0161362b565b909b50995060408d01359150613ddd82613673565b90975060608c01359080821115613df357600080fd5b613dff8e838f0161362b565b9098509650869150613e1360808e016138be565b955060a08d0135945060c08d0135915080821115613cde57600080fd5b600080600060608486031215613e4557600080fd5b8335613e5081613610565b92506020840135613c1581613610565b6000806000806000806000806000806000806101208d8f031215613e8357600080fd5b613e8c8d6138be565b9b50613e9a60208e01613620565b9a506001600160401b0360408e01351115613eb457600080fd5b613ec48e60408f01358f0161362b565b909a50985060608d013597506001600160401b0360808e01351115613ee857600080fd5b613ef88e60808f01358f0161362b565b9097509550613f0960a08e01613688565b9450613f1760c08e016138be565b9350613f2560e08e016138be565b92506001600160401b036101008e01351115613f4057600080fd5b613f518e6101008f01358f0161362b565b81935080925050509295989b509295989b509295989b565b600060208284031215613f7b57600080fd5b813561156f8161379c565b60008060008060808587031215613f9c57600080fd5b84356139ec81613610565b600181811c90821680613fbb57607f821691505b60208210811415613fdc57634e487b7160e01b600052602260045260246000fd5b50919050565b8183823760009101908152919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b61ffff8516815260606020820152600061406e606083018587614027565b905082604083015295945050505050565b61ffff871681526001600160a01b038616602082015260a0604082018190526000906140ad90830187613b5b565b851515606084015282810360808401526140c8818587614027565b9998505050505050505050565b600080604083850312156140e857600080fd5b505080516020909101519092909150565b61ffff841681526040602082015260006122fa604083018486614027565b60609190911b6bffffffffffffffffffffffff1916815260140190565b60006020828403121561414657600080fd5b815161156f816138a9565b60006020828403121561416357600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b6000828210156141925761419261416a565b500390565b8284823760609190911b6bffffffffffffffffffffffff19169101908152601401919050565b61ffff8616815260a0602082015260006141da60a0830187613b5b565b856040840152841515606084015282810360808401526141fa8185613b5b565b98975050505050505050565b61ffff8916815260c06020820152600061422360c083018a613b5b565b828103604084015261423681898b614027565b90508660608401528281036080840152614251818688614027565b9150506001600160401b03831660a08301529998505050505050505050565b600061ffff80881683528087166020840152508460408301526080606083015261429e608083018486614027565b979650505050505050565b6080815260006142bd60808301888a614027565b6001600160a01b03871660208401526040830186905282810360608401526140c8818587614027565b61ffff8a16815260c06020820152600061430460c083018a8c614027565b6001600160401b0389166040840152828103606084015261432681888a614027565b905085608084015282810360a0840152614341818587614027565b9c9b505050505050505050505050565b61ffff8616815260806020820152600061436f608083018688614027565b6001600160401b0394909416604083015250606001529392505050565b600082601f83011261439d57600080fd5b81516143ab613ae382613a62565b8181528460208386010111156143c057600080fd5b6143d1826020830160208701613b2f565b949350505050565b6000602082840312156143eb57600080fd5b81516001600160401b0381111561440157600080fd5b6143d18482850161438c565b61ffff8516815260806020820152600061442a6080830186613b5b565b6001600160401b0385166040840152828103606084015261429e8185613b5b565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b61ffff841681526060602082015260006145016060830185613b5b565b9050826040830152949350505050565b6040815260006145246040830185613b5b565b90508260208301529392505050565b600082198211156145465761454661416a565b500190565b61ffff8816815260c06020820152600061456860c0830189613b5b565b828103604084015261457a8189613b5b565b90508660608401528281036080840152614595818688614027565b9150506001600160401b03831660a083015298975050505050505050565b600082516145c5818460208701613b2f565b9190910192915050565b61ffff8616815260a0602082015260006145ec60a0830187613b5b565b6001600160401b0386166040840152828103606084015261460d8186613b5b565b905082810360808401526141fa8185613b5b565b60006020828403121561463357600080fd5b815161156f8161379c565b61ffff8716815260c06020820152600061465b60c0830188613b5b565b828103604084015261466d8188613b5b565b6001600160a01b0387811660608601528616608085015283810360a085015290506140c88185613b5b565b6000806000606084860312156146ad57600080fd5b83516146b881613610565b60208501519093506001600160401b038111156146d457600080fd5b6146e08682870161438c565b925050604084015190509250925092565b60008060008060008060c0878903121561470a57600080fd5b865161471581613610565b60208801519096506001600160401b038082111561473257600080fd5b61473e8a838b0161438c565b9650604089015191508082111561475457600080fd5b6147608a838b0161438c565b955060608901519450608089015191508082111561477d57600080fd5b5061478a89828a0161438c565b92505060a087015161479b81613673565b809150509295509295509295565b61ffff8716815260c0602082015260006147c660c0830188613b5b565b6001600160401b038716604084015282810360608401526147e78187613b5b565b905084608084015282810360a08401526140c88185613b5b565b6080815260006148146080830187613b5b565b6001600160a01b038616602084015260408301859052828103606084015261429e8185613b5b565b60c08152600061484f60c0830189613b5b565b6001600160401b038816602084015282810360408401526148708188613b5b565b9050856060840152828103608084015261488a8186613b5b565b905082810360a08401526140c88185613b5b565b6060815260006148b16060830186613b5b565b6001600160401b03949094166020830152506040015291905056fea26469706673582212201cea9e1efea156ac443ced363b9a56886a3aaee82de7bc3b0e60cc328bf3975864736f6c63430008090033", "devdoc": { "kind": "dev", "methods": { @@ -1426,7 +1431,7 @@ "storageLayout": { "storage": [ { - "astId": 19718, + "astId": 19848, "contract": "contracts/ProxyOFT.sol:ProxyOFT", "label": "_initialized", "offset": 0, @@ -1434,7 +1439,7 @@ "type": "t_uint8" }, { - "astId": 19721, + "astId": 19851, "contract": "contracts/ProxyOFT.sol:ProxyOFT", "label": "_initializing", "offset": 1, @@ -1442,7 +1447,7 @@ "type": "t_bool" }, { - "astId": 20137, + "astId": 20267, "contract": "contracts/ProxyOFT.sol:ProxyOFT", "label": "__gap", "offset": 0, @@ -1450,7 +1455,7 @@ "type": "t_array(t_uint256)50_storage" }, { - "astId": 19598, + "astId": 19728, "contract": "contracts/ProxyOFT.sol:ProxyOFT", "label": "_owner", "offset": 0, @@ -1458,7 +1463,7 @@ "type": "t_address" }, { - "astId": 19710, + "astId": 19840, "contract": "contracts/ProxyOFT.sol:ProxyOFT", "label": "__gap", "offset": 0, @@ -1466,15 +1471,15 @@ "type": "t_array(t_uint256)49_storage" }, { - "astId": 14536, + "astId": 14666, "contract": "contracts/ProxyOFT.sol:ProxyOFT", "label": "lzEndpoint", "offset": 0, "slot": "101", - "type": "t_contract(ILayerZeroEndpointUpgradeable)14467" + "type": "t_contract(ILayerZeroEndpointUpgradeable)14597" }, { - "astId": 14540, + "astId": 14670, "contract": "contracts/ProxyOFT.sol:ProxyOFT", "label": "trustedRemoteLookup", "offset": 0, @@ -1482,7 +1487,7 @@ "type": "t_mapping(t_uint16,t_bytes_storage)" }, { - "astId": 14546, + "astId": 14676, "contract": "contracts/ProxyOFT.sol:ProxyOFT", "label": "minDstGasLookup", "offset": 0, @@ -1490,7 +1495,7 @@ "type": "t_mapping(t_uint16,t_mapping(t_uint16,t_uint256))" }, { - "astId": 14550, + "astId": 14680, "contract": "contracts/ProxyOFT.sol:ProxyOFT", "label": "payloadSizeLimitLookup", "offset": 0, @@ -1498,7 +1503,7 @@ "type": "t_mapping(t_uint16,t_uint256)" }, { - "astId": 14552, + "astId": 14682, "contract": "contracts/ProxyOFT.sol:ProxyOFT", "label": "precrime", "offset": 0, @@ -1506,7 +1511,7 @@ "type": "t_address" }, { - "astId": 15084, + "astId": 15214, "contract": "contracts/ProxyOFT.sol:ProxyOFT", "label": "__gap", "offset": 0, @@ -1514,7 +1519,7 @@ "type": "t_array(t_uint256)45_storage" }, { - "astId": 15127, + "astId": 15257, "contract": "contracts/ProxyOFT.sol:ProxyOFT", "label": "failedMessages", "offset": 0, @@ -1522,7 +1527,7 @@ "type": "t_mapping(t_uint16,t_mapping(t_bytes_memory_ptr,t_mapping(t_uint64,t_bytes32)))" }, { - "astId": 15346, + "astId": 15476, "contract": "contracts/ProxyOFT.sol:ProxyOFT", "label": "__gap", "offset": 0, @@ -1530,7 +1535,7 @@ "type": "t_array(t_uint256)49_storage" }, { - "astId": 20181, + "astId": 20311, "contract": "contracts/ProxyOFT.sol:ProxyOFT", "label": "__gap", "offset": 0, @@ -1538,7 +1543,7 @@ "type": "t_array(t_uint256)50_storage" }, { - "astId": 15450, + "astId": 15580, "contract": "contracts/ProxyOFT.sol:ProxyOFT", "label": "useCustomAdapterParams", "offset": 0, @@ -1546,7 +1551,7 @@ "type": "t_bool" }, { - "astId": 15782, + "astId": 15912, "contract": "contracts/ProxyOFT.sol:ProxyOFT", "label": "__gap", "offset": 0, @@ -1554,7 +1559,7 @@ "type": "t_array(t_uint256)49_storage" }, { - "astId": 15810, + "astId": 15940, "contract": "contracts/ProxyOFT.sol:ProxyOFT", "label": "failedOFTReceivedMessages", "offset": 0, @@ -1562,7 +1567,7 @@ "type": "t_mapping(t_uint16,t_mapping(t_bytes_memory_ptr,t_mapping(t_uint64,t_bytes32)))" }, { - "astId": 16334, + "astId": 16464, "contract": "contracts/ProxyOFT.sol:ProxyOFT", "label": "__gap", "offset": 0, @@ -1570,12 +1575,12 @@ "type": "t_array(t_uint256)49_storage" }, { - "astId": 31174, + "astId": 31332, "contract": "contracts/ProxyOFT.sol:ProxyOFT", "label": "syntheticToken", "offset": 0, "slot": "351", - "type": "t_contract(ISyntheticToken)28341" + "type": "t_contract(ISyntheticToken)28471" } ], "types": { @@ -1622,12 +1627,12 @@ "label": "bytes", "numberOfBytes": "32" }, - "t_contract(ILayerZeroEndpointUpgradeable)14467": { + "t_contract(ILayerZeroEndpointUpgradeable)14597": { "encoding": "inplace", "label": "contract ILayerZeroEndpointUpgradeable", "numberOfBytes": "20" }, - "t_contract(ISyntheticToken)28341": { + "t_contract(ISyntheticToken)28471": { "encoding": "inplace", "label": "contract ISyntheticToken", "numberOfBytes": "20" diff --git a/deployments/base/ProxyOFTUpgraderV2.json b/deployments/base/ProxyOFTUpgraderV2.json new file mode 100644 index 0000000..c3800d0 --- /dev/null +++ b/deployments/base/ProxyOFTUpgraderV2.json @@ -0,0 +1,290 @@ +{ + "address": "0xecfE7634aBCd2140bede1fb34753A7F5d412c881", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "StorageValueIsNotEqual", + "type": "error" + }, + { + "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": "multicall", + "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": "0xaaa9980bf2108745afa33ed023a759600b20160de998a5c5680cb8f9d2ae9938", + "receipt": { + "to": null, + "from": "0xdf826ff6518e609E4cEE86299d40611C148099d5", + "contractAddress": "0xecfE7634aBCd2140bede1fb34753A7F5d412c881", + "transactionIndex": 29, + "gasUsed": "770640", + "logsBloom": "0x00000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000020002000000000000000800000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000004000000000000000000000000000000100000000000000000000000000000800000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xd5452425f0e7366539f4b64a1d9cbcbf5922df88e2f51cb3e24e1adfdf68ff7f", + "transactionHash": "0xaaa9980bf2108745afa33ed023a759600b20160de998a5c5680cb8f9d2ae9938", + "logs": [ + { + "transactionIndex": 29, + "blockNumber": 15057291, + "transactionHash": "0xaaa9980bf2108745afa33ed023a759600b20160de998a5c5680cb8f9d2ae9938", + "address": "0xecfE7634aBCd2140bede1fb34753A7F5d412c881", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000df826ff6518e609e4cee86299d40611c148099d5" + ], + "data": "0x", + "logIndex": 76, + "blockHash": "0xd5452425f0e7366539f4b64a1d9cbcbf5922df88e2f51cb3e24e1adfdf68ff7f" + }, + { + "transactionIndex": 29, + "blockNumber": 15057291, + "transactionHash": "0xaaa9980bf2108745afa33ed023a759600b20160de998a5c5680cb8f9d2ae9938", + "address": "0xecfE7634aBCd2140bede1fb34753A7F5d412c881", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x000000000000000000000000df826ff6518e609e4cee86299d40611c148099d5", + "0x000000000000000000000000df826ff6518e609e4cee86299d40611c148099d5" + ], + "data": "0x", + "logIndex": 77, + "blockHash": "0xd5452425f0e7366539f4b64a1d9cbcbf5922df88e2f51cb3e24e1adfdf68ff7f" + } + ], + "blockNumber": 15057291, + "cumulativeGasUsed": "4654341", + "status": 1, + "byzantium": true + }, + "args": [ + "0xdf826ff6518e609E4cEE86299d40611C148099d5" + ], + "numDeployments": 1, + "solcInputHash": "210845288ae75ad5da12a755a9f52e1f", + "metadata": "{\"compiler\":{\"version\":\"0.8.9+commit.e5eed63a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"StorageValueIsNotEqual\",\"type\":\"error\"},{\"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\":\"multicall\",\"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\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"changeProxyAdmin(address,address)\":{\"details\":\"Changes the admin of `proxy` to `newAdmin`. Requirements: - This contract must be the current admin of `proxy`.\"},\"getProxyAdmin(address)\":{\"details\":\"Returns the current admin of `proxy`. Requirements: - This contract must be the admin of `proxy`.\"},\"getProxyImplementation(address)\":{\"details\":\"Returns the current implementation of `proxy`. Requirements: - This contract must be the admin of `proxy`.\"},\"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 anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing 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.\"},\"upgrade(address,address)\":{\"details\":\"Upgrades `proxy` to `implementation`. See {TransparentUpgradeableProxy-upgradeTo}. Requirements: - This contract must be the admin of `proxy`.\"},\"upgradeAndCall(address,address,bytes)\":{\"details\":\"Upgrades `proxy` to `implementation` and calls a function on the new implementation. See {TransparentUpgradeableProxy-upgradeToAndCall}. Requirements: - This contract must be the admin of `proxy`.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/upgraders/ProxyOFTUpgrader.sol\":\"ProxyOFTUpgraderV2\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/dependencies/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() {\\n _transferOwnership(_msgSender());\\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\",\"keccak256\":\"0x24e0364e503a9bbde94c715d26573a76f14cd2a202d45f96f52134ab806b67b9\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin/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\"},\"contracts/dependencies/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\"},\"contracts/dependencies/openzeppelin/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.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 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(\\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(\\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\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin/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\"},\"contracts/dependencies/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\"},\"contracts/dependencies/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 * @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\",\"keccak256\":\"0x33b8603bfbef7f33d9308b79c79aa3db7eb19525fd1addd764285e834ca275d7\",\"license\":\"MIT\"},\"contracts/dependencies/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\"},\"contracts/dependencies/openzeppelin/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.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\":\"0x2ccf9d2313a313d41a791505f2b5abfdc62191b5d4334f7f7a82691c088a1c87\",\"license\":\"MIT\"},\"contracts/dependencies/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\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"contracts/dependencies/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\"},\"contracts/interfaces/external/IMulticall.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\ninterface IMulticall {\\n struct Call {\\n address target;\\n bytes callData;\\n }\\n\\n function aggregate(Call[] calldata calls) external returns (uint256 blockNumber, bytes[] memory returnData);\\n}\\n\",\"keccak256\":\"0x249eb838097ac10b76bfbe0879aabea8ecac25d36080d64d50598ca4b7e4cec4\",\"license\":\"MIT\"},\"contracts/upgraders/ProxyOFTUpgrader.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./UpgraderBase.sol\\\";\\n\\ncontract ProxyOFTUpgrader is UpgraderBase {\\n constructor(address _owner) {\\n transferOwnership(_owner);\\n }\\n\\n /// @inheritdoc UpgraderBase\\n function _calls() internal pure virtual override returns (bytes[] memory _callsList) {\\n _callsList = new bytes[](1);\\n _callsList[0] = abi.encodeWithSignature(\\\"syntheticToken()\\\");\\n }\\n}\\n\\ncontract ProxyOFTUpgraderV2 is ProxyOFTUpgrader {\\n // solhint-disable-next-line no-empty-blocks\\n constructor(address _owner) ProxyOFTUpgrader(_owner) {}\\n\\n /// @inheritdoc UpgraderBase\\n function _calls() internal pure virtual override returns (bytes[] memory _callsList) {\\n _callsList = new bytes[](1);\\n _callsList[0] = abi.encodeWithSignature(\\\"token()\\\");\\n }\\n}\\n\",\"keccak256\":\"0x5709aa0758bd4e10684d297aa0eacb0a301d62ebdae1fc9953f520d3495c2c97\",\"license\":\"MIT\"},\"contracts/upgraders/UpgraderBase.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/openzeppelin/proxy/transparent/ProxyAdmin.sol\\\";\\nimport \\\"../dependencies/openzeppelin//proxy/transparent/TransparentUpgradeableProxy.sol\\\";\\nimport \\\"../interfaces/external/IMulticall.sol\\\";\\n\\nerror StorageValueIsNotEqual();\\n\\nabstract contract UpgraderBase is ProxyAdmin {\\n // Note: `Multicall3` contract has same address for all chains\\n // solhint-disable-next-line const-name-snakecase\\n address public constant multicall = 0xcA11bde05977b3631167028862bE2a173976CA11;\\n\\n /// @inheritdoc ProxyAdmin\\n function upgrade(TransparentUpgradeableProxy proxy_, address implementation_) public override onlyOwner {\\n bytes[] memory _callsList = _calls();\\n bytes[] memory _beforeResults = _aggregate(proxy_, _callsList);\\n\\n proxy_.upgradeTo(implementation_);\\n\\n bytes[] memory _afterResults = _aggregate(proxy_, _callsList);\\n _checkResults(_beforeResults, _afterResults);\\n }\\n\\n /// @inheritdoc ProxyAdmin\\n function upgradeAndCall(\\n TransparentUpgradeableProxy proxy_,\\n address implementation_,\\n bytes calldata data_\\n ) public payable override onlyOwner {\\n bytes[] memory _callsList = _calls();\\n bytes[] memory _beforeResults = _aggregate(proxy_, _callsList);\\n\\n TransparentUpgradeableProxy(payable(proxy_)).upgradeToAndCall{value: msg.value}(implementation_, data_);\\n\\n bytes[] memory _afterResults = _aggregate(proxy_, _callsList);\\n _checkResults(_beforeResults, _afterResults);\\n }\\n\\n /**\\n * @notice Execute storage check calls using `Multicall3` contract\\n * @param proxy_ The proxy being upgraded is the target contract\\n * @param callDatas_ The array of storage calls to check\\n * @return _results The storage values\\n */\\n function _aggregate(\\n TransparentUpgradeableProxy proxy_,\\n bytes[] memory callDatas_\\n ) private returns (bytes[] memory _results) {\\n uint256 _length = callDatas_.length;\\n IMulticall.Call[] memory _callsList = new IMulticall.Call[](_length);\\n for (uint256 i; i < _length; ++i) {\\n _callsList[i].target = address(proxy_);\\n _callsList[i].callData = callDatas_[i];\\n }\\n (, _results) = IMulticall(multicall).aggregate(_callsList);\\n }\\n\\n /**\\n * @notice Return list of storage calls\\n * @dev The values of those calls will be compared before and after upgrade to check storage integrity\\n */\\n function _calls() internal virtual returns (bytes[] memory _callsList);\\n\\n /**\\n * @notice Compare values\\n * @dev Throws if values are inconsistent\\n */\\n function _checkResults(bytes[] memory before_, bytes[] memory after_) private pure {\\n uint256 _length = before_.length;\\n for (uint256 i; i < _length; ++i) {\\n if (keccak256(before_[i]) != keccak256(after_[i])) revert StorageValueIsNotEqual();\\n }\\n }\\n}\\n\",\"keccak256\":\"0x14cce0a9e4a8abdc551c47bfc4455232bd29e9aee69ce4f90220af5f97b98939\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b50604051610e0c380380610e0c83398101604081905261002f91610169565b8061003933610049565b61004281610099565b5050610199565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000546001600160a01b031633146100f85760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b6001600160a01b03811661015d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016100ef565b61016681610049565b50565b60006020828403121561017b57600080fd5b81516001600160a01b038116811461019257600080fd5b9392505050565b610c64806101a86000396000f3fe6080604052600436106100865760003560e01c80638da5cb5b116100595780638da5cb5b146101265780639623609d1461014457806399a88ec414610157578063f2fde38b14610177578063f3b7dead1461019757600080fd5b80631cdcf85a1461008b578063204e1c7a146100cf578063715018a6146100ef5780637eff275e14610106575b600080fd5b34801561009757600080fd5b506100b373ca11bde05977b3631167028862be2a173976ca1181565b6040516001600160a01b03909116815260200160405180910390f35b3480156100db57600080fd5b506100b36100ea366004610840565b6101b7565b3480156100fb57600080fd5b50610104610248565b005b34801561011257600080fd5b50610104610121366004610864565b610287565b34801561013257600080fd5b506000546001600160a01b03166100b3565b61010461015236600461089d565b610310565b34801561016357600080fd5b50610104610172366004610864565b6103d8565b34801561018357600080fd5b50610104610192366004610840565b610498565b3480156101a357600080fd5b506100b36101b2366004610840565b610533565b6000806000836001600160a01b03166040516101dd90635c60da1b60e01b815260040190565b600060405180830381855afa9150503d8060008114610218576040519150601f19603f3d011682016040523d82523d6000602084013e61021d565b606091505b50915091508161022c57600080fd5b80806020019051810190610240919061092f565b949350505050565b6000546001600160a01b0316331461027b5760405162461bcd60e51b81526004016102729061094c565b60405180910390fd5b6102856000610559565b565b6000546001600160a01b031633146102b15760405162461bcd60e51b81526004016102729061094c565b6040516308f2839760e41b81526001600160a01b038281166004830152831690638f28397090602401600060405180830381600087803b1580156102f457600080fd5b505af1158015610308573d6000803e3d6000fd5b505050505050565b6000546001600160a01b0316331461033a5760405162461bcd60e51b81526004016102729061094c565b60006103446105a9565b905060006103528683610623565b9050856001600160a01b0316634f1ef286348787876040518563ffffffff1660e01b815260040161038593929190610981565b6000604051808303818588803b15801561039e57600080fd5b505af11580156103b2573d6000803e3d6000fd5b505050505060006103c38784610623565b90506103cf82826107a8565b50505050505050565b6000546001600160a01b031633146104025760405162461bcd60e51b81526004016102729061094c565b600061040c6105a9565b9050600061041a8483610623565b604051631b2ce7f360e11b81526001600160a01b03858116600483015291925090851690633659cfe690602401600060405180830381600087803b15801561046157600080fd5b505af1158015610475573d6000803e3d6000fd5b5050505060006104858584610623565b905061049182826107a8565b5050505050565b6000546001600160a01b031633146104c25760405162461bcd60e51b81526004016102729061094c565b6001600160a01b0381166105275760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610272565b61053081610559565b50565b6000806000836001600160a01b03166040516101dd906303e1469160e61b815260040190565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b604080516001808252818301909252606091816020015b60608152602001906001900390816105c0579050506040805160048152602481019091526020810180516001600160e01b0316637e062a3560e11b1790528151919250908290600090610615576106156109d7565b602002602001018190525090565b805160609060008167ffffffffffffffff811115610643576106436109c1565b60405190808252806020026020018201604052801561068957816020015b6040805180820190915260008152606060208201528152602001906001900390816106615790505b50905060005b8281101561071057858282815181106106aa576106aa6109d7565b60209081029190910101516001600160a01b03909116905284518590829081106106d6576106d66109d7565b60200260200101518282815181106106f0576106f06109d7565b60200260200101516020018190525080610709906109ed565b905061068f565b50604051631296dd2160e11b815273ca11bde05977b3631167028862be2a173976ca119063252dba4290610748908490600401610a42565b600060405180830381600087803b15801561076257600080fd5b505af1158015610776573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261079e9190810190610b0d565b9695505050505050565b815160005b81811015610825578281815181106107c7576107c76109d7565b6020026020010151805190602001208482815181106107e8576107e86109d7565b60200260200101518051906020012014610815576040516301b052a160e61b815260040160405180910390fd5b61081e816109ed565b90506107ad565b50505050565b6001600160a01b038116811461053057600080fd5b60006020828403121561085257600080fd5b813561085d8161082b565b9392505050565b6000806040838503121561087757600080fd5b82356108828161082b565b915060208301356108928161082b565b809150509250929050565b600080600080606085870312156108b357600080fd5b84356108be8161082b565b935060208501356108ce8161082b565b9250604085013567ffffffffffffffff808211156108eb57600080fd5b818701915087601f8301126108ff57600080fd5b81358181111561090e57600080fd5b88602082850101111561092057600080fd5b95989497505060200194505050565b60006020828403121561094157600080fd5b815161085d8161082b565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6001600160a01b03841681526040602082018190528101829052818360608301376000818301606090810191909152601f909201601f1916010192915050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000600019821415610a0f57634e487b7160e01b600052601160045260246000fd5b5060010190565b60005b83811015610a31578181015183820152602001610a19565b838111156108255750506000910152565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b83811015610ace57888303603f19018552815180516001600160a01b0316845287015187840187905280518785018190526060610aab82828801858d01610a16565b96890196601f91909101601f191694909401909301925090860190600101610a69565b509098975050505050505050565b604051601f8201601f1916810167ffffffffffffffff81118282101715610b0557610b056109c1565b604052919050565b6000806040808486031215610b2157600080fd5b8351925060208085015167ffffffffffffffff80821115610b4157600080fd5b8187019150601f8881840112610b5657600080fd5b825182811115610b6857610b686109c1565b8060051b610b77868201610adc565b918252848101860191868101908c841115610b9157600080fd5b87870192505b83831015610c1b57825186811115610baf5760008081fd5b8701603f81018e13610bc15760008081fd5b8881015187811115610bd557610bd56109c1565b610be6818801601f19168b01610adc565b8181528f8c838501011115610bfb5760008081fd5b610c0a828c83018e8601610a16565b845250509187019190870190610b97565b809950505050505050505050925092905056fea26469706673582212209d4b058c1d8efc3e33668b6d719f3b8442770c41f61a5569bc2e1c636ccdd48464736f6c63430008090033", + "deployedBytecode": "0x6080604052600436106100865760003560e01c80638da5cb5b116100595780638da5cb5b146101265780639623609d1461014457806399a88ec414610157578063f2fde38b14610177578063f3b7dead1461019757600080fd5b80631cdcf85a1461008b578063204e1c7a146100cf578063715018a6146100ef5780637eff275e14610106575b600080fd5b34801561009757600080fd5b506100b373ca11bde05977b3631167028862be2a173976ca1181565b6040516001600160a01b03909116815260200160405180910390f35b3480156100db57600080fd5b506100b36100ea366004610840565b6101b7565b3480156100fb57600080fd5b50610104610248565b005b34801561011257600080fd5b50610104610121366004610864565b610287565b34801561013257600080fd5b506000546001600160a01b03166100b3565b61010461015236600461089d565b610310565b34801561016357600080fd5b50610104610172366004610864565b6103d8565b34801561018357600080fd5b50610104610192366004610840565b610498565b3480156101a357600080fd5b506100b36101b2366004610840565b610533565b6000806000836001600160a01b03166040516101dd90635c60da1b60e01b815260040190565b600060405180830381855afa9150503d8060008114610218576040519150601f19603f3d011682016040523d82523d6000602084013e61021d565b606091505b50915091508161022c57600080fd5b80806020019051810190610240919061092f565b949350505050565b6000546001600160a01b0316331461027b5760405162461bcd60e51b81526004016102729061094c565b60405180910390fd5b6102856000610559565b565b6000546001600160a01b031633146102b15760405162461bcd60e51b81526004016102729061094c565b6040516308f2839760e41b81526001600160a01b038281166004830152831690638f28397090602401600060405180830381600087803b1580156102f457600080fd5b505af1158015610308573d6000803e3d6000fd5b505050505050565b6000546001600160a01b0316331461033a5760405162461bcd60e51b81526004016102729061094c565b60006103446105a9565b905060006103528683610623565b9050856001600160a01b0316634f1ef286348787876040518563ffffffff1660e01b815260040161038593929190610981565b6000604051808303818588803b15801561039e57600080fd5b505af11580156103b2573d6000803e3d6000fd5b505050505060006103c38784610623565b90506103cf82826107a8565b50505050505050565b6000546001600160a01b031633146104025760405162461bcd60e51b81526004016102729061094c565b600061040c6105a9565b9050600061041a8483610623565b604051631b2ce7f360e11b81526001600160a01b03858116600483015291925090851690633659cfe690602401600060405180830381600087803b15801561046157600080fd5b505af1158015610475573d6000803e3d6000fd5b5050505060006104858584610623565b905061049182826107a8565b5050505050565b6000546001600160a01b031633146104c25760405162461bcd60e51b81526004016102729061094c565b6001600160a01b0381166105275760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610272565b61053081610559565b50565b6000806000836001600160a01b03166040516101dd906303e1469160e61b815260040190565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b604080516001808252818301909252606091816020015b60608152602001906001900390816105c0579050506040805160048152602481019091526020810180516001600160e01b0316637e062a3560e11b1790528151919250908290600090610615576106156109d7565b602002602001018190525090565b805160609060008167ffffffffffffffff811115610643576106436109c1565b60405190808252806020026020018201604052801561068957816020015b6040805180820190915260008152606060208201528152602001906001900390816106615790505b50905060005b8281101561071057858282815181106106aa576106aa6109d7565b60209081029190910101516001600160a01b03909116905284518590829081106106d6576106d66109d7565b60200260200101518282815181106106f0576106f06109d7565b60200260200101516020018190525080610709906109ed565b905061068f565b50604051631296dd2160e11b815273ca11bde05977b3631167028862be2a173976ca119063252dba4290610748908490600401610a42565b600060405180830381600087803b15801561076257600080fd5b505af1158015610776573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261079e9190810190610b0d565b9695505050505050565b815160005b81811015610825578281815181106107c7576107c76109d7565b6020026020010151805190602001208482815181106107e8576107e86109d7565b60200260200101518051906020012014610815576040516301b052a160e61b815260040160405180910390fd5b61081e816109ed565b90506107ad565b50505050565b6001600160a01b038116811461053057600080fd5b60006020828403121561085257600080fd5b813561085d8161082b565b9392505050565b6000806040838503121561087757600080fd5b82356108828161082b565b915060208301356108928161082b565b809150509250929050565b600080600080606085870312156108b357600080fd5b84356108be8161082b565b935060208501356108ce8161082b565b9250604085013567ffffffffffffffff808211156108eb57600080fd5b818701915087601f8301126108ff57600080fd5b81358181111561090e57600080fd5b88602082850101111561092057600080fd5b95989497505060200194505050565b60006020828403121561094157600080fd5b815161085d8161082b565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6001600160a01b03841681526040602082018190528101829052818360608301376000818301606090810191909152601f909201601f1916010192915050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000600019821415610a0f57634e487b7160e01b600052601160045260246000fd5b5060010190565b60005b83811015610a31578181015183820152602001610a19565b838111156108255750506000910152565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b83811015610ace57888303603f19018552815180516001600160a01b0316845287015187840187905280518785018190526060610aab82828801858d01610a16565b96890196601f91909101601f191694909401909301925090860190600101610a69565b509098975050505050505050565b604051601f8201601f1916810167ffffffffffffffff81118282101715610b0557610b056109c1565b604052919050565b6000806040808486031215610b2157600080fd5b8351925060208085015167ffffffffffffffff80821115610b4157600080fd5b8187019150601f8881840112610b5657600080fd5b825182811115610b6857610b686109c1565b8060051b610b77868201610adc565b918252848101860191868101908c841115610b9157600080fd5b87870192505b83831015610c1b57825186811115610baf5760008081fd5b8701603f81018e13610bc15760008081fd5b8881015187811115610bd557610bd56109c1565b610be6818801601f19168b01610adc565b8181528f8c838501011115610bfb5760008081fd5b610c0a828c83018e8601610a16565b845250509187019190870190610b97565b809950505050505050505050925092905056fea26469706673582212209d4b058c1d8efc3e33668b6d719f3b8442770c41f61a5569bc2e1c636ccdd48464736f6c63430008090033", + "devdoc": { + "kind": "dev", + "methods": { + "changeProxyAdmin(address,address)": { + "details": "Changes the admin of `proxy` to `newAdmin`. Requirements: - This contract must be the current admin of `proxy`." + }, + "getProxyAdmin(address)": { + "details": "Returns the current admin of `proxy`. Requirements: - This contract must be the admin of `proxy`." + }, + "getProxyImplementation(address)": { + "details": "Returns the current implementation of `proxy`. Requirements: - This contract must be the admin of `proxy`." + }, + "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 anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing 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." + }, + "upgrade(address,address)": { + "details": "Upgrades `proxy` to `implementation`. See {TransparentUpgradeableProxy-upgradeTo}. Requirements: - This contract must be the admin of `proxy`." + }, + "upgradeAndCall(address,address,bytes)": { + "details": "Upgrades `proxy` to `implementation` and calls a function on the new implementation. See {TransparentUpgradeableProxy-upgradeToAndCall}. Requirements: - This contract must be the admin of `proxy`." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 20332, + "contract": "contracts/upgraders/ProxyOFTUpgrader.sol:ProxyOFTUpgraderV2", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + } + } + } +} \ No newline at end of file diff --git a/deployments/base/Quoter.json b/deployments/base/Quoter.json index 4d53515..71b0f01 100644 --- a/deployments/base/Quoter.json +++ b/deployments/base/Quoter.json @@ -435,18 +435,12 @@ "0xa3C6d5E857943346B7F6Dee3F3053DF55357Ef69", "0xc4d66de80000000000000000000000004372a2b9304296c06197a823f25cf03119d2fd82" ], - "numDeployments": 1, + "numDeployments": 2, "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": [ - "0x4372A2b9304296c06197a823f25Cf03119d2Fd82" - ] - }, - "implementation": "0x61129aAFaa83dfd817fe827D7570eE478Ed5A4eA", + "implementation": "0xBf6CcBBFa9D488A944E7637531102b490112Ad07", "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", diff --git a/deployments/base/Quoter_Implementation.json b/deployments/base/Quoter_Implementation.json index a0a1dd3..3f90b7f 100644 --- a/deployments/base/Quoter_Implementation.json +++ b/deployments/base/Quoter_Implementation.json @@ -1,5 +1,5 @@ { - "address": "0x61129aAFaa83dfd817fe827D7570eE478Ed5A4eA", + "address": "0xBf6CcBBFa9D488A944E7637531102b490112Ad07", "abi": [ { "inputs": [], @@ -237,28 +237,28 @@ "type": "function" } ], - "transactionHash": "0x26a604a2a82f92a6620545cb6f444cafba57f2ae4d12f4d93b07efde5dc67b61", + "transactionHash": "0xeb6937ee238bb1a4b0e2ef3c7c6809bfc97cdf8a75f2436cb9c091545a6acb78", "receipt": { "to": null, "from": "0xdf826ff6518e609E4cEE86299d40611C148099d5", - "contractAddress": "0x61129aAFaa83dfd817fe827D7570eE478Ed5A4eA", - "transactionIndex": 30, - "gasUsed": "1286218", + "contractAddress": "0xBf6CcBBFa9D488A944E7637531102b490112Ad07", + "transactionIndex": 24, + "gasUsed": "1290571", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x3718721671d1d8277d12a3760f77a1a9ce97857446ec890c4831d637a56ae5d0", - "transactionHash": "0x26a604a2a82f92a6620545cb6f444cafba57f2ae4d12f4d93b07efde5dc67b61", + "blockHash": "0xd1b6d15f7d379ec1d6463ef48a4d41a4a1810dd5f75fdf8ebf3511e0ae1d4ed5", + "transactionHash": "0xeb6937ee238bb1a4b0e2ef3c7c6809bfc97cdf8a75f2436cb9c091545a6acb78", "logs": [], - "blockNumber": 14104332, - "cumulativeGasUsed": "4705039", + "blockNumber": 15058308, + "cumulativeGasUsed": "7701685", "status": 1, "byzantium": true }, "args": [], - "numDeployments": 1, - "solcInputHash": "05e4492217f7bda719dac100afeac118", - "metadata": "{\"compiler\":{\"version\":\"0.8.9+commit.e5eed63a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AddressIsNull\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"LZ_ADAPTER_PARAMS_VERSION\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"PT_SEND_AND_CALL\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SG_TYPE_SWAP_REMOTE\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"VERSION\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"srcChainId_\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"dstChainId_\",\"type\":\"uint16\"}],\"name\":\"getFlashRepaySwapAndCallbackLzArgs\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"_lzArgs\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"srcChainId_\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"dstChainId_\",\"type\":\"uint16\"}],\"name\":\"getLeverageSwapAndCallbackLzArgs\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"_lzArgs\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IPoolRegistry\",\"name\":\"poolRegistry_\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"poolRegistry\",\"outputs\":[{\"internalType\":\"contract IPoolRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IProxyOFT\",\"name\":\"proxyOFT_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"lzArgs_\",\"type\":\"bytes\"}],\"name\":\"quoteCrossChainFlashRepayNativeFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_nativeFee\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IProxyOFT\",\"name\":\"proxyOFT_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"lzArgs_\",\"type\":\"bytes\"}],\"name\":\"quoteCrossChainLeverageNativeFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_nativeFee\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"srcChainId_\",\"type\":\"uint16\"}],\"name\":\"quoteFlashRepayCallbackNativeFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_callbackTxNativeFee\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"srcChainId_\",\"type\":\"uint16\"}],\"name\":\"quoteLeverageCallbackNativeFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_callbackTxNativeFee\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"getFlashRepaySwapAndCallbackLzArgs(uint16,uint16)\":{\"details\":\"Must be called on the chain where the swap will be executed (a.k.a. destination chain)\",\"params\":{\"dstChainId_\":\"Destination chain's LZ id (i.e. chain used for swap)\",\"srcChainId_\":\"Source chain's LZ id (i.e. user-facing chain)\"}},\"getLeverageSwapAndCallbackLzArgs(uint16,uint16)\":{\"details\":\"Must be called on the chain where the swap will be executed (a.k.a. destination chain)\",\"params\":{\"dstChainId_\":\"Destination chain's LZ id (i.e. chain used for swap)\",\"srcChainId_\":\"Source chain's LZ id (i.e. user-facing chain)\"}},\"quoteCrossChainFlashRepayNativeFee(address,bytes)\":{\"params\":{\"lzArgs_\":\"The LZ args for swap transaction (See: `getFlashRepaySwapAndCallbackLzArgs()`)\",\"proxyOFT_\":\"The synthetic token's Proxy OFT contract\"},\"returns\":{\"_nativeFee\":\"The fee in native coin\"}},\"quoteCrossChainLeverageNativeFee(address,bytes)\":{\"params\":{\"lzArgs_\":\"The LZ args for swap transaction (See: `getLeverageSwapAndCallbackLzArgs()`)\",\"proxyOFT_\":\"The synthetic token's Proxy OFT contract\"},\"returns\":{\"_nativeFee\":\"The fee in native coin\"}},\"quoteFlashRepayCallbackNativeFee(uint16)\":{\"params\":{\"srcChainId_\":\"Source chain's LZ id (i.e. user-facing chain)\"},\"returns\":{\"_callbackTxNativeFee\":\"The fee in native coin\"}},\"quoteLeverageCallbackNativeFee(uint16)\":{\"params\":{\"srcChainId_\":\"Source chain's LZ id (i.e. user-facing chain)\"},\"returns\":{\"_callbackTxNativeFee\":\"The fee in native coin\"}}},\"stateVariables\":{\"LZ_ADAPTER_PARAMS_VERSION\":{\"details\":\"LayerZero adapter param version See more: https://layerzero.gitbook.io/docs/evm-guides/advanced/relayer-adapter-parameters\"},\"PT_SEND_AND_CALL\":{\"details\":\"OFT packet type\"},\"SG_TYPE_SWAP_REMOTE\":{\"details\":\"Stargate swap function type See more: https://stargateprotocol.gitbook.io/stargate/developers/function-types\"}},\"title\":\"Quoter contract\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"getFlashRepaySwapAndCallbackLzArgs(uint16,uint16)\":{\"notice\":\"Get LZ args for the swap and callback's trigger execution\"},\"getLeverageSwapAndCallbackLzArgs(uint16,uint16)\":{\"notice\":\"Get LZ args for the swap and callback's trigger execution\"},\"poolRegistry()\":{\"notice\":\"The pool registry contract\"},\"quoteCrossChainFlashRepayNativeFee(address,bytes)\":{\"notice\":\"Get the LZ (native) fee for the `triggerFlashRepay()` call\"},\"quoteCrossChainLeverageNativeFee(address,bytes)\":{\"notice\":\"Get the LZ (native) fee for the `triggerLeverageSwap()` call\"},\"quoteFlashRepayCallbackNativeFee(uint16)\":{\"notice\":\"Get the LZ (native) fee for the `crossChainFlashRepayCallback()` call\"},\"quoteLeverageCallbackNativeFee(uint16)\":{\"notice\":\"Get the LZ (native) fee for the `crossChainLeverageCallback()` call\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/Quoter.sol\":\"Quoter\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/Quoter.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./dependencies/openzeppelin-upgradeable/proxy/utils/Initializable.sol\\\";\\nimport \\\"./storage/QuoterStorage.sol\\\";\\nimport \\\"./interfaces/external/IStargateBridge.sol\\\";\\nimport \\\"./lib/CrossChainLib.sol\\\";\\n\\nerror AddressIsNull();\\nerror NotAvailableOnThisChain();\\n\\n/**\\n * @title Quoter contract\\n */\\ncontract Quoter is Initializable, QuoterStorageV1 {\\n string public constant VERSION = \\\"1.3.0\\\";\\n\\n /**\\n * @dev LayerZero adapter param version\\n * See more: https://layerzero.gitbook.io/docs/evm-guides/advanced/relayer-adapter-parameters\\n */\\n uint16 public constant LZ_ADAPTER_PARAMS_VERSION = 2;\\n\\n /**\\n * @dev Stargate swap function type\\n * See more: https://stargateprotocol.gitbook.io/stargate/developers/function-types\\n */\\n uint8 public constant SG_TYPE_SWAP_REMOTE = 1;\\n\\n /**\\n * @dev OFT packet type\\n */\\n uint16 public constant PT_SEND_AND_CALL = 1;\\n\\n constructor() {\\n _disableInitializers();\\n }\\n\\n function initialize(IPoolRegistry poolRegistry_) external initializer {\\n if (address(poolRegistry_) == address(0)) revert AddressIsNull();\\n poolRegistry = poolRegistry_;\\n }\\n\\n /**\\n * @notice Get LZ args for the swap and callback's trigger execution\\n * @dev Must be called on the chain where the swap will be executed (a.k.a. destination chain)\\n * @param srcChainId_ Source chain's LZ id (i.e. user-facing chain)\\n * @param dstChainId_ Destination chain's LZ id (i.e. chain used for swap)\\n */\\n function getFlashRepaySwapAndCallbackLzArgs(\\n uint16 srcChainId_,\\n uint16 dstChainId_\\n ) external view returns (bytes memory _lzArgs) {\\n return\\n CrossChainLib.encodeLzArgs({\\n dstChainId_: dstChainId_,\\n callbackNativeFee_: quoteFlashRepayCallbackNativeFee(srcChainId_),\\n swapTxGasLimit_: _getCrossChainDispatcher().flashRepaySwapTxGasLimit()\\n });\\n }\\n\\n /**\\n * @notice Get LZ args for the swap and callback's trigger execution\\n * @dev Must be called on the chain where the swap will be executed (a.k.a. destination chain)\\n * @param srcChainId_ Source chain's LZ id (i.e. user-facing chain)\\n * @param dstChainId_ Destination chain's LZ id (i.e. chain used for swap)\\n */\\n function getLeverageSwapAndCallbackLzArgs(\\n uint16 srcChainId_,\\n uint16 dstChainId_\\n ) external view returns (bytes memory _lzArgs) {\\n return\\n CrossChainLib.encodeLzArgs({\\n dstChainId_: dstChainId_,\\n callbackNativeFee_: quoteLeverageCallbackNativeFee(srcChainId_),\\n swapTxGasLimit_: _getCrossChainDispatcher().leverageSwapTxGasLimit()\\n });\\n }\\n\\n /**\\n * @notice Get the LZ (native) fee for the `crossChainLeverageCallback()` call\\n * @param srcChainId_ Source chain's LZ id (i.e. user-facing chain)\\n * @return _callbackTxNativeFee The fee in native coin\\n */\\n function quoteLeverageCallbackNativeFee(uint16 srcChainId_) public view returns (uint256 _callbackTxNativeFee) {\\n ICrossChainDispatcher _crossChainDispatcher = _getCrossChainDispatcher();\\n (_callbackTxNativeFee, ) = _crossChainDispatcher.stargateComposer().quoteLayerZeroFee({\\n _dstChainId: srcChainId_,\\n _functionType: SG_TYPE_SWAP_REMOTE,\\n _toAddress: abi.encodePacked(address(type(uint160).max)),\\n _transferAndCallPayload: CrossChainLib.encodeLeverageCallbackPayload(\\n address(type(uint160).max),\\n type(uint256).max\\n ),\\n _lzTxParams: IStargateRouter.lzTxObj({\\n dstGasForCall: _crossChainDispatcher.leverageCallbackTxGasLimit(),\\n dstNativeAmount: 0,\\n dstNativeAddr: \\\"\\\"\\n })\\n });\\n }\\n\\n /**\\n * @notice Get the LZ (native) fee for the `crossChainFlashRepayCallback()` call\\n * @param srcChainId_ Source chain's LZ id (i.e. user-facing chain)\\n * @return _callbackTxNativeFee The fee in native coin\\n */\\n function quoteFlashRepayCallbackNativeFee(uint16 srcChainId_) public view returns (uint256 _callbackTxNativeFee) {\\n ICrossChainDispatcher _crossChainDispatcher = _getCrossChainDispatcher();\\n uint64 _callbackTxGasLimit = _crossChainDispatcher.flashRepayCallbackTxGasLimit();\\n\\n bytes memory _lzPayload = abi.encode(\\n PT_SEND_AND_CALL,\\n abi.encodePacked(msg.sender),\\n abi.encodePacked(address(type(uint160).max)),\\n type(uint256).max,\\n CrossChainLib.encodeFlashRepayCallbackPayload(\\n address(type(uint160).max),\\n address(type(uint160).max),\\n type(uint256).max\\n ),\\n _callbackTxGasLimit\\n );\\n\\n (_callbackTxNativeFee, ) = IStargateBridge(_crossChainDispatcher.stargateComposer().stargateBridge())\\n .layerZeroEndpoint()\\n .estimateFees(\\n srcChainId_,\\n address(this),\\n _lzPayload,\\n false,\\n abi.encodePacked(\\n LZ_ADAPTER_PARAMS_VERSION,\\n uint256(_crossChainDispatcher.lzBaseGasLimit() + _callbackTxGasLimit),\\n uint256(0),\\n address(0)\\n )\\n );\\n }\\n\\n /**\\n * @notice Get the LZ (native) fee for the `triggerFlashRepay()` call\\n * @param proxyOFT_ The synthetic token's Proxy OFT contract\\n * @param lzArgs_ The LZ args for swap transaction (See: `getFlashRepaySwapAndCallbackLzArgs()`)\\n * @return _nativeFee The fee in native coin\\n */\\n function quoteCrossChainFlashRepayNativeFee(\\n IProxyOFT proxyOFT_,\\n bytes calldata lzArgs_\\n ) external view returns (uint256 _nativeFee) {\\n (uint16 _dstChainId, uint256 _callbackTxNativeFee, uint64 _swapTxGasLimit_) = CrossChainLib.decodeLzArgs(\\n lzArgs_\\n );\\n\\n bytes memory _dstProxyOFT = abi.encodePacked(proxyOFT_.getProxyOFTOf(_dstChainId));\\n\\n (_nativeFee, ) = _getCrossChainDispatcher().stargateComposer().quoteLayerZeroFee({\\n _dstChainId: _dstChainId,\\n _functionType: SG_TYPE_SWAP_REMOTE,\\n _toAddress: _dstProxyOFT,\\n _transferAndCallPayload: CrossChainLib.encodeFlashRepaySwapPayload(\\n address(type(uint160).max),\\n address(type(uint160).max),\\n type(uint256).max,\\n address(type(uint160).max),\\n type(uint256).max\\n ),\\n _lzTxParams: IStargateRouter.lzTxObj({\\n dstGasForCall: _swapTxGasLimit_,\\n dstNativeAmount: _callbackTxNativeFee,\\n dstNativeAddr: _dstProxyOFT\\n })\\n });\\n }\\n\\n /**\\n * @notice Get the LZ (native) fee for the `triggerLeverageSwap()` call\\n * @param proxyOFT_ The synthetic token's Proxy OFT contract\\n * @param lzArgs_ The LZ args for swap transaction (See: `getLeverageSwapAndCallbackLzArgs()`)\\n * @return _nativeFee The fee in native coin\\n */\\n function quoteCrossChainLeverageNativeFee(\\n IProxyOFT proxyOFT_,\\n bytes calldata lzArgs_\\n ) public view returns (uint256 _nativeFee) {\\n uint16 _dstChainId;\\n address _dstProxyOFT;\\n bytes memory _payload;\\n bytes memory _adapterParams;\\n uint64 _swapTxGasLimit;\\n {\\n _payload = CrossChainLib.encodeLeverageSwapPayload(\\n address(type(uint160).max),\\n address(type(uint160).max),\\n type(uint256).max,\\n type(uint256).max,\\n address(type(uint160).max),\\n type(uint256).max\\n );\\n\\n uint256 _callbackTxNativeFee;\\n (_dstChainId, _callbackTxNativeFee, _swapTxGasLimit) = CrossChainLib.decodeLzArgs(lzArgs_);\\n\\n _dstProxyOFT = proxyOFT_.getProxyOFTOf(_dstChainId);\\n\\n _adapterParams = abi.encodePacked(\\n LZ_ADAPTER_PARAMS_VERSION,\\n uint256(_getCrossChainDispatcher().lzBaseGasLimit() + _swapTxGasLimit),\\n _callbackTxNativeFee,\\n _dstProxyOFT\\n );\\n }\\n\\n (_nativeFee, ) = proxyOFT_.estimateSendAndCallFee({\\n _dstChainId: _dstChainId,\\n _toAddress: abi.encodePacked(_dstProxyOFT),\\n _amount: type(uint256).max,\\n _payload: _payload,\\n _dstGasForCall: _swapTxGasLimit,\\n _useZro: false,\\n _adapterParams: _adapterParams\\n });\\n }\\n\\n function _getCrossChainDispatcher() private view returns (ICrossChainDispatcher) {\\n return poolRegistry.crossChainDispatcher();\\n }\\n}\\n\",\"keccak256\":\"0x1fd8bf74cba56c3f21ae17c6f05161b49394fe623f9c438da49f25518ca54631\",\"license\":\"MIT\"},\"contracts/dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/IOFTCoreUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../../../../openzeppelin-upgradeable/utils/introspection/IERC165Upgradeable.sol\\\";\\n\\n/**\\n * @dev Interface of the IOFT core standard\\n */\\ninterface IOFTCoreUpgradeable is IERC165Upgradeable {\\n /**\\n * @dev estimate send token `_tokenId` to (`_dstChainId`, `_toAddress`)\\n * _dstChainId - L0 defined chain id to send tokens too\\n * _toAddress - dynamic bytes array which contains the address to whom you are sending tokens to on the dstChain\\n * _amount - amount of the tokens to transfer\\n * _useZro - indicates to use zro to pay L0 fees\\n * _adapterParam - flexible bytes array to indicate messaging adapter services in L0\\n */\\n function estimateSendFee(\\n uint16 _dstChainId,\\n bytes calldata _toAddress,\\n uint _amount,\\n bool _useZro,\\n bytes calldata _adapterParams\\n ) external view returns (uint nativeFee, uint zroFee);\\n\\n /**\\n * @dev send `_amount` amount of token to (`_dstChainId`, `_toAddress`) from `_from`\\n * `_from` the owner of token\\n * `_dstChainId` the destination chain identifier\\n * `_toAddress` can be any size depending on the `dstChainId`.\\n * `_amount` the quantity of tokens in wei\\n * `_refundAddress` the address LayerZero refunds if too much message fee is sent\\n * `_zroPaymentAddress` set to address(0x0) if not paying in ZRO (LayerZero Token)\\n * `_adapterParams` is a flexible bytes array to indicate messaging adapter services\\n */\\n function sendFrom(\\n address _from,\\n uint16 _dstChainId,\\n bytes calldata _toAddress,\\n uint _amount,\\n address payable _refundAddress,\\n address _zroPaymentAddress,\\n bytes calldata _adapterParams\\n ) external payable;\\n\\n /**\\n * @dev returns the circulating amount of tokens on current chain\\n */\\n function circulatingSupply() external view returns (uint);\\n\\n /**\\n * @dev returns the address of the ERC20 token\\n */\\n function token() external view returns (address);\\n\\n /**\\n * @dev Emitted when `_amount` tokens are moved from the `_sender` to (`_dstChainId`, `_toAddress`)\\n * `_nonce` is the outbound nonce\\n */\\n event SendToChain(uint16 indexed _dstChainId, address indexed _from, bytes _toAddress, uint _amount);\\n\\n /**\\n * @dev Emitted when `_amount` tokens are received from `_srcChainId` into the `_toAddress` on the local chain.\\n * `_nonce` is the inbound nonce.\\n */\\n event ReceiveFromChain(uint16 indexed _srcChainId, address indexed _to, uint _amount);\\n\\n event SetUseCustomAdapterParams(bool _useCustomAdapterParams);\\n}\\n\",\"keccak256\":\"0x22651924296f8308db8195d7a86a6781023241c53905418f2d3925e3f693f530\",\"license\":\"MIT\"},\"contracts/dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/composable/IComposableOFTCoreUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.5.0;\\n\\nimport \\\"../IOFTCoreUpgradeable.sol\\\";\\n\\n/**\\n * @dev Interface of the composable OFT core standard\\n */\\ninterface IComposableOFTCoreUpgradeable is IOFTCoreUpgradeable {\\n function estimateSendAndCallFee(\\n uint16 _dstChainId,\\n bytes calldata _toAddress,\\n uint _amount,\\n bytes calldata _payload,\\n uint64 _dstGasForCall,\\n bool _useZro,\\n bytes calldata _adapterParams\\n ) external view returns (uint nativeFee, uint zroFee);\\n\\n function sendAndCall(\\n address _from,\\n uint16 _dstChainId,\\n bytes calldata _toAddress,\\n uint _amount,\\n bytes calldata _payload,\\n uint64 _dstGasForCall,\\n address payable _refundAddress,\\n address _zroPaymentAddress,\\n bytes calldata _adapterParams\\n ) external payable;\\n\\n function retryOFTReceived(\\n uint16 _srcChainId,\\n bytes calldata _srcAddress,\\n uint64 _nonce,\\n bytes calldata _from,\\n address _to,\\n uint _amount,\\n bytes calldata _payload\\n ) external;\\n\\n event CallOFTReceivedFailure(\\n uint16 indexed _srcChainId,\\n bytes _srcAddress,\\n uint64 _nonce,\\n bytes _from,\\n address indexed _to,\\n uint _amount,\\n bytes _payload,\\n bytes _reason\\n );\\n\\n event CallOFTReceivedSuccess(uint16 indexed _srcChainId, bytes _srcAddress, uint64 _nonce, bytes32 _hash);\\n\\n event RetryOFTReceivedSuccess(bytes32 _messageHash);\\n\\n event NonContractAddress(address _address);\\n}\\n\",\"keccak256\":\"0x769b9356ad6019bdabdcfc11762f28d15eb9a4e262efc96835725f6862c5d9e9\",\"license\":\"MIT\"},\"contracts/dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/composable/IOFTReceiverUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.5.0;\\n\\ninterface IOFTReceiverUpgradeable {\\n /**\\n * @dev Called by the OFT contract when tokens are received from source chain.\\n * @param _srcChainId The chain id of the source chain.\\n * @param _srcAddress The address of the OFT token contract on the source chain.\\n * @param _nonce The nonce of the transaction on the source chain.\\n * @param _from The address of the account who calls the sendAndCall() on the source chain.\\n * @param _amount The amount of tokens to transfer.\\n * @param _payload Additional data with no specified format.\\n */\\n function onOFTReceived(\\n uint16 _srcChainId,\\n bytes calldata _srcAddress,\\n uint64 _nonce,\\n bytes calldata _from,\\n uint _amount,\\n bytes calldata _payload\\n ) external;\\n}\\n\",\"keccak256\":\"0x287036c704c57e34a6fc3f7e67c8dfaaade6eb3667b570576bc491c0f1f89a5b\",\"license\":\"MIT\"},\"contracts/dependencies/@layerzerolabs/solidity-examples/interfaces/ILayerZeroEndpoint.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.5.0;\\n\\nimport \\\"./ILayerZeroUserApplicationConfig.sol\\\";\\n\\ninterface ILayerZeroEndpoint is ILayerZeroUserApplicationConfig {\\n // @notice send a LayerZero message to the specified address at a LayerZero endpoint.\\n // @param _dstChainId - the destination chain identifier\\n // @param _destination - the address on destination chain (in bytes). address length/format may vary by chains\\n // @param _payload - a custom bytes payload to send to the destination contract\\n // @param _refundAddress - if the source transaction is cheaper than the amount of value passed, refund the additional amount to this address\\n // @param _zroPaymentAddress - the address of the ZRO token holder who would pay for the transaction\\n // @param _adapterParams - parameters for custom functionality. e.g. receive airdropped native gas from the relayer on destination\\n function send(\\n uint16 _dstChainId,\\n bytes calldata _destination,\\n bytes calldata _payload,\\n address payable _refundAddress,\\n address _zroPaymentAddress,\\n bytes calldata _adapterParams\\n ) external payable;\\n\\n // @notice used by the messaging library to publish verified payload\\n // @param _srcChainId - the source chain identifier\\n // @param _srcAddress - the source contract (as bytes) at the source chain\\n // @param _dstAddress - the address on destination chain\\n // @param _nonce - the unbound message ordering nonce\\n // @param _gasLimit - the gas limit for external contract execution\\n // @param _payload - verified payload to send to the destination contract\\n function receivePayload(\\n uint16 _srcChainId,\\n bytes calldata _srcAddress,\\n address _dstAddress,\\n uint64 _nonce,\\n uint _gasLimit,\\n bytes calldata _payload\\n ) external;\\n\\n // @notice get the inboundNonce of a lzApp from a source chain which could be EVM or non-EVM chain\\n // @param _srcChainId - the source chain identifier\\n // @param _srcAddress - the source chain contract address\\n function getInboundNonce(uint16 _srcChainId, bytes calldata _srcAddress) external view returns (uint64);\\n\\n // @notice get the outboundNonce from this source chain which, consequently, is always an EVM\\n // @param _srcAddress - the source chain contract address\\n function getOutboundNonce(uint16 _dstChainId, address _srcAddress) external view returns (uint64);\\n\\n // @notice gets a quote in source native gas, for the amount that send() requires to pay for message delivery\\n // @param _dstChainId - the destination chain identifier\\n // @param _userApplication - the user app address on this EVM chain\\n // @param _payload - the custom message to send over LayerZero\\n // @param _payInZRO - if false, user app pays the protocol fee in native token\\n // @param _adapterParam - parameters for the adapter service, e.g. send some dust native token to dstChain\\n function estimateFees(\\n uint16 _dstChainId,\\n address _userApplication,\\n bytes calldata _payload,\\n bool _payInZRO,\\n bytes calldata _adapterParam\\n ) external view returns (uint nativeFee, uint zroFee);\\n\\n // @notice get this Endpoint's immutable source identifier\\n function getChainId() external view returns (uint16);\\n\\n // @notice the interface to retry failed message on this Endpoint destination\\n // @param _srcChainId - the source chain identifier\\n // @param _srcAddress - the source chain contract address\\n // @param _payload - the payload to be retried\\n function retryPayload(uint16 _srcChainId, bytes calldata _srcAddress, bytes calldata _payload) external;\\n\\n // @notice query if any STORED payload (message blocking) at the endpoint.\\n // @param _srcChainId - the source chain identifier\\n // @param _srcAddress - the source chain contract address\\n function hasStoredPayload(uint16 _srcChainId, bytes calldata _srcAddress) external view returns (bool);\\n\\n // @notice query if the _libraryAddress is valid for sending msgs.\\n // @param _userApplication - the user app address on this EVM chain\\n function getSendLibraryAddress(address _userApplication) external view returns (address);\\n\\n // @notice query if the _libraryAddress is valid for receiving msgs.\\n // @param _userApplication - the user app address on this EVM chain\\n function getReceiveLibraryAddress(address _userApplication) external view returns (address);\\n\\n // @notice query if the non-reentrancy guard for send() is on\\n // @return true if the guard is on. false otherwise\\n function isSendingPayload() external view returns (bool);\\n\\n // @notice query if the non-reentrancy guard for receive() is on\\n // @return true if the guard is on. false otherwise\\n function isReceivingPayload() external view returns (bool);\\n\\n // @notice get the configuration of the LayerZero messaging library of the specified version\\n // @param _version - messaging library version\\n // @param _chainId - the chainId for the pending config change\\n // @param _userApplication - the contract address of the user application\\n // @param _configType - type of configuration. every messaging library has its own convention.\\n function getConfig(\\n uint16 _version,\\n uint16 _chainId,\\n address _userApplication,\\n uint _configType\\n ) external view returns (bytes memory);\\n\\n // @notice get the send() LayerZero messaging library version\\n // @param _userApplication - the contract address of the user application\\n function getSendVersion(address _userApplication) external view returns (uint16);\\n\\n // @notice get the lzReceive() LayerZero messaging library version\\n // @param _userApplication - the contract address of the user application\\n function getReceiveVersion(address _userApplication) external view returns (uint16);\\n}\\n\",\"keccak256\":\"0xa652155069d84b9f0c3e4bca7d145acc7c6cedb33ef48c873202acda27b92553\",\"license\":\"MIT\"},\"contracts/dependencies/@layerzerolabs/solidity-examples/interfaces/ILayerZeroUserApplicationConfig.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.5.0;\\n\\ninterface ILayerZeroUserApplicationConfig {\\n // @notice set the configuration of the LayerZero messaging library of the specified version\\n // @param _version - messaging library version\\n // @param _chainId - the chainId for the pending config change\\n // @param _configType - type of configuration. every messaging library has its own convention.\\n // @param _config - configuration in the bytes. can encode arbitrary content.\\n function setConfig(uint16 _version, uint16 _chainId, uint _configType, bytes calldata _config) external;\\n\\n // @notice set the send() LayerZero messaging library version to _version\\n // @param _version - new messaging library version\\n function setSendVersion(uint16 _version) external;\\n\\n // @notice set the lzReceive() LayerZero messaging library version to _version\\n // @param _version - new messaging library version\\n function setReceiveVersion(uint16 _version) external;\\n\\n // @notice Only when the UA needs to resume the message flow in blocking mode and clear the stored payload\\n // @param _srcChainId - the chainId of the source chain\\n // @param _srcAddress - the contract address of the source contract at the source chain\\n function forceResumeReceive(uint16 _srcChainId, bytes calldata _srcAddress) external;\\n}\\n\",\"keccak256\":\"0xe3e50134e39aa3c0f916447d36367970c6e4df972d488b794227e0b052ce80d5\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.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 * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\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. Equivalent to `reinitializer(1)`.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = _setInitializedVersion(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 * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original\\n * initialization step. This is essential to configure modules that are added through upgrades and that require\\n * initialization.\\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 modifier reinitializer(uint8 version) {\\n bool isTopLevelCall = _setInitializedVersion(version);\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(version);\\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} 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 function _disableInitializers() internal virtual {\\n _setInitializedVersion(type(uint8).max);\\n }\\n\\n function _setInitializedVersion(uint8 version) private returns (bool) {\\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, and for the lowest level\\n // of initializers, because in other contexts the contract may have been reentered.\\n if (_initializing) {\\n require(\\n version == 1 && !AddressUpgradeable.isContract(address(this)),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n return false;\\n } else {\\n require(_initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n return true;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x7454006cccb737612b00104d2f606d728e2818b778e7e55542f063c614ce46ba\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin-upgradeable/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.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 *\\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 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\":\"0x55cf2bd9fc76704ddcdc19834cd288b7de00fc0f298a40ea16a954ae8991db2d\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin-upgradeable/utils/introspection/IERC165Upgradeable.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 IERC165Upgradeable {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0xc6cef87559d0aeffdf0a99803de655938a7779ec0a3cd5d4383483ad85565a09\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\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 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 `recipient`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address recipient, 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 `sender` to `recipient` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address sender,\\n address recipient,\\n uint256 amount\\n ) external returns (bool);\\n\\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\",\"keccak256\":\"0x027b891937d20ccf213fdb9c31531574256de774bda99d3a70ecef6e1913ed2a\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\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\":\"0x83fe24f5c04a56091e50f4a345ff504c8bff658a76d4c43b16878c8f940c53b2\",\"license\":\"MIT\"},\"contracts/dependencies/stargate-protocol/interfaces/IStargateComposer.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./IStargateRouter.sol\\\";\\n\\ninterface IStargateComposer {\\n function swap(\\n uint16 _dstChainId,\\n uint256 _srcPoolId,\\n uint256 _dstPoolId,\\n address payable _refundAddress,\\n uint256 _amountLD,\\n uint256 _minAmountLD,\\n IStargateRouter.lzTxObj memory _lzTxParams,\\n bytes calldata _to,\\n bytes calldata _payload\\n ) external payable;\\n\\n function factory() external view returns (address);\\n\\n function stargateBridge() external view returns (address);\\n\\n function stargateRouter() external view returns (IStargateRouter);\\n\\n function quoteLayerZeroFee(\\n uint16 _dstChainId,\\n uint8 _functionType,\\n bytes calldata _toAddress,\\n bytes calldata _transferAndCallPayload,\\n IStargateRouter.lzTxObj memory _lzTxParams\\n ) external view returns (uint256, uint256);\\n\\n function peers(uint16 _chainId) external view returns (address);\\n}\\n\",\"keccak256\":\"0xdfdd1690bf176ac05803534a60227be90cc435b4bdd8fce2348f1a9417a9f63a\",\"license\":\"BUSL-1.1\"},\"contracts/dependencies/stargate-protocol/interfaces/IStargateReceiver.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\n\\npragma solidity 0.8.9;\\n\\ninterface IStargateReceiver {\\n function sgReceive(\\n uint16 _chainId,\\n bytes memory _srcAddress,\\n uint256 _nonce,\\n address _token,\\n uint256 amountLD,\\n bytes memory payload\\n ) external;\\n}\\n\",\"keccak256\":\"0xe4d6bf9fa422e5e43dc1b6880f951d06611a4ed12c2dd7dd8c0b6a5d9e06ad0d\",\"license\":\"BUSL-1.1\"},\"contracts/dependencies/stargate-protocol/interfaces/IStargateRouter.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\n\\npragma solidity 0.8.9;\\n\\ninterface IStargateRouter {\\n struct lzTxObj {\\n uint256 dstGasForCall;\\n uint256 dstNativeAmount;\\n bytes dstNativeAddr;\\n }\\n\\n function addLiquidity(uint256 _poolId, uint256 _amountLD, address _to) external;\\n\\n function swap(\\n uint16 _dstChainId,\\n uint256 _srcPoolId,\\n uint256 _dstPoolId,\\n address payable _refundAddress,\\n uint256 _amountLD,\\n uint256 _minAmountLD,\\n lzTxObj memory _lzTxParams,\\n bytes calldata _to,\\n bytes calldata _payload\\n ) external payable;\\n\\n function redeemRemote(\\n uint16 _dstChainId,\\n uint256 _srcPoolId,\\n uint256 _dstPoolId,\\n address payable _refundAddress,\\n uint256 _amountLP,\\n uint256 _minAmountLD,\\n bytes calldata _to,\\n lzTxObj memory _lzTxParams\\n ) external payable;\\n\\n function instantRedeemLocal(uint16 _srcPoolId, uint256 _amountLP, address _to) external returns (uint256);\\n\\n function redeemLocal(\\n uint16 _dstChainId,\\n uint256 _srcPoolId,\\n uint256 _dstPoolId,\\n address payable _refundAddress,\\n uint256 _amountLP,\\n bytes calldata _to,\\n lzTxObj memory _lzTxParams\\n ) external payable;\\n\\n function sendCredits(\\n uint16 _dstChainId,\\n uint256 _srcPoolId,\\n uint256 _dstPoolId,\\n address payable _refundAddress\\n ) external payable;\\n\\n function quoteLayerZeroFee(\\n uint16 _dstChainId,\\n uint8 _functionType,\\n bytes calldata _toAddress,\\n bytes calldata _transferAndCallPayload,\\n lzTxObj memory _lzTxParams\\n ) external view returns (uint256, uint256);\\n\\n function clearCachedSwap(uint16 _srcChainId, bytes calldata _srcAddress, uint256 _nonce) external;\\n\\n function factory() external view returns (address);\\n\\n function bridge() external view returns (address);\\n\\n function cachedSwapLookup(\\n uint16 _chainId_,\\n bytes calldata _srcAddress,\\n uint256 _nonce\\n ) external view returns (address token, uint256 amountLD, address to, bytes memory payload);\\n}\\n\",\"keccak256\":\"0x92126df8e682b2c5647c7b22e7387da69f9e72480af86948ce5ed17dc2c9e0a7\",\"license\":\"BUSL-1.1\"},\"contracts/interfaces/ICrossChainDispatcher.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/composable/IOFTReceiverUpgradeable.sol\\\";\\nimport \\\"../dependencies/stargate-protocol/interfaces/IStargateReceiver.sol\\\";\\nimport \\\"../dependencies/stargate-protocol/interfaces/IStargateRouter.sol\\\";\\nimport \\\"../dependencies/stargate-protocol/interfaces/IStargateComposer.sol\\\";\\nimport \\\"./IProxyOFT.sol\\\";\\n\\ninterface ICrossChainDispatcher is IStargateReceiver, IOFTReceiverUpgradeable {\\n function crossChainDispatcherOf(uint16 chainId_) external view returns (address);\\n\\n function triggerFlashRepaySwap(\\n uint256 id_,\\n address payable account_,\\n address tokenIn_,\\n address tokenOut_,\\n uint256 amountIn_,\\n uint256 amountOutMin_,\\n bytes calldata lzArgs_\\n ) external payable;\\n\\n function triggerLeverageSwap(\\n uint256 id_,\\n address payable account_,\\n address tokenIn_,\\n address tokenOut_,\\n uint256 amountIn_,\\n uint256 amountOutMin,\\n bytes calldata lzArgs_\\n ) external payable;\\n\\n function isBridgingActive() external view returns (bool);\\n\\n function flashRepayCallbackTxGasLimit() external view returns (uint64);\\n\\n function flashRepaySwapTxGasLimit() external view returns (uint64);\\n\\n function leverageCallbackTxGasLimit() external view returns (uint64);\\n\\n function leverageSwapTxGasLimit() external view returns (uint64);\\n\\n function lzBaseGasLimit() external view returns (uint256);\\n\\n function stargateComposer() external view returns (IStargateComposer);\\n\\n function stargateSlippage() external view returns (uint256);\\n\\n function stargatePoolIdOf(address token_) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xcaf05e625588dcfaa5706acc78a35fa46d50baeb2d28f689036963695a4e39cb\",\"license\":\"MIT\"},\"contracts/interfaces/IDebtToken.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/openzeppelin/token/ERC20/extensions/IERC20Metadata.sol\\\";\\nimport \\\"./ISyntheticToken.sol\\\";\\n\\ninterface IDebtToken is IERC20Metadata {\\n function lastTimestampAccrued() external view returns (uint256);\\n\\n function isActive() external view returns (bool);\\n\\n function syntheticToken() external view returns (ISyntheticToken);\\n\\n function accrueInterest() external;\\n\\n function debtIndex() external returns (uint256 debtIndex_);\\n\\n function burn(address from_, uint256 amount_) external;\\n\\n function issue(uint256 amount_, address to_) external returns (uint256 _issued, uint256 _fee);\\n\\n function flashIssue(address to_, uint256 amount_) external returns (uint256 _issued, uint256 _fee);\\n\\n function mint(address to_, uint256 amount_) external;\\n\\n function repay(address onBehalfOf_, uint256 amount_) external returns (uint256 _repaid, uint256 _fee);\\n\\n function repayAll(address onBehalfOf_) external returns (uint256 _repaid, uint256 _fee);\\n\\n function quoteIssueIn(uint256 amountToIssue_) external view returns (uint256 _amount, uint256 _fee);\\n\\n function quoteIssueOut(uint256 amount_) external view returns (uint256 _amountToIssue, uint256 _fee);\\n\\n function quoteRepayIn(uint256 amountToRepay_) external view returns (uint256 _amount, uint256 _fee);\\n\\n function quoteRepayOut(uint256 amount_) external view returns (uint256 _amountToRepay, uint256 _fee);\\n\\n function updateMaxTotalSupply(uint256 newMaxTotalSupply_) external;\\n\\n function updateInterestRate(uint256 newInterestRate_) external;\\n\\n function maxTotalSupply() external view returns (uint256);\\n\\n function interestRate() external view returns (uint256);\\n\\n function interestRatePerSecond() external view returns (uint256);\\n\\n function toggleIsActive() external;\\n}\\n\",\"keccak256\":\"0xd2f04aa1bee06d6991b10aaf7c03c3ee09d85f8e48ba92feac595ad855881380\",\"license\":\"MIT\"},\"contracts/interfaces/IGovernable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\n/**\\n * @notice Governable interface\\n */\\ninterface IGovernable {\\n function governor() external view returns (address _governor);\\n\\n function transferGovernorship(address _proposedGovernor) external;\\n}\\n\",\"keccak256\":\"0xbe84461adf33aec1bf31b6d84a5380aaeb791de9a4b95346dd8270dc6632984e\",\"license\":\"MIT\"},\"contracts/interfaces/IPauseable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\ninterface IPauseable {\\n function paused() external view returns (bool);\\n\\n function everythingStopped() external view returns (bool);\\n}\\n\",\"keccak256\":\"0xa768de9fadad05a8104cb407ae6243354e70ffd6e1a50c3e0bb0a6a1dc49d32a\",\"license\":\"MIT\"},\"contracts/interfaces/IPoolRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./external/IMasterOracle.sol\\\";\\nimport \\\"./IPauseable.sol\\\";\\nimport \\\"./IGovernable.sol\\\";\\nimport \\\"./ISyntheticToken.sol\\\";\\nimport \\\"./external/ISwapper.sol\\\";\\nimport \\\"./IQuoter.sol\\\";\\nimport \\\"./ICrossChainDispatcher.sol\\\";\\n\\ninterface IPoolRegistry is IPauseable, IGovernable {\\n function feeCollector() external view returns (address);\\n\\n function isPoolRegistered(address pool_) external view returns (bool);\\n\\n function nativeTokenGateway() external view returns (address);\\n\\n function getPools() external view returns (address[] memory);\\n\\n function registerPool(address pool_) external;\\n\\n function unregisterPool(address pool_) external;\\n\\n function masterOracle() external view returns (IMasterOracle);\\n\\n function updateFeeCollector(address newFeeCollector_) external;\\n\\n function idOfPool(address pool_) external view returns (uint256);\\n\\n function nextPoolId() external view returns (uint256);\\n\\n function swapper() external view returns (ISwapper);\\n\\n function quoter() external view returns (IQuoter);\\n\\n function crossChainDispatcher() external view returns (ICrossChainDispatcher);\\n\\n function doesSyntheticTokenExist(ISyntheticToken syntheticToken_) external view returns (bool _exists);\\n}\\n\",\"keccak256\":\"0x9ffa9e5fd39a48ac2bda561af7fb4fc9df5f8ffb7a602ef1d4da8c068019e723\",\"license\":\"MIT\"},\"contracts/interfaces/IProxyOFT.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/composable/IComposableOFTCoreUpgradeable.sol\\\";\\n\\ninterface IProxyOFT is IComposableOFTCoreUpgradeable {\\n function getProxyOFTOf(uint16 chainId_) external view returns (address _proxyOFT);\\n}\\n\",\"keccak256\":\"0x4041a90eb60de460c9e1631aaedfbf2bff2275b3f91964800b1c774546931cd5\",\"license\":\"MIT\"},\"contracts/interfaces/IQuoter.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./IPoolRegistry.sol\\\";\\nimport \\\"./IProxyOFT.sol\\\";\\n\\ninterface IQuoter {\\n function quoteCrossChainFlashRepayNativeFee(\\n IProxyOFT proxyOFT_,\\n bytes calldata lzArgs_\\n ) external view returns (uint256 _nativeFee);\\n\\n function quoteCrossChainLeverageNativeFee(\\n IProxyOFT proxyOFT_,\\n bytes calldata lzArgs_\\n ) external view returns (uint256 _nativeFee);\\n\\n function quoteLeverageCallbackNativeFee(uint16 dstChainId_) external view returns (uint256 _callbackTxNativeFee);\\n\\n function quoteFlashRepayCallbackNativeFee(uint16 dstChainId_) external view returns (uint256 _callbackTxNativeFee);\\n\\n function getFlashRepaySwapAndCallbackLzArgs(\\n uint16 srcChainId_,\\n uint16 dstChainId_\\n ) external view returns (bytes memory lzArgs_);\\n\\n function getLeverageSwapAndCallbackLzArgs(\\n uint16 srcChainId_,\\n uint16 dstChainId_\\n ) external view returns (bytes memory lzArgs_);\\n}\\n\",\"keccak256\":\"0x1e4d2dd779a09dc8ea6b6c244b167deddca3a48e71b73bf940da04113b40c752\",\"license\":\"MIT\"},\"contracts/interfaces/ISyntheticToken.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/openzeppelin/token/ERC20/extensions/IERC20Metadata.sol\\\";\\nimport \\\"./IDebtToken.sol\\\";\\nimport \\\"./IPoolRegistry.sol\\\";\\nimport \\\"../interfaces/IProxyOFT.sol\\\";\\n\\ninterface ISyntheticToken is IERC20Metadata {\\n function isActive() external view returns (bool);\\n\\n function mint(address to_, uint256 amount_) external;\\n\\n function burn(address from_, uint256 amount) external;\\n\\n function poolRegistry() external view returns (IPoolRegistry);\\n\\n function toggleIsActive() external;\\n\\n function seize(address from_, address to_, uint256 amount_) external;\\n\\n function updateMaxTotalSupply(uint256 newMaxTotalSupply_) external;\\n\\n function updateProxyOFT(IProxyOFT newProxyOFT_) external;\\n\\n function maxTotalSupply() external view returns (uint256);\\n\\n function proxyOFT() external view returns (IProxyOFT);\\n}\\n\",\"keccak256\":\"0xfaeb24d1067e85493a5c8818d6de06fc6dbc72c37e85f82811990d0120f8a0cf\",\"license\":\"MIT\"},\"contracts/interfaces/external/IMasterOracle.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\ninterface IMasterOracle {\\n function quoteTokenToUsd(address _asset, uint256 _amount) external view returns (uint256 _amountInUsd);\\n\\n function quoteUsdToToken(address _asset, uint256 _amountInUsd) external view returns (uint256 _amount);\\n\\n function quote(address _assetIn, address _assetOut, uint256 _amountIn) external view returns (uint256 _amountOut);\\n}\\n\",\"keccak256\":\"0x2f080adc5880151dc4446ef43b54abab8e3711c5f2e526917ef39a05e3c16a00\",\"license\":\"MIT\"},\"contracts/interfaces/external/IStargateBridge.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../../dependencies/@layerzerolabs/solidity-examples/interfaces/ILayerZeroEndpoint.sol\\\";\\n\\ninterface IStargateBridge {\\n function layerZeroEndpoint() external view returns (ILayerZeroEndpoint _lzEndpoint);\\n}\\n\",\"keccak256\":\"0x45007a6d6eb5d1041dc80f6912e10a89a990ee89078668a8e39648df11ce9d5b\",\"license\":\"MIT\"},\"contracts/interfaces/external/ISwapper.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\ninterface ISwapper {\\n function swapExactInput(\\n address tokenIn_,\\n address tokenOut_,\\n uint256 amountIn_,\\n uint256 amountOutMin_,\\n address receiver_\\n ) external returns (uint256 _amountOut);\\n}\\n\",\"keccak256\":\"0x75f04b225d0c310be7e0a09ee4c1aa6eeeb8d94e02fc0e4160a9597ce2d8d446\",\"license\":\"MIT\"},\"contracts/lib/CrossChainLib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nlibrary CrossChainLib {\\n /**\\n * @notice Supported cross-chain operations\\n */\\n uint8 public constant LEVERAGE = 1;\\n uint8 public constant FLASH_REPAY = 2;\\n\\n function getOperationType(bytes memory payload_) internal pure returns (uint8 _op) {\\n (_op, ) = abi.decode(payload_, (uint8, bytes));\\n }\\n\\n function encodeLeverageCallbackPayload(\\n address srcSmartFarmingManager_,\\n uint256 requestId_\\n ) internal pure returns (bytes memory _payload) {\\n return abi.encode(LEVERAGE, abi.encode(srcSmartFarmingManager_, requestId_));\\n }\\n\\n function decodeLeverageCallbackPayload(\\n bytes memory payload_\\n ) internal pure returns (address _srcSmartFarmingManager, uint256 _requestId) {\\n (, payload_) = abi.decode(payload_, (uint8, bytes));\\n return abi.decode(payload_, (address, uint256));\\n }\\n\\n function encodeFlashRepayCallbackPayload(\\n address srcProxyOFT_,\\n address srcSmartFarmingManager_,\\n uint256 requestId_\\n ) internal pure returns (bytes memory _payload) {\\n return abi.encode(FLASH_REPAY, abi.encode(srcProxyOFT_, srcSmartFarmingManager_, requestId_));\\n }\\n\\n function decodeFlashRepayCallbackPayload(\\n bytes memory payload_\\n ) internal pure returns (address srcProxyOFT_, address _srcSmartFarmingManager, uint256 _requestId) {\\n (, payload_) = abi.decode(payload_, (uint8, bytes));\\n return abi.decode(payload_, (address, address, uint256));\\n }\\n\\n function encodeFlashRepaySwapPayload(\\n address srcSmartFarmingManager_,\\n address dstProxyOFT_,\\n uint256 requestId_,\\n address account_,\\n uint256 amountOutMin_\\n ) internal pure returns (bytes memory _payload) {\\n return\\n abi.encode(\\n FLASH_REPAY,\\n abi.encode(srcSmartFarmingManager_, dstProxyOFT_, requestId_, account_, amountOutMin_)\\n );\\n }\\n\\n function decodeFlashRepaySwapPayload(\\n bytes memory payload_\\n )\\n internal\\n pure\\n returns (\\n address srcSmartFarmingManager_,\\n address dstProxyOFT_,\\n uint256 requestId_,\\n address account_,\\n uint256 amountOutMin_\\n )\\n {\\n (, payload_) = abi.decode(payload_, (uint8, bytes));\\n return abi.decode(payload_, (address, address, uint256, address, uint256));\\n }\\n\\n function encodeLeverageSwapPayload(\\n address srcSmartFarmingManager_,\\n address dstProxyOFT_,\\n uint256 requestId_,\\n uint256 sgPoolId_,\\n address account_,\\n uint256 amountOutMin_\\n ) internal pure returns (bytes memory _payload) {\\n return\\n abi.encode(\\n LEVERAGE,\\n abi.encode(srcSmartFarmingManager_, dstProxyOFT_, requestId_, sgPoolId_, account_, amountOutMin_)\\n );\\n }\\n\\n function decodeLeverageSwapPayload(\\n bytes memory payload_\\n )\\n internal\\n pure\\n returns (\\n address srcSmartFarmingManager_,\\n address dstProxyOFT_,\\n uint256 requestId_,\\n uint256 sgPoolId_,\\n address account_,\\n uint256 amountOutMin_\\n )\\n {\\n (, payload_) = abi.decode(payload_, (uint8, bytes));\\n return abi.decode(payload_, (address, address, uint256, uint256, address, uint256));\\n }\\n\\n function encodeLzArgs(\\n uint16 dstChainId_,\\n uint256 callbackNativeFee_,\\n uint64 swapTxGasLimit_\\n ) internal pure returns (bytes memory _lzArgs) {\\n return abi.encode(dstChainId_, callbackNativeFee_, swapTxGasLimit_);\\n }\\n\\n function decodeLzArgs(\\n bytes memory lzArgs_\\n ) internal pure returns (uint16 dstChainId_, uint256 callbackNativeFee_, uint64 swapTxGasLimit_) {\\n return abi.decode(lzArgs_, (uint16, uint256, uint64));\\n }\\n}\\n\",\"keccak256\":\"0x207930d2f144d84704364fc6bafdf7eb3bdb2f12ff7f74d75afded53ff035b90\",\"license\":\"MIT\"},\"contracts/storage/QuoterStorage.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../interfaces/IPoolRegistry.sol\\\";\\nimport \\\"../interfaces/IQuoter.sol\\\";\\n\\nabstract contract QuoterStorageV1 is IQuoter {\\n /**\\n * @notice The pool registry contract\\n */\\n IPoolRegistry public poolRegistry;\\n}\\n\",\"keccak256\":\"0xe8520d98aa00781fe447be32fbc3f5b3b9f81577bc0fc161cf428bca40225926\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x60806040523480156200001157600080fd5b506200001c62000022565b62000152565b6200002e60ff62000031565b50565b60008054610100900460ff1615620000ca578160ff1660011480156200006a575062000068306200014360201b62000da31760201c565b155b620000c25760405162461bcd60e51b815260206004820152602e60248201526000805160206200172f83398151915260448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b506000919050565b60005460ff808416911610620001295760405162461bcd60e51b815260206004820152602e60248201526000805160206200172f83398151915260448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401620000b9565b506000805460ff191660ff92909216919091179055600190565b6001600160a01b03163b151590565b6115cd80620001626000396000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c8063cca8e39a11610071578063cca8e39a14610176578063d81e47d314610189578063e6a20ae61461019c578063e762fc3c146101b7578063eb9f7f18146101ca578063ffa1ad74146101d257600080fd5b806348dab843146100b95780634fbedeac146100e25780639a47014a14610103578063ab39c79414610116578063afcff50f14610130578063c4d66de814610161575b600080fd5b6100cc6100c73660046110cd565b6101f6565b6040516100d99190611153565b60405180910390f35b6100f56100f036600461117b565b610289565b6040519081526020016100d9565b6100cc6101113660046110cd565b6104c2565b61011e600181565b60405160ff90911681526020016100d9565b600054610149906201000090046001600160a01b031681565b6040516001600160a01b0390911681526020016100d9565b61017461016f366004611200565b610511565b005b6100f561018436600461121d565b6105c8565b6100f561019736600461121d565b61095d565b6101a4600181565b60405161ffff90911681526020016100d9565b6100f56101c536600461117b565b610b42565b6101a4600281565b6100cc604051806040016040528060058152602001640312e332e360dc1b81525081565b606061028282610205856105c8565b61020d610db2565b6001600160a01b031663e7f4c16b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561024557600080fd5b505afa158015610259573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061027d9190611252565b610e3e565b9392505050565b6000806000806102ce86868080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610e8392505050565b6040516001627dd58f60e11b0319815261ffff8416600482015292955090935091506000906001600160a01b0389169063ff0454e29060240160206040518083038186803b15801561031f57600080fd5b505afa158015610333573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610357919061126d565b604051602001610367919061128a565b6040516020818303038152906040529050610380610db2565b6001600160a01b0316633352b6086040518163ffffffff1660e01b815260040160206040518083038186803b1580156103b857600080fd5b505afa1580156103cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103f0919061126d565b6001600160a01b0316630a512369856001846104216001600160a01b03806000196001600160a01b03600019610ea9565b60405180606001604052808967ffffffffffffffff1681526020018a8152602001888152506040518663ffffffff1660e01b81526004016104669594939291906112a7565b604080518083038186803b15801561047d57600080fd5b505afa158015610491573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104b5919061131d565b5098975050505050505050565b6060610282826104d18561095d565b6104d9610db2565b6001600160a01b031663e3d47ece6040518163ffffffff1660e01b815260040160206040518083038186803b15801561024557600080fd5b600061051d6001610f18565b90508015610535576000805461ff0019166101001790555b6001600160a01b03821661055c5760405163fb7566d760e01b815260040160405180910390fd5b6000805462010000600160b01b031916620100006001600160a01b0385160217905580156105c4576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050565b6000806105d3610db2565b90506000816001600160a01b03166362491b356040518163ffffffff1660e01b815260040160206040518083038186803b15801561061057600080fd5b505afa158015610624573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106489190611252565b9050600060013360405160200161065f919061128a565b6040516020818303038152906040526001600160a01b03604051602001610686919061128a565b6040516020818303038152906040526000196106ac6001600160a01b0380600019610fae565b866040516020016106c296959493929190611341565b6040516020818303038152906040529050826001600160a01b0316633352b6086040518163ffffffff1660e01b815260040160206040518083038186803b15801561070c57600080fd5b505afa158015610720573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610744919061126d565b6001600160a01b031663e0b63dee6040518163ffffffff1660e01b815260040160206040518083038186803b15801561077c57600080fd5b505afa158015610790573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b4919061126d565b6001600160a01b03166307968db16040518163ffffffff1660e01b815260040160206040518083038186803b1580156107ec57600080fd5b505afa158015610800573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610824919061126d565b6001600160a01b03166340a7bb10863084600060028867ffffffffffffffff168a6001600160a01b0316636c77d24f6040518163ffffffff1660e01b815260040160206040518083038186803b15801561087d57600080fd5b505afa158015610891573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108b591906113a8565b6108bf91906113c1565b6000806040516020016108d594939291906113e7565b6040516020818303038152906040526040518663ffffffff1660e01b8152600401610904959493929190611423565b604080518083038186803b15801561091b57600080fd5b505afa15801561092f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610953919061131d565b5095945050505050565b600080610968610db2565b9050806001600160a01b0316633352b6086040518163ffffffff1660e01b815260040160206040518083038186803b1580156109a357600080fd5b505afa1580156109b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109db919061126d565b6001600160a01b0316630a5123698460016001600160a01b03604051602001610a04919061128a565b604051602081830303815290604052610a266001600160a01b03600019610ff1565b6040518060600160405280886001600160a01b0316630b211f0f6040518163ffffffff1660e01b815260040160206040518083038186803b158015610a6a57600080fd5b505afa158015610a7e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aa29190611252565b67ffffffffffffffff16815260200160008152602001604051806020016040528060008152508152506040518663ffffffff1660e01b8152600401610aeb9594939291906112a7565b604080518083038186803b158015610b0257600080fd5b505afa158015610b16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b3a919061131d565b509392505050565b60008060006060806000610b6c6001600160a01b0380600019806001600160a01b03600019611042565b92506000610baf89898080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610e8392505050565b6040516001627dd58f60e11b0319815261ffff84166004820152929850935091506001600160a01b038b169063ff0454e29060240160206040518083038186803b158015610bfc57600080fd5b505afa158015610c10573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c34919061126d565b945060028267ffffffffffffffff16610c4b610db2565b6001600160a01b0316636c77d24f6040518163ffffffff1660e01b815260040160206040518083038186803b158015610c8357600080fd5b505afa158015610c97573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cbb91906113a8565b610cc591906113c1565b8287604051602001610cda94939291906113e7565b604051602081830303815290604052925050886001600160a01b031663c8598dca8686604051602001610d0d919061128a565b60405160208183030381529060405260001987866000896040518863ffffffff1660e01b8152600401610d469796959493929190611477565b604080518083038186803b158015610d5d57600080fd5b505afa158015610d71573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d95919061131d565b509998505050505050505050565b6001600160a01b03163b151590565b60008060029054906101000a90046001600160a01b03166001600160a01b03166332c615b46040518163ffffffff1660e01b815260040160206040518083038186803b158015610e0157600080fd5b505afa158015610e15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e39919061126d565b905090565b6040805161ffff8516602082015290810183905267ffffffffffffffff8216606082810191909152906080015b60405160208183030381529060405290509392505050565b600080600083806020019051810190610e9c91906114e6565b9250925092509193909250565b604080516001600160a01b038781166020830152868116828401526060808301879052908516608083015260a08083018590528351808403909101815260c0830190935291610efe916002919060e001611525565b604051602081830303815290604052905095945050505050565b60008054610100900460ff1615610f68578160ff166001148015610f3b5750303b155b610f605760405162461bcd60e51b8152600401610f5790611549565b60405180910390fd5b506000919050565b60005460ff808416911610610f8f5760405162461bcd60e51b8152600401610f5790611549565b506000805460ff191660ff92909216919091179055600190565b919050565b604080516001600160a01b03858116602083015284168183015260608082018490528251808303820181526080830190935291610e6b916002919060a001611525565b604080516001600160a01b0384166020820152808201839052815180820383018152606080830190935261102b9160019190608001611525565b604051602081830303815290604052905092915050565b604080516001600160a01b0388811660208301528781168284015260608083018890526080830187905290851660a083015260c08083018590528351808403909101815260e083019093529161109f916001919061010001611525565b60405160208183030381529060405290509695505050505050565b61ffff811681146110ca57600080fd5b50565b600080604083850312156110e057600080fd5b82356110eb816110ba565b915060208301356110fb816110ba565b809150509250929050565b6000815180845260005b8181101561112c57602081850181015186830182015201611110565b8181111561113e576000602083870101525b50601f01601f19169290920160200192915050565b6020815260006102826020830184611106565b6001600160a01b03811681146110ca57600080fd5b60008060006040848603121561119057600080fd5b833561119b81611166565b9250602084013567ffffffffffffffff808211156111b857600080fd5b818601915086601f8301126111cc57600080fd5b8135818111156111db57600080fd5b8760208285010111156111ed57600080fd5b6020830194508093505050509250925092565b60006020828403121561121257600080fd5b813561028281611166565b60006020828403121561122f57600080fd5b8135610282816110ba565b805167ffffffffffffffff81168114610fa957600080fd5b60006020828403121561126457600080fd5b6102828261123a565b60006020828403121561127f57600080fd5b815161028281611166565b60609190911b6bffffffffffffffffffffffff1916815260140190565b61ffff8616815260ff8516602082015260a0604082015260006112cd60a0830186611106565b82810360608401526112df8186611106565b9050828103608084015283518152602084015160208201526040840151606060408301526113106060830182611106565b9998505050505050505050565b6000806040838503121561133057600080fd5b505080516020909101519092909150565b61ffff8716815260c06020820152600061135e60c0830188611106565b82810360408401526113708188611106565b9050856060840152828103608084015261138a8186611106565b91505067ffffffffffffffff831660a0830152979650505050505050565b6000602082840312156113ba57600080fd5b5051919050565b600082198211156113e257634e487b7160e01b600052601160045260246000fd5b500190565b60f09490941b6001600160f01b03191684526002840192909252602283015260601b6bffffffffffffffffffffffff1916604282015260560190565b61ffff861681526001600160a01b038516602082015260a06040820181905260009061145190830186611106565b8415156060840152828103608084015261146b8185611106565b98975050505050505050565b61ffff8816815260e06020820152600061149460e0830189611106565b87604084015282810360608401526114ac8188611106565b905067ffffffffffffffff8616608084015284151560a084015282810360c08401526114d88185611106565b9a9950505050505050505050565b6000806000606084860312156114fb57600080fd5b8351611506816110ba565b6020850151909350915061151c6040850161123a565b90509250925092565b60ff831681526040602082015260006115416040830184611106565b949350505050565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b60608201526080019056fea2646970667358221220bfbe23d7d6510714e067876ac59d002a9a7554bd8ccb9727b4f7ceae77304da064736f6c63430008090033496e697469616c697a61626c653a20636f6e747261637420697320616c726561", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100b45760003560e01c8063cca8e39a11610071578063cca8e39a14610176578063d81e47d314610189578063e6a20ae61461019c578063e762fc3c146101b7578063eb9f7f18146101ca578063ffa1ad74146101d257600080fd5b806348dab843146100b95780634fbedeac146100e25780639a47014a14610103578063ab39c79414610116578063afcff50f14610130578063c4d66de814610161575b600080fd5b6100cc6100c73660046110cd565b6101f6565b6040516100d99190611153565b60405180910390f35b6100f56100f036600461117b565b610289565b6040519081526020016100d9565b6100cc6101113660046110cd565b6104c2565b61011e600181565b60405160ff90911681526020016100d9565b600054610149906201000090046001600160a01b031681565b6040516001600160a01b0390911681526020016100d9565b61017461016f366004611200565b610511565b005b6100f561018436600461121d565b6105c8565b6100f561019736600461121d565b61095d565b6101a4600181565b60405161ffff90911681526020016100d9565b6100f56101c536600461117b565b610b42565b6101a4600281565b6100cc604051806040016040528060058152602001640312e332e360dc1b81525081565b606061028282610205856105c8565b61020d610db2565b6001600160a01b031663e7f4c16b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561024557600080fd5b505afa158015610259573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061027d9190611252565b610e3e565b9392505050565b6000806000806102ce86868080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610e8392505050565b6040516001627dd58f60e11b0319815261ffff8416600482015292955090935091506000906001600160a01b0389169063ff0454e29060240160206040518083038186803b15801561031f57600080fd5b505afa158015610333573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610357919061126d565b604051602001610367919061128a565b6040516020818303038152906040529050610380610db2565b6001600160a01b0316633352b6086040518163ffffffff1660e01b815260040160206040518083038186803b1580156103b857600080fd5b505afa1580156103cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103f0919061126d565b6001600160a01b0316630a512369856001846104216001600160a01b03806000196001600160a01b03600019610ea9565b60405180606001604052808967ffffffffffffffff1681526020018a8152602001888152506040518663ffffffff1660e01b81526004016104669594939291906112a7565b604080518083038186803b15801561047d57600080fd5b505afa158015610491573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104b5919061131d565b5098975050505050505050565b6060610282826104d18561095d565b6104d9610db2565b6001600160a01b031663e3d47ece6040518163ffffffff1660e01b815260040160206040518083038186803b15801561024557600080fd5b600061051d6001610f18565b90508015610535576000805461ff0019166101001790555b6001600160a01b03821661055c5760405163fb7566d760e01b815260040160405180910390fd5b6000805462010000600160b01b031916620100006001600160a01b0385160217905580156105c4576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050565b6000806105d3610db2565b90506000816001600160a01b03166362491b356040518163ffffffff1660e01b815260040160206040518083038186803b15801561061057600080fd5b505afa158015610624573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106489190611252565b9050600060013360405160200161065f919061128a565b6040516020818303038152906040526001600160a01b03604051602001610686919061128a565b6040516020818303038152906040526000196106ac6001600160a01b0380600019610fae565b866040516020016106c296959493929190611341565b6040516020818303038152906040529050826001600160a01b0316633352b6086040518163ffffffff1660e01b815260040160206040518083038186803b15801561070c57600080fd5b505afa158015610720573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610744919061126d565b6001600160a01b031663e0b63dee6040518163ffffffff1660e01b815260040160206040518083038186803b15801561077c57600080fd5b505afa158015610790573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b4919061126d565b6001600160a01b03166307968db16040518163ffffffff1660e01b815260040160206040518083038186803b1580156107ec57600080fd5b505afa158015610800573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610824919061126d565b6001600160a01b03166340a7bb10863084600060028867ffffffffffffffff168a6001600160a01b0316636c77d24f6040518163ffffffff1660e01b815260040160206040518083038186803b15801561087d57600080fd5b505afa158015610891573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108b591906113a8565b6108bf91906113c1565b6000806040516020016108d594939291906113e7565b6040516020818303038152906040526040518663ffffffff1660e01b8152600401610904959493929190611423565b604080518083038186803b15801561091b57600080fd5b505afa15801561092f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610953919061131d565b5095945050505050565b600080610968610db2565b9050806001600160a01b0316633352b6086040518163ffffffff1660e01b815260040160206040518083038186803b1580156109a357600080fd5b505afa1580156109b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109db919061126d565b6001600160a01b0316630a5123698460016001600160a01b03604051602001610a04919061128a565b604051602081830303815290604052610a266001600160a01b03600019610ff1565b6040518060600160405280886001600160a01b0316630b211f0f6040518163ffffffff1660e01b815260040160206040518083038186803b158015610a6a57600080fd5b505afa158015610a7e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aa29190611252565b67ffffffffffffffff16815260200160008152602001604051806020016040528060008152508152506040518663ffffffff1660e01b8152600401610aeb9594939291906112a7565b604080518083038186803b158015610b0257600080fd5b505afa158015610b16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b3a919061131d565b509392505050565b60008060006060806000610b6c6001600160a01b0380600019806001600160a01b03600019611042565b92506000610baf89898080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610e8392505050565b6040516001627dd58f60e11b0319815261ffff84166004820152929850935091506001600160a01b038b169063ff0454e29060240160206040518083038186803b158015610bfc57600080fd5b505afa158015610c10573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c34919061126d565b945060028267ffffffffffffffff16610c4b610db2565b6001600160a01b0316636c77d24f6040518163ffffffff1660e01b815260040160206040518083038186803b158015610c8357600080fd5b505afa158015610c97573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cbb91906113a8565b610cc591906113c1565b8287604051602001610cda94939291906113e7565b604051602081830303815290604052925050886001600160a01b031663c8598dca8686604051602001610d0d919061128a565b60405160208183030381529060405260001987866000896040518863ffffffff1660e01b8152600401610d469796959493929190611477565b604080518083038186803b158015610d5d57600080fd5b505afa158015610d71573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d95919061131d565b509998505050505050505050565b6001600160a01b03163b151590565b60008060029054906101000a90046001600160a01b03166001600160a01b03166332c615b46040518163ffffffff1660e01b815260040160206040518083038186803b158015610e0157600080fd5b505afa158015610e15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e39919061126d565b905090565b6040805161ffff8516602082015290810183905267ffffffffffffffff8216606082810191909152906080015b60405160208183030381529060405290509392505050565b600080600083806020019051810190610e9c91906114e6565b9250925092509193909250565b604080516001600160a01b038781166020830152868116828401526060808301879052908516608083015260a08083018590528351808403909101815260c0830190935291610efe916002919060e001611525565b604051602081830303815290604052905095945050505050565b60008054610100900460ff1615610f68578160ff166001148015610f3b5750303b155b610f605760405162461bcd60e51b8152600401610f5790611549565b60405180910390fd5b506000919050565b60005460ff808416911610610f8f5760405162461bcd60e51b8152600401610f5790611549565b506000805460ff191660ff92909216919091179055600190565b919050565b604080516001600160a01b03858116602083015284168183015260608082018490528251808303820181526080830190935291610e6b916002919060a001611525565b604080516001600160a01b0384166020820152808201839052815180820383018152606080830190935261102b9160019190608001611525565b604051602081830303815290604052905092915050565b604080516001600160a01b0388811660208301528781168284015260608083018890526080830187905290851660a083015260c08083018590528351808403909101815260e083019093529161109f916001919061010001611525565b60405160208183030381529060405290509695505050505050565b61ffff811681146110ca57600080fd5b50565b600080604083850312156110e057600080fd5b82356110eb816110ba565b915060208301356110fb816110ba565b809150509250929050565b6000815180845260005b8181101561112c57602081850181015186830182015201611110565b8181111561113e576000602083870101525b50601f01601f19169290920160200192915050565b6020815260006102826020830184611106565b6001600160a01b03811681146110ca57600080fd5b60008060006040848603121561119057600080fd5b833561119b81611166565b9250602084013567ffffffffffffffff808211156111b857600080fd5b818601915086601f8301126111cc57600080fd5b8135818111156111db57600080fd5b8760208285010111156111ed57600080fd5b6020830194508093505050509250925092565b60006020828403121561121257600080fd5b813561028281611166565b60006020828403121561122f57600080fd5b8135610282816110ba565b805167ffffffffffffffff81168114610fa957600080fd5b60006020828403121561126457600080fd5b6102828261123a565b60006020828403121561127f57600080fd5b815161028281611166565b60609190911b6bffffffffffffffffffffffff1916815260140190565b61ffff8616815260ff8516602082015260a0604082015260006112cd60a0830186611106565b82810360608401526112df8186611106565b9050828103608084015283518152602084015160208201526040840151606060408301526113106060830182611106565b9998505050505050505050565b6000806040838503121561133057600080fd5b505080516020909101519092909150565b61ffff8716815260c06020820152600061135e60c0830188611106565b82810360408401526113708188611106565b9050856060840152828103608084015261138a8186611106565b91505067ffffffffffffffff831660a0830152979650505050505050565b6000602082840312156113ba57600080fd5b5051919050565b600082198211156113e257634e487b7160e01b600052601160045260246000fd5b500190565b60f09490941b6001600160f01b03191684526002840192909252602283015260601b6bffffffffffffffffffffffff1916604282015260560190565b61ffff861681526001600160a01b038516602082015260a06040820181905260009061145190830186611106565b8415156060840152828103608084015261146b8185611106565b98975050505050505050565b61ffff8816815260e06020820152600061149460e0830189611106565b87604084015282810360608401526114ac8188611106565b905067ffffffffffffffff8616608084015284151560a084015282810360c08401526114d88185611106565b9a9950505050505050505050565b6000806000606084860312156114fb57600080fd5b8351611506816110ba565b6020850151909350915061151c6040850161123a565b90509250925092565b60ff831681526040602082015260006115416040830184611106565b949350505050565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b60608201526080019056fea2646970667358221220bfbe23d7d6510714e067876ac59d002a9a7554bd8ccb9727b4f7ceae77304da064736f6c63430008090033", + "numDeployments": 2, + "solcInputHash": "210845288ae75ad5da12a755a9f52e1f", + "metadata": "{\"compiler\":{\"version\":\"0.8.9+commit.e5eed63a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AddressIsNull\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"LZ_ADAPTER_PARAMS_VERSION\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"PT_SEND_AND_CALL\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SG_TYPE_SWAP_REMOTE\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"VERSION\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"srcChainId_\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"dstChainId_\",\"type\":\"uint16\"}],\"name\":\"getFlashRepaySwapAndCallbackLzArgs\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"_lzArgs\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"srcChainId_\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"dstChainId_\",\"type\":\"uint16\"}],\"name\":\"getLeverageSwapAndCallbackLzArgs\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"_lzArgs\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IPoolRegistry\",\"name\":\"poolRegistry_\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"poolRegistry\",\"outputs\":[{\"internalType\":\"contract IPoolRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IProxyOFT\",\"name\":\"proxyOFT_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"lzArgs_\",\"type\":\"bytes\"}],\"name\":\"quoteCrossChainFlashRepayNativeFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_nativeFee\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IProxyOFT\",\"name\":\"proxyOFT_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"lzArgs_\",\"type\":\"bytes\"}],\"name\":\"quoteCrossChainLeverageNativeFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_nativeFee\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"srcChainId_\",\"type\":\"uint16\"}],\"name\":\"quoteFlashRepayCallbackNativeFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_callbackTxNativeFee\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"srcChainId_\",\"type\":\"uint16\"}],\"name\":\"quoteLeverageCallbackNativeFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_callbackTxNativeFee\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"getFlashRepaySwapAndCallbackLzArgs(uint16,uint16)\":{\"details\":\"Must be called on the chain where the swap will be executed (a.k.a. destination chain)\",\"params\":{\"dstChainId_\":\"Destination chain's LZ id (i.e. chain used for swap)\",\"srcChainId_\":\"Source chain's LZ id (i.e. user-facing chain)\"}},\"getLeverageSwapAndCallbackLzArgs(uint16,uint16)\":{\"details\":\"Must be called on the chain where the swap will be executed (a.k.a. destination chain)\",\"params\":{\"dstChainId_\":\"Destination chain's LZ id (i.e. chain used for swap)\",\"srcChainId_\":\"Source chain's LZ id (i.e. user-facing chain)\"}},\"quoteCrossChainFlashRepayNativeFee(address,bytes)\":{\"params\":{\"lzArgs_\":\"The LZ args for swap transaction (See: `getFlashRepaySwapAndCallbackLzArgs()`)\",\"proxyOFT_\":\"The synthetic token's Proxy OFT contract\"},\"returns\":{\"_nativeFee\":\"The fee in native coin\"}},\"quoteCrossChainLeverageNativeFee(address,bytes)\":{\"params\":{\"lzArgs_\":\"The LZ args for swap transaction (See: `getLeverageSwapAndCallbackLzArgs()`)\",\"proxyOFT_\":\"The synthetic token's Proxy OFT contract\"},\"returns\":{\"_nativeFee\":\"The fee in native coin\"}},\"quoteFlashRepayCallbackNativeFee(uint16)\":{\"params\":{\"srcChainId_\":\"Source chain's LZ id (i.e. user-facing chain)\"},\"returns\":{\"_callbackTxNativeFee\":\"The fee in native coin\"}},\"quoteLeverageCallbackNativeFee(uint16)\":{\"params\":{\"srcChainId_\":\"Source chain's LZ id (i.e. user-facing chain)\"},\"returns\":{\"_callbackTxNativeFee\":\"The fee in native coin\"}}},\"stateVariables\":{\"LZ_ADAPTER_PARAMS_VERSION\":{\"details\":\"LayerZero adapter param version See more: https://layerzero.gitbook.io/docs/evm-guides/advanced/relayer-adapter-parameters\"},\"PT_SEND_AND_CALL\":{\"details\":\"OFT packet type\"},\"SG_TYPE_SWAP_REMOTE\":{\"details\":\"Stargate swap function type See more: https://stargateprotocol.gitbook.io/stargate/developers/function-types\"}},\"title\":\"Quoter contract\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"getFlashRepaySwapAndCallbackLzArgs(uint16,uint16)\":{\"notice\":\"Get LZ args for the swap and callback's trigger execution\"},\"getLeverageSwapAndCallbackLzArgs(uint16,uint16)\":{\"notice\":\"Get LZ args for the swap and callback's trigger execution\"},\"poolRegistry()\":{\"notice\":\"The pool registry contract\"},\"quoteCrossChainFlashRepayNativeFee(address,bytes)\":{\"notice\":\"Get the LZ (native) fee for the `triggerFlashRepay()` call\"},\"quoteCrossChainLeverageNativeFee(address,bytes)\":{\"notice\":\"Get the LZ (native) fee for the `triggerLeverageSwap()` call\"},\"quoteFlashRepayCallbackNativeFee(uint16)\":{\"notice\":\"Get the LZ (native) fee for the `crossChainFlashRepayCallback()` call\"},\"quoteLeverageCallbackNativeFee(uint16)\":{\"notice\":\"Get the LZ (native) fee for the `crossChainLeverageCallback()` call\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/Quoter.sol\":\"Quoter\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/Quoter.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./dependencies/openzeppelin-upgradeable/proxy/utils/Initializable.sol\\\";\\nimport \\\"./storage/QuoterStorage.sol\\\";\\nimport \\\"./interfaces/external/IStargateBridge.sol\\\";\\nimport \\\"./lib/CrossChainLib.sol\\\";\\n\\nerror AddressIsNull();\\nerror NotAvailableOnThisChain();\\n\\n/**\\n * @title Quoter contract\\n */\\ncontract Quoter is Initializable, QuoterStorageV1 {\\n string public constant VERSION = \\\"1.3.0\\\";\\n\\n /**\\n * @dev LayerZero adapter param version\\n * See more: https://layerzero.gitbook.io/docs/evm-guides/advanced/relayer-adapter-parameters\\n */\\n uint16 public constant LZ_ADAPTER_PARAMS_VERSION = 2;\\n\\n /**\\n * @dev Stargate swap function type\\n * See more: https://stargateprotocol.gitbook.io/stargate/developers/function-types\\n */\\n uint8 public constant SG_TYPE_SWAP_REMOTE = 1;\\n\\n /**\\n * @dev OFT packet type\\n */\\n uint16 public constant PT_SEND_AND_CALL = 1;\\n\\n constructor() {\\n _disableInitializers();\\n }\\n\\n function initialize(IPoolRegistry poolRegistry_) external initializer {\\n if (address(poolRegistry_) == address(0)) revert AddressIsNull();\\n poolRegistry = poolRegistry_;\\n }\\n\\n /**\\n * @notice Get LZ args for the swap and callback's trigger execution\\n * @dev Must be called on the chain where the swap will be executed (a.k.a. destination chain)\\n * @param srcChainId_ Source chain's LZ id (i.e. user-facing chain)\\n * @param dstChainId_ Destination chain's LZ id (i.e. chain used for swap)\\n */\\n function getFlashRepaySwapAndCallbackLzArgs(\\n uint16 srcChainId_,\\n uint16 dstChainId_\\n ) external view returns (bytes memory _lzArgs) {\\n return\\n CrossChainLib.encodeLzArgs({\\n dstChainId_: dstChainId_,\\n callbackNativeFee_: quoteFlashRepayCallbackNativeFee(srcChainId_),\\n swapTxGasLimit_: _getCrossChainDispatcher().flashRepaySwapTxGasLimit()\\n });\\n }\\n\\n /**\\n * @notice Get LZ args for the swap and callback's trigger execution\\n * @dev Must be called on the chain where the swap will be executed (a.k.a. destination chain)\\n * @param srcChainId_ Source chain's LZ id (i.e. user-facing chain)\\n * @param dstChainId_ Destination chain's LZ id (i.e. chain used for swap)\\n */\\n function getLeverageSwapAndCallbackLzArgs(\\n uint16 srcChainId_,\\n uint16 dstChainId_\\n ) external view returns (bytes memory _lzArgs) {\\n return\\n CrossChainLib.encodeLzArgs({\\n dstChainId_: dstChainId_,\\n callbackNativeFee_: quoteLeverageCallbackNativeFee(srcChainId_),\\n swapTxGasLimit_: _getCrossChainDispatcher().leverageSwapTxGasLimit()\\n });\\n }\\n\\n /**\\n * @notice Get the LZ (native) fee for the `crossChainLeverageCallback()` call\\n * @param srcChainId_ Source chain's LZ id (i.e. user-facing chain)\\n * @return _callbackTxNativeFee The fee in native coin\\n */\\n function quoteLeverageCallbackNativeFee(uint16 srcChainId_) public view returns (uint256 _callbackTxNativeFee) {\\n ICrossChainDispatcher _crossChainDispatcher = _getCrossChainDispatcher();\\n (_callbackTxNativeFee, ) = _crossChainDispatcher.stargateComposer().quoteLayerZeroFee({\\n _dstChainId: srcChainId_,\\n _functionType: SG_TYPE_SWAP_REMOTE,\\n _toAddress: abi.encodePacked(address(type(uint160).max)),\\n _transferAndCallPayload: CrossChainLib.encodeLeverageCallbackPayload(\\n address(type(uint160).max),\\n type(uint256).max\\n ),\\n _lzTxParams: IStargateRouter.lzTxObj({\\n dstGasForCall: _crossChainDispatcher.leverageCallbackTxGasLimit(),\\n dstNativeAmount: 0,\\n dstNativeAddr: \\\"\\\"\\n })\\n });\\n }\\n\\n /**\\n * @notice Get the LZ (native) fee for the `crossChainFlashRepayCallback()` call\\n * @param srcChainId_ Source chain's LZ id (i.e. user-facing chain)\\n * @return _callbackTxNativeFee The fee in native coin\\n */\\n function quoteFlashRepayCallbackNativeFee(uint16 srcChainId_) public view returns (uint256 _callbackTxNativeFee) {\\n ICrossChainDispatcher _crossChainDispatcher = _getCrossChainDispatcher();\\n uint64 _callbackTxGasLimit = _crossChainDispatcher.flashRepayCallbackTxGasLimit();\\n\\n bytes memory _lzPayload = abi.encode(\\n PT_SEND_AND_CALL,\\n abi.encodePacked(msg.sender),\\n abi.encodePacked(address(type(uint160).max)),\\n type(uint256).max,\\n CrossChainLib.encodeFlashRepayCallbackPayload(\\n address(type(uint160).max),\\n address(type(uint160).max),\\n type(uint256).max\\n ),\\n _callbackTxGasLimit\\n );\\n\\n (_callbackTxNativeFee, ) = IStargateBridge(_crossChainDispatcher.stargateComposer().stargateBridge())\\n .layerZeroEndpoint()\\n .estimateFees(\\n srcChainId_,\\n address(this),\\n _lzPayload,\\n false,\\n abi.encodePacked(\\n LZ_ADAPTER_PARAMS_VERSION,\\n uint256(_crossChainDispatcher.lzBaseGasLimit() + _callbackTxGasLimit),\\n uint256(0),\\n address(0)\\n )\\n );\\n }\\n\\n /**\\n * @notice Get the LZ (native) fee for the `triggerFlashRepay()` call\\n * @param proxyOFT_ The synthetic token's Proxy OFT contract\\n * @param lzArgs_ The LZ args for swap transaction (See: `getFlashRepaySwapAndCallbackLzArgs()`)\\n * @return _nativeFee The fee in native coin\\n */\\n function quoteCrossChainFlashRepayNativeFee(\\n IProxyOFT proxyOFT_,\\n bytes calldata lzArgs_\\n ) external view returns (uint256 _nativeFee) {\\n (uint16 _dstChainId, uint256 _callbackTxNativeFee, uint64 _swapTxGasLimit_) = CrossChainLib.decodeLzArgs(\\n lzArgs_\\n );\\n\\n bytes memory _dstProxyOFT = abi.encodePacked(proxyOFT_.getProxyOFTOf(_dstChainId));\\n\\n (_nativeFee, ) = _getCrossChainDispatcher().stargateComposer().quoteLayerZeroFee({\\n _dstChainId: _dstChainId,\\n _functionType: SG_TYPE_SWAP_REMOTE,\\n _toAddress: _dstProxyOFT,\\n _transferAndCallPayload: CrossChainLib.encodeFlashRepaySwapPayload(\\n address(type(uint160).max),\\n address(type(uint160).max),\\n type(uint256).max,\\n address(type(uint160).max),\\n type(uint256).max,\\n type(uint256).max\\n ),\\n _lzTxParams: IStargateRouter.lzTxObj({\\n dstGasForCall: _swapTxGasLimit_,\\n dstNativeAmount: _callbackTxNativeFee,\\n dstNativeAddr: _dstProxyOFT\\n })\\n });\\n }\\n\\n /**\\n * @notice Get the LZ (native) fee for the `triggerLeverageSwap()` call\\n * @param proxyOFT_ The synthetic token's Proxy OFT contract\\n * @param lzArgs_ The LZ args for swap transaction (See: `getLeverageSwapAndCallbackLzArgs()`)\\n * @return _nativeFee The fee in native coin\\n */\\n function quoteCrossChainLeverageNativeFee(\\n IProxyOFT proxyOFT_,\\n bytes calldata lzArgs_\\n ) public view returns (uint256 _nativeFee) {\\n uint16 _dstChainId;\\n address _dstProxyOFT;\\n bytes memory _payload;\\n bytes memory _adapterParams;\\n uint64 _swapTxGasLimit;\\n {\\n _payload = CrossChainLib.encodeLeverageSwapPayload(\\n address(type(uint160).max),\\n address(type(uint160).max),\\n type(uint256).max,\\n type(uint256).max,\\n address(type(uint160).max),\\n type(uint256).max,\\n type(uint256).max\\n );\\n\\n uint256 _callbackTxNativeFee;\\n (_dstChainId, _callbackTxNativeFee, _swapTxGasLimit) = CrossChainLib.decodeLzArgs(lzArgs_);\\n\\n _dstProxyOFT = proxyOFT_.getProxyOFTOf(_dstChainId);\\n\\n _adapterParams = abi.encodePacked(\\n LZ_ADAPTER_PARAMS_VERSION,\\n uint256(_getCrossChainDispatcher().lzBaseGasLimit() + _swapTxGasLimit),\\n _callbackTxNativeFee,\\n _dstProxyOFT\\n );\\n }\\n\\n (_nativeFee, ) = proxyOFT_.estimateSendAndCallFee({\\n _dstChainId: _dstChainId,\\n _toAddress: abi.encodePacked(_dstProxyOFT),\\n _amount: type(uint256).max,\\n _payload: _payload,\\n _dstGasForCall: _swapTxGasLimit,\\n _useZro: false,\\n _adapterParams: _adapterParams\\n });\\n }\\n\\n function _getCrossChainDispatcher() private view returns (ICrossChainDispatcher) {\\n return poolRegistry.crossChainDispatcher();\\n }\\n}\\n\",\"keccak256\":\"0x795b92355da1232d02223c330457c6072c9b3c36ea8a0a7105b2f1dcb47e7202\",\"license\":\"MIT\"},\"contracts/dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/IOFTCoreUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../../../../openzeppelin-upgradeable/utils/introspection/IERC165Upgradeable.sol\\\";\\n\\n/**\\n * @dev Interface of the IOFT core standard\\n */\\ninterface IOFTCoreUpgradeable is IERC165Upgradeable {\\n /**\\n * @dev estimate send token `_tokenId` to (`_dstChainId`, `_toAddress`)\\n * _dstChainId - L0 defined chain id to send tokens too\\n * _toAddress - dynamic bytes array which contains the address to whom you are sending tokens to on the dstChain\\n * _amount - amount of the tokens to transfer\\n * _useZro - indicates to use zro to pay L0 fees\\n * _adapterParam - flexible bytes array to indicate messaging adapter services in L0\\n */\\n function estimateSendFee(\\n uint16 _dstChainId,\\n bytes calldata _toAddress,\\n uint _amount,\\n bool _useZro,\\n bytes calldata _adapterParams\\n ) external view returns (uint nativeFee, uint zroFee);\\n\\n /**\\n * @dev send `_amount` amount of token to (`_dstChainId`, `_toAddress`) from `_from`\\n * `_from` the owner of token\\n * `_dstChainId` the destination chain identifier\\n * `_toAddress` can be any size depending on the `dstChainId`.\\n * `_amount` the quantity of tokens in wei\\n * `_refundAddress` the address LayerZero refunds if too much message fee is sent\\n * `_zroPaymentAddress` set to address(0x0) if not paying in ZRO (LayerZero Token)\\n * `_adapterParams` is a flexible bytes array to indicate messaging adapter services\\n */\\n function sendFrom(\\n address _from,\\n uint16 _dstChainId,\\n bytes calldata _toAddress,\\n uint _amount,\\n address payable _refundAddress,\\n address _zroPaymentAddress,\\n bytes calldata _adapterParams\\n ) external payable;\\n\\n /**\\n * @dev returns the circulating amount of tokens on current chain\\n */\\n function circulatingSupply() external view returns (uint);\\n\\n /**\\n * @dev returns the address of the ERC20 token\\n */\\n function token() external view returns (address);\\n\\n /**\\n * @dev Emitted when `_amount` tokens are moved from the `_sender` to (`_dstChainId`, `_toAddress`)\\n * `_nonce` is the outbound nonce\\n */\\n event SendToChain(uint16 indexed _dstChainId, address indexed _from, bytes _toAddress, uint _amount);\\n\\n /**\\n * @dev Emitted when `_amount` tokens are received from `_srcChainId` into the `_toAddress` on the local chain.\\n * `_nonce` is the inbound nonce.\\n */\\n event ReceiveFromChain(uint16 indexed _srcChainId, address indexed _to, uint _amount);\\n\\n event SetUseCustomAdapterParams(bool _useCustomAdapterParams);\\n}\\n\",\"keccak256\":\"0x22651924296f8308db8195d7a86a6781023241c53905418f2d3925e3f693f530\",\"license\":\"MIT\"},\"contracts/dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/composable/IComposableOFTCoreUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.5.0;\\n\\nimport \\\"../IOFTCoreUpgradeable.sol\\\";\\n\\n/**\\n * @dev Interface of the composable OFT core standard\\n */\\ninterface IComposableOFTCoreUpgradeable is IOFTCoreUpgradeable {\\n function estimateSendAndCallFee(\\n uint16 _dstChainId,\\n bytes calldata _toAddress,\\n uint _amount,\\n bytes calldata _payload,\\n uint64 _dstGasForCall,\\n bool _useZro,\\n bytes calldata _adapterParams\\n ) external view returns (uint nativeFee, uint zroFee);\\n\\n function sendAndCall(\\n address _from,\\n uint16 _dstChainId,\\n bytes calldata _toAddress,\\n uint _amount,\\n bytes calldata _payload,\\n uint64 _dstGasForCall,\\n address payable _refundAddress,\\n address _zroPaymentAddress,\\n bytes calldata _adapterParams\\n ) external payable;\\n\\n function retryOFTReceived(\\n uint16 _srcChainId,\\n bytes calldata _srcAddress,\\n uint64 _nonce,\\n bytes calldata _from,\\n address _to,\\n uint _amount,\\n bytes calldata _payload\\n ) external;\\n\\n event CallOFTReceivedFailure(\\n uint16 indexed _srcChainId,\\n bytes _srcAddress,\\n uint64 _nonce,\\n bytes _from,\\n address indexed _to,\\n uint _amount,\\n bytes _payload,\\n bytes _reason\\n );\\n\\n event CallOFTReceivedSuccess(uint16 indexed _srcChainId, bytes _srcAddress, uint64 _nonce, bytes32 _hash);\\n\\n event RetryOFTReceivedSuccess(bytes32 _messageHash);\\n\\n event NonContractAddress(address _address);\\n}\\n\",\"keccak256\":\"0x769b9356ad6019bdabdcfc11762f28d15eb9a4e262efc96835725f6862c5d9e9\",\"license\":\"MIT\"},\"contracts/dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/composable/IOFTReceiverUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.5.0;\\n\\ninterface IOFTReceiverUpgradeable {\\n /**\\n * @dev Called by the OFT contract when tokens are received from source chain.\\n * @param _srcChainId The chain id of the source chain.\\n * @param _srcAddress The address of the OFT token contract on the source chain.\\n * @param _nonce The nonce of the transaction on the source chain.\\n * @param _from The address of the account who calls the sendAndCall() on the source chain.\\n * @param _amount The amount of tokens to transfer.\\n * @param _payload Additional data with no specified format.\\n */\\n function onOFTReceived(\\n uint16 _srcChainId,\\n bytes calldata _srcAddress,\\n uint64 _nonce,\\n bytes calldata _from,\\n uint _amount,\\n bytes calldata _payload\\n ) external;\\n}\\n\",\"keccak256\":\"0x287036c704c57e34a6fc3f7e67c8dfaaade6eb3667b570576bc491c0f1f89a5b\",\"license\":\"MIT\"},\"contracts/dependencies/@layerzerolabs/solidity-examples/interfaces/ILayerZeroEndpoint.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.5.0;\\n\\nimport \\\"./ILayerZeroUserApplicationConfig.sol\\\";\\n\\ninterface ILayerZeroEndpoint is ILayerZeroUserApplicationConfig {\\n // @notice send a LayerZero message to the specified address at a LayerZero endpoint.\\n // @param _dstChainId - the destination chain identifier\\n // @param _destination - the address on destination chain (in bytes). address length/format may vary by chains\\n // @param _payload - a custom bytes payload to send to the destination contract\\n // @param _refundAddress - if the source transaction is cheaper than the amount of value passed, refund the additional amount to this address\\n // @param _zroPaymentAddress - the address of the ZRO token holder who would pay for the transaction\\n // @param _adapterParams - parameters for custom functionality. e.g. receive airdropped native gas from the relayer on destination\\n function send(\\n uint16 _dstChainId,\\n bytes calldata _destination,\\n bytes calldata _payload,\\n address payable _refundAddress,\\n address _zroPaymentAddress,\\n bytes calldata _adapterParams\\n ) external payable;\\n\\n // @notice used by the messaging library to publish verified payload\\n // @param _srcChainId - the source chain identifier\\n // @param _srcAddress - the source contract (as bytes) at the source chain\\n // @param _dstAddress - the address on destination chain\\n // @param _nonce - the unbound message ordering nonce\\n // @param _gasLimit - the gas limit for external contract execution\\n // @param _payload - verified payload to send to the destination contract\\n function receivePayload(\\n uint16 _srcChainId,\\n bytes calldata _srcAddress,\\n address _dstAddress,\\n uint64 _nonce,\\n uint _gasLimit,\\n bytes calldata _payload\\n ) external;\\n\\n // @notice get the inboundNonce of a lzApp from a source chain which could be EVM or non-EVM chain\\n // @param _srcChainId - the source chain identifier\\n // @param _srcAddress - the source chain contract address\\n function getInboundNonce(uint16 _srcChainId, bytes calldata _srcAddress) external view returns (uint64);\\n\\n // @notice get the outboundNonce from this source chain which, consequently, is always an EVM\\n // @param _srcAddress - the source chain contract address\\n function getOutboundNonce(uint16 _dstChainId, address _srcAddress) external view returns (uint64);\\n\\n // @notice gets a quote in source native gas, for the amount that send() requires to pay for message delivery\\n // @param _dstChainId - the destination chain identifier\\n // @param _userApplication - the user app address on this EVM chain\\n // @param _payload - the custom message to send over LayerZero\\n // @param _payInZRO - if false, user app pays the protocol fee in native token\\n // @param _adapterParam - parameters for the adapter service, e.g. send some dust native token to dstChain\\n function estimateFees(\\n uint16 _dstChainId,\\n address _userApplication,\\n bytes calldata _payload,\\n bool _payInZRO,\\n bytes calldata _adapterParam\\n ) external view returns (uint nativeFee, uint zroFee);\\n\\n // @notice get this Endpoint's immutable source identifier\\n function getChainId() external view returns (uint16);\\n\\n // @notice the interface to retry failed message on this Endpoint destination\\n // @param _srcChainId - the source chain identifier\\n // @param _srcAddress - the source chain contract address\\n // @param _payload - the payload to be retried\\n function retryPayload(uint16 _srcChainId, bytes calldata _srcAddress, bytes calldata _payload) external;\\n\\n // @notice query if any STORED payload (message blocking) at the endpoint.\\n // @param _srcChainId - the source chain identifier\\n // @param _srcAddress - the source chain contract address\\n function hasStoredPayload(uint16 _srcChainId, bytes calldata _srcAddress) external view returns (bool);\\n\\n // @notice query if the _libraryAddress is valid for sending msgs.\\n // @param _userApplication - the user app address on this EVM chain\\n function getSendLibraryAddress(address _userApplication) external view returns (address);\\n\\n // @notice query if the _libraryAddress is valid for receiving msgs.\\n // @param _userApplication - the user app address on this EVM chain\\n function getReceiveLibraryAddress(address _userApplication) external view returns (address);\\n\\n // @notice query if the non-reentrancy guard for send() is on\\n // @return true if the guard is on. false otherwise\\n function isSendingPayload() external view returns (bool);\\n\\n // @notice query if the non-reentrancy guard for receive() is on\\n // @return true if the guard is on. false otherwise\\n function isReceivingPayload() external view returns (bool);\\n\\n // @notice get the configuration of the LayerZero messaging library of the specified version\\n // @param _version - messaging library version\\n // @param _chainId - the chainId for the pending config change\\n // @param _userApplication - the contract address of the user application\\n // @param _configType - type of configuration. every messaging library has its own convention.\\n function getConfig(\\n uint16 _version,\\n uint16 _chainId,\\n address _userApplication,\\n uint _configType\\n ) external view returns (bytes memory);\\n\\n // @notice get the send() LayerZero messaging library version\\n // @param _userApplication - the contract address of the user application\\n function getSendVersion(address _userApplication) external view returns (uint16);\\n\\n // @notice get the lzReceive() LayerZero messaging library version\\n // @param _userApplication - the contract address of the user application\\n function getReceiveVersion(address _userApplication) external view returns (uint16);\\n}\\n\",\"keccak256\":\"0xa652155069d84b9f0c3e4bca7d145acc7c6cedb33ef48c873202acda27b92553\",\"license\":\"MIT\"},\"contracts/dependencies/@layerzerolabs/solidity-examples/interfaces/ILayerZeroUserApplicationConfig.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.5.0;\\n\\ninterface ILayerZeroUserApplicationConfig {\\n // @notice set the configuration of the LayerZero messaging library of the specified version\\n // @param _version - messaging library version\\n // @param _chainId - the chainId for the pending config change\\n // @param _configType - type of configuration. every messaging library has its own convention.\\n // @param _config - configuration in the bytes. can encode arbitrary content.\\n function setConfig(uint16 _version, uint16 _chainId, uint _configType, bytes calldata _config) external;\\n\\n // @notice set the send() LayerZero messaging library version to _version\\n // @param _version - new messaging library version\\n function setSendVersion(uint16 _version) external;\\n\\n // @notice set the lzReceive() LayerZero messaging library version to _version\\n // @param _version - new messaging library version\\n function setReceiveVersion(uint16 _version) external;\\n\\n // @notice Only when the UA needs to resume the message flow in blocking mode and clear the stored payload\\n // @param _srcChainId - the chainId of the source chain\\n // @param _srcAddress - the contract address of the source contract at the source chain\\n function forceResumeReceive(uint16 _srcChainId, bytes calldata _srcAddress) external;\\n}\\n\",\"keccak256\":\"0xe3e50134e39aa3c0f916447d36367970c6e4df972d488b794227e0b052ce80d5\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.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 * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\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. Equivalent to `reinitializer(1)`.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = _setInitializedVersion(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 * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original\\n * initialization step. This is essential to configure modules that are added through upgrades and that require\\n * initialization.\\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 modifier reinitializer(uint8 version) {\\n bool isTopLevelCall = _setInitializedVersion(version);\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(version);\\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} 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 function _disableInitializers() internal virtual {\\n _setInitializedVersion(type(uint8).max);\\n }\\n\\n function _setInitializedVersion(uint8 version) private returns (bool) {\\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, and for the lowest level\\n // of initializers, because in other contexts the contract may have been reentered.\\n if (_initializing) {\\n require(\\n version == 1 && !AddressUpgradeable.isContract(address(this)),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n return false;\\n } else {\\n require(_initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n return true;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x7454006cccb737612b00104d2f606d728e2818b778e7e55542f063c614ce46ba\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin-upgradeable/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.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 *\\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 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\":\"0x55cf2bd9fc76704ddcdc19834cd288b7de00fc0f298a40ea16a954ae8991db2d\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin-upgradeable/utils/introspection/IERC165Upgradeable.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 IERC165Upgradeable {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0xc6cef87559d0aeffdf0a99803de655938a7779ec0a3cd5d4383483ad85565a09\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\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 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 `recipient`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address recipient, 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 `sender` to `recipient` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address sender,\\n address recipient,\\n uint256 amount\\n ) external returns (bool);\\n\\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\",\"keccak256\":\"0x027b891937d20ccf213fdb9c31531574256de774bda99d3a70ecef6e1913ed2a\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\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\":\"0x83fe24f5c04a56091e50f4a345ff504c8bff658a76d4c43b16878c8f940c53b2\",\"license\":\"MIT\"},\"contracts/dependencies/stargate-protocol/interfaces/IStargateComposer.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./IStargateRouter.sol\\\";\\n\\ninterface IStargateComposer {\\n function swap(\\n uint16 _dstChainId,\\n uint256 _srcPoolId,\\n uint256 _dstPoolId,\\n address payable _refundAddress,\\n uint256 _amountLD,\\n uint256 _minAmountLD,\\n IStargateRouter.lzTxObj memory _lzTxParams,\\n bytes calldata _to,\\n bytes calldata _payload\\n ) external payable;\\n\\n function factory() external view returns (address);\\n\\n function stargateBridge() external view returns (address);\\n\\n function stargateRouter() external view returns (IStargateRouter);\\n\\n function quoteLayerZeroFee(\\n uint16 _dstChainId,\\n uint8 _functionType,\\n bytes calldata _toAddress,\\n bytes calldata _transferAndCallPayload,\\n IStargateRouter.lzTxObj memory _lzTxParams\\n ) external view returns (uint256, uint256);\\n\\n function peers(uint16 _chainId) external view returns (address);\\n}\\n\",\"keccak256\":\"0xdfdd1690bf176ac05803534a60227be90cc435b4bdd8fce2348f1a9417a9f63a\",\"license\":\"BUSL-1.1\"},\"contracts/dependencies/stargate-protocol/interfaces/IStargateReceiver.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\n\\npragma solidity 0.8.9;\\n\\ninterface IStargateReceiver {\\n function sgReceive(\\n uint16 _chainId,\\n bytes memory _srcAddress,\\n uint256 _nonce,\\n address _token,\\n uint256 amountLD,\\n bytes memory payload\\n ) external;\\n}\\n\",\"keccak256\":\"0xe4d6bf9fa422e5e43dc1b6880f951d06611a4ed12c2dd7dd8c0b6a5d9e06ad0d\",\"license\":\"BUSL-1.1\"},\"contracts/dependencies/stargate-protocol/interfaces/IStargateRouter.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\n\\npragma solidity 0.8.9;\\n\\ninterface IStargateRouter {\\n struct lzTxObj {\\n uint256 dstGasForCall;\\n uint256 dstNativeAmount;\\n bytes dstNativeAddr;\\n }\\n\\n function addLiquidity(uint256 _poolId, uint256 _amountLD, address _to) external;\\n\\n function swap(\\n uint16 _dstChainId,\\n uint256 _srcPoolId,\\n uint256 _dstPoolId,\\n address payable _refundAddress,\\n uint256 _amountLD,\\n uint256 _minAmountLD,\\n lzTxObj memory _lzTxParams,\\n bytes calldata _to,\\n bytes calldata _payload\\n ) external payable;\\n\\n function redeemRemote(\\n uint16 _dstChainId,\\n uint256 _srcPoolId,\\n uint256 _dstPoolId,\\n address payable _refundAddress,\\n uint256 _amountLP,\\n uint256 _minAmountLD,\\n bytes calldata _to,\\n lzTxObj memory _lzTxParams\\n ) external payable;\\n\\n function instantRedeemLocal(uint16 _srcPoolId, uint256 _amountLP, address _to) external returns (uint256);\\n\\n function redeemLocal(\\n uint16 _dstChainId,\\n uint256 _srcPoolId,\\n uint256 _dstPoolId,\\n address payable _refundAddress,\\n uint256 _amountLP,\\n bytes calldata _to,\\n lzTxObj memory _lzTxParams\\n ) external payable;\\n\\n function sendCredits(\\n uint16 _dstChainId,\\n uint256 _srcPoolId,\\n uint256 _dstPoolId,\\n address payable _refundAddress\\n ) external payable;\\n\\n function quoteLayerZeroFee(\\n uint16 _dstChainId,\\n uint8 _functionType,\\n bytes calldata _toAddress,\\n bytes calldata _transferAndCallPayload,\\n lzTxObj memory _lzTxParams\\n ) external view returns (uint256, uint256);\\n\\n function clearCachedSwap(uint16 _srcChainId, bytes calldata _srcAddress, uint256 _nonce) external;\\n\\n function factory() external view returns (address);\\n\\n function bridge() external view returns (address);\\n\\n function cachedSwapLookup(\\n uint16 _chainId_,\\n bytes calldata _srcAddress,\\n uint256 _nonce\\n ) external view returns (address token, uint256 amountLD, address to, bytes memory payload);\\n}\\n\",\"keccak256\":\"0x92126df8e682b2c5647c7b22e7387da69f9e72480af86948ce5ed17dc2c9e0a7\",\"license\":\"BUSL-1.1\"},\"contracts/interfaces/ICrossChainDispatcher.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/composable/IOFTReceiverUpgradeable.sol\\\";\\nimport \\\"../dependencies/stargate-protocol/interfaces/IStargateReceiver.sol\\\";\\nimport \\\"../dependencies/stargate-protocol/interfaces/IStargateRouter.sol\\\";\\nimport \\\"../dependencies/stargate-protocol/interfaces/IStargateComposer.sol\\\";\\nimport \\\"./IProxyOFT.sol\\\";\\n\\ninterface ICrossChainDispatcher is IStargateReceiver, IOFTReceiverUpgradeable {\\n function crossChainDispatcherOf(uint16 chainId_) external view returns (address);\\n\\n function triggerFlashRepaySwap(\\n uint256 id_,\\n address payable account_,\\n address tokenIn_,\\n address tokenOut_,\\n uint256 amountIn_,\\n uint256 amountOutMin_,\\n bytes calldata lzArgs_\\n ) external payable;\\n\\n function triggerLeverageSwap(\\n uint256 id_,\\n address payable account_,\\n address tokenIn_,\\n address tokenOut_,\\n uint256 amountIn_,\\n uint256 amountOutMin,\\n bytes calldata lzArgs_\\n ) external payable;\\n\\n function isBridgingActive() external view returns (bool);\\n\\n function flashRepayCallbackTxGasLimit() external view returns (uint64);\\n\\n function flashRepaySwapTxGasLimit() external view returns (uint64);\\n\\n function leverageCallbackTxGasLimit() external view returns (uint64);\\n\\n function leverageSwapTxGasLimit() external view returns (uint64);\\n\\n function lzBaseGasLimit() external view returns (uint256);\\n\\n function stargateComposer() external view returns (IStargateComposer);\\n\\n function stargateSlippage() external view returns (uint256);\\n\\n function stargatePoolIdOf(address token_) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xcaf05e625588dcfaa5706acc78a35fa46d50baeb2d28f689036963695a4e39cb\",\"license\":\"MIT\"},\"contracts/interfaces/IDebtToken.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/openzeppelin/token/ERC20/extensions/IERC20Metadata.sol\\\";\\nimport \\\"./ISyntheticToken.sol\\\";\\n\\ninterface IDebtToken is IERC20Metadata {\\n function lastTimestampAccrued() external view returns (uint256);\\n\\n function isActive() external view returns (bool);\\n\\n function syntheticToken() external view returns (ISyntheticToken);\\n\\n function accrueInterest() external;\\n\\n function debtIndex() external returns (uint256 debtIndex_);\\n\\n function burn(address from_, uint256 amount_) external;\\n\\n function issue(uint256 amount_, address to_) external returns (uint256 _issued, uint256 _fee);\\n\\n function flashIssue(address to_, uint256 amount_) external returns (uint256 _issued, uint256 _fee);\\n\\n function mint(address to_, uint256 amount_) external;\\n\\n function repay(address onBehalfOf_, uint256 amount_) external returns (uint256 _repaid, uint256 _fee);\\n\\n function repayAll(address onBehalfOf_) external returns (uint256 _repaid, uint256 _fee);\\n\\n function quoteIssueIn(uint256 amountToIssue_) external view returns (uint256 _amount, uint256 _fee);\\n\\n function quoteIssueOut(uint256 amount_) external view returns (uint256 _amountToIssue, uint256 _fee);\\n\\n function quoteRepayIn(uint256 amountToRepay_) external view returns (uint256 _amount, uint256 _fee);\\n\\n function quoteRepayOut(uint256 amount_) external view returns (uint256 _amountToRepay, uint256 _fee);\\n\\n function updateMaxTotalSupply(uint256 newMaxTotalSupply_) external;\\n\\n function updateInterestRate(uint256 newInterestRate_) external;\\n\\n function maxTotalSupply() external view returns (uint256);\\n\\n function interestRate() external view returns (uint256);\\n\\n function interestRatePerSecond() external view returns (uint256);\\n\\n function toggleIsActive() external;\\n}\\n\",\"keccak256\":\"0xd2f04aa1bee06d6991b10aaf7c03c3ee09d85f8e48ba92feac595ad855881380\",\"license\":\"MIT\"},\"contracts/interfaces/IGovernable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\n/**\\n * @notice Governable interface\\n */\\ninterface IGovernable {\\n function governor() external view returns (address _governor);\\n\\n function transferGovernorship(address _proposedGovernor) external;\\n}\\n\",\"keccak256\":\"0xbe84461adf33aec1bf31b6d84a5380aaeb791de9a4b95346dd8270dc6632984e\",\"license\":\"MIT\"},\"contracts/interfaces/IPauseable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\ninterface IPauseable {\\n function paused() external view returns (bool);\\n\\n function everythingStopped() external view returns (bool);\\n}\\n\",\"keccak256\":\"0xa768de9fadad05a8104cb407ae6243354e70ffd6e1a50c3e0bb0a6a1dc49d32a\",\"license\":\"MIT\"},\"contracts/interfaces/IPoolRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./external/IMasterOracle.sol\\\";\\nimport \\\"./IPauseable.sol\\\";\\nimport \\\"./IGovernable.sol\\\";\\nimport \\\"./ISyntheticToken.sol\\\";\\nimport \\\"./external/ISwapper.sol\\\";\\nimport \\\"./IQuoter.sol\\\";\\nimport \\\"./ICrossChainDispatcher.sol\\\";\\n\\ninterface IPoolRegistry is IPauseable, IGovernable {\\n function feeCollector() external view returns (address);\\n\\n function isPoolRegistered(address pool_) external view returns (bool);\\n\\n function nativeTokenGateway() external view returns (address);\\n\\n function getPools() external view returns (address[] memory);\\n\\n function registerPool(address pool_) external;\\n\\n function unregisterPool(address pool_) external;\\n\\n function masterOracle() external view returns (IMasterOracle);\\n\\n function updateFeeCollector(address newFeeCollector_) external;\\n\\n function idOfPool(address pool_) external view returns (uint256);\\n\\n function nextPoolId() external view returns (uint256);\\n\\n function swapper() external view returns (ISwapper);\\n\\n function quoter() external view returns (IQuoter);\\n\\n function crossChainDispatcher() external view returns (ICrossChainDispatcher);\\n\\n function doesSyntheticTokenExist(ISyntheticToken syntheticToken_) external view returns (bool _exists);\\n}\\n\",\"keccak256\":\"0x9ffa9e5fd39a48ac2bda561af7fb4fc9df5f8ffb7a602ef1d4da8c068019e723\",\"license\":\"MIT\"},\"contracts/interfaces/IProxyOFT.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/composable/IComposableOFTCoreUpgradeable.sol\\\";\\n\\ninterface IProxyOFT is IComposableOFTCoreUpgradeable {\\n function getProxyOFTOf(uint16 chainId_) external view returns (address _proxyOFT);\\n}\\n\",\"keccak256\":\"0x4041a90eb60de460c9e1631aaedfbf2bff2275b3f91964800b1c774546931cd5\",\"license\":\"MIT\"},\"contracts/interfaces/IQuoter.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./IPoolRegistry.sol\\\";\\nimport \\\"./IProxyOFT.sol\\\";\\n\\ninterface IQuoter {\\n function quoteCrossChainFlashRepayNativeFee(\\n IProxyOFT proxyOFT_,\\n bytes calldata lzArgs_\\n ) external view returns (uint256 _nativeFee);\\n\\n function quoteCrossChainLeverageNativeFee(\\n IProxyOFT proxyOFT_,\\n bytes calldata lzArgs_\\n ) external view returns (uint256 _nativeFee);\\n\\n function quoteLeverageCallbackNativeFee(uint16 dstChainId_) external view returns (uint256 _callbackTxNativeFee);\\n\\n function quoteFlashRepayCallbackNativeFee(uint16 dstChainId_) external view returns (uint256 _callbackTxNativeFee);\\n\\n function getFlashRepaySwapAndCallbackLzArgs(\\n uint16 srcChainId_,\\n uint16 dstChainId_\\n ) external view returns (bytes memory lzArgs_);\\n\\n function getLeverageSwapAndCallbackLzArgs(\\n uint16 srcChainId_,\\n uint16 dstChainId_\\n ) external view returns (bytes memory lzArgs_);\\n}\\n\",\"keccak256\":\"0x1e4d2dd779a09dc8ea6b6c244b167deddca3a48e71b73bf940da04113b40c752\",\"license\":\"MIT\"},\"contracts/interfaces/ISyntheticToken.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/openzeppelin/token/ERC20/extensions/IERC20Metadata.sol\\\";\\nimport \\\"./IDebtToken.sol\\\";\\nimport \\\"./IPoolRegistry.sol\\\";\\nimport \\\"../interfaces/IProxyOFT.sol\\\";\\n\\ninterface ISyntheticToken is IERC20Metadata {\\n function isActive() external view returns (bool);\\n\\n function mint(address to_, uint256 amount_) external;\\n\\n function burn(address from_, uint256 amount) external;\\n\\n function poolRegistry() external view returns (IPoolRegistry);\\n\\n function toggleIsActive() external;\\n\\n function seize(address from_, address to_, uint256 amount_) external;\\n\\n function updateMaxTotalSupply(uint256 newMaxTotalSupply_) external;\\n\\n function updateProxyOFT(IProxyOFT newProxyOFT_) external;\\n\\n function maxTotalSupply() external view returns (uint256);\\n\\n function proxyOFT() external view returns (IProxyOFT);\\n}\\n\",\"keccak256\":\"0xfaeb24d1067e85493a5c8818d6de06fc6dbc72c37e85f82811990d0120f8a0cf\",\"license\":\"MIT\"},\"contracts/interfaces/external/IMasterOracle.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\ninterface IMasterOracle {\\n function quoteTokenToUsd(address _asset, uint256 _amount) external view returns (uint256 _amountInUsd);\\n\\n function quoteUsdToToken(address _asset, uint256 _amountInUsd) external view returns (uint256 _amount);\\n\\n function quote(address _assetIn, address _assetOut, uint256 _amountIn) external view returns (uint256 _amountOut);\\n}\\n\",\"keccak256\":\"0x2f080adc5880151dc4446ef43b54abab8e3711c5f2e526917ef39a05e3c16a00\",\"license\":\"MIT\"},\"contracts/interfaces/external/IStargateBridge.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../../dependencies/@layerzerolabs/solidity-examples/interfaces/ILayerZeroEndpoint.sol\\\";\\n\\ninterface IStargateBridge {\\n function layerZeroEndpoint() external view returns (ILayerZeroEndpoint _lzEndpoint);\\n}\\n\",\"keccak256\":\"0x45007a6d6eb5d1041dc80f6912e10a89a990ee89078668a8e39648df11ce9d5b\",\"license\":\"MIT\"},\"contracts/interfaces/external/ISwapper.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\ninterface ISwapper {\\n function swapExactInput(\\n address tokenIn_,\\n address tokenOut_,\\n uint256 amountIn_,\\n uint256 amountOutMin_,\\n address receiver_\\n ) external returns (uint256 _amountOut);\\n}\\n\",\"keccak256\":\"0x75f04b225d0c310be7e0a09ee4c1aa6eeeb8d94e02fc0e4160a9597ce2d8d446\",\"license\":\"MIT\"},\"contracts/lib/CrossChainLib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nlibrary CrossChainLib {\\n /**\\n * @notice Supported cross-chain operations\\n */\\n uint8 public constant LEVERAGE = 1;\\n uint8 public constant FLASH_REPAY = 2;\\n\\n function getOperationType(bytes memory payload_) internal pure returns (uint8 _op) {\\n (_op, ) = abi.decode(payload_, (uint8, bytes));\\n }\\n\\n function encodeLeverageCallbackPayload(\\n address srcSmartFarmingManager_,\\n uint256 requestId_\\n ) internal pure returns (bytes memory _payload) {\\n return abi.encode(LEVERAGE, abi.encode(srcSmartFarmingManager_, requestId_));\\n }\\n\\n function decodeLeverageCallbackPayload(\\n bytes memory payload_\\n ) internal pure returns (address _srcSmartFarmingManager, uint256 _requestId) {\\n (, payload_) = abi.decode(payload_, (uint8, bytes));\\n return abi.decode(payload_, (address, uint256));\\n }\\n\\n function encodeFlashRepayCallbackPayload(\\n address srcProxyOFT_,\\n address srcSmartFarmingManager_,\\n uint256 requestId_\\n ) internal pure returns (bytes memory _payload) {\\n return abi.encode(FLASH_REPAY, abi.encode(srcProxyOFT_, srcSmartFarmingManager_, requestId_));\\n }\\n\\n function decodeFlashRepayCallbackPayload(\\n bytes memory payload_\\n ) internal pure returns (address srcProxyOFT_, address _srcSmartFarmingManager, uint256 _requestId) {\\n (, payload_) = abi.decode(payload_, (uint8, bytes));\\n return abi.decode(payload_, (address, address, uint256));\\n }\\n\\n function encodeFlashRepaySwapPayload(\\n address srcSmartFarmingManager_,\\n address dstProxyOFT_,\\n uint256 requestId_,\\n address account_,\\n uint256 amountOutMin_,\\n uint256 callbackTxNativeFee_\\n ) internal pure returns (bytes memory _payload) {\\n return\\n abi.encode(\\n FLASH_REPAY,\\n abi.encode(\\n srcSmartFarmingManager_,\\n dstProxyOFT_,\\n requestId_,\\n account_,\\n amountOutMin_,\\n callbackTxNativeFee_\\n )\\n );\\n }\\n\\n function decodeFlashRepaySwapPayload(\\n bytes memory payload_\\n )\\n internal\\n pure\\n returns (\\n address _srcSmartFarmingManager,\\n address _dstProxyOFT,\\n uint256 _requestId,\\n address _account,\\n uint256 _amountOutMin,\\n uint256 _callbackTxNativeFee\\n )\\n {\\n (, payload_) = abi.decode(payload_, (uint8, bytes));\\n return abi.decode(payload_, (address, address, uint256, address, uint256, uint256));\\n }\\n\\n function encodeLeverageSwapPayload(\\n address srcSmartFarmingManager_,\\n address dstProxyOFT_,\\n uint256 requestId_,\\n uint256 sgPoolId_,\\n address account_,\\n uint256 amountOutMin_,\\n uint256 callbackTxNativeFee_\\n ) internal pure returns (bytes memory _payload) {\\n return\\n abi.encode(\\n LEVERAGE,\\n abi.encode(\\n srcSmartFarmingManager_,\\n dstProxyOFT_,\\n requestId_,\\n sgPoolId_,\\n account_,\\n amountOutMin_,\\n callbackTxNativeFee_\\n )\\n );\\n }\\n\\n function decodeLeverageSwapPayload(\\n bytes memory payload_\\n )\\n internal\\n pure\\n returns (\\n address _srcSmartFarmingManager,\\n address _dstProxyOFT,\\n uint256 _requestId,\\n uint256 _sgPoolId,\\n address _account,\\n uint256 _amountOutMin,\\n uint256 _callbackTxNativeFee\\n )\\n {\\n (, payload_) = abi.decode(payload_, (uint8, bytes));\\n return abi.decode(payload_, (address, address, uint256, uint256, address, uint256, uint256));\\n }\\n\\n function encodeLzArgs(\\n uint16 dstChainId_,\\n uint256 callbackNativeFee_,\\n uint64 swapTxGasLimit_\\n ) internal pure returns (bytes memory _lzArgs) {\\n return abi.encode(dstChainId_, callbackNativeFee_, swapTxGasLimit_);\\n }\\n\\n function decodeLzArgs(\\n bytes memory lzArgs_\\n ) internal pure returns (uint16 _dstChainId, uint256 _callbackNativeFee, uint64 _swapTxGasLimit) {\\n return abi.decode(lzArgs_, (uint16, uint256, uint64));\\n }\\n}\\n\",\"keccak256\":\"0x15b84cfe132b4641c5b8a6f04eed6a5a88fbbb0bd89ad7c167d98ad653ff1043\",\"license\":\"MIT\"},\"contracts/storage/QuoterStorage.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../interfaces/IPoolRegistry.sol\\\";\\nimport \\\"../interfaces/IQuoter.sol\\\";\\n\\nabstract contract QuoterStorageV1 is IQuoter {\\n /**\\n * @notice The pool registry contract\\n */\\n IPoolRegistry public poolRegistry;\\n}\\n\",\"keccak256\":\"0xe8520d98aa00781fe447be32fbc3f5b3b9f81577bc0fc161cf428bca40225926\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60806040523480156200001157600080fd5b506200001c62000022565b62000152565b6200002e60ff62000031565b50565b60008054610100900460ff1615620000ca578160ff1660011480156200006a575062000068306200014360201b62000da51760201c565b155b620000c25760405162461bcd60e51b815260206004820152602e60248201526000805160206200174383398151915260448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b506000919050565b60005460ff808416911610620001295760405162461bcd60e51b815260206004820152602e60248201526000805160206200174383398151915260448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401620000b9565b506000805460ff191660ff92909216919091179055600190565b6001600160a01b03163b151590565b6115e180620001626000396000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c8063cca8e39a11610071578063cca8e39a14610176578063d81e47d314610189578063e6a20ae61461019c578063e762fc3c146101b7578063eb9f7f18146101ca578063ffa1ad74146101d257600080fd5b806348dab843146100b95780634fbedeac146100e25780639a47014a14610103578063ab39c79414610116578063afcff50f14610130578063c4d66de814610161575b600080fd5b6100cc6100c73660046110e1565b6101f6565b6040516100d99190611167565b60405180910390f35b6100f56100f036600461118f565b610289565b6040519081526020016100d9565b6100cc6101113660046110e1565b6104c3565b61011e600181565b60405160ff90911681526020016100d9565b600054610149906201000090046001600160a01b031681565b6040516001600160a01b0390911681526020016100d9565b61017461016f366004611214565b610512565b005b6100f5610184366004611231565b6105c9565b6100f5610197366004611231565b61095e565b6101a4600181565b60405161ffff90911681526020016100d9565b6100f56101c536600461118f565b610b43565b6101a4600281565b6100cc604051806040016040528060058152602001640312e332e360dc1b81525081565b606061028282610205856105c9565b61020d610db4565b6001600160a01b031663e7f4c16b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561024557600080fd5b505afa158015610259573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061027d9190611266565b610e40565b9392505050565b6000806000806102ce86868080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610e8592505050565b6040516001627dd58f60e11b0319815261ffff8416600482015292955090935091506000906001600160a01b0389169063ff0454e29060240160206040518083038186803b15801561031f57600080fd5b505afa158015610333573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103579190611281565b604051602001610367919061129e565b6040516020818303038152906040529050610380610db4565b6001600160a01b0316633352b6086040518163ffffffff1660e01b815260040160206040518083038186803b1580156103b857600080fd5b505afa1580156103cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103f09190611281565b6001600160a01b0316630a512369856001846104226001600160a01b03806000196001600160a01b0360001980610eab565b60405180606001604052808967ffffffffffffffff1681526020018a8152602001888152506040518663ffffffff1660e01b81526004016104679594939291906112bb565b604080518083038186803b15801561047e57600080fd5b505afa158015610492573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104b69190611331565b5098975050505050505050565b6060610282826104d28561095e565b6104da610db4565b6001600160a01b031663e3d47ece6040518163ffffffff1660e01b815260040160206040518083038186803b15801561024557600080fd5b600061051e6001610f23565b90508015610536576000805461ff0019166101001790555b6001600160a01b03821661055d5760405163fb7566d760e01b815260040160405180910390fd5b6000805462010000600160b01b031916620100006001600160a01b0385160217905580156105c5576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050565b6000806105d4610db4565b90506000816001600160a01b03166362491b356040518163ffffffff1660e01b815260040160206040518083038186803b15801561061157600080fd5b505afa158015610625573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106499190611266565b90506000600133604051602001610660919061129e565b6040516020818303038152906040526001600160a01b03604051602001610687919061129e565b6040516020818303038152906040526000196106ad6001600160a01b0380600019610fb9565b866040516020016106c396959493929190611355565b6040516020818303038152906040529050826001600160a01b0316633352b6086040518163ffffffff1660e01b815260040160206040518083038186803b15801561070d57600080fd5b505afa158015610721573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107459190611281565b6001600160a01b031663e0b63dee6040518163ffffffff1660e01b815260040160206040518083038186803b15801561077d57600080fd5b505afa158015610791573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b59190611281565b6001600160a01b03166307968db16040518163ffffffff1660e01b815260040160206040518083038186803b1580156107ed57600080fd5b505afa158015610801573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108259190611281565b6001600160a01b03166340a7bb10863084600060028867ffffffffffffffff168a6001600160a01b0316636c77d24f6040518163ffffffff1660e01b815260040160206040518083038186803b15801561087e57600080fd5b505afa158015610892573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108b691906113bc565b6108c091906113d5565b6000806040516020016108d694939291906113fb565b6040516020818303038152906040526040518663ffffffff1660e01b8152600401610905959493929190611437565b604080518083038186803b15801561091c57600080fd5b505afa158015610930573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109549190611331565b5095945050505050565b600080610969610db4565b9050806001600160a01b0316633352b6086040518163ffffffff1660e01b815260040160206040518083038186803b1580156109a457600080fd5b505afa1580156109b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109dc9190611281565b6001600160a01b0316630a5123698460016001600160a01b03604051602001610a05919061129e565b604051602081830303815290604052610a276001600160a01b03600019610ffc565b6040518060600160405280886001600160a01b0316630b211f0f6040518163ffffffff1660e01b815260040160206040518083038186803b158015610a6b57600080fd5b505afa158015610a7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aa39190611266565b67ffffffffffffffff16815260200160008152602001604051806020016040528060008152508152506040518663ffffffff1660e01b8152600401610aec9594939291906112bb565b604080518083038186803b158015610b0357600080fd5b505afa158015610b17573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b3b9190611331565b509392505050565b60008060006060806000610b6e6001600160a01b0380600019806001600160a01b036000198061104d565b92506000610bb189898080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610e8592505050565b6040516001627dd58f60e11b0319815261ffff84166004820152929850935091506001600160a01b038b169063ff0454e29060240160206040518083038186803b158015610bfe57600080fd5b505afa158015610c12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c369190611281565b945060028267ffffffffffffffff16610c4d610db4565b6001600160a01b0316636c77d24f6040518163ffffffff1660e01b815260040160206040518083038186803b158015610c8557600080fd5b505afa158015610c99573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cbd91906113bc565b610cc791906113d5565b8287604051602001610cdc94939291906113fb565b604051602081830303815290604052925050886001600160a01b031663c8598dca8686604051602001610d0f919061129e565b60405160208183030381529060405260001987866000896040518863ffffffff1660e01b8152600401610d48979695949392919061148b565b604080518083038186803b158015610d5f57600080fd5b505afa158015610d73573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d979190611331565b509998505050505050505050565b6001600160a01b03163b151590565b60008060029054906101000a90046001600160a01b03166001600160a01b03166332c615b46040518163ffffffff1660e01b815260040160206040518083038186803b158015610e0357600080fd5b505afa158015610e17573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e3b9190611281565b905090565b6040805161ffff8516602082015290810183905267ffffffffffffffff8216606082810191909152906080015b60405160208183030381529060405290509392505050565b600080600083806020019051810190610e9e91906114fa565b9250925092509193909250565b604080516001600160a01b038881166020830152878116828401526060808301889052908616608083015260a0820185905260c08083018590528351808403909101815260e0830190935291610f08916002919061010001611539565b60405160208183030381529060405290509695505050505050565b60008054610100900460ff1615610f73578160ff166001148015610f465750303b155b610f6b5760405162461bcd60e51b8152600401610f629061155d565b60405180910390fd5b506000919050565b60005460ff808416911610610f9a5760405162461bcd60e51b8152600401610f629061155d565b506000805460ff191660ff92909216919091179055600190565b919050565b604080516001600160a01b03858116602083015284168183015260608082018490528251808303820181526080830190935291610e6d916002919060a001611539565b604080516001600160a01b038416602082015280820183905281518082038301815260608083019093526110369160019190608001611539565b604051602081830303815290604052905092915050565b604080516001600160a01b0389811660208301528881168284015260608083018990526080830188905290861660a083015260c0820185905260e0808301859052835180840390910181526101008301909352916110b2916001919061012001611539565b6040516020818303038152906040529050979650505050505050565b61ffff811681146110de57600080fd5b50565b600080604083850312156110f457600080fd5b82356110ff816110ce565b9150602083013561110f816110ce565b809150509250929050565b6000815180845260005b8181101561114057602081850181015186830182015201611124565b81811115611152576000602083870101525b50601f01601f19169290920160200192915050565b602081526000610282602083018461111a565b6001600160a01b03811681146110de57600080fd5b6000806000604084860312156111a457600080fd5b83356111af8161117a565b9250602084013567ffffffffffffffff808211156111cc57600080fd5b818601915086601f8301126111e057600080fd5b8135818111156111ef57600080fd5b87602082850101111561120157600080fd5b6020830194508093505050509250925092565b60006020828403121561122657600080fd5b81356102828161117a565b60006020828403121561124357600080fd5b8135610282816110ce565b805167ffffffffffffffff81168114610fb457600080fd5b60006020828403121561127857600080fd5b6102828261124e565b60006020828403121561129357600080fd5b81516102828161117a565b60609190911b6bffffffffffffffffffffffff1916815260140190565b61ffff8616815260ff8516602082015260a0604082015260006112e160a083018661111a565b82810360608401526112f3818661111a565b905082810360808401528351815260208401516020820152604084015160606040830152611324606083018261111a565b9998505050505050505050565b6000806040838503121561134457600080fd5b505080516020909101519092909150565b61ffff8716815260c06020820152600061137260c083018861111a565b8281036040840152611384818861111a565b9050856060840152828103608084015261139e818661111a565b91505067ffffffffffffffff831660a0830152979650505050505050565b6000602082840312156113ce57600080fd5b5051919050565b600082198211156113f657634e487b7160e01b600052601160045260246000fd5b500190565b60f09490941b6001600160f01b03191684526002840192909252602283015260601b6bffffffffffffffffffffffff1916604282015260560190565b61ffff861681526001600160a01b038516602082015260a0604082018190526000906114659083018661111a565b8415156060840152828103608084015261147f818561111a565b98975050505050505050565b61ffff8816815260e0602082015260006114a860e083018961111a565b87604084015282810360608401526114c0818861111a565b905067ffffffffffffffff8616608084015284151560a084015282810360c08401526114ec818561111a565b9a9950505050505050505050565b60008060006060848603121561150f57600080fd5b835161151a816110ce565b602085015190935091506115306040850161124e565b90509250925092565b60ff83168152604060208201526000611555604083018461111a565b949350505050565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b60608201526080019056fea2646970667358221220edf457f61c26fd0eeb84b3eb9a812d5a6d3017c4d6d2477e0364c8bdaa11a9d764736f6c63430008090033496e697469616c697a61626c653a20636f6e747261637420697320616c726561", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100b45760003560e01c8063cca8e39a11610071578063cca8e39a14610176578063d81e47d314610189578063e6a20ae61461019c578063e762fc3c146101b7578063eb9f7f18146101ca578063ffa1ad74146101d257600080fd5b806348dab843146100b95780634fbedeac146100e25780639a47014a14610103578063ab39c79414610116578063afcff50f14610130578063c4d66de814610161575b600080fd5b6100cc6100c73660046110e1565b6101f6565b6040516100d99190611167565b60405180910390f35b6100f56100f036600461118f565b610289565b6040519081526020016100d9565b6100cc6101113660046110e1565b6104c3565b61011e600181565b60405160ff90911681526020016100d9565b600054610149906201000090046001600160a01b031681565b6040516001600160a01b0390911681526020016100d9565b61017461016f366004611214565b610512565b005b6100f5610184366004611231565b6105c9565b6100f5610197366004611231565b61095e565b6101a4600181565b60405161ffff90911681526020016100d9565b6100f56101c536600461118f565b610b43565b6101a4600281565b6100cc604051806040016040528060058152602001640312e332e360dc1b81525081565b606061028282610205856105c9565b61020d610db4565b6001600160a01b031663e7f4c16b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561024557600080fd5b505afa158015610259573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061027d9190611266565b610e40565b9392505050565b6000806000806102ce86868080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610e8592505050565b6040516001627dd58f60e11b0319815261ffff8416600482015292955090935091506000906001600160a01b0389169063ff0454e29060240160206040518083038186803b15801561031f57600080fd5b505afa158015610333573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103579190611281565b604051602001610367919061129e565b6040516020818303038152906040529050610380610db4565b6001600160a01b0316633352b6086040518163ffffffff1660e01b815260040160206040518083038186803b1580156103b857600080fd5b505afa1580156103cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103f09190611281565b6001600160a01b0316630a512369856001846104226001600160a01b03806000196001600160a01b0360001980610eab565b60405180606001604052808967ffffffffffffffff1681526020018a8152602001888152506040518663ffffffff1660e01b81526004016104679594939291906112bb565b604080518083038186803b15801561047e57600080fd5b505afa158015610492573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104b69190611331565b5098975050505050505050565b6060610282826104d28561095e565b6104da610db4565b6001600160a01b031663e3d47ece6040518163ffffffff1660e01b815260040160206040518083038186803b15801561024557600080fd5b600061051e6001610f23565b90508015610536576000805461ff0019166101001790555b6001600160a01b03821661055d5760405163fb7566d760e01b815260040160405180910390fd5b6000805462010000600160b01b031916620100006001600160a01b0385160217905580156105c5576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050565b6000806105d4610db4565b90506000816001600160a01b03166362491b356040518163ffffffff1660e01b815260040160206040518083038186803b15801561061157600080fd5b505afa158015610625573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106499190611266565b90506000600133604051602001610660919061129e565b6040516020818303038152906040526001600160a01b03604051602001610687919061129e565b6040516020818303038152906040526000196106ad6001600160a01b0380600019610fb9565b866040516020016106c396959493929190611355565b6040516020818303038152906040529050826001600160a01b0316633352b6086040518163ffffffff1660e01b815260040160206040518083038186803b15801561070d57600080fd5b505afa158015610721573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107459190611281565b6001600160a01b031663e0b63dee6040518163ffffffff1660e01b815260040160206040518083038186803b15801561077d57600080fd5b505afa158015610791573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b59190611281565b6001600160a01b03166307968db16040518163ffffffff1660e01b815260040160206040518083038186803b1580156107ed57600080fd5b505afa158015610801573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108259190611281565b6001600160a01b03166340a7bb10863084600060028867ffffffffffffffff168a6001600160a01b0316636c77d24f6040518163ffffffff1660e01b815260040160206040518083038186803b15801561087e57600080fd5b505afa158015610892573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108b691906113bc565b6108c091906113d5565b6000806040516020016108d694939291906113fb565b6040516020818303038152906040526040518663ffffffff1660e01b8152600401610905959493929190611437565b604080518083038186803b15801561091c57600080fd5b505afa158015610930573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109549190611331565b5095945050505050565b600080610969610db4565b9050806001600160a01b0316633352b6086040518163ffffffff1660e01b815260040160206040518083038186803b1580156109a457600080fd5b505afa1580156109b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109dc9190611281565b6001600160a01b0316630a5123698460016001600160a01b03604051602001610a05919061129e565b604051602081830303815290604052610a276001600160a01b03600019610ffc565b6040518060600160405280886001600160a01b0316630b211f0f6040518163ffffffff1660e01b815260040160206040518083038186803b158015610a6b57600080fd5b505afa158015610a7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aa39190611266565b67ffffffffffffffff16815260200160008152602001604051806020016040528060008152508152506040518663ffffffff1660e01b8152600401610aec9594939291906112bb565b604080518083038186803b158015610b0357600080fd5b505afa158015610b17573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b3b9190611331565b509392505050565b60008060006060806000610b6e6001600160a01b0380600019806001600160a01b036000198061104d565b92506000610bb189898080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610e8592505050565b6040516001627dd58f60e11b0319815261ffff84166004820152929850935091506001600160a01b038b169063ff0454e29060240160206040518083038186803b158015610bfe57600080fd5b505afa158015610c12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c369190611281565b945060028267ffffffffffffffff16610c4d610db4565b6001600160a01b0316636c77d24f6040518163ffffffff1660e01b815260040160206040518083038186803b158015610c8557600080fd5b505afa158015610c99573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cbd91906113bc565b610cc791906113d5565b8287604051602001610cdc94939291906113fb565b604051602081830303815290604052925050886001600160a01b031663c8598dca8686604051602001610d0f919061129e565b60405160208183030381529060405260001987866000896040518863ffffffff1660e01b8152600401610d48979695949392919061148b565b604080518083038186803b158015610d5f57600080fd5b505afa158015610d73573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d979190611331565b509998505050505050505050565b6001600160a01b03163b151590565b60008060029054906101000a90046001600160a01b03166001600160a01b03166332c615b46040518163ffffffff1660e01b815260040160206040518083038186803b158015610e0357600080fd5b505afa158015610e17573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e3b9190611281565b905090565b6040805161ffff8516602082015290810183905267ffffffffffffffff8216606082810191909152906080015b60405160208183030381529060405290509392505050565b600080600083806020019051810190610e9e91906114fa565b9250925092509193909250565b604080516001600160a01b038881166020830152878116828401526060808301889052908616608083015260a0820185905260c08083018590528351808403909101815260e0830190935291610f08916002919061010001611539565b60405160208183030381529060405290509695505050505050565b60008054610100900460ff1615610f73578160ff166001148015610f465750303b155b610f6b5760405162461bcd60e51b8152600401610f629061155d565b60405180910390fd5b506000919050565b60005460ff808416911610610f9a5760405162461bcd60e51b8152600401610f629061155d565b506000805460ff191660ff92909216919091179055600190565b919050565b604080516001600160a01b03858116602083015284168183015260608082018490528251808303820181526080830190935291610e6d916002919060a001611539565b604080516001600160a01b038416602082015280820183905281518082038301815260608083019093526110369160019190608001611539565b604051602081830303815290604052905092915050565b604080516001600160a01b0389811660208301528881168284015260608083018990526080830188905290861660a083015260c0820185905260e0808301859052835180840390910181526101008301909352916110b2916001919061012001611539565b6040516020818303038152906040529050979650505050505050565b61ffff811681146110de57600080fd5b50565b600080604083850312156110f457600080fd5b82356110ff816110ce565b9150602083013561110f816110ce565b809150509250929050565b6000815180845260005b8181101561114057602081850181015186830182015201611124565b81811115611152576000602083870101525b50601f01601f19169290920160200192915050565b602081526000610282602083018461111a565b6001600160a01b03811681146110de57600080fd5b6000806000604084860312156111a457600080fd5b83356111af8161117a565b9250602084013567ffffffffffffffff808211156111cc57600080fd5b818601915086601f8301126111e057600080fd5b8135818111156111ef57600080fd5b87602082850101111561120157600080fd5b6020830194508093505050509250925092565b60006020828403121561122657600080fd5b81356102828161117a565b60006020828403121561124357600080fd5b8135610282816110ce565b805167ffffffffffffffff81168114610fb457600080fd5b60006020828403121561127857600080fd5b6102828261124e565b60006020828403121561129357600080fd5b81516102828161117a565b60609190911b6bffffffffffffffffffffffff1916815260140190565b61ffff8616815260ff8516602082015260a0604082015260006112e160a083018661111a565b82810360608401526112f3818661111a565b905082810360808401528351815260208401516020820152604084015160606040830152611324606083018261111a565b9998505050505050505050565b6000806040838503121561134457600080fd5b505080516020909101519092909150565b61ffff8716815260c06020820152600061137260c083018861111a565b8281036040840152611384818861111a565b9050856060840152828103608084015261139e818661111a565b91505067ffffffffffffffff831660a0830152979650505050505050565b6000602082840312156113ce57600080fd5b5051919050565b600082198211156113f657634e487b7160e01b600052601160045260246000fd5b500190565b60f09490941b6001600160f01b03191684526002840192909252602283015260601b6bffffffffffffffffffffffff1916604282015260560190565b61ffff861681526001600160a01b038516602082015260a0604082018190526000906114659083018661111a565b8415156060840152828103608084015261147f818561111a565b98975050505050505050565b61ffff8816815260e0602082015260006114a860e083018961111a565b87604084015282810360608401526114c0818861111a565b905067ffffffffffffffff8616608084015284151560a084015282810360c08401526114ec818561111a565b9a9950505050505050505050565b60008060006060848603121561150f57600080fd5b835161151a816110ce565b602085015190935091506115306040850161124e565b90509250925092565b60ff83168152604060208201526000611555604083018461111a565b949350505050565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b60608201526080019056fea2646970667358221220edf457f61c26fd0eeb84b3eb9a812d5a6d3017c4d6d2477e0364c8bdaa11a9d764736f6c63430008090033", "devdoc": { "kind": "dev", "methods": { @@ -355,7 +355,7 @@ "storageLayout": { "storage": [ { - "astId": 19718, + "astId": 19848, "contract": "contracts/Quoter.sol:Quoter", "label": "_initialized", "offset": 0, @@ -363,7 +363,7 @@ "type": "t_uint8" }, { - "astId": 19721, + "astId": 19851, "contract": "contracts/Quoter.sol:Quoter", "label": "_initializing", "offset": 1, @@ -371,12 +371,12 @@ "type": "t_bool" }, { - "astId": 31185, + "astId": 31343, "contract": "contracts/Quoter.sol:Quoter", "label": "poolRegistry", "offset": 2, "slot": "0", - "type": "t_contract(IPoolRegistry)27964" + "type": "t_contract(IPoolRegistry)28094" } ], "types": { @@ -385,7 +385,7 @@ "label": "bool", "numberOfBytes": "1" }, - "t_contract(IPoolRegistry)27964": { + "t_contract(IPoolRegistry)28094": { "encoding": "inplace", "label": "contract IPoolRegistry", "numberOfBytes": "20" diff --git a/deployments/base/SmartFarmingManager.json b/deployments/base/SmartFarmingManager.json index 881b6b2..4cba49e 100644 --- a/deployments/base/SmartFarmingManager.json +++ b/deployments/base/SmartFarmingManager.json @@ -1,5 +1,5 @@ { - "address": "0xf55d146D5A496D6B5576a1661E8861cF5c5ffF9f", + "address": "0x1D62a9C4A8e7D38E4d78B40de8278786f09696bD", "abi": [ { "inputs": [], @@ -802,28 +802,28 @@ "type": "function" } ], - "transactionHash": "0xe95091b0f4d9f987ae149786eb1c62d129ff14e52ee9457f5901c899a33c8adc", + "transactionHash": "0x60d053e636b8dc1072dbeeca290b17a2cc38a9e8e9be781b6bd8d2d185a3b110", "receipt": { "to": null, "from": "0xdf826ff6518e609E4cEE86299d40611C148099d5", - "contractAddress": "0xf55d146D5A496D6B5576a1661E8861cF5c5ffF9f", - "transactionIndex": 36, - "gasUsed": "4128957", + "contractAddress": "0x1D62a9C4A8e7D38E4d78B40de8278786f09696bD", + "transactionIndex": 13, + "gasUsed": "4136047", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x1dc05df9688328a5c29330d1a92a46b715325bd33c3d3d4ddf90649e2bc88568", - "transactionHash": "0xe95091b0f4d9f987ae149786eb1c62d129ff14e52ee9457f5901c899a33c8adc", + "blockHash": "0x413bbe2551aff5d51cc4b69876e3f3f83b09e791e7f05d529d945ee27a6a313c", + "transactionHash": "0x60d053e636b8dc1072dbeeca290b17a2cc38a9e8e9be781b6bd8d2d185a3b110", "logs": [], - "blockNumber": 14104352, - "cumulativeGasUsed": "8160855", + "blockNumber": 15058343, + "cumulativeGasUsed": "5398544", "status": 1, "byzantium": true }, "args": [], - "numDeployments": 1, - "solcInputHash": "05e4492217f7bda719dac100afeac118", - "metadata": "{\"compiler\":{\"version\":\"0.8.9+commit.e5eed63a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AmountIsTooHigh\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AmountIsZero\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BridgeTokenIsNull\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CrossChainFlashRepayInactive\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CrossChainRequestCompletedAlready\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CrossChainRequestInvalidKey\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DepositTokenDoesNotExist\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FlashRepaySlippageTooHigh\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IsShutdown\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LeverageSlippageTooHigh\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LeverageTooHigh\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LeverageTooLow\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PoolAddressIsNull\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PoolIsNull\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PositionIsNotHealthy\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SenderIsNotCrossChainDispatcher\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SyntheticDoesNotExist\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TokenInIsNull\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"CrossChainFlashRepayFinished\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"CrossChainFlashRepayStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"CrossChainLeverageFinished\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"CrossChainLeverageStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract ISyntheticToken\",\"name\":\"syntheticToken\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"contract IDepositToken\",\"name\":\"depositToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"withdrawn\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"repaid\",\"type\":\"uint256\"}],\"name\":\"FlashRepaid\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IERC20\",\"name\":\"tokenIn\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"contract IDepositToken\",\"name\":\"depositToken\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"contract ISyntheticToken\",\"name\":\"syntheticToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"leverage\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"issued\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"deposited\",\"type\":\"uint256\"}],\"name\":\"Leveraged\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"VERSION\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"crossChainDispatcher\",\"outputs\":[{\"internalType\":\"contract ICrossChainDispatcher\",\"name\":\"_crossChainDispatcher\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ISyntheticToken\",\"name\":\"syntheticToken_\",\"type\":\"address\"},{\"internalType\":\"contract IDepositToken\",\"name\":\"depositToken_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"withdrawAmount_\",\"type\":\"uint256\"},{\"internalType\":\"contract IERC20\",\"name\":\"bridgeToken_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"bridgeTokenAmountMin_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"swapAmountOutMin_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"repayAmountMin_\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"lzArgs_\",\"type\":\"bytes\"}],\"name\":\"crossChainFlashRepay\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"swapAmountOut_\",\"type\":\"uint256\"}],\"name\":\"crossChainFlashRepayCallback\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_repaid\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"crossChainFlashRepays\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"dstChainId\",\"type\":\"uint16\"},{\"internalType\":\"contract ISyntheticToken\",\"name\":\"syntheticToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"repayAmountMin\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"finished\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"tokenIn_\",\"type\":\"address\"},{\"internalType\":\"contract ISyntheticToken\",\"name\":\"syntheticToken_\",\"type\":\"address\"},{\"internalType\":\"contract IERC20\",\"name\":\"bridgeToken_\",\"type\":\"address\"},{\"internalType\":\"contract IDepositToken\",\"name\":\"depositToken_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountIn_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"leverage_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"swapAmountOutMin_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"depositAmountMin_\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"lzArgs_\",\"type\":\"bytes\"}],\"name\":\"crossChainLeverage\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"contract IDepositToken\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"contract ISyntheticToken\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"crossChainLeverage\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"swapAmountOut_\",\"type\":\"uint256\"}],\"name\":\"crossChainLeverageCallback\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_deposited\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"crossChainLeverages\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"dstChainId\",\"type\":\"uint16\"},{\"internalType\":\"contract IERC20\",\"name\":\"bridgeToken\",\"type\":\"address\"},{\"internalType\":\"contract IDepositToken\",\"name\":\"depositToken\",\"type\":\"address\"},{\"internalType\":\"contract ISyntheticToken\",\"name\":\"syntheticToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"debtAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"depositAmountMin\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"finished\",\"type\":\"bool\"},{\"internalType\":\"contract IERC20\",\"name\":\"tokenIn\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"crossChainRequestsLength\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ISyntheticToken\",\"name\":\"syntheticToken_\",\"type\":\"address\"},{\"internalType\":\"contract IDepositToken\",\"name\":\"depositToken_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"withdrawAmount_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"repayAmountMin_\",\"type\":\"uint256\"}],\"name\":\"flashRepay\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_withdrawn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_repaid\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IPool\",\"name\":\"pool_\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"tokenIn_\",\"type\":\"address\"},{\"internalType\":\"contract IDepositToken\",\"name\":\"depositToken_\",\"type\":\"address\"},{\"internalType\":\"contract ISyntheticToken\",\"name\":\"syntheticToken_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountIn_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"leverage_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"depositAmountMin_\",\"type\":\"uint256\"}],\"name\":\"leverage\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_deposited\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_issued\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pool\",\"outputs\":[{\"internalType\":\"contract IPool\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"srcChainId_\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"srcAddress_\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"nonce_\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"amount_\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"payload_\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"newRepayAmountMin_\",\"type\":\"uint256\"}],\"name\":\"retryCrossChainFlashRepayCallback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"srcChainId_\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"srcAddress_\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"nonce_\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"token_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount_\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"payload_\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"newDepositAmountMin_\",\"type\":\"uint256\"}],\"name\":\"retryCrossChainLeverageCallback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"swapper\",\"outputs\":[{\"internalType\":\"contract ISwapper\",\"name\":\"_swapper\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"crossChainFlashRepayCallback(uint256,uint256)\":{\"details\":\"Receives msAsset from L1 and use it to repay\",\"params\":{\"id_\":\"The id of the request\",\"swapAmountOut_\":\"The msAsset amount received from L1 swap\"},\"returns\":{\"_repaid\":\"The debt amount repaid\"}},\"crossChainLeverage(address,address,address,uint256,uint256,uint256,uint256,bytes)\":{\"details\":\"Keep this function to avoid changing interface Refs: https://github.com/autonomoussoftware/metronome-synth/issues/877\"},\"crossChainLeverageCallback(uint256,uint256)\":{\"details\":\"Receives bridged token (aka naked token) use it to deposit\",\"params\":{\"id_\":\"The id of the request\",\"swapAmountOut_\":\"The amount received from swap\"},\"returns\":{\"_deposited\":\"The amount deposited\"}},\"flashRepay(address,address,uint256,uint256)\":{\"params\":{\"depositToken_\":\"The collateral to withdraw\",\"repayAmountMin_\":\"The minimum amount to repay (slippage check)\",\"syntheticToken_\":\"The debt token to repay\",\"withdrawAmount_\":\"The amount to withdraw\"}},\"governor()\":{\"returns\":{\"_governor\":\"The governor\"}},\"leverage(address,address,address,uint256,uint256,uint256)\":{\"params\":{\"amountIn_\":\"The amount to deposit\",\"depositAmountMin_\":\"The min final deposit amount (slippage)\",\"depositToken_\":\"The collateral to deposit\",\"leverage_\":\"The leverage X param (e.g. 1.5e18 for 1.5X)\",\"syntheticToken_\":\"The msAsset to mint\",\"tokenIn_\":\"The token to transfer\"}},\"retryCrossChainFlashRepayCallback(uint16,bytes,uint64,uint256,bytes,uint256)\":{\"details\":\"This function is used to recover from callback failures due to slippage\",\"params\":{\"amount_\":\"The amount of failed tx\",\"newRepayAmountMin_\":\"If repayment failed due to slippage, caller may send lower newRepayAmountMin_\",\"nonce_\":\"The nonce of failed tx\",\"payload_\":\"The payload of failed tx\",\"srcAddress_\":\"The source path of failed tx\",\"srcChainId_\":\"The source chain of failed tx\"}},\"retryCrossChainLeverageCallback(uint16,bytes,uint64,address,uint256,bytes,uint256)\":{\"details\":\"This function is used to recover from callback failures due to slippage\",\"params\":{\"amount_\":\"The amountIn of failed tx\",\"newDepositAmountMin_\":\"If deposit failed due to slippage, caller may send lower newDepositAmountMin_\",\"nonce_\":\"The nonce of failed tx\",\"payload_\":\"The payload of failed tx\",\"srcAddress_\":\"The source path of failed tx\",\"srcChainId_\":\"The source chain of failed tx\",\"token_\":\"The token of failed tx\"}}},\"title\":\"SmartFarmingManager contract\",\"version\":1},\"userdoc\":{\"events\":{\"CrossChainFlashRepayFinished(uint256)\":{\"notice\":\"Emitted when a cross-chain flash repay request is finalized\"},\"CrossChainFlashRepayStarted(uint256)\":{\"notice\":\"Emitted when a cross-chain flash repay request is created\"},\"CrossChainLeverageFinished(uint256)\":{\"notice\":\"Emitted when a cross-chain leverage request is finalized\"},\"CrossChainLeverageStarted(uint256)\":{\"notice\":\"Emitted when a cross-chain leverage request is created\"},\"FlashRepaid(address,address,uint256,uint256)\":{\"notice\":\"Emitted when debt is flash repaid\"},\"Leveraged(address,address,address,uint256,uint256,uint256,uint256)\":{\"notice\":\"Emitted when deposit is leveraged\"}},\"kind\":\"user\",\"methods\":{\"crossChainDispatcher()\":{\"notice\":\"Get the Cross-chain dispatcher contract\"},\"crossChainFlashRepayCallback(uint256,uint256)\":{\"notice\":\"Finalize cross-chain flash debt repayment process\"},\"crossChainFlashRepays(uint256)\":{\"notice\":\"Cross-chain flash repay requests\"},\"crossChainLeverageCallback(uint256,uint256)\":{\"notice\":\"Finalize cross-chain leverage process\"},\"crossChainLeverages(uint256)\":{\"notice\":\"Cross-chain leverage requests\"},\"crossChainRequestsLength()\":{\"notice\":\"Cross-chain requests counter\"},\"flashRepay(address,address,uint256,uint256)\":{\"notice\":\"Flash debt repayment\"},\"governor()\":{\"notice\":\"Get the governor\"},\"leverage(address,address,address,uint256,uint256,uint256)\":{\"notice\":\"Leverage yield position\"},\"pool()\":{\"notice\":\"Pool contract\"},\"retryCrossChainFlashRepayCallback(uint16,bytes,uint64,uint256,bytes,uint256)\":{\"notice\":\"Retry cross-chain flash repay callback\"},\"retryCrossChainLeverageCallback(uint16,bytes,uint64,address,uint256,bytes,uint256)\":{\"notice\":\"Retry cross-chain leverage callback\"},\"swapper()\":{\"notice\":\"Get the swapper contract\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/SmartFarmingManager.sol\":\"SmartFarmingManager\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/SmartFarmingManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./utils/ReentrancyGuard.sol\\\";\\nimport \\\"./dependencies/openzeppelin/token/ERC20/utils/SafeERC20.sol\\\";\\nimport \\\"./dependencies/openzeppelin/utils/math/Math.sol\\\";\\nimport \\\"./interfaces/external/IStargateComposerWithRetry.sol\\\";\\nimport \\\"./access/Manageable.sol\\\";\\nimport \\\"./storage/SmartFarmingManagerStorage.sol\\\";\\nimport \\\"./lib/WadRayMath.sol\\\";\\nimport \\\"./lib/CrossChainLib.sol\\\";\\n\\nerror SyntheticDoesNotExist();\\nerror PoolIsNull();\\nerror FlashRepaySlippageTooHigh();\\nerror LeverageTooLow();\\nerror LeverageTooHigh();\\nerror LeverageSlippageTooHigh();\\nerror PositionIsNotHealthy();\\nerror AmountIsZero();\\nerror AmountIsTooHigh();\\nerror DepositTokenDoesNotExist();\\nerror AddressIsNull();\\nerror NewValueIsSameAsCurrent();\\nerror CrossChainRequestInvalidKey();\\nerror SenderIsNotCrossChainDispatcher();\\nerror CrossChainRequestCompletedAlready();\\nerror TokenInIsNull();\\nerror BridgeTokenIsNull();\\nerror CrossChainFlashRepayInactive();\\n\\n// Note: The `IPoolRegistry` wasn't updated to avoid changing interface\\n// Refs: https://github.com/autonomoussoftware/metronome-synth/issues/877\\ninterface IPoolRegistryV3 is IPoolRegistry {\\n function isCrossChainFlashRepayActive() external view returns (bool);\\n}\\n\\n/**\\n * @title SmartFarmingManager contract\\n */\\ncontract SmartFarmingManager is ReentrancyGuard, Manageable, SmartFarmingManagerStorageV1 {\\n using SafeERC20 for IERC20;\\n using SafeERC20 for ISyntheticToken;\\n using WadRayMath for uint256;\\n\\n string public constant VERSION = \\\"1.3.0\\\";\\n\\n /// @notice Emitted when a cross-chain leverage request is finalized\\n event CrossChainLeverageFinished(uint256 indexed id);\\n\\n /// @notice Emitted when a cross-chain leverage request is created\\n event CrossChainLeverageStarted(uint256 indexed id);\\n\\n /// @notice Emitted when a cross-chain flash repay request is finalized\\n event CrossChainFlashRepayFinished(uint256 indexed id);\\n\\n /// @notice Emitted when a cross-chain flash repay request is created\\n event CrossChainFlashRepayStarted(uint256 indexed id);\\n\\n /// @notice Emitted when debt is flash repaid\\n event FlashRepaid(\\n ISyntheticToken indexed syntheticToken,\\n IDepositToken indexed depositToken,\\n uint256 withdrawn,\\n uint256 repaid\\n );\\n\\n /// @notice Emitted when deposit is leveraged\\n event Leveraged(\\n IERC20 indexed tokenIn,\\n IDepositToken indexed depositToken,\\n ISyntheticToken indexed syntheticToken,\\n uint256 leverage,\\n uint256 amountIn,\\n uint256 issued,\\n uint256 deposited\\n );\\n\\n /**\\n * @dev Throws if sender isn't a valid ProxyOFT contract\\n */\\n modifier onlyIfCrossChainDispatcher() {\\n if (msg.sender != address(crossChainDispatcher())) revert SenderIsNotCrossChainDispatcher();\\n _;\\n }\\n\\n /**\\n * @dev Throws if deposit token doesn't exist\\n */\\n modifier onlyIfDepositTokenExists(IDepositToken depositToken_) {\\n if (!pool.doesDepositTokenExist(depositToken_)) revert DepositTokenDoesNotExist();\\n _;\\n }\\n\\n /**\\n * @dev Throws if synthetic token doesn't exist\\n */\\n modifier onlyIfSyntheticTokenExists(ISyntheticToken syntheticToken_) {\\n if (!pool.doesSyntheticTokenExist(syntheticToken_)) revert SyntheticDoesNotExist();\\n _;\\n }\\n\\n constructor() {\\n _disableInitializers();\\n }\\n\\n function initialize(IPool pool_) public initializer {\\n if (address(pool_) == address(0)) revert PoolIsNull();\\n __ReentrancyGuard_init();\\n __Manageable_init(pool_);\\n }\\n\\n /**\\n * @notice Get the Cross-chain dispatcher contract\\n */\\n function crossChainDispatcher() public view returns (ICrossChainDispatcher _crossChainDispatcher) {\\n return pool.poolRegistry().crossChainDispatcher();\\n }\\n\\n /***\\n * @notice Cross-chain flash debt repayment\\n * @dev Not calling `whenNotShutdown` here because nested function already does it\\n * @param syntheticToken_ The debt token to repay\\n * @param depositToken_ The collateral to withdraw\\n * @param withdrawAmount_ The amount to withdraw\\n * @param bridgeToken_ The asset that will be bridged out and used to swap for msAsset\\n * @param bridgeTokenAmountMin_ The minimum amount out when converting collateral for bridgeToken if they aren't the same (slippage check)\\n * @param swapAmountOutMin_ The minimum amount out from the bridgeToken->msAsset swap (slippage check)\\n * @param repayAmountMin_ The minimum amount to repay (slippage check)\\n * @param lzArgs_ The LayerZero params (See: `Quoter.getFlashRepaySwapAndCallbackLzArgs()`)\\n */\\n function crossChainFlashRepay(\\n ISyntheticToken syntheticToken_,\\n IDepositToken depositToken_,\\n uint256 withdrawAmount_,\\n IERC20 bridgeToken_,\\n uint256 bridgeTokenAmountMin_,\\n uint256 swapAmountOutMin_,\\n uint256 repayAmountMin_,\\n bytes calldata lzArgs_\\n )\\n external\\n payable\\n override\\n nonReentrant\\n onlyIfDepositTokenExists(depositToken_)\\n onlyIfSyntheticTokenExists(syntheticToken_)\\n {\\n if (withdrawAmount_ == 0) revert AmountIsZero();\\n if (!IPoolRegistryV3(address(pool.poolRegistry())).isCrossChainFlashRepayActive())\\n revert CrossChainFlashRepayInactive();\\n\\n ICrossChainDispatcher _crossChainDispatcher;\\n {\\n IDebtToken _debtToken = pool.debtTokenOf(syntheticToken_);\\n _debtToken.accrueInterest();\\n if (repayAmountMin_ > _debtToken.balanceOf(msg.sender)) revert AmountIsTooHigh();\\n\\n _crossChainDispatcher = crossChainDispatcher();\\n }\\n\\n uint256 _amountIn;\\n {\\n // 1. withdraw collateral\\n // Note: No need to check healthy because this function ensures withdrawing only from unlocked balance\\n (_amountIn, ) = depositToken_.withdrawFrom(msg.sender, withdrawAmount_);\\n\\n // 2. swap collateral for bridge token\\n _amountIn = _swap({\\n swapper_: swapper(),\\n tokenIn_: _collateralOf(depositToken_),\\n tokenOut_: bridgeToken_,\\n amountIn_: _amountIn,\\n amountOutMin_: bridgeTokenAmountMin_,\\n to_: address(_crossChainDispatcher)\\n });\\n }\\n\\n // 3. store request and trigger swap\\n _triggerFlashRepaySwap({\\n crossChainDispatcher_: _crossChainDispatcher,\\n swapTokenIn_: bridgeToken_,\\n swapTokenOut_: syntheticToken_,\\n swapAmountIn_: _amountIn,\\n swapAmountOutMin_: swapAmountOutMin_,\\n repayAmountMin_: repayAmountMin_,\\n lzArgs_: lzArgs_\\n });\\n }\\n\\n /**\\n * @dev Stores flash repay cross-chain request and triggers swap on the destination chain\\n */\\n function _triggerFlashRepaySwap(\\n ICrossChainDispatcher crossChainDispatcher_,\\n IERC20 swapTokenIn_,\\n ISyntheticToken swapTokenOut_,\\n uint256 swapAmountIn_,\\n uint256 swapAmountOutMin_,\\n uint256 repayAmountMin_,\\n bytes calldata lzArgs_\\n ) private {\\n uint256 _id = _nextCrossChainRequestId();\\n\\n (uint16 _dstChainId, , ) = CrossChainLib.decodeLzArgs(lzArgs_);\\n\\n crossChainFlashRepays[_id] = CrossChainFlashRepay({\\n dstChainId: _dstChainId,\\n syntheticToken: swapTokenOut_,\\n repayAmountMin: repayAmountMin_,\\n account: msg.sender,\\n finished: false\\n });\\n\\n crossChainDispatcher_.triggerFlashRepaySwap{value: msg.value}({\\n id_: _id,\\n account_: payable(msg.sender),\\n tokenIn_: address(swapTokenIn_),\\n tokenOut_: address(swapTokenOut_),\\n amountIn_: swapAmountIn_,\\n amountOutMin_: swapAmountOutMin_,\\n lzArgs_: lzArgs_\\n });\\n\\n emit CrossChainFlashRepayStarted(_id);\\n }\\n\\n /**\\n * @notice Finalize cross-chain flash debt repayment process\\n * @dev Receives msAsset from L1 and use it to repay\\n * @param id_ The id of the request\\n * @param swapAmountOut_ The msAsset amount received from L1 swap\\n * @return _repaid The debt amount repaid\\n */\\n function crossChainFlashRepayCallback(\\n uint256 id_,\\n uint256 swapAmountOut_\\n ) external override whenNotShutdown nonReentrant onlyIfCrossChainDispatcher returns (uint256 _repaid) {\\n CrossChainFlashRepay memory _request = crossChainFlashRepays[id_];\\n\\n if (_request.account == address(0)) revert CrossChainRequestInvalidKey();\\n if (_request.finished) revert CrossChainRequestCompletedAlready();\\n\\n // 1. update state\\n crossChainFlashRepays[id_].finished = true;\\n\\n // 2. transfer synthetic token\\n swapAmountOut_ = _safeTransferFrom(_request.syntheticToken, msg.sender, swapAmountOut_);\\n\\n // 3. repay debt\\n IDebtToken _debtToken = pool.debtTokenOf(_request.syntheticToken);\\n (uint256 _maxRepayAmount, ) = _debtToken.quoteRepayIn(_debtToken.balanceOf(_request.account));\\n uint256 _repayAmount = Math.min(swapAmountOut_, _maxRepayAmount);\\n (_repaid, ) = _debtToken.repay(_request.account, _repayAmount);\\n if (_repaid < _request.repayAmountMin) revert FlashRepaySlippageTooHigh();\\n\\n // 4. refund synthetic token in excess\\n if (swapAmountOut_ > _repayAmount) {\\n _request.syntheticToken.safeTransfer(_request.account, swapAmountOut_ - _repayAmount);\\n }\\n\\n emit CrossChainFlashRepayFinished(id_);\\n }\\n\\n /**\\n * @dev Keep this function to avoid changing interface\\n * Refs: https://github.com/autonomoussoftware/metronome-synth/issues/877\\n */\\n function crossChainLeverage(\\n IERC20,\\n IDepositToken,\\n ISyntheticToken,\\n uint256,\\n uint256,\\n uint256,\\n uint256,\\n bytes calldata\\n ) external payable override {\\n revert(\\\"deprecated\\\");\\n }\\n\\n /***\\n * @notice Cross-chain Leverage\\n * @dev Not calling `whenNotShutdown` here because nested function already does it\\n * @param tokenIn_ The token to transfer\\n * @param syntheticToken_ The msAsset to mint\\n * @param bridgeToken_ The asset that will be used to swap from msAsset and bridged back\\n * @param depositToken_ The collateral to deposit\\n * @param amountIn_ The amount to deposit\\n * @param leverage_ The leverage X param (e.g. 1.5e18 for 1.5X)\\n * @param swapAmountOutMin_ The minimum amount out from msAsset->bridgeToken swap (slippage check)\\n * @param depositAmountMin_ The minimum final amount to deposit (slippage check)\\n * @param lzArgs_ The LayerZero params (See: `Quoter.getLeverageSwapAndCallbackLzArgs()`)\\n */\\n function crossChainLeverage(\\n IERC20 tokenIn_,\\n ISyntheticToken syntheticToken_,\\n IERC20 bridgeToken_,\\n IDepositToken depositToken_,\\n uint256 amountIn_,\\n uint256 leverage_,\\n uint256 swapAmountOutMin_,\\n uint256 depositAmountMin_,\\n bytes calldata lzArgs_\\n )\\n external\\n payable\\n // Note: Not adding this function to the `ISmartFarmingInterface` to avoid changing interface\\n // Refs: https://github.com/autonomoussoftware/metronome-synth/issues/877\\n // override\\n nonReentrant\\n onlyIfDepositTokenExists(depositToken_)\\n onlyIfSyntheticTokenExists(syntheticToken_)\\n {\\n IERC20 _tokenIn = tokenIn_; // stack too deep\\n\\n if (amountIn_ == 0) revert AmountIsZero();\\n if (leverage_ <= 1e18) revert LeverageTooLow();\\n if (leverage_ > uint256(1e18).wadDiv(1e18 - depositToken_.collateralFactor())) revert LeverageTooHigh();\\n if (address(_tokenIn) == address(0)) revert TokenInIsNull();\\n if (address(bridgeToken_) == address(0)) revert BridgeTokenIsNull();\\n\\n uint256 _debtAmount;\\n uint256 _issued;\\n {\\n // 1. transfer tokenIn\\n amountIn_ = _safeTransferFrom(_tokenIn, msg.sender, amountIn_);\\n\\n // 2. mint synth\\n _debtAmount = _calculateLeverageDebtAmount(_tokenIn, syntheticToken_, amountIn_, leverage_);\\n (_issued, ) = pool.debtTokenOf(syntheticToken_).flashIssue(address(crossChainDispatcher()), _debtAmount);\\n }\\n\\n bytes memory _swapArgs = abi.encode(syntheticToken_, bridgeToken_, _issued, swapAmountOutMin_); // stack too deep\\n IDepositToken _depositToken = depositToken_; // stack too deep\\n\\n // 3. store request and trigger swap\\n _triggerCrossChainLeverageSwap({\\n tokenIn_: _tokenIn,\\n amountIn_: amountIn_,\\n debtAmount_: _debtAmount,\\n swapArgs_: _swapArgs,\\n depositToken_: _depositToken,\\n depositAmountMin_: depositAmountMin_,\\n lzArgs_: lzArgs_\\n });\\n }\\n\\n /**\\n * @dev Stores leverage cross-chain request and triggers swap on the destination chain\\n */\\n function _triggerCrossChainLeverageSwap(\\n IERC20 tokenIn_,\\n uint256 amountIn_,\\n uint256 debtAmount_,\\n bytes memory swapArgs_,\\n IDepositToken depositToken_,\\n uint256 depositAmountMin_,\\n bytes calldata lzArgs_\\n ) private {\\n uint256 _id = _nextCrossChainRequestId();\\n\\n (ISyntheticToken _swapTokenIn, IERC20 _swapTokenOut, uint256 _swapAmountIn, uint256 _swapAmountOutMin) = abi\\n .decode(swapArgs_, (ISyntheticToken, IERC20, uint256, uint256));\\n\\n {\\n (uint16 _dstChainId, , ) = CrossChainLib.decodeLzArgs(lzArgs_);\\n\\n crossChainLeverages[_id] = CrossChainLeverage({\\n dstChainId: _dstChainId,\\n tokenIn: tokenIn_,\\n syntheticToken: _swapTokenIn,\\n bridgeToken: _swapTokenOut,\\n depositToken: depositToken_,\\n amountIn: amountIn_,\\n debtAmount: debtAmount_,\\n depositAmountMin: depositAmountMin_,\\n account: msg.sender,\\n finished: false\\n });\\n }\\n\\n crossChainDispatcher().triggerLeverageSwap{value: msg.value}({\\n id_: _id,\\n account_: payable(msg.sender),\\n tokenIn_: address(_swapTokenIn),\\n tokenOut_: address(_swapTokenOut),\\n amountIn_: _swapAmountIn,\\n amountOutMin: _swapAmountOutMin,\\n lzArgs_: lzArgs_\\n });\\n\\n emit CrossChainLeverageStarted(_id);\\n }\\n\\n /**\\n * @notice Finalize cross-chain leverage process\\n * @dev Receives bridged token (aka naked token) use it to deposit\\n * @param id_ The id of the request\\n * @param swapAmountOut_ The amount received from swap\\n * @return _deposited The amount deposited\\n */\\n function crossChainLeverageCallback(\\n uint256 id_,\\n uint256 swapAmountOut_\\n ) external override whenNotShutdown nonReentrant onlyIfCrossChainDispatcher returns (uint256 _deposited) {\\n CrossChainLeverage memory _request = crossChainLeverages[id_];\\n\\n if (_request.account == address(0)) revert CrossChainRequestInvalidKey();\\n if (_request.finished) revert CrossChainRequestCompletedAlready();\\n IERC20 _collateral = _collateralOf(_request.depositToken);\\n\\n // 1. update state\\n crossChainLeverages[id_].finished = true;\\n\\n // 2. transfer swap's tokenOut (aka bridged token)\\n swapAmountOut_ = _safeTransferFrom(_request.bridgeToken, msg.sender, swapAmountOut_);\\n\\n // 3. swap received tokens for collateral if needed\\n // Note: The internal `_swap()` doesn't swap if `tokenIn` and `tokenOut` are the same\\n uint256 _depositAmount;\\n if (_request.tokenIn == _request.bridgeToken) {\\n _depositAmount = _swap(swapper(), _request.tokenIn, _collateral, _request.amountIn + swapAmountOut_, 0);\\n } else {\\n _depositAmount = _swap(swapper(), _request.tokenIn, _collateral, _request.amountIn, 0);\\n _depositAmount += _swap(swapper(), _request.bridgeToken, _collateral, swapAmountOut_, 0);\\n }\\n\\n if (_depositAmount < _request.depositAmountMin) revert LeverageSlippageTooHigh();\\n\\n // 4. deposit collateral\\n _collateral.safeApprove(address(_request.depositToken), 0);\\n _collateral.safeApprove(address(_request.depositToken), _depositAmount);\\n (_deposited, ) = _request.depositToken.deposit(_depositAmount, _request.account);\\n\\n // 5. mint debt\\n IPool _pool = pool;\\n _pool.debtTokenOf(_request.syntheticToken).mint(_request.account, _request.debtAmount);\\n\\n // 6. check the health of the outcome position\\n (bool _isHealthy, , , , ) = _pool.debtPositionOf(_request.account);\\n if (!_isHealthy) revert PositionIsNotHealthy();\\n\\n emit CrossChainLeverageFinished(id_);\\n }\\n\\n /**\\n * @notice Flash debt repayment\\n * @param syntheticToken_ The debt token to repay\\n * @param depositToken_ The collateral to withdraw\\n * @param withdrawAmount_ The amount to withdraw\\n * @param repayAmountMin_ The minimum amount to repay (slippage check)\\n */\\n function flashRepay(\\n ISyntheticToken syntheticToken_,\\n IDepositToken depositToken_,\\n uint256 withdrawAmount_,\\n uint256 repayAmountMin_\\n )\\n external\\n override\\n whenNotShutdown\\n nonReentrant\\n onlyIfDepositTokenExists(depositToken_)\\n onlyIfSyntheticTokenExists(syntheticToken_)\\n returns (uint256 _withdrawn, uint256 _repaid)\\n {\\n if (withdrawAmount_ == 0) revert AmountIsZero();\\n if (withdrawAmount_ > depositToken_.balanceOf(msg.sender)) revert AmountIsTooHigh();\\n IPool _pool = pool;\\n IDebtToken _debtToken = _pool.debtTokenOf(syntheticToken_);\\n if (repayAmountMin_ > _debtToken.balanceOf(msg.sender)) revert AmountIsTooHigh();\\n\\n // 1. withdraw collateral\\n (_withdrawn, ) = depositToken_.flashWithdraw(msg.sender, withdrawAmount_);\\n\\n // 2. swap it for synth\\n uint256 _amountToRepay = _swap(swapper(), _collateralOf(depositToken_), syntheticToken_, _withdrawn, 0);\\n\\n // 3. repay debt\\n (_repaid, ) = _debtToken.repay(msg.sender, _amountToRepay);\\n if (_repaid < repayAmountMin_) revert FlashRepaySlippageTooHigh();\\n\\n // 4. check the health of the outcome position\\n (bool _isHealthy, , , , ) = _pool.debtPositionOf(msg.sender);\\n if (!_isHealthy) revert PositionIsNotHealthy();\\n\\n emit FlashRepaid(syntheticToken_, depositToken_, _withdrawn, _repaid);\\n }\\n\\n /**\\n * @notice Leverage yield position\\n * @param tokenIn_ The token to transfer\\n * @param depositToken_ The collateral to deposit\\n * @param syntheticToken_ The msAsset to mint\\n * @param amountIn_ The amount to deposit\\n * @param leverage_ The leverage X param (e.g. 1.5e18 for 1.5X)\\n * @param depositAmountMin_ The min final deposit amount (slippage)\\n */\\n function leverage(\\n IERC20 tokenIn_,\\n IDepositToken depositToken_,\\n ISyntheticToken syntheticToken_,\\n uint256 amountIn_,\\n uint256 leverage_,\\n uint256 depositAmountMin_\\n )\\n external\\n override\\n whenNotShutdown\\n nonReentrant\\n onlyIfDepositTokenExists(depositToken_)\\n onlyIfSyntheticTokenExists(syntheticToken_)\\n returns (uint256 _deposited, uint256 _issued)\\n {\\n if (amountIn_ == 0) revert AmountIsZero();\\n if (leverage_ <= 1e18) revert LeverageTooLow();\\n if (leverage_ > uint256(1e18).wadDiv(1e18 - depositToken_.collateralFactor())) revert LeverageTooHigh();\\n\\n ISwapper _swapper = swapper();\\n\\n // 1. transfer collateral\\n IERC20 _collateral = _collateralOf(depositToken_);\\n if (address(tokenIn_) == address(0)) tokenIn_ = _collateral;\\n amountIn_ = _safeTransferFrom(tokenIn_, msg.sender, amountIn_);\\n if (tokenIn_ != _collateral) {\\n // Note: `amountOutMin_` is `0` because slippage will be checked later on\\n amountIn_ = _swap(_swapper, tokenIn_, _collateral, amountIn_, 0);\\n }\\n\\n {\\n // 2. mint synth + debt\\n uint256 _debtAmount = _calculateLeverageDebtAmount(_collateral, syntheticToken_, amountIn_, leverage_);\\n IDebtToken _debtToken = pool.debtTokenOf(syntheticToken_);\\n (_issued, ) = _debtToken.flashIssue(address(this), _debtAmount);\\n _debtToken.mint(msg.sender, _debtAmount);\\n }\\n\\n // 3. swap synth for collateral\\n uint256 _depositAmount = amountIn_ + _swap(_swapper, syntheticToken_, _collateral, _issued, 0);\\n if (_depositAmount < depositAmountMin_) revert LeverageSlippageTooHigh();\\n\\n // 4. deposit collateral\\n _collateral.safeApprove(address(depositToken_), 0);\\n _collateral.safeApprove(address(depositToken_), _depositAmount);\\n (_deposited, ) = depositToken_.deposit(_depositAmount, msg.sender);\\n\\n // 5. check the health of the outcome position\\n (bool _isHealthy, , , , ) = pool.debtPositionOf(msg.sender);\\n if (!_isHealthy) revert PositionIsNotHealthy();\\n\\n emit Leveraged(tokenIn_, depositToken_, syntheticToken_, leverage_, amountIn_, _issued, _deposited);\\n }\\n\\n /**\\n * @notice Retry cross-chain flash repay callback\\n * @dev This function is used to recover from callback failures due to slippage\\n * @param srcChainId_ The source chain of failed tx\\n * @param srcAddress_ The source path of failed tx\\n * @param nonce_ The nonce of failed tx\\n * @param amount_ The amount of failed tx\\n * @param payload_ The payload of failed tx\\n * @param newRepayAmountMin_ If repayment failed due to slippage, caller may send lower newRepayAmountMin_\\n */\\n function retryCrossChainFlashRepayCallback(\\n uint16 srcChainId_,\\n bytes calldata srcAddress_,\\n uint64 nonce_,\\n uint256 amount_,\\n bytes calldata payload_,\\n uint256 newRepayAmountMin_\\n ) external {\\n (, , uint256 _requestId) = CrossChainLib.decodeFlashRepayCallbackPayload(payload_);\\n\\n CrossChainFlashRepay memory _request = crossChainFlashRepays[_requestId];\\n\\n if (_request.account == address(0)) revert CrossChainRequestInvalidKey();\\n if (_request.finished) revert CrossChainRequestCompletedAlready();\\n\\n // Note: Only user can change slippage param\\n if (msg.sender == _request.account) {\\n crossChainFlashRepays[_requestId].repayAmountMin = newRepayAmountMin_;\\n }\\n\\n ICrossChainDispatcher _crossChainDispatcher = crossChainDispatcher();\\n bytes memory _from = abi.encodePacked(_crossChainDispatcher.crossChainDispatcherOf(srcChainId_));\\n\\n _request.syntheticToken.proxyOFT().retryOFTReceived({\\n _srcChainId: srcChainId_,\\n _srcAddress: srcAddress_,\\n _nonce: nonce_,\\n _from: _from,\\n _to: address(_crossChainDispatcher),\\n _amount: amount_,\\n _payload: payload_\\n });\\n }\\n\\n /**\\n * @notice Retry cross-chain leverage callback\\n * @dev This function is used to recover from callback failures due to slippage\\n * @param srcChainId_ The source chain of failed tx\\n * @param srcAddress_ The source path of failed tx\\n * @param nonce_ The nonce of failed tx\\n * @param token_ The token of failed tx\\n * @param amount_ The amountIn of failed tx\\n * @param payload_ The payload of failed tx\\n * @param newDepositAmountMin_ If deposit failed due to slippage, caller may send lower newDepositAmountMin_\\n */\\n function retryCrossChainLeverageCallback(\\n uint16 srcChainId_,\\n bytes calldata srcAddress_,\\n uint64 nonce_,\\n address token_,\\n uint256 amount_,\\n bytes calldata payload_,\\n uint256 newDepositAmountMin_\\n ) external {\\n (, uint256 _requestId) = CrossChainLib.decodeLeverageCallbackPayload(payload_);\\n\\n CrossChainLeverage memory _request = crossChainLeverages[_requestId];\\n\\n if (_request.account == address(0)) revert CrossChainRequestInvalidKey();\\n if (_request.finished) revert CrossChainRequestCompletedAlready();\\n\\n // Note: Only user can change slippage param\\n if (msg.sender == _request.account) {\\n crossChainLeverages[_requestId].depositAmountMin = newDepositAmountMin_;\\n }\\n\\n ICrossChainDispatcher _crossChainDispatcher = crossChainDispatcher();\\n\\n address _from = _crossChainDispatcher.crossChainDispatcherOf(srcChainId_);\\n bytes memory _sgReceiveCallData = abi.encodeWithSelector(\\n IStargateReceiver.sgReceive.selector,\\n srcChainId_,\\n abi.encodePacked(_from),\\n nonce_,\\n token_,\\n amount_,\\n payload_\\n );\\n\\n IStargateComposerWithRetry(address(_crossChainDispatcher.stargateComposer())).clearCachedSwap(\\n srcChainId_,\\n srcAddress_,\\n nonce_,\\n address(_crossChainDispatcher),\\n _sgReceiveCallData\\n );\\n }\\n\\n /**\\n * @notice Get the swapper contract\\n */\\n function swapper() public view returns (ISwapper _swapper) {\\n return pool.poolRegistry().swapper();\\n }\\n\\n /**\\n * @notice Calculate debt to issue for a leverage operation\\n * @param collateral_ The collateral to deposit\\n * @param syntheticToken_ The msAsset to mint\\n * @param amountIn_ The amount to deposit\\n * @param leverage_ The leverage X param (e.g. 1.5e18 for 1.5X)\\n * @return _debtAmount The debt issue\\n */\\n function _calculateLeverageDebtAmount(\\n IERC20 collateral_,\\n ISyntheticToken syntheticToken_,\\n uint256 amountIn_,\\n uint256 leverage_\\n ) private view returns (uint256 _debtAmount) {\\n return\\n pool.masterOracle().quote(\\n address(collateral_),\\n address(syntheticToken_),\\n (leverage_ - 1e18).wadMul(amountIn_)\\n );\\n }\\n\\n /**\\n * @dev `collateral` is a better name than `underlying`\\n * See more: https://github.com/autonomoussoftware/metronome-synth/issues/905\\n */\\n function _collateralOf(IDepositToken depositToken_) private view returns (IERC20) {\\n return depositToken_.underlying();\\n }\\n\\n /**\\n * @dev Generates cross-chain request id by hashing `chainId`+`requestId` in order to avoid\\n * having same id across supported chains\\n * Note: The cross-chain code mostly uses LZ chain ids but in this case, we're using native id.\\n */\\n function _nextCrossChainRequestId() private returns (uint256 _id) {\\n return uint256(keccak256(abi.encode(block.chainid, ++crossChainRequestsLength)));\\n }\\n\\n /**\\n * @notice Transfer token and check actual amount transferred\\n * @param token_ The token to transfer\\n * @param from_ The account to get tokens from\\n * @param amount_ The amount to transfer\\n * @return _transferred The actual transferred amount\\n */\\n function _safeTransferFrom(IERC20 token_, address from_, uint256 amount_) private returns (uint256 _transferred) {\\n uint256 _before = token_.balanceOf(address(this));\\n token_.safeTransferFrom(from_, address(this), amount_);\\n return token_.balanceOf(address(this)) - _before;\\n }\\n\\n /**\\n * @notice Swap assets using Swapper contract\\n * @dev Use `address(this)` as amount out receiver\\n * @param swapper_ The Swapper contract\\n * @param tokenIn_ The token to swap from\\n * @param tokenOut_ The token to swap to\\n * @param amountIn_ The amount in\\n * @param amountOutMin_ The minimum amount out (slippage check)\\n * @return _amountOut The actual amount out\\n */\\n function _swap(\\n ISwapper swapper_,\\n IERC20 tokenIn_,\\n IERC20 tokenOut_,\\n uint256 amountIn_,\\n uint256 amountOutMin_\\n ) private returns (uint256 _amountOut) {\\n return _swap(swapper_, tokenIn_, tokenOut_, amountIn_, amountOutMin_, address(this));\\n }\\n\\n /**\\n * @notice Swap assets using Swapper contract\\n * @param swapper_ The Swapper contract\\n * @param tokenIn_ The token to swap from\\n * @param tokenOut_ The token to swap to\\n * @param amountIn_ The amount in\\n * @param amountOutMin_ The minimum amount out (slippage check)\\n * @param to_ The amount out receiver\\n * @return _amountOut The actual amount out\\n */\\n function _swap(\\n ISwapper swapper_,\\n IERC20 tokenIn_,\\n IERC20 tokenOut_,\\n uint256 amountIn_,\\n uint256 amountOutMin_,\\n address to_\\n ) private returns (uint256 _amountOut) {\\n if (tokenIn_ != tokenOut_) {\\n tokenIn_.safeApprove(address(swapper_), 0);\\n tokenIn_.safeApprove(address(swapper_), amountIn_);\\n uint256 _tokenOutBefore = tokenOut_.balanceOf(to_);\\n swapper_.swapExactInput(address(tokenIn_), address(tokenOut_), amountIn_, amountOutMin_, to_);\\n return tokenOut_.balanceOf(to_) - _tokenOutBefore;\\n } else if (to_ != address(this)) {\\n tokenIn_.safeTransfer(to_, amountIn_);\\n }\\n return amountIn_;\\n }\\n}\\n\",\"keccak256\":\"0x46eb3cbc628d86f4f06cce7ab1cdcf8ce3816bb0e5bd74d1739506644bad0208\",\"license\":\"MIT\"},\"contracts/access/Manageable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/openzeppelin-upgradeable/proxy/utils/Initializable.sol\\\";\\nimport \\\"../interfaces/IGovernable.sol\\\";\\nimport \\\"../interfaces/IManageable.sol\\\";\\n\\nerror SenderIsNotPool();\\nerror SenderIsNotGovernor();\\nerror IsPaused();\\nerror IsShutdown();\\nerror PoolAddressIsNull();\\n\\n/**\\n * @title Reusable contract that handles accesses\\n */\\nabstract contract Manageable is IManageable, Initializable {\\n /**\\n * @notice Pool contract\\n */\\n IPool public pool;\\n\\n /**\\n * @dev Throws if `msg.sender` isn't the pool\\n */\\n modifier onlyPool() {\\n if (msg.sender != address(pool)) revert SenderIsNotPool();\\n _;\\n }\\n\\n /**\\n * @dev Throws if `msg.sender` isn't the governor\\n */\\n modifier onlyGovernor() {\\n if (msg.sender != governor()) revert SenderIsNotGovernor();\\n _;\\n }\\n\\n /**\\n * @dev Throws if contract is paused\\n */\\n modifier whenNotPaused() {\\n if (pool.paused()) revert IsPaused();\\n _;\\n }\\n\\n /**\\n * @dev Throws if contract is shutdown\\n */\\n modifier whenNotShutdown() {\\n if (pool.everythingStopped()) revert IsShutdown();\\n _;\\n }\\n\\n // solhint-disable-next-line func-name-mixedcase\\n function __Manageable_init(IPool pool_) internal onlyInitializing {\\n if (address(pool_) == address(0)) revert PoolAddressIsNull();\\n pool = pool_;\\n }\\n\\n /**\\n * @notice Get the governor\\n * @return _governor The governor\\n */\\n function governor() public view returns (address _governor) {\\n _governor = IGovernable(address(pool)).governor();\\n }\\n\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x95964544ea9b3a0799e14959d5cd1d33dbf8fd9463260d3bc33358c3945812b9\",\"license\":\"MIT\"},\"contracts/dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/IOFTCoreUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../../../../openzeppelin-upgradeable/utils/introspection/IERC165Upgradeable.sol\\\";\\n\\n/**\\n * @dev Interface of the IOFT core standard\\n */\\ninterface IOFTCoreUpgradeable is IERC165Upgradeable {\\n /**\\n * @dev estimate send token `_tokenId` to (`_dstChainId`, `_toAddress`)\\n * _dstChainId - L0 defined chain id to send tokens too\\n * _toAddress - dynamic bytes array which contains the address to whom you are sending tokens to on the dstChain\\n * _amount - amount of the tokens to transfer\\n * _useZro - indicates to use zro to pay L0 fees\\n * _adapterParam - flexible bytes array to indicate messaging adapter services in L0\\n */\\n function estimateSendFee(\\n uint16 _dstChainId,\\n bytes calldata _toAddress,\\n uint _amount,\\n bool _useZro,\\n bytes calldata _adapterParams\\n ) external view returns (uint nativeFee, uint zroFee);\\n\\n /**\\n * @dev send `_amount` amount of token to (`_dstChainId`, `_toAddress`) from `_from`\\n * `_from` the owner of token\\n * `_dstChainId` the destination chain identifier\\n * `_toAddress` can be any size depending on the `dstChainId`.\\n * `_amount` the quantity of tokens in wei\\n * `_refundAddress` the address LayerZero refunds if too much message fee is sent\\n * `_zroPaymentAddress` set to address(0x0) if not paying in ZRO (LayerZero Token)\\n * `_adapterParams` is a flexible bytes array to indicate messaging adapter services\\n */\\n function sendFrom(\\n address _from,\\n uint16 _dstChainId,\\n bytes calldata _toAddress,\\n uint _amount,\\n address payable _refundAddress,\\n address _zroPaymentAddress,\\n bytes calldata _adapterParams\\n ) external payable;\\n\\n /**\\n * @dev returns the circulating amount of tokens on current chain\\n */\\n function circulatingSupply() external view returns (uint);\\n\\n /**\\n * @dev returns the address of the ERC20 token\\n */\\n function token() external view returns (address);\\n\\n /**\\n * @dev Emitted when `_amount` tokens are moved from the `_sender` to (`_dstChainId`, `_toAddress`)\\n * `_nonce` is the outbound nonce\\n */\\n event SendToChain(uint16 indexed _dstChainId, address indexed _from, bytes _toAddress, uint _amount);\\n\\n /**\\n * @dev Emitted when `_amount` tokens are received from `_srcChainId` into the `_toAddress` on the local chain.\\n * `_nonce` is the inbound nonce.\\n */\\n event ReceiveFromChain(uint16 indexed _srcChainId, address indexed _to, uint _amount);\\n\\n event SetUseCustomAdapterParams(bool _useCustomAdapterParams);\\n}\\n\",\"keccak256\":\"0x22651924296f8308db8195d7a86a6781023241c53905418f2d3925e3f693f530\",\"license\":\"MIT\"},\"contracts/dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/composable/IComposableOFTCoreUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.5.0;\\n\\nimport \\\"../IOFTCoreUpgradeable.sol\\\";\\n\\n/**\\n * @dev Interface of the composable OFT core standard\\n */\\ninterface IComposableOFTCoreUpgradeable is IOFTCoreUpgradeable {\\n function estimateSendAndCallFee(\\n uint16 _dstChainId,\\n bytes calldata _toAddress,\\n uint _amount,\\n bytes calldata _payload,\\n uint64 _dstGasForCall,\\n bool _useZro,\\n bytes calldata _adapterParams\\n ) external view returns (uint nativeFee, uint zroFee);\\n\\n function sendAndCall(\\n address _from,\\n uint16 _dstChainId,\\n bytes calldata _toAddress,\\n uint _amount,\\n bytes calldata _payload,\\n uint64 _dstGasForCall,\\n address payable _refundAddress,\\n address _zroPaymentAddress,\\n bytes calldata _adapterParams\\n ) external payable;\\n\\n function retryOFTReceived(\\n uint16 _srcChainId,\\n bytes calldata _srcAddress,\\n uint64 _nonce,\\n bytes calldata _from,\\n address _to,\\n uint _amount,\\n bytes calldata _payload\\n ) external;\\n\\n event CallOFTReceivedFailure(\\n uint16 indexed _srcChainId,\\n bytes _srcAddress,\\n uint64 _nonce,\\n bytes _from,\\n address indexed _to,\\n uint _amount,\\n bytes _payload,\\n bytes _reason\\n );\\n\\n event CallOFTReceivedSuccess(uint16 indexed _srcChainId, bytes _srcAddress, uint64 _nonce, bytes32 _hash);\\n\\n event RetryOFTReceivedSuccess(bytes32 _messageHash);\\n\\n event NonContractAddress(address _address);\\n}\\n\",\"keccak256\":\"0x769b9356ad6019bdabdcfc11762f28d15eb9a4e262efc96835725f6862c5d9e9\",\"license\":\"MIT\"},\"contracts/dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/composable/IOFTReceiverUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.5.0;\\n\\ninterface IOFTReceiverUpgradeable {\\n /**\\n * @dev Called by the OFT contract when tokens are received from source chain.\\n * @param _srcChainId The chain id of the source chain.\\n * @param _srcAddress The address of the OFT token contract on the source chain.\\n * @param _nonce The nonce of the transaction on the source chain.\\n * @param _from The address of the account who calls the sendAndCall() on the source chain.\\n * @param _amount The amount of tokens to transfer.\\n * @param _payload Additional data with no specified format.\\n */\\n function onOFTReceived(\\n uint16 _srcChainId,\\n bytes calldata _srcAddress,\\n uint64 _nonce,\\n bytes calldata _from,\\n uint _amount,\\n bytes calldata _payload\\n ) external;\\n}\\n\",\"keccak256\":\"0x287036c704c57e34a6fc3f7e67c8dfaaade6eb3667b570576bc491c0f1f89a5b\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.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 * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\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. Equivalent to `reinitializer(1)`.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = _setInitializedVersion(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 * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original\\n * initialization step. This is essential to configure modules that are added through upgrades and that require\\n * initialization.\\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 modifier reinitializer(uint8 version) {\\n bool isTopLevelCall = _setInitializedVersion(version);\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(version);\\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} 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 function _disableInitializers() internal virtual {\\n _setInitializedVersion(type(uint8).max);\\n }\\n\\n function _setInitializedVersion(uint8 version) private returns (bool) {\\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, and for the lowest level\\n // of initializers, because in other contexts the contract may have been reentered.\\n if (_initializing) {\\n require(\\n version == 1 && !AddressUpgradeable.isContract(address(this)),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n return false;\\n } else {\\n require(_initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n return true;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x7454006cccb737612b00104d2f606d728e2818b778e7e55542f063c614ce46ba\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin-upgradeable/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.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 *\\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 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\":\"0x55cf2bd9fc76704ddcdc19834cd288b7de00fc0f298a40ea16a954ae8991db2d\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin-upgradeable/utils/introspection/IERC165Upgradeable.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 IERC165Upgradeable {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0xc6cef87559d0aeffdf0a99803de655938a7779ec0a3cd5d4383483ad85565a09\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\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 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 `recipient`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address recipient, 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 `sender` to `recipient` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address sender,\\n address recipient,\\n uint256 amount\\n ) external returns (bool);\\n\\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\",\"keccak256\":\"0x027b891937d20ccf213fdb9c31531574256de774bda99d3a70ecef6e1913ed2a\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\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\":\"0x83fe24f5c04a56091e50f4a345ff504c8bff658a76d4c43b16878c8f940c53b2\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin/token/ERC20/utils/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\nimport \\\"../../../utils/Address.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n using Address for address;\\n\\n function safeTransfer(\\n IERC20 token,\\n address to,\\n uint256 value\\n ) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n function safeTransferFrom(\\n IERC20 token,\\n address from,\\n address to,\\n uint256 value\\n ) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\\n }\\n\\n /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\n */\\n function safeApprove(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n // safeApprove should only be called when setting an initial allowance,\\n // or when resetting it to zero. To increase and decrease it, use\\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\\n require(\\n (value == 0) || (token.allowance(address(this), spender) == 0),\\n \\\"SafeERC20: approve from non-zero to non-zero allowance\\\"\\n );\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\\n }\\n\\n function safeIncreaseAllowance(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n uint256 newAllowance = token.allowance(address(this), spender) + value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n unchecked {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n require(oldAllowance >= value, \\\"SafeERC20: decreased allowance below zero\\\");\\n uint256 newAllowance = oldAllowance - value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\n if (returndata.length > 0) {\\n // Return data is optional\\n require(abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0x02348b2e4b9f3200c7e3907c5c2661643a6d8520e9f79939fbb9b4005a54894d\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.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\":\"0x2ccf9d2313a313d41a791505f2b5abfdc62191b5d4334f7f7a82691c088a1c87\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.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 /**\\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 / b + (a % b == 0 ? 0 : 1);\\n }\\n}\\n\",\"keccak256\":\"0xc995bddbca1ae19788db9f8b61e63385edd3fddf89693b612d5abd1a275974d2\",\"license\":\"MIT\"},\"contracts/dependencies/stargate-protocol/interfaces/IStargateComposer.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./IStargateRouter.sol\\\";\\n\\ninterface IStargateComposer {\\n function swap(\\n uint16 _dstChainId,\\n uint256 _srcPoolId,\\n uint256 _dstPoolId,\\n address payable _refundAddress,\\n uint256 _amountLD,\\n uint256 _minAmountLD,\\n IStargateRouter.lzTxObj memory _lzTxParams,\\n bytes calldata _to,\\n bytes calldata _payload\\n ) external payable;\\n\\n function factory() external view returns (address);\\n\\n function stargateBridge() external view returns (address);\\n\\n function stargateRouter() external view returns (IStargateRouter);\\n\\n function quoteLayerZeroFee(\\n uint16 _dstChainId,\\n uint8 _functionType,\\n bytes calldata _toAddress,\\n bytes calldata _transferAndCallPayload,\\n IStargateRouter.lzTxObj memory _lzTxParams\\n ) external view returns (uint256, uint256);\\n\\n function peers(uint16 _chainId) external view returns (address);\\n}\\n\",\"keccak256\":\"0xdfdd1690bf176ac05803534a60227be90cc435b4bdd8fce2348f1a9417a9f63a\",\"license\":\"BUSL-1.1\"},\"contracts/dependencies/stargate-protocol/interfaces/IStargateReceiver.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\n\\npragma solidity 0.8.9;\\n\\ninterface IStargateReceiver {\\n function sgReceive(\\n uint16 _chainId,\\n bytes memory _srcAddress,\\n uint256 _nonce,\\n address _token,\\n uint256 amountLD,\\n bytes memory payload\\n ) external;\\n}\\n\",\"keccak256\":\"0xe4d6bf9fa422e5e43dc1b6880f951d06611a4ed12c2dd7dd8c0b6a5d9e06ad0d\",\"license\":\"BUSL-1.1\"},\"contracts/dependencies/stargate-protocol/interfaces/IStargateRouter.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\n\\npragma solidity 0.8.9;\\n\\ninterface IStargateRouter {\\n struct lzTxObj {\\n uint256 dstGasForCall;\\n uint256 dstNativeAmount;\\n bytes dstNativeAddr;\\n }\\n\\n function addLiquidity(uint256 _poolId, uint256 _amountLD, address _to) external;\\n\\n function swap(\\n uint16 _dstChainId,\\n uint256 _srcPoolId,\\n uint256 _dstPoolId,\\n address payable _refundAddress,\\n uint256 _amountLD,\\n uint256 _minAmountLD,\\n lzTxObj memory _lzTxParams,\\n bytes calldata _to,\\n bytes calldata _payload\\n ) external payable;\\n\\n function redeemRemote(\\n uint16 _dstChainId,\\n uint256 _srcPoolId,\\n uint256 _dstPoolId,\\n address payable _refundAddress,\\n uint256 _amountLP,\\n uint256 _minAmountLD,\\n bytes calldata _to,\\n lzTxObj memory _lzTxParams\\n ) external payable;\\n\\n function instantRedeemLocal(uint16 _srcPoolId, uint256 _amountLP, address _to) external returns (uint256);\\n\\n function redeemLocal(\\n uint16 _dstChainId,\\n uint256 _srcPoolId,\\n uint256 _dstPoolId,\\n address payable _refundAddress,\\n uint256 _amountLP,\\n bytes calldata _to,\\n lzTxObj memory _lzTxParams\\n ) external payable;\\n\\n function sendCredits(\\n uint16 _dstChainId,\\n uint256 _srcPoolId,\\n uint256 _dstPoolId,\\n address payable _refundAddress\\n ) external payable;\\n\\n function quoteLayerZeroFee(\\n uint16 _dstChainId,\\n uint8 _functionType,\\n bytes calldata _toAddress,\\n bytes calldata _transferAndCallPayload,\\n lzTxObj memory _lzTxParams\\n ) external view returns (uint256, uint256);\\n\\n function clearCachedSwap(uint16 _srcChainId, bytes calldata _srcAddress, uint256 _nonce) external;\\n\\n function factory() external view returns (address);\\n\\n function bridge() external view returns (address);\\n\\n function cachedSwapLookup(\\n uint16 _chainId_,\\n bytes calldata _srcAddress,\\n uint256 _nonce\\n ) external view returns (address token, uint256 amountLD, address to, bytes memory payload);\\n}\\n\",\"keccak256\":\"0x92126df8e682b2c5647c7b22e7387da69f9e72480af86948ce5ed17dc2c9e0a7\",\"license\":\"BUSL-1.1\"},\"contracts/interfaces/ICrossChainDispatcher.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/composable/IOFTReceiverUpgradeable.sol\\\";\\nimport \\\"../dependencies/stargate-protocol/interfaces/IStargateReceiver.sol\\\";\\nimport \\\"../dependencies/stargate-protocol/interfaces/IStargateRouter.sol\\\";\\nimport \\\"../dependencies/stargate-protocol/interfaces/IStargateComposer.sol\\\";\\nimport \\\"./IProxyOFT.sol\\\";\\n\\ninterface ICrossChainDispatcher is IStargateReceiver, IOFTReceiverUpgradeable {\\n function crossChainDispatcherOf(uint16 chainId_) external view returns (address);\\n\\n function triggerFlashRepaySwap(\\n uint256 id_,\\n address payable account_,\\n address tokenIn_,\\n address tokenOut_,\\n uint256 amountIn_,\\n uint256 amountOutMin_,\\n bytes calldata lzArgs_\\n ) external payable;\\n\\n function triggerLeverageSwap(\\n uint256 id_,\\n address payable account_,\\n address tokenIn_,\\n address tokenOut_,\\n uint256 amountIn_,\\n uint256 amountOutMin,\\n bytes calldata lzArgs_\\n ) external payable;\\n\\n function isBridgingActive() external view returns (bool);\\n\\n function flashRepayCallbackTxGasLimit() external view returns (uint64);\\n\\n function flashRepaySwapTxGasLimit() external view returns (uint64);\\n\\n function leverageCallbackTxGasLimit() external view returns (uint64);\\n\\n function leverageSwapTxGasLimit() external view returns (uint64);\\n\\n function lzBaseGasLimit() external view returns (uint256);\\n\\n function stargateComposer() external view returns (IStargateComposer);\\n\\n function stargateSlippage() external view returns (uint256);\\n\\n function stargatePoolIdOf(address token_) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xcaf05e625588dcfaa5706acc78a35fa46d50baeb2d28f689036963695a4e39cb\",\"license\":\"MIT\"},\"contracts/interfaces/IDebtToken.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/openzeppelin/token/ERC20/extensions/IERC20Metadata.sol\\\";\\nimport \\\"./ISyntheticToken.sol\\\";\\n\\ninterface IDebtToken is IERC20Metadata {\\n function lastTimestampAccrued() external view returns (uint256);\\n\\n function isActive() external view returns (bool);\\n\\n function syntheticToken() external view returns (ISyntheticToken);\\n\\n function accrueInterest() external;\\n\\n function debtIndex() external returns (uint256 debtIndex_);\\n\\n function burn(address from_, uint256 amount_) external;\\n\\n function issue(uint256 amount_, address to_) external returns (uint256 _issued, uint256 _fee);\\n\\n function flashIssue(address to_, uint256 amount_) external returns (uint256 _issued, uint256 _fee);\\n\\n function mint(address to_, uint256 amount_) external;\\n\\n function repay(address onBehalfOf_, uint256 amount_) external returns (uint256 _repaid, uint256 _fee);\\n\\n function repayAll(address onBehalfOf_) external returns (uint256 _repaid, uint256 _fee);\\n\\n function quoteIssueIn(uint256 amountToIssue_) external view returns (uint256 _amount, uint256 _fee);\\n\\n function quoteIssueOut(uint256 amount_) external view returns (uint256 _amountToIssue, uint256 _fee);\\n\\n function quoteRepayIn(uint256 amountToRepay_) external view returns (uint256 _amount, uint256 _fee);\\n\\n function quoteRepayOut(uint256 amount_) external view returns (uint256 _amountToRepay, uint256 _fee);\\n\\n function updateMaxTotalSupply(uint256 newMaxTotalSupply_) external;\\n\\n function updateInterestRate(uint256 newInterestRate_) external;\\n\\n function maxTotalSupply() external view returns (uint256);\\n\\n function interestRate() external view returns (uint256);\\n\\n function interestRatePerSecond() external view returns (uint256);\\n\\n function toggleIsActive() external;\\n}\\n\",\"keccak256\":\"0xd2f04aa1bee06d6991b10aaf7c03c3ee09d85f8e48ba92feac595ad855881380\",\"license\":\"MIT\"},\"contracts/interfaces/IDepositToken.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/openzeppelin/token/ERC20/extensions/IERC20Metadata.sol\\\";\\n\\ninterface IDepositToken is IERC20Metadata {\\n function underlying() external view returns (IERC20);\\n\\n function collateralFactor() external view returns (uint256);\\n\\n function unlockedBalanceOf(address account_) external view returns (uint256);\\n\\n function lockedBalanceOf(address account_) external view returns (uint256);\\n\\n function flashWithdraw(address account_, uint256 amount_) external returns (uint256 _withdrawn, uint256 _fee);\\n\\n function deposit(uint256 amount_, address onBehalfOf_) external returns (uint256 _deposited, uint256 _fee);\\n\\n function quoteDepositIn(uint256 amountToDeposit_) external view returns (uint256 _amount, uint256 _fee);\\n\\n function quoteDepositOut(uint256 amount_) external view returns (uint256 _amountToDeposit, uint256 _fee);\\n\\n function quoteWithdrawIn(uint256 amountToWithdraw_) external view returns (uint256 _amount, uint256 _fee);\\n\\n function quoteWithdrawOut(uint256 amount_) external view returns (uint256 _amountToWithdraw, uint256 _fee);\\n\\n function withdraw(uint256 amount_, address to_) external returns (uint256 _withdrawn, uint256 _fee);\\n\\n function seize(address from_, address to_, uint256 amount_) external;\\n\\n function updateCollateralFactor(uint128 newCollateralFactor_) external;\\n\\n function isActive() external view returns (bool);\\n\\n function toggleIsActive() external;\\n\\n function maxTotalSupply() external view returns (uint256);\\n\\n function updateMaxTotalSupply(uint256 newMaxTotalSupply_) external;\\n\\n function withdrawFrom(address from_, uint256 amount_) external returns (uint256 _withdrawn, uint256 _fee);\\n}\\n\",\"keccak256\":\"0xb27092f9450d9c48c1a215925007ca9c7282cfe6cf257b34ab3dbe6e745b6bd1\",\"license\":\"MIT\"},\"contracts/interfaces/IFeeProvider.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\n/**\\n * @notice FeeProvider interface\\n */\\ninterface IFeeProvider {\\n struct LiquidationFees {\\n uint128 liquidatorIncentive;\\n uint128 protocolFee;\\n }\\n\\n function defaultSwapFee() external view returns (uint256);\\n\\n function depositFee() external view returns (uint256);\\n\\n function issueFee() external view returns (uint256);\\n\\n function liquidationFees() external view returns (uint128 liquidatorIncentive, uint128 protocolFee);\\n\\n function repayFee() external view returns (uint256);\\n\\n function swapFeeFor(address account_) external view returns (uint256);\\n\\n function withdrawFee() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x3b132b42090c167b2c0aef6d78d833c669c43b9e55593a7a21a96ed5d3082700\",\"license\":\"MIT\"},\"contracts/interfaces/IGovernable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\n/**\\n * @notice Governable interface\\n */\\ninterface IGovernable {\\n function governor() external view returns (address _governor);\\n\\n function transferGovernorship(address _proposedGovernor) external;\\n}\\n\",\"keccak256\":\"0xbe84461adf33aec1bf31b6d84a5380aaeb791de9a4b95346dd8270dc6632984e\",\"license\":\"MIT\"},\"contracts/interfaces/IManageable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./IPool.sol\\\";\\n\\n/**\\n * @notice Manageable interface\\n */\\ninterface IManageable {\\n function pool() external view returns (IPool _pool);\\n}\\n\",\"keccak256\":\"0xac88e0997a26942cb9cbda1a7dd9756e28ba2025813e5b07e55939fbf8538ea2\",\"license\":\"MIT\"},\"contracts/interfaces/IPauseable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\ninterface IPauseable {\\n function paused() external view returns (bool);\\n\\n function everythingStopped() external view returns (bool);\\n}\\n\",\"keccak256\":\"0xa768de9fadad05a8104cb407ae6243354e70ffd6e1a50c3e0bb0a6a1dc49d32a\",\"license\":\"MIT\"},\"contracts/interfaces/IPool.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./IDepositToken.sol\\\";\\nimport \\\"./IDebtToken.sol\\\";\\nimport \\\"./ITreasury.sol\\\";\\nimport \\\"./IRewardsDistributor.sol\\\";\\nimport \\\"./IPoolRegistry.sol\\\";\\nimport \\\"./IFeeProvider.sol\\\";\\nimport \\\"./ISmartFarmingManager.sol\\\";\\nimport \\\"./external/ISwapper.sol\\\";\\nimport \\\"../interfaces/IFeeProvider.sol\\\";\\n\\n/**\\n * @notice Pool interface\\n */\\ninterface IPool is IPauseable, IGovernable {\\n function debtFloorInUsd() external view returns (uint256);\\n\\n function feeCollector() external view returns (address);\\n\\n function feeProvider() external view returns (IFeeProvider);\\n\\n function maxLiquidable() external view returns (uint256);\\n\\n function doesSyntheticTokenExist(ISyntheticToken syntheticToken_) external view returns (bool);\\n\\n function doesDebtTokenExist(IDebtToken debtToken_) external view returns (bool);\\n\\n function doesDepositTokenExist(IDepositToken depositToken_) external view returns (bool);\\n\\n function depositTokenOf(IERC20 underlying_) external view returns (IDepositToken);\\n\\n function debtTokenOf(ISyntheticToken syntheticToken_) external view returns (IDebtToken);\\n\\n function getDepositTokens() external view returns (address[] memory);\\n\\n function getDebtTokens() external view returns (address[] memory);\\n\\n function getRewardsDistributors() external view returns (address[] memory);\\n\\n function debtOf(address account_) external view returns (uint256 _debtInUsd);\\n\\n function depositOf(address account_) external view returns (uint256 _depositInUsd, uint256 _issuableLimitInUsd);\\n\\n function debtPositionOf(\\n address account_\\n )\\n external\\n view\\n returns (\\n bool _isHealthy,\\n uint256 _depositInUsd,\\n uint256 _debtInUsd,\\n uint256 _issuableLimitInUsd,\\n uint256 _issuableInUsd\\n );\\n\\n function liquidate(\\n ISyntheticToken syntheticToken_,\\n address account_,\\n uint256 amountToRepay_,\\n IDepositToken depositToken_\\n ) external returns (uint256 _totalSeized, uint256 _toLiquidator, uint256 _fee);\\n\\n function quoteLiquidateIn(\\n ISyntheticToken syntheticToken_,\\n uint256 totalToSeized_,\\n IDepositToken depositToken_\\n ) external view returns (uint256 _amountToRepay, uint256 _toLiquidator, uint256 _fee);\\n\\n function quoteLiquidateMax(\\n ISyntheticToken syntheticToken_,\\n address account_,\\n IDepositToken depositToken_\\n ) external view returns (uint256 _maxAmountToRepay);\\n\\n function quoteLiquidateOut(\\n ISyntheticToken syntheticToken_,\\n uint256 amountToRepay_,\\n IDepositToken depositToken_\\n ) external view returns (uint256 _totalSeized, uint256 _toLiquidator, uint256 _fee);\\n\\n function quoteSwapIn(\\n ISyntheticToken syntheticTokenIn_,\\n ISyntheticToken syntheticTokenOut_,\\n uint256 amountOut_\\n ) external view returns (uint256 _amountIn, uint256 _fee);\\n\\n function quoteSwapOut(\\n ISyntheticToken syntheticTokenIn_,\\n ISyntheticToken syntheticTokenOut_,\\n uint256 amountIn_\\n ) external view returns (uint256 _amountOut, uint256 _fee);\\n\\n function swap(\\n ISyntheticToken syntheticTokenIn_,\\n ISyntheticToken syntheticTokenOut_,\\n uint256 amountIn_\\n ) external returns (uint256 _amountOut, uint256 _fee);\\n\\n function treasury() external view returns (ITreasury);\\n\\n function masterOracle() external view returns (IMasterOracle);\\n\\n function poolRegistry() external view returns (IPoolRegistry);\\n\\n function addToDepositTokensOfAccount(address account_) external;\\n\\n function removeFromDepositTokensOfAccount(address account_) external;\\n\\n function addToDebtTokensOfAccount(address account_) external;\\n\\n function removeFromDebtTokensOfAccount(address account_) external;\\n\\n function getDepositTokensOfAccount(address account_) external view returns (address[] memory);\\n\\n function getDebtTokensOfAccount(address account_) external view returns (address[] memory);\\n\\n function isSwapActive() external view returns (bool);\\n\\n function smartFarmingManager() external view returns (ISmartFarmingManager);\\n}\\n\",\"keccak256\":\"0x0f0a869451cca858ba52b56970db167360fe161f2450557a053c4da938558816\",\"license\":\"MIT\"},\"contracts/interfaces/IPoolRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./external/IMasterOracle.sol\\\";\\nimport \\\"./IPauseable.sol\\\";\\nimport \\\"./IGovernable.sol\\\";\\nimport \\\"./ISyntheticToken.sol\\\";\\nimport \\\"./external/ISwapper.sol\\\";\\nimport \\\"./IQuoter.sol\\\";\\nimport \\\"./ICrossChainDispatcher.sol\\\";\\n\\ninterface IPoolRegistry is IPauseable, IGovernable {\\n function feeCollector() external view returns (address);\\n\\n function isPoolRegistered(address pool_) external view returns (bool);\\n\\n function nativeTokenGateway() external view returns (address);\\n\\n function getPools() external view returns (address[] memory);\\n\\n function registerPool(address pool_) external;\\n\\n function unregisterPool(address pool_) external;\\n\\n function masterOracle() external view returns (IMasterOracle);\\n\\n function updateFeeCollector(address newFeeCollector_) external;\\n\\n function idOfPool(address pool_) external view returns (uint256);\\n\\n function nextPoolId() external view returns (uint256);\\n\\n function swapper() external view returns (ISwapper);\\n\\n function quoter() external view returns (IQuoter);\\n\\n function crossChainDispatcher() external view returns (ICrossChainDispatcher);\\n\\n function doesSyntheticTokenExist(ISyntheticToken syntheticToken_) external view returns (bool _exists);\\n}\\n\",\"keccak256\":\"0x9ffa9e5fd39a48ac2bda561af7fb4fc9df5f8ffb7a602ef1d4da8c068019e723\",\"license\":\"MIT\"},\"contracts/interfaces/IProxyOFT.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/composable/IComposableOFTCoreUpgradeable.sol\\\";\\n\\ninterface IProxyOFT is IComposableOFTCoreUpgradeable {\\n function getProxyOFTOf(uint16 chainId_) external view returns (address _proxyOFT);\\n}\\n\",\"keccak256\":\"0x4041a90eb60de460c9e1631aaedfbf2bff2275b3f91964800b1c774546931cd5\",\"license\":\"MIT\"},\"contracts/interfaces/IQuoter.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./IPoolRegistry.sol\\\";\\nimport \\\"./IProxyOFT.sol\\\";\\n\\ninterface IQuoter {\\n function quoteCrossChainFlashRepayNativeFee(\\n IProxyOFT proxyOFT_,\\n bytes calldata lzArgs_\\n ) external view returns (uint256 _nativeFee);\\n\\n function quoteCrossChainLeverageNativeFee(\\n IProxyOFT proxyOFT_,\\n bytes calldata lzArgs_\\n ) external view returns (uint256 _nativeFee);\\n\\n function quoteLeverageCallbackNativeFee(uint16 dstChainId_) external view returns (uint256 _callbackTxNativeFee);\\n\\n function quoteFlashRepayCallbackNativeFee(uint16 dstChainId_) external view returns (uint256 _callbackTxNativeFee);\\n\\n function getFlashRepaySwapAndCallbackLzArgs(\\n uint16 srcChainId_,\\n uint16 dstChainId_\\n ) external view returns (bytes memory lzArgs_);\\n\\n function getLeverageSwapAndCallbackLzArgs(\\n uint16 srcChainId_,\\n uint16 dstChainId_\\n ) external view returns (bytes memory lzArgs_);\\n}\\n\",\"keccak256\":\"0x1e4d2dd779a09dc8ea6b6c244b167deddca3a48e71b73bf940da04113b40c752\",\"license\":\"MIT\"},\"contracts/interfaces/IRewardsDistributor.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/openzeppelin/token/ERC20/IERC20.sol\\\";\\n\\n/**\\n * @notice Reward Distributor interface\\n */\\ninterface IRewardsDistributor {\\n function rewardToken() external view returns (IERC20);\\n\\n function tokenSpeeds(IERC20 token_) external view returns (uint256);\\n\\n function tokensAccruedOf(address account_) external view returns (uint256);\\n\\n function updateBeforeMintOrBurn(IERC20 token_, address account_) external;\\n\\n function updateBeforeTransfer(IERC20 token_, address from_, address to_) external;\\n\\n function claimable(address account_) external view returns (uint256 _claimable);\\n\\n function claimable(address account_, IERC20 token_) external view returns (uint256 _claimable);\\n\\n function claimRewards(address account_) external;\\n\\n function claimRewards(address account_, IERC20[] memory tokens_) external;\\n\\n function claimRewards(address[] memory accounts_, IERC20[] memory tokens_) external;\\n\\n function updateTokenSpeed(IERC20 token_, uint256 newSpeed_) external;\\n\\n function updateTokenSpeeds(IERC20[] calldata tokens_, uint256[] calldata speeds_) external;\\n\\n function tokens(uint256) external view returns (IERC20);\\n\\n function tokenStates(IERC20) external view returns (uint224 index, uint32 timestamp);\\n\\n function accountIndexOf(IERC20, address) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x4f527eeae61b6a5bff7d3b48037234ef718ae7f71dc452e8cab3b60581f0d810\",\"license\":\"MIT\"},\"contracts/interfaces/ISmartFarmingManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./IManageable.sol\\\";\\nimport \\\"./IDepositToken.sol\\\";\\nimport \\\"./IDebtToken.sol\\\";\\n\\n/**\\n * @notice SmartFarmingManager interface\\n */\\ninterface ISmartFarmingManager {\\n function flashRepay(\\n ISyntheticToken syntheticToken_,\\n IDepositToken depositToken_,\\n uint256 withdrawAmount_,\\n uint256 repayAmountMin_\\n ) external returns (uint256 _withdrawn, uint256 _repaid);\\n\\n function crossChainFlashRepay(\\n ISyntheticToken syntheticToken_,\\n IDepositToken depositToken_,\\n uint256 withdrawAmount_,\\n IERC20 bridgeToken_,\\n uint256 bridgeTokenAmountMin_,\\n uint256 swapAmountOutMin_,\\n uint256 repayAmountMin_,\\n bytes calldata lzArgs_\\n ) external payable;\\n\\n function crossChainLeverage(\\n IERC20 tokenIn_,\\n IDepositToken depositToken_,\\n ISyntheticToken syntheticToken_,\\n uint256 amountIn_,\\n uint256 leverage_,\\n uint256 swapAmountOutMin_,\\n uint256 depositAmountMin_,\\n bytes calldata lzArgs_\\n ) external payable;\\n\\n function crossChainLeverageCallback(uint256 id_, uint256 swapAmountOut_) external returns (uint256 _deposited);\\n\\n function crossChainFlashRepayCallback(uint256 id_, uint256 swapAmountOut_) external returns (uint256 _repaid);\\n\\n function leverage(\\n IERC20 tokenIn_,\\n IDepositToken depositToken_,\\n ISyntheticToken syntheticToken_,\\n uint256 amountIn_,\\n uint256 leverage_,\\n uint256 depositAmountMin_\\n ) external returns (uint256 _deposited, uint256 _issued);\\n}\\n\",\"keccak256\":\"0x7544a9d308a49e24d6984c3cfcfe2c1cfb7d9ce4655408438e1c12f37175a3b0\",\"license\":\"MIT\"},\"contracts/interfaces/ISyntheticToken.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/openzeppelin/token/ERC20/extensions/IERC20Metadata.sol\\\";\\nimport \\\"./IDebtToken.sol\\\";\\nimport \\\"./IPoolRegistry.sol\\\";\\nimport \\\"../interfaces/IProxyOFT.sol\\\";\\n\\ninterface ISyntheticToken is IERC20Metadata {\\n function isActive() external view returns (bool);\\n\\n function mint(address to_, uint256 amount_) external;\\n\\n function burn(address from_, uint256 amount) external;\\n\\n function poolRegistry() external view returns (IPoolRegistry);\\n\\n function toggleIsActive() external;\\n\\n function seize(address from_, address to_, uint256 amount_) external;\\n\\n function updateMaxTotalSupply(uint256 newMaxTotalSupply_) external;\\n\\n function updateProxyOFT(IProxyOFT newProxyOFT_) external;\\n\\n function maxTotalSupply() external view returns (uint256);\\n\\n function proxyOFT() external view returns (IProxyOFT);\\n}\\n\",\"keccak256\":\"0xfaeb24d1067e85493a5c8818d6de06fc6dbc72c37e85f82811990d0120f8a0cf\",\"license\":\"MIT\"},\"contracts/interfaces/ITreasury.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\ninterface ITreasury {\\n function pull(address to_, uint256 amount_) external;\\n\\n function migrateTo(address newTreasury_) external;\\n}\\n\",\"keccak256\":\"0x9ee0a41cfe7b5bd2ec256441fc7b2ae6407921ed28a65daeaa476cfc9df73c1b\",\"license\":\"MIT\"},\"contracts/interfaces/external/IMasterOracle.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\ninterface IMasterOracle {\\n function quoteTokenToUsd(address _asset, uint256 _amount) external view returns (uint256 _amountInUsd);\\n\\n function quoteUsdToToken(address _asset, uint256 _amountInUsd) external view returns (uint256 _amount);\\n\\n function quote(address _assetIn, address _assetOut, uint256 _amountIn) external view returns (uint256 _amountOut);\\n}\\n\",\"keccak256\":\"0x2f080adc5880151dc4446ef43b54abab8e3711c5f2e526917ef39a05e3c16a00\",\"license\":\"MIT\"},\"contracts/interfaces/external/IStargateComposerWithRetry.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../../dependencies/stargate-protocol/interfaces/IStargateComposer.sol\\\";\\n\\n// Note: Extending interface instead of adding those function to avoid triggering upgrade for other contracts\\n// We may move functions to `IStargateComposer` on the next major upgrade\\n// Refs: https://github.com/autonomoussoftware/metronome-synth/issues/877\\ninterface IStargateComposerWithRetry is IStargateComposer {\\n function payloadHashes(\\n uint16 _srcChainId,\\n bytes calldata _srcAddress,\\n uint256 _nonce\\n ) external view returns (bytes32);\\n\\n function clearCachedSwap(\\n uint16 _srcChainId,\\n bytes calldata _srcAddress,\\n uint64 _nonce,\\n address _receiver,\\n bytes calldata _sgReceiveCallData\\n ) external;\\n}\\n\",\"keccak256\":\"0x92a0df931fd4ffb78085bf1526c0a5b53c78d9ea9a8a9f9b57d7178b14b80508\",\"license\":\"BUSL-1.1\"},\"contracts/interfaces/external/ISwapper.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\ninterface ISwapper {\\n function swapExactInput(\\n address tokenIn_,\\n address tokenOut_,\\n uint256 amountIn_,\\n uint256 amountOutMin_,\\n address receiver_\\n ) external returns (uint256 _amountOut);\\n}\\n\",\"keccak256\":\"0x75f04b225d0c310be7e0a09ee4c1aa6eeeb8d94e02fc0e4160a9597ce2d8d446\",\"license\":\"MIT\"},\"contracts/lib/CrossChainLib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nlibrary CrossChainLib {\\n /**\\n * @notice Supported cross-chain operations\\n */\\n uint8 public constant LEVERAGE = 1;\\n uint8 public constant FLASH_REPAY = 2;\\n\\n function getOperationType(bytes memory payload_) internal pure returns (uint8 _op) {\\n (_op, ) = abi.decode(payload_, (uint8, bytes));\\n }\\n\\n function encodeLeverageCallbackPayload(\\n address srcSmartFarmingManager_,\\n uint256 requestId_\\n ) internal pure returns (bytes memory _payload) {\\n return abi.encode(LEVERAGE, abi.encode(srcSmartFarmingManager_, requestId_));\\n }\\n\\n function decodeLeverageCallbackPayload(\\n bytes memory payload_\\n ) internal pure returns (address _srcSmartFarmingManager, uint256 _requestId) {\\n (, payload_) = abi.decode(payload_, (uint8, bytes));\\n return abi.decode(payload_, (address, uint256));\\n }\\n\\n function encodeFlashRepayCallbackPayload(\\n address srcProxyOFT_,\\n address srcSmartFarmingManager_,\\n uint256 requestId_\\n ) internal pure returns (bytes memory _payload) {\\n return abi.encode(FLASH_REPAY, abi.encode(srcProxyOFT_, srcSmartFarmingManager_, requestId_));\\n }\\n\\n function decodeFlashRepayCallbackPayload(\\n bytes memory payload_\\n ) internal pure returns (address srcProxyOFT_, address _srcSmartFarmingManager, uint256 _requestId) {\\n (, payload_) = abi.decode(payload_, (uint8, bytes));\\n return abi.decode(payload_, (address, address, uint256));\\n }\\n\\n function encodeFlashRepaySwapPayload(\\n address srcSmartFarmingManager_,\\n address dstProxyOFT_,\\n uint256 requestId_,\\n address account_,\\n uint256 amountOutMin_\\n ) internal pure returns (bytes memory _payload) {\\n return\\n abi.encode(\\n FLASH_REPAY,\\n abi.encode(srcSmartFarmingManager_, dstProxyOFT_, requestId_, account_, amountOutMin_)\\n );\\n }\\n\\n function decodeFlashRepaySwapPayload(\\n bytes memory payload_\\n )\\n internal\\n pure\\n returns (\\n address srcSmartFarmingManager_,\\n address dstProxyOFT_,\\n uint256 requestId_,\\n address account_,\\n uint256 amountOutMin_\\n )\\n {\\n (, payload_) = abi.decode(payload_, (uint8, bytes));\\n return abi.decode(payload_, (address, address, uint256, address, uint256));\\n }\\n\\n function encodeLeverageSwapPayload(\\n address srcSmartFarmingManager_,\\n address dstProxyOFT_,\\n uint256 requestId_,\\n uint256 sgPoolId_,\\n address account_,\\n uint256 amountOutMin_\\n ) internal pure returns (bytes memory _payload) {\\n return\\n abi.encode(\\n LEVERAGE,\\n abi.encode(srcSmartFarmingManager_, dstProxyOFT_, requestId_, sgPoolId_, account_, amountOutMin_)\\n );\\n }\\n\\n function decodeLeverageSwapPayload(\\n bytes memory payload_\\n )\\n internal\\n pure\\n returns (\\n address srcSmartFarmingManager_,\\n address dstProxyOFT_,\\n uint256 requestId_,\\n uint256 sgPoolId_,\\n address account_,\\n uint256 amountOutMin_\\n )\\n {\\n (, payload_) = abi.decode(payload_, (uint8, bytes));\\n return abi.decode(payload_, (address, address, uint256, uint256, address, uint256));\\n }\\n\\n function encodeLzArgs(\\n uint16 dstChainId_,\\n uint256 callbackNativeFee_,\\n uint64 swapTxGasLimit_\\n ) internal pure returns (bytes memory _lzArgs) {\\n return abi.encode(dstChainId_, callbackNativeFee_, swapTxGasLimit_);\\n }\\n\\n function decodeLzArgs(\\n bytes memory lzArgs_\\n ) internal pure returns (uint16 dstChainId_, uint256 callbackNativeFee_, uint64 swapTxGasLimit_) {\\n return abi.decode(lzArgs_, (uint16, uint256, uint64));\\n }\\n}\\n\",\"keccak256\":\"0x207930d2f144d84704364fc6bafdf7eb3bdb2f12ff7f74d75afded53ff035b90\",\"license\":\"MIT\"},\"contracts/lib/WadRayMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\n/**\\n * @title Math library\\n * @dev Provides mul and div function for wads (decimal numbers with 18 digits precision) and rays (decimals with 27 digits)\\n * @dev Based on https://github.com/dapphub/ds-math/blob/master/src/math.sol\\n */\\nlibrary WadRayMath {\\n uint256 internal constant WAD = 1e18;\\n uint256 internal constant HALF_WAD = WAD / 2;\\n\\n uint256 internal constant RAY = 1e27;\\n uint256 internal constant HALF_RAY = RAY / 2;\\n\\n uint256 internal constant WAD_RAY_RATIO = 1e9;\\n\\n /**\\n * @dev Multiplies two wad, rounding half up to the nearest wad\\n * @param a Wad\\n * @param b Wad\\n * @return The result of a*b, in wad\\n */\\n function wadMul(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (a == 0 || b == 0) {\\n return 0;\\n }\\n\\n return (a * b + HALF_WAD) / WAD;\\n }\\n\\n /**\\n * @dev Divides two wad, rounding half up to the nearest wad\\n * @param a Wad\\n * @param b Wad\\n * @return The result of a/b, in wad\\n */\\n function wadDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n return (a * WAD + b / 2) / b;\\n }\\n}\\n\",\"keccak256\":\"0xd971282b7b02c2121f64a13df8b40f427dbda36a770d0d391a3102947a743071\",\"license\":\"MIT\"},\"contracts/storage/SmartFarmingManagerStorage.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../interfaces/ISmartFarmingManager.sol\\\";\\n\\n// solhint-disable var-name-mixedcase, max-states-count\\nabstract contract SmartFarmingManagerStorageV1 is ISmartFarmingManager {\\n /**\\n * @notice Cross-chain Leverage request data\\n */\\n struct CrossChainLeverage {\\n uint16 dstChainId;\\n IERC20 bridgeToken;\\n IDepositToken depositToken;\\n ISyntheticToken syntheticToken;\\n uint256 amountIn;\\n uint256 debtAmount;\\n uint256 depositAmountMin;\\n address account;\\n bool finished;\\n IERC20 tokenIn;\\n }\\n\\n /**\\n * @notice Cross-chain Flash repay request data\\n */\\n struct CrossChainFlashRepay {\\n uint16 dstChainId;\\n ISyntheticToken syntheticToken;\\n uint256 repayAmountMin;\\n address account;\\n bool finished;\\n }\\n\\n /**\\n * @notice Cross-chain requests counter\\n */\\n uint256 public crossChainRequestsLength;\\n\\n /**\\n * @notice Cross-chain leverage requests\\n */\\n mapping(uint256 => CrossChainLeverage) public crossChainLeverages;\\n\\n /**\\n * @notice Cross-chain flash repay requests\\n */\\n mapping(uint256 => CrossChainFlashRepay) public crossChainFlashRepays;\\n}\\n\",\"keccak256\":\"0x2af2ef0dc315ab9d1714b0530cf6a3481fbc4e899a9dd7655ce1fadd9aa218f8\",\"license\":\"MIT\"},\"contracts/utils/ReentrancyGuard.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../dependencies/openzeppelin-upgradeable/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 ReentrancyGuard 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 // On the first call to nonReentrant, _notEntered will be true\\n require(_status != _ENTERED, \\\"ReentrancyGuard: reentrant call\\\");\\n\\n // Any calls to nonReentrant after this point will fail\\n _status = _ENTERED;\\n\\n _;\\n\\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\",\"keccak256\":\"0x3bf3c3de5a638ca101f25dfcaec5268e9c8a1c29a9a278d70be4459768fb41fe\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x60806040523480156200001157600080fd5b506200001c62000022565b62000152565b6200002e60ff62000031565b50565b60008054610100900460ff1615620000ca578160ff1660011480156200006a575062000068306200014360201b62002d811760201c565b155b620000c25760405162461bcd60e51b815260206004820152602e602482015260008051602062004a9983398151915260448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b506000919050565b60005460ff808416911610620001295760405162461bcd60e51b815260206004820152602e602482015260008051602062004a9983398151915260448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401620000b9565b506000805460ff191660ff92909216919091179055600190565b6001600160a01b03163b151590565b61493780620001626000396000f3fe6080604052600436106101095760003560e01c8063583bfe761161009557806399e5e6551161006457806399e5e6551461037b5780639b6623d814610416578063c35576911461042c578063c4d66de81461043f578063ffa1ad741461045f57600080fd5b8063583bfe76146102275780636455bf6f146102475780638056777414610275578063823185611461029557600080fd5b806332c615b4116100dc57806332c615b41461018a578063364fda001461019f57806339c9a98e146101d45780633bb1f3d0146101e75780634d7e9a761461020757600080fd5b80630c340a241461010e57806316f0115b14610140578063196e7f51146101605780632b3297f914610175575b600080fd5b34801561011a57600080fd5b5061012361049d565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561014c57600080fd5b50600254610123906001600160a01b031681565b61017361016e366004613e2e565b61051f565b005b34801561018157600080fd5b5061012361098d565b34801561019657600080fd5b50610123610a42565b3480156101ab57600080fd5b506101bf6101ba366004613ee7565b610af7565b60408051928352602083019190915201610137565b6101736101e2366004613f2d565b61111c565b3480156101f357600080fd5b50610173610202366004613ff8565b611151565b34801561021357600080fd5b506101bf6102223660046140a0565b611429565b34801561023357600080fd5b50610173610242366004614105565b611abd565b34801561025357600080fd5b506102676102623660046141c2565b611e1c565b604051908152602001610137565b34801561028157600080fd5b506102676102903660046141c2565b61229a565b3480156102a157600080fd5b506103196102b03660046141e4565b6035602052600090815260409020805460018201546002830154600384015460048501546005860154600687015460079097015461ffff871697620100009097046001600160a01b0390811697968116969581169581811692600160a01b90910460ff1691168a565b6040805161ffff909b168b526001600160a01b03998a1660208c0152978916978a01979097529487166060890152608088019390935260a087019190915260c0860152831660e085015215156101008401521661012082015261014001610137565b34801561038757600080fd5b506103dc6103963660046141e4565b60366020526000908152604090208054600182015460029092015461ffff821692620100009092046001600160a01b03908116929190811690600160a01b900460ff1685565b6040805161ffff90961686526001600160a01b0394851660208701528501929092529190911660608301521515608082015260a001610137565b34801561042257600080fd5b5061026760345481565b61017361043a3660046141fd565b612810565b34801561044b57600080fd5b5061017361045a36600461427f565b612cdb565b34801561046b57600080fd5b50610490604051806040016040528060058152602001640312e332e360dc1b81525081565b60405161013791906142f4565b6002546040805163030d028960e21b815290516000926001600160a01b031691630c340a24916004808301926020929190829003018186803b1580156104e257600080fd5b505afa1580156104f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061051a9190614307565b905090565b6002600154141561054b5760405162461bcd60e51b815260040161054290614324565b60405180910390fd5b6002600181905554604051633e25dee160e21b81526001600160a01b03808a1660048301528992169063f8977b849060240160206040518083038186803b15801561059557600080fd5b505afa1580156105a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105cd919061436b565b6105ea5760405163a67d528360e01b815260040160405180910390fd5b600254604051631a0dd00b60e01b81526001600160a01b03808d1660048301528c921690631a0dd00b9060240160206040518083038186803b15801561062f57600080fd5b505afa158015610643573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610667919061436b565b6106845760405163a596698b60e01b815260040160405180910390fd5b8b886106a3576040516310eb483f60e21b815260040160405180910390fd5b670de0b6b3a764000088116106cb57604051631907e1ff60e21b815260040160405180910390fd5b6107608a6001600160a01b031663df011c416040518163ffffffff1660e01b815260040160206040518083038186803b15801561070757600080fd5b505afa15801561071b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061073f9190614386565b61075190670de0b6b3a76400006143b5565b670de0b6b3a764000090612d90565b88111561078057604051630a4f5a0760e01b815260040160405180910390fd5b6001600160a01b0381166107a757604051634f70ad6b60e01b815260040160405180910390fd5b6001600160a01b038b166107ce57604051633a8b51a760e01b815260040160405180910390fd5b6000806107dc83338d612dcd565b9a506107ea838f8d8d612eee565b9150600260009054906101000a90046001600160a01b03166001600160a01b0316639f8f0fa88f6040518263ffffffff1660e01b815260040161083c91906001600160a01b0391909116815260200190565b60206040518083038186803b15801561085457600080fd5b505afa158015610868573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061088c9190614307565b6001600160a01b031663bfa176566108a2610a42565b846040518363ffffffff1660e01b81526004016108c09291906143cc565b6040805180830381600087803b1580156108d957600080fd5b505af11580156108ed573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061091191906143e5565b508091505060008e8e838c60405160200161095394939291906001600160a01b0394851681529290931660208301526040820152606081019190915260800190565b60408051601f1981840301815291905290508c610976858e8685858f8f8f613025565b505060018055505050505050505050505050505050565b6002546040805163afcff50f60e01b815290516000926001600160a01b03169163afcff50f916004808301926020929190829003018186803b1580156109d257600080fd5b505afa1580156109e6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a0a9190614307565b6001600160a01b0316632b3297f96040518163ffffffff1660e01b815260040160206040518083038186803b1580156104e257600080fd5b6002546040805163afcff50f60e01b815290516000926001600160a01b03169163afcff50f916004808301926020929190829003018186803b158015610a8757600080fd5b505afa158015610a9b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610abf9190614307565b6001600160a01b03166332c615b46040518163ffffffff1660e01b815260040160206040518083038186803b1580156104e257600080fd5b600080600260009054906101000a90046001600160a01b03166001600160a01b031663ecf3a3f96040518163ffffffff1660e01b815260040160206040518083038186803b158015610b4857600080fd5b505afa158015610b5c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b80919061436b565b15610b9e57604051631b0e923f60e11b815260040160405180910390fd5b60026001541415610bc15760405162461bcd60e51b815260040161054290614324565b6002600181905554604051633e25dee160e21b81526001600160a01b0380881660048301528792169063f8977b849060240160206040518083038186803b158015610c0b57600080fd5b505afa158015610c1f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c43919061436b565b610c605760405163a67d528360e01b815260040160405180910390fd5b600254604051631a0dd00b60e01b81526001600160a01b03808a16600483015289921690631a0dd00b9060240160206040518083038186803b158015610ca557600080fd5b505afa158015610cb9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cdd919061436b565b610cfa5760405163a596698b60e01b815260040160405180910390fd5b85610d18576040516310eb483f60e21b815260040160405180910390fd5b6040516370a0823160e01b81523360048201526001600160a01b038816906370a082319060240160206040518083038186803b158015610d5757600080fd5b505afa158015610d6b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d8f9190614386565b861115610daf57604051635de1e54160e01b815260040160405180910390fd5b6002546040516313f1e1f560e31b81526001600160a01b038a81166004830152909116906000908290639f8f0fa89060240160206040518083038186803b158015610df957600080fd5b505afa158015610e0d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e319190614307565b6040516370a0823160e01b81523360048201529091506001600160a01b038216906370a082319060240160206040518083038186803b158015610e7357600080fd5b505afa158015610e87573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eab9190614386565b871115610ecb57604051635de1e54160e01b815260040160405180910390fd5b6040516336e1668760e11b81526001600160a01b038a1690636dc2cd0e90610ef99033908c906004016143cc565b6040805180830381600087803b158015610f1257600080fd5b505af1158015610f26573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f4a91906143e5565b5095506000610f6c610f5a61098d565b610f638c61331b565b8d8a600061338e565b604051630450cfaf60e31b81529091506001600160a01b038316906322867d7890610f9d90339085906004016143cc565b6040805180830381600087803b158015610fb657600080fd5b505af1158015610fca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fee91906143e5565b5095508786101561101257604051634394bddf60e11b815260040160405180910390fd5b60405163dde3ab9560e01b81523360048201526000906001600160a01b0385169063dde3ab959060240160a06040518083038186803b15801561105457600080fd5b505afa158015611068573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061108c9190614409565b505050509050806110b05760405163cfd3600360e01b815260040160405180910390fd5b8a6001600160a01b03168c6001600160a01b03167f70e2337c0939e469d0c3d069c581bc0b72c541a70c592cdd46087d24e5e980d28a8a6040516110fe929190918252602082015260400190565b60405180910390a35050505050506001808190555094509492505050565b60405162461bcd60e51b815260206004820152600a60248201526919195c1c9958d85d195960b21b6044820152606401610542565b600061119284848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506133a892505050565b600081815260366020908152604091829020825160a081018452815461ffff811682526201000090046001600160a01b03908116938201939093526001820154938101939093526002015490811660608301819052600160a01b90910460ff161515608083015291945092501515905061121f576040516311bf899560e21b815260040160405180910390fd5b80608001511561124257604051630814de4560e11b815260040160405180910390fd5b80606001516001600160a01b0316336001600160a01b031614156112755760008281526036602052604090206001018390555b600061127f610a42565b60405163dfda255f60e01b815261ffff8d1660048201529091506000906001600160a01b0383169063dfda255f9060240160206040518083038186803b1580156112c857600080fd5b505afa1580156112dc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113009190614307565b604051602001611328919060609190911b6bffffffffffffffffffffffff1916815260140190565b604051602081830303815290604052905082602001516001600160a01b0316636d1bb8f76040518163ffffffff1660e01b815260040160206040518083038186803b15801561137657600080fd5b505afa15801561138a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ae9190614307565b6001600160a01b031663cfd6528e8d8d8d8d86888f8f8f6040518a63ffffffff1660e01b81526004016113e999989796959493929190614479565b600060405180830381600087803b15801561140357600080fd5b505af1158015611417573d6000803e3d6000fd5b50505050505050505050505050505050565b600080600260009054906101000a90046001600160a01b03166001600160a01b031663ecf3a3f96040518163ffffffff1660e01b815260040160206040518083038186803b15801561147a57600080fd5b505afa15801561148e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114b2919061436b565b156114d057604051631b0e923f60e11b815260040160405180910390fd5b600260015414156114f35760405162461bcd60e51b815260040161054290614324565b6002600181905554604051633e25dee160e21b81526001600160a01b03808a1660048301528992169063f8977b849060240160206040518083038186803b15801561153d57600080fd5b505afa158015611551573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611575919061436b565b6115925760405163a67d528360e01b815260040160405180910390fd5b600254604051631a0dd00b60e01b81526001600160a01b03808a16600483015289921690631a0dd00b9060240160206040518083038186803b1580156115d757600080fd5b505afa1580156115eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061160f919061436b565b61162c5760405163a596698b60e01b815260040160405180910390fd5b8661164a576040516310eb483f60e21b815260040160405180910390fd5b670de0b6b3a7640000861161167257604051631907e1ff60e21b815260040160405180910390fd5b6116ae896001600160a01b031663df011c416040518163ffffffff1660e01b815260040160206040518083038186803b15801561070757600080fd5b8611156116ce57604051630a4f5a0760e01b815260040160405180910390fd5b60006116d861098d565b905060006116e58b61331b565b90506001600160a01b038c166116f957809b505b6117048c338b612dcd565b9850806001600160a01b03168c6001600160a01b0316146117305761172d828d838c600061338e565b98505b600061173e828c8c8c612eee565b6002546040516313f1e1f560e31b81526001600160a01b038e8116600483015292935060009290911690639f8f0fa89060240160206040518083038186803b15801561178957600080fd5b505afa15801561179d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117c19190614307565b604051635fd0bb2b60e11b81529091506001600160a01b0382169063bfa17656906117f290309086906004016143cc565b6040805180830381600087803b15801561180b57600080fd5b505af115801561181f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061184391906143e5565b506040516340c10f1960e01b81529097506001600160a01b038216906340c10f199061187590339086906004016143cc565b600060405180830381600087803b15801561188f57600080fd5b505af11580156118a3573d6000803e3d6000fd5b50505050505060006118b9838c8489600061338e565b6118c3908b6144f4565b9050878110156118e65760405163c724afdf60e01b815260040160405180910390fd5b6118fb6001600160a01b0383168d60006133e7565b61190f6001600160a01b0383168d836133e7565b604051636e553f6560e01b8152600481018290523360248201526001600160a01b038d1690636e553f65906044016040805180830381600087803b15801561195657600080fd5b505af115801561196a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061198e91906143e5565b5060025460405163dde3ab9560e01b81523360048201529198506000916001600160a01b039091169063dde3ab959060240160a06040518083038186803b1580156119d857600080fd5b505afa1580156119ec573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a109190614409565b50505050905080611a345760405163cfd3600360e01b815260040160405180910390fd5b8b6001600160a01b03168d6001600160a01b03168f6001600160a01b03167fd82c156e929db20771fc8413cc0789925f6c666a3e5076d5844765ee28bb3a958d8f8c8e604051611a9d949392919093845260208401929092526040830152606082015260800190565b60405180910390a450505050505060018081905550965096945050505050565b6000611afe84848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061353692505050565b600081815260356020908152604091829020825161014081018452815461ffff811682526201000090046001600160a01b0390811693820193909352600182015483169381019390935260028101548216606084015260038101546080840152600481015460a0840152600581015460c0840152600681015480831660e08501819052600160a01b90910460ff1615156101008501526007909101549091166101208301529193509150611bc5576040516311bf899560e21b815260040160405180910390fd5b80610100015115611be957604051630814de4560e11b815260040160405180910390fd5b8060e001516001600160a01b0316336001600160a01b03161415611c1c5760008281526035602052604090206005018390555b6000611c26610a42565b60405163dfda255f60e01b815261ffff8e1660048201529091506000906001600160a01b0383169063dfda255f9060240160206040518083038186803b158015611c6f57600080fd5b505afa158015611c83573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ca79190614307565b6040516bffffffffffffffffffffffff19606083901b16602082015290915060009063ab8236f360e01b908f9060340160408051601f1981840301815290829052611cff92918f908f908f908f908f9060240161450c565b604051602081830303815290604052906001600160e01b0319166020820180516001600160e01b0383818316178352505050509050826001600160a01b0316633352b6086040518163ffffffff1660e01b815260040160206040518083038186803b158015611d6d57600080fd5b505afa158015611d81573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611da59190614307565b6001600160a01b031663c0e6ac6c8f8f8f8f88876040518763ffffffff1660e01b8152600401611dda96959493929190614570565b600060405180830381600087803b158015611df457600080fd5b505af1158015611e08573d6000803e3d6000fd5b505050505050505050505050505050505050565b6002546040805163ecf3a3f960e01b815290516000926001600160a01b03169163ecf3a3f9916004808301926020929190829003018186803b158015611e6157600080fd5b505afa158015611e75573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e99919061436b565b15611eb757604051631b0e923f60e11b815260040160405180910390fd5b60026001541415611eda5760405162461bcd60e51b815260040161054290614324565b6002600155611ee7610a42565b6001600160a01b0316336001600160a01b031614611f1857604051632b78ce1b60e11b815260040160405180910390fd5b600083815260366020908152604091829020825160a081018452815461ffff811682526201000090046001600160a01b03908116938201939093526001820154938101939093526002015490811660608301819052600160a01b90910460ff1615156080830152611f9c576040516311bf899560e21b815260040160405180910390fd5b806080015115611fbf57604051630814de4560e11b815260040160405180910390fd5b6000848152603660209081526040909120600201805460ff60a01b1916600160a01b179055810151611ff2903385612dcd565b60025460208301516040516313f1e1f560e31b81526001600160a01b039182166004820152929550600092911690639f8f0fa89060240160206040518083038186803b15801561204157600080fd5b505afa158015612055573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120799190614307565b60608301516040516370a0823160e01b81526001600160a01b0391821660048201529192506000919083169063c9dc4b4d9082906370a082319060240160206040518083038186803b1580156120ce57600080fd5b505afa1580156120e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121069190614386565b6040518263ffffffff1660e01b815260040161212491815260200190565b604080518083038186803b15801561213b57600080fd5b505afa15801561214f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061217391906143e5565b5090506000612182868361356f565b6060850151604051630450cfaf60e31b81529192506001600160a01b038516916322867d78916121b69185906004016143cc565b6040805180830381600087803b1580156121cf57600080fd5b505af11580156121e3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061220791906143e5565b50604085015190955085101561223057604051634394bddf60e11b815260040160405180910390fd5b808611156122605760608401516122609061224b83896143b5565b60208701516001600160a01b03169190613585565b60405187907f46da7fdc7ceed834de258df19d8f9ebd7082810a4eb45732d1401df31e5aaa1390600090a250506001805550909392505050565b6002546040805163ecf3a3f960e01b815290516000926001600160a01b03169163ecf3a3f9916004808301926020929190829003018186803b1580156122df57600080fd5b505afa1580156122f3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612317919061436b565b1561233557604051631b0e923f60e11b815260040160405180910390fd5b600260015414156123585760405162461bcd60e51b815260040161054290614324565b6002600155612365610a42565b6001600160a01b0316336001600160a01b03161461239657604051632b78ce1b60e11b815260040160405180910390fd5b600083815260356020908152604091829020825161014081018452815461ffff811682526201000090046001600160a01b0390811693820193909352600182015483169381019390935260028101548216606084015260038101546080840152600481015460a0840152600581015460c0840152600681015480831660e08501819052600160a01b90910460ff161515610100850152600790910154909116610120830152612458576040516311bf899560e21b815260040160405180910390fd5b8061010001511561247c57604051630814de4560e11b815260040160405180910390fd5b600061248b826040015161331b565b6000868152603560209081526040909120600601805460ff60a01b1916600160a01b1790558301519091506124c1903386612dcd565b9350600082602001516001600160a01b03168361012001516001600160a01b03161415612518576125116124f361098d565b8461012001518488876080015161250a91906144f4565b600061338e565b905061255e565b61253661252361098d565b846101200151848660800151600061338e565b905061255161254361098d565b84602001518488600061338e565b61255b90826144f4565b90505b8260c001518110156125835760405163c724afdf60e01b815260040160405180910390fd5b604083015161259e906001600160a01b0384169060006133e7565b60408301516125b8906001600160a01b03841690836133e7565b60408084015160e08501519151636e553f6560e01b8152600481018490526001600160a01b039283166024820152911690636e553f65906044016040805180830381600087803b15801561260b57600080fd5b505af115801561261f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061264391906143e5565b5060025460608501516040516313f1e1f560e31b81526001600160a01b03918216600482015292965016908190639f8f0fa89060240160206040518083038186803b15801561269157600080fd5b505afa1580156126a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126c99190614307565b6001600160a01b03166340c10f198560e001518660a001516040518363ffffffff1660e01b81526004016126fe9291906143cc565b600060405180830381600087803b15801561271857600080fd5b505af115801561272c573d6000803e3d6000fd5b5050505060e084015160405163dde3ab9560e01b81526001600160a01b03918216600482015260009183169063dde3ab959060240160a06040518083038186803b15801561277957600080fd5b505afa15801561278d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127b19190614409565b505050509050806127d55760405163cfd3600360e01b815260040160405180910390fd5b60405188907f8e4ff8e32fb3b90b184bdac5bf0d9b2a0fe19baa9dfea95c0fcd7d8e3842e80e90600090a25050600180555091949350505050565b600260015414156128335760405162461bcd60e51b815260040161054290614324565b6002600181905554604051633e25dee160e21b81526001600160a01b03808b1660048301528a92169063f8977b849060240160206040518083038186803b15801561287d57600080fd5b505afa158015612891573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128b5919061436b565b6128d25760405163a67d528360e01b815260040160405180910390fd5b600254604051631a0dd00b60e01b81526001600160a01b03808d1660048301528c921690631a0dd00b9060240160206040518083038186803b15801561291757600080fd5b505afa15801561292b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061294f919061436b565b61296c5760405163a596698b60e01b815260040160405180910390fd5b8861298a576040516310eb483f60e21b815260040160405180910390fd5b600260009054906101000a90046001600160a01b03166001600160a01b031663afcff50f6040518163ffffffff1660e01b815260040160206040518083038186803b1580156129d857600080fd5b505afa1580156129ec573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a109190614307565b6001600160a01b031663995031cd6040518163ffffffff1660e01b815260040160206040518083038186803b158015612a4857600080fd5b505afa158015612a5c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a80919061436b565b612a9d57604051639e0d93d560e01b815260040160405180910390fd5b6002546040516313f1e1f560e31b81526001600160a01b038d811660048301526000928392911690639f8f0fa89060240160206040518083038186803b158015612ae657600080fd5b505afa158015612afa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b1e9190614307565b9050806001600160a01b031663a6afed956040518163ffffffff1660e01b8152600401600060405180830381600087803b158015612b5b57600080fd5b505af1158015612b6f573d6000803e3d6000fd5b50506040516370a0823160e01b81523360048201526001600160a01b03841692506370a08231915060240160206040518083038186803b158015612bb257600080fd5b505afa158015612bc6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bea9190614386565b871115612c0a57604051635de1e54160e01b815260040160405180910390fd5b612c12610a42565b91505060008b6001600160a01b0316639470b0bd338d6040518363ffffffff1660e01b8152600401612c459291906143cc565b6040805180830381600087803b158015612c5e57600080fd5b505af1158015612c72573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c9691906143e5565b509050612cb6612ca461098d565b612cad8e61331b565b8c848d876135a4565b9050612cc8828b8f848c8c8c8c6137c0565b5050600180555050505050505050505050565b6000612ce76001613949565b90508015612cff576000805461ff0019166101001790555b6001600160a01b038216612d2657604051633cb1fb1f60e11b815260040160405180910390fd5b612d2e6139d6565b612d3782613a07565b8015612d7d576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050565b6001600160a01b03163b151590565b600081612d9e6002826145cc565b612db0670de0b6b3a7640000866145ee565b612dba91906144f4565b612dc491906145cc565b90505b92915050565b6040516370a0823160e01b815230600482015260009081906001600160a01b038616906370a082319060240160206040518083038186803b158015612e1157600080fd5b505afa158015612e25573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e499190614386565b9050612e606001600160a01b038616853086613a77565b6040516370a0823160e01b815230600482015281906001600160a01b038716906370a082319060240160206040518083038186803b158015612ea157600080fd5b505afa158015612eb5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ed99190614386565b612ee391906143b5565b9150505b9392505050565b60025460408051637556d1c160e11b815290516000926001600160a01b03169163eaada382916004808301926020929190829003018186803b158015612f3357600080fd5b505afa158015612f47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f6b9190614307565b6001600160a01b031663b64663848686612f9787612f91670de0b6b3a7640000896143b5565b90613ab5565b6040516001600160e01b031960e086901b1681526001600160a01b039384166004820152929091166024830152604482015260640160206040518083038186803b158015612fe457600080fd5b505afa158015612ff8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061301c9190614386565b95945050505050565b600061302f613aed565b90506000806000808980602001905181019061304b919061460d565b9350935093509350600061309488888080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250613b3492505050565b505090506040518061014001604052808261ffff168152602001856001600160a01b031681526020018b6001600160a01b03168152602001866001600160a01b031681526020018e81526020018d81526020018a8152602001336001600160a01b031681526020016000151581526020018f6001600160a01b03168152506035600088815260200190815260200160002060008201518160000160006101000a81548161ffff021916908361ffff16021790555060208201518160000160026101000a8154816001600160a01b0302191690836001600160a01b0316021790555060408201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060608201518160020160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506080820151816003015560a0820151816004015560c0820151816005015560e08201518160060160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506101008201518160060160146101000a81548160ff0219169083151502179055506101208201518160070160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555090505050613275610a42565b6001600160a01b03166339f648bf348733888888888f8f6040518a63ffffffff1660e01b81526004016132af989796959493929190614655565b6000604051808303818588803b1580156132c857600080fd5b505af11580156132dc573d6000803e3d6000fd5b50506040518893507f46a791deaa2c43990d6e3b60a320fbebef9a6677379f326b308fb9efc8128619925060009150a250505050505050505050505050565b6000816001600160a01b0316636f307dc36040518163ffffffff1660e01b815260040160206040518083038186803b15801561335657600080fd5b505afa15801561336a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612dc79190614307565b600061339e8686868686306135a4565b9695505050505050565b6000806000838060200190518101906133c191906146b4565b80519095506133da91508501602090810190860161477d565b9250925092509193909250565b8015806134705750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b15801561343657600080fd5b505afa15801561344a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061346e9190614386565b155b6134db5760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b6064820152608401610542565b6135318363095ea7b360e01b84846040516024016134fa9291906143cc565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152613b4d565b505050565b6000808280602001905181019061354d91906146b4565b80519094506135669150840160209081019085016147c0565b91509150915091565b600081831061357e5781612dc4565b5090919050565b6135318363a9059cbb60e01b84846040516024016134fa9291906143cc565b6000846001600160a01b0316866001600160a01b031614613791576135d46001600160a01b0387168860006133e7565b6135e86001600160a01b03871688866133e7565b6040516370a0823160e01b81526001600160a01b038381166004830152600091908716906370a082319060240160206040518083038186803b15801561362d57600080fd5b505afa158015613641573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136659190614386565b604051636ccb2b0160e01b81526001600160a01b03898116600483015288811660248301526044820188905260648201879052858116608483015291925090891690636ccb2b019060a401602060405180830381600087803b1580156136ca57600080fd5b505af11580156136de573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137029190614386565b506040516370a0823160e01b81526001600160a01b0384811660048301528291908816906370a082319060240160206040518083038186803b15801561374757600080fd5b505afa15801561375b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061377f9190614386565b61378991906143b5565b91505061339e565b6001600160a01b03821630146137b5576137b56001600160a01b0387168386613585565b509195945050505050565b60006137ca613aed565b9050600061380d84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250613b3492505050565b50506040805160a08101825261ffff80841682526001600160a01b03808d1660208085019182528486018c815233606087018181526000608089018181528d82526036909552899020975188549551871662010000026001600160b01b031990961697169690961793909317865551600186015592516002909401805493511515600160a01b026001600160a81b03199094169483169490941792909217909255915162bc9db960e01b81529293508c169162bc9db99134916138e09187918f908f908f908f908e908e90600401614655565b6000604051808303818588803b1580156138f957600080fd5b505af115801561390d573d6000803e3d6000fd5b50506040518593507ff83a8331f3e68a894879f051738cb73cdced1709a214e49f6dc1d541a0415e8b925060009150a250505050505050505050565b60008054610100900460ff1615613990578160ff16600114801561396c5750303b155b6139885760405162461bcd60e51b8152600401610542906147ee565b506000919050565b60005460ff8084169116106139b75760405162461bcd60e51b8152600401610542906147ee565b506000805460ff191660ff92909216919091179055600190565b919050565b600054610100900460ff166139fd5760405162461bcd60e51b81526004016105429061483c565b613a05613c1f565b565b600054610100900460ff16613a2e5760405162461bcd60e51b81526004016105429061483c565b6001600160a01b038116613a555760405163724f500960e01b815260040160405180910390fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6040516001600160a01b0380851660248301528316604482015260648101829052613aaf9085906323b872dd60e01b906084016134fa565b50505050565b6000821580613ac2575081155b15613acf57506000612dc7565b670de0b6b3a7640000613ae36002826145cc565b612db084866145ee565b600046603460008154613aff90614887565b91829055506040805160208101939093528201526060016040516020818303038152906040528051906020012060001c905090565b6000806000838060200190518101906133da91906148a2565b6000613ba2826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316613c4c9092919063ffffffff16565b8051909150156135315780806020019051810190613bc0919061436b565b6135315760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610542565b600054610100900460ff16613c465760405162461bcd60e51b81526004016105429061483c565b60018055565b6060613c5b8484600085613c63565b949350505050565b606082471015613cc45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610542565b6001600160a01b0385163b613d1b5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610542565b600080866001600160a01b03168587604051613d3791906148e5565b60006040518083038185875af1925050503d8060008114613d74576040519150601f19603f3d011682016040523d82523d6000602084013e613d79565b606091505b5091509150613d89828286613d94565b979650505050505050565b60608315613da3575081612ee7565b825115613db35782518084602001fd5b8160405162461bcd60e51b815260040161054291906142f4565b6001600160a01b0381168114613de257600080fd5b50565b60008083601f840112613df757600080fd5b50813567ffffffffffffffff811115613e0f57600080fd5b602083019150836020828501011115613e2757600080fd5b9250929050565b6000806000806000806000806000806101208b8d031215613e4e57600080fd5b8a35613e5981613dcd565b995060208b0135613e6981613dcd565b985060408b0135613e7981613dcd565b975060608b0135613e8981613dcd565b965060808b0135955060a08b0135945060c08b0135935060e08b013592506101008b013567ffffffffffffffff811115613ec257600080fd5b613ece8d828e01613de5565b915080935050809150509295989b9194979a5092959850565b60008060008060808587031215613efd57600080fd5b8435613f0881613dcd565b93506020850135613f1881613dcd565b93969395505050506040820135916060013590565b60008060008060008060008060006101008a8c031215613f4c57600080fd5b8935613f5781613dcd565b985060208a0135613f6781613dcd565b975060408a0135613f7781613dcd565b965060608a0135955060808a0135945060a08a0135935060c08a0135925060e08a013567ffffffffffffffff811115613faf57600080fd5b613fbb8c828d01613de5565b915080935050809150509295985092959850929598565b61ffff81168114613de257600080fd5b67ffffffffffffffff81168114613de257600080fd5b60008060008060008060008060c0898b03121561401457600080fd5b883561401f81613fd2565b9750602089013567ffffffffffffffff8082111561403c57600080fd5b6140488c838d01613de5565b909950975060408b0135915061405d82613fe2565b90955060608a0135945060808a0135908082111561407a57600080fd5b506140878b828c01613de5565b999c989b50969995989497949560a00135949350505050565b60008060008060008060c087890312156140b957600080fd5b86356140c481613dcd565b955060208701356140d481613dcd565b945060408701356140e481613dcd565b959894975094956060810135955060808101359460a0909101359350915050565b600080600080600080600080600060e08a8c03121561412357600080fd5b893561412e81613fd2565b985060208a013567ffffffffffffffff8082111561414b57600080fd5b6141578d838e01613de5565b909a50985060408c0135915061416c82613fe2565b90965060608b01359061417e82613dcd565b90955060808b0135945060a08b0135908082111561419b57600080fd5b506141a88c828d01613de5565b9a9d999c50979a9699959894979660c00135949350505050565b600080604083850312156141d557600080fd5b50508035926020909101359150565b6000602082840312156141f657600080fd5b5035919050565b60008060008060008060008060006101008a8c03121561421c57600080fd5b893561422781613dcd565b985060208a013561423781613dcd565b975060408a0135965060608a013561424e81613dcd565b955060808a0135945060a08a0135935060c08a0135925060e08a013567ffffffffffffffff811115613faf57600080fd5b60006020828403121561429157600080fd5b8135612ee781613dcd565b60005b838110156142b757818101518382015260200161429f565b83811115613aaf5750506000910152565b600081518084526142e081602086016020860161429c565b601f01601f19169290920160200192915050565b602081526000612dc460208301846142c8565b60006020828403121561431957600080fd5b8151612ee781613dcd565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b805180151581146139d157600080fd5b60006020828403121561437d57600080fd5b612dc48261435b565b60006020828403121561439857600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b6000828210156143c7576143c761439f565b500390565b6001600160a01b03929092168252602082015260400190565b600080604083850312156143f857600080fd5b505080516020909101519092909150565b600080600080600060a0868803121561442157600080fd5b61442a8661435b565b602087015160408801516060890151608090990151929a91995097965090945092505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b61ffff8a16815260e06020820152600061449760e083018a8c614450565b67ffffffffffffffff8916604084015282810360608401526144b981896142c8565b6001600160a01b038816608085015260a0840187905283810360c085015290506144e4818587614450565b9c9b505050505050505050505050565b600082198211156145075761450761439f565b500190565b61ffff8816815260c06020820152600061452960c08301896142c8565b67ffffffffffffffff881660408401526001600160a01b03871660608401526080830186905282810360a0840152614562818587614450565b9a9950505050505050505050565b61ffff8716815260a06020820152600061458e60a083018789614450565b67ffffffffffffffff861660408401526001600160a01b038516606084015282810360808401526145bf81856142c8565b9998505050505050505050565b6000826145e957634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156146085761460861439f565b500290565b6000806000806080858703121561462357600080fd5b845161462e81613dcd565b602086015190945061463f81613dcd565b6040860151606090960151949790965092505050565b8881526001600160a01b0388811660208301528781166040830152861660608201526080810185905260a0810184905260e060c082018190526000906145629083018486614450565b634e487b7160e01b600052604160045260246000fd5b600080604083850312156146c757600080fd5b825160ff811681146146d857600080fd5b602084015190925067ffffffffffffffff808211156146f657600080fd5b818501915085601f83011261470a57600080fd5b81518181111561471c5761471c61469e565b604051601f8201601f19908116603f011681019083821181831017156147445761474461469e565b8160405282815288602084870101111561475d57600080fd5b61476e83602083016020880161429c565b80955050505050509250929050565b60008060006060848603121561479257600080fd5b835161479d81613dcd565b60208501519093506147ae81613dcd565b80925050604084015190509250925092565b600080604083850312156147d357600080fd5b82516147de81613dcd565b6020939093015192949293505050565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b600060001982141561489b5761489b61439f565b5060010190565b6000806000606084860312156148b757600080fd5b83516148c281613fd2565b6020850151604086015191945092506148da81613fe2565b809150509250925092565b600082516148f781846020870161429c565b919091019291505056fea264697066735822122045475cac2017390a8d2f1a29e2196db5086f999766a02f96d8ac9c13a33a650b64736f6c63430008090033496e697469616c697a61626c653a20636f6e747261637420697320616c726561", - "deployedBytecode": "0x6080604052600436106101095760003560e01c8063583bfe761161009557806399e5e6551161006457806399e5e6551461037b5780639b6623d814610416578063c35576911461042c578063c4d66de81461043f578063ffa1ad741461045f57600080fd5b8063583bfe76146102275780636455bf6f146102475780638056777414610275578063823185611461029557600080fd5b806332c615b4116100dc57806332c615b41461018a578063364fda001461019f57806339c9a98e146101d45780633bb1f3d0146101e75780634d7e9a761461020757600080fd5b80630c340a241461010e57806316f0115b14610140578063196e7f51146101605780632b3297f914610175575b600080fd5b34801561011a57600080fd5b5061012361049d565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561014c57600080fd5b50600254610123906001600160a01b031681565b61017361016e366004613e2e565b61051f565b005b34801561018157600080fd5b5061012361098d565b34801561019657600080fd5b50610123610a42565b3480156101ab57600080fd5b506101bf6101ba366004613ee7565b610af7565b60408051928352602083019190915201610137565b6101736101e2366004613f2d565b61111c565b3480156101f357600080fd5b50610173610202366004613ff8565b611151565b34801561021357600080fd5b506101bf6102223660046140a0565b611429565b34801561023357600080fd5b50610173610242366004614105565b611abd565b34801561025357600080fd5b506102676102623660046141c2565b611e1c565b604051908152602001610137565b34801561028157600080fd5b506102676102903660046141c2565b61229a565b3480156102a157600080fd5b506103196102b03660046141e4565b6035602052600090815260409020805460018201546002830154600384015460048501546005860154600687015460079097015461ffff871697620100009097046001600160a01b0390811697968116969581169581811692600160a01b90910460ff1691168a565b6040805161ffff909b168b526001600160a01b03998a1660208c0152978916978a01979097529487166060890152608088019390935260a087019190915260c0860152831660e085015215156101008401521661012082015261014001610137565b34801561038757600080fd5b506103dc6103963660046141e4565b60366020526000908152604090208054600182015460029092015461ffff821692620100009092046001600160a01b03908116929190811690600160a01b900460ff1685565b6040805161ffff90961686526001600160a01b0394851660208701528501929092529190911660608301521515608082015260a001610137565b34801561042257600080fd5b5061026760345481565b61017361043a3660046141fd565b612810565b34801561044b57600080fd5b5061017361045a36600461427f565b612cdb565b34801561046b57600080fd5b50610490604051806040016040528060058152602001640312e332e360dc1b81525081565b60405161013791906142f4565b6002546040805163030d028960e21b815290516000926001600160a01b031691630c340a24916004808301926020929190829003018186803b1580156104e257600080fd5b505afa1580156104f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061051a9190614307565b905090565b6002600154141561054b5760405162461bcd60e51b815260040161054290614324565b60405180910390fd5b6002600181905554604051633e25dee160e21b81526001600160a01b03808a1660048301528992169063f8977b849060240160206040518083038186803b15801561059557600080fd5b505afa1580156105a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105cd919061436b565b6105ea5760405163a67d528360e01b815260040160405180910390fd5b600254604051631a0dd00b60e01b81526001600160a01b03808d1660048301528c921690631a0dd00b9060240160206040518083038186803b15801561062f57600080fd5b505afa158015610643573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610667919061436b565b6106845760405163a596698b60e01b815260040160405180910390fd5b8b886106a3576040516310eb483f60e21b815260040160405180910390fd5b670de0b6b3a764000088116106cb57604051631907e1ff60e21b815260040160405180910390fd5b6107608a6001600160a01b031663df011c416040518163ffffffff1660e01b815260040160206040518083038186803b15801561070757600080fd5b505afa15801561071b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061073f9190614386565b61075190670de0b6b3a76400006143b5565b670de0b6b3a764000090612d90565b88111561078057604051630a4f5a0760e01b815260040160405180910390fd5b6001600160a01b0381166107a757604051634f70ad6b60e01b815260040160405180910390fd5b6001600160a01b038b166107ce57604051633a8b51a760e01b815260040160405180910390fd5b6000806107dc83338d612dcd565b9a506107ea838f8d8d612eee565b9150600260009054906101000a90046001600160a01b03166001600160a01b0316639f8f0fa88f6040518263ffffffff1660e01b815260040161083c91906001600160a01b0391909116815260200190565b60206040518083038186803b15801561085457600080fd5b505afa158015610868573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061088c9190614307565b6001600160a01b031663bfa176566108a2610a42565b846040518363ffffffff1660e01b81526004016108c09291906143cc565b6040805180830381600087803b1580156108d957600080fd5b505af11580156108ed573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061091191906143e5565b508091505060008e8e838c60405160200161095394939291906001600160a01b0394851681529290931660208301526040820152606081019190915260800190565b60408051601f1981840301815291905290508c610976858e8685858f8f8f613025565b505060018055505050505050505050505050505050565b6002546040805163afcff50f60e01b815290516000926001600160a01b03169163afcff50f916004808301926020929190829003018186803b1580156109d257600080fd5b505afa1580156109e6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a0a9190614307565b6001600160a01b0316632b3297f96040518163ffffffff1660e01b815260040160206040518083038186803b1580156104e257600080fd5b6002546040805163afcff50f60e01b815290516000926001600160a01b03169163afcff50f916004808301926020929190829003018186803b158015610a8757600080fd5b505afa158015610a9b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610abf9190614307565b6001600160a01b03166332c615b46040518163ffffffff1660e01b815260040160206040518083038186803b1580156104e257600080fd5b600080600260009054906101000a90046001600160a01b03166001600160a01b031663ecf3a3f96040518163ffffffff1660e01b815260040160206040518083038186803b158015610b4857600080fd5b505afa158015610b5c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b80919061436b565b15610b9e57604051631b0e923f60e11b815260040160405180910390fd5b60026001541415610bc15760405162461bcd60e51b815260040161054290614324565b6002600181905554604051633e25dee160e21b81526001600160a01b0380881660048301528792169063f8977b849060240160206040518083038186803b158015610c0b57600080fd5b505afa158015610c1f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c43919061436b565b610c605760405163a67d528360e01b815260040160405180910390fd5b600254604051631a0dd00b60e01b81526001600160a01b03808a16600483015289921690631a0dd00b9060240160206040518083038186803b158015610ca557600080fd5b505afa158015610cb9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cdd919061436b565b610cfa5760405163a596698b60e01b815260040160405180910390fd5b85610d18576040516310eb483f60e21b815260040160405180910390fd5b6040516370a0823160e01b81523360048201526001600160a01b038816906370a082319060240160206040518083038186803b158015610d5757600080fd5b505afa158015610d6b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d8f9190614386565b861115610daf57604051635de1e54160e01b815260040160405180910390fd5b6002546040516313f1e1f560e31b81526001600160a01b038a81166004830152909116906000908290639f8f0fa89060240160206040518083038186803b158015610df957600080fd5b505afa158015610e0d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e319190614307565b6040516370a0823160e01b81523360048201529091506001600160a01b038216906370a082319060240160206040518083038186803b158015610e7357600080fd5b505afa158015610e87573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eab9190614386565b871115610ecb57604051635de1e54160e01b815260040160405180910390fd5b6040516336e1668760e11b81526001600160a01b038a1690636dc2cd0e90610ef99033908c906004016143cc565b6040805180830381600087803b158015610f1257600080fd5b505af1158015610f26573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f4a91906143e5565b5095506000610f6c610f5a61098d565b610f638c61331b565b8d8a600061338e565b604051630450cfaf60e31b81529091506001600160a01b038316906322867d7890610f9d90339085906004016143cc565b6040805180830381600087803b158015610fb657600080fd5b505af1158015610fca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fee91906143e5565b5095508786101561101257604051634394bddf60e11b815260040160405180910390fd5b60405163dde3ab9560e01b81523360048201526000906001600160a01b0385169063dde3ab959060240160a06040518083038186803b15801561105457600080fd5b505afa158015611068573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061108c9190614409565b505050509050806110b05760405163cfd3600360e01b815260040160405180910390fd5b8a6001600160a01b03168c6001600160a01b03167f70e2337c0939e469d0c3d069c581bc0b72c541a70c592cdd46087d24e5e980d28a8a6040516110fe929190918252602082015260400190565b60405180910390a35050505050506001808190555094509492505050565b60405162461bcd60e51b815260206004820152600a60248201526919195c1c9958d85d195960b21b6044820152606401610542565b600061119284848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506133a892505050565b600081815260366020908152604091829020825160a081018452815461ffff811682526201000090046001600160a01b03908116938201939093526001820154938101939093526002015490811660608301819052600160a01b90910460ff161515608083015291945092501515905061121f576040516311bf899560e21b815260040160405180910390fd5b80608001511561124257604051630814de4560e11b815260040160405180910390fd5b80606001516001600160a01b0316336001600160a01b031614156112755760008281526036602052604090206001018390555b600061127f610a42565b60405163dfda255f60e01b815261ffff8d1660048201529091506000906001600160a01b0383169063dfda255f9060240160206040518083038186803b1580156112c857600080fd5b505afa1580156112dc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113009190614307565b604051602001611328919060609190911b6bffffffffffffffffffffffff1916815260140190565b604051602081830303815290604052905082602001516001600160a01b0316636d1bb8f76040518163ffffffff1660e01b815260040160206040518083038186803b15801561137657600080fd5b505afa15801561138a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ae9190614307565b6001600160a01b031663cfd6528e8d8d8d8d86888f8f8f6040518a63ffffffff1660e01b81526004016113e999989796959493929190614479565b600060405180830381600087803b15801561140357600080fd5b505af1158015611417573d6000803e3d6000fd5b50505050505050505050505050505050565b600080600260009054906101000a90046001600160a01b03166001600160a01b031663ecf3a3f96040518163ffffffff1660e01b815260040160206040518083038186803b15801561147a57600080fd5b505afa15801561148e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114b2919061436b565b156114d057604051631b0e923f60e11b815260040160405180910390fd5b600260015414156114f35760405162461bcd60e51b815260040161054290614324565b6002600181905554604051633e25dee160e21b81526001600160a01b03808a1660048301528992169063f8977b849060240160206040518083038186803b15801561153d57600080fd5b505afa158015611551573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611575919061436b565b6115925760405163a67d528360e01b815260040160405180910390fd5b600254604051631a0dd00b60e01b81526001600160a01b03808a16600483015289921690631a0dd00b9060240160206040518083038186803b1580156115d757600080fd5b505afa1580156115eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061160f919061436b565b61162c5760405163a596698b60e01b815260040160405180910390fd5b8661164a576040516310eb483f60e21b815260040160405180910390fd5b670de0b6b3a7640000861161167257604051631907e1ff60e21b815260040160405180910390fd5b6116ae896001600160a01b031663df011c416040518163ffffffff1660e01b815260040160206040518083038186803b15801561070757600080fd5b8611156116ce57604051630a4f5a0760e01b815260040160405180910390fd5b60006116d861098d565b905060006116e58b61331b565b90506001600160a01b038c166116f957809b505b6117048c338b612dcd565b9850806001600160a01b03168c6001600160a01b0316146117305761172d828d838c600061338e565b98505b600061173e828c8c8c612eee565b6002546040516313f1e1f560e31b81526001600160a01b038e8116600483015292935060009290911690639f8f0fa89060240160206040518083038186803b15801561178957600080fd5b505afa15801561179d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117c19190614307565b604051635fd0bb2b60e11b81529091506001600160a01b0382169063bfa17656906117f290309086906004016143cc565b6040805180830381600087803b15801561180b57600080fd5b505af115801561181f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061184391906143e5565b506040516340c10f1960e01b81529097506001600160a01b038216906340c10f199061187590339086906004016143cc565b600060405180830381600087803b15801561188f57600080fd5b505af11580156118a3573d6000803e3d6000fd5b50505050505060006118b9838c8489600061338e565b6118c3908b6144f4565b9050878110156118e65760405163c724afdf60e01b815260040160405180910390fd5b6118fb6001600160a01b0383168d60006133e7565b61190f6001600160a01b0383168d836133e7565b604051636e553f6560e01b8152600481018290523360248201526001600160a01b038d1690636e553f65906044016040805180830381600087803b15801561195657600080fd5b505af115801561196a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061198e91906143e5565b5060025460405163dde3ab9560e01b81523360048201529198506000916001600160a01b039091169063dde3ab959060240160a06040518083038186803b1580156119d857600080fd5b505afa1580156119ec573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a109190614409565b50505050905080611a345760405163cfd3600360e01b815260040160405180910390fd5b8b6001600160a01b03168d6001600160a01b03168f6001600160a01b03167fd82c156e929db20771fc8413cc0789925f6c666a3e5076d5844765ee28bb3a958d8f8c8e604051611a9d949392919093845260208401929092526040830152606082015260800190565b60405180910390a450505050505060018081905550965096945050505050565b6000611afe84848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061353692505050565b600081815260356020908152604091829020825161014081018452815461ffff811682526201000090046001600160a01b0390811693820193909352600182015483169381019390935260028101548216606084015260038101546080840152600481015460a0840152600581015460c0840152600681015480831660e08501819052600160a01b90910460ff1615156101008501526007909101549091166101208301529193509150611bc5576040516311bf899560e21b815260040160405180910390fd5b80610100015115611be957604051630814de4560e11b815260040160405180910390fd5b8060e001516001600160a01b0316336001600160a01b03161415611c1c5760008281526035602052604090206005018390555b6000611c26610a42565b60405163dfda255f60e01b815261ffff8e1660048201529091506000906001600160a01b0383169063dfda255f9060240160206040518083038186803b158015611c6f57600080fd5b505afa158015611c83573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ca79190614307565b6040516bffffffffffffffffffffffff19606083901b16602082015290915060009063ab8236f360e01b908f9060340160408051601f1981840301815290829052611cff92918f908f908f908f908f9060240161450c565b604051602081830303815290604052906001600160e01b0319166020820180516001600160e01b0383818316178352505050509050826001600160a01b0316633352b6086040518163ffffffff1660e01b815260040160206040518083038186803b158015611d6d57600080fd5b505afa158015611d81573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611da59190614307565b6001600160a01b031663c0e6ac6c8f8f8f8f88876040518763ffffffff1660e01b8152600401611dda96959493929190614570565b600060405180830381600087803b158015611df457600080fd5b505af1158015611e08573d6000803e3d6000fd5b505050505050505050505050505050505050565b6002546040805163ecf3a3f960e01b815290516000926001600160a01b03169163ecf3a3f9916004808301926020929190829003018186803b158015611e6157600080fd5b505afa158015611e75573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e99919061436b565b15611eb757604051631b0e923f60e11b815260040160405180910390fd5b60026001541415611eda5760405162461bcd60e51b815260040161054290614324565b6002600155611ee7610a42565b6001600160a01b0316336001600160a01b031614611f1857604051632b78ce1b60e11b815260040160405180910390fd5b600083815260366020908152604091829020825160a081018452815461ffff811682526201000090046001600160a01b03908116938201939093526001820154938101939093526002015490811660608301819052600160a01b90910460ff1615156080830152611f9c576040516311bf899560e21b815260040160405180910390fd5b806080015115611fbf57604051630814de4560e11b815260040160405180910390fd5b6000848152603660209081526040909120600201805460ff60a01b1916600160a01b179055810151611ff2903385612dcd565b60025460208301516040516313f1e1f560e31b81526001600160a01b039182166004820152929550600092911690639f8f0fa89060240160206040518083038186803b15801561204157600080fd5b505afa158015612055573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120799190614307565b60608301516040516370a0823160e01b81526001600160a01b0391821660048201529192506000919083169063c9dc4b4d9082906370a082319060240160206040518083038186803b1580156120ce57600080fd5b505afa1580156120e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121069190614386565b6040518263ffffffff1660e01b815260040161212491815260200190565b604080518083038186803b15801561213b57600080fd5b505afa15801561214f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061217391906143e5565b5090506000612182868361356f565b6060850151604051630450cfaf60e31b81529192506001600160a01b038516916322867d78916121b69185906004016143cc565b6040805180830381600087803b1580156121cf57600080fd5b505af11580156121e3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061220791906143e5565b50604085015190955085101561223057604051634394bddf60e11b815260040160405180910390fd5b808611156122605760608401516122609061224b83896143b5565b60208701516001600160a01b03169190613585565b60405187907f46da7fdc7ceed834de258df19d8f9ebd7082810a4eb45732d1401df31e5aaa1390600090a250506001805550909392505050565b6002546040805163ecf3a3f960e01b815290516000926001600160a01b03169163ecf3a3f9916004808301926020929190829003018186803b1580156122df57600080fd5b505afa1580156122f3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612317919061436b565b1561233557604051631b0e923f60e11b815260040160405180910390fd5b600260015414156123585760405162461bcd60e51b815260040161054290614324565b6002600155612365610a42565b6001600160a01b0316336001600160a01b03161461239657604051632b78ce1b60e11b815260040160405180910390fd5b600083815260356020908152604091829020825161014081018452815461ffff811682526201000090046001600160a01b0390811693820193909352600182015483169381019390935260028101548216606084015260038101546080840152600481015460a0840152600581015460c0840152600681015480831660e08501819052600160a01b90910460ff161515610100850152600790910154909116610120830152612458576040516311bf899560e21b815260040160405180910390fd5b8061010001511561247c57604051630814de4560e11b815260040160405180910390fd5b600061248b826040015161331b565b6000868152603560209081526040909120600601805460ff60a01b1916600160a01b1790558301519091506124c1903386612dcd565b9350600082602001516001600160a01b03168361012001516001600160a01b03161415612518576125116124f361098d565b8461012001518488876080015161250a91906144f4565b600061338e565b905061255e565b61253661252361098d565b846101200151848660800151600061338e565b905061255161254361098d565b84602001518488600061338e565b61255b90826144f4565b90505b8260c001518110156125835760405163c724afdf60e01b815260040160405180910390fd5b604083015161259e906001600160a01b0384169060006133e7565b60408301516125b8906001600160a01b03841690836133e7565b60408084015160e08501519151636e553f6560e01b8152600481018490526001600160a01b039283166024820152911690636e553f65906044016040805180830381600087803b15801561260b57600080fd5b505af115801561261f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061264391906143e5565b5060025460608501516040516313f1e1f560e31b81526001600160a01b03918216600482015292965016908190639f8f0fa89060240160206040518083038186803b15801561269157600080fd5b505afa1580156126a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126c99190614307565b6001600160a01b03166340c10f198560e001518660a001516040518363ffffffff1660e01b81526004016126fe9291906143cc565b600060405180830381600087803b15801561271857600080fd5b505af115801561272c573d6000803e3d6000fd5b5050505060e084015160405163dde3ab9560e01b81526001600160a01b03918216600482015260009183169063dde3ab959060240160a06040518083038186803b15801561277957600080fd5b505afa15801561278d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127b19190614409565b505050509050806127d55760405163cfd3600360e01b815260040160405180910390fd5b60405188907f8e4ff8e32fb3b90b184bdac5bf0d9b2a0fe19baa9dfea95c0fcd7d8e3842e80e90600090a25050600180555091949350505050565b600260015414156128335760405162461bcd60e51b815260040161054290614324565b6002600181905554604051633e25dee160e21b81526001600160a01b03808b1660048301528a92169063f8977b849060240160206040518083038186803b15801561287d57600080fd5b505afa158015612891573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128b5919061436b565b6128d25760405163a67d528360e01b815260040160405180910390fd5b600254604051631a0dd00b60e01b81526001600160a01b03808d1660048301528c921690631a0dd00b9060240160206040518083038186803b15801561291757600080fd5b505afa15801561292b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061294f919061436b565b61296c5760405163a596698b60e01b815260040160405180910390fd5b8861298a576040516310eb483f60e21b815260040160405180910390fd5b600260009054906101000a90046001600160a01b03166001600160a01b031663afcff50f6040518163ffffffff1660e01b815260040160206040518083038186803b1580156129d857600080fd5b505afa1580156129ec573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a109190614307565b6001600160a01b031663995031cd6040518163ffffffff1660e01b815260040160206040518083038186803b158015612a4857600080fd5b505afa158015612a5c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a80919061436b565b612a9d57604051639e0d93d560e01b815260040160405180910390fd5b6002546040516313f1e1f560e31b81526001600160a01b038d811660048301526000928392911690639f8f0fa89060240160206040518083038186803b158015612ae657600080fd5b505afa158015612afa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b1e9190614307565b9050806001600160a01b031663a6afed956040518163ffffffff1660e01b8152600401600060405180830381600087803b158015612b5b57600080fd5b505af1158015612b6f573d6000803e3d6000fd5b50506040516370a0823160e01b81523360048201526001600160a01b03841692506370a08231915060240160206040518083038186803b158015612bb257600080fd5b505afa158015612bc6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bea9190614386565b871115612c0a57604051635de1e54160e01b815260040160405180910390fd5b612c12610a42565b91505060008b6001600160a01b0316639470b0bd338d6040518363ffffffff1660e01b8152600401612c459291906143cc565b6040805180830381600087803b158015612c5e57600080fd5b505af1158015612c72573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c9691906143e5565b509050612cb6612ca461098d565b612cad8e61331b565b8c848d876135a4565b9050612cc8828b8f848c8c8c8c6137c0565b5050600180555050505050505050505050565b6000612ce76001613949565b90508015612cff576000805461ff0019166101001790555b6001600160a01b038216612d2657604051633cb1fb1f60e11b815260040160405180910390fd5b612d2e6139d6565b612d3782613a07565b8015612d7d576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050565b6001600160a01b03163b151590565b600081612d9e6002826145cc565b612db0670de0b6b3a7640000866145ee565b612dba91906144f4565b612dc491906145cc565b90505b92915050565b6040516370a0823160e01b815230600482015260009081906001600160a01b038616906370a082319060240160206040518083038186803b158015612e1157600080fd5b505afa158015612e25573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e499190614386565b9050612e606001600160a01b038616853086613a77565b6040516370a0823160e01b815230600482015281906001600160a01b038716906370a082319060240160206040518083038186803b158015612ea157600080fd5b505afa158015612eb5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ed99190614386565b612ee391906143b5565b9150505b9392505050565b60025460408051637556d1c160e11b815290516000926001600160a01b03169163eaada382916004808301926020929190829003018186803b158015612f3357600080fd5b505afa158015612f47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f6b9190614307565b6001600160a01b031663b64663848686612f9787612f91670de0b6b3a7640000896143b5565b90613ab5565b6040516001600160e01b031960e086901b1681526001600160a01b039384166004820152929091166024830152604482015260640160206040518083038186803b158015612fe457600080fd5b505afa158015612ff8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061301c9190614386565b95945050505050565b600061302f613aed565b90506000806000808980602001905181019061304b919061460d565b9350935093509350600061309488888080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250613b3492505050565b505090506040518061014001604052808261ffff168152602001856001600160a01b031681526020018b6001600160a01b03168152602001866001600160a01b031681526020018e81526020018d81526020018a8152602001336001600160a01b031681526020016000151581526020018f6001600160a01b03168152506035600088815260200190815260200160002060008201518160000160006101000a81548161ffff021916908361ffff16021790555060208201518160000160026101000a8154816001600160a01b0302191690836001600160a01b0316021790555060408201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060608201518160020160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506080820151816003015560a0820151816004015560c0820151816005015560e08201518160060160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506101008201518160060160146101000a81548160ff0219169083151502179055506101208201518160070160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555090505050613275610a42565b6001600160a01b03166339f648bf348733888888888f8f6040518a63ffffffff1660e01b81526004016132af989796959493929190614655565b6000604051808303818588803b1580156132c857600080fd5b505af11580156132dc573d6000803e3d6000fd5b50506040518893507f46a791deaa2c43990d6e3b60a320fbebef9a6677379f326b308fb9efc8128619925060009150a250505050505050505050505050565b6000816001600160a01b0316636f307dc36040518163ffffffff1660e01b815260040160206040518083038186803b15801561335657600080fd5b505afa15801561336a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612dc79190614307565b600061339e8686868686306135a4565b9695505050505050565b6000806000838060200190518101906133c191906146b4565b80519095506133da91508501602090810190860161477d565b9250925092509193909250565b8015806134705750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b15801561343657600080fd5b505afa15801561344a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061346e9190614386565b155b6134db5760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b6064820152608401610542565b6135318363095ea7b360e01b84846040516024016134fa9291906143cc565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152613b4d565b505050565b6000808280602001905181019061354d91906146b4565b80519094506135669150840160209081019085016147c0565b91509150915091565b600081831061357e5781612dc4565b5090919050565b6135318363a9059cbb60e01b84846040516024016134fa9291906143cc565b6000846001600160a01b0316866001600160a01b031614613791576135d46001600160a01b0387168860006133e7565b6135e86001600160a01b03871688866133e7565b6040516370a0823160e01b81526001600160a01b038381166004830152600091908716906370a082319060240160206040518083038186803b15801561362d57600080fd5b505afa158015613641573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136659190614386565b604051636ccb2b0160e01b81526001600160a01b03898116600483015288811660248301526044820188905260648201879052858116608483015291925090891690636ccb2b019060a401602060405180830381600087803b1580156136ca57600080fd5b505af11580156136de573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137029190614386565b506040516370a0823160e01b81526001600160a01b0384811660048301528291908816906370a082319060240160206040518083038186803b15801561374757600080fd5b505afa15801561375b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061377f9190614386565b61378991906143b5565b91505061339e565b6001600160a01b03821630146137b5576137b56001600160a01b0387168386613585565b509195945050505050565b60006137ca613aed565b9050600061380d84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250613b3492505050565b50506040805160a08101825261ffff80841682526001600160a01b03808d1660208085019182528486018c815233606087018181526000608089018181528d82526036909552899020975188549551871662010000026001600160b01b031990961697169690961793909317865551600186015592516002909401805493511515600160a01b026001600160a81b03199094169483169490941792909217909255915162bc9db960e01b81529293508c169162bc9db99134916138e09187918f908f908f908f908e908e90600401614655565b6000604051808303818588803b1580156138f957600080fd5b505af115801561390d573d6000803e3d6000fd5b50506040518593507ff83a8331f3e68a894879f051738cb73cdced1709a214e49f6dc1d541a0415e8b925060009150a250505050505050505050565b60008054610100900460ff1615613990578160ff16600114801561396c5750303b155b6139885760405162461bcd60e51b8152600401610542906147ee565b506000919050565b60005460ff8084169116106139b75760405162461bcd60e51b8152600401610542906147ee565b506000805460ff191660ff92909216919091179055600190565b919050565b600054610100900460ff166139fd5760405162461bcd60e51b81526004016105429061483c565b613a05613c1f565b565b600054610100900460ff16613a2e5760405162461bcd60e51b81526004016105429061483c565b6001600160a01b038116613a555760405163724f500960e01b815260040160405180910390fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6040516001600160a01b0380851660248301528316604482015260648101829052613aaf9085906323b872dd60e01b906084016134fa565b50505050565b6000821580613ac2575081155b15613acf57506000612dc7565b670de0b6b3a7640000613ae36002826145cc565b612db084866145ee565b600046603460008154613aff90614887565b91829055506040805160208101939093528201526060016040516020818303038152906040528051906020012060001c905090565b6000806000838060200190518101906133da91906148a2565b6000613ba2826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316613c4c9092919063ffffffff16565b8051909150156135315780806020019051810190613bc0919061436b565b6135315760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610542565b600054610100900460ff16613c465760405162461bcd60e51b81526004016105429061483c565b60018055565b6060613c5b8484600085613c63565b949350505050565b606082471015613cc45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610542565b6001600160a01b0385163b613d1b5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610542565b600080866001600160a01b03168587604051613d3791906148e5565b60006040518083038185875af1925050503d8060008114613d74576040519150601f19603f3d011682016040523d82523d6000602084013e613d79565b606091505b5091509150613d89828286613d94565b979650505050505050565b60608315613da3575081612ee7565b825115613db35782518084602001fd5b8160405162461bcd60e51b815260040161054291906142f4565b6001600160a01b0381168114613de257600080fd5b50565b60008083601f840112613df757600080fd5b50813567ffffffffffffffff811115613e0f57600080fd5b602083019150836020828501011115613e2757600080fd5b9250929050565b6000806000806000806000806000806101208b8d031215613e4e57600080fd5b8a35613e5981613dcd565b995060208b0135613e6981613dcd565b985060408b0135613e7981613dcd565b975060608b0135613e8981613dcd565b965060808b0135955060a08b0135945060c08b0135935060e08b013592506101008b013567ffffffffffffffff811115613ec257600080fd5b613ece8d828e01613de5565b915080935050809150509295989b9194979a5092959850565b60008060008060808587031215613efd57600080fd5b8435613f0881613dcd565b93506020850135613f1881613dcd565b93969395505050506040820135916060013590565b60008060008060008060008060006101008a8c031215613f4c57600080fd5b8935613f5781613dcd565b985060208a0135613f6781613dcd565b975060408a0135613f7781613dcd565b965060608a0135955060808a0135945060a08a0135935060c08a0135925060e08a013567ffffffffffffffff811115613faf57600080fd5b613fbb8c828d01613de5565b915080935050809150509295985092959850929598565b61ffff81168114613de257600080fd5b67ffffffffffffffff81168114613de257600080fd5b60008060008060008060008060c0898b03121561401457600080fd5b883561401f81613fd2565b9750602089013567ffffffffffffffff8082111561403c57600080fd5b6140488c838d01613de5565b909950975060408b0135915061405d82613fe2565b90955060608a0135945060808a0135908082111561407a57600080fd5b506140878b828c01613de5565b999c989b50969995989497949560a00135949350505050565b60008060008060008060c087890312156140b957600080fd5b86356140c481613dcd565b955060208701356140d481613dcd565b945060408701356140e481613dcd565b959894975094956060810135955060808101359460a0909101359350915050565b600080600080600080600080600060e08a8c03121561412357600080fd5b893561412e81613fd2565b985060208a013567ffffffffffffffff8082111561414b57600080fd5b6141578d838e01613de5565b909a50985060408c0135915061416c82613fe2565b90965060608b01359061417e82613dcd565b90955060808b0135945060a08b0135908082111561419b57600080fd5b506141a88c828d01613de5565b9a9d999c50979a9699959894979660c00135949350505050565b600080604083850312156141d557600080fd5b50508035926020909101359150565b6000602082840312156141f657600080fd5b5035919050565b60008060008060008060008060006101008a8c03121561421c57600080fd5b893561422781613dcd565b985060208a013561423781613dcd565b975060408a0135965060608a013561424e81613dcd565b955060808a0135945060a08a0135935060c08a0135925060e08a013567ffffffffffffffff811115613faf57600080fd5b60006020828403121561429157600080fd5b8135612ee781613dcd565b60005b838110156142b757818101518382015260200161429f565b83811115613aaf5750506000910152565b600081518084526142e081602086016020860161429c565b601f01601f19169290920160200192915050565b602081526000612dc460208301846142c8565b60006020828403121561431957600080fd5b8151612ee781613dcd565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b805180151581146139d157600080fd5b60006020828403121561437d57600080fd5b612dc48261435b565b60006020828403121561439857600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b6000828210156143c7576143c761439f565b500390565b6001600160a01b03929092168252602082015260400190565b600080604083850312156143f857600080fd5b505080516020909101519092909150565b600080600080600060a0868803121561442157600080fd5b61442a8661435b565b602087015160408801516060890151608090990151929a91995097965090945092505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b61ffff8a16815260e06020820152600061449760e083018a8c614450565b67ffffffffffffffff8916604084015282810360608401526144b981896142c8565b6001600160a01b038816608085015260a0840187905283810360c085015290506144e4818587614450565b9c9b505050505050505050505050565b600082198211156145075761450761439f565b500190565b61ffff8816815260c06020820152600061452960c08301896142c8565b67ffffffffffffffff881660408401526001600160a01b03871660608401526080830186905282810360a0840152614562818587614450565b9a9950505050505050505050565b61ffff8716815260a06020820152600061458e60a083018789614450565b67ffffffffffffffff861660408401526001600160a01b038516606084015282810360808401526145bf81856142c8565b9998505050505050505050565b6000826145e957634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156146085761460861439f565b500290565b6000806000806080858703121561462357600080fd5b845161462e81613dcd565b602086015190945061463f81613dcd565b6040860151606090960151949790965092505050565b8881526001600160a01b0388811660208301528781166040830152861660608201526080810185905260a0810184905260e060c082018190526000906145629083018486614450565b634e487b7160e01b600052604160045260246000fd5b600080604083850312156146c757600080fd5b825160ff811681146146d857600080fd5b602084015190925067ffffffffffffffff808211156146f657600080fd5b818501915085601f83011261470a57600080fd5b81518181111561471c5761471c61469e565b604051601f8201601f19908116603f011681019083821181831017156147445761474461469e565b8160405282815288602084870101111561475d57600080fd5b61476e83602083016020880161429c565b80955050505050509250929050565b60008060006060848603121561479257600080fd5b835161479d81613dcd565b60208501519093506147ae81613dcd565b80925050604084015190509250925092565b600080604083850312156147d357600080fd5b82516147de81613dcd565b6020939093015192949293505050565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b600060001982141561489b5761489b61439f565b5060010190565b6000806000606084860312156148b757600080fd5b83516148c281613fd2565b6020850151604086015191945092506148da81613fe2565b809150509250925092565b600082516148f781846020870161429c565b919091019291505056fea264697066735822122045475cac2017390a8d2f1a29e2196db5086f999766a02f96d8ac9c13a33a650b64736f6c63430008090033", + "numDeployments": 2, + "solcInputHash": "210845288ae75ad5da12a755a9f52e1f", + "metadata": "{\"compiler\":{\"version\":\"0.8.9+commit.e5eed63a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AmountIsTooHigh\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AmountIsZero\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BridgeTokenIsNull\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CrossChainFlashRepayInactive\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CrossChainRequestCompletedAlready\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CrossChainRequestInvalidKey\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DepositTokenDoesNotExist\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FlashRepaySlippageTooHigh\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IsShutdown\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LeverageSlippageTooHigh\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LeverageTooHigh\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"LeverageTooLow\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PoolAddressIsNull\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PoolIsNull\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PositionIsNotHealthy\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SenderIsNotCrossChainDispatcher\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SyntheticDoesNotExist\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TokenInIsNull\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"CrossChainFlashRepayFinished\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"CrossChainFlashRepayStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"CrossChainLeverageFinished\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"CrossChainLeverageStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract ISyntheticToken\",\"name\":\"syntheticToken\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"contract IDepositToken\",\"name\":\"depositToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"withdrawn\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"repaid\",\"type\":\"uint256\"}],\"name\":\"FlashRepaid\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IERC20\",\"name\":\"tokenIn\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"contract IDepositToken\",\"name\":\"depositToken\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"contract ISyntheticToken\",\"name\":\"syntheticToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"leverage\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"issued\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"deposited\",\"type\":\"uint256\"}],\"name\":\"Leveraged\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"VERSION\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"crossChainDispatcher\",\"outputs\":[{\"internalType\":\"contract ICrossChainDispatcher\",\"name\":\"_crossChainDispatcher\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ISyntheticToken\",\"name\":\"syntheticToken_\",\"type\":\"address\"},{\"internalType\":\"contract IDepositToken\",\"name\":\"depositToken_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"withdrawAmount_\",\"type\":\"uint256\"},{\"internalType\":\"contract IERC20\",\"name\":\"bridgeToken_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"bridgeTokenAmountMin_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"swapAmountOutMin_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"repayAmountMin_\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"lzArgs_\",\"type\":\"bytes\"}],\"name\":\"crossChainFlashRepay\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"swapAmountOut_\",\"type\":\"uint256\"}],\"name\":\"crossChainFlashRepayCallback\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_repaid\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"crossChainFlashRepays\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"dstChainId\",\"type\":\"uint16\"},{\"internalType\":\"contract ISyntheticToken\",\"name\":\"syntheticToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"repayAmountMin\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"finished\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"tokenIn_\",\"type\":\"address\"},{\"internalType\":\"contract ISyntheticToken\",\"name\":\"syntheticToken_\",\"type\":\"address\"},{\"internalType\":\"contract IERC20\",\"name\":\"bridgeToken_\",\"type\":\"address\"},{\"internalType\":\"contract IDepositToken\",\"name\":\"depositToken_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountIn_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"leverage_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"swapAmountOutMin_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"depositAmountMin_\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"lzArgs_\",\"type\":\"bytes\"}],\"name\":\"crossChainLeverage\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"contract IDepositToken\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"contract ISyntheticToken\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"crossChainLeverage\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"swapAmountOut_\",\"type\":\"uint256\"}],\"name\":\"crossChainLeverageCallback\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_deposited\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"crossChainLeverages\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"dstChainId\",\"type\":\"uint16\"},{\"internalType\":\"contract IERC20\",\"name\":\"bridgeToken\",\"type\":\"address\"},{\"internalType\":\"contract IDepositToken\",\"name\":\"depositToken\",\"type\":\"address\"},{\"internalType\":\"contract ISyntheticToken\",\"name\":\"syntheticToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"debtAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"depositAmountMin\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"finished\",\"type\":\"bool\"},{\"internalType\":\"contract IERC20\",\"name\":\"tokenIn\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"crossChainRequestsLength\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ISyntheticToken\",\"name\":\"syntheticToken_\",\"type\":\"address\"},{\"internalType\":\"contract IDepositToken\",\"name\":\"depositToken_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"withdrawAmount_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"repayAmountMin_\",\"type\":\"uint256\"}],\"name\":\"flashRepay\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_withdrawn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_repaid\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IPool\",\"name\":\"pool_\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"tokenIn_\",\"type\":\"address\"},{\"internalType\":\"contract IDepositToken\",\"name\":\"depositToken_\",\"type\":\"address\"},{\"internalType\":\"contract ISyntheticToken\",\"name\":\"syntheticToken_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountIn_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"leverage_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"depositAmountMin_\",\"type\":\"uint256\"}],\"name\":\"leverage\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_deposited\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_issued\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pool\",\"outputs\":[{\"internalType\":\"contract IPool\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"srcChainId_\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"srcAddress_\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"nonce_\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"amount_\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"payload_\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"newRepayAmountMin_\",\"type\":\"uint256\"}],\"name\":\"retryCrossChainFlashRepayCallback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"srcChainId_\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"srcAddress_\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"nonce_\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"token_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount_\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"payload_\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"newDepositAmountMin_\",\"type\":\"uint256\"}],\"name\":\"retryCrossChainLeverageCallback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"swapper\",\"outputs\":[{\"internalType\":\"contract ISwapper\",\"name\":\"_swapper\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"crossChainFlashRepayCallback(uint256,uint256)\":{\"details\":\"Receives msAsset from L1 and use it to repay\",\"params\":{\"id_\":\"The id of the request\",\"swapAmountOut_\":\"The msAsset amount received from L1 swap\"},\"returns\":{\"_repaid\":\"The debt amount repaid\"}},\"crossChainLeverage(address,address,address,uint256,uint256,uint256,uint256,bytes)\":{\"details\":\"Keep this function to avoid changing interface Refs: https://github.com/autonomoussoftware/metronome-synth/issues/877\"},\"crossChainLeverageCallback(uint256,uint256)\":{\"details\":\"Receives bridged token (aka naked token) use it to deposit\",\"params\":{\"id_\":\"The id of the request\",\"swapAmountOut_\":\"The amount received from swap\"},\"returns\":{\"_deposited\":\"The amount deposited\"}},\"flashRepay(address,address,uint256,uint256)\":{\"params\":{\"depositToken_\":\"The collateral to withdraw\",\"repayAmountMin_\":\"The minimum amount to repay (slippage check)\",\"syntheticToken_\":\"The debt token to repay\",\"withdrawAmount_\":\"The amount to withdraw\"}},\"governor()\":{\"returns\":{\"_governor\":\"The governor\"}},\"leverage(address,address,address,uint256,uint256,uint256)\":{\"params\":{\"amountIn_\":\"The amount to deposit\",\"depositAmountMin_\":\"The min final deposit amount (slippage)\",\"depositToken_\":\"The collateral to deposit\",\"leverage_\":\"The leverage X param (e.g. 1.5e18 for 1.5X)\",\"syntheticToken_\":\"The msAsset to mint\",\"tokenIn_\":\"The token to transfer\"}},\"retryCrossChainFlashRepayCallback(uint16,bytes,uint64,uint256,bytes,uint256)\":{\"details\":\"This function is used to recover from callback failures due to slippage\",\"params\":{\"amount_\":\"The amount of failed tx\",\"newRepayAmountMin_\":\"If repayment failed due to slippage, caller may send lower newRepayAmountMin_\",\"nonce_\":\"The nonce of failed tx\",\"payload_\":\"The payload of failed tx\",\"srcAddress_\":\"The source path of failed tx\",\"srcChainId_\":\"The source chain of failed tx\"}},\"retryCrossChainLeverageCallback(uint16,bytes,uint64,address,uint256,bytes,uint256)\":{\"details\":\"This function is used to recover from callback failures due to slippage\",\"params\":{\"amount_\":\"The amountIn of failed tx\",\"newDepositAmountMin_\":\"If deposit failed due to slippage, caller may send lower newDepositAmountMin_\",\"nonce_\":\"The nonce of failed tx\",\"payload_\":\"The payload of failed tx\",\"srcAddress_\":\"The source path of failed tx\",\"srcChainId_\":\"The source chain of failed tx\",\"token_\":\"The token of failed tx\"}}},\"title\":\"SmartFarmingManager contract\",\"version\":1},\"userdoc\":{\"events\":{\"CrossChainFlashRepayFinished(uint256)\":{\"notice\":\"Emitted when a cross-chain flash repay request is finalized\"},\"CrossChainFlashRepayStarted(uint256)\":{\"notice\":\"Emitted when a cross-chain flash repay request is created\"},\"CrossChainLeverageFinished(uint256)\":{\"notice\":\"Emitted when a cross-chain leverage request is finalized\"},\"CrossChainLeverageStarted(uint256)\":{\"notice\":\"Emitted when a cross-chain leverage request is created\"},\"FlashRepaid(address,address,uint256,uint256)\":{\"notice\":\"Emitted when debt is flash repaid\"},\"Leveraged(address,address,address,uint256,uint256,uint256,uint256)\":{\"notice\":\"Emitted when deposit is leveraged\"}},\"kind\":\"user\",\"methods\":{\"crossChainDispatcher()\":{\"notice\":\"Get the Cross-chain dispatcher contract\"},\"crossChainFlashRepayCallback(uint256,uint256)\":{\"notice\":\"Finalize cross-chain flash debt repayment process\"},\"crossChainFlashRepays(uint256)\":{\"notice\":\"Cross-chain flash repay requests\"},\"crossChainLeverageCallback(uint256,uint256)\":{\"notice\":\"Finalize cross-chain leverage process\"},\"crossChainLeverages(uint256)\":{\"notice\":\"Cross-chain leverage requests\"},\"crossChainRequestsLength()\":{\"notice\":\"Cross-chain requests counter\"},\"flashRepay(address,address,uint256,uint256)\":{\"notice\":\"Flash debt repayment\"},\"governor()\":{\"notice\":\"Get the governor\"},\"leverage(address,address,address,uint256,uint256,uint256)\":{\"notice\":\"Leverage yield position\"},\"pool()\":{\"notice\":\"Pool contract\"},\"retryCrossChainFlashRepayCallback(uint16,bytes,uint64,uint256,bytes,uint256)\":{\"notice\":\"Retry cross-chain flash repay callback\"},\"retryCrossChainLeverageCallback(uint16,bytes,uint64,address,uint256,bytes,uint256)\":{\"notice\":\"Retry cross-chain leverage callback\"},\"swapper()\":{\"notice\":\"Get the swapper contract\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/SmartFarmingManager.sol\":\"SmartFarmingManager\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/SmartFarmingManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./utils/ReentrancyGuard.sol\\\";\\nimport \\\"./dependencies/openzeppelin/token/ERC20/utils/SafeERC20.sol\\\";\\nimport \\\"./dependencies/openzeppelin/utils/math/Math.sol\\\";\\nimport \\\"./interfaces/external/IStargateComposerWithRetry.sol\\\";\\nimport \\\"./access/Manageable.sol\\\";\\nimport \\\"./storage/SmartFarmingManagerStorage.sol\\\";\\nimport \\\"./lib/WadRayMath.sol\\\";\\nimport \\\"./lib/CrossChainLib.sol\\\";\\n\\nerror SyntheticDoesNotExist();\\nerror PoolIsNull();\\nerror FlashRepaySlippageTooHigh();\\nerror LeverageTooLow();\\nerror LeverageTooHigh();\\nerror LeverageSlippageTooHigh();\\nerror PositionIsNotHealthy();\\nerror AmountIsZero();\\nerror AmountIsTooHigh();\\nerror DepositTokenDoesNotExist();\\nerror AddressIsNull();\\nerror NewValueIsSameAsCurrent();\\nerror CrossChainRequestInvalidKey();\\nerror SenderIsNotCrossChainDispatcher();\\nerror CrossChainRequestCompletedAlready();\\nerror TokenInIsNull();\\nerror BridgeTokenIsNull();\\nerror CrossChainFlashRepayInactive();\\n\\n// Note: The `IPoolRegistry` wasn't updated to avoid changing interface\\n// Refs: https://github.com/autonomoussoftware/metronome-synth/issues/877\\ninterface IPoolRegistryV3 is IPoolRegistry {\\n function isCrossChainFlashRepayActive() external view returns (bool);\\n}\\n\\n/**\\n * @title SmartFarmingManager contract\\n */\\ncontract SmartFarmingManager is ReentrancyGuard, Manageable, SmartFarmingManagerStorageV1 {\\n using SafeERC20 for IERC20;\\n using SafeERC20 for ISyntheticToken;\\n using WadRayMath for uint256;\\n\\n string public constant VERSION = \\\"1.3.0\\\";\\n\\n /// @notice Emitted when a cross-chain leverage request is finalized\\n event CrossChainLeverageFinished(uint256 indexed id);\\n\\n /// @notice Emitted when a cross-chain leverage request is created\\n event CrossChainLeverageStarted(uint256 indexed id);\\n\\n /// @notice Emitted when a cross-chain flash repay request is finalized\\n event CrossChainFlashRepayFinished(uint256 indexed id);\\n\\n /// @notice Emitted when a cross-chain flash repay request is created\\n event CrossChainFlashRepayStarted(uint256 indexed id);\\n\\n /// @notice Emitted when debt is flash repaid\\n event FlashRepaid(\\n ISyntheticToken indexed syntheticToken,\\n IDepositToken indexed depositToken,\\n uint256 withdrawn,\\n uint256 repaid\\n );\\n\\n /// @notice Emitted when deposit is leveraged\\n event Leveraged(\\n IERC20 indexed tokenIn,\\n IDepositToken indexed depositToken,\\n ISyntheticToken indexed syntheticToken,\\n uint256 leverage,\\n uint256 amountIn,\\n uint256 issued,\\n uint256 deposited\\n );\\n\\n /**\\n * @dev Throws if sender isn't a valid ProxyOFT contract\\n */\\n modifier onlyIfCrossChainDispatcher() {\\n if (msg.sender != address(crossChainDispatcher())) revert SenderIsNotCrossChainDispatcher();\\n _;\\n }\\n\\n /**\\n * @dev Throws if deposit token doesn't exist\\n */\\n modifier onlyIfDepositTokenExists(IDepositToken depositToken_) {\\n if (!pool.doesDepositTokenExist(depositToken_)) revert DepositTokenDoesNotExist();\\n _;\\n }\\n\\n /**\\n * @dev Throws if synthetic token doesn't exist\\n */\\n modifier onlyIfSyntheticTokenExists(ISyntheticToken syntheticToken_) {\\n if (!pool.doesSyntheticTokenExist(syntheticToken_)) revert SyntheticDoesNotExist();\\n _;\\n }\\n\\n constructor() {\\n _disableInitializers();\\n }\\n\\n function initialize(IPool pool_) public initializer {\\n if (address(pool_) == address(0)) revert PoolIsNull();\\n __ReentrancyGuard_init();\\n __Manageable_init(pool_);\\n }\\n\\n /**\\n * @notice Get the Cross-chain dispatcher contract\\n */\\n function crossChainDispatcher() public view returns (ICrossChainDispatcher _crossChainDispatcher) {\\n return pool.poolRegistry().crossChainDispatcher();\\n }\\n\\n /***\\n * @notice Cross-chain flash debt repayment\\n * @dev Not calling `whenNotShutdown` here because nested function already does it\\n * @param syntheticToken_ The debt token to repay\\n * @param depositToken_ The collateral to withdraw\\n * @param withdrawAmount_ The amount to withdraw\\n * @param bridgeToken_ The asset that will be bridged out and used to swap for msAsset\\n * @param bridgeTokenAmountMin_ The minimum amount out when converting collateral for bridgeToken if they aren't the same (slippage check)\\n * @param swapAmountOutMin_ The minimum amount out from the bridgeToken->msAsset swap (slippage check)\\n * @param repayAmountMin_ The minimum amount to repay (slippage check)\\n * @param lzArgs_ The LayerZero params (See: `Quoter.getFlashRepaySwapAndCallbackLzArgs()`)\\n */\\n function crossChainFlashRepay(\\n ISyntheticToken syntheticToken_,\\n IDepositToken depositToken_,\\n uint256 withdrawAmount_,\\n IERC20 bridgeToken_,\\n uint256 bridgeTokenAmountMin_,\\n uint256 swapAmountOutMin_,\\n uint256 repayAmountMin_,\\n bytes calldata lzArgs_\\n )\\n external\\n payable\\n override\\n nonReentrant\\n onlyIfDepositTokenExists(depositToken_)\\n onlyIfSyntheticTokenExists(syntheticToken_)\\n {\\n if (withdrawAmount_ == 0) revert AmountIsZero();\\n if (!IPoolRegistryV3(address(pool.poolRegistry())).isCrossChainFlashRepayActive())\\n revert CrossChainFlashRepayInactive();\\n\\n ICrossChainDispatcher _crossChainDispatcher;\\n {\\n IDebtToken _debtToken = pool.debtTokenOf(syntheticToken_);\\n _debtToken.accrueInterest();\\n if (repayAmountMin_ > _debtToken.balanceOf(msg.sender)) revert AmountIsTooHigh();\\n\\n _crossChainDispatcher = crossChainDispatcher();\\n }\\n\\n uint256 _amountIn;\\n {\\n // 1. withdraw collateral\\n // Note: No need to check healthy because this function ensures withdrawing only from unlocked balance\\n (_amountIn, ) = depositToken_.withdrawFrom(msg.sender, withdrawAmount_);\\n\\n // 2. swap collateral for bridge token\\n _amountIn = _swap({\\n swapper_: swapper(),\\n tokenIn_: _collateralOf(depositToken_),\\n tokenOut_: bridgeToken_,\\n amountIn_: _amountIn,\\n amountOutMin_: bridgeTokenAmountMin_,\\n to_: address(_crossChainDispatcher)\\n });\\n }\\n\\n // 3. store request and trigger swap\\n _triggerFlashRepaySwap({\\n crossChainDispatcher_: _crossChainDispatcher,\\n swapTokenIn_: bridgeToken_,\\n swapTokenOut_: syntheticToken_,\\n swapAmountIn_: _amountIn,\\n swapAmountOutMin_: swapAmountOutMin_,\\n repayAmountMin_: repayAmountMin_,\\n lzArgs_: lzArgs_\\n });\\n }\\n\\n /**\\n * @dev Stores flash repay cross-chain request and triggers swap on the destination chain\\n */\\n function _triggerFlashRepaySwap(\\n ICrossChainDispatcher crossChainDispatcher_,\\n IERC20 swapTokenIn_,\\n ISyntheticToken swapTokenOut_,\\n uint256 swapAmountIn_,\\n uint256 swapAmountOutMin_,\\n uint256 repayAmountMin_,\\n bytes calldata lzArgs_\\n ) private {\\n uint256 _id = _nextCrossChainRequestId();\\n\\n (uint16 _dstChainId, , ) = CrossChainLib.decodeLzArgs(lzArgs_);\\n\\n crossChainFlashRepays[_id] = CrossChainFlashRepay({\\n dstChainId: _dstChainId,\\n syntheticToken: swapTokenOut_,\\n repayAmountMin: repayAmountMin_,\\n account: msg.sender,\\n finished: false\\n });\\n\\n crossChainDispatcher_.triggerFlashRepaySwap{value: msg.value}({\\n id_: _id,\\n account_: payable(msg.sender),\\n tokenIn_: address(swapTokenIn_),\\n tokenOut_: address(swapTokenOut_),\\n amountIn_: swapAmountIn_,\\n amountOutMin_: swapAmountOutMin_,\\n lzArgs_: lzArgs_\\n });\\n\\n emit CrossChainFlashRepayStarted(_id);\\n }\\n\\n /**\\n * @notice Finalize cross-chain flash debt repayment process\\n * @dev Receives msAsset from L1 and use it to repay\\n * @param id_ The id of the request\\n * @param swapAmountOut_ The msAsset amount received from L1 swap\\n * @return _repaid The debt amount repaid\\n */\\n function crossChainFlashRepayCallback(\\n uint256 id_,\\n uint256 swapAmountOut_\\n ) external override whenNotShutdown nonReentrant onlyIfCrossChainDispatcher returns (uint256 _repaid) {\\n CrossChainFlashRepay memory _request = crossChainFlashRepays[id_];\\n\\n if (_request.account == address(0)) revert CrossChainRequestInvalidKey();\\n if (_request.finished) revert CrossChainRequestCompletedAlready();\\n\\n // 1. update state\\n crossChainFlashRepays[id_].finished = true;\\n\\n // 2. transfer synthetic token\\n swapAmountOut_ = _safeTransferFrom(_request.syntheticToken, msg.sender, swapAmountOut_);\\n\\n // 3. repay debt\\n IDebtToken _debtToken = pool.debtTokenOf(_request.syntheticToken);\\n (uint256 _maxRepayAmount, ) = _debtToken.quoteRepayIn(_debtToken.balanceOf(_request.account));\\n uint256 _repayAmount = Math.min(swapAmountOut_, _maxRepayAmount);\\n if (_repayAmount > 0) (_repaid, ) = _debtToken.repay(_request.account, _repayAmount);\\n if (_repaid < _request.repayAmountMin) revert FlashRepaySlippageTooHigh();\\n\\n // 4. refund synthetic token in excess\\n if (swapAmountOut_ > _repayAmount) {\\n _request.syntheticToken.safeTransfer(_request.account, swapAmountOut_ - _repayAmount);\\n }\\n\\n emit CrossChainFlashRepayFinished(id_);\\n }\\n\\n /**\\n * @dev Keep this function to avoid changing interface\\n * Refs: https://github.com/autonomoussoftware/metronome-synth/issues/877\\n */\\n function crossChainLeverage(\\n IERC20,\\n IDepositToken,\\n ISyntheticToken,\\n uint256,\\n uint256,\\n uint256,\\n uint256,\\n bytes calldata\\n ) external payable override {\\n revert(\\\"deprecated\\\");\\n }\\n\\n /***\\n * @notice Cross-chain Leverage\\n * @dev Not calling `whenNotShutdown` here because nested function already does it\\n * @param tokenIn_ The token to transfer\\n * @param syntheticToken_ The msAsset to mint\\n * @param bridgeToken_ The asset that will be used to swap from msAsset and bridged back\\n * @param depositToken_ The collateral to deposit\\n * @param amountIn_ The amount to deposit\\n * @param leverage_ The leverage X param (e.g. 1.5e18 for 1.5X)\\n * @param swapAmountOutMin_ The minimum amount out from msAsset->bridgeToken swap (slippage check)\\n * @param depositAmountMin_ The minimum final amount to deposit (slippage check)\\n * @param lzArgs_ The LayerZero params (See: `Quoter.getLeverageSwapAndCallbackLzArgs()`)\\n */\\n function crossChainLeverage(\\n IERC20 tokenIn_,\\n ISyntheticToken syntheticToken_,\\n IERC20 bridgeToken_,\\n IDepositToken depositToken_,\\n uint256 amountIn_,\\n uint256 leverage_,\\n uint256 swapAmountOutMin_,\\n uint256 depositAmountMin_,\\n bytes calldata lzArgs_\\n )\\n external\\n payable\\n // Note: Not adding this function to the `ISmartFarmingInterface` to avoid changing interface\\n // Refs: https://github.com/autonomoussoftware/metronome-synth/issues/877\\n // override\\n nonReentrant\\n onlyIfDepositTokenExists(depositToken_)\\n onlyIfSyntheticTokenExists(syntheticToken_)\\n {\\n IERC20 _tokenIn = tokenIn_; // stack too deep\\n\\n if (amountIn_ == 0) revert AmountIsZero();\\n if (leverage_ <= 1e18) revert LeverageTooLow();\\n if (leverage_ > uint256(1e18).wadDiv(1e18 - depositToken_.collateralFactor())) revert LeverageTooHigh();\\n if (address(_tokenIn) == address(0)) revert TokenInIsNull();\\n if (address(bridgeToken_) == address(0)) revert BridgeTokenIsNull();\\n\\n uint256 _debtAmount;\\n uint256 _issued;\\n {\\n // 1. transfer tokenIn\\n amountIn_ = _safeTransferFrom(_tokenIn, msg.sender, amountIn_);\\n\\n // 2. mint synth\\n _debtAmount = _calculateLeverageDebtAmount(_tokenIn, syntheticToken_, amountIn_, leverage_);\\n (_issued, ) = pool.debtTokenOf(syntheticToken_).flashIssue(address(crossChainDispatcher()), _debtAmount);\\n }\\n\\n bytes memory _swapArgs = abi.encode(syntheticToken_, bridgeToken_, _issued, swapAmountOutMin_); // stack too deep\\n IDepositToken _depositToken = depositToken_; // stack too deep\\n\\n // 3. store request and trigger swap\\n _triggerCrossChainLeverageSwap({\\n tokenIn_: _tokenIn,\\n amountIn_: amountIn_,\\n debtAmount_: _debtAmount,\\n swapArgs_: _swapArgs,\\n depositToken_: _depositToken,\\n depositAmountMin_: depositAmountMin_,\\n lzArgs_: lzArgs_\\n });\\n }\\n\\n /**\\n * @dev Stores leverage cross-chain request and triggers swap on the destination chain\\n */\\n function _triggerCrossChainLeverageSwap(\\n IERC20 tokenIn_,\\n uint256 amountIn_,\\n uint256 debtAmount_,\\n bytes memory swapArgs_,\\n IDepositToken depositToken_,\\n uint256 depositAmountMin_,\\n bytes calldata lzArgs_\\n ) private {\\n uint256 _id = _nextCrossChainRequestId();\\n\\n (ISyntheticToken _swapTokenIn, IERC20 _swapTokenOut, uint256 _swapAmountIn, uint256 _swapAmountOutMin) = abi\\n .decode(swapArgs_, (ISyntheticToken, IERC20, uint256, uint256));\\n\\n {\\n (uint16 _dstChainId, , ) = CrossChainLib.decodeLzArgs(lzArgs_);\\n\\n crossChainLeverages[_id] = CrossChainLeverage({\\n dstChainId: _dstChainId,\\n tokenIn: tokenIn_,\\n syntheticToken: _swapTokenIn,\\n bridgeToken: _swapTokenOut,\\n depositToken: depositToken_,\\n amountIn: amountIn_,\\n debtAmount: debtAmount_,\\n depositAmountMin: depositAmountMin_,\\n account: msg.sender,\\n finished: false\\n });\\n }\\n\\n crossChainDispatcher().triggerLeverageSwap{value: msg.value}({\\n id_: _id,\\n account_: payable(msg.sender),\\n tokenIn_: address(_swapTokenIn),\\n tokenOut_: address(_swapTokenOut),\\n amountIn_: _swapAmountIn,\\n amountOutMin: _swapAmountOutMin,\\n lzArgs_: lzArgs_\\n });\\n\\n emit CrossChainLeverageStarted(_id);\\n }\\n\\n /**\\n * @notice Finalize cross-chain leverage process\\n * @dev Receives bridged token (aka naked token) use it to deposit\\n * @param id_ The id of the request\\n * @param swapAmountOut_ The amount received from swap\\n * @return _deposited The amount deposited\\n */\\n function crossChainLeverageCallback(\\n uint256 id_,\\n uint256 swapAmountOut_\\n ) external override whenNotShutdown nonReentrant onlyIfCrossChainDispatcher returns (uint256 _deposited) {\\n CrossChainLeverage memory _request = crossChainLeverages[id_];\\n\\n if (_request.account == address(0)) revert CrossChainRequestInvalidKey();\\n if (_request.finished) revert CrossChainRequestCompletedAlready();\\n IERC20 _collateral = _collateralOf(_request.depositToken);\\n\\n // 1. update state\\n crossChainLeverages[id_].finished = true;\\n\\n // 2. transfer swap's tokenOut (aka bridged token)\\n swapAmountOut_ = _safeTransferFrom(_request.bridgeToken, msg.sender, swapAmountOut_);\\n\\n // 3. swap received tokens for collateral if needed\\n // Note: The internal `_swap()` doesn't swap if `tokenIn` and `tokenOut` are the same\\n uint256 _depositAmount;\\n if (_request.tokenIn == _request.bridgeToken) {\\n _depositAmount = _swap(swapper(), _request.tokenIn, _collateral, _request.amountIn + swapAmountOut_, 0);\\n } else {\\n _depositAmount = _swap(swapper(), _request.tokenIn, _collateral, _request.amountIn, 0);\\n _depositAmount += _swap(swapper(), _request.bridgeToken, _collateral, swapAmountOut_, 0);\\n }\\n\\n if (_depositAmount < _request.depositAmountMin) revert LeverageSlippageTooHigh();\\n\\n // 4. deposit collateral\\n _collateral.safeApprove(address(_request.depositToken), 0);\\n _collateral.safeApprove(address(_request.depositToken), _depositAmount);\\n (_deposited, ) = _request.depositToken.deposit(_depositAmount, _request.account);\\n\\n // 5. mint debt\\n IPool _pool = pool;\\n _pool.debtTokenOf(_request.syntheticToken).mint(_request.account, _request.debtAmount);\\n\\n // 6. check the health of the outcome position\\n (bool _isHealthy, , , , ) = _pool.debtPositionOf(_request.account);\\n if (!_isHealthy) revert PositionIsNotHealthy();\\n\\n emit CrossChainLeverageFinished(id_);\\n }\\n\\n /**\\n * @notice Flash debt repayment\\n * @param syntheticToken_ The debt token to repay\\n * @param depositToken_ The collateral to withdraw\\n * @param withdrawAmount_ The amount to withdraw\\n * @param repayAmountMin_ The minimum amount to repay (slippage check)\\n */\\n function flashRepay(\\n ISyntheticToken syntheticToken_,\\n IDepositToken depositToken_,\\n uint256 withdrawAmount_,\\n uint256 repayAmountMin_\\n )\\n external\\n override\\n whenNotShutdown\\n nonReentrant\\n onlyIfDepositTokenExists(depositToken_)\\n onlyIfSyntheticTokenExists(syntheticToken_)\\n returns (uint256 _withdrawn, uint256 _repaid)\\n {\\n if (withdrawAmount_ == 0) revert AmountIsZero();\\n if (withdrawAmount_ > depositToken_.balanceOf(msg.sender)) revert AmountIsTooHigh();\\n IPool _pool = pool;\\n IDebtToken _debtToken = _pool.debtTokenOf(syntheticToken_);\\n if (repayAmountMin_ > _debtToken.balanceOf(msg.sender)) revert AmountIsTooHigh();\\n\\n // 1. withdraw collateral\\n (_withdrawn, ) = depositToken_.flashWithdraw(msg.sender, withdrawAmount_);\\n\\n // 2. swap it for synth\\n uint256 _amountToRepay = _swap(swapper(), _collateralOf(depositToken_), syntheticToken_, _withdrawn, 0);\\n\\n // 3. repay debt\\n (_repaid, ) = _debtToken.repay(msg.sender, _amountToRepay);\\n if (_repaid < repayAmountMin_) revert FlashRepaySlippageTooHigh();\\n\\n // 4. check the health of the outcome position\\n (bool _isHealthy, , , , ) = _pool.debtPositionOf(msg.sender);\\n if (!_isHealthy) revert PositionIsNotHealthy();\\n\\n emit FlashRepaid(syntheticToken_, depositToken_, _withdrawn, _repaid);\\n }\\n\\n /**\\n * @notice Leverage yield position\\n * @param tokenIn_ The token to transfer\\n * @param depositToken_ The collateral to deposit\\n * @param syntheticToken_ The msAsset to mint\\n * @param amountIn_ The amount to deposit\\n * @param leverage_ The leverage X param (e.g. 1.5e18 for 1.5X)\\n * @param depositAmountMin_ The min final deposit amount (slippage)\\n */\\n function leverage(\\n IERC20 tokenIn_,\\n IDepositToken depositToken_,\\n ISyntheticToken syntheticToken_,\\n uint256 amountIn_,\\n uint256 leverage_,\\n uint256 depositAmountMin_\\n )\\n external\\n override\\n whenNotShutdown\\n nonReentrant\\n onlyIfDepositTokenExists(depositToken_)\\n onlyIfSyntheticTokenExists(syntheticToken_)\\n returns (uint256 _deposited, uint256 _issued)\\n {\\n if (amountIn_ == 0) revert AmountIsZero();\\n if (leverage_ <= 1e18) revert LeverageTooLow();\\n if (leverage_ > uint256(1e18).wadDiv(1e18 - depositToken_.collateralFactor())) revert LeverageTooHigh();\\n\\n ISwapper _swapper = swapper();\\n\\n // 1. transfer collateral\\n IERC20 _collateral = _collateralOf(depositToken_);\\n if (address(tokenIn_) == address(0)) tokenIn_ = _collateral;\\n amountIn_ = _safeTransferFrom(tokenIn_, msg.sender, amountIn_);\\n if (tokenIn_ != _collateral) {\\n // Note: `amountOutMin_` is `0` because slippage will be checked later on\\n amountIn_ = _swap(_swapper, tokenIn_, _collateral, amountIn_, 0);\\n }\\n\\n {\\n // 2. mint synth + debt\\n uint256 _debtAmount = _calculateLeverageDebtAmount(_collateral, syntheticToken_, amountIn_, leverage_);\\n IDebtToken _debtToken = pool.debtTokenOf(syntheticToken_);\\n (_issued, ) = _debtToken.flashIssue(address(this), _debtAmount);\\n _debtToken.mint(msg.sender, _debtAmount);\\n }\\n\\n // 3. swap synth for collateral\\n uint256 _depositAmount = amountIn_ + _swap(_swapper, syntheticToken_, _collateral, _issued, 0);\\n if (_depositAmount < depositAmountMin_) revert LeverageSlippageTooHigh();\\n\\n // 4. deposit collateral\\n _collateral.safeApprove(address(depositToken_), 0);\\n _collateral.safeApprove(address(depositToken_), _depositAmount);\\n (_deposited, ) = depositToken_.deposit(_depositAmount, msg.sender);\\n\\n // 5. check the health of the outcome position\\n (bool _isHealthy, , , , ) = pool.debtPositionOf(msg.sender);\\n if (!_isHealthy) revert PositionIsNotHealthy();\\n\\n emit Leveraged(tokenIn_, depositToken_, syntheticToken_, leverage_, amountIn_, _issued, _deposited);\\n }\\n\\n /**\\n * @notice Retry cross-chain flash repay callback\\n * @dev This function is used to recover from callback failures due to slippage\\n * @param srcChainId_ The source chain of failed tx\\n * @param srcAddress_ The source path of failed tx\\n * @param nonce_ The nonce of failed tx\\n * @param amount_ The amount of failed tx\\n * @param payload_ The payload of failed tx\\n * @param newRepayAmountMin_ If repayment failed due to slippage, caller may send lower newRepayAmountMin_\\n */\\n function retryCrossChainFlashRepayCallback(\\n uint16 srcChainId_,\\n bytes calldata srcAddress_,\\n uint64 nonce_,\\n uint256 amount_,\\n bytes calldata payload_,\\n uint256 newRepayAmountMin_\\n ) external {\\n (, , uint256 _requestId) = CrossChainLib.decodeFlashRepayCallbackPayload(payload_);\\n\\n CrossChainFlashRepay memory _request = crossChainFlashRepays[_requestId];\\n\\n if (_request.account == address(0)) revert CrossChainRequestInvalidKey();\\n if (_request.finished) revert CrossChainRequestCompletedAlready();\\n\\n // Note: Only user can change slippage param\\n if (msg.sender == _request.account) {\\n crossChainFlashRepays[_requestId].repayAmountMin = newRepayAmountMin_;\\n }\\n\\n ICrossChainDispatcher _crossChainDispatcher = crossChainDispatcher();\\n bytes memory _from = abi.encodePacked(_crossChainDispatcher.crossChainDispatcherOf(srcChainId_));\\n\\n _request.syntheticToken.proxyOFT().retryOFTReceived({\\n _srcChainId: srcChainId_,\\n _srcAddress: srcAddress_,\\n _nonce: nonce_,\\n _from: _from,\\n _to: address(_crossChainDispatcher),\\n _amount: amount_,\\n _payload: payload_\\n });\\n }\\n\\n /**\\n * @notice Retry cross-chain leverage callback\\n * @dev This function is used to recover from callback failures due to slippage\\n * @param srcChainId_ The source chain of failed tx\\n * @param srcAddress_ The source path of failed tx\\n * @param nonce_ The nonce of failed tx\\n * @param token_ The token of failed tx\\n * @param amount_ The amountIn of failed tx\\n * @param payload_ The payload of failed tx\\n * @param newDepositAmountMin_ If deposit failed due to slippage, caller may send lower newDepositAmountMin_\\n */\\n function retryCrossChainLeverageCallback(\\n uint16 srcChainId_,\\n bytes calldata srcAddress_,\\n uint64 nonce_,\\n address token_,\\n uint256 amount_,\\n bytes calldata payload_,\\n uint256 newDepositAmountMin_\\n ) external {\\n (, uint256 _requestId) = CrossChainLib.decodeLeverageCallbackPayload(payload_);\\n\\n CrossChainLeverage memory _request = crossChainLeverages[_requestId];\\n\\n if (_request.account == address(0)) revert CrossChainRequestInvalidKey();\\n if (_request.finished) revert CrossChainRequestCompletedAlready();\\n\\n // Note: Only user can change slippage param\\n if (msg.sender == _request.account) {\\n crossChainLeverages[_requestId].depositAmountMin = newDepositAmountMin_;\\n }\\n\\n ICrossChainDispatcher _crossChainDispatcher = crossChainDispatcher();\\n\\n address _from = _crossChainDispatcher.crossChainDispatcherOf(srcChainId_);\\n bytes memory _sgReceiveCallData = abi.encodeWithSelector(\\n IStargateReceiver.sgReceive.selector,\\n srcChainId_,\\n abi.encodePacked(_from),\\n nonce_,\\n token_,\\n amount_,\\n payload_\\n );\\n\\n IStargateComposerWithRetry(address(_crossChainDispatcher.stargateComposer())).clearCachedSwap(\\n srcChainId_,\\n srcAddress_,\\n nonce_,\\n address(_crossChainDispatcher),\\n _sgReceiveCallData\\n );\\n }\\n\\n /**\\n * @notice Get the swapper contract\\n */\\n function swapper() public view returns (ISwapper _swapper) {\\n return pool.poolRegistry().swapper();\\n }\\n\\n /**\\n * @notice Calculate debt to issue for a leverage operation\\n * @param collateral_ The collateral to deposit\\n * @param syntheticToken_ The msAsset to mint\\n * @param amountIn_ The amount to deposit\\n * @param leverage_ The leverage X param (e.g. 1.5e18 for 1.5X)\\n * @return _debtAmount The debt issue\\n */\\n function _calculateLeverageDebtAmount(\\n IERC20 collateral_,\\n ISyntheticToken syntheticToken_,\\n uint256 amountIn_,\\n uint256 leverage_\\n ) private view returns (uint256 _debtAmount) {\\n return\\n pool.masterOracle().quote(\\n address(collateral_),\\n address(syntheticToken_),\\n (leverage_ - 1e18).wadMul(amountIn_)\\n );\\n }\\n\\n /**\\n * @dev `collateral` is a better name than `underlying`\\n * See more: https://github.com/autonomoussoftware/metronome-synth/issues/905\\n */\\n function _collateralOf(IDepositToken depositToken_) private view returns (IERC20) {\\n return depositToken_.underlying();\\n }\\n\\n /**\\n * @dev Generates cross-chain request id by hashing `chainId`+`requestId` in order to avoid\\n * having same id across supported chains\\n * Note: The cross-chain code mostly uses LZ chain ids but in this case, we're using native id.\\n */\\n function _nextCrossChainRequestId() private returns (uint256 _id) {\\n return uint256(keccak256(abi.encode(block.chainid, address(this), ++crossChainRequestsLength)));\\n }\\n\\n /**\\n * @notice Transfer token and check actual amount transferred\\n * @param token_ The token to transfer\\n * @param from_ The account to get tokens from\\n * @param amount_ The amount to transfer\\n * @return _transferred The actual transferred amount\\n */\\n function _safeTransferFrom(IERC20 token_, address from_, uint256 amount_) private returns (uint256 _transferred) {\\n uint256 _before = token_.balanceOf(address(this));\\n token_.safeTransferFrom(from_, address(this), amount_);\\n return token_.balanceOf(address(this)) - _before;\\n }\\n\\n /**\\n * @notice Swap assets using Swapper contract\\n * @dev Use `address(this)` as amount out receiver\\n * @param swapper_ The Swapper contract\\n * @param tokenIn_ The token to swap from\\n * @param tokenOut_ The token to swap to\\n * @param amountIn_ The amount in\\n * @param amountOutMin_ The minimum amount out (slippage check)\\n * @return _amountOut The actual amount out\\n */\\n function _swap(\\n ISwapper swapper_,\\n IERC20 tokenIn_,\\n IERC20 tokenOut_,\\n uint256 amountIn_,\\n uint256 amountOutMin_\\n ) private returns (uint256 _amountOut) {\\n return _swap(swapper_, tokenIn_, tokenOut_, amountIn_, amountOutMin_, address(this));\\n }\\n\\n /**\\n * @notice Swap assets using Swapper contract\\n * @param swapper_ The Swapper contract\\n * @param tokenIn_ The token to swap from\\n * @param tokenOut_ The token to swap to\\n * @param amountIn_ The amount in\\n * @param amountOutMin_ The minimum amount out (slippage check)\\n * @param to_ The amount out receiver\\n * @return _amountOut The actual amount out\\n */\\n function _swap(\\n ISwapper swapper_,\\n IERC20 tokenIn_,\\n IERC20 tokenOut_,\\n uint256 amountIn_,\\n uint256 amountOutMin_,\\n address to_\\n ) private returns (uint256 _amountOut) {\\n if (tokenIn_ != tokenOut_) {\\n tokenIn_.safeApprove(address(swapper_), 0);\\n tokenIn_.safeApprove(address(swapper_), amountIn_);\\n uint256 _tokenOutBefore = tokenOut_.balanceOf(to_);\\n swapper_.swapExactInput(address(tokenIn_), address(tokenOut_), amountIn_, amountOutMin_, to_);\\n return tokenOut_.balanceOf(to_) - _tokenOutBefore;\\n } else if (to_ != address(this)) {\\n tokenIn_.safeTransfer(to_, amountIn_);\\n }\\n return amountIn_;\\n }\\n}\\n\",\"keccak256\":\"0x19d204b4f17813a080889d777db746ddcd7798a53c35d1c9a5664a2bccf138c9\",\"license\":\"MIT\"},\"contracts/access/Manageable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/openzeppelin-upgradeable/proxy/utils/Initializable.sol\\\";\\nimport \\\"../interfaces/IGovernable.sol\\\";\\nimport \\\"../interfaces/IManageable.sol\\\";\\n\\nerror SenderIsNotPool();\\nerror SenderIsNotGovernor();\\nerror IsPaused();\\nerror IsShutdown();\\nerror PoolAddressIsNull();\\n\\n/**\\n * @title Reusable contract that handles accesses\\n */\\nabstract contract Manageable is IManageable, Initializable {\\n /**\\n * @notice Pool contract\\n */\\n IPool public pool;\\n\\n /**\\n * @dev Throws if `msg.sender` isn't the pool\\n */\\n modifier onlyPool() {\\n if (msg.sender != address(pool)) revert SenderIsNotPool();\\n _;\\n }\\n\\n /**\\n * @dev Throws if `msg.sender` isn't the governor\\n */\\n modifier onlyGovernor() {\\n if (msg.sender != governor()) revert SenderIsNotGovernor();\\n _;\\n }\\n\\n /**\\n * @dev Throws if contract is paused\\n */\\n modifier whenNotPaused() {\\n if (pool.paused()) revert IsPaused();\\n _;\\n }\\n\\n /**\\n * @dev Throws if contract is shutdown\\n */\\n modifier whenNotShutdown() {\\n if (pool.everythingStopped()) revert IsShutdown();\\n _;\\n }\\n\\n // solhint-disable-next-line func-name-mixedcase\\n function __Manageable_init(IPool pool_) internal onlyInitializing {\\n if (address(pool_) == address(0)) revert PoolAddressIsNull();\\n pool = pool_;\\n }\\n\\n /**\\n * @notice Get the governor\\n * @return _governor The governor\\n */\\n function governor() public view returns (address _governor) {\\n _governor = IGovernable(address(pool)).governor();\\n }\\n\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x95964544ea9b3a0799e14959d5cd1d33dbf8fd9463260d3bc33358c3945812b9\",\"license\":\"MIT\"},\"contracts/dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/IOFTCoreUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../../../../openzeppelin-upgradeable/utils/introspection/IERC165Upgradeable.sol\\\";\\n\\n/**\\n * @dev Interface of the IOFT core standard\\n */\\ninterface IOFTCoreUpgradeable is IERC165Upgradeable {\\n /**\\n * @dev estimate send token `_tokenId` to (`_dstChainId`, `_toAddress`)\\n * _dstChainId - L0 defined chain id to send tokens too\\n * _toAddress - dynamic bytes array which contains the address to whom you are sending tokens to on the dstChain\\n * _amount - amount of the tokens to transfer\\n * _useZro - indicates to use zro to pay L0 fees\\n * _adapterParam - flexible bytes array to indicate messaging adapter services in L0\\n */\\n function estimateSendFee(\\n uint16 _dstChainId,\\n bytes calldata _toAddress,\\n uint _amount,\\n bool _useZro,\\n bytes calldata _adapterParams\\n ) external view returns (uint nativeFee, uint zroFee);\\n\\n /**\\n * @dev send `_amount` amount of token to (`_dstChainId`, `_toAddress`) from `_from`\\n * `_from` the owner of token\\n * `_dstChainId` the destination chain identifier\\n * `_toAddress` can be any size depending on the `dstChainId`.\\n * `_amount` the quantity of tokens in wei\\n * `_refundAddress` the address LayerZero refunds if too much message fee is sent\\n * `_zroPaymentAddress` set to address(0x0) if not paying in ZRO (LayerZero Token)\\n * `_adapterParams` is a flexible bytes array to indicate messaging adapter services\\n */\\n function sendFrom(\\n address _from,\\n uint16 _dstChainId,\\n bytes calldata _toAddress,\\n uint _amount,\\n address payable _refundAddress,\\n address _zroPaymentAddress,\\n bytes calldata _adapterParams\\n ) external payable;\\n\\n /**\\n * @dev returns the circulating amount of tokens on current chain\\n */\\n function circulatingSupply() external view returns (uint);\\n\\n /**\\n * @dev returns the address of the ERC20 token\\n */\\n function token() external view returns (address);\\n\\n /**\\n * @dev Emitted when `_amount` tokens are moved from the `_sender` to (`_dstChainId`, `_toAddress`)\\n * `_nonce` is the outbound nonce\\n */\\n event SendToChain(uint16 indexed _dstChainId, address indexed _from, bytes _toAddress, uint _amount);\\n\\n /**\\n * @dev Emitted when `_amount` tokens are received from `_srcChainId` into the `_toAddress` on the local chain.\\n * `_nonce` is the inbound nonce.\\n */\\n event ReceiveFromChain(uint16 indexed _srcChainId, address indexed _to, uint _amount);\\n\\n event SetUseCustomAdapterParams(bool _useCustomAdapterParams);\\n}\\n\",\"keccak256\":\"0x22651924296f8308db8195d7a86a6781023241c53905418f2d3925e3f693f530\",\"license\":\"MIT\"},\"contracts/dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/composable/IComposableOFTCoreUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.5.0;\\n\\nimport \\\"../IOFTCoreUpgradeable.sol\\\";\\n\\n/**\\n * @dev Interface of the composable OFT core standard\\n */\\ninterface IComposableOFTCoreUpgradeable is IOFTCoreUpgradeable {\\n function estimateSendAndCallFee(\\n uint16 _dstChainId,\\n bytes calldata _toAddress,\\n uint _amount,\\n bytes calldata _payload,\\n uint64 _dstGasForCall,\\n bool _useZro,\\n bytes calldata _adapterParams\\n ) external view returns (uint nativeFee, uint zroFee);\\n\\n function sendAndCall(\\n address _from,\\n uint16 _dstChainId,\\n bytes calldata _toAddress,\\n uint _amount,\\n bytes calldata _payload,\\n uint64 _dstGasForCall,\\n address payable _refundAddress,\\n address _zroPaymentAddress,\\n bytes calldata _adapterParams\\n ) external payable;\\n\\n function retryOFTReceived(\\n uint16 _srcChainId,\\n bytes calldata _srcAddress,\\n uint64 _nonce,\\n bytes calldata _from,\\n address _to,\\n uint _amount,\\n bytes calldata _payload\\n ) external;\\n\\n event CallOFTReceivedFailure(\\n uint16 indexed _srcChainId,\\n bytes _srcAddress,\\n uint64 _nonce,\\n bytes _from,\\n address indexed _to,\\n uint _amount,\\n bytes _payload,\\n bytes _reason\\n );\\n\\n event CallOFTReceivedSuccess(uint16 indexed _srcChainId, bytes _srcAddress, uint64 _nonce, bytes32 _hash);\\n\\n event RetryOFTReceivedSuccess(bytes32 _messageHash);\\n\\n event NonContractAddress(address _address);\\n}\\n\",\"keccak256\":\"0x769b9356ad6019bdabdcfc11762f28d15eb9a4e262efc96835725f6862c5d9e9\",\"license\":\"MIT\"},\"contracts/dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/composable/IOFTReceiverUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.5.0;\\n\\ninterface IOFTReceiverUpgradeable {\\n /**\\n * @dev Called by the OFT contract when tokens are received from source chain.\\n * @param _srcChainId The chain id of the source chain.\\n * @param _srcAddress The address of the OFT token contract on the source chain.\\n * @param _nonce The nonce of the transaction on the source chain.\\n * @param _from The address of the account who calls the sendAndCall() on the source chain.\\n * @param _amount The amount of tokens to transfer.\\n * @param _payload Additional data with no specified format.\\n */\\n function onOFTReceived(\\n uint16 _srcChainId,\\n bytes calldata _srcAddress,\\n uint64 _nonce,\\n bytes calldata _from,\\n uint _amount,\\n bytes calldata _payload\\n ) external;\\n}\\n\",\"keccak256\":\"0x287036c704c57e34a6fc3f7e67c8dfaaade6eb3667b570576bc491c0f1f89a5b\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.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 * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\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. Equivalent to `reinitializer(1)`.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = _setInitializedVersion(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 * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original\\n * initialization step. This is essential to configure modules that are added through upgrades and that require\\n * initialization.\\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 modifier reinitializer(uint8 version) {\\n bool isTopLevelCall = _setInitializedVersion(version);\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(version);\\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} 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 function _disableInitializers() internal virtual {\\n _setInitializedVersion(type(uint8).max);\\n }\\n\\n function _setInitializedVersion(uint8 version) private returns (bool) {\\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, and for the lowest level\\n // of initializers, because in other contexts the contract may have been reentered.\\n if (_initializing) {\\n require(\\n version == 1 && !AddressUpgradeable.isContract(address(this)),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n return false;\\n } else {\\n require(_initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n return true;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x7454006cccb737612b00104d2f606d728e2818b778e7e55542f063c614ce46ba\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin-upgradeable/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.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 *\\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 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\":\"0x55cf2bd9fc76704ddcdc19834cd288b7de00fc0f298a40ea16a954ae8991db2d\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin-upgradeable/utils/introspection/IERC165Upgradeable.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 IERC165Upgradeable {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0xc6cef87559d0aeffdf0a99803de655938a7779ec0a3cd5d4383483ad85565a09\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\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 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 `recipient`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address recipient, 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 `sender` to `recipient` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address sender,\\n address recipient,\\n uint256 amount\\n ) external returns (bool);\\n\\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\",\"keccak256\":\"0x027b891937d20ccf213fdb9c31531574256de774bda99d3a70ecef6e1913ed2a\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\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\":\"0x83fe24f5c04a56091e50f4a345ff504c8bff658a76d4c43b16878c8f940c53b2\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin/token/ERC20/utils/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\nimport \\\"../../../utils/Address.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n using Address for address;\\n\\n function safeTransfer(\\n IERC20 token,\\n address to,\\n uint256 value\\n ) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n function safeTransferFrom(\\n IERC20 token,\\n address from,\\n address to,\\n uint256 value\\n ) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\\n }\\n\\n /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\n */\\n function safeApprove(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n // safeApprove should only be called when setting an initial allowance,\\n // or when resetting it to zero. To increase and decrease it, use\\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\\n require(\\n (value == 0) || (token.allowance(address(this), spender) == 0),\\n \\\"SafeERC20: approve from non-zero to non-zero allowance\\\"\\n );\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\\n }\\n\\n function safeIncreaseAllowance(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n uint256 newAllowance = token.allowance(address(this), spender) + value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n unchecked {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n require(oldAllowance >= value, \\\"SafeERC20: decreased allowance below zero\\\");\\n uint256 newAllowance = oldAllowance - value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\n if (returndata.length > 0) {\\n // Return data is optional\\n require(abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0x02348b2e4b9f3200c7e3907c5c2661643a6d8520e9f79939fbb9b4005a54894d\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.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\":\"0x2ccf9d2313a313d41a791505f2b5abfdc62191b5d4334f7f7a82691c088a1c87\",\"license\":\"MIT\"},\"contracts/dependencies/openzeppelin/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.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 /**\\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 / b + (a % b == 0 ? 0 : 1);\\n }\\n}\\n\",\"keccak256\":\"0xc995bddbca1ae19788db9f8b61e63385edd3fddf89693b612d5abd1a275974d2\",\"license\":\"MIT\"},\"contracts/dependencies/stargate-protocol/interfaces/IStargateComposer.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./IStargateRouter.sol\\\";\\n\\ninterface IStargateComposer {\\n function swap(\\n uint16 _dstChainId,\\n uint256 _srcPoolId,\\n uint256 _dstPoolId,\\n address payable _refundAddress,\\n uint256 _amountLD,\\n uint256 _minAmountLD,\\n IStargateRouter.lzTxObj memory _lzTxParams,\\n bytes calldata _to,\\n bytes calldata _payload\\n ) external payable;\\n\\n function factory() external view returns (address);\\n\\n function stargateBridge() external view returns (address);\\n\\n function stargateRouter() external view returns (IStargateRouter);\\n\\n function quoteLayerZeroFee(\\n uint16 _dstChainId,\\n uint8 _functionType,\\n bytes calldata _toAddress,\\n bytes calldata _transferAndCallPayload,\\n IStargateRouter.lzTxObj memory _lzTxParams\\n ) external view returns (uint256, uint256);\\n\\n function peers(uint16 _chainId) external view returns (address);\\n}\\n\",\"keccak256\":\"0xdfdd1690bf176ac05803534a60227be90cc435b4bdd8fce2348f1a9417a9f63a\",\"license\":\"BUSL-1.1\"},\"contracts/dependencies/stargate-protocol/interfaces/IStargateReceiver.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\n\\npragma solidity 0.8.9;\\n\\ninterface IStargateReceiver {\\n function sgReceive(\\n uint16 _chainId,\\n bytes memory _srcAddress,\\n uint256 _nonce,\\n address _token,\\n uint256 amountLD,\\n bytes memory payload\\n ) external;\\n}\\n\",\"keccak256\":\"0xe4d6bf9fa422e5e43dc1b6880f951d06611a4ed12c2dd7dd8c0b6a5d9e06ad0d\",\"license\":\"BUSL-1.1\"},\"contracts/dependencies/stargate-protocol/interfaces/IStargateRouter.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\n\\npragma solidity 0.8.9;\\n\\ninterface IStargateRouter {\\n struct lzTxObj {\\n uint256 dstGasForCall;\\n uint256 dstNativeAmount;\\n bytes dstNativeAddr;\\n }\\n\\n function addLiquidity(uint256 _poolId, uint256 _amountLD, address _to) external;\\n\\n function swap(\\n uint16 _dstChainId,\\n uint256 _srcPoolId,\\n uint256 _dstPoolId,\\n address payable _refundAddress,\\n uint256 _amountLD,\\n uint256 _minAmountLD,\\n lzTxObj memory _lzTxParams,\\n bytes calldata _to,\\n bytes calldata _payload\\n ) external payable;\\n\\n function redeemRemote(\\n uint16 _dstChainId,\\n uint256 _srcPoolId,\\n uint256 _dstPoolId,\\n address payable _refundAddress,\\n uint256 _amountLP,\\n uint256 _minAmountLD,\\n bytes calldata _to,\\n lzTxObj memory _lzTxParams\\n ) external payable;\\n\\n function instantRedeemLocal(uint16 _srcPoolId, uint256 _amountLP, address _to) external returns (uint256);\\n\\n function redeemLocal(\\n uint16 _dstChainId,\\n uint256 _srcPoolId,\\n uint256 _dstPoolId,\\n address payable _refundAddress,\\n uint256 _amountLP,\\n bytes calldata _to,\\n lzTxObj memory _lzTxParams\\n ) external payable;\\n\\n function sendCredits(\\n uint16 _dstChainId,\\n uint256 _srcPoolId,\\n uint256 _dstPoolId,\\n address payable _refundAddress\\n ) external payable;\\n\\n function quoteLayerZeroFee(\\n uint16 _dstChainId,\\n uint8 _functionType,\\n bytes calldata _toAddress,\\n bytes calldata _transferAndCallPayload,\\n lzTxObj memory _lzTxParams\\n ) external view returns (uint256, uint256);\\n\\n function clearCachedSwap(uint16 _srcChainId, bytes calldata _srcAddress, uint256 _nonce) external;\\n\\n function factory() external view returns (address);\\n\\n function bridge() external view returns (address);\\n\\n function cachedSwapLookup(\\n uint16 _chainId_,\\n bytes calldata _srcAddress,\\n uint256 _nonce\\n ) external view returns (address token, uint256 amountLD, address to, bytes memory payload);\\n}\\n\",\"keccak256\":\"0x92126df8e682b2c5647c7b22e7387da69f9e72480af86948ce5ed17dc2c9e0a7\",\"license\":\"BUSL-1.1\"},\"contracts/interfaces/ICrossChainDispatcher.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/composable/IOFTReceiverUpgradeable.sol\\\";\\nimport \\\"../dependencies/stargate-protocol/interfaces/IStargateReceiver.sol\\\";\\nimport \\\"../dependencies/stargate-protocol/interfaces/IStargateRouter.sol\\\";\\nimport \\\"../dependencies/stargate-protocol/interfaces/IStargateComposer.sol\\\";\\nimport \\\"./IProxyOFT.sol\\\";\\n\\ninterface ICrossChainDispatcher is IStargateReceiver, IOFTReceiverUpgradeable {\\n function crossChainDispatcherOf(uint16 chainId_) external view returns (address);\\n\\n function triggerFlashRepaySwap(\\n uint256 id_,\\n address payable account_,\\n address tokenIn_,\\n address tokenOut_,\\n uint256 amountIn_,\\n uint256 amountOutMin_,\\n bytes calldata lzArgs_\\n ) external payable;\\n\\n function triggerLeverageSwap(\\n uint256 id_,\\n address payable account_,\\n address tokenIn_,\\n address tokenOut_,\\n uint256 amountIn_,\\n uint256 amountOutMin,\\n bytes calldata lzArgs_\\n ) external payable;\\n\\n function isBridgingActive() external view returns (bool);\\n\\n function flashRepayCallbackTxGasLimit() external view returns (uint64);\\n\\n function flashRepaySwapTxGasLimit() external view returns (uint64);\\n\\n function leverageCallbackTxGasLimit() external view returns (uint64);\\n\\n function leverageSwapTxGasLimit() external view returns (uint64);\\n\\n function lzBaseGasLimit() external view returns (uint256);\\n\\n function stargateComposer() external view returns (IStargateComposer);\\n\\n function stargateSlippage() external view returns (uint256);\\n\\n function stargatePoolIdOf(address token_) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xcaf05e625588dcfaa5706acc78a35fa46d50baeb2d28f689036963695a4e39cb\",\"license\":\"MIT\"},\"contracts/interfaces/IDebtToken.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/openzeppelin/token/ERC20/extensions/IERC20Metadata.sol\\\";\\nimport \\\"./ISyntheticToken.sol\\\";\\n\\ninterface IDebtToken is IERC20Metadata {\\n function lastTimestampAccrued() external view returns (uint256);\\n\\n function isActive() external view returns (bool);\\n\\n function syntheticToken() external view returns (ISyntheticToken);\\n\\n function accrueInterest() external;\\n\\n function debtIndex() external returns (uint256 debtIndex_);\\n\\n function burn(address from_, uint256 amount_) external;\\n\\n function issue(uint256 amount_, address to_) external returns (uint256 _issued, uint256 _fee);\\n\\n function flashIssue(address to_, uint256 amount_) external returns (uint256 _issued, uint256 _fee);\\n\\n function mint(address to_, uint256 amount_) external;\\n\\n function repay(address onBehalfOf_, uint256 amount_) external returns (uint256 _repaid, uint256 _fee);\\n\\n function repayAll(address onBehalfOf_) external returns (uint256 _repaid, uint256 _fee);\\n\\n function quoteIssueIn(uint256 amountToIssue_) external view returns (uint256 _amount, uint256 _fee);\\n\\n function quoteIssueOut(uint256 amount_) external view returns (uint256 _amountToIssue, uint256 _fee);\\n\\n function quoteRepayIn(uint256 amountToRepay_) external view returns (uint256 _amount, uint256 _fee);\\n\\n function quoteRepayOut(uint256 amount_) external view returns (uint256 _amountToRepay, uint256 _fee);\\n\\n function updateMaxTotalSupply(uint256 newMaxTotalSupply_) external;\\n\\n function updateInterestRate(uint256 newInterestRate_) external;\\n\\n function maxTotalSupply() external view returns (uint256);\\n\\n function interestRate() external view returns (uint256);\\n\\n function interestRatePerSecond() external view returns (uint256);\\n\\n function toggleIsActive() external;\\n}\\n\",\"keccak256\":\"0xd2f04aa1bee06d6991b10aaf7c03c3ee09d85f8e48ba92feac595ad855881380\",\"license\":\"MIT\"},\"contracts/interfaces/IDepositToken.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/openzeppelin/token/ERC20/extensions/IERC20Metadata.sol\\\";\\n\\ninterface IDepositToken is IERC20Metadata {\\n function underlying() external view returns (IERC20);\\n\\n function collateralFactor() external view returns (uint256);\\n\\n function unlockedBalanceOf(address account_) external view returns (uint256);\\n\\n function lockedBalanceOf(address account_) external view returns (uint256);\\n\\n function flashWithdraw(address account_, uint256 amount_) external returns (uint256 _withdrawn, uint256 _fee);\\n\\n function deposit(uint256 amount_, address onBehalfOf_) external returns (uint256 _deposited, uint256 _fee);\\n\\n function quoteDepositIn(uint256 amountToDeposit_) external view returns (uint256 _amount, uint256 _fee);\\n\\n function quoteDepositOut(uint256 amount_) external view returns (uint256 _amountToDeposit, uint256 _fee);\\n\\n function quoteWithdrawIn(uint256 amountToWithdraw_) external view returns (uint256 _amount, uint256 _fee);\\n\\n function quoteWithdrawOut(uint256 amount_) external view returns (uint256 _amountToWithdraw, uint256 _fee);\\n\\n function withdraw(uint256 amount_, address to_) external returns (uint256 _withdrawn, uint256 _fee);\\n\\n function seize(address from_, address to_, uint256 amount_) external;\\n\\n function updateCollateralFactor(uint128 newCollateralFactor_) external;\\n\\n function isActive() external view returns (bool);\\n\\n function toggleIsActive() external;\\n\\n function maxTotalSupply() external view returns (uint256);\\n\\n function updateMaxTotalSupply(uint256 newMaxTotalSupply_) external;\\n\\n function withdrawFrom(address from_, uint256 amount_) external returns (uint256 _withdrawn, uint256 _fee);\\n}\\n\",\"keccak256\":\"0xb27092f9450d9c48c1a215925007ca9c7282cfe6cf257b34ab3dbe6e745b6bd1\",\"license\":\"MIT\"},\"contracts/interfaces/IFeeProvider.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\n/**\\n * @notice FeeProvider interface\\n */\\ninterface IFeeProvider {\\n struct LiquidationFees {\\n uint128 liquidatorIncentive;\\n uint128 protocolFee;\\n }\\n\\n function defaultSwapFee() external view returns (uint256);\\n\\n function depositFee() external view returns (uint256);\\n\\n function issueFee() external view returns (uint256);\\n\\n function liquidationFees() external view returns (uint128 liquidatorIncentive, uint128 protocolFee);\\n\\n function repayFee() external view returns (uint256);\\n\\n function swapFeeFor(address account_) external view returns (uint256);\\n\\n function withdrawFee() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x3b132b42090c167b2c0aef6d78d833c669c43b9e55593a7a21a96ed5d3082700\",\"license\":\"MIT\"},\"contracts/interfaces/IGovernable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\n/**\\n * @notice Governable interface\\n */\\ninterface IGovernable {\\n function governor() external view returns (address _governor);\\n\\n function transferGovernorship(address _proposedGovernor) external;\\n}\\n\",\"keccak256\":\"0xbe84461adf33aec1bf31b6d84a5380aaeb791de9a4b95346dd8270dc6632984e\",\"license\":\"MIT\"},\"contracts/interfaces/IManageable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./IPool.sol\\\";\\n\\n/**\\n * @notice Manageable interface\\n */\\ninterface IManageable {\\n function pool() external view returns (IPool _pool);\\n}\\n\",\"keccak256\":\"0xac88e0997a26942cb9cbda1a7dd9756e28ba2025813e5b07e55939fbf8538ea2\",\"license\":\"MIT\"},\"contracts/interfaces/IPauseable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\ninterface IPauseable {\\n function paused() external view returns (bool);\\n\\n function everythingStopped() external view returns (bool);\\n}\\n\",\"keccak256\":\"0xa768de9fadad05a8104cb407ae6243354e70ffd6e1a50c3e0bb0a6a1dc49d32a\",\"license\":\"MIT\"},\"contracts/interfaces/IPool.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./IDepositToken.sol\\\";\\nimport \\\"./IDebtToken.sol\\\";\\nimport \\\"./ITreasury.sol\\\";\\nimport \\\"./IRewardsDistributor.sol\\\";\\nimport \\\"./IPoolRegistry.sol\\\";\\nimport \\\"./IFeeProvider.sol\\\";\\nimport \\\"./ISmartFarmingManager.sol\\\";\\nimport \\\"./external/ISwapper.sol\\\";\\nimport \\\"../interfaces/IFeeProvider.sol\\\";\\n\\n/**\\n * @notice Pool interface\\n */\\ninterface IPool is IPauseable, IGovernable {\\n function debtFloorInUsd() external view returns (uint256);\\n\\n function feeCollector() external view returns (address);\\n\\n function feeProvider() external view returns (IFeeProvider);\\n\\n function maxLiquidable() external view returns (uint256);\\n\\n function doesSyntheticTokenExist(ISyntheticToken syntheticToken_) external view returns (bool);\\n\\n function doesDebtTokenExist(IDebtToken debtToken_) external view returns (bool);\\n\\n function doesDepositTokenExist(IDepositToken depositToken_) external view returns (bool);\\n\\n function depositTokenOf(IERC20 underlying_) external view returns (IDepositToken);\\n\\n function debtTokenOf(ISyntheticToken syntheticToken_) external view returns (IDebtToken);\\n\\n function getDepositTokens() external view returns (address[] memory);\\n\\n function getDebtTokens() external view returns (address[] memory);\\n\\n function getRewardsDistributors() external view returns (address[] memory);\\n\\n function debtOf(address account_) external view returns (uint256 _debtInUsd);\\n\\n function depositOf(address account_) external view returns (uint256 _depositInUsd, uint256 _issuableLimitInUsd);\\n\\n function debtPositionOf(\\n address account_\\n )\\n external\\n view\\n returns (\\n bool _isHealthy,\\n uint256 _depositInUsd,\\n uint256 _debtInUsd,\\n uint256 _issuableLimitInUsd,\\n uint256 _issuableInUsd\\n );\\n\\n function liquidate(\\n ISyntheticToken syntheticToken_,\\n address account_,\\n uint256 amountToRepay_,\\n IDepositToken depositToken_\\n ) external returns (uint256 _totalSeized, uint256 _toLiquidator, uint256 _fee);\\n\\n function quoteLiquidateIn(\\n ISyntheticToken syntheticToken_,\\n uint256 totalToSeized_,\\n IDepositToken depositToken_\\n ) external view returns (uint256 _amountToRepay, uint256 _toLiquidator, uint256 _fee);\\n\\n function quoteLiquidateMax(\\n ISyntheticToken syntheticToken_,\\n address account_,\\n IDepositToken depositToken_\\n ) external view returns (uint256 _maxAmountToRepay);\\n\\n function quoteLiquidateOut(\\n ISyntheticToken syntheticToken_,\\n uint256 amountToRepay_,\\n IDepositToken depositToken_\\n ) external view returns (uint256 _totalSeized, uint256 _toLiquidator, uint256 _fee);\\n\\n function quoteSwapIn(\\n ISyntheticToken syntheticTokenIn_,\\n ISyntheticToken syntheticTokenOut_,\\n uint256 amountOut_\\n ) external view returns (uint256 _amountIn, uint256 _fee);\\n\\n function quoteSwapOut(\\n ISyntheticToken syntheticTokenIn_,\\n ISyntheticToken syntheticTokenOut_,\\n uint256 amountIn_\\n ) external view returns (uint256 _amountOut, uint256 _fee);\\n\\n function swap(\\n ISyntheticToken syntheticTokenIn_,\\n ISyntheticToken syntheticTokenOut_,\\n uint256 amountIn_\\n ) external returns (uint256 _amountOut, uint256 _fee);\\n\\n function treasury() external view returns (ITreasury);\\n\\n function masterOracle() external view returns (IMasterOracle);\\n\\n function poolRegistry() external view returns (IPoolRegistry);\\n\\n function addToDepositTokensOfAccount(address account_) external;\\n\\n function removeFromDepositTokensOfAccount(address account_) external;\\n\\n function addToDebtTokensOfAccount(address account_) external;\\n\\n function removeFromDebtTokensOfAccount(address account_) external;\\n\\n function getDepositTokensOfAccount(address account_) external view returns (address[] memory);\\n\\n function getDebtTokensOfAccount(address account_) external view returns (address[] memory);\\n\\n function isSwapActive() external view returns (bool);\\n\\n function smartFarmingManager() external view returns (ISmartFarmingManager);\\n}\\n\",\"keccak256\":\"0x0f0a869451cca858ba52b56970db167360fe161f2450557a053c4da938558816\",\"license\":\"MIT\"},\"contracts/interfaces/IPoolRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./external/IMasterOracle.sol\\\";\\nimport \\\"./IPauseable.sol\\\";\\nimport \\\"./IGovernable.sol\\\";\\nimport \\\"./ISyntheticToken.sol\\\";\\nimport \\\"./external/ISwapper.sol\\\";\\nimport \\\"./IQuoter.sol\\\";\\nimport \\\"./ICrossChainDispatcher.sol\\\";\\n\\ninterface IPoolRegistry is IPauseable, IGovernable {\\n function feeCollector() external view returns (address);\\n\\n function isPoolRegistered(address pool_) external view returns (bool);\\n\\n function nativeTokenGateway() external view returns (address);\\n\\n function getPools() external view returns (address[] memory);\\n\\n function registerPool(address pool_) external;\\n\\n function unregisterPool(address pool_) external;\\n\\n function masterOracle() external view returns (IMasterOracle);\\n\\n function updateFeeCollector(address newFeeCollector_) external;\\n\\n function idOfPool(address pool_) external view returns (uint256);\\n\\n function nextPoolId() external view returns (uint256);\\n\\n function swapper() external view returns (ISwapper);\\n\\n function quoter() external view returns (IQuoter);\\n\\n function crossChainDispatcher() external view returns (ICrossChainDispatcher);\\n\\n function doesSyntheticTokenExist(ISyntheticToken syntheticToken_) external view returns (bool _exists);\\n}\\n\",\"keccak256\":\"0x9ffa9e5fd39a48ac2bda561af7fb4fc9df5f8ffb7a602ef1d4da8c068019e723\",\"license\":\"MIT\"},\"contracts/interfaces/IProxyOFT.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/composable/IComposableOFTCoreUpgradeable.sol\\\";\\n\\ninterface IProxyOFT is IComposableOFTCoreUpgradeable {\\n function getProxyOFTOf(uint16 chainId_) external view returns (address _proxyOFT);\\n}\\n\",\"keccak256\":\"0x4041a90eb60de460c9e1631aaedfbf2bff2275b3f91964800b1c774546931cd5\",\"license\":\"MIT\"},\"contracts/interfaces/IQuoter.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./IPoolRegistry.sol\\\";\\nimport \\\"./IProxyOFT.sol\\\";\\n\\ninterface IQuoter {\\n function quoteCrossChainFlashRepayNativeFee(\\n IProxyOFT proxyOFT_,\\n bytes calldata lzArgs_\\n ) external view returns (uint256 _nativeFee);\\n\\n function quoteCrossChainLeverageNativeFee(\\n IProxyOFT proxyOFT_,\\n bytes calldata lzArgs_\\n ) external view returns (uint256 _nativeFee);\\n\\n function quoteLeverageCallbackNativeFee(uint16 dstChainId_) external view returns (uint256 _callbackTxNativeFee);\\n\\n function quoteFlashRepayCallbackNativeFee(uint16 dstChainId_) external view returns (uint256 _callbackTxNativeFee);\\n\\n function getFlashRepaySwapAndCallbackLzArgs(\\n uint16 srcChainId_,\\n uint16 dstChainId_\\n ) external view returns (bytes memory lzArgs_);\\n\\n function getLeverageSwapAndCallbackLzArgs(\\n uint16 srcChainId_,\\n uint16 dstChainId_\\n ) external view returns (bytes memory lzArgs_);\\n}\\n\",\"keccak256\":\"0x1e4d2dd779a09dc8ea6b6c244b167deddca3a48e71b73bf940da04113b40c752\",\"license\":\"MIT\"},\"contracts/interfaces/IRewardsDistributor.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/openzeppelin/token/ERC20/IERC20.sol\\\";\\n\\n/**\\n * @notice Reward Distributor interface\\n */\\ninterface IRewardsDistributor {\\n function rewardToken() external view returns (IERC20);\\n\\n function tokenSpeeds(IERC20 token_) external view returns (uint256);\\n\\n function tokensAccruedOf(address account_) external view returns (uint256);\\n\\n function updateBeforeMintOrBurn(IERC20 token_, address account_) external;\\n\\n function updateBeforeTransfer(IERC20 token_, address from_, address to_) external;\\n\\n function claimable(address account_) external view returns (uint256 _claimable);\\n\\n function claimable(address account_, IERC20 token_) external view returns (uint256 _claimable);\\n\\n function claimRewards(address account_) external;\\n\\n function claimRewards(address account_, IERC20[] memory tokens_) external;\\n\\n function claimRewards(address[] memory accounts_, IERC20[] memory tokens_) external;\\n\\n function updateTokenSpeed(IERC20 token_, uint256 newSpeed_) external;\\n\\n function updateTokenSpeeds(IERC20[] calldata tokens_, uint256[] calldata speeds_) external;\\n\\n function tokens(uint256) external view returns (IERC20);\\n\\n function tokenStates(IERC20) external view returns (uint224 index, uint32 timestamp);\\n\\n function accountIndexOf(IERC20, address) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x4f527eeae61b6a5bff7d3b48037234ef718ae7f71dc452e8cab3b60581f0d810\",\"license\":\"MIT\"},\"contracts/interfaces/ISmartFarmingManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"./IManageable.sol\\\";\\nimport \\\"./IDepositToken.sol\\\";\\nimport \\\"./IDebtToken.sol\\\";\\n\\n/**\\n * @notice SmartFarmingManager interface\\n */\\ninterface ISmartFarmingManager {\\n function flashRepay(\\n ISyntheticToken syntheticToken_,\\n IDepositToken depositToken_,\\n uint256 withdrawAmount_,\\n uint256 repayAmountMin_\\n ) external returns (uint256 _withdrawn, uint256 _repaid);\\n\\n function crossChainFlashRepay(\\n ISyntheticToken syntheticToken_,\\n IDepositToken depositToken_,\\n uint256 withdrawAmount_,\\n IERC20 bridgeToken_,\\n uint256 bridgeTokenAmountMin_,\\n uint256 swapAmountOutMin_,\\n uint256 repayAmountMin_,\\n bytes calldata lzArgs_\\n ) external payable;\\n\\n function crossChainLeverage(\\n IERC20 tokenIn_,\\n IDepositToken depositToken_,\\n ISyntheticToken syntheticToken_,\\n uint256 amountIn_,\\n uint256 leverage_,\\n uint256 swapAmountOutMin_,\\n uint256 depositAmountMin_,\\n bytes calldata lzArgs_\\n ) external payable;\\n\\n function crossChainLeverageCallback(uint256 id_, uint256 swapAmountOut_) external returns (uint256 _deposited);\\n\\n function crossChainFlashRepayCallback(uint256 id_, uint256 swapAmountOut_) external returns (uint256 _repaid);\\n\\n function leverage(\\n IERC20 tokenIn_,\\n IDepositToken depositToken_,\\n ISyntheticToken syntheticToken_,\\n uint256 amountIn_,\\n uint256 leverage_,\\n uint256 depositAmountMin_\\n ) external returns (uint256 _deposited, uint256 _issued);\\n}\\n\",\"keccak256\":\"0x7544a9d308a49e24d6984c3cfcfe2c1cfb7d9ce4655408438e1c12f37175a3b0\",\"license\":\"MIT\"},\"contracts/interfaces/ISyntheticToken.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../dependencies/openzeppelin/token/ERC20/extensions/IERC20Metadata.sol\\\";\\nimport \\\"./IDebtToken.sol\\\";\\nimport \\\"./IPoolRegistry.sol\\\";\\nimport \\\"../interfaces/IProxyOFT.sol\\\";\\n\\ninterface ISyntheticToken is IERC20Metadata {\\n function isActive() external view returns (bool);\\n\\n function mint(address to_, uint256 amount_) external;\\n\\n function burn(address from_, uint256 amount) external;\\n\\n function poolRegistry() external view returns (IPoolRegistry);\\n\\n function toggleIsActive() external;\\n\\n function seize(address from_, address to_, uint256 amount_) external;\\n\\n function updateMaxTotalSupply(uint256 newMaxTotalSupply_) external;\\n\\n function updateProxyOFT(IProxyOFT newProxyOFT_) external;\\n\\n function maxTotalSupply() external view returns (uint256);\\n\\n function proxyOFT() external view returns (IProxyOFT);\\n}\\n\",\"keccak256\":\"0xfaeb24d1067e85493a5c8818d6de06fc6dbc72c37e85f82811990d0120f8a0cf\",\"license\":\"MIT\"},\"contracts/interfaces/ITreasury.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\ninterface ITreasury {\\n function pull(address to_, uint256 amount_) external;\\n\\n function migrateTo(address newTreasury_) external;\\n}\\n\",\"keccak256\":\"0x9ee0a41cfe7b5bd2ec256441fc7b2ae6407921ed28a65daeaa476cfc9df73c1b\",\"license\":\"MIT\"},\"contracts/interfaces/external/IMasterOracle.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\ninterface IMasterOracle {\\n function quoteTokenToUsd(address _asset, uint256 _amount) external view returns (uint256 _amountInUsd);\\n\\n function quoteUsdToToken(address _asset, uint256 _amountInUsd) external view returns (uint256 _amount);\\n\\n function quote(address _assetIn, address _assetOut, uint256 _amountIn) external view returns (uint256 _amountOut);\\n}\\n\",\"keccak256\":\"0x2f080adc5880151dc4446ef43b54abab8e3711c5f2e526917ef39a05e3c16a00\",\"license\":\"MIT\"},\"contracts/interfaces/external/IStargateComposerWithRetry.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../../dependencies/stargate-protocol/interfaces/IStargateComposer.sol\\\";\\n\\n// Note: Extending interface instead of adding those function to avoid triggering upgrade for other contracts\\n// We may move functions to `IStargateComposer` on the next major upgrade\\n// Refs: https://github.com/autonomoussoftware/metronome-synth/issues/877\\ninterface IStargateComposerWithRetry is IStargateComposer {\\n function payloadHashes(\\n uint16 _srcChainId,\\n bytes calldata _srcAddress,\\n uint256 _nonce\\n ) external view returns (bytes32);\\n\\n function clearCachedSwap(\\n uint16 _srcChainId,\\n bytes calldata _srcAddress,\\n uint64 _nonce,\\n address _receiver,\\n bytes calldata _sgReceiveCallData\\n ) external;\\n}\\n\",\"keccak256\":\"0x92a0df931fd4ffb78085bf1526c0a5b53c78d9ea9a8a9f9b57d7178b14b80508\",\"license\":\"BUSL-1.1\"},\"contracts/interfaces/external/ISwapper.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\ninterface ISwapper {\\n function swapExactInput(\\n address tokenIn_,\\n address tokenOut_,\\n uint256 amountIn_,\\n uint256 amountOutMin_,\\n address receiver_\\n ) external returns (uint256 _amountOut);\\n}\\n\",\"keccak256\":\"0x75f04b225d0c310be7e0a09ee4c1aa6eeeb8d94e02fc0e4160a9597ce2d8d446\",\"license\":\"MIT\"},\"contracts/lib/CrossChainLib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nlibrary CrossChainLib {\\n /**\\n * @notice Supported cross-chain operations\\n */\\n uint8 public constant LEVERAGE = 1;\\n uint8 public constant FLASH_REPAY = 2;\\n\\n function getOperationType(bytes memory payload_) internal pure returns (uint8 _op) {\\n (_op, ) = abi.decode(payload_, (uint8, bytes));\\n }\\n\\n function encodeLeverageCallbackPayload(\\n address srcSmartFarmingManager_,\\n uint256 requestId_\\n ) internal pure returns (bytes memory _payload) {\\n return abi.encode(LEVERAGE, abi.encode(srcSmartFarmingManager_, requestId_));\\n }\\n\\n function decodeLeverageCallbackPayload(\\n bytes memory payload_\\n ) internal pure returns (address _srcSmartFarmingManager, uint256 _requestId) {\\n (, payload_) = abi.decode(payload_, (uint8, bytes));\\n return abi.decode(payload_, (address, uint256));\\n }\\n\\n function encodeFlashRepayCallbackPayload(\\n address srcProxyOFT_,\\n address srcSmartFarmingManager_,\\n uint256 requestId_\\n ) internal pure returns (bytes memory _payload) {\\n return abi.encode(FLASH_REPAY, abi.encode(srcProxyOFT_, srcSmartFarmingManager_, requestId_));\\n }\\n\\n function decodeFlashRepayCallbackPayload(\\n bytes memory payload_\\n ) internal pure returns (address srcProxyOFT_, address _srcSmartFarmingManager, uint256 _requestId) {\\n (, payload_) = abi.decode(payload_, (uint8, bytes));\\n return abi.decode(payload_, (address, address, uint256));\\n }\\n\\n function encodeFlashRepaySwapPayload(\\n address srcSmartFarmingManager_,\\n address dstProxyOFT_,\\n uint256 requestId_,\\n address account_,\\n uint256 amountOutMin_,\\n uint256 callbackTxNativeFee_\\n ) internal pure returns (bytes memory _payload) {\\n return\\n abi.encode(\\n FLASH_REPAY,\\n abi.encode(\\n srcSmartFarmingManager_,\\n dstProxyOFT_,\\n requestId_,\\n account_,\\n amountOutMin_,\\n callbackTxNativeFee_\\n )\\n );\\n }\\n\\n function decodeFlashRepaySwapPayload(\\n bytes memory payload_\\n )\\n internal\\n pure\\n returns (\\n address _srcSmartFarmingManager,\\n address _dstProxyOFT,\\n uint256 _requestId,\\n address _account,\\n uint256 _amountOutMin,\\n uint256 _callbackTxNativeFee\\n )\\n {\\n (, payload_) = abi.decode(payload_, (uint8, bytes));\\n return abi.decode(payload_, (address, address, uint256, address, uint256, uint256));\\n }\\n\\n function encodeLeverageSwapPayload(\\n address srcSmartFarmingManager_,\\n address dstProxyOFT_,\\n uint256 requestId_,\\n uint256 sgPoolId_,\\n address account_,\\n uint256 amountOutMin_,\\n uint256 callbackTxNativeFee_\\n ) internal pure returns (bytes memory _payload) {\\n return\\n abi.encode(\\n LEVERAGE,\\n abi.encode(\\n srcSmartFarmingManager_,\\n dstProxyOFT_,\\n requestId_,\\n sgPoolId_,\\n account_,\\n amountOutMin_,\\n callbackTxNativeFee_\\n )\\n );\\n }\\n\\n function decodeLeverageSwapPayload(\\n bytes memory payload_\\n )\\n internal\\n pure\\n returns (\\n address _srcSmartFarmingManager,\\n address _dstProxyOFT,\\n uint256 _requestId,\\n uint256 _sgPoolId,\\n address _account,\\n uint256 _amountOutMin,\\n uint256 _callbackTxNativeFee\\n )\\n {\\n (, payload_) = abi.decode(payload_, (uint8, bytes));\\n return abi.decode(payload_, (address, address, uint256, uint256, address, uint256, uint256));\\n }\\n\\n function encodeLzArgs(\\n uint16 dstChainId_,\\n uint256 callbackNativeFee_,\\n uint64 swapTxGasLimit_\\n ) internal pure returns (bytes memory _lzArgs) {\\n return abi.encode(dstChainId_, callbackNativeFee_, swapTxGasLimit_);\\n }\\n\\n function decodeLzArgs(\\n bytes memory lzArgs_\\n ) internal pure returns (uint16 _dstChainId, uint256 _callbackNativeFee, uint64 _swapTxGasLimit) {\\n return abi.decode(lzArgs_, (uint16, uint256, uint64));\\n }\\n}\\n\",\"keccak256\":\"0x15b84cfe132b4641c5b8a6f04eed6a5a88fbbb0bd89ad7c167d98ad653ff1043\",\"license\":\"MIT\"},\"contracts/lib/WadRayMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\n/**\\n * @title Math library\\n * @dev Provides mul and div function for wads (decimal numbers with 18 digits precision) and rays (decimals with 27 digits)\\n * @dev Based on https://github.com/dapphub/ds-math/blob/master/src/math.sol\\n */\\nlibrary WadRayMath {\\n uint256 internal constant WAD = 1e18;\\n uint256 internal constant HALF_WAD = WAD / 2;\\n\\n uint256 internal constant RAY = 1e27;\\n uint256 internal constant HALF_RAY = RAY / 2;\\n\\n uint256 internal constant WAD_RAY_RATIO = 1e9;\\n\\n /**\\n * @dev Multiplies two wad, rounding half up to the nearest wad\\n * @param a Wad\\n * @param b Wad\\n * @return The result of a*b, in wad\\n */\\n function wadMul(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (a == 0 || b == 0) {\\n return 0;\\n }\\n\\n return (a * b + HALF_WAD) / WAD;\\n }\\n\\n /**\\n * @dev Divides two wad, rounding half up to the nearest wad\\n * @param a Wad\\n * @param b Wad\\n * @return The result of a/b, in wad\\n */\\n function wadDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n return (a * WAD + b / 2) / b;\\n }\\n}\\n\",\"keccak256\":\"0xd971282b7b02c2121f64a13df8b40f427dbda36a770d0d391a3102947a743071\",\"license\":\"MIT\"},\"contracts/storage/SmartFarmingManagerStorage.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.9;\\n\\nimport \\\"../interfaces/ISmartFarmingManager.sol\\\";\\n\\n// solhint-disable var-name-mixedcase, max-states-count\\nabstract contract SmartFarmingManagerStorageV1 is ISmartFarmingManager {\\n /**\\n * @notice Cross-chain Leverage request data\\n */\\n struct CrossChainLeverage {\\n uint16 dstChainId;\\n IERC20 bridgeToken;\\n IDepositToken depositToken;\\n ISyntheticToken syntheticToken;\\n uint256 amountIn;\\n uint256 debtAmount;\\n uint256 depositAmountMin;\\n address account;\\n bool finished;\\n IERC20 tokenIn;\\n }\\n\\n /**\\n * @notice Cross-chain Flash repay request data\\n */\\n struct CrossChainFlashRepay {\\n uint16 dstChainId;\\n ISyntheticToken syntheticToken;\\n uint256 repayAmountMin;\\n address account;\\n bool finished;\\n }\\n\\n /**\\n * @notice Cross-chain requests counter\\n */\\n uint256 public crossChainRequestsLength;\\n\\n /**\\n * @notice Cross-chain leverage requests\\n */\\n mapping(uint256 => CrossChainLeverage) public crossChainLeverages;\\n\\n /**\\n * @notice Cross-chain flash repay requests\\n */\\n mapping(uint256 => CrossChainFlashRepay) public crossChainFlashRepays;\\n}\\n\",\"keccak256\":\"0x2af2ef0dc315ab9d1714b0530cf6a3481fbc4e899a9dd7655ce1fadd9aa218f8\",\"license\":\"MIT\"},\"contracts/utils/ReentrancyGuard.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../dependencies/openzeppelin-upgradeable/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 ReentrancyGuard 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 // On the first call to nonReentrant, _notEntered will be true\\n require(_status != _ENTERED, \\\"ReentrancyGuard: reentrant call\\\");\\n\\n // Any calls to nonReentrant after this point will fail\\n _status = _ENTERED;\\n\\n _;\\n\\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\",\"keccak256\":\"0x3bf3c3de5a638ca101f25dfcaec5268e9c8a1c29a9a278d70be4459768fb41fe\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60806040523480156200001157600080fd5b506200001c62000022565b62000152565b6200002e60ff62000031565b50565b60008054610100900460ff1615620000ca578160ff1660011480156200006a575062000068306200014360201b62002d871760201c565b155b620000c25760405162461bcd60e51b815260206004820152602e602482015260008051602062004aba83398151915260448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b506000919050565b60005460ff808416911610620001295760405162461bcd60e51b815260206004820152602e602482015260008051602062004aba83398151915260448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401620000b9565b506000805460ff191660ff92909216919091179055600190565b6001600160a01b03163b151590565b61495880620001626000396000f3fe6080604052600436106101095760003560e01c8063583bfe761161009557806399e5e6551161006457806399e5e6551461037b5780639b6623d814610416578063c35576911461042c578063c4d66de81461043f578063ffa1ad741461045f57600080fd5b8063583bfe76146102275780636455bf6f146102475780638056777414610275578063823185611461029557600080fd5b806332c615b4116100dc57806332c615b41461018a578063364fda001461019f57806339c9a98e146101d45780633bb1f3d0146101e75780634d7e9a761461020757600080fd5b80630c340a241461010e57806316f0115b14610140578063196e7f51146101605780632b3297f914610175575b600080fd5b34801561011a57600080fd5b5061012361049d565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561014c57600080fd5b50600254610123906001600160a01b031681565b61017361016e366004613e4f565b61051f565b005b34801561018157600080fd5b5061012361098d565b34801561019657600080fd5b50610123610a42565b3480156101ab57600080fd5b506101bf6101ba366004613f08565b610af7565b60408051928352602083019190915201610137565b6101736101e2366004613f4e565b61111c565b3480156101f357600080fd5b50610173610202366004614019565b611151565b34801561021357600080fd5b506101bf6102223660046140c1565b611429565b34801561023357600080fd5b50610173610242366004614126565b611abd565b34801561025357600080fd5b506102676102623660046141e3565b611e1c565b604051908152602001610137565b34801561028157600080fd5b506102676102903660046141e3565b6122a0565b3480156102a157600080fd5b506103196102b0366004614205565b6035602052600090815260409020805460018201546002830154600384015460048501546005860154600687015460079097015461ffff871697620100009097046001600160a01b0390811697968116969581169581811692600160a01b90910460ff1691168a565b6040805161ffff909b168b526001600160a01b03998a1660208c0152978916978a01979097529487166060890152608088019390935260a087019190915260c0860152831660e085015215156101008401521661012082015261014001610137565b34801561038757600080fd5b506103dc610396366004614205565b60366020526000908152604090208054600182015460029092015461ffff821692620100009092046001600160a01b03908116929190811690600160a01b900460ff1685565b6040805161ffff90961686526001600160a01b0394851660208701528501929092529190911660608301521515608082015260a001610137565b34801561042257600080fd5b5061026760345481565b61017361043a36600461421e565b612816565b34801561044b57600080fd5b5061017361045a3660046142a0565b612ce1565b34801561046b57600080fd5b50610490604051806040016040528060058152602001640312e332e360dc1b81525081565b6040516101379190614315565b6002546040805163030d028960e21b815290516000926001600160a01b031691630c340a24916004808301926020929190829003018186803b1580156104e257600080fd5b505afa1580156104f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061051a9190614328565b905090565b6002600154141561054b5760405162461bcd60e51b815260040161054290614345565b60405180910390fd5b6002600181905554604051633e25dee160e21b81526001600160a01b03808a1660048301528992169063f8977b849060240160206040518083038186803b15801561059557600080fd5b505afa1580156105a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105cd919061438c565b6105ea5760405163a67d528360e01b815260040160405180910390fd5b600254604051631a0dd00b60e01b81526001600160a01b03808d1660048301528c921690631a0dd00b9060240160206040518083038186803b15801561062f57600080fd5b505afa158015610643573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610667919061438c565b6106845760405163a596698b60e01b815260040160405180910390fd5b8b886106a3576040516310eb483f60e21b815260040160405180910390fd5b670de0b6b3a764000088116106cb57604051631907e1ff60e21b815260040160405180910390fd5b6107608a6001600160a01b031663df011c416040518163ffffffff1660e01b815260040160206040518083038186803b15801561070757600080fd5b505afa15801561071b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061073f91906143a7565b61075190670de0b6b3a76400006143d6565b670de0b6b3a764000090612d96565b88111561078057604051630a4f5a0760e01b815260040160405180910390fd5b6001600160a01b0381166107a757604051634f70ad6b60e01b815260040160405180910390fd5b6001600160a01b038b166107ce57604051633a8b51a760e01b815260040160405180910390fd5b6000806107dc83338d612dd3565b9a506107ea838f8d8d612ef4565b9150600260009054906101000a90046001600160a01b03166001600160a01b0316639f8f0fa88f6040518263ffffffff1660e01b815260040161083c91906001600160a01b0391909116815260200190565b60206040518083038186803b15801561085457600080fd5b505afa158015610868573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061088c9190614328565b6001600160a01b031663bfa176566108a2610a42565b846040518363ffffffff1660e01b81526004016108c09291906143ed565b6040805180830381600087803b1580156108d957600080fd5b505af11580156108ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109119190614406565b508091505060008e8e838c60405160200161095394939291906001600160a01b0394851681529290931660208301526040820152606081019190915260800190565b60408051601f1981840301815291905290508c610976858e8685858f8f8f61302b565b505060018055505050505050505050505050505050565b6002546040805163afcff50f60e01b815290516000926001600160a01b03169163afcff50f916004808301926020929190829003018186803b1580156109d257600080fd5b505afa1580156109e6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a0a9190614328565b6001600160a01b0316632b3297f96040518163ffffffff1660e01b815260040160206040518083038186803b1580156104e257600080fd5b6002546040805163afcff50f60e01b815290516000926001600160a01b03169163afcff50f916004808301926020929190829003018186803b158015610a8757600080fd5b505afa158015610a9b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610abf9190614328565b6001600160a01b03166332c615b46040518163ffffffff1660e01b815260040160206040518083038186803b1580156104e257600080fd5b600080600260009054906101000a90046001600160a01b03166001600160a01b031663ecf3a3f96040518163ffffffff1660e01b815260040160206040518083038186803b158015610b4857600080fd5b505afa158015610b5c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b80919061438c565b15610b9e57604051631b0e923f60e11b815260040160405180910390fd5b60026001541415610bc15760405162461bcd60e51b815260040161054290614345565b6002600181905554604051633e25dee160e21b81526001600160a01b0380881660048301528792169063f8977b849060240160206040518083038186803b158015610c0b57600080fd5b505afa158015610c1f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c43919061438c565b610c605760405163a67d528360e01b815260040160405180910390fd5b600254604051631a0dd00b60e01b81526001600160a01b03808a16600483015289921690631a0dd00b9060240160206040518083038186803b158015610ca557600080fd5b505afa158015610cb9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cdd919061438c565b610cfa5760405163a596698b60e01b815260040160405180910390fd5b85610d18576040516310eb483f60e21b815260040160405180910390fd5b6040516370a0823160e01b81523360048201526001600160a01b038816906370a082319060240160206040518083038186803b158015610d5757600080fd5b505afa158015610d6b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d8f91906143a7565b861115610daf57604051635de1e54160e01b815260040160405180910390fd5b6002546040516313f1e1f560e31b81526001600160a01b038a81166004830152909116906000908290639f8f0fa89060240160206040518083038186803b158015610df957600080fd5b505afa158015610e0d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e319190614328565b6040516370a0823160e01b81523360048201529091506001600160a01b038216906370a082319060240160206040518083038186803b158015610e7357600080fd5b505afa158015610e87573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eab91906143a7565b871115610ecb57604051635de1e54160e01b815260040160405180910390fd5b6040516336e1668760e11b81526001600160a01b038a1690636dc2cd0e90610ef99033908c906004016143ed565b6040805180830381600087803b158015610f1257600080fd5b505af1158015610f26573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f4a9190614406565b5095506000610f6c610f5a61098d565b610f638c613321565b8d8a6000613394565b604051630450cfaf60e31b81529091506001600160a01b038316906322867d7890610f9d90339085906004016143ed565b6040805180830381600087803b158015610fb657600080fd5b505af1158015610fca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fee9190614406565b5095508786101561101257604051634394bddf60e11b815260040160405180910390fd5b60405163dde3ab9560e01b81523360048201526000906001600160a01b0385169063dde3ab959060240160a06040518083038186803b15801561105457600080fd5b505afa158015611068573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061108c919061442a565b505050509050806110b05760405163cfd3600360e01b815260040160405180910390fd5b8a6001600160a01b03168c6001600160a01b03167f70e2337c0939e469d0c3d069c581bc0b72c541a70c592cdd46087d24e5e980d28a8a6040516110fe929190918252602082015260400190565b60405180910390a35050505050506001808190555094509492505050565b60405162461bcd60e51b815260206004820152600a60248201526919195c1c9958d85d195960b21b6044820152606401610542565b600061119284848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506133ae92505050565b600081815260366020908152604091829020825160a081018452815461ffff811682526201000090046001600160a01b03908116938201939093526001820154938101939093526002015490811660608301819052600160a01b90910460ff161515608083015291945092501515905061121f576040516311bf899560e21b815260040160405180910390fd5b80608001511561124257604051630814de4560e11b815260040160405180910390fd5b80606001516001600160a01b0316336001600160a01b031614156112755760008281526036602052604090206001018390555b600061127f610a42565b60405163dfda255f60e01b815261ffff8d1660048201529091506000906001600160a01b0383169063dfda255f9060240160206040518083038186803b1580156112c857600080fd5b505afa1580156112dc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113009190614328565b604051602001611328919060609190911b6bffffffffffffffffffffffff1916815260140190565b604051602081830303815290604052905082602001516001600160a01b0316636d1bb8f76040518163ffffffff1660e01b815260040160206040518083038186803b15801561137657600080fd5b505afa15801561138a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ae9190614328565b6001600160a01b031663cfd6528e8d8d8d8d86888f8f8f6040518a63ffffffff1660e01b81526004016113e99998979695949392919061449a565b600060405180830381600087803b15801561140357600080fd5b505af1158015611417573d6000803e3d6000fd5b50505050505050505050505050505050565b600080600260009054906101000a90046001600160a01b03166001600160a01b031663ecf3a3f96040518163ffffffff1660e01b815260040160206040518083038186803b15801561147a57600080fd5b505afa15801561148e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114b2919061438c565b156114d057604051631b0e923f60e11b815260040160405180910390fd5b600260015414156114f35760405162461bcd60e51b815260040161054290614345565b6002600181905554604051633e25dee160e21b81526001600160a01b03808a1660048301528992169063f8977b849060240160206040518083038186803b15801561153d57600080fd5b505afa158015611551573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611575919061438c565b6115925760405163a67d528360e01b815260040160405180910390fd5b600254604051631a0dd00b60e01b81526001600160a01b03808a16600483015289921690631a0dd00b9060240160206040518083038186803b1580156115d757600080fd5b505afa1580156115eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061160f919061438c565b61162c5760405163a596698b60e01b815260040160405180910390fd5b8661164a576040516310eb483f60e21b815260040160405180910390fd5b670de0b6b3a7640000861161167257604051631907e1ff60e21b815260040160405180910390fd5b6116ae896001600160a01b031663df011c416040518163ffffffff1660e01b815260040160206040518083038186803b15801561070757600080fd5b8611156116ce57604051630a4f5a0760e01b815260040160405180910390fd5b60006116d861098d565b905060006116e58b613321565b90506001600160a01b038c166116f957809b505b6117048c338b612dd3565b9850806001600160a01b03168c6001600160a01b0316146117305761172d828d838c6000613394565b98505b600061173e828c8c8c612ef4565b6002546040516313f1e1f560e31b81526001600160a01b038e8116600483015292935060009290911690639f8f0fa89060240160206040518083038186803b15801561178957600080fd5b505afa15801561179d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117c19190614328565b604051635fd0bb2b60e11b81529091506001600160a01b0382169063bfa17656906117f290309086906004016143ed565b6040805180830381600087803b15801561180b57600080fd5b505af115801561181f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118439190614406565b506040516340c10f1960e01b81529097506001600160a01b038216906340c10f199061187590339086906004016143ed565b600060405180830381600087803b15801561188f57600080fd5b505af11580156118a3573d6000803e3d6000fd5b50505050505060006118b9838c84896000613394565b6118c3908b614515565b9050878110156118e65760405163c724afdf60e01b815260040160405180910390fd5b6118fb6001600160a01b0383168d60006133ed565b61190f6001600160a01b0383168d836133ed565b604051636e553f6560e01b8152600481018290523360248201526001600160a01b038d1690636e553f65906044016040805180830381600087803b15801561195657600080fd5b505af115801561196a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061198e9190614406565b5060025460405163dde3ab9560e01b81523360048201529198506000916001600160a01b039091169063dde3ab959060240160a06040518083038186803b1580156119d857600080fd5b505afa1580156119ec573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a10919061442a565b50505050905080611a345760405163cfd3600360e01b815260040160405180910390fd5b8b6001600160a01b03168d6001600160a01b03168f6001600160a01b03167fd82c156e929db20771fc8413cc0789925f6c666a3e5076d5844765ee28bb3a958d8f8c8e604051611a9d949392919093845260208401929092526040830152606082015260800190565b60405180910390a450505050505060018081905550965096945050505050565b6000611afe84848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061353c92505050565b600081815260356020908152604091829020825161014081018452815461ffff811682526201000090046001600160a01b0390811693820193909352600182015483169381019390935260028101548216606084015260038101546080840152600481015460a0840152600581015460c0840152600681015480831660e08501819052600160a01b90910460ff1615156101008501526007909101549091166101208301529193509150611bc5576040516311bf899560e21b815260040160405180910390fd5b80610100015115611be957604051630814de4560e11b815260040160405180910390fd5b8060e001516001600160a01b0316336001600160a01b03161415611c1c5760008281526035602052604090206005018390555b6000611c26610a42565b60405163dfda255f60e01b815261ffff8e1660048201529091506000906001600160a01b0383169063dfda255f9060240160206040518083038186803b158015611c6f57600080fd5b505afa158015611c83573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ca79190614328565b6040516bffffffffffffffffffffffff19606083901b16602082015290915060009063ab8236f360e01b908f9060340160408051601f1981840301815290829052611cff92918f908f908f908f908f9060240161452d565b604051602081830303815290604052906001600160e01b0319166020820180516001600160e01b0383818316178352505050509050826001600160a01b0316633352b6086040518163ffffffff1660e01b815260040160206040518083038186803b158015611d6d57600080fd5b505afa158015611d81573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611da59190614328565b6001600160a01b031663c0e6ac6c8f8f8f8f88876040518763ffffffff1660e01b8152600401611dda96959493929190614591565b600060405180830381600087803b158015611df457600080fd5b505af1158015611e08573d6000803e3d6000fd5b505050505050505050505050505050505050565b6002546040805163ecf3a3f960e01b815290516000926001600160a01b03169163ecf3a3f9916004808301926020929190829003018186803b158015611e6157600080fd5b505afa158015611e75573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e99919061438c565b15611eb757604051631b0e923f60e11b815260040160405180910390fd5b60026001541415611eda5760405162461bcd60e51b815260040161054290614345565b6002600155611ee7610a42565b6001600160a01b0316336001600160a01b031614611f1857604051632b78ce1b60e11b815260040160405180910390fd5b600083815260366020908152604091829020825160a081018452815461ffff811682526201000090046001600160a01b03908116938201939093526001820154938101939093526002015490811660608301819052600160a01b90910460ff1615156080830152611f9c576040516311bf899560e21b815260040160405180910390fd5b806080015115611fbf57604051630814de4560e11b815260040160405180910390fd5b6000848152603660209081526040909120600201805460ff60a01b1916600160a01b179055810151611ff2903385612dd3565b60025460208301516040516313f1e1f560e31b81526001600160a01b039182166004820152929550600092911690639f8f0fa89060240160206040518083038186803b15801561204157600080fd5b505afa158015612055573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120799190614328565b60608301516040516370a0823160e01b81526001600160a01b0391821660048201529192506000919083169063c9dc4b4d9082906370a082319060240160206040518083038186803b1580156120ce57600080fd5b505afa1580156120e2573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061210691906143a7565b6040518263ffffffff1660e01b815260040161212491815260200190565b604080518083038186803b15801561213b57600080fd5b505afa15801561214f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121739190614406565b50905060006121828683613575565b90508015612211576060840151604051630450cfaf60e31b81526001600160a01b038516916322867d78916121bc919085906004016143ed565b6040805180830381600087803b1580156121d557600080fd5b505af11580156121e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061220d9190614406565b5094505b836040015185101561223657604051634394bddf60e11b815260040160405180910390fd5b808611156122665760608401516122669061225183896143d6565b60208701516001600160a01b0316919061358b565b60405187907f46da7fdc7ceed834de258df19d8f9ebd7082810a4eb45732d1401df31e5aaa1390600090a250506001805550909392505050565b6002546040805163ecf3a3f960e01b815290516000926001600160a01b03169163ecf3a3f9916004808301926020929190829003018186803b1580156122e557600080fd5b505afa1580156122f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061231d919061438c565b1561233b57604051631b0e923f60e11b815260040160405180910390fd5b6002600154141561235e5760405162461bcd60e51b815260040161054290614345565b600260015561236b610a42565b6001600160a01b0316336001600160a01b03161461239c57604051632b78ce1b60e11b815260040160405180910390fd5b600083815260356020908152604091829020825161014081018452815461ffff811682526201000090046001600160a01b0390811693820193909352600182015483169381019390935260028101548216606084015260038101546080840152600481015460a0840152600581015460c0840152600681015480831660e08501819052600160a01b90910460ff16151561010085015260079091015490911661012083015261245e576040516311bf899560e21b815260040160405180910390fd5b8061010001511561248257604051630814de4560e11b815260040160405180910390fd5b60006124918260400151613321565b6000868152603560209081526040909120600601805460ff60a01b1916600160a01b1790558301519091506124c7903386612dd3565b9350600082602001516001600160a01b03168361012001516001600160a01b0316141561251e576125176124f961098d565b846101200151848887608001516125109190614515565b6000613394565b9050612564565b61253c61252961098d565b8461012001518486608001516000613394565b905061255761254961098d565b846020015184886000613394565b6125619082614515565b90505b8260c001518110156125895760405163c724afdf60e01b815260040160405180910390fd5b60408301516125a4906001600160a01b0384169060006133ed565b60408301516125be906001600160a01b03841690836133ed565b60408084015160e08501519151636e553f6560e01b8152600481018490526001600160a01b039283166024820152911690636e553f65906044016040805180830381600087803b15801561261157600080fd5b505af1158015612625573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126499190614406565b5060025460608501516040516313f1e1f560e31b81526001600160a01b03918216600482015292965016908190639f8f0fa89060240160206040518083038186803b15801561269757600080fd5b505afa1580156126ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126cf9190614328565b6001600160a01b03166340c10f198560e001518660a001516040518363ffffffff1660e01b81526004016127049291906143ed565b600060405180830381600087803b15801561271e57600080fd5b505af1158015612732573d6000803e3d6000fd5b5050505060e084015160405163dde3ab9560e01b81526001600160a01b03918216600482015260009183169063dde3ab959060240160a06040518083038186803b15801561277f57600080fd5b505afa158015612793573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127b7919061442a565b505050509050806127db5760405163cfd3600360e01b815260040160405180910390fd5b60405188907f8e4ff8e32fb3b90b184bdac5bf0d9b2a0fe19baa9dfea95c0fcd7d8e3842e80e90600090a25050600180555091949350505050565b600260015414156128395760405162461bcd60e51b815260040161054290614345565b6002600181905554604051633e25dee160e21b81526001600160a01b03808b1660048301528a92169063f8977b849060240160206040518083038186803b15801561288357600080fd5b505afa158015612897573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128bb919061438c565b6128d85760405163a67d528360e01b815260040160405180910390fd5b600254604051631a0dd00b60e01b81526001600160a01b03808d1660048301528c921690631a0dd00b9060240160206040518083038186803b15801561291d57600080fd5b505afa158015612931573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612955919061438c565b6129725760405163a596698b60e01b815260040160405180910390fd5b88612990576040516310eb483f60e21b815260040160405180910390fd5b600260009054906101000a90046001600160a01b03166001600160a01b031663afcff50f6040518163ffffffff1660e01b815260040160206040518083038186803b1580156129de57600080fd5b505afa1580156129f2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a169190614328565b6001600160a01b031663995031cd6040518163ffffffff1660e01b815260040160206040518083038186803b158015612a4e57600080fd5b505afa158015612a62573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a86919061438c565b612aa357604051639e0d93d560e01b815260040160405180910390fd5b6002546040516313f1e1f560e31b81526001600160a01b038d811660048301526000928392911690639f8f0fa89060240160206040518083038186803b158015612aec57600080fd5b505afa158015612b00573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b249190614328565b9050806001600160a01b031663a6afed956040518163ffffffff1660e01b8152600401600060405180830381600087803b158015612b6157600080fd5b505af1158015612b75573d6000803e3d6000fd5b50506040516370a0823160e01b81523360048201526001600160a01b03841692506370a08231915060240160206040518083038186803b158015612bb857600080fd5b505afa158015612bcc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bf091906143a7565b871115612c1057604051635de1e54160e01b815260040160405180910390fd5b612c18610a42565b91505060008b6001600160a01b0316639470b0bd338d6040518363ffffffff1660e01b8152600401612c4b9291906143ed565b6040805180830381600087803b158015612c6457600080fd5b505af1158015612c78573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c9c9190614406565b509050612cbc612caa61098d565b612cb38e613321565b8c848d876135aa565b9050612cce828b8f848c8c8c8c6137c6565b5050600180555050505050505050505050565b6000612ced600161394f565b90508015612d05576000805461ff0019166101001790555b6001600160a01b038216612d2c57604051633cb1fb1f60e11b815260040160405180910390fd5b612d346139dc565b612d3d82613a0d565b8015612d83576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050565b6001600160a01b03163b151590565b600081612da46002826145ed565b612db6670de0b6b3a76400008661460f565b612dc09190614515565b612dca91906145ed565b90505b92915050565b6040516370a0823160e01b815230600482015260009081906001600160a01b038616906370a082319060240160206040518083038186803b158015612e1757600080fd5b505afa158015612e2b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e4f91906143a7565b9050612e666001600160a01b038616853086613a7d565b6040516370a0823160e01b815230600482015281906001600160a01b038716906370a082319060240160206040518083038186803b158015612ea757600080fd5b505afa158015612ebb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612edf91906143a7565b612ee991906143d6565b9150505b9392505050565b60025460408051637556d1c160e11b815290516000926001600160a01b03169163eaada382916004808301926020929190829003018186803b158015612f3957600080fd5b505afa158015612f4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f719190614328565b6001600160a01b031663b64663848686612f9d87612f97670de0b6b3a7640000896143d6565b90613abb565b6040516001600160e01b031960e086901b1681526001600160a01b039384166004820152929091166024830152604482015260640160206040518083038186803b158015612fea57600080fd5b505afa158015612ffe573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061302291906143a7565b95945050505050565b6000613035613af3565b905060008060008089806020019051810190613051919061462e565b9350935093509350600061309a88888080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250613b5592505050565b505090506040518061014001604052808261ffff168152602001856001600160a01b031681526020018b6001600160a01b03168152602001866001600160a01b031681526020018e81526020018d81526020018a8152602001336001600160a01b031681526020016000151581526020018f6001600160a01b03168152506035600088815260200190815260200160002060008201518160000160006101000a81548161ffff021916908361ffff16021790555060208201518160000160026101000a8154816001600160a01b0302191690836001600160a01b0316021790555060408201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060608201518160020160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506080820151816003015560a0820151816004015560c0820151816005015560e08201518160060160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506101008201518160060160146101000a81548160ff0219169083151502179055506101208201518160070160006101000a8154816001600160a01b0302191690836001600160a01b031602179055509050505061327b610a42565b6001600160a01b03166339f648bf348733888888888f8f6040518a63ffffffff1660e01b81526004016132b5989796959493929190614676565b6000604051808303818588803b1580156132ce57600080fd5b505af11580156132e2573d6000803e3d6000fd5b50506040518893507f46a791deaa2c43990d6e3b60a320fbebef9a6677379f326b308fb9efc8128619925060009150a250505050505050505050505050565b6000816001600160a01b0316636f307dc36040518163ffffffff1660e01b815260040160206040518083038186803b15801561335c57600080fd5b505afa158015613370573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612dcd9190614328565b60006133a48686868686306135aa565b9695505050505050565b6000806000838060200190518101906133c791906146d5565b80519095506133e091508501602090810190860161479e565b9250925092509193909250565b8015806134765750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b15801561343c57600080fd5b505afa158015613450573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061347491906143a7565b155b6134e15760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b6064820152608401610542565b6135378363095ea7b360e01b84846040516024016135009291906143ed565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152613b6e565b505050565b6000808280602001905181019061355391906146d5565b805190945061356c9150840160209081019085016147e1565b91509150915091565b60008183106135845781612dca565b5090919050565b6135378363a9059cbb60e01b84846040516024016135009291906143ed565b6000846001600160a01b0316866001600160a01b031614613797576135da6001600160a01b0387168860006133ed565b6135ee6001600160a01b03871688866133ed565b6040516370a0823160e01b81526001600160a01b038381166004830152600091908716906370a082319060240160206040518083038186803b15801561363357600080fd5b505afa158015613647573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061366b91906143a7565b604051636ccb2b0160e01b81526001600160a01b03898116600483015288811660248301526044820188905260648201879052858116608483015291925090891690636ccb2b019060a401602060405180830381600087803b1580156136d057600080fd5b505af11580156136e4573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061370891906143a7565b506040516370a0823160e01b81526001600160a01b0384811660048301528291908816906370a082319060240160206040518083038186803b15801561374d57600080fd5b505afa158015613761573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061378591906143a7565b61378f91906143d6565b9150506133a4565b6001600160a01b03821630146137bb576137bb6001600160a01b038716838661358b565b509195945050505050565b60006137d0613af3565b9050600061381384848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250613b5592505050565b50506040805160a08101825261ffff80841682526001600160a01b03808d1660208085019182528486018c815233606087018181526000608089018181528d82526036909552899020975188549551871662010000026001600160b01b031990961697169690961793909317865551600186015592516002909401805493511515600160a01b026001600160a81b03199094169483169490941792909217909255915162bc9db960e01b81529293508c169162bc9db99134916138e69187918f908f908f908f908e908e90600401614676565b6000604051808303818588803b1580156138ff57600080fd5b505af1158015613913573d6000803e3d6000fd5b50506040518593507ff83a8331f3e68a894879f051738cb73cdced1709a214e49f6dc1d541a0415e8b925060009150a250505050505050505050565b60008054610100900460ff1615613996578160ff1660011480156139725750303b155b61398e5760405162461bcd60e51b81526004016105429061480f565b506000919050565b60005460ff8084169116106139bd5760405162461bcd60e51b81526004016105429061480f565b506000805460ff191660ff92909216919091179055600190565b919050565b600054610100900460ff16613a035760405162461bcd60e51b81526004016105429061485d565b613a0b613c40565b565b600054610100900460ff16613a345760405162461bcd60e51b81526004016105429061485d565b6001600160a01b038116613a5b5760405163724f500960e01b815260040160405180910390fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6040516001600160a01b0380851660248301528316604482015260648101829052613ab59085906323b872dd60e01b90608401613500565b50505050565b6000821580613ac8575081155b15613ad557506000612dcd565b670de0b6b3a7640000613ae96002826145ed565b612db6848661460f565b60004630603460008154613b06906148a8565b9182905550604051613b37939291906020019283526001600160a01b03919091166020830152604082015260600190565b6040516020818303038152906040528051906020012060001c905090565b6000806000838060200190518101906133e091906148c3565b6000613bc3826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316613c6d9092919063ffffffff16565b8051909150156135375780806020019051810190613be1919061438c565b6135375760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610542565b600054610100900460ff16613c675760405162461bcd60e51b81526004016105429061485d565b60018055565b6060613c7c8484600085613c84565b949350505050565b606082471015613ce55760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610542565b6001600160a01b0385163b613d3c5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610542565b600080866001600160a01b03168587604051613d589190614906565b60006040518083038185875af1925050503d8060008114613d95576040519150601f19603f3d011682016040523d82523d6000602084013e613d9a565b606091505b5091509150613daa828286613db5565b979650505050505050565b60608315613dc4575081612eed565b825115613dd45782518084602001fd5b8160405162461bcd60e51b81526004016105429190614315565b6001600160a01b0381168114613e0357600080fd5b50565b60008083601f840112613e1857600080fd5b50813567ffffffffffffffff811115613e3057600080fd5b602083019150836020828501011115613e4857600080fd5b9250929050565b6000806000806000806000806000806101208b8d031215613e6f57600080fd5b8a35613e7a81613dee565b995060208b0135613e8a81613dee565b985060408b0135613e9a81613dee565b975060608b0135613eaa81613dee565b965060808b0135955060a08b0135945060c08b0135935060e08b013592506101008b013567ffffffffffffffff811115613ee357600080fd5b613eef8d828e01613e06565b915080935050809150509295989b9194979a5092959850565b60008060008060808587031215613f1e57600080fd5b8435613f2981613dee565b93506020850135613f3981613dee565b93969395505050506040820135916060013590565b60008060008060008060008060006101008a8c031215613f6d57600080fd5b8935613f7881613dee565b985060208a0135613f8881613dee565b975060408a0135613f9881613dee565b965060608a0135955060808a0135945060a08a0135935060c08a0135925060e08a013567ffffffffffffffff811115613fd057600080fd5b613fdc8c828d01613e06565b915080935050809150509295985092959850929598565b61ffff81168114613e0357600080fd5b67ffffffffffffffff81168114613e0357600080fd5b60008060008060008060008060c0898b03121561403557600080fd5b883561404081613ff3565b9750602089013567ffffffffffffffff8082111561405d57600080fd5b6140698c838d01613e06565b909950975060408b0135915061407e82614003565b90955060608a0135945060808a0135908082111561409b57600080fd5b506140a88b828c01613e06565b999c989b50969995989497949560a00135949350505050565b60008060008060008060c087890312156140da57600080fd5b86356140e581613dee565b955060208701356140f581613dee565b9450604087013561410581613dee565b959894975094956060810135955060808101359460a0909101359350915050565b600080600080600080600080600060e08a8c03121561414457600080fd5b893561414f81613ff3565b985060208a013567ffffffffffffffff8082111561416c57600080fd5b6141788d838e01613e06565b909a50985060408c0135915061418d82614003565b90965060608b01359061419f82613dee565b90955060808b0135945060a08b013590808211156141bc57600080fd5b506141c98c828d01613e06565b9a9d999c50979a9699959894979660c00135949350505050565b600080604083850312156141f657600080fd5b50508035926020909101359150565b60006020828403121561421757600080fd5b5035919050565b60008060008060008060008060006101008a8c03121561423d57600080fd5b893561424881613dee565b985060208a013561425881613dee565b975060408a0135965060608a013561426f81613dee565b955060808a0135945060a08a0135935060c08a0135925060e08a013567ffffffffffffffff811115613fd057600080fd5b6000602082840312156142b257600080fd5b8135612eed81613dee565b60005b838110156142d85781810151838201526020016142c0565b83811115613ab55750506000910152565b600081518084526143018160208601602086016142bd565b601f01601f19169290920160200192915050565b602081526000612dca60208301846142e9565b60006020828403121561433a57600080fd5b8151612eed81613dee565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b805180151581146139d757600080fd5b60006020828403121561439e57600080fd5b612dca8261437c565b6000602082840312156143b957600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b6000828210156143e8576143e86143c0565b500390565b6001600160a01b03929092168252602082015260400190565b6000806040838503121561441957600080fd5b505080516020909101519092909150565b600080600080600060a0868803121561444257600080fd5b61444b8661437c565b602087015160408801516060890151608090990151929a91995097965090945092505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b61ffff8a16815260e0602082015260006144b860e083018a8c614471565b67ffffffffffffffff8916604084015282810360608401526144da81896142e9565b6001600160a01b038816608085015260a0840187905283810360c08501529050614505818587614471565b9c9b505050505050505050505050565b60008219821115614528576145286143c0565b500190565b61ffff8816815260c06020820152600061454a60c08301896142e9565b67ffffffffffffffff881660408401526001600160a01b03871660608401526080830186905282810360a0840152614583818587614471565b9a9950505050505050505050565b61ffff8716815260a0602082015260006145af60a083018789614471565b67ffffffffffffffff861660408401526001600160a01b038516606084015282810360808401526145e081856142e9565b9998505050505050505050565b60008261460a57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615614629576146296143c0565b500290565b6000806000806080858703121561464457600080fd5b845161464f81613dee565b602086015190945061466081613dee565b6040860151606090960151949790965092505050565b8881526001600160a01b0388811660208301528781166040830152861660608201526080810185905260a0810184905260e060c082018190526000906145839083018486614471565b634e487b7160e01b600052604160045260246000fd5b600080604083850312156146e857600080fd5b825160ff811681146146f957600080fd5b602084015190925067ffffffffffffffff8082111561471757600080fd5b818501915085601f83011261472b57600080fd5b81518181111561473d5761473d6146bf565b604051601f8201601f19908116603f01168101908382118183101715614765576147656146bf565b8160405282815288602084870101111561477e57600080fd5b61478f8360208301602088016142bd565b80955050505050509250929050565b6000806000606084860312156147b357600080fd5b83516147be81613dee565b60208501519093506147cf81613dee565b80925050604084015190509250925092565b600080604083850312156147f457600080fd5b82516147ff81613dee565b6020939093015192949293505050565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60006000198214156148bc576148bc6143c0565b5060010190565b6000806000606084860312156148d857600080fd5b83516148e381613ff3565b6020850151604086015191945092506148fb81614003565b809150509250925092565b600082516149188184602087016142bd565b919091019291505056fea2646970667358221220999a51eea1c92569334064d2a38a22fd3865d8effb2083d8a4d64e433beb715664736f6c63430008090033496e697469616c697a61626c653a20636f6e747261637420697320616c726561", + "deployedBytecode": "0x6080604052600436106101095760003560e01c8063583bfe761161009557806399e5e6551161006457806399e5e6551461037b5780639b6623d814610416578063c35576911461042c578063c4d66de81461043f578063ffa1ad741461045f57600080fd5b8063583bfe76146102275780636455bf6f146102475780638056777414610275578063823185611461029557600080fd5b806332c615b4116100dc57806332c615b41461018a578063364fda001461019f57806339c9a98e146101d45780633bb1f3d0146101e75780634d7e9a761461020757600080fd5b80630c340a241461010e57806316f0115b14610140578063196e7f51146101605780632b3297f914610175575b600080fd5b34801561011a57600080fd5b5061012361049d565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561014c57600080fd5b50600254610123906001600160a01b031681565b61017361016e366004613e4f565b61051f565b005b34801561018157600080fd5b5061012361098d565b34801561019657600080fd5b50610123610a42565b3480156101ab57600080fd5b506101bf6101ba366004613f08565b610af7565b60408051928352602083019190915201610137565b6101736101e2366004613f4e565b61111c565b3480156101f357600080fd5b50610173610202366004614019565b611151565b34801561021357600080fd5b506101bf6102223660046140c1565b611429565b34801561023357600080fd5b50610173610242366004614126565b611abd565b34801561025357600080fd5b506102676102623660046141e3565b611e1c565b604051908152602001610137565b34801561028157600080fd5b506102676102903660046141e3565b6122a0565b3480156102a157600080fd5b506103196102b0366004614205565b6035602052600090815260409020805460018201546002830154600384015460048501546005860154600687015460079097015461ffff871697620100009097046001600160a01b0390811697968116969581169581811692600160a01b90910460ff1691168a565b6040805161ffff909b168b526001600160a01b03998a1660208c0152978916978a01979097529487166060890152608088019390935260a087019190915260c0860152831660e085015215156101008401521661012082015261014001610137565b34801561038757600080fd5b506103dc610396366004614205565b60366020526000908152604090208054600182015460029092015461ffff821692620100009092046001600160a01b03908116929190811690600160a01b900460ff1685565b6040805161ffff90961686526001600160a01b0394851660208701528501929092529190911660608301521515608082015260a001610137565b34801561042257600080fd5b5061026760345481565b61017361043a36600461421e565b612816565b34801561044b57600080fd5b5061017361045a3660046142a0565b612ce1565b34801561046b57600080fd5b50610490604051806040016040528060058152602001640312e332e360dc1b81525081565b6040516101379190614315565b6002546040805163030d028960e21b815290516000926001600160a01b031691630c340a24916004808301926020929190829003018186803b1580156104e257600080fd5b505afa1580156104f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061051a9190614328565b905090565b6002600154141561054b5760405162461bcd60e51b815260040161054290614345565b60405180910390fd5b6002600181905554604051633e25dee160e21b81526001600160a01b03808a1660048301528992169063f8977b849060240160206040518083038186803b15801561059557600080fd5b505afa1580156105a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105cd919061438c565b6105ea5760405163a67d528360e01b815260040160405180910390fd5b600254604051631a0dd00b60e01b81526001600160a01b03808d1660048301528c921690631a0dd00b9060240160206040518083038186803b15801561062f57600080fd5b505afa158015610643573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610667919061438c565b6106845760405163a596698b60e01b815260040160405180910390fd5b8b886106a3576040516310eb483f60e21b815260040160405180910390fd5b670de0b6b3a764000088116106cb57604051631907e1ff60e21b815260040160405180910390fd5b6107608a6001600160a01b031663df011c416040518163ffffffff1660e01b815260040160206040518083038186803b15801561070757600080fd5b505afa15801561071b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061073f91906143a7565b61075190670de0b6b3a76400006143d6565b670de0b6b3a764000090612d96565b88111561078057604051630a4f5a0760e01b815260040160405180910390fd5b6001600160a01b0381166107a757604051634f70ad6b60e01b815260040160405180910390fd5b6001600160a01b038b166107ce57604051633a8b51a760e01b815260040160405180910390fd5b6000806107dc83338d612dd3565b9a506107ea838f8d8d612ef4565b9150600260009054906101000a90046001600160a01b03166001600160a01b0316639f8f0fa88f6040518263ffffffff1660e01b815260040161083c91906001600160a01b0391909116815260200190565b60206040518083038186803b15801561085457600080fd5b505afa158015610868573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061088c9190614328565b6001600160a01b031663bfa176566108a2610a42565b846040518363ffffffff1660e01b81526004016108c09291906143ed565b6040805180830381600087803b1580156108d957600080fd5b505af11580156108ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109119190614406565b508091505060008e8e838c60405160200161095394939291906001600160a01b0394851681529290931660208301526040820152606081019190915260800190565b60408051601f1981840301815291905290508c610976858e8685858f8f8f61302b565b505060018055505050505050505050505050505050565b6002546040805163afcff50f60e01b815290516000926001600160a01b03169163afcff50f916004808301926020929190829003018186803b1580156109d257600080fd5b505afa1580156109e6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a0a9190614328565b6001600160a01b0316632b3297f96040518163ffffffff1660e01b815260040160206040518083038186803b1580156104e257600080fd5b6002546040805163afcff50f60e01b815290516000926001600160a01b03169163afcff50f916004808301926020929190829003018186803b158015610a8757600080fd5b505afa158015610a9b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610abf9190614328565b6001600160a01b03166332c615b46040518163ffffffff1660e01b815260040160206040518083038186803b1580156104e257600080fd5b600080600260009054906101000a90046001600160a01b03166001600160a01b031663ecf3a3f96040518163ffffffff1660e01b815260040160206040518083038186803b158015610b4857600080fd5b505afa158015610b5c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b80919061438c565b15610b9e57604051631b0e923f60e11b815260040160405180910390fd5b60026001541415610bc15760405162461bcd60e51b815260040161054290614345565b6002600181905554604051633e25dee160e21b81526001600160a01b0380881660048301528792169063f8977b849060240160206040518083038186803b158015610c0b57600080fd5b505afa158015610c1f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c43919061438c565b610c605760405163a67d528360e01b815260040160405180910390fd5b600254604051631a0dd00b60e01b81526001600160a01b03808a16600483015289921690631a0dd00b9060240160206040518083038186803b158015610ca557600080fd5b505afa158015610cb9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cdd919061438c565b610cfa5760405163a596698b60e01b815260040160405180910390fd5b85610d18576040516310eb483f60e21b815260040160405180910390fd5b6040516370a0823160e01b81523360048201526001600160a01b038816906370a082319060240160206040518083038186803b158015610d5757600080fd5b505afa158015610d6b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d8f91906143a7565b861115610daf57604051635de1e54160e01b815260040160405180910390fd5b6002546040516313f1e1f560e31b81526001600160a01b038a81166004830152909116906000908290639f8f0fa89060240160206040518083038186803b158015610df957600080fd5b505afa158015610e0d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e319190614328565b6040516370a0823160e01b81523360048201529091506001600160a01b038216906370a082319060240160206040518083038186803b158015610e7357600080fd5b505afa158015610e87573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eab91906143a7565b871115610ecb57604051635de1e54160e01b815260040160405180910390fd5b6040516336e1668760e11b81526001600160a01b038a1690636dc2cd0e90610ef99033908c906004016143ed565b6040805180830381600087803b158015610f1257600080fd5b505af1158015610f26573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f4a9190614406565b5095506000610f6c610f5a61098d565b610f638c613321565b8d8a6000613394565b604051630450cfaf60e31b81529091506001600160a01b038316906322867d7890610f9d90339085906004016143ed565b6040805180830381600087803b158015610fb657600080fd5b505af1158015610fca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fee9190614406565b5095508786101561101257604051634394bddf60e11b815260040160405180910390fd5b60405163dde3ab9560e01b81523360048201526000906001600160a01b0385169063dde3ab959060240160a06040518083038186803b15801561105457600080fd5b505afa158015611068573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061108c919061442a565b505050509050806110b05760405163cfd3600360e01b815260040160405180910390fd5b8a6001600160a01b03168c6001600160a01b03167f70e2337c0939e469d0c3d069c581bc0b72c541a70c592cdd46087d24e5e980d28a8a6040516110fe929190918252602082015260400190565b60405180910390a35050505050506001808190555094509492505050565b60405162461bcd60e51b815260206004820152600a60248201526919195c1c9958d85d195960b21b6044820152606401610542565b600061119284848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506133ae92505050565b600081815260366020908152604091829020825160a081018452815461ffff811682526201000090046001600160a01b03908116938201939093526001820154938101939093526002015490811660608301819052600160a01b90910460ff161515608083015291945092501515905061121f576040516311bf899560e21b815260040160405180910390fd5b80608001511561124257604051630814de4560e11b815260040160405180910390fd5b80606001516001600160a01b0316336001600160a01b031614156112755760008281526036602052604090206001018390555b600061127f610a42565b60405163dfda255f60e01b815261ffff8d1660048201529091506000906001600160a01b0383169063dfda255f9060240160206040518083038186803b1580156112c857600080fd5b505afa1580156112dc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113009190614328565b604051602001611328919060609190911b6bffffffffffffffffffffffff1916815260140190565b604051602081830303815290604052905082602001516001600160a01b0316636d1bb8f76040518163ffffffff1660e01b815260040160206040518083038186803b15801561137657600080fd5b505afa15801561138a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ae9190614328565b6001600160a01b031663cfd6528e8d8d8d8d86888f8f8f6040518a63ffffffff1660e01b81526004016113e99998979695949392919061449a565b600060405180830381600087803b15801561140357600080fd5b505af1158015611417573d6000803e3d6000fd5b50505050505050505050505050505050565b600080600260009054906101000a90046001600160a01b03166001600160a01b031663ecf3a3f96040518163ffffffff1660e01b815260040160206040518083038186803b15801561147a57600080fd5b505afa15801561148e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114b2919061438c565b156114d057604051631b0e923f60e11b815260040160405180910390fd5b600260015414156114f35760405162461bcd60e51b815260040161054290614345565b6002600181905554604051633e25dee160e21b81526001600160a01b03808a1660048301528992169063f8977b849060240160206040518083038186803b15801561153d57600080fd5b505afa158015611551573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611575919061438c565b6115925760405163a67d528360e01b815260040160405180910390fd5b600254604051631a0dd00b60e01b81526001600160a01b03808a16600483015289921690631a0dd00b9060240160206040518083038186803b1580156115d757600080fd5b505afa1580156115eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061160f919061438c565b61162c5760405163a596698b60e01b815260040160405180910390fd5b8661164a576040516310eb483f60e21b815260040160405180910390fd5b670de0b6b3a7640000861161167257604051631907e1ff60e21b815260040160405180910390fd5b6116ae896001600160a01b031663df011c416040518163ffffffff1660e01b815260040160206040518083038186803b15801561070757600080fd5b8611156116ce57604051630a4f5a0760e01b815260040160405180910390fd5b60006116d861098d565b905060006116e58b613321565b90506001600160a01b038c166116f957809b505b6117048c338b612dd3565b9850806001600160a01b03168c6001600160a01b0316146117305761172d828d838c6000613394565b98505b600061173e828c8c8c612ef4565b6002546040516313f1e1f560e31b81526001600160a01b038e8116600483015292935060009290911690639f8f0fa89060240160206040518083038186803b15801561178957600080fd5b505afa15801561179d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117c19190614328565b604051635fd0bb2b60e11b81529091506001600160a01b0382169063bfa17656906117f290309086906004016143ed565b6040805180830381600087803b15801561180b57600080fd5b505af115801561181f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118439190614406565b506040516340c10f1960e01b81529097506001600160a01b038216906340c10f199061187590339086906004016143ed565b600060405180830381600087803b15801561188f57600080fd5b505af11580156118a3573d6000803e3d6000fd5b50505050505060006118b9838c84896000613394565b6118c3908b614515565b9050878110156118e65760405163c724afdf60e01b815260040160405180910390fd5b6118fb6001600160a01b0383168d60006133ed565b61190f6001600160a01b0383168d836133ed565b604051636e553f6560e01b8152600481018290523360248201526001600160a01b038d1690636e553f65906044016040805180830381600087803b15801561195657600080fd5b505af115801561196a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061198e9190614406565b5060025460405163dde3ab9560e01b81523360048201529198506000916001600160a01b039091169063dde3ab959060240160a06040518083038186803b1580156119d857600080fd5b505afa1580156119ec573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a10919061442a565b50505050905080611a345760405163cfd3600360e01b815260040160405180910390fd5b8b6001600160a01b03168d6001600160a01b03168f6001600160a01b03167fd82c156e929db20771fc8413cc0789925f6c666a3e5076d5844765ee28bb3a958d8f8c8e604051611a9d949392919093845260208401929092526040830152606082015260800190565b60405180910390a450505050505060018081905550965096945050505050565b6000611afe84848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061353c92505050565b600081815260356020908152604091829020825161014081018452815461ffff811682526201000090046001600160a01b0390811693820193909352600182015483169381019390935260028101548216606084015260038101546080840152600481015460a0840152600581015460c0840152600681015480831660e08501819052600160a01b90910460ff1615156101008501526007909101549091166101208301529193509150611bc5576040516311bf899560e21b815260040160405180910390fd5b80610100015115611be957604051630814de4560e11b815260040160405180910390fd5b8060e001516001600160a01b0316336001600160a01b03161415611c1c5760008281526035602052604090206005018390555b6000611c26610a42565b60405163dfda255f60e01b815261ffff8e1660048201529091506000906001600160a01b0383169063dfda255f9060240160206040518083038186803b158015611c6f57600080fd5b505afa158015611c83573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ca79190614328565b6040516bffffffffffffffffffffffff19606083901b16602082015290915060009063ab8236f360e01b908f9060340160408051601f1981840301815290829052611cff92918f908f908f908f908f9060240161452d565b604051602081830303815290604052906001600160e01b0319166020820180516001600160e01b0383818316178352505050509050826001600160a01b0316633352b6086040518163ffffffff1660e01b815260040160206040518083038186803b158015611d6d57600080fd5b505afa158015611d81573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611da59190614328565b6001600160a01b031663c0e6ac6c8f8f8f8f88876040518763ffffffff1660e01b8152600401611dda96959493929190614591565b600060405180830381600087803b158015611df457600080fd5b505af1158015611e08573d6000803e3d6000fd5b505050505050505050505050505050505050565b6002546040805163ecf3a3f960e01b815290516000926001600160a01b03169163ecf3a3f9916004808301926020929190829003018186803b158015611e6157600080fd5b505afa158015611e75573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e99919061438c565b15611eb757604051631b0e923f60e11b815260040160405180910390fd5b60026001541415611eda5760405162461bcd60e51b815260040161054290614345565b6002600155611ee7610a42565b6001600160a01b0316336001600160a01b031614611f1857604051632b78ce1b60e11b815260040160405180910390fd5b600083815260366020908152604091829020825160a081018452815461ffff811682526201000090046001600160a01b03908116938201939093526001820154938101939093526002015490811660608301819052600160a01b90910460ff1615156080830152611f9c576040516311bf899560e21b815260040160405180910390fd5b806080015115611fbf57604051630814de4560e11b815260040160405180910390fd5b6000848152603660209081526040909120600201805460ff60a01b1916600160a01b179055810151611ff2903385612dd3565b60025460208301516040516313f1e1f560e31b81526001600160a01b039182166004820152929550600092911690639f8f0fa89060240160206040518083038186803b15801561204157600080fd5b505afa158015612055573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120799190614328565b60608301516040516370a0823160e01b81526001600160a01b0391821660048201529192506000919083169063c9dc4b4d9082906370a082319060240160206040518083038186803b1580156120ce57600080fd5b505afa1580156120e2573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061210691906143a7565b6040518263ffffffff1660e01b815260040161212491815260200190565b604080518083038186803b15801561213b57600080fd5b505afa15801561214f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121739190614406565b50905060006121828683613575565b90508015612211576060840151604051630450cfaf60e31b81526001600160a01b038516916322867d78916121bc919085906004016143ed565b6040805180830381600087803b1580156121d557600080fd5b505af11580156121e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061220d9190614406565b5094505b836040015185101561223657604051634394bddf60e11b815260040160405180910390fd5b808611156122665760608401516122669061225183896143d6565b60208701516001600160a01b0316919061358b565b60405187907f46da7fdc7ceed834de258df19d8f9ebd7082810a4eb45732d1401df31e5aaa1390600090a250506001805550909392505050565b6002546040805163ecf3a3f960e01b815290516000926001600160a01b03169163ecf3a3f9916004808301926020929190829003018186803b1580156122e557600080fd5b505afa1580156122f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061231d919061438c565b1561233b57604051631b0e923f60e11b815260040160405180910390fd5b6002600154141561235e5760405162461bcd60e51b815260040161054290614345565b600260015561236b610a42565b6001600160a01b0316336001600160a01b03161461239c57604051632b78ce1b60e11b815260040160405180910390fd5b600083815260356020908152604091829020825161014081018452815461ffff811682526201000090046001600160a01b0390811693820193909352600182015483169381019390935260028101548216606084015260038101546080840152600481015460a0840152600581015460c0840152600681015480831660e08501819052600160a01b90910460ff16151561010085015260079091015490911661012083015261245e576040516311bf899560e21b815260040160405180910390fd5b8061010001511561248257604051630814de4560e11b815260040160405180910390fd5b60006124918260400151613321565b6000868152603560209081526040909120600601805460ff60a01b1916600160a01b1790558301519091506124c7903386612dd3565b9350600082602001516001600160a01b03168361012001516001600160a01b0316141561251e576125176124f961098d565b846101200151848887608001516125109190614515565b6000613394565b9050612564565b61253c61252961098d565b8461012001518486608001516000613394565b905061255761254961098d565b846020015184886000613394565b6125619082614515565b90505b8260c001518110156125895760405163c724afdf60e01b815260040160405180910390fd5b60408301516125a4906001600160a01b0384169060006133ed565b60408301516125be906001600160a01b03841690836133ed565b60408084015160e08501519151636e553f6560e01b8152600481018490526001600160a01b039283166024820152911690636e553f65906044016040805180830381600087803b15801561261157600080fd5b505af1158015612625573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126499190614406565b5060025460608501516040516313f1e1f560e31b81526001600160a01b03918216600482015292965016908190639f8f0fa89060240160206040518083038186803b15801561269757600080fd5b505afa1580156126ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126cf9190614328565b6001600160a01b03166340c10f198560e001518660a001516040518363ffffffff1660e01b81526004016127049291906143ed565b600060405180830381600087803b15801561271e57600080fd5b505af1158015612732573d6000803e3d6000fd5b5050505060e084015160405163dde3ab9560e01b81526001600160a01b03918216600482015260009183169063dde3ab959060240160a06040518083038186803b15801561277f57600080fd5b505afa158015612793573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127b7919061442a565b505050509050806127db5760405163cfd3600360e01b815260040160405180910390fd5b60405188907f8e4ff8e32fb3b90b184bdac5bf0d9b2a0fe19baa9dfea95c0fcd7d8e3842e80e90600090a25050600180555091949350505050565b600260015414156128395760405162461bcd60e51b815260040161054290614345565b6002600181905554604051633e25dee160e21b81526001600160a01b03808b1660048301528a92169063f8977b849060240160206040518083038186803b15801561288357600080fd5b505afa158015612897573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128bb919061438c565b6128d85760405163a67d528360e01b815260040160405180910390fd5b600254604051631a0dd00b60e01b81526001600160a01b03808d1660048301528c921690631a0dd00b9060240160206040518083038186803b15801561291d57600080fd5b505afa158015612931573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612955919061438c565b6129725760405163a596698b60e01b815260040160405180910390fd5b88612990576040516310eb483f60e21b815260040160405180910390fd5b600260009054906101000a90046001600160a01b03166001600160a01b031663afcff50f6040518163ffffffff1660e01b815260040160206040518083038186803b1580156129de57600080fd5b505afa1580156129f2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a169190614328565b6001600160a01b031663995031cd6040518163ffffffff1660e01b815260040160206040518083038186803b158015612a4e57600080fd5b505afa158015612a62573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a86919061438c565b612aa357604051639e0d93d560e01b815260040160405180910390fd5b6002546040516313f1e1f560e31b81526001600160a01b038d811660048301526000928392911690639f8f0fa89060240160206040518083038186803b158015612aec57600080fd5b505afa158015612b00573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b249190614328565b9050806001600160a01b031663a6afed956040518163ffffffff1660e01b8152600401600060405180830381600087803b158015612b6157600080fd5b505af1158015612b75573d6000803e3d6000fd5b50506040516370a0823160e01b81523360048201526001600160a01b03841692506370a08231915060240160206040518083038186803b158015612bb857600080fd5b505afa158015612bcc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bf091906143a7565b871115612c1057604051635de1e54160e01b815260040160405180910390fd5b612c18610a42565b91505060008b6001600160a01b0316639470b0bd338d6040518363ffffffff1660e01b8152600401612c4b9291906143ed565b6040805180830381600087803b158015612c6457600080fd5b505af1158015612c78573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c9c9190614406565b509050612cbc612caa61098d565b612cb38e613321565b8c848d876135aa565b9050612cce828b8f848c8c8c8c6137c6565b5050600180555050505050505050505050565b6000612ced600161394f565b90508015612d05576000805461ff0019166101001790555b6001600160a01b038216612d2c57604051633cb1fb1f60e11b815260040160405180910390fd5b612d346139dc565b612d3d82613a0d565b8015612d83576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050565b6001600160a01b03163b151590565b600081612da46002826145ed565b612db6670de0b6b3a76400008661460f565b612dc09190614515565b612dca91906145ed565b90505b92915050565b6040516370a0823160e01b815230600482015260009081906001600160a01b038616906370a082319060240160206040518083038186803b158015612e1757600080fd5b505afa158015612e2b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e4f91906143a7565b9050612e666001600160a01b038616853086613a7d565b6040516370a0823160e01b815230600482015281906001600160a01b038716906370a082319060240160206040518083038186803b158015612ea757600080fd5b505afa158015612ebb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612edf91906143a7565b612ee991906143d6565b9150505b9392505050565b60025460408051637556d1c160e11b815290516000926001600160a01b03169163eaada382916004808301926020929190829003018186803b158015612f3957600080fd5b505afa158015612f4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f719190614328565b6001600160a01b031663b64663848686612f9d87612f97670de0b6b3a7640000896143d6565b90613abb565b6040516001600160e01b031960e086901b1681526001600160a01b039384166004820152929091166024830152604482015260640160206040518083038186803b158015612fea57600080fd5b505afa158015612ffe573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061302291906143a7565b95945050505050565b6000613035613af3565b905060008060008089806020019051810190613051919061462e565b9350935093509350600061309a88888080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250613b5592505050565b505090506040518061014001604052808261ffff168152602001856001600160a01b031681526020018b6001600160a01b03168152602001866001600160a01b031681526020018e81526020018d81526020018a8152602001336001600160a01b031681526020016000151581526020018f6001600160a01b03168152506035600088815260200190815260200160002060008201518160000160006101000a81548161ffff021916908361ffff16021790555060208201518160000160026101000a8154816001600160a01b0302191690836001600160a01b0316021790555060408201518160010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060608201518160020160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506080820151816003015560a0820151816004015560c0820151816005015560e08201518160060160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506101008201518160060160146101000a81548160ff0219169083151502179055506101208201518160070160006101000a8154816001600160a01b0302191690836001600160a01b031602179055509050505061327b610a42565b6001600160a01b03166339f648bf348733888888888f8f6040518a63ffffffff1660e01b81526004016132b5989796959493929190614676565b6000604051808303818588803b1580156132ce57600080fd5b505af11580156132e2573d6000803e3d6000fd5b50506040518893507f46a791deaa2c43990d6e3b60a320fbebef9a6677379f326b308fb9efc8128619925060009150a250505050505050505050505050565b6000816001600160a01b0316636f307dc36040518163ffffffff1660e01b815260040160206040518083038186803b15801561335c57600080fd5b505afa158015613370573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612dcd9190614328565b60006133a48686868686306135aa565b9695505050505050565b6000806000838060200190518101906133c791906146d5565b80519095506133e091508501602090810190860161479e565b9250925092509193909250565b8015806134765750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b15801561343c57600080fd5b505afa158015613450573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061347491906143a7565b155b6134e15760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b6064820152608401610542565b6135378363095ea7b360e01b84846040516024016135009291906143ed565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152613b6e565b505050565b6000808280602001905181019061355391906146d5565b805190945061356c9150840160209081019085016147e1565b91509150915091565b60008183106135845781612dca565b5090919050565b6135378363a9059cbb60e01b84846040516024016135009291906143ed565b6000846001600160a01b0316866001600160a01b031614613797576135da6001600160a01b0387168860006133ed565b6135ee6001600160a01b03871688866133ed565b6040516370a0823160e01b81526001600160a01b038381166004830152600091908716906370a082319060240160206040518083038186803b15801561363357600080fd5b505afa158015613647573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061366b91906143a7565b604051636ccb2b0160e01b81526001600160a01b03898116600483015288811660248301526044820188905260648201879052858116608483015291925090891690636ccb2b019060a401602060405180830381600087803b1580156136d057600080fd5b505af11580156136e4573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061370891906143a7565b506040516370a0823160e01b81526001600160a01b0384811660048301528291908816906370a082319060240160206040518083038186803b15801561374d57600080fd5b505afa158015613761573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061378591906143a7565b61378f91906143d6565b9150506133a4565b6001600160a01b03821630146137bb576137bb6001600160a01b038716838661358b565b509195945050505050565b60006137d0613af3565b9050600061381384848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250613b5592505050565b50506040805160a08101825261ffff80841682526001600160a01b03808d1660208085019182528486018c815233606087018181526000608089018181528d82526036909552899020975188549551871662010000026001600160b01b031990961697169690961793909317865551600186015592516002909401805493511515600160a01b026001600160a81b03199094169483169490941792909217909255915162bc9db960e01b81529293508c169162bc9db99134916138e69187918f908f908f908f908e908e90600401614676565b6000604051808303818588803b1580156138ff57600080fd5b505af1158015613913573d6000803e3d6000fd5b50506040518593507ff83a8331f3e68a894879f051738cb73cdced1709a214e49f6dc1d541a0415e8b925060009150a250505050505050505050565b60008054610100900460ff1615613996578160ff1660011480156139725750303b155b61398e5760405162461bcd60e51b81526004016105429061480f565b506000919050565b60005460ff8084169116106139bd5760405162461bcd60e51b81526004016105429061480f565b506000805460ff191660ff92909216919091179055600190565b919050565b600054610100900460ff16613a035760405162461bcd60e51b81526004016105429061485d565b613a0b613c40565b565b600054610100900460ff16613a345760405162461bcd60e51b81526004016105429061485d565b6001600160a01b038116613a5b5760405163724f500960e01b815260040160405180910390fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6040516001600160a01b0380851660248301528316604482015260648101829052613ab59085906323b872dd60e01b90608401613500565b50505050565b6000821580613ac8575081155b15613ad557506000612dcd565b670de0b6b3a7640000613ae96002826145ed565b612db6848661460f565b60004630603460008154613b06906148a8565b9182905550604051613b37939291906020019283526001600160a01b03919091166020830152604082015260600190565b6040516020818303038152906040528051906020012060001c905090565b6000806000838060200190518101906133e091906148c3565b6000613bc3826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316613c6d9092919063ffffffff16565b8051909150156135375780806020019051810190613be1919061438c565b6135375760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610542565b600054610100900460ff16613c675760405162461bcd60e51b81526004016105429061485d565b60018055565b6060613c7c8484600085613c84565b949350505050565b606082471015613ce55760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610542565b6001600160a01b0385163b613d3c5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610542565b600080866001600160a01b03168587604051613d589190614906565b60006040518083038185875af1925050503d8060008114613d95576040519150601f19603f3d011682016040523d82523d6000602084013e613d9a565b606091505b5091509150613daa828286613db5565b979650505050505050565b60608315613dc4575081612eed565b825115613dd45782518084602001fd5b8160405162461bcd60e51b81526004016105429190614315565b6001600160a01b0381168114613e0357600080fd5b50565b60008083601f840112613e1857600080fd5b50813567ffffffffffffffff811115613e3057600080fd5b602083019150836020828501011115613e4857600080fd5b9250929050565b6000806000806000806000806000806101208b8d031215613e6f57600080fd5b8a35613e7a81613dee565b995060208b0135613e8a81613dee565b985060408b0135613e9a81613dee565b975060608b0135613eaa81613dee565b965060808b0135955060a08b0135945060c08b0135935060e08b013592506101008b013567ffffffffffffffff811115613ee357600080fd5b613eef8d828e01613e06565b915080935050809150509295989b9194979a5092959850565b60008060008060808587031215613f1e57600080fd5b8435613f2981613dee565b93506020850135613f3981613dee565b93969395505050506040820135916060013590565b60008060008060008060008060006101008a8c031215613f6d57600080fd5b8935613f7881613dee565b985060208a0135613f8881613dee565b975060408a0135613f9881613dee565b965060608a0135955060808a0135945060a08a0135935060c08a0135925060e08a013567ffffffffffffffff811115613fd057600080fd5b613fdc8c828d01613e06565b915080935050809150509295985092959850929598565b61ffff81168114613e0357600080fd5b67ffffffffffffffff81168114613e0357600080fd5b60008060008060008060008060c0898b03121561403557600080fd5b883561404081613ff3565b9750602089013567ffffffffffffffff8082111561405d57600080fd5b6140698c838d01613e06565b909950975060408b0135915061407e82614003565b90955060608a0135945060808a0135908082111561409b57600080fd5b506140a88b828c01613e06565b999c989b50969995989497949560a00135949350505050565b60008060008060008060c087890312156140da57600080fd5b86356140e581613dee565b955060208701356140f581613dee565b9450604087013561410581613dee565b959894975094956060810135955060808101359460a0909101359350915050565b600080600080600080600080600060e08a8c03121561414457600080fd5b893561414f81613ff3565b985060208a013567ffffffffffffffff8082111561416c57600080fd5b6141788d838e01613e06565b909a50985060408c0135915061418d82614003565b90965060608b01359061419f82613dee565b90955060808b0135945060a08b013590808211156141bc57600080fd5b506141c98c828d01613e06565b9a9d999c50979a9699959894979660c00135949350505050565b600080604083850312156141f657600080fd5b50508035926020909101359150565b60006020828403121561421757600080fd5b5035919050565b60008060008060008060008060006101008a8c03121561423d57600080fd5b893561424881613dee565b985060208a013561425881613dee565b975060408a0135965060608a013561426f81613dee565b955060808a0135945060a08a0135935060c08a0135925060e08a013567ffffffffffffffff811115613fd057600080fd5b6000602082840312156142b257600080fd5b8135612eed81613dee565b60005b838110156142d85781810151838201526020016142c0565b83811115613ab55750506000910152565b600081518084526143018160208601602086016142bd565b601f01601f19169290920160200192915050565b602081526000612dca60208301846142e9565b60006020828403121561433a57600080fd5b8151612eed81613dee565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b805180151581146139d757600080fd5b60006020828403121561439e57600080fd5b612dca8261437c565b6000602082840312156143b957600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b6000828210156143e8576143e86143c0565b500390565b6001600160a01b03929092168252602082015260400190565b6000806040838503121561441957600080fd5b505080516020909101519092909150565b600080600080600060a0868803121561444257600080fd5b61444b8661437c565b602087015160408801516060890151608090990151929a91995097965090945092505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b61ffff8a16815260e0602082015260006144b860e083018a8c614471565b67ffffffffffffffff8916604084015282810360608401526144da81896142e9565b6001600160a01b038816608085015260a0840187905283810360c08501529050614505818587614471565b9c9b505050505050505050505050565b60008219821115614528576145286143c0565b500190565b61ffff8816815260c06020820152600061454a60c08301896142e9565b67ffffffffffffffff881660408401526001600160a01b03871660608401526080830186905282810360a0840152614583818587614471565b9a9950505050505050505050565b61ffff8716815260a0602082015260006145af60a083018789614471565b67ffffffffffffffff861660408401526001600160a01b038516606084015282810360808401526145e081856142e9565b9998505050505050505050565b60008261460a57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615614629576146296143c0565b500290565b6000806000806080858703121561464457600080fd5b845161464f81613dee565b602086015190945061466081613dee565b6040860151606090960151949790965092505050565b8881526001600160a01b0388811660208301528781166040830152861660608201526080810185905260a0810184905260e060c082018190526000906145839083018486614471565b634e487b7160e01b600052604160045260246000fd5b600080604083850312156146e857600080fd5b825160ff811681146146f957600080fd5b602084015190925067ffffffffffffffff8082111561471757600080fd5b818501915085601f83011261472b57600080fd5b81518181111561473d5761473d6146bf565b604051601f8201601f19908116603f01168101908382118183101715614765576147656146bf565b8160405282815288602084870101111561477e57600080fd5b61478f8360208301602088016142bd565b80955050505050509250929050565b6000806000606084860312156147b357600080fd5b83516147be81613dee565b60208501519093506147cf81613dee565b80925050604084015190509250925092565b600080604083850312156147f457600080fd5b82516147ff81613dee565b6020939093015192949293505050565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60006000198214156148bc576148bc6143c0565b5060010190565b6000806000606084860312156148d857600080fd5b83516148e381613ff3565b6020850151604086015191945092506148fb81614003565b809150509250925092565b600082516149188184602087016142bd565b919091019291505056fea2646970667358221220999a51eea1c92569334064d2a38a22fd3865d8effb2083d8a4d64e433beb715664736f6c63430008090033", "devdoc": { "kind": "dev", "methods": { @@ -968,7 +968,7 @@ "storageLayout": { "storage": [ { - "astId": 19718, + "astId": 19848, "contract": "contracts/SmartFarmingManager.sol:SmartFarmingManager", "label": "_initialized", "offset": 0, @@ -976,7 +976,7 @@ "type": "t_uint8" }, { - "astId": 19721, + "astId": 19851, "contract": "contracts/SmartFarmingManager.sol:SmartFarmingManager", "label": "_initializing", "offset": 1, @@ -984,7 +984,7 @@ "type": "t_bool" }, { - "astId": 33546, + "astId": 33742, "contract": "contracts/SmartFarmingManager.sol:SmartFarmingManager", "label": "_status", "offset": 0, @@ -992,15 +992,15 @@ "type": "t_uint256" }, { - "astId": 14219, + "astId": 14349, "contract": "contracts/SmartFarmingManager.sol:SmartFarmingManager", "label": "pool", "offset": 0, "slot": "2", - "type": "t_contract(IPool)27868" + "type": "t_contract(IPool)27998" }, { - "astId": 14321, + "astId": 14451, "contract": "contracts/SmartFarmingManager.sol:SmartFarmingManager", "label": "__gap", "offset": 0, @@ -1008,7 +1008,7 @@ "type": "t_array(t_uint256)49_storage" }, { - "astId": 31288, + "astId": 31446, "contract": "contracts/SmartFarmingManager.sol:SmartFarmingManager", "label": "crossChainRequestsLength", "offset": 0, @@ -1016,20 +1016,20 @@ "type": "t_uint256" }, { - "astId": 31294, + "astId": 31452, "contract": "contracts/SmartFarmingManager.sol:SmartFarmingManager", "label": "crossChainLeverages", "offset": 0, "slot": "53", - "type": "t_mapping(t_uint256,t_struct(CrossChainLeverage)31273_storage)" + "type": "t_mapping(t_uint256,t_struct(CrossChainLeverage)31431_storage)" }, { - "astId": 31300, + "astId": 31458, "contract": "contracts/SmartFarmingManager.sol:SmartFarmingManager", "label": "crossChainFlashRepays", "offset": 0, "slot": "54", - "type": "t_mapping(t_uint256,t_struct(CrossChainFlashRepay)31285_storage)" + "type": "t_mapping(t_uint256,t_struct(CrossChainFlashRepay)31443_storage)" } ], "types": { @@ -1049,46 +1049,46 @@ "label": "bool", "numberOfBytes": "1" }, - "t_contract(IDepositToken)27459": { + "t_contract(IDepositToken)27589": { "encoding": "inplace", "label": "contract IDepositToken", "numberOfBytes": "20" }, - "t_contract(IERC20)21889": { + "t_contract(IERC20)22019": { "encoding": "inplace", "label": "contract IERC20", "numberOfBytes": "20" }, - "t_contract(IPool)27868": { + "t_contract(IPool)27998": { "encoding": "inplace", "label": "contract IPool", "numberOfBytes": "20" }, - "t_contract(ISyntheticToken)28341": { + "t_contract(ISyntheticToken)28471": { "encoding": "inplace", "label": "contract ISyntheticToken", "numberOfBytes": "20" }, - "t_mapping(t_uint256,t_struct(CrossChainFlashRepay)31285_storage)": { + "t_mapping(t_uint256,t_struct(CrossChainFlashRepay)31443_storage)": { "encoding": "mapping", "key": "t_uint256", "label": "mapping(uint256 => struct SmartFarmingManagerStorageV1.CrossChainFlashRepay)", "numberOfBytes": "32", - "value": "t_struct(CrossChainFlashRepay)31285_storage" + "value": "t_struct(CrossChainFlashRepay)31443_storage" }, - "t_mapping(t_uint256,t_struct(CrossChainLeverage)31273_storage)": { + "t_mapping(t_uint256,t_struct(CrossChainLeverage)31431_storage)": { "encoding": "mapping", "key": "t_uint256", "label": "mapping(uint256 => struct SmartFarmingManagerStorageV1.CrossChainLeverage)", "numberOfBytes": "32", - "value": "t_struct(CrossChainLeverage)31273_storage" + "value": "t_struct(CrossChainLeverage)31431_storage" }, - "t_struct(CrossChainFlashRepay)31285_storage": { + "t_struct(CrossChainFlashRepay)31443_storage": { "encoding": "inplace", "label": "struct SmartFarmingManagerStorageV1.CrossChainFlashRepay", "members": [ { - "astId": 31275, + "astId": 31433, "contract": "contracts/SmartFarmingManager.sol:SmartFarmingManager", "label": "dstChainId", "offset": 0, @@ -1096,15 +1096,15 @@ "type": "t_uint16" }, { - "astId": 31278, + "astId": 31436, "contract": "contracts/SmartFarmingManager.sol:SmartFarmingManager", "label": "syntheticToken", "offset": 2, "slot": "0", - "type": "t_contract(ISyntheticToken)28341" + "type": "t_contract(ISyntheticToken)28471" }, { - "astId": 31280, + "astId": 31438, "contract": "contracts/SmartFarmingManager.sol:SmartFarmingManager", "label": "repayAmountMin", "offset": 0, @@ -1112,7 +1112,7 @@ "type": "t_uint256" }, { - "astId": 31282, + "astId": 31440, "contract": "contracts/SmartFarmingManager.sol:SmartFarmingManager", "label": "account", "offset": 0, @@ -1120,7 +1120,7 @@ "type": "t_address" }, { - "astId": 31284, + "astId": 31442, "contract": "contracts/SmartFarmingManager.sol:SmartFarmingManager", "label": "finished", "offset": 20, @@ -1130,12 +1130,12 @@ ], "numberOfBytes": "96" }, - "t_struct(CrossChainLeverage)31273_storage": { + "t_struct(CrossChainLeverage)31431_storage": { "encoding": "inplace", "label": "struct SmartFarmingManagerStorageV1.CrossChainLeverage", "members": [ { - "astId": 31250, + "astId": 31408, "contract": "contracts/SmartFarmingManager.sol:SmartFarmingManager", "label": "dstChainId", "offset": 0, @@ -1143,31 +1143,31 @@ "type": "t_uint16" }, { - "astId": 31253, + "astId": 31411, "contract": "contracts/SmartFarmingManager.sol:SmartFarmingManager", "label": "bridgeToken", "offset": 2, "slot": "0", - "type": "t_contract(IERC20)21889" + "type": "t_contract(IERC20)22019" }, { - "astId": 31256, + "astId": 31414, "contract": "contracts/SmartFarmingManager.sol:SmartFarmingManager", "label": "depositToken", "offset": 0, "slot": "1", - "type": "t_contract(IDepositToken)27459" + "type": "t_contract(IDepositToken)27589" }, { - "astId": 31259, + "astId": 31417, "contract": "contracts/SmartFarmingManager.sol:SmartFarmingManager", "label": "syntheticToken", "offset": 0, "slot": "2", - "type": "t_contract(ISyntheticToken)28341" + "type": "t_contract(ISyntheticToken)28471" }, { - "astId": 31261, + "astId": 31419, "contract": "contracts/SmartFarmingManager.sol:SmartFarmingManager", "label": "amountIn", "offset": 0, @@ -1175,7 +1175,7 @@ "type": "t_uint256" }, { - "astId": 31263, + "astId": 31421, "contract": "contracts/SmartFarmingManager.sol:SmartFarmingManager", "label": "debtAmount", "offset": 0, @@ -1183,7 +1183,7 @@ "type": "t_uint256" }, { - "astId": 31265, + "astId": 31423, "contract": "contracts/SmartFarmingManager.sol:SmartFarmingManager", "label": "depositAmountMin", "offset": 0, @@ -1191,7 +1191,7 @@ "type": "t_uint256" }, { - "astId": 31267, + "astId": 31425, "contract": "contracts/SmartFarmingManager.sol:SmartFarmingManager", "label": "account", "offset": 0, @@ -1199,7 +1199,7 @@ "type": "t_address" }, { - "astId": 31269, + "astId": 31427, "contract": "contracts/SmartFarmingManager.sol:SmartFarmingManager", "label": "finished", "offset": 20, @@ -1207,12 +1207,12 @@ "type": "t_bool" }, { - "astId": 31272, + "astId": 31430, "contract": "contracts/SmartFarmingManager.sol:SmartFarmingManager", "label": "tokenIn", "offset": 0, "slot": "7", - "type": "t_contract(IERC20)21889" + "type": "t_contract(IERC20)22019" } ], "numberOfBytes": "256" @@ -1234,4 +1234,4 @@ } } } -} +} \ No newline at end of file diff --git a/deployments/base/SmartFarmingManager_Pool1.json b/deployments/base/SmartFarmingManager_Pool1.json index f643ad6..bc7931b 100644 --- a/deployments/base/SmartFarmingManager_Pool1.json +++ b/deployments/base/SmartFarmingManager_Pool1.json @@ -1000,18 +1000,12 @@ "0x720501250D7937Ac3b6b308E24466c03A61EFB70", "0xc4d66de8000000000000000000000000c614136d6c5ab85bc2acf0ec2652351642d7f54e" ], - "numDeployments": 1, + "numDeployments": 2, "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": [ - "0xc614136d6c5AB85bc2aCF0ec2652351642d7F54E" - ] - }, - "implementation": "0xf55d146D5A496D6B5576a1661E8861cF5c5ffF9f", + "implementation": "0x1D62a9C4A8e7D38E4d78B40de8278786f09696bD", "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", diff --git a/deployments/base/VaCBETHDepositToken_Pool1.json b/deployments/base/VaCBETHDepositToken_Pool1.json new file mode 100644 index 0000000..3ffdce3 --- /dev/null +++ b/deployments/base/VaCBETHDepositToken_Pool1.json @@ -0,0 +1,1297 @@ +{ + "address": "0xE7Eb345866e07201f0dfe9Afb3a8f0637D998FC9", + "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": "AmountExceedsAllowance", + "type": "error" + }, + { + "inputs": [], + "name": "AmountIsZero", + "type": "error" + }, + { + "inputs": [], + "name": "ApproveFromTheZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "ApproveToTheZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "BeneficiaryIsNull", + "type": "error" + }, + { + "inputs": [], + "name": "BurnAmountExceedsBalance", + "type": "error" + }, + { + "inputs": [], + "name": "BurnFromTheZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "CollateralFactorTooHigh", + "type": "error" + }, + { + "inputs": [], + "name": "CollateralFactorTooLow", + "type": "error" + }, + { + "inputs": [], + "name": "CollateralIsInexistent", + "type": "error" + }, + { + "inputs": [], + "name": "DecimalsIsNull", + "type": "error" + }, + { + "inputs": [], + "name": "DecreasedAllowanceBelowZero", + "type": "error" + }, + { + "inputs": [], + "name": "DepositTokenIsInactive", + "type": "error" + }, + { + "inputs": [], + "name": "FallbackIsNotAllowed", + "type": "error" + }, + { + "inputs": [], + "name": "IsPaused", + "type": "error" + }, + { + "inputs": [], + "name": "IsShutdown", + "type": "error" + }, + { + "inputs": [], + "name": "MintToTheZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "NewValueIsSameAsCurrent", + "type": "error" + }, + { + "inputs": [], + "name": "NotEnoughFreeBalance", + "type": "error" + }, + { + "inputs": [], + "name": "PoolAddressIsNull", + "type": "error" + }, + { + "inputs": [], + "name": "PoolIsNull", + "type": "error" + }, + { + "inputs": [], + "name": "ReceiveIsNotAllowed", + "type": "error" + }, + { + "inputs": [], + "name": "RecipientIsNull", + "type": "error" + }, + { + "inputs": [], + "name": "SenderIsNotGovernor", + "type": "error" + }, + { + "inputs": [], + "name": "SenderIsNotPool", + "type": "error" + }, + { + "inputs": [], + "name": "SenderIsNotSmartFarmingManager", + "type": "error" + }, + { + "inputs": [], + "name": "SurpassMaxDepositSupply", + "type": "error" + }, + { + "inputs": [], + "name": "SymbolIsNull", + "type": "error" + }, + { + "inputs": [], + "name": "TransferAmountExceedsBalance", + "type": "error" + }, + { + "inputs": [], + "name": "TransferFromTheZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "TransferToTheZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "UnderlyingAssetIsNull", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "deposited", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "fee", + "type": "uint256" + } + ], + "name": "CollateralDeposited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldCollateralFactor", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newCollateralFactor", + "type": "uint256" + } + ], + "name": "CollateralFactorUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "withdrawn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "fee", + "type": "uint256" + } + ], + "name": "CollateralWithdrawn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "newActive", + "type": "bool" + } + ], + "name": "DepositTokenActiveUpdated", + "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": "oldMaxTotalSupply", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newMaxTotalSupply", + "type": "uint256" + } + ], + "name": "MaxTotalSupplyUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [], + "name": "VERSION", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "collateralFactor", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue_", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + }, + { + "internalType": "address", + "name": "onBehalfOf_", + "type": "address" + } + ], + "name": "deposit", + "outputs": [ + { + "internalType": "uint256", + "name": "_deposited", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_fee", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "flashWithdraw", + "outputs": [ + { + "internalType": "uint256", + "name": "_withdrawn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_fee", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue_", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "underlying_", + "type": "address" + }, + { + "internalType": "contract IPool", + "name": "pool_", + "type": "address" + }, + { + "internalType": "string", + "name": "name_", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol_", + "type": "string" + }, + { + "internalType": "uint8", + "name": "decimals_", + "type": "uint8" + }, + { + "internalType": "uint128", + "name": "collateralFactor_", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "maxTotalSupply_", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isActive", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account_", + "type": "address" + } + ], + "name": "lockedBalanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "_lockedBalance", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxTotalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pool", + "outputs": [ + { + "internalType": "contract IPool", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountToDeposit_", + "type": "uint256" + } + ], + "name": "quoteDepositIn", + "outputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_fee", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "quoteDepositOut", + "outputs": [ + { + "internalType": "uint256", + "name": "_amountToDeposit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_fee", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountToWithdraw_", + "type": "uint256" + } + ], + "name": "quoteWithdrawIn", + "outputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_fee", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "quoteWithdrawOut", + "outputs": [ + { + "internalType": "uint256", + "name": "_amountToWithdraw", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_fee", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from_", + "type": "address" + }, + { + "internalType": "address", + "name": "to_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "seize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "token_", + "type": "address" + }, + { + "internalType": "address", + "name": "to_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "sweep", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "toggleIsActive", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender_", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "underlying", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account_", + "type": "address" + } + ], + "name": "unlockedBalanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "_unlockedBalance", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "newCollateralFactor_", + "type": "uint128" + } + ], + "name": "updateCollateralFactor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newMaxTotalSupply_", + "type": "uint256" + } + ], + "name": "updateMaxTotalSupply", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + }, + { + "internalType": "address", + "name": "to_", + "type": "address" + } + ], + "name": "withdraw", + "outputs": [ + { + "internalType": "uint256", + "name": "_withdrawn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_fee", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "withdrawFrom", + "outputs": [ + { + "internalType": "uint256", + "name": "_withdrawn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_fee", + "type": "uint256" + } + ], + "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": "0xa23b517d7a0bfa9fc483e3eec751791abca6a278eb140ae8e80a4efe05cc1fbc", + "receipt": { + "to": null, + "from": "0xdf826ff6518e609E4cEE86299d40611C148099d5", + "contractAddress": "0xE7Eb345866e07201f0dfe9Afb3a8f0637D998FC9", + "transactionIndex": 35, + "gasUsed": "907621", + "logsBloom": "0x00000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002010000000000000000000000000000000000000400000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000080000000000000800000000000000000000001000000000400000000000000000000000000000000000000800020000000000000000400040000000000000400000000000000000000000000000000000000000000000000000000000000000000000000020000000000", + "blockHash": "0xb7f523562b002a3ac6880935839256fe96f6c0ba694dd936dd8ded1374bc045f", + "transactionHash": "0xa23b517d7a0bfa9fc483e3eec751791abca6a278eb140ae8e80a4efe05cc1fbc", + "logs": [ + { + "transactionIndex": 35, + "blockNumber": 15984709, + "transactionHash": "0xa23b517d7a0bfa9fc483e3eec751791abca6a278eb140ae8e80a4efe05cc1fbc", + "address": "0xE7Eb345866e07201f0dfe9Afb3a8f0637D998FC9", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x0000000000000000000000009bf24739310fb7f79af48ecc38557e2172469eee" + ], + "data": "0x", + "logIndex": 143, + "blockHash": "0xb7f523562b002a3ac6880935839256fe96f6c0ba694dd936dd8ded1374bc045f" + }, + { + "transactionIndex": 35, + "blockNumber": 15984709, + "transactionHash": "0xa23b517d7a0bfa9fc483e3eec751791abca6a278eb140ae8e80a4efe05cc1fbc", + "address": "0xE7Eb345866e07201f0dfe9Afb3a8f0637D998FC9", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 144, + "blockHash": "0xb7f523562b002a3ac6880935839256fe96f6c0ba694dd936dd8ded1374bc045f" + }, + { + "transactionIndex": 35, + "blockNumber": 15984709, + "transactionHash": "0xa23b517d7a0bfa9fc483e3eec751791abca6a278eb140ae8e80a4efe05cc1fbc", + "address": "0xE7Eb345866e07201f0dfe9Afb3a8f0637D998FC9", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000003506b5efea8d0719e47cdcabc81b6e60b5fa73b5", + "logIndex": 145, + "blockHash": "0xb7f523562b002a3ac6880935839256fe96f6c0ba694dd936dd8ded1374bc045f" + } + ], + "blockNumber": 15984709, + "cumulativeGasUsed": "6701471", + "status": 1, + "byzantium": true + }, + "args": [ + "0x9bF24739310FB7F79af48ECc38557E2172469EEE", + "0x3506B5EfEa8d0719E47cDcabC81b6E60B5Fa73B5", + "0xffc0e17e0000000000000000000000003899a6090c5c178db8a1800da39dad0d06eeefbe000000000000000000000000c614136d6c5ab85bc2acf0ec2652351642d7f54e00000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000a688906bd8b0000000000000000000000000000000000000000000000000002b5e3af16b1880000000000000000000000000000000000000000000000000000000000000000001f4d6574726f6e6f6d652053796e746820766143424554482d4465706f73697400000000000000000000000000000000000000000000000000000000000000000c6d7364766143424554482d310000000000000000000000000000000000000000" + ], + "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": [ + "0x3899a6090c5C178dB8A1800DA39daD0D06EeEFBE", + "0xc614136d6c5AB85bc2aCF0ec2652351642d7F54E", + "Metronome Synth vaCBETH-Deposit", + "msdvaCBETH-1", + 18, + { + "type": "BigNumber", + "hex": "0x0a688906bd8b0000" + }, + { + "type": "BigNumber", + "hex": "0x02b5e3af16b1880000" + } + ] + }, + "implementation": "0x9bF24739310FB7F79af48ECc38557E2172469EEE", + "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 + } +} \ No newline at end of file diff --git a/deployments/base/VaCBETHDepositToken_Pool1_Proxy.json b/deployments/base/VaCBETHDepositToken_Pool1_Proxy.json new file mode 100644 index 0000000..ee970af --- /dev/null +++ b/deployments/base/VaCBETHDepositToken_Pool1_Proxy.json @@ -0,0 +1,247 @@ +{ + "address": "0xE7Eb345866e07201f0dfe9Afb3a8f0637D998FC9", + "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": "0xa23b517d7a0bfa9fc483e3eec751791abca6a278eb140ae8e80a4efe05cc1fbc", + "receipt": { + "to": null, + "from": "0xdf826ff6518e609E4cEE86299d40611C148099d5", + "contractAddress": "0xE7Eb345866e07201f0dfe9Afb3a8f0637D998FC9", + "transactionIndex": 35, + "gasUsed": "907621", + "logsBloom": "0x00000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002010000000000000000000000000000000000000400000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000080000000000000800000000000000000000001000000000400000000000000000000000000000000000000800020000000000000000400040000000000000400000000000000000000000000000000000000000000000000000000000000000000000000020000000000", + "blockHash": "0xb7f523562b002a3ac6880935839256fe96f6c0ba694dd936dd8ded1374bc045f", + "transactionHash": "0xa23b517d7a0bfa9fc483e3eec751791abca6a278eb140ae8e80a4efe05cc1fbc", + "logs": [ + { + "transactionIndex": 35, + "blockNumber": 15984709, + "transactionHash": "0xa23b517d7a0bfa9fc483e3eec751791abca6a278eb140ae8e80a4efe05cc1fbc", + "address": "0xE7Eb345866e07201f0dfe9Afb3a8f0637D998FC9", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x0000000000000000000000009bf24739310fb7f79af48ecc38557e2172469eee" + ], + "data": "0x", + "logIndex": 143, + "blockHash": "0xb7f523562b002a3ac6880935839256fe96f6c0ba694dd936dd8ded1374bc045f" + }, + { + "transactionIndex": 35, + "blockNumber": 15984709, + "transactionHash": "0xa23b517d7a0bfa9fc483e3eec751791abca6a278eb140ae8e80a4efe05cc1fbc", + "address": "0xE7Eb345866e07201f0dfe9Afb3a8f0637D998FC9", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 144, + "blockHash": "0xb7f523562b002a3ac6880935839256fe96f6c0ba694dd936dd8ded1374bc045f" + }, + { + "transactionIndex": 35, + "blockNumber": 15984709, + "transactionHash": "0xa23b517d7a0bfa9fc483e3eec751791abca6a278eb140ae8e80a4efe05cc1fbc", + "address": "0xE7Eb345866e07201f0dfe9Afb3a8f0637D998FC9", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000003506b5efea8d0719e47cdcabc81b6e60b5fa73b5", + "logIndex": 145, + "blockHash": "0xb7f523562b002a3ac6880935839256fe96f6c0ba694dd936dd8ded1374bc045f" + } + ], + "blockNumber": 15984709, + "cumulativeGasUsed": "6701471", + "status": 1, + "byzantium": true + }, + "args": [ + "0x9bF24739310FB7F79af48ECc38557E2172469EEE", + "0x3506B5EfEa8d0719E47cDcabC81b6E60B5Fa73B5", + "0xffc0e17e0000000000000000000000003899a6090c5c178db8a1800da39dad0d06eeefbe000000000000000000000000c614136d6c5ab85bc2acf0ec2652351642d7f54e00000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000a688906bd8b0000000000000000000000000000000000000000000000000002b5e3af16b1880000000000000000000000000000000000000000000000000000000000000000001f4d6574726f6e6f6d652053796e746820766143424554482d4465706f73697400000000000000000000000000000000000000000000000000000000000000000c6d7364766143424554482d310000000000000000000000000000000000000000" + ], + "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 + } +} \ No newline at end of file diff --git a/deployments/base/VaETHDepositToken_Pool1.json b/deployments/base/VaETHDepositToken_Pool1.json new file mode 100644 index 0000000..fc1a5ff --- /dev/null +++ b/deployments/base/VaETHDepositToken_Pool1.json @@ -0,0 +1,1297 @@ +{ + "address": "0x631E4eFe520152b9aa98aCa50739a7F6a8f21319", + "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": "AmountExceedsAllowance", + "type": "error" + }, + { + "inputs": [], + "name": "AmountIsZero", + "type": "error" + }, + { + "inputs": [], + "name": "ApproveFromTheZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "ApproveToTheZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "BeneficiaryIsNull", + "type": "error" + }, + { + "inputs": [], + "name": "BurnAmountExceedsBalance", + "type": "error" + }, + { + "inputs": [], + "name": "BurnFromTheZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "CollateralFactorTooHigh", + "type": "error" + }, + { + "inputs": [], + "name": "CollateralFactorTooLow", + "type": "error" + }, + { + "inputs": [], + "name": "CollateralIsInexistent", + "type": "error" + }, + { + "inputs": [], + "name": "DecimalsIsNull", + "type": "error" + }, + { + "inputs": [], + "name": "DecreasedAllowanceBelowZero", + "type": "error" + }, + { + "inputs": [], + "name": "DepositTokenIsInactive", + "type": "error" + }, + { + "inputs": [], + "name": "FallbackIsNotAllowed", + "type": "error" + }, + { + "inputs": [], + "name": "IsPaused", + "type": "error" + }, + { + "inputs": [], + "name": "IsShutdown", + "type": "error" + }, + { + "inputs": [], + "name": "MintToTheZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "NewValueIsSameAsCurrent", + "type": "error" + }, + { + "inputs": [], + "name": "NotEnoughFreeBalance", + "type": "error" + }, + { + "inputs": [], + "name": "PoolAddressIsNull", + "type": "error" + }, + { + "inputs": [], + "name": "PoolIsNull", + "type": "error" + }, + { + "inputs": [], + "name": "ReceiveIsNotAllowed", + "type": "error" + }, + { + "inputs": [], + "name": "RecipientIsNull", + "type": "error" + }, + { + "inputs": [], + "name": "SenderIsNotGovernor", + "type": "error" + }, + { + "inputs": [], + "name": "SenderIsNotPool", + "type": "error" + }, + { + "inputs": [], + "name": "SenderIsNotSmartFarmingManager", + "type": "error" + }, + { + "inputs": [], + "name": "SurpassMaxDepositSupply", + "type": "error" + }, + { + "inputs": [], + "name": "SymbolIsNull", + "type": "error" + }, + { + "inputs": [], + "name": "TransferAmountExceedsBalance", + "type": "error" + }, + { + "inputs": [], + "name": "TransferFromTheZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "TransferToTheZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "UnderlyingAssetIsNull", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "deposited", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "fee", + "type": "uint256" + } + ], + "name": "CollateralDeposited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldCollateralFactor", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newCollateralFactor", + "type": "uint256" + } + ], + "name": "CollateralFactorUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "withdrawn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "fee", + "type": "uint256" + } + ], + "name": "CollateralWithdrawn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "newActive", + "type": "bool" + } + ], + "name": "DepositTokenActiveUpdated", + "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": "oldMaxTotalSupply", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newMaxTotalSupply", + "type": "uint256" + } + ], + "name": "MaxTotalSupplyUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [], + "name": "VERSION", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "collateralFactor", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue_", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + }, + { + "internalType": "address", + "name": "onBehalfOf_", + "type": "address" + } + ], + "name": "deposit", + "outputs": [ + { + "internalType": "uint256", + "name": "_deposited", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_fee", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "flashWithdraw", + "outputs": [ + { + "internalType": "uint256", + "name": "_withdrawn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_fee", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue_", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "underlying_", + "type": "address" + }, + { + "internalType": "contract IPool", + "name": "pool_", + "type": "address" + }, + { + "internalType": "string", + "name": "name_", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol_", + "type": "string" + }, + { + "internalType": "uint8", + "name": "decimals_", + "type": "uint8" + }, + { + "internalType": "uint128", + "name": "collateralFactor_", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "maxTotalSupply_", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isActive", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account_", + "type": "address" + } + ], + "name": "lockedBalanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "_lockedBalance", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxTotalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pool", + "outputs": [ + { + "internalType": "contract IPool", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountToDeposit_", + "type": "uint256" + } + ], + "name": "quoteDepositIn", + "outputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_fee", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "quoteDepositOut", + "outputs": [ + { + "internalType": "uint256", + "name": "_amountToDeposit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_fee", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountToWithdraw_", + "type": "uint256" + } + ], + "name": "quoteWithdrawIn", + "outputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_fee", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "quoteWithdrawOut", + "outputs": [ + { + "internalType": "uint256", + "name": "_amountToWithdraw", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_fee", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from_", + "type": "address" + }, + { + "internalType": "address", + "name": "to_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "seize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "token_", + "type": "address" + }, + { + "internalType": "address", + "name": "to_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "sweep", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "toggleIsActive", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender_", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "underlying", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account_", + "type": "address" + } + ], + "name": "unlockedBalanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "_unlockedBalance", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "newCollateralFactor_", + "type": "uint128" + } + ], + "name": "updateCollateralFactor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newMaxTotalSupply_", + "type": "uint256" + } + ], + "name": "updateMaxTotalSupply", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + }, + { + "internalType": "address", + "name": "to_", + "type": "address" + } + ], + "name": "withdraw", + "outputs": [ + { + "internalType": "uint256", + "name": "_withdrawn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_fee", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "withdrawFrom", + "outputs": [ + { + "internalType": "uint256", + "name": "_withdrawn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_fee", + "type": "uint256" + } + ], + "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": "0xb14864dc487f809b00d326fe15ad3c6ec8ca21b7316eca828638f046e04948cc", + "receipt": { + "to": null, + "from": "0xdf826ff6518e609E4cEE86299d40611C148099d5", + "contractAddress": "0x631E4eFe520152b9aa98aCa50739a7F6a8f21319", + "transactionIndex": 39, + "gasUsed": "907573", + "logsBloom": "0x00000000000000000000000000000000400000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002010000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000080000000000000800000000000000000000001100000000400000000000000000000000000000000000000000020000000000000000400040000000000000400000000000000000000000000000000000400000000000000000000000000000000000000000000000000", + "blockHash": "0x1368eaf6cf64f7a24b93d4c4aaf4e0c87a1633d3f47b303856631b1e9b18f5c3", + "transactionHash": "0xb14864dc487f809b00d326fe15ad3c6ec8ca21b7316eca828638f046e04948cc", + "logs": [ + { + "transactionIndex": 39, + "blockNumber": 15984695, + "transactionHash": "0xb14864dc487f809b00d326fe15ad3c6ec8ca21b7316eca828638f046e04948cc", + "address": "0x631E4eFe520152b9aa98aCa50739a7F6a8f21319", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x0000000000000000000000009bf24739310fb7f79af48ecc38557e2172469eee" + ], + "data": "0x", + "logIndex": 117, + "blockHash": "0x1368eaf6cf64f7a24b93d4c4aaf4e0c87a1633d3f47b303856631b1e9b18f5c3" + }, + { + "transactionIndex": 39, + "blockNumber": 15984695, + "transactionHash": "0xb14864dc487f809b00d326fe15ad3c6ec8ca21b7316eca828638f046e04948cc", + "address": "0x631E4eFe520152b9aa98aCa50739a7F6a8f21319", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 118, + "blockHash": "0x1368eaf6cf64f7a24b93d4c4aaf4e0c87a1633d3f47b303856631b1e9b18f5c3" + }, + { + "transactionIndex": 39, + "blockNumber": 15984695, + "transactionHash": "0xb14864dc487f809b00d326fe15ad3c6ec8ca21b7316eca828638f046e04948cc", + "address": "0x631E4eFe520152b9aa98aCa50739a7F6a8f21319", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000003506b5efea8d0719e47cdcabc81b6e60b5fa73b5", + "logIndex": 119, + "blockHash": "0x1368eaf6cf64f7a24b93d4c4aaf4e0c87a1633d3f47b303856631b1e9b18f5c3" + } + ], + "blockNumber": 15984695, + "cumulativeGasUsed": "7800214", + "status": 1, + "byzantium": true + }, + "args": [ + "0x9bF24739310FB7F79af48ECc38557E2172469EEE", + "0x3506B5EfEa8d0719E47cDcabC81b6E60B5Fa73B5", + "0xffc0e17e00000000000000000000000082562507429876486b60af4f32390ef0947b3d13000000000000000000000000c614136d6c5ab85bc2acf0ec2652351642d7f54e00000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000b1a2bc2ec50000000000000000000000000000000000000000000000000000821ab0d4414980000000000000000000000000000000000000000000000000000000000000000001d4d6574726f6e6f6d652053796e74682076614554482d4465706f736974000000000000000000000000000000000000000000000000000000000000000000000a6d736476614554482d3100000000000000000000000000000000000000000000" + ], + "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": [ + "0x82562507429876486B60AF4F32390ef0947b3d13", + "0xc614136d6c5AB85bc2aCF0ec2652351642d7F54E", + "Metronome Synth vaETH-Deposit", + "msdvaETH-1", + 18, + { + "type": "BigNumber", + "hex": "0x0b1a2bc2ec500000" + }, + { + "type": "BigNumber", + "hex": "0x0821ab0d4414980000" + } + ] + }, + "implementation": "0x9bF24739310FB7F79af48ECc38557E2172469EEE", + "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 + } +} \ No newline at end of file diff --git a/deployments/base/VaETHDepositToken_Pool1_Proxy.json b/deployments/base/VaETHDepositToken_Pool1_Proxy.json new file mode 100644 index 0000000..abc6776 --- /dev/null +++ b/deployments/base/VaETHDepositToken_Pool1_Proxy.json @@ -0,0 +1,247 @@ +{ + "address": "0x631E4eFe520152b9aa98aCa50739a7F6a8f21319", + "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": "0xb14864dc487f809b00d326fe15ad3c6ec8ca21b7316eca828638f046e04948cc", + "receipt": { + "to": null, + "from": "0xdf826ff6518e609E4cEE86299d40611C148099d5", + "contractAddress": "0x631E4eFe520152b9aa98aCa50739a7F6a8f21319", + "transactionIndex": 39, + "gasUsed": "907573", + "logsBloom": "0x00000000000000000000000000000000400000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002010000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000080000000000000800000000000000000000001100000000400000000000000000000000000000000000000000020000000000000000400040000000000000400000000000000000000000000000000000400000000000000000000000000000000000000000000000000", + "blockHash": "0x1368eaf6cf64f7a24b93d4c4aaf4e0c87a1633d3f47b303856631b1e9b18f5c3", + "transactionHash": "0xb14864dc487f809b00d326fe15ad3c6ec8ca21b7316eca828638f046e04948cc", + "logs": [ + { + "transactionIndex": 39, + "blockNumber": 15984695, + "transactionHash": "0xb14864dc487f809b00d326fe15ad3c6ec8ca21b7316eca828638f046e04948cc", + "address": "0x631E4eFe520152b9aa98aCa50739a7F6a8f21319", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x0000000000000000000000009bf24739310fb7f79af48ecc38557e2172469eee" + ], + "data": "0x", + "logIndex": 117, + "blockHash": "0x1368eaf6cf64f7a24b93d4c4aaf4e0c87a1633d3f47b303856631b1e9b18f5c3" + }, + { + "transactionIndex": 39, + "blockNumber": 15984695, + "transactionHash": "0xb14864dc487f809b00d326fe15ad3c6ec8ca21b7316eca828638f046e04948cc", + "address": "0x631E4eFe520152b9aa98aCa50739a7F6a8f21319", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 118, + "blockHash": "0x1368eaf6cf64f7a24b93d4c4aaf4e0c87a1633d3f47b303856631b1e9b18f5c3" + }, + { + "transactionIndex": 39, + "blockNumber": 15984695, + "transactionHash": "0xb14864dc487f809b00d326fe15ad3c6ec8ca21b7316eca828638f046e04948cc", + "address": "0x631E4eFe520152b9aa98aCa50739a7F6a8f21319", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000003506b5efea8d0719e47cdcabc81b6e60b5fa73b5", + "logIndex": 119, + "blockHash": "0x1368eaf6cf64f7a24b93d4c4aaf4e0c87a1633d3f47b303856631b1e9b18f5c3" + } + ], + "blockNumber": 15984695, + "cumulativeGasUsed": "7800214", + "status": 1, + "byzantium": true + }, + "args": [ + "0x9bF24739310FB7F79af48ECc38557E2172469EEE", + "0x3506B5EfEa8d0719E47cDcabC81b6E60B5Fa73B5", + "0xffc0e17e00000000000000000000000082562507429876486b60af4f32390ef0947b3d13000000000000000000000000c614136d6c5ab85bc2acf0ec2652351642d7f54e00000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000b1a2bc2ec50000000000000000000000000000000000000000000000000000821ab0d4414980000000000000000000000000000000000000000000000000000000000000000001d4d6574726f6e6f6d652053796e74682076614554482d4465706f736974000000000000000000000000000000000000000000000000000000000000000000000a6d736476614554482d3100000000000000000000000000000000000000000000" + ], + "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 + } +} \ No newline at end of file diff --git a/deployments/base/VaUSDCDepositToken_Pool1.json b/deployments/base/VaUSDCDepositToken_Pool1.json new file mode 100644 index 0000000..c12d84d --- /dev/null +++ b/deployments/base/VaUSDCDepositToken_Pool1.json @@ -0,0 +1,1297 @@ +{ + "address": "0x329846f9e19dAa7fD9844065a62eD01BCf63Cf69", + "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": "AmountExceedsAllowance", + "type": "error" + }, + { + "inputs": [], + "name": "AmountIsZero", + "type": "error" + }, + { + "inputs": [], + "name": "ApproveFromTheZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "ApproveToTheZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "BeneficiaryIsNull", + "type": "error" + }, + { + "inputs": [], + "name": "BurnAmountExceedsBalance", + "type": "error" + }, + { + "inputs": [], + "name": "BurnFromTheZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "CollateralFactorTooHigh", + "type": "error" + }, + { + "inputs": [], + "name": "CollateralFactorTooLow", + "type": "error" + }, + { + "inputs": [], + "name": "CollateralIsInexistent", + "type": "error" + }, + { + "inputs": [], + "name": "DecimalsIsNull", + "type": "error" + }, + { + "inputs": [], + "name": "DecreasedAllowanceBelowZero", + "type": "error" + }, + { + "inputs": [], + "name": "DepositTokenIsInactive", + "type": "error" + }, + { + "inputs": [], + "name": "FallbackIsNotAllowed", + "type": "error" + }, + { + "inputs": [], + "name": "IsPaused", + "type": "error" + }, + { + "inputs": [], + "name": "IsShutdown", + "type": "error" + }, + { + "inputs": [], + "name": "MintToTheZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "NewValueIsSameAsCurrent", + "type": "error" + }, + { + "inputs": [], + "name": "NotEnoughFreeBalance", + "type": "error" + }, + { + "inputs": [], + "name": "PoolAddressIsNull", + "type": "error" + }, + { + "inputs": [], + "name": "PoolIsNull", + "type": "error" + }, + { + "inputs": [], + "name": "ReceiveIsNotAllowed", + "type": "error" + }, + { + "inputs": [], + "name": "RecipientIsNull", + "type": "error" + }, + { + "inputs": [], + "name": "SenderIsNotGovernor", + "type": "error" + }, + { + "inputs": [], + "name": "SenderIsNotPool", + "type": "error" + }, + { + "inputs": [], + "name": "SenderIsNotSmartFarmingManager", + "type": "error" + }, + { + "inputs": [], + "name": "SurpassMaxDepositSupply", + "type": "error" + }, + { + "inputs": [], + "name": "SymbolIsNull", + "type": "error" + }, + { + "inputs": [], + "name": "TransferAmountExceedsBalance", + "type": "error" + }, + { + "inputs": [], + "name": "TransferFromTheZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "TransferToTheZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "UnderlyingAssetIsNull", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "deposited", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "fee", + "type": "uint256" + } + ], + "name": "CollateralDeposited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldCollateralFactor", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newCollateralFactor", + "type": "uint256" + } + ], + "name": "CollateralFactorUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "withdrawn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "fee", + "type": "uint256" + } + ], + "name": "CollateralWithdrawn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "newActive", + "type": "bool" + } + ], + "name": "DepositTokenActiveUpdated", + "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": "oldMaxTotalSupply", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newMaxTotalSupply", + "type": "uint256" + } + ], + "name": "MaxTotalSupplyUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [], + "name": "VERSION", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "collateralFactor", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue_", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + }, + { + "internalType": "address", + "name": "onBehalfOf_", + "type": "address" + } + ], + "name": "deposit", + "outputs": [ + { + "internalType": "uint256", + "name": "_deposited", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_fee", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "flashWithdraw", + "outputs": [ + { + "internalType": "uint256", + "name": "_withdrawn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_fee", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue_", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "underlying_", + "type": "address" + }, + { + "internalType": "contract IPool", + "name": "pool_", + "type": "address" + }, + { + "internalType": "string", + "name": "name_", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol_", + "type": "string" + }, + { + "internalType": "uint8", + "name": "decimals_", + "type": "uint8" + }, + { + "internalType": "uint128", + "name": "collateralFactor_", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "maxTotalSupply_", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isActive", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account_", + "type": "address" + } + ], + "name": "lockedBalanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "_lockedBalance", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxTotalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pool", + "outputs": [ + { + "internalType": "contract IPool", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountToDeposit_", + "type": "uint256" + } + ], + "name": "quoteDepositIn", + "outputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_fee", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "quoteDepositOut", + "outputs": [ + { + "internalType": "uint256", + "name": "_amountToDeposit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_fee", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountToWithdraw_", + "type": "uint256" + } + ], + "name": "quoteWithdrawIn", + "outputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_fee", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "quoteWithdrawOut", + "outputs": [ + { + "internalType": "uint256", + "name": "_amountToWithdraw", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_fee", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from_", + "type": "address" + }, + { + "internalType": "address", + "name": "to_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "seize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "token_", + "type": "address" + }, + { + "internalType": "address", + "name": "to_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "sweep", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "toggleIsActive", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender_", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "underlying", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account_", + "type": "address" + } + ], + "name": "unlockedBalanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "_unlockedBalance", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "newCollateralFactor_", + "type": "uint128" + } + ], + "name": "updateCollateralFactor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newMaxTotalSupply_", + "type": "uint256" + } + ], + "name": "updateMaxTotalSupply", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + }, + { + "internalType": "address", + "name": "to_", + "type": "address" + } + ], + "name": "withdraw", + "outputs": [ + { + "internalType": "uint256", + "name": "_withdrawn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_fee", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "withdrawFrom", + "outputs": [ + { + "internalType": "uint256", + "name": "_withdrawn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_fee", + "type": "uint256" + } + ], + "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": "0x0cd34cb0f238d3ca9a6460ff93a09c4b1a8b29df1c2475483c6f573f5fadf219", + "receipt": { + "to": null, + "from": "0xdf826ff6518e609E4cEE86299d40611C148099d5", + "contractAddress": "0x329846f9e19dAa7fD9844065a62eD01BCf63Cf69", + "transactionIndex": 53, + "gasUsed": "907609", + "logsBloom": "0x00000000000000800000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002010000000000000000000000000000000000002000000000000000000020000000000000800000000000000000000000000000000000000000000000000000000000000000000080000000000000800000000000000000000001000000000400000000000000000000000000000000000000000020000000000000000400040000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xfb40fbff8d81366c05a6a3073a957204f8a67ef6bbdd4aa294896d59ab3a5f74", + "transactionHash": "0x0cd34cb0f238d3ca9a6460ff93a09c4b1a8b29df1c2475483c6f573f5fadf219", + "logs": [ + { + "transactionIndex": 53, + "blockNumber": 15984699, + "transactionHash": "0x0cd34cb0f238d3ca9a6460ff93a09c4b1a8b29df1c2475483c6f573f5fadf219", + "address": "0x329846f9e19dAa7fD9844065a62eD01BCf63Cf69", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x0000000000000000000000009bf24739310fb7f79af48ecc38557e2172469eee" + ], + "data": "0x", + "logIndex": 138, + "blockHash": "0xfb40fbff8d81366c05a6a3073a957204f8a67ef6bbdd4aa294896d59ab3a5f74" + }, + { + "transactionIndex": 53, + "blockNumber": 15984699, + "transactionHash": "0x0cd34cb0f238d3ca9a6460ff93a09c4b1a8b29df1c2475483c6f573f5fadf219", + "address": "0x329846f9e19dAa7fD9844065a62eD01BCf63Cf69", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 139, + "blockHash": "0xfb40fbff8d81366c05a6a3073a957204f8a67ef6bbdd4aa294896d59ab3a5f74" + }, + { + "transactionIndex": 53, + "blockNumber": 15984699, + "transactionHash": "0x0cd34cb0f238d3ca9a6460ff93a09c4b1a8b29df1c2475483c6f573f5fadf219", + "address": "0x329846f9e19dAa7fD9844065a62eD01BCf63Cf69", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000003506b5efea8d0719e47cdcabc81b6e60b5fa73b5", + "logIndex": 140, + "blockHash": "0xfb40fbff8d81366c05a6a3073a957204f8a67ef6bbdd4aa294896d59ab3a5f74" + } + ], + "blockNumber": 15984699, + "cumulativeGasUsed": "8171594", + "status": 1, + "byzantium": true + }, + "args": [ + "0x9bF24739310FB7F79af48ECc38557E2172469EEE", + "0x3506B5EfEa8d0719E47cDcabC81b6E60B5Fa73B5", + "0xffc0e17e0000000000000000000000001e41238acd3a9ff90b0dcb9ea96cf45f104e09ef000000000000000000000000c614136d6c5ab85bc2acf0ec2652351642d7f54e00000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000b6139a7cbd200000000000000000000000000000000000000000000000069e10de76676d0800000000000000000000000000000000000000000000000000000000000000000001e4d6574726f6e6f6d652053796e7468207661555344432d4465706f7369740000000000000000000000000000000000000000000000000000000000000000000b6d73647661555344432d31000000000000000000000000000000000000000000" + ], + "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": [ + "0x1e41238aCd3A9fF90b0DCB9ea96Cf45F104e09Ef", + "0xc614136d6c5AB85bc2aCF0ec2652351642d7F54E", + "Metronome Synth vaUSDC-Deposit", + "msdvaUSDC-1", + 18, + { + "type": "BigNumber", + "hex": "0x0b6139a7cbd20000" + }, + { + "type": "BigNumber", + "hex": "0x69e10de76676d0800000" + } + ] + }, + "implementation": "0x9bF24739310FB7F79af48ECc38557E2172469EEE", + "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 + } +} \ No newline at end of file diff --git a/deployments/base/VaUSDCDepositToken_Pool1_Proxy.json b/deployments/base/VaUSDCDepositToken_Pool1_Proxy.json new file mode 100644 index 0000000..390bc79 --- /dev/null +++ b/deployments/base/VaUSDCDepositToken_Pool1_Proxy.json @@ -0,0 +1,247 @@ +{ + "address": "0x329846f9e19dAa7fD9844065a62eD01BCf63Cf69", + "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": "0x0cd34cb0f238d3ca9a6460ff93a09c4b1a8b29df1c2475483c6f573f5fadf219", + "receipt": { + "to": null, + "from": "0xdf826ff6518e609E4cEE86299d40611C148099d5", + "contractAddress": "0x329846f9e19dAa7fD9844065a62eD01BCf63Cf69", + "transactionIndex": 53, + "gasUsed": "907609", + "logsBloom": "0x00000000000000800000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002010000000000000000000000000000000000002000000000000000000020000000000000800000000000000000000000000000000000000000000000000000000000000000000080000000000000800000000000000000000001000000000400000000000000000000000000000000000000000020000000000000000400040000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xfb40fbff8d81366c05a6a3073a957204f8a67ef6bbdd4aa294896d59ab3a5f74", + "transactionHash": "0x0cd34cb0f238d3ca9a6460ff93a09c4b1a8b29df1c2475483c6f573f5fadf219", + "logs": [ + { + "transactionIndex": 53, + "blockNumber": 15984699, + "transactionHash": "0x0cd34cb0f238d3ca9a6460ff93a09c4b1a8b29df1c2475483c6f573f5fadf219", + "address": "0x329846f9e19dAa7fD9844065a62eD01BCf63Cf69", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x0000000000000000000000009bf24739310fb7f79af48ecc38557e2172469eee" + ], + "data": "0x", + "logIndex": 138, + "blockHash": "0xfb40fbff8d81366c05a6a3073a957204f8a67ef6bbdd4aa294896d59ab3a5f74" + }, + { + "transactionIndex": 53, + "blockNumber": 15984699, + "transactionHash": "0x0cd34cb0f238d3ca9a6460ff93a09c4b1a8b29df1c2475483c6f573f5fadf219", + "address": "0x329846f9e19dAa7fD9844065a62eD01BCf63Cf69", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 139, + "blockHash": "0xfb40fbff8d81366c05a6a3073a957204f8a67ef6bbdd4aa294896d59ab3a5f74" + }, + { + "transactionIndex": 53, + "blockNumber": 15984699, + "transactionHash": "0x0cd34cb0f238d3ca9a6460ff93a09c4b1a8b29df1c2475483c6f573f5fadf219", + "address": "0x329846f9e19dAa7fD9844065a62eD01BCf63Cf69", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000003506b5efea8d0719e47cdcabc81b6e60b5fa73b5", + "logIndex": 140, + "blockHash": "0xfb40fbff8d81366c05a6a3073a957204f8a67ef6bbdd4aa294896d59ab3a5f74" + } + ], + "blockNumber": 15984699, + "cumulativeGasUsed": "8171594", + "status": 1, + "byzantium": true + }, + "args": [ + "0x9bF24739310FB7F79af48ECc38557E2172469EEE", + "0x3506B5EfEa8d0719E47cDcabC81b6E60B5Fa73B5", + "0xffc0e17e0000000000000000000000001e41238acd3a9ff90b0dcb9ea96cf45f104e09ef000000000000000000000000c614136d6c5ab85bc2acf0ec2652351642d7f54e00000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000b6139a7cbd200000000000000000000000000000000000000000000000069e10de76676d0800000000000000000000000000000000000000000000000000000000000000000001e4d6574726f6e6f6d652053796e7468207661555344432d4465706f7369740000000000000000000000000000000000000000000000000000000000000000000b6d73647661555344432d31000000000000000000000000000000000000000000" + ], + "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 + } +} \ No newline at end of file diff --git a/deployments/base/VaWSTETHDepositToken_Pool1.json b/deployments/base/VaWSTETHDepositToken_Pool1.json new file mode 100644 index 0000000..7a4a5e3 --- /dev/null +++ b/deployments/base/VaWSTETHDepositToken_Pool1.json @@ -0,0 +1,1297 @@ +{ + "address": "0x3E5C739deC75aC5b8BC11D763b02B2a777046802", + "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": "AmountExceedsAllowance", + "type": "error" + }, + { + "inputs": [], + "name": "AmountIsZero", + "type": "error" + }, + { + "inputs": [], + "name": "ApproveFromTheZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "ApproveToTheZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "BeneficiaryIsNull", + "type": "error" + }, + { + "inputs": [], + "name": "BurnAmountExceedsBalance", + "type": "error" + }, + { + "inputs": [], + "name": "BurnFromTheZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "CollateralFactorTooHigh", + "type": "error" + }, + { + "inputs": [], + "name": "CollateralFactorTooLow", + "type": "error" + }, + { + "inputs": [], + "name": "CollateralIsInexistent", + "type": "error" + }, + { + "inputs": [], + "name": "DecimalsIsNull", + "type": "error" + }, + { + "inputs": [], + "name": "DecreasedAllowanceBelowZero", + "type": "error" + }, + { + "inputs": [], + "name": "DepositTokenIsInactive", + "type": "error" + }, + { + "inputs": [], + "name": "FallbackIsNotAllowed", + "type": "error" + }, + { + "inputs": [], + "name": "IsPaused", + "type": "error" + }, + { + "inputs": [], + "name": "IsShutdown", + "type": "error" + }, + { + "inputs": [], + "name": "MintToTheZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "NewValueIsSameAsCurrent", + "type": "error" + }, + { + "inputs": [], + "name": "NotEnoughFreeBalance", + "type": "error" + }, + { + "inputs": [], + "name": "PoolAddressIsNull", + "type": "error" + }, + { + "inputs": [], + "name": "PoolIsNull", + "type": "error" + }, + { + "inputs": [], + "name": "ReceiveIsNotAllowed", + "type": "error" + }, + { + "inputs": [], + "name": "RecipientIsNull", + "type": "error" + }, + { + "inputs": [], + "name": "SenderIsNotGovernor", + "type": "error" + }, + { + "inputs": [], + "name": "SenderIsNotPool", + "type": "error" + }, + { + "inputs": [], + "name": "SenderIsNotSmartFarmingManager", + "type": "error" + }, + { + "inputs": [], + "name": "SurpassMaxDepositSupply", + "type": "error" + }, + { + "inputs": [], + "name": "SymbolIsNull", + "type": "error" + }, + { + "inputs": [], + "name": "TransferAmountExceedsBalance", + "type": "error" + }, + { + "inputs": [], + "name": "TransferFromTheZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "TransferToTheZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "UnderlyingAssetIsNull", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "deposited", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "fee", + "type": "uint256" + } + ], + "name": "CollateralDeposited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldCollateralFactor", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newCollateralFactor", + "type": "uint256" + } + ], + "name": "CollateralFactorUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "withdrawn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "fee", + "type": "uint256" + } + ], + "name": "CollateralWithdrawn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "newActive", + "type": "bool" + } + ], + "name": "DepositTokenActiveUpdated", + "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": "oldMaxTotalSupply", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newMaxTotalSupply", + "type": "uint256" + } + ], + "name": "MaxTotalSupplyUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [], + "name": "VERSION", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "collateralFactor", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue_", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + }, + { + "internalType": "address", + "name": "onBehalfOf_", + "type": "address" + } + ], + "name": "deposit", + "outputs": [ + { + "internalType": "uint256", + "name": "_deposited", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_fee", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "flashWithdraw", + "outputs": [ + { + "internalType": "uint256", + "name": "_withdrawn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_fee", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue_", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "underlying_", + "type": "address" + }, + { + "internalType": "contract IPool", + "name": "pool_", + "type": "address" + }, + { + "internalType": "string", + "name": "name_", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol_", + "type": "string" + }, + { + "internalType": "uint8", + "name": "decimals_", + "type": "uint8" + }, + { + "internalType": "uint128", + "name": "collateralFactor_", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "maxTotalSupply_", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isActive", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account_", + "type": "address" + } + ], + "name": "lockedBalanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "_lockedBalance", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxTotalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pool", + "outputs": [ + { + "internalType": "contract IPool", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountToDeposit_", + "type": "uint256" + } + ], + "name": "quoteDepositIn", + "outputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_fee", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "quoteDepositOut", + "outputs": [ + { + "internalType": "uint256", + "name": "_amountToDeposit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_fee", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountToWithdraw_", + "type": "uint256" + } + ], + "name": "quoteWithdrawIn", + "outputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_fee", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "quoteWithdrawOut", + "outputs": [ + { + "internalType": "uint256", + "name": "_amountToWithdraw", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_fee", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from_", + "type": "address" + }, + { + "internalType": "address", + "name": "to_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "seize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "token_", + "type": "address" + }, + { + "internalType": "address", + "name": "to_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "sweep", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "toggleIsActive", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender_", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "underlying", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account_", + "type": "address" + } + ], + "name": "unlockedBalanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "_unlockedBalance", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint128", + "name": "newCollateralFactor_", + "type": "uint128" + } + ], + "name": "updateCollateralFactor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newMaxTotalSupply_", + "type": "uint256" + } + ], + "name": "updateMaxTotalSupply", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + }, + { + "internalType": "address", + "name": "to_", + "type": "address" + } + ], + "name": "withdraw", + "outputs": [ + { + "internalType": "uint256", + "name": "_withdrawn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_fee", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount_", + "type": "uint256" + } + ], + "name": "withdrawFrom", + "outputs": [ + { + "internalType": "uint256", + "name": "_withdrawn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_fee", + "type": "uint256" + } + ], + "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": "0xb438323aa0a382ad1dbf7651dee3cee865c5bd36292bfe906cdfc5329148e388", + "receipt": { + "to": null, + "from": "0xdf826ff6518e609E4cEE86299d40611C148099d5", + "contractAddress": "0x3E5C739deC75aC5b8BC11D763b02B2a777046802", + "transactionIndex": 33, + "gasUsed": "929847", + "logsBloom": "0x00000000000000000000000000000000400000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000002010000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000080000000000200800000000000000000000001000000000c00000000000000000000000000000000000000000020000000000000000400040000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x57dc3b5a8f73e5501c88c598472d2691fd5a7960e8a54a375cfcd92980f5d72b", + "transactionHash": "0xb438323aa0a382ad1dbf7651dee3cee865c5bd36292bfe906cdfc5329148e388", + "logs": [ + { + "transactionIndex": 33, + "blockNumber": 15984704, + "transactionHash": "0xb438323aa0a382ad1dbf7651dee3cee865c5bd36292bfe906cdfc5329148e388", + "address": "0x3E5C739deC75aC5b8BC11D763b02B2a777046802", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x0000000000000000000000009bf24739310fb7f79af48ecc38557e2172469eee" + ], + "data": "0x", + "logIndex": 102, + "blockHash": "0x57dc3b5a8f73e5501c88c598472d2691fd5a7960e8a54a375cfcd92980f5d72b" + }, + { + "transactionIndex": 33, + "blockNumber": 15984704, + "transactionHash": "0xb438323aa0a382ad1dbf7651dee3cee865c5bd36292bfe906cdfc5329148e388", + "address": "0x3E5C739deC75aC5b8BC11D763b02B2a777046802", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 103, + "blockHash": "0x57dc3b5a8f73e5501c88c598472d2691fd5a7960e8a54a375cfcd92980f5d72b" + }, + { + "transactionIndex": 33, + "blockNumber": 15984704, + "transactionHash": "0xb438323aa0a382ad1dbf7651dee3cee865c5bd36292bfe906cdfc5329148e388", + "address": "0x3E5C739deC75aC5b8BC11D763b02B2a777046802", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000003506b5efea8d0719e47cdcabc81b6e60b5fa73b5", + "logIndex": 104, + "blockHash": "0x57dc3b5a8f73e5501c88c598472d2691fd5a7960e8a54a375cfcd92980f5d72b" + } + ], + "blockNumber": 15984704, + "cumulativeGasUsed": "7205861", + "status": 1, + "byzantium": true + }, + "args": [ + "0x9bF24739310FB7F79af48ECc38557E2172469EEE", + "0x3506B5EfEa8d0719E47cDcabC81b6E60B5Fa73B5", + "0xffc0e17e00000000000000000000000046fb68eb2b1fc43654abae5691d39d18d933e4b4000000000000000000000000c614136d6c5ab85bc2acf0ec2652351642d7f54e00000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000ad31dde0cce00000000000000000000000000000000000000000000000000056bc75e2d6310000000000000000000000000000000000000000000000000000000000000000000204d6574726f6e6f6d652053796e74682076615753544554482d4465706f736974000000000000000000000000000000000000000000000000000000000000000d6d736476615753544554482d3100000000000000000000000000000000000000" + ], + "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": [ + "0x46fb68Eb2b1Fc43654AbaE5691D39D18D933E4b4", + "0xc614136d6c5AB85bc2aCF0ec2652351642d7F54E", + "Metronome Synth vaWSTETH-Deposit", + "msdvaWSTETH-1", + 18, + { + "type": "BigNumber", + "hex": "0x0ad31dde0cce0000" + }, + { + "type": "BigNumber", + "hex": "0x056bc75e2d63100000" + } + ] + }, + "implementation": "0x9bF24739310FB7F79af48ECc38557E2172469EEE", + "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 + } +} \ No newline at end of file diff --git a/deployments/base/VaWSTETHDepositToken_Pool1_Proxy.json b/deployments/base/VaWSTETHDepositToken_Pool1_Proxy.json new file mode 100644 index 0000000..62ed62b --- /dev/null +++ b/deployments/base/VaWSTETHDepositToken_Pool1_Proxy.json @@ -0,0 +1,247 @@ +{ + "address": "0x3E5C739deC75aC5b8BC11D763b02B2a777046802", + "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": "0xb438323aa0a382ad1dbf7651dee3cee865c5bd36292bfe906cdfc5329148e388", + "receipt": { + "to": null, + "from": "0xdf826ff6518e609E4cEE86299d40611C148099d5", + "contractAddress": "0x3E5C739deC75aC5b8BC11D763b02B2a777046802", + "transactionIndex": 33, + "gasUsed": "929847", + "logsBloom": "0x00000000000000000000000000000000400000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000002010000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000080000000000200800000000000000000000001000000000c00000000000000000000000000000000000000000020000000000000000400040000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x57dc3b5a8f73e5501c88c598472d2691fd5a7960e8a54a375cfcd92980f5d72b", + "transactionHash": "0xb438323aa0a382ad1dbf7651dee3cee865c5bd36292bfe906cdfc5329148e388", + "logs": [ + { + "transactionIndex": 33, + "blockNumber": 15984704, + "transactionHash": "0xb438323aa0a382ad1dbf7651dee3cee865c5bd36292bfe906cdfc5329148e388", + "address": "0x3E5C739deC75aC5b8BC11D763b02B2a777046802", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x0000000000000000000000009bf24739310fb7f79af48ecc38557e2172469eee" + ], + "data": "0x", + "logIndex": 102, + "blockHash": "0x57dc3b5a8f73e5501c88c598472d2691fd5a7960e8a54a375cfcd92980f5d72b" + }, + { + "transactionIndex": 33, + "blockNumber": 15984704, + "transactionHash": "0xb438323aa0a382ad1dbf7651dee3cee865c5bd36292bfe906cdfc5329148e388", + "address": "0x3E5C739deC75aC5b8BC11D763b02B2a777046802", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 103, + "blockHash": "0x57dc3b5a8f73e5501c88c598472d2691fd5a7960e8a54a375cfcd92980f5d72b" + }, + { + "transactionIndex": 33, + "blockNumber": 15984704, + "transactionHash": "0xb438323aa0a382ad1dbf7651dee3cee865c5bd36292bfe906cdfc5329148e388", + "address": "0x3E5C739deC75aC5b8BC11D763b02B2a777046802", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000003506b5efea8d0719e47cdcabc81b6e60b5fa73b5", + "logIndex": 104, + "blockHash": "0x57dc3b5a8f73e5501c88c598472d2691fd5a7960e8a54a375cfcd92980f5d72b" + } + ], + "blockNumber": 15984704, + "cumulativeGasUsed": "7205861", + "status": 1, + "byzantium": true + }, + "args": [ + "0x9bF24739310FB7F79af48ECc38557E2172469EEE", + "0x3506B5EfEa8d0719E47cDcabC81b6E60B5Fa73B5", + "0xffc0e17e00000000000000000000000046fb68eb2b1fc43654abae5691d39d18d933e4b4000000000000000000000000c614136d6c5ab85bc2acf0ec2652351642d7f54e00000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000ad31dde0cce00000000000000000000000000000000000000000000000000056bc75e2d6310000000000000000000000000000000000000000000000000000000000000000000204d6574726f6e6f6d652053796e74682076615753544554482d4465706f736974000000000000000000000000000000000000000000000000000000000000000d6d736476615753544554482d3100000000000000000000000000000000000000" + ], + "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 + } +} \ No newline at end of file diff --git a/deployments/base/solcInputs/210845288ae75ad5da12a755a9f52e1f.json b/deployments/base/solcInputs/210845288ae75ad5da12a755a9f52e1f.json new file mode 100644 index 0000000..5acc861 --- /dev/null +++ b/deployments/base/solcInputs/210845288ae75ad5da12a755a9f52e1f.json @@ -0,0 +1,482 @@ +{ + "language": "Solidity", + "sources": { + "contracts/access/Governable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"../dependencies/openzeppelin-upgradeable/proxy/utils/Initializable.sol\";\nimport \"../utils/TokenHolder.sol\";\nimport \"../interfaces/IGovernable.sol\";\n\nerror SenderIsNotGovernor();\nerror ProposedGovernorIsNull();\nerror SenderIsNotTheProposedGovernor();\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (governor) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the governor account will be the one that deploys the contract. This\n * can later be changed with {transferGovernorship}.\n *\n */\nabstract contract Governable is IGovernable, TokenHolder, Initializable {\n /**\n * @notice The governor\n * @dev By default the contract deployer is the initial governor\n */\n address public governor;\n\n /**\n * @notice The proposed governor\n * @dev It will be empty (address(0)) if there isn't a proposed governor\n */\n address public proposedGovernor;\n\n event UpdatedGovernor(address indexed previousGovernor, address indexed proposedGovernor);\n\n constructor() {\n governor = msg.sender;\n emit UpdatedGovernor(address(0), msg.sender);\n }\n\n /**\n * @dev If inheriting child is using proxy then child contract can use\n * __Governable_init() function to initialization this contract\n */\n // solhint-disable-next-line func-name-mixedcase\n function __Governable_init() internal onlyInitializing {\n governor = msg.sender;\n emit UpdatedGovernor(address(0), msg.sender);\n }\n\n /**\n * @dev Throws if called by any account other than the governor.\n */\n modifier onlyGovernor() {\n if (governor != msg.sender) revert SenderIsNotGovernor();\n _;\n }\n\n /// @inheritdoc TokenHolder\n // solhint-disable-next-line no-empty-blocks\n function _requireCanSweep() internal view override onlyGovernor {}\n\n /**\n * @notice Transfers governorship of the contract to a new account (`proposedGovernor`).\n * @dev Can only be called by the current owner.\n * @param proposedGovernor_ The new proposed governor\n */\n function transferGovernorship(address proposedGovernor_) external onlyGovernor {\n if (proposedGovernor_ == address(0)) revert ProposedGovernorIsNull();\n proposedGovernor = proposedGovernor_;\n }\n\n /**\n * @notice Allows new governor to accept governorship of the contract.\n */\n function acceptGovernorship() external {\n address _proposedGovernor = proposedGovernor;\n if (msg.sender != _proposedGovernor) revert SenderIsNotTheProposedGovernor();\n emit UpdatedGovernor(governor, _proposedGovernor);\n governor = _proposedGovernor;\n proposedGovernor = address(0);\n }\n}\n" + }, + "contracts/access/Manageable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"../dependencies/openzeppelin-upgradeable/proxy/utils/Initializable.sol\";\nimport \"../interfaces/IGovernable.sol\";\nimport \"../interfaces/IManageable.sol\";\n\nerror SenderIsNotPool();\nerror SenderIsNotGovernor();\nerror IsPaused();\nerror IsShutdown();\nerror PoolAddressIsNull();\n\n/**\n * @title Reusable contract that handles accesses\n */\nabstract contract Manageable is IManageable, Initializable {\n /**\n * @notice Pool contract\n */\n IPool public pool;\n\n /**\n * @dev Throws if `msg.sender` isn't the pool\n */\n modifier onlyPool() {\n if (msg.sender != address(pool)) revert SenderIsNotPool();\n _;\n }\n\n /**\n * @dev Throws if `msg.sender` isn't the governor\n */\n modifier onlyGovernor() {\n if (msg.sender != governor()) revert SenderIsNotGovernor();\n _;\n }\n\n /**\n * @dev Throws if contract is paused\n */\n modifier whenNotPaused() {\n if (pool.paused()) revert IsPaused();\n _;\n }\n\n /**\n * @dev Throws if contract is shutdown\n */\n modifier whenNotShutdown() {\n if (pool.everythingStopped()) revert IsShutdown();\n _;\n }\n\n // solhint-disable-next-line func-name-mixedcase\n function __Manageable_init(IPool pool_) internal onlyInitializing {\n if (address(pool_) == address(0)) revert PoolAddressIsNull();\n pool = pool_;\n }\n\n /**\n * @notice Get the governor\n * @return _governor The governor\n */\n function governor() public view returns (address _governor) {\n _governor = IGovernable(address(pool)).governor();\n }\n\n uint256[49] private __gap;\n}\n" + }, + "contracts/CrossChainDispatcher.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"./utils/ReentrancyGuard.sol\";\nimport \"./dependencies/@layerzerolabs/solidity-examples/util/BytesLib.sol\";\nimport \"./dependencies/openzeppelin/token/ERC20/utils/SafeERC20.sol\";\nimport \"./interfaces/external/IStargateComposerWithRetry.sol\";\nimport \"./interfaces/external/IWETH.sol\";\nimport \"./interfaces/external/IStargatePool.sol\";\nimport \"./interfaces/external/IStargateFactory.sol\";\nimport \"./storage/CrossChainDispatcherStorage.sol\";\nimport \"./interfaces/IProxyOFT.sol\";\nimport \"./interfaces/ISmartFarmingManager.sol\";\nimport \"./interfaces/ISyntheticToken.sol\";\nimport \"./interfaces/external/ISwapper.sol\";\nimport \"./lib/CrossChainLib.sol\";\n\nerror AddressIsNull();\nerror InvalidMsgSender();\nerror BridgingIsPaused();\nerror InvalidFromAddress();\nerror InvalidToAddress();\nerror NewValueIsSameAsCurrent();\nerror SenderIsNotGovernor();\nerror DestinationChainNotAllowed();\nerror InvalidOperationType();\nerror BridgeTokenNotSupported();\nerror InvalidSlippageParam();\nerror InvalidPayload();\n\n// Note: The `IPool` wasn't updated to avoid changing interface\n// Refs: https://github.com/autonomoussoftware/metronome-synth/issues/877\ninterface IPoolV4 is IPool {\n function isBridgingActive() external view returns (bool);\n}\n\n/**\n * @title Cross-chain dispatcher\n */\ncontract CrossChainDispatcher is ReentrancyGuard, CrossChainDispatcherStorageV2 {\n using SafeERC20 for IERC20;\n using BytesLib for bytes;\n\n string public constant VERSION = \"1.3.0\";\n\n /**\n * @dev LayerZero adapter param version\n * See more: https://layerzero.gitbook.io/docs/evm-guides/advanced/relayer-adapter-parameters\n */\n uint16 private constant LZ_ADAPTER_PARAMS_VERSION = 2;\n\n uint256 private constant MAX_BPS = 100_00;\n\n struct LayerZeroParams {\n address tokenIn;\n uint16 dstChainId;\n uint256 amountIn;\n uint256 nativeFee;\n bytes payload;\n address refundAddress;\n uint64 dstGasForCall;\n uint256 dstNativeAmount;\n }\n\n /// @notice Emitted when Lz base gas limit updated\n event LzBaseGasLimitUpdated(uint256 oldLzBaseGasLimit, uint256 newLzBaseGasLimit);\n\n /// @notice Emitted when Stargate composer is updated\n event StargateComposerUpdated(IStargateComposer oldStargateComposer, IStargateComposer newStargateComposer);\n\n /// @notice Emitted when Stargate pool id is updated\n event StargatePoolIdUpdated(address indexed token, uint256 oldPoolId, uint256 newPoolId);\n\n /// @notice Emitted when Stargate slippage is updated\n event StargateSlippageUpdated(uint256 oldStargateSlippage, uint256 newStargateSlippage);\n\n /// @notice Emitted when synth->underlying L1 swap gas limit is updated\n event LeverageSwapTxGasLimitUpdated(uint64 oldSwapTxGasLimit, uint64 newSwapTxGasLimit);\n\n /// @notice Emitted when leverage callback gas limit is updated\n event LeverageCallbackTxGasLimitUpdated(uint64 oldCallbackTxGasLimit, uint64 newCallbackTxGasLimit);\n\n /// @notice Emitted when underlying->synth L1 swap gas limit is updated\n event FlashRepaySwapTxGasLimitUpdated(uint64 oldSwapTxGasLimit, uint64 newSwapTxGasLimit);\n\n /// @notice Emitted when flash repay callback gas limit is updated\n event FlashRepayCallbackTxGasLimitUpdated(uint64 oldCallbackTxGasLimit, uint64 newCallbackTxGasLimit);\n\n /// @notice Emitted when flag for pause bridge transfer is toggled\n event BridgingIsActiveUpdated(bool newIsActive);\n\n /// @notice Emitted when a Cross-chain dispatcher mapping is updated\n event CrossChainDispatcherUpdated(uint16 chainId, address oldCrossChainDispatcher, address newCrossChainDispatcher);\n\n /// @notice Emitted when flag for support chain is toggled\n event DestinationChainIsSupportedUpdated(uint16 chainId, bool newIsSupported);\n\n modifier onlyGovernor() {\n if (msg.sender != poolRegistry.governor()) revert SenderIsNotGovernor();\n _;\n }\n\n modifier onlyIfBridgingIsNotPaused() {\n if (!isBridgingActive || !IPoolV4(address(IManageable(msg.sender).pool())).isBridgingActive())\n revert BridgingIsPaused();\n _;\n }\n\n modifier onlyIfSmartFarmingManager() {\n IPool _pool = IManageable(msg.sender).pool();\n if (!poolRegistry.isPoolRegistered(address(_pool))) revert InvalidMsgSender();\n if (msg.sender != address(_pool.smartFarmingManager())) revert InvalidMsgSender();\n _;\n }\n\n modifier onlyIfStargateComposer() {\n if (msg.sender != address(stargateComposer)) revert InvalidMsgSender();\n _;\n }\n\n modifier onlyIfProxyOFT() {\n if (!_isValidProxyOFT(msg.sender)) revert InvalidMsgSender();\n _;\n }\n\n constructor() {\n _disableInitializers();\n }\n\n receive() external payable {}\n\n function initialize(IPoolRegistry poolRegistry_, address weth_, address sgeth_) external initializer {\n if (address(poolRegistry_) == address(0)) revert AddressIsNull();\n\n __ReentrancyGuard_init();\n\n poolRegistry = poolRegistry_;\n stargateSlippage = 50; // 0.5%\n lzBaseGasLimit = 200_000;\n flashRepayCallbackTxGasLimit = 750_000;\n flashRepaySwapTxGasLimit = 500_000;\n leverageCallbackTxGasLimit = 750_000;\n leverageSwapTxGasLimit = 750_000;\n weth = weth_;\n sgeth = sgeth_;\n }\n\n /**\n * @notice Called by the OFT contract when tokens are received from source chain.\n * @dev Token received are swapped to another token\n * @param srcChainId_ The chain id of the source chain.\n * @param from_ The address of the account who calls the sendAndCall() on the source chain.\n * @param amount_ The amount of tokens to transfer.\n * @param payload_ Additional data with no specified format.\n */\n function onOFTReceived(\n uint16 srcChainId_,\n bytes calldata /*srcAddress_*/,\n uint64 /*nonce_*/,\n bytes calldata from_,\n uint amount_,\n bytes calldata payload_\n ) external override onlyIfProxyOFT {\n address _from = from_.toAddress(0);\n if (_from == address(0) || _from != crossChainDispatcherOf[srcChainId_]) revert InvalidFromAddress();\n\n uint8 _op = CrossChainLib.getOperationType(payload_);\n\n if (_op == CrossChainLib.FLASH_REPAY) {\n _crossChainFlashRepayCallback(amount_, payload_);\n } else if (_op == CrossChainLib.LEVERAGE) {\n _swapAndTriggerLeverageCallback(srcChainId_, amount_, payload_);\n } else {\n revert InvalidOperationType();\n }\n }\n\n /**\n * @dev Finalize cross-chain flash repay process. The callback may fail due to slippage.\n */\n function _crossChainFlashRepayCallback(uint amount_, bytes calldata payload_) private {\n (address proxyOFT_, address _smartFarmingManager, uint256 _requestId) = CrossChainLib\n .decodeFlashRepayCallbackPayload(payload_);\n\n IERC20 _syntheticToken = IERC20(IProxyOFT(proxyOFT_).token());\n _syntheticToken.safeApprove(_smartFarmingManager, 0);\n _syntheticToken.safeApprove(_smartFarmingManager, amount_);\n ISmartFarmingManager(_smartFarmingManager).crossChainFlashRepayCallback(_requestId, amount_);\n }\n\n /**\n * @dev Swap synthetic token for underlying and trigger callback call\n */\n function _swapAndTriggerLeverageCallback(uint16 srcChainId_, uint amountIn_, bytes calldata payload_) private {\n // 1. Swap\n (\n address _srcSmartFarmingManager,\n address _dstProxyOFT,\n uint256 _requestId,\n uint256 _sgPoolId,\n address _account,\n uint256 _amountOutMin,\n uint256 _callbackTxNativeFee\n ) = CrossChainLib.decodeLeverageSwapPayload(payload_);\n\n address _bridgeToken = IStargatePool(IStargateFactory(stargateComposer.factory()).getPool(_sgPoolId)).token();\n\n if (_bridgeToken == sgeth) _bridgeToken = weth;\n\n amountIn_ = _swap({\n requestId_: _requestId,\n tokenIn_: IProxyOFT(_dstProxyOFT).token(),\n tokenOut_: _bridgeToken,\n amountIn_: amountIn_,\n amountOutMin_: _amountOutMin\n });\n\n // 2. Transfer underlying to source chain\n uint16 _srcChainId = srcChainId_;\n\n _sendUsingStargate(\n LayerZeroParams({\n tokenIn: _bridgeToken,\n dstChainId: _srcChainId,\n amountIn: amountIn_,\n nativeFee: _callbackTxNativeFee + extraCallbackTxNativeFee[_requestId],\n payload: CrossChainLib.encodeLeverageCallbackPayload(_srcSmartFarmingManager, _requestId),\n refundAddress: _account,\n dstGasForCall: leverageCallbackTxGasLimit,\n dstNativeAmount: 0\n })\n );\n }\n\n /**\n * @notice Receive token and payload from Stargate\n * @param srcChainId_ The chain id of the source chain.\n * @param srcAddress_ The remote Bridge address\n * @param token_ The token contract on the local chain\n * @param amountLD_ The qty of local _token contract tokens\n * @param payload_ The payload\n */\n function sgReceive(\n uint16 srcChainId_,\n bytes memory srcAddress_,\n uint256 /*nonce_*/,\n address token_,\n uint256 amountLD_,\n bytes memory payload_\n ) external override onlyIfStargateComposer {\n // Note: Stargate uses SGETH as `token_` when receiving native ETH\n if (token_ == sgeth) {\n IWETH(weth).deposit{value: amountLD_}();\n token_ = weth;\n }\n\n address _srcAddress = srcAddress_.toAddress(0);\n\n if (_srcAddress == address(0) || _srcAddress != crossChainDispatcherOf[srcChainId_])\n revert InvalidFromAddress();\n\n uint8 _op = CrossChainLib.getOperationType(payload_);\n\n if (_op == CrossChainLib.LEVERAGE) {\n _crossChainLeverageCallback(token_, amountLD_, payload_);\n } else if (_op == CrossChainLib.FLASH_REPAY) {\n _swapAndTriggerFlashRepayCallback(srcChainId_, token_, amountLD_, payload_);\n } else {\n revert InvalidOperationType();\n }\n }\n\n /**\n * @dev Finalize cross-chain leverage process. The callback may fail due to slippage.\n */\n function _crossChainLeverageCallback(address bridgeToken_, uint256 amount_, bytes memory payload_) private {\n (address _smartFarmingManager, uint256 _requestId) = CrossChainLib.decodeLeverageCallbackPayload(payload_);\n IERC20(bridgeToken_).safeApprove(_smartFarmingManager, 0);\n IERC20(bridgeToken_).safeApprove(_smartFarmingManager, amount_);\n ISmartFarmingManager(_smartFarmingManager).crossChainLeverageCallback(_requestId, amount_);\n }\n\n /**\n * @dev Send synthetic token cross-chain\n */\n function _sendUsingLayerZero(LayerZeroParams memory params_) private {\n address _to = crossChainDispatcherOf[params_.dstChainId];\n if (_to == address(0)) revert AddressIsNull();\n\n bytes memory _adapterParams = abi.encodePacked(\n LZ_ADAPTER_PARAMS_VERSION,\n uint256(lzBaseGasLimit + params_.dstGasForCall),\n params_.dstNativeAmount,\n (params_.dstNativeAmount > 0) ? _to : address(0)\n );\n\n ISyntheticToken(params_.tokenIn).proxyOFT().sendAndCall{value: params_.nativeFee}({\n _from: address(this),\n _dstChainId: params_.dstChainId,\n _toAddress: abi.encodePacked(_to),\n _amount: params_.amountIn,\n _payload: params_.payload,\n _dstGasForCall: params_.dstGasForCall,\n _refundAddress: payable(params_.refundAddress),\n _zroPaymentAddress: address(0),\n _adapterParams: _adapterParams\n });\n }\n\n /**\n * @dev Swap underlying for synthetic token and trigger callback call\n */\n function _swapAndTriggerFlashRepayCallback(\n uint16 srcChainId_,\n address token_,\n uint256 amount_,\n bytes memory payload_\n ) private {\n // 1. Swap\n (\n address _srcSmartFarmingManager,\n address _dstProxyOFT,\n uint256 _requestId,\n address _account,\n uint256 _amountOutMin,\n uint256 _callbackTxNativeFee\n ) = CrossChainLib.decodeFlashRepaySwapPayload(payload_);\n\n address _syntheticToken = IProxyOFT(_dstProxyOFT).token();\n amount_ = _swap({\n requestId_: _requestId,\n tokenIn_: token_,\n tokenOut_: _syntheticToken,\n amountIn_: amount_,\n amountOutMin_: _amountOutMin\n });\n\n // 2. Transfer synthetic token to source chain\n uint16 _srcChainId = srcChainId_;\n address _srcProxyOFT = IProxyOFT(_dstProxyOFT).getProxyOFTOf(_srcChainId);\n\n _sendUsingLayerZero(\n LayerZeroParams({\n tokenIn: _syntheticToken,\n dstChainId: _srcChainId,\n amountIn: amount_,\n payload: CrossChainLib.encodeFlashRepayCallbackPayload(\n _srcProxyOFT,\n _srcSmartFarmingManager,\n _requestId\n ),\n refundAddress: _account,\n dstGasForCall: flashRepayCallbackTxGasLimit,\n dstNativeAmount: 0,\n nativeFee: _callbackTxNativeFee + extraCallbackTxNativeFee[_requestId]\n })\n );\n }\n\n /**\n * @notice Retry swap underlying and trigger callback.\n * @param srcChainId_ The source chain of failed tx\n * @param srcAddress_ The source path of failed tx\n * @param nonce_ The nonce of failed tx\n * @param token_ The token of failed tx\n * @param amount_ The amountIn of failed tx\n * @param payload_ The payload of failed tx\n * @param newAmountOutMin_ If swap failed due to slippage, caller may set lower newAmountOutMin_\n */\n function retrySwapAndTriggerFlashRepayCallback(\n uint16 srcChainId_,\n bytes calldata srcAddress_,\n uint64 nonce_,\n address token_,\n uint256 amount_,\n bytes calldata payload_,\n uint256 newAmountOutMin_\n ) external payable nonReentrant {\n IStargateComposerWithRetry _stargateComposer = IStargateComposerWithRetry(address(stargateComposer));\n\n bytes memory _sgReceiveCallData = abi.encodeWithSelector(\n IStargateReceiver.sgReceive.selector,\n srcChainId_,\n abi.encodePacked(crossChainDispatcherOf[srcChainId_]),\n nonce_,\n token_,\n amount_,\n payload_\n );\n\n (, , uint256 _requestId, address _account, , ) = CrossChainLib.decodeFlashRepaySwapPayload(payload_);\n\n if (msg.value > 0) {\n extraCallbackTxNativeFee[_requestId] += msg.value;\n }\n\n if (msg.sender == _account) {\n // Note: If `swapAmountOutMin[_requestId]` is `0` (default value), swap function will use payload's slippage param\n if (newAmountOutMin_ == 0) revert InvalidSlippageParam();\n swapAmountOutMin[_requestId] = newAmountOutMin_;\n }\n\n // Note: `clearCachedSwap()` has checks to ensure that the args are consistent\n _stargateComposer.clearCachedSwap(srcChainId_, srcAddress_, nonce_, address(this), _sgReceiveCallData);\n }\n\n /**\n * @notice Retry swap and trigger callback.\n * @param srcChainId_ The source chain of failed tx\n * @param srcAddress_ The source path of failed tx\n * @param nonce_ The nonce of failed tx\n * @param amount_ The amountIn of failed tx\n * @param payload_ The payload of failed tx\n * @param newAmountOutMin_ If swap failed due to slippage, caller may set lower newAmountOutMin_\n */\n function retrySwapAndTriggerLeverageCallback(\n uint16 srcChainId_,\n bytes calldata srcAddress_,\n uint64 nonce_,\n uint256 amount_,\n bytes calldata payload_,\n uint256 newAmountOutMin_\n ) external payable nonReentrant {\n (, address _dstProxyOFT, uint256 _requestId, , address _account, , ) = CrossChainLib.decodeLeverageSwapPayload(\n payload_\n );\n\n if (!_isValidProxyOFT(_dstProxyOFT)) revert InvalidPayload();\n\n if (msg.value > 0) {\n extraCallbackTxNativeFee[_requestId] += msg.value;\n }\n\n if (msg.sender == _account) {\n // Note: If `swapAmountOutMin[_requestId]` is `0` (default value), swap function will use payload's slippage param\n if (newAmountOutMin_ == 0) revert InvalidSlippageParam();\n swapAmountOutMin[_requestId] = newAmountOutMin_;\n }\n\n // Note: `retryOFTReceived()` has checks to ensure that the args are consistent\n bytes memory _from = abi.encodePacked(crossChainDispatcherOf[srcChainId_]);\n IProxyOFT(_dstProxyOFT).retryOFTReceived(\n srcChainId_,\n srcAddress_,\n nonce_,\n _from,\n address(this),\n amount_,\n payload_\n );\n }\n\n /***\n * @notice Trigger swap using Stargate for flashRepay.\n * @param requestId_ Request id.\n * @param account_ User address and also refund address\n * @param tokenIn_ tokenIn\n * @param tokenOut_ tokenOut\n * @param amountIn_ amountIn_\n * @param amountOutMin_ amountOutMin_\n * @param lzArgs_ LayerZero method argument\n */\n function triggerFlashRepaySwap(\n uint256 requestId_,\n address payable account_,\n address tokenIn_,\n address tokenOut_,\n uint256 amountIn_,\n uint256 amountOutMin_,\n bytes calldata lzArgs_\n ) external payable override nonReentrant onlyIfSmartFarmingManager onlyIfBridgingIsNotPaused {\n address _account = account_; // stack too deep\n\n (uint16 _dstChainId, uint256 callbackTxNativeFee_, uint64 flashRepaySwapTxGasLimit_) = CrossChainLib\n .decodeLzArgs(lzArgs_);\n\n bytes memory _payload;\n {\n address _dstProxyOFT = ISyntheticToken(tokenOut_).proxyOFT().getProxyOFTOf(_dstChainId);\n\n if (_dstProxyOFT == address(0)) revert AddressIsNull();\n if (!isDestinationChainSupported[_dstChainId]) revert DestinationChainNotAllowed();\n\n uint256 _requestId = requestId_; // stack too deep\n\n _payload = CrossChainLib.encodeFlashRepaySwapPayload({\n srcSmartFarmingManager_: msg.sender,\n dstProxyOFT_: _dstProxyOFT,\n requestId_: _requestId,\n account_: _account,\n amountOutMin_: amountOutMin_,\n callbackTxNativeFee_: callbackTxNativeFee_\n });\n }\n\n _sendUsingStargate(\n LayerZeroParams({\n tokenIn: tokenIn_,\n dstChainId: _dstChainId,\n amountIn: amountIn_,\n nativeFee: msg.value,\n payload: _payload,\n refundAddress: _account,\n dstGasForCall: flashRepaySwapTxGasLimit_,\n dstNativeAmount: callbackTxNativeFee_\n })\n );\n }\n\n /***\n * @notice Send synthetic token and trigger swap at destination chain\n * @dev Not checking if bridging is pause because `ProxyOFT._debitFrom()` does it\n * @param requestId_ Request id.\n * @param account_ User address and also refund address\n * @param tokenOut_ tokenOut\n * @param amountIn_ amountIn\n * @param amountOutMin_ amountOutMin\n * @param lzArgs_ LayerZero method argument\n */\n function triggerLeverageSwap(\n uint256 requestId_,\n address payable account_,\n address tokenIn_,\n address tokenOut_,\n uint256 amountIn_,\n uint256 amountOutMin_,\n bytes calldata lzArgs_\n ) external payable override nonReentrant onlyIfSmartFarmingManager onlyIfBridgingIsNotPaused {\n address _account = account_; // stack too deep\n\n (uint16 _dstChainId, uint256 _callbackTxNativeFee, uint64 _leverageSwapTxGasLimit) = CrossChainLib.decodeLzArgs(\n lzArgs_\n );\n\n bytes memory _payload;\n {\n address _tokenOut = tokenOut_; // stack too deep\n uint256 _requestId = requestId_; // stack too deep\n uint256 _amountOutMin = amountOutMin_; // stack too deep\n\n address _dstProxyOFT = ISyntheticToken(tokenIn_).proxyOFT().getProxyOFTOf(_dstChainId);\n uint256 _sgPoolId = stargatePoolIdOf[_tokenOut];\n\n if (_dstProxyOFT == address(0)) revert AddressIsNull();\n if (!isDestinationChainSupported[_dstChainId]) revert DestinationChainNotAllowed();\n if (_sgPoolId == 0) revert BridgeTokenNotSupported();\n\n _payload = CrossChainLib.encodeLeverageSwapPayload({\n srcSmartFarmingManager_: msg.sender,\n dstProxyOFT_: _dstProxyOFT,\n requestId_: _requestId,\n sgPoolId_: _sgPoolId,\n account_: _account,\n amountOutMin_: _amountOutMin,\n callbackTxNativeFee_: _callbackTxNativeFee\n });\n }\n\n _sendUsingLayerZero(\n LayerZeroParams({\n tokenIn: tokenIn_,\n dstChainId: _dstChainId,\n amountIn: amountIn_,\n payload: _payload,\n refundAddress: _account,\n dstGasForCall: _leverageSwapTxGasLimit,\n dstNativeAmount: _callbackTxNativeFee,\n nativeFee: msg.value\n })\n );\n }\n\n /**\n * @dev Check wether an address is a proxyOFT or not\n */\n function _isValidProxyOFT(address proxyOFT_) private view returns (bool) {\n ISyntheticToken _syntheticToken = ISyntheticToken(IProxyOFT(proxyOFT_).token());\n if (!poolRegistry.doesSyntheticTokenExist(_syntheticToken)) return false;\n if (proxyOFT_ != address(_syntheticToken.proxyOFT())) return false;\n\n return true;\n }\n\n /**\n * @dev Send underlying token cross-chain\n */\n function _sendUsingStargate(LayerZeroParams memory params_) private {\n IStargateRouter.lzTxObj memory _lzTxParams;\n bytes memory _to = abi.encodePacked(crossChainDispatcherOf[params_.dstChainId]);\n {\n if (_to.toAddress(0) == address(0)) revert AddressIsNull();\n\n _lzTxParams = IStargateRouter.lzTxObj({\n dstGasForCall: params_.dstGasForCall,\n dstNativeAmount: params_.dstNativeAmount,\n dstNativeAddr: (params_.dstNativeAmount > 0) ? _to : abi.encode(0)\n });\n }\n\n uint256 _poolId = stargatePoolIdOf[params_.tokenIn];\n if (_poolId == 0) revert BridgeTokenNotSupported();\n uint256 _amountOutMin = (params_.amountIn * (MAX_BPS - stargateSlippage)) / MAX_BPS;\n bytes memory _payload = params_.payload;\n\n IStargateComposer _stargateComposer = stargateComposer;\n\n // Note: StargateComposer only accepts native for ETH pool\n if (params_.tokenIn == weth) {\n IWETH(weth).withdraw(params_.amountIn);\n params_.nativeFee += params_.amountIn;\n } else {\n IERC20(params_.tokenIn).safeApprove(address(_stargateComposer), 0);\n IERC20(params_.tokenIn).safeApprove(address(_stargateComposer), params_.amountIn);\n }\n\n _stargateComposer.swap{value: params_.nativeFee}({\n _dstChainId: params_.dstChainId,\n _srcPoolId: _poolId,\n _dstPoolId: _poolId,\n _refundAddress: payable(params_.refundAddress),\n _amountLD: params_.amountIn,\n _minAmountLD: _amountOutMin,\n _lzTxParams: _lzTxParams,\n _to: _to,\n _payload: _payload\n });\n }\n\n /**\n * @dev Perform a swap considering slippage param from user\n */\n function _swap(\n uint256 requestId_,\n address tokenIn_,\n address tokenOut_,\n uint256 amountIn_,\n uint256 amountOutMin_\n ) private returns (uint256 _amountOut) {\n // 1. Use updated slippage if exist\n uint256 _storedAmountOutMin = swapAmountOutMin[requestId_];\n if (_storedAmountOutMin > 0) {\n // Use stored slippage and clear it\n amountOutMin_ = _storedAmountOutMin;\n delete swapAmountOutMin[requestId_];\n }\n\n // 2. Perform swap\n ISwapper _swapper = poolRegistry.swapper();\n IERC20(tokenIn_).safeApprove(address(_swapper), 0);\n IERC20(tokenIn_).safeApprove(address(_swapper), amountIn_);\n _amountOut = _swapper.swapExactInput({\n tokenIn_: tokenIn_,\n tokenOut_: tokenOut_,\n amountIn_: amountIn_,\n amountOutMin_: amountOutMin_,\n receiver_: address(this)\n });\n }\n\n /**\n * @notice Update flash repay callback tx gas limit\n */\n function updateFlashRepayCallbackTxGasLimit(uint64 newFlashRepayCallbackTxGasLimit_) external onlyGovernor {\n uint64 _currentFlashRepayCallbackTxGasLimit = flashRepayCallbackTxGasLimit;\n if (newFlashRepayCallbackTxGasLimit_ == _currentFlashRepayCallbackTxGasLimit) revert NewValueIsSameAsCurrent();\n emit FlashRepayCallbackTxGasLimitUpdated(\n _currentFlashRepayCallbackTxGasLimit,\n newFlashRepayCallbackTxGasLimit_\n );\n flashRepayCallbackTxGasLimit = newFlashRepayCallbackTxGasLimit_;\n }\n\n /**\n * @notice Update flash repay swap tx gas limit\n */\n function updateFlashRepaySwapTxGasLimit(uint64 newFlashRepaySwapTxGasLimit_) external onlyGovernor {\n uint64 _currentFlashRepaySwapTxGasLimit = flashRepaySwapTxGasLimit;\n if (newFlashRepaySwapTxGasLimit_ == _currentFlashRepaySwapTxGasLimit) revert NewValueIsSameAsCurrent();\n emit FlashRepaySwapTxGasLimitUpdated(_currentFlashRepaySwapTxGasLimit, newFlashRepaySwapTxGasLimit_);\n flashRepaySwapTxGasLimit = newFlashRepaySwapTxGasLimit_;\n }\n\n /**\n * @notice Update leverage callback tx gas limit\n */\n function updateLeverageCallbackTxGasLimit(uint64 newLeverageCallbackTxGasLimit_) external onlyGovernor {\n uint64 _currentLeverageCallbackTxGasLimit = leverageCallbackTxGasLimit;\n if (newLeverageCallbackTxGasLimit_ == _currentLeverageCallbackTxGasLimit) revert NewValueIsSameAsCurrent();\n emit LeverageCallbackTxGasLimitUpdated(_currentLeverageCallbackTxGasLimit, newLeverageCallbackTxGasLimit_);\n leverageCallbackTxGasLimit = newLeverageCallbackTxGasLimit_;\n }\n\n /**\n * @notice Update leverage swap tx gas limit\n */\n function updateLeverageSwapTxGasLimit(uint64 newLeverageSwapTxGasLimit_) external onlyGovernor {\n uint64 _currentSwapTxGasLimit = leverageSwapTxGasLimit;\n if (newLeverageSwapTxGasLimit_ == _currentSwapTxGasLimit) revert NewValueIsSameAsCurrent();\n emit LeverageSwapTxGasLimitUpdated(_currentSwapTxGasLimit, newLeverageSwapTxGasLimit_);\n leverageSwapTxGasLimit = newLeverageSwapTxGasLimit_;\n }\n\n /**\n * @notice Update Lz base gas limit\n */\n function updateLzBaseGasLimit(uint256 newLzBaseGasLimit_) external onlyGovernor {\n uint256 _currentBaseGasLimit = lzBaseGasLimit;\n if (newLzBaseGasLimit_ == _currentBaseGasLimit) revert NewValueIsSameAsCurrent();\n emit LzBaseGasLimitUpdated(_currentBaseGasLimit, newLzBaseGasLimit_);\n lzBaseGasLimit = newLzBaseGasLimit_;\n }\n\n /**\n * @notice Update Stargate pool id of token.\n * @dev Use LZ ids (https://stargateprotocol.gitbook.io/stargate/developers/pool-ids)\n */\n function updateStargatePoolIdOf(address token_, uint256 newPoolId_) external onlyGovernor {\n uint256 _currentPoolId = stargatePoolIdOf[token_];\n if (newPoolId_ == _currentPoolId) revert NewValueIsSameAsCurrent();\n emit StargatePoolIdUpdated(token_, _currentPoolId, newPoolId_);\n stargatePoolIdOf[token_] = newPoolId_;\n }\n\n /**\n * @notice Update Stargate slippage\n */\n function updateStargateSlippage(uint256 newStargateSlippage_) external onlyGovernor {\n uint256 _currentStargateSlippage = stargateSlippage;\n if (newStargateSlippage_ == _currentStargateSlippage) revert NewValueIsSameAsCurrent();\n emit StargateSlippageUpdated(_currentStargateSlippage, newStargateSlippage_);\n stargateSlippage = newStargateSlippage_;\n }\n\n /**\n * @notice Update StargateComposer\n */\n function updateStargateComposer(IStargateComposer newStargateComposer_) external onlyGovernor {\n IStargateComposer _currentStargateComposer = stargateComposer;\n if (newStargateComposer_ == _currentStargateComposer) revert NewValueIsSameAsCurrent();\n emit StargateComposerUpdated(_currentStargateComposer, newStargateComposer_);\n stargateComposer = newStargateComposer_;\n }\n\n /**\n * @notice Pause/Unpause bridge transfers\n */\n function toggleBridgingIsActive() external onlyGovernor {\n bool _newIsBridgingActive = !isBridgingActive;\n emit BridgingIsActiveUpdated(_newIsBridgingActive);\n isBridgingActive = _newIsBridgingActive;\n }\n\n /**\n * @notice Update Cross-chain dispatcher mapping\n */\n function updateCrossChainDispatcherOf(uint16 chainId_, address crossChainDispatcher_) external onlyGovernor {\n address _current = crossChainDispatcherOf[chainId_];\n if (crossChainDispatcher_ == _current) revert NewValueIsSameAsCurrent();\n emit CrossChainDispatcherUpdated(chainId_, _current, crossChainDispatcher_);\n crossChainDispatcherOf[chainId_] = crossChainDispatcher_;\n }\n\n /**\n * @notice Allow/Disallow destination chain\n * @dev Use LZ chain id\n */\n function toggleDestinationChainIsActive(uint16 chainId_) external onlyGovernor {\n bool _isDestinationChainSupported = !isDestinationChainSupported[chainId_];\n emit BridgingIsActiveUpdated(_isDestinationChainSupported);\n isDestinationChainSupported[chainId_] = _isDestinationChainSupported;\n }\n}\n" + }, + "contracts/DebtToken.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"./utils/ReentrancyGuard.sol\";\nimport \"./utils/TokenHolder.sol\";\nimport \"./access/Manageable.sol\";\nimport \"./storage/DebtTokenStorage.sol\";\nimport \"./lib/WadRayMath.sol\";\n\nerror SyntheticDoesNotExist();\nerror SyntheticIsInactive();\nerror DebtTokenInactive();\nerror NameIsNull();\nerror SymbolIsNull();\nerror PoolIsNull();\nerror SyntheticIsNull();\nerror AllowanceNotSupported();\nerror ApprovalNotSupported();\nerror AmountIsZero();\nerror NotEnoughCollateral();\nerror DebtLowerThanTheFloor();\nerror RemainingDebtIsLowerThanTheFloor();\nerror TransferNotSupported();\nerror BurnFromNullAddress();\nerror BurnAmountExceedsBalance();\nerror MintToNullAddress();\nerror SurpassMaxDebtSupply();\nerror NewValueIsSameAsCurrent();\nerror SenderIsNotSmartFarmingManager();\n\n/**\n * @title Non-transferable token that represents users' debts\n */\ncontract DebtToken is ReentrancyGuard, TokenHolder, Manageable, DebtTokenStorageV2 {\n using WadRayMath for uint256;\n\n string public constant VERSION = \"1.3.0\";\n\n uint256 public constant SECONDS_PER_YEAR = 365.25 days;\n uint256 private constant HUNDRED_PERCENT = 1e18;\n\n /// @notice Emitted when synthetic's debt is repaid\n event DebtRepaid(address indexed payer, address indexed account, uint256 amount, uint256 repaid, uint256 fee);\n\n /// @notice Emitted when active flag is updated\n event DebtTokenActiveUpdated(bool newActive);\n\n /// @notice Emitted when interest rate is updated\n event InterestRateUpdated(uint256 oldInterestRate, uint256 newInterestRate);\n\n /// @notice Emitted when max total supply is updated\n event MaxTotalSupplyUpdated(uint256 oldMaxTotalSupply, uint256 newMaxTotalSupply);\n\n /// @notice Emitted when synthetic token is issued\n event SyntheticTokenIssued(\n address indexed account,\n address indexed to,\n uint256 amount,\n uint256 issued,\n uint256 fee\n );\n\n /**\n * @dev Throws if sender is not SmartFarmingManager\n */\n modifier onlyIfSmartFarmingManager() {\n if (msg.sender != address(pool.smartFarmingManager())) revert SenderIsNotSmartFarmingManager();\n _;\n }\n\n /**\n * @dev Throws if synthetic token doesn't exist\n */\n modifier onlyIfSyntheticTokenExists() {\n if (!pool.doesSyntheticTokenExist(syntheticToken)) revert SyntheticDoesNotExist();\n _;\n }\n\n /**\n * @dev Throws if debt token isn't enabled\n */\n modifier onlyIfDebtTokenIsActive() {\n if (!isActive) revert DebtTokenInactive();\n _;\n }\n\n /**\n * @dev Throws if synthetic token isn't enabled\n */\n modifier onlyIfSyntheticTokenIsActive() {\n if (!syntheticToken.isActive()) revert SyntheticIsInactive();\n _;\n }\n\n /**\n * @notice Update reward contracts' states\n * @dev Should be called before balance changes (i.e. mint/burn)\n */\n modifier updateRewardsBeforeMintOrBurn(address account_) {\n address[] memory _rewardsDistributors = pool.getRewardsDistributors();\n ISyntheticToken _syntheticToken = syntheticToken;\n uint256 _length = _rewardsDistributors.length;\n for (uint256 i; i < _length; ++i) {\n IRewardsDistributor(_rewardsDistributors[i]).updateBeforeMintOrBurn(_syntheticToken, account_);\n }\n _;\n }\n\n constructor() {\n _disableInitializers();\n }\n\n function initialize(\n string calldata name_,\n string calldata symbol_,\n IPool pool_,\n ISyntheticToken syntheticToken_,\n uint256 interestRate_,\n uint256 maxTotalSupply_\n ) external initializer {\n if (bytes(name_).length == 0) revert NameIsNull();\n if (bytes(symbol_).length == 0) revert SymbolIsNull();\n if (address(pool_) == address(0)) revert PoolIsNull();\n if (address(syntheticToken_) == address(0)) revert SyntheticIsNull();\n\n __ReentrancyGuard_init();\n __Manageable_init(pool_);\n\n name = name_;\n symbol = symbol_;\n decimals = syntheticToken_.decimals();\n syntheticToken = syntheticToken_;\n lastTimestampAccrued = block.timestamp;\n debtIndex = 1e18;\n interestRate = interestRate_;\n maxTotalSupply = maxTotalSupply_;\n isActive = true;\n }\n\n /**\n * @notice Accrue interest over debt supply\n */\n function accrueInterest() public override {\n (\n uint256 _interestAmountAccrued,\n uint256 _debtIndex,\n uint256 _lastTimestampAccrued\n ) = _calculateInterestAccrual();\n\n if (block.timestamp == _lastTimestampAccrued) {\n return;\n }\n\n lastTimestampAccrued = block.timestamp;\n\n if (_interestAmountAccrued > 0) {\n totalSupply_ += _interestAmountAccrued;\n debtIndex = _debtIndex;\n\n // Note: Address states where minting will fail (e.g. the token is inactive, it reached max supply, etc)\n try syntheticToken.mint(pool.feeCollector(), _interestAmountAccrued + pendingInterestFee) {\n pendingInterestFee = 0;\n } catch {\n pendingInterestFee += _interestAmountAccrued;\n }\n }\n }\n\n /// @inheritdoc IERC20\n function allowance(address /*owner_*/, address /*spender_*/) external pure override returns (uint256) {\n revert AllowanceNotSupported();\n }\n\n /// @inheritdoc IERC20\n // solhint-disable-next-line\n function approve(address /*spender_*/, uint256 /*amount_*/) external override returns (bool) {\n revert ApprovalNotSupported();\n }\n\n /**\n * @notice Get the updated (principal + interest) user's debt\n */\n function balanceOf(address account_) public view override returns (uint256) {\n uint256 _principal = principalOf[account_];\n if (_principal == 0) {\n return 0;\n }\n\n (, uint256 _debtIndex, ) = _calculateInterestAccrual();\n\n // Note: The `debtIndex / debtIndexOf` gives the interest to apply to the principal amount\n return (_principal * _debtIndex) / debtIndexOf[account_];\n }\n\n /**\n * @notice Burn debt token\n * @param from_ The account to burn from\n * @param amount_ The amount to burn\n */\n function burn(address from_, uint256 amount_) external override onlyPool {\n _burn(from_, amount_);\n }\n\n /**\n * @notice Collect pending interest fee if any\n */\n function collectPendingInterestFee() external {\n uint256 _pendingInterestFee = pendingInterestFee;\n if (_pendingInterestFee > 0) {\n syntheticToken.mint(pool.feeCollector(), _pendingInterestFee);\n pendingInterestFee = 0;\n }\n }\n\n /**\n * @notice Lock collateral and mint synthetic token\n * @param amount_ The amount to mint\n * @param to_ The beneficiary account\n * @return _issued The amount issued after fees\n * @return _fee The fee amount collected\n */\n function issue(\n uint256 amount_,\n address to_\n )\n external\n override\n whenNotShutdown\n nonReentrant\n onlyIfSyntheticTokenExists\n returns (uint256 _issued, uint256 _fee)\n {\n if (amount_ == 0) revert AmountIsZero();\n\n accrueInterest();\n\n IPool _pool = pool;\n ISyntheticToken _syntheticToken = syntheticToken;\n\n (, , , , uint256 _issuableInUsd) = _pool.debtPositionOf(msg.sender);\n\n IMasterOracle _masterOracle = _pool.masterOracle();\n\n if (amount_ > _masterOracle.quoteUsdToToken(address(_syntheticToken), _issuableInUsd)) {\n revert NotEnoughCollateral();\n }\n\n _mint(_pool, _masterOracle, msg.sender, amount_);\n\n (_issued, _fee) = quoteIssueOut(amount_);\n if (_fee > 0) {\n _syntheticToken.mint(_pool.feeCollector(), _fee);\n }\n _syntheticToken.mint(to_, _issued);\n\n emit SyntheticTokenIssued(msg.sender, to_, amount_, _issued, _fee);\n }\n\n /**\n * @notice Issue synth without checking collateral and without minting debt tokens\n * @dev The healthy of outcome position must be done afterhand\n * @param to_ The beneficiary account\n * @param amount_ The amount to mint\n * @return _issued The amount issued after fees\n * @return _fee The fee amount collected\n */\n function flashIssue(\n address to_,\n uint256 amount_\n )\n external\n override\n onlyIfSmartFarmingManager\n whenNotShutdown\n nonReentrant\n onlyIfSyntheticTokenExists\n onlyIfDebtTokenIsActive\n returns (uint256 _issued, uint256 _fee)\n {\n if (amount_ == 0) revert AmountIsZero();\n\n accrueInterest();\n\n ISyntheticToken _syntheticToken = syntheticToken;\n\n (_issued, _fee) = quoteIssueOut(amount_);\n if (_fee > 0) {\n _syntheticToken.mint(pool.feeCollector(), _fee);\n }\n _syntheticToken.mint(to_, _issued);\n }\n\n /**\n * @notice Return interest rate (in percent) per second\n */\n function interestRatePerSecond() public view override returns (uint256) {\n return interestRate / SECONDS_PER_YEAR;\n }\n\n /**\n * @notice onlySmartFarmingManager:: Mint `amount_` of debtToken at `to_`.\n * @param to_ Receiver address\n * @param amount_ Token amount to mint\n */\n function mint(\n address to_,\n uint256 amount_\n )\n external\n override\n onlyIfSmartFarmingManager\n whenNotShutdown\n nonReentrant\n onlyIfSyntheticTokenExists\n onlyIfSyntheticTokenIsActive\n {\n accrueInterest();\n\n IPool _pool = pool;\n\n _mint(_pool, _pool.masterOracle(), to_, amount_);\n }\n\n /**\n * @notice Quote gross `_amount` to issue `amountToIssue_` synthetic tokens\n * @param amountToIssue_ Synth to issue\n * @return _amount Gross amount\n * @return _fee The fee amount to collect\n */\n function quoteIssueIn(uint256 amountToIssue_) external view override returns (uint256 _amount, uint256 _fee) {\n uint256 _issueFee = pool.feeProvider().issueFee();\n if (_issueFee == 0) {\n return (amountToIssue_, _fee);\n }\n\n _amount = amountToIssue_.wadDiv(HUNDRED_PERCENT - _issueFee);\n _fee = _amount - amountToIssue_;\n }\n\n /**\n * @notice Quote synthetic tokens `_amountToIssue` by using gross `_amount`\n * @param amount_ Gross amount\n * @return _amountToIssue Synth to issue\n * @return _fee The fee amount to collect\n */\n function quoteIssueOut(uint256 amount_) public view override returns (uint256 _amountToIssue, uint256 _fee) {\n uint256 _issueFee = pool.feeProvider().issueFee();\n if (_issueFee == 0) {\n return (amount_, _fee);\n }\n\n _fee = amount_.wadMul(_issueFee);\n _amountToIssue = amount_ - _fee;\n }\n\n /**\n * @notice Quote synthetic token `_amount` need to repay `amountToRepay_` debt\n * @param amountToRepay_ Debt amount to repay\n * @return _amount Gross amount\n * @return _fee The fee amount to collect\n */\n function quoteRepayIn(uint256 amountToRepay_) public view override returns (uint256 _amount, uint256 _fee) {\n uint256 _repayFee = pool.feeProvider().repayFee();\n if (_repayFee == 0) {\n return (amountToRepay_, _fee);\n }\n\n _fee = amountToRepay_.wadMul(_repayFee);\n _amount = amountToRepay_ + _fee;\n }\n\n /**\n * @notice Quote debt `_amountToRepay` by burning `_amount` synthetic tokens\n * @param amount_ Gross amount\n * @return _amountToRepay Debt amount to repay\n * @return _fee The fee amount to collect\n */\n function quoteRepayOut(uint256 amount_) public view override returns (uint256 _amountToRepay, uint256 _fee) {\n uint256 _repayFee = pool.feeProvider().repayFee();\n if (_repayFee == 0) {\n return (amount_, _fee);\n }\n\n _amountToRepay = amount_.wadDiv(HUNDRED_PERCENT + _repayFee);\n _fee = amount_ - _amountToRepay;\n }\n\n /**\n * @notice Send synthetic token to decrease debt\n * @dev The msg.sender is the payer and the account beneficed\n * @param onBehalfOf_ The account that will have debt decreased\n * @param amount_ The amount of synthetic token to burn (this is the gross amount, the repay fee will be subtracted from it)\n * @return _repaid The amount repaid after fees\n */\n function repay(\n address onBehalfOf_,\n uint256 amount_\n )\n external\n override\n whenNotShutdown\n nonReentrant\n onlyIfSyntheticTokenExists\n returns (uint256 _repaid, uint256 _fee)\n {\n if (amount_ == 0) revert AmountIsZero();\n\n accrueInterest();\n\n IPool _pool = pool;\n ISyntheticToken _syntheticToken = syntheticToken;\n\n (_repaid, _fee) = quoteRepayOut(amount_);\n if (_fee > 0) {\n _syntheticToken.seize(msg.sender, _pool.feeCollector(), _fee);\n }\n\n uint256 _debtFloorInUsd = _pool.debtFloorInUsd();\n if (_debtFloorInUsd > 0) {\n uint256 _newDebtInUsd = _pool.masterOracle().quoteTokenToUsd(\n address(_syntheticToken),\n balanceOf(onBehalfOf_) - _repaid\n );\n if (_newDebtInUsd > 0 && _newDebtInUsd < _debtFloorInUsd) {\n revert RemainingDebtIsLowerThanTheFloor();\n }\n }\n\n _syntheticToken.burn(msg.sender, _repaid);\n _burn(onBehalfOf_, _repaid);\n\n emit DebtRepaid(msg.sender, onBehalfOf_, amount_, _repaid, _fee);\n }\n\n /**\n * @notice Send synthetic token to decrease debt\n * @dev This function helps users to no leave debt dust behind\n * @param onBehalfOf_ The account that will have debt decreased\n * @return _repaid The amount repaid after fees\n * @return _fee The fee amount collected\n */\n function repayAll(\n address onBehalfOf_\n )\n external\n override\n whenNotShutdown\n nonReentrant\n onlyIfSyntheticTokenExists\n returns (uint256 _repaid, uint256 _fee)\n {\n accrueInterest();\n\n _repaid = balanceOf(onBehalfOf_);\n if (_repaid == 0) revert AmountIsZero();\n\n ISyntheticToken _syntheticToken = syntheticToken;\n\n uint256 _amount;\n (_amount, _fee) = quoteRepayIn(_repaid);\n\n if (_fee > 0) {\n _syntheticToken.seize(msg.sender, pool.feeCollector(), _fee);\n }\n\n _syntheticToken.burn(msg.sender, _repaid);\n _burn(onBehalfOf_, _repaid);\n\n emit DebtRepaid(msg.sender, onBehalfOf_, _amount, _repaid, _fee);\n }\n\n /**\n * @notice Return the total supply\n */\n function totalSupply() external view override returns (uint256) {\n (uint256 _interestAmountAccrued, , ) = _calculateInterestAccrual();\n return totalSupply_ + _interestAmountAccrued;\n }\n\n /// @inheritdoc IERC20\n // solhint-disable-next-line\n function transfer(address /*recipient_*/, uint256 /*amount_*/) external override returns (bool) {\n revert TransferNotSupported();\n }\n\n /// @inheritdoc IERC20\n // solhint-disable-next-line\n function transferFrom(\n address /*sender_*/,\n address /*recipient_*/,\n uint256 /*amount_*/\n ) external override returns (bool) {\n revert TransferNotSupported();\n }\n\n /**\n * @notice Destroy `amount` tokens from `account`, reducing the\n * total supply\n */\n function _burn(address account_, uint256 amount_) private updateRewardsBeforeMintOrBurn(account_) {\n if (account_ == address(0)) revert BurnFromNullAddress();\n\n uint256 _accountBalance = balanceOf(account_);\n if (_accountBalance < amount_) revert BurnAmountExceedsBalance();\n\n unchecked {\n principalOf[account_] = _accountBalance - amount_;\n debtIndexOf[account_] = debtIndex;\n totalSupply_ -= amount_;\n }\n\n emit Transfer(account_, address(0), amount_);\n\n // Remove this token from the debt tokens list if the sender's balance goes to zero\n if (amount_ > 0 && balanceOf(account_) == 0) {\n pool.removeFromDebtTokensOfAccount(account_);\n }\n }\n\n /**\n * @notice Calculate interest to accrue\n * @dev This util function avoids code duplication across `balanceOf` and `accrueInterest`\n * @return _interestAmountAccrued The total amount of debt tokens accrued\n * @return _debtIndex The new `debtIndex` value\n */\n function _calculateInterestAccrual()\n private\n view\n returns (uint256 _interestAmountAccrued, uint256 _debtIndex, uint256 _lastTimestampAccrued)\n {\n _lastTimestampAccrued = lastTimestampAccrued;\n _debtIndex = debtIndex;\n\n if (block.timestamp > _lastTimestampAccrued) {\n uint256 _interestRateToAccrue = interestRatePerSecond() * (block.timestamp - _lastTimestampAccrued);\n if (_interestRateToAccrue > 0) {\n _interestAmountAccrued = _interestRateToAccrue.wadMul(totalSupply_);\n _debtIndex += _interestRateToAccrue.wadMul(debtIndex);\n }\n }\n }\n\n /**\n * @dev Create `amount` tokens and assigns them to `account`, increasing\n * the total supply\n */\n function _mint(\n IPool pool_,\n IMasterOracle masterOracle_,\n address account_,\n uint256 amount_\n ) private onlyIfDebtTokenIsActive updateRewardsBeforeMintOrBurn(account_) {\n if (account_ == address(0)) revert MintToNullAddress();\n\n uint256 _debtFloorInUsd = pool_.debtFloorInUsd();\n uint256 _balanceBefore = balanceOf(account_);\n\n if (\n _debtFloorInUsd > 0 &&\n masterOracle_.quoteTokenToUsd(address(syntheticToken), _balanceBefore + amount_) < _debtFloorInUsd\n ) {\n revert DebtLowerThanTheFloor();\n }\n\n totalSupply_ += amount_;\n if (totalSupply_ > maxTotalSupply) revert SurpassMaxDebtSupply();\n\n principalOf[account_] = _balanceBefore + amount_;\n debtIndexOf[account_] = debtIndex;\n emit Transfer(address(0), account_, amount_);\n\n // Add this token to the debt tokens list if the recipient is receiving it for the 1st time\n if (_balanceBefore == 0 && amount_ > 0) {\n pool.addToDebtTokensOfAccount(account_);\n }\n }\n\n /// @inheritdoc TokenHolder\n // solhint-disable-next-line no-empty-blocks\n function _requireCanSweep() internal view override onlyGovernor {}\n\n /**\n * @notice Update max total supply\n */\n function updateMaxTotalSupply(uint256 newMaxTotalSupply_) external override onlyGovernor {\n uint256 _currentMaxTotalSupply = maxTotalSupply;\n if (newMaxTotalSupply_ == _currentMaxTotalSupply) revert NewValueIsSameAsCurrent();\n emit MaxTotalSupplyUpdated(_currentMaxTotalSupply, newMaxTotalSupply_);\n maxTotalSupply = newMaxTotalSupply_;\n }\n\n /**\n * @notice Update interest rate (APR)\n */\n function updateInterestRate(uint256 newInterestRate_) external override onlyGovernor {\n accrueInterest();\n uint256 _currentInterestRate = interestRate;\n if (newInterestRate_ == _currentInterestRate) revert NewValueIsSameAsCurrent();\n emit InterestRateUpdated(_currentInterestRate, newInterestRate_);\n interestRate = newInterestRate_;\n }\n\n /**\n * @notice Enable/Disable the Debt Token\n */\n function toggleIsActive() external override onlyGovernor {\n bool _newIsActive = !isActive;\n emit DebtTokenActiveUpdated(_newIsActive);\n isActive = _newIsActive;\n }\n}\n" + }, + "contracts/dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/interfaces/ILayerZeroEndpointUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.2;\n\nimport \"./ILayerZeroUserApplicationConfigUpgradeable.sol\";\n\ninterface ILayerZeroEndpointUpgradeable is ILayerZeroUserApplicationConfigUpgradeable {\n // @notice send a LayerZero message to the specified address at a LayerZero endpoint.\n // @param _dstChainId - the destination chain identifier\n // @param _destination - the address on destination chain (in bytes). address length/format may vary by chains\n // @param _payload - a custom bytes payload to send to the destination contract\n // @param _refundAddress - if the source transaction is cheaper than the amount of value passed, refund the additional amount to this address\n // @param _zroPaymentAddress - the address of the ZRO token holder who would pay for the transaction\n // @param _adapterParams - parameters for custom functionality. e.g. receive airdropped native gas from the relayer on destination\n function send(uint16 _dstChainId, bytes calldata _destination, bytes calldata _payload, address payable _refundAddress, address _zroPaymentAddress, bytes calldata _adapterParams) external payable;\n\n // @notice used by the messaging library to publish verified payload\n // @param _srcChainId - the source chain identifier\n // @param _srcAddress - the source contract (as bytes) at the source chain\n // @param _dstAddress - the address on destination chain\n // @param _nonce - the unbound message ordering nonce\n // @param _gasLimit - the gas limit for external contract execution\n // @param _payload - verified payload to send to the destination contract\n function receivePayload(uint16 _srcChainId, bytes calldata _srcAddress, address _dstAddress, uint64 _nonce, uint _gasLimit, bytes calldata _payload) external;\n\n // @notice get the inboundNonce of a lzApp from a source chain which could be EVM or non-EVM chain\n // @param _srcChainId - the source chain identifier\n // @param _srcAddress - the source chain contract address\n function getInboundNonce(uint16 _srcChainId, bytes calldata _srcAddress) external view returns (uint64);\n\n // @notice get the outboundNonce from this source chain which, consequently, is always an EVM\n // @param _srcAddress - the source chain contract address\n function getOutboundNonce(uint16 _dstChainId, address _srcAddress) external view returns (uint64);\n\n // @notice gets a quote in source native gas, for the amount that send() requires to pay for message delivery\n // @param _dstChainId - the destination chain identifier\n // @param _userApplication - the user app address on this EVM chain\n // @param _payload - the custom message to send over LayerZero\n // @param _payInZRO - if false, user app pays the protocol fee in native token\n // @param _adapterParam - parameters for the adapter service, e.g. send some dust native token to dstChain\n function estimateFees(uint16 _dstChainId, address _userApplication, bytes calldata _payload, bool _payInZRO, bytes calldata _adapterParam) external view returns (uint nativeFee, uint zroFee);\n\n // @notice get this Endpoint's immutable source identifier\n function getChainId() external view returns (uint16);\n\n // @notice the interface to retry failed message on this Endpoint destination\n // @param _srcChainId - the source chain identifier\n // @param _srcAddress - the source chain contract address\n // @param _payload - the payload to be retried\n function retryPayload(uint16 _srcChainId, bytes calldata _srcAddress, bytes calldata _payload) external;\n\n // @notice query if any STORED payload (message blocking) at the endpoint.\n // @param _srcChainId - the source chain identifier\n // @param _srcAddress - the source chain contract address\n function hasStoredPayload(uint16 _srcChainId, bytes calldata _srcAddress) external view returns (bool);\n\n // @notice query if the _libraryAddress is valid for sending msgs.\n // @param _userApplication - the user app address on this EVM chain\n function getSendLibraryAddress(address _userApplication) external view returns (address);\n\n // @notice query if the _libraryAddress is valid for receiving msgs.\n // @param _userApplication - the user app address on this EVM chain\n function getReceiveLibraryAddress(address _userApplication) external view returns (address);\n\n // @notice query if the non-reentrancy guard for send() is on\n // @return true if the guard is on. false otherwise\n function isSendingPayload() external view returns (bool);\n\n // @notice query if the non-reentrancy guard for receive() is on\n // @return true if the guard is on. false otherwise\n function isReceivingPayload() external view returns (bool);\n\n // @notice get the configuration of the LayerZero messaging library of the specified version\n // @param _version - messaging library version\n // @param _chainId - the chainId for the pending config change\n // @param _userApplication - the contract address of the user application\n // @param _configType - type of configuration. every messaging library has its own convention.\n function getConfig(uint16 _version, uint16 _chainId, address _userApplication, uint _configType) external view returns (bytes memory);\n\n // @notice get the send() LayerZero messaging library version\n // @param _userApplication - the contract address of the user application\n function getSendVersion(address _userApplication) external view returns (uint16);\n\n // @notice get the lzReceive() LayerZero messaging library version\n // @param _userApplication - the contract address of the user application\n function getReceiveVersion(address _userApplication) external view returns (uint16);\n}\n" + }, + "contracts/dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/interfaces/ILayerZeroReceiverUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.2;\n\ninterface ILayerZeroReceiverUpgradeable {\n // @notice LayerZero endpoint will invoke this function to deliver the message on the destination\n // @param _srcChainId - the source endpoint identifier\n // @param _srcAddress - the source sending contract address from the source chain\n // @param _nonce - the ordered message nonce\n // @param _payload - the signed payload is the UA bytes has encoded to be sent\n function lzReceive(uint16 _srcChainId, bytes calldata _srcAddress, uint64 _nonce, bytes calldata _payload) external;\n}\n" + }, + "contracts/dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/interfaces/ILayerZeroUserApplicationConfigUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.2;\n\ninterface ILayerZeroUserApplicationConfigUpgradeable {\n // @notice set the configuration of the LayerZero messaging library of the specified version\n // @param _version - messaging library version\n // @param _chainId - the chainId for the pending config change\n // @param _configType - type of configuration. every messaging library has its own convention.\n // @param _config - configuration in the bytes. can encode arbitrary content.\n function setConfig(uint16 _version, uint16 _chainId, uint _configType, bytes calldata _config) external;\n\n // @notice set the send() LayerZero messaging library version to _version\n // @param _version - new messaging library version\n function setSendVersion(uint16 _version) external;\n\n // @notice set the lzReceive() LayerZero messaging library version to _version\n // @param _version - new messaging library version\n function setReceiveVersion(uint16 _version) external;\n\n // @notice Only when the UA needs to resume the message flow in blocking mode and clear the stored payload\n // @param _srcChainId - the chainId of the source chain\n // @param _srcAddress - the contract address of the source contract at the source chain\n function forceResumeReceive(uint16 _srcChainId, bytes calldata _srcAddress) external;\n}\n" + }, + "contracts/dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/lzApp/LzAppUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.2;\n\nimport \"../../../../openzeppelin-upgradeable/access/OwnableUpgradeable.sol\";\nimport \"../interfaces/ILayerZeroReceiverUpgradeable.sol\";\nimport \"../interfaces/ILayerZeroUserApplicationConfigUpgradeable.sol\";\nimport \"../interfaces/ILayerZeroEndpointUpgradeable.sol\";\nimport \"../../util/BytesLib.sol\";\n\n/*\n * a generic LzReceiver implementation\n */\nabstract contract LzAppUpgradeable is\n Initializable,\n OwnableUpgradeable,\n ILayerZeroReceiverUpgradeable,\n ILayerZeroUserApplicationConfigUpgradeable\n{\n using BytesLib for bytes;\n\n // ua can not send payload larger than this by default, but it can be changed by the ua owner\n uint public constant DEFAULT_PAYLOAD_SIZE_LIMIT = 10000;\n\n ILayerZeroEndpointUpgradeable public lzEndpoint;\n mapping(uint16 => bytes) public trustedRemoteLookup;\n mapping(uint16 => mapping(uint16 => uint)) public minDstGasLookup;\n mapping(uint16 => uint) public payloadSizeLimitLookup;\n address public precrime;\n\n event SetPrecrime(address precrime);\n event SetTrustedRemote(uint16 _remoteChainId, bytes _path);\n event SetTrustedRemoteAddress(uint16 _remoteChainId, bytes _remoteAddress);\n event SetMinDstGas(uint16 _dstChainId, uint16 _type, uint _minDstGas);\n\n function __LzAppUpgradeable_init(address _endpoint) internal onlyInitializing {\n __Ownable_init_unchained();\n __LzAppUpgradeable_init_unchained(_endpoint);\n }\n\n function __LzAppUpgradeable_init_unchained(address _endpoint) internal onlyInitializing {\n lzEndpoint = ILayerZeroEndpointUpgradeable(_endpoint);\n }\n\n function lzReceive(\n uint16 _srcChainId,\n bytes calldata _srcAddress,\n uint64 _nonce,\n bytes calldata _payload\n ) public virtual override {\n // lzReceive must be called by the endpoint for security\n require(_msgSender() == address(lzEndpoint), \"LzApp: invalid endpoint caller\");\n\n bytes memory trustedRemote = trustedRemoteLookup[_srcChainId];\n // if will still block the message pathway from (srcChainId, srcAddress). should not receive message from untrusted remote.\n require(\n _srcAddress.length == trustedRemote.length &&\n trustedRemote.length > 0 &&\n keccak256(_srcAddress) == keccak256(trustedRemote),\n \"LzApp: invalid source sending contract\"\n );\n\n _blockingLzReceive(_srcChainId, _srcAddress, _nonce, _payload);\n }\n\n // abstract function - the default behaviour of LayerZero is blocking. See: NonblockingLzApp if you dont need to enforce ordered messaging\n function _blockingLzReceive(\n uint16 _srcChainId,\n bytes memory _srcAddress,\n uint64 _nonce,\n bytes memory _payload\n ) internal virtual;\n\n function _lzSend(\n uint16 _dstChainId,\n bytes memory _payload,\n address payable _refundAddress,\n address _zroPaymentAddress,\n bytes memory _adapterParams,\n uint _nativeFee\n ) internal virtual {\n bytes memory trustedRemote = trustedRemoteLookup[_dstChainId];\n require(trustedRemote.length != 0, \"LzApp: destination chain is not a trusted source\");\n _checkPayloadSize(_dstChainId, _payload.length);\n lzEndpoint.send{value: _nativeFee}(\n _dstChainId,\n trustedRemote,\n _payload,\n _refundAddress,\n _zroPaymentAddress,\n _adapterParams\n );\n }\n\n function _checkGasLimit(\n uint16 _dstChainId,\n uint16 _type,\n bytes memory _adapterParams,\n uint _extraGas\n ) internal view virtual {\n uint providedGasLimit = _getGasLimit(_adapterParams);\n uint minGasLimit = minDstGasLookup[_dstChainId][_type] + _extraGas;\n require(minGasLimit > 0, \"LzApp: minGasLimit not set\");\n require(providedGasLimit >= minGasLimit, \"LzApp: gas limit is too low\");\n }\n\n function _getGasLimit(bytes memory _adapterParams) internal pure virtual returns (uint gasLimit) {\n require(_adapterParams.length >= 34, \"LzApp: invalid adapterParams\");\n assembly {\n gasLimit := mload(add(_adapterParams, 34))\n }\n }\n\n function _checkPayloadSize(uint16 _dstChainId, uint _payloadSize) internal view virtual {\n uint payloadSizeLimit = payloadSizeLimitLookup[_dstChainId];\n if (payloadSizeLimit == 0) {\n // use default if not set\n payloadSizeLimit = DEFAULT_PAYLOAD_SIZE_LIMIT;\n }\n require(_payloadSize <= payloadSizeLimit, \"LzApp: payload size is too large\");\n }\n\n //---------------------------UserApplication config----------------------------------------\n function getConfig(\n uint16 _version,\n uint16 _chainId,\n address,\n uint _configType\n ) external view returns (bytes memory) {\n return lzEndpoint.getConfig(_version, _chainId, address(this), _configType);\n }\n\n // generic config for LayerZero user Application\n function setConfig(\n uint16 _version,\n uint16 _chainId,\n uint _configType,\n bytes calldata _config\n ) external override onlyOwner {\n lzEndpoint.setConfig(_version, _chainId, _configType, _config);\n }\n\n function setSendVersion(uint16 _version) external override onlyOwner {\n lzEndpoint.setSendVersion(_version);\n }\n\n function setReceiveVersion(uint16 _version) external override onlyOwner {\n lzEndpoint.setReceiveVersion(_version);\n }\n\n function forceResumeReceive(uint16 _srcChainId, bytes calldata _srcAddress) external override onlyOwner {\n lzEndpoint.forceResumeReceive(_srcChainId, _srcAddress);\n }\n\n // _path = abi.encodePacked(remoteAddress, localAddress)\n // this function set the trusted path for the cross-chain communication\n function setTrustedRemote(uint16 _srcChainId, bytes calldata _path) external onlyOwner {\n trustedRemoteLookup[_srcChainId] = _path;\n emit SetTrustedRemote(_srcChainId, _path);\n }\n\n function setTrustedRemoteAddress(uint16 _remoteChainId, bytes calldata _remoteAddress) external onlyOwner {\n trustedRemoteLookup[_remoteChainId] = abi.encodePacked(_remoteAddress, address(this));\n emit SetTrustedRemoteAddress(_remoteChainId, _remoteAddress);\n }\n\n function getTrustedRemoteAddress(uint16 _remoteChainId) external view returns (bytes memory) {\n bytes memory path = trustedRemoteLookup[_remoteChainId];\n require(path.length != 0, \"LzApp: no trusted path record\");\n return path.slice(0, path.length - 20); // the last 20 bytes should be address(this)\n }\n\n function setPrecrime(address _precrime) external onlyOwner {\n precrime = _precrime;\n emit SetPrecrime(_precrime);\n }\n\n function setMinDstGas(uint16 _dstChainId, uint16 _packetType, uint _minGas) external onlyOwner {\n require(_minGas > 0, \"LzApp: invalid minGas\");\n minDstGasLookup[_dstChainId][_packetType] = _minGas;\n emit SetMinDstGas(_dstChainId, _packetType, _minGas);\n }\n\n // if the size is 0, it means default size limit\n function setPayloadSizeLimit(uint16 _dstChainId, uint _size) external onlyOwner {\n payloadSizeLimitLookup[_dstChainId] = _size;\n }\n\n //--------------------------- VIEW FUNCTION ----------------------------------------\n function isTrustedRemote(uint16 _srcChainId, bytes calldata _srcAddress) external view returns (bool) {\n bytes memory trustedSource = trustedRemoteLookup[_srcChainId];\n return keccak256(trustedSource) == keccak256(_srcAddress);\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 uint[45] private __gap;\n}\n" + }, + "contracts/dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/lzApp/NonblockingLzAppUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.2;\n\nimport \"./LzAppUpgradeable.sol\";\nimport \"../../util/ExcessivelySafeCall.sol\";\n\n/*\n * the default LayerZero messaging behaviour is blocking, i.e. any failed message will block the channel\n * this abstract class try-catch all fail messages and store locally for future retry. hence, non-blocking\n * NOTE: if the srcAddress is not configured properly, it will still block the message pathway from (srcChainId, srcAddress)\n */\nabstract contract NonblockingLzAppUpgradeable is Initializable, LzAppUpgradeable {\n using ExcessivelySafeCall for address;\n\n function __NonblockingLzAppUpgradeable_init(address _endpoint) internal onlyInitializing {\n __Ownable_init_unchained();\n __LzAppUpgradeable_init_unchained(_endpoint);\n }\n\n function __NonblockingLzAppUpgradeable_init_unchained(address _endpoint) internal onlyInitializing {}\n\n mapping(uint16 => mapping(bytes => mapping(uint64 => bytes32))) public failedMessages;\n\n event MessageFailed(uint16 _srcChainId, bytes _srcAddress, uint64 _nonce, bytes _payload, bytes _reason);\n event RetryMessageSuccess(uint16 _srcChainId, bytes _srcAddress, uint64 _nonce, bytes32 _payloadHash);\n\n // overriding the virtual function in LzReceiver\n function _blockingLzReceive(uint16 _srcChainId, bytes memory _srcAddress, uint64 _nonce, bytes memory _payload) internal virtual override {\n (bool success, bytes memory reason) = address(this).excessivelySafeCall(gasleft(), 150, abi.encodeWithSelector(this.nonblockingLzReceive.selector, _srcChainId, _srcAddress, _nonce, _payload));\n // try-catch all errors/exceptions\n if (!success) {\n _storeFailedMessage(_srcChainId, _srcAddress, _nonce, _payload, reason);\n }\n }\n\n function _storeFailedMessage(uint16 _srcChainId, bytes memory _srcAddress, uint64 _nonce, bytes memory _payload, bytes memory _reason) internal virtual {\n failedMessages[_srcChainId][_srcAddress][_nonce] = keccak256(_payload);\n emit MessageFailed(_srcChainId, _srcAddress, _nonce, _payload, _reason);\n }\n\n function nonblockingLzReceive(uint16 _srcChainId, bytes calldata _srcAddress, uint64 _nonce, bytes calldata _payload) public virtual {\n // only internal transaction\n require(_msgSender() == address(this), \"NonblockingLzApp: caller must be LzApp\");\n _nonblockingLzReceive(_srcChainId, _srcAddress, _nonce, _payload);\n }\n\n //@notice override this function\n function _nonblockingLzReceive(uint16 _srcChainId, bytes memory _srcAddress, uint64 _nonce, bytes memory _payload) internal virtual;\n\n function retryMessage(uint16 _srcChainId, bytes calldata _srcAddress, uint64 _nonce, bytes calldata _payload) public payable virtual {\n // assert there is message to retry\n bytes32 payloadHash = failedMessages[_srcChainId][_srcAddress][_nonce];\n require(payloadHash != bytes32(0), \"NonblockingLzApp: no stored message\");\n require(keccak256(_payload) == payloadHash, \"NonblockingLzApp: invalid payload\");\n // clear the stored message\n failedMessages[_srcChainId][_srcAddress][_nonce] = bytes32(0);\n // execute the message. revert if it fails again\n _nonblockingLzReceive(_srcChainId, _srcAddress, _nonce, _payload);\n emit RetryMessageSuccess(_srcChainId, _srcAddress, _nonce, payloadHash);\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 uint[49] private __gap;\n}\n" + }, + "contracts/dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/composable/ComposableOFTCoreUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../OFTCoreUpgradeable.sol\";\nimport \"./IOFTReceiverUpgradeable.sol\";\nimport \"./IComposableOFTCoreUpgradeable.sol\";\nimport \"../../../../util/ExcessivelySafeCall.sol\";\n\nabstract contract ComposableOFTCoreUpgradeable is OFTCoreUpgradeable, IComposableOFTCoreUpgradeable {\n using ExcessivelySafeCall for address;\n using BytesLib for bytes;\n\n // packet type\n uint16 public constant PT_SEND_AND_CALL = 1;\n\n mapping(uint16 => mapping(bytes => mapping(uint64 => bytes32))) public failedOFTReceivedMessages;\n\n function __ComposableOFTCoreUpgradeable_init(address _lzEndpoint) internal onlyInitializing {\n __OFTCoreUpgradeable_init(_lzEndpoint);\n }\n\n function __ComposableOFTCoreUpgradeable_init_unchained() internal onlyInitializing {}\n\n function supportsInterface(\n bytes4 interfaceId\n ) public view virtual override(OFTCoreUpgradeable, IERC165Upgradeable) returns (bool) {\n return interfaceId == type(IComposableOFTCoreUpgradeable).interfaceId || super.supportsInterface(interfaceId);\n }\n\n function estimateSendAndCallFee(\n uint16 _dstChainId,\n bytes calldata _toAddress,\n uint _amount,\n bytes calldata _payload,\n uint64 _dstGasForCall,\n bool _useZro,\n bytes calldata _adapterParams\n ) public view virtual override returns (uint nativeFee, uint zroFee) {\n // mock the payload for sendAndCall()\n bytes memory payload = abi.encode(\n PT_SEND_AND_CALL,\n abi.encodePacked(msg.sender),\n _toAddress,\n _amount,\n _payload,\n _dstGasForCall\n );\n return lzEndpoint.estimateFees(_dstChainId, address(this), payload, _useZro, _adapterParams);\n }\n\n function sendAndCall(\n address _from,\n uint16 _dstChainId,\n bytes calldata _toAddress,\n uint _amount,\n bytes calldata _payload,\n uint64 _dstGasForCall,\n address payable _refundAddress,\n address _zroPaymentAddress,\n bytes calldata _adapterParams\n ) public payable virtual override {\n _sendAndCall(\n _from,\n _dstChainId,\n _toAddress,\n _amount,\n _payload,\n _dstGasForCall,\n _refundAddress,\n _zroPaymentAddress,\n _adapterParams\n );\n }\n\n function retryOFTReceived(\n uint16 _srcChainId,\n bytes calldata _srcAddress,\n uint64 _nonce,\n bytes calldata _from,\n address _to,\n uint _amount,\n bytes calldata _payload\n ) public virtual override {\n bytes32 msgHash = failedOFTReceivedMessages[_srcChainId][_srcAddress][_nonce];\n require(msgHash != bytes32(0), \"ComposableOFTCore: no failed message to retry\");\n\n bytes32 hash = keccak256(abi.encode(_from, _to, _amount, _payload));\n require(hash == msgHash, \"ComposableOFTCore: failed message hash mismatch\");\n\n delete failedOFTReceivedMessages[_srcChainId][_srcAddress][_nonce];\n IOFTReceiverUpgradeable(_to).onOFTReceived(_srcChainId, _srcAddress, _nonce, _from, _amount, _payload);\n emit RetryOFTReceivedSuccess(hash);\n }\n\n function _nonblockingLzReceive(\n uint16 _srcChainId,\n bytes memory _srcAddress,\n uint64 _nonce,\n bytes memory _payload\n ) internal virtual override {\n uint16 packetType;\n assembly {\n packetType := mload(add(_payload, 32))\n }\n\n if (packetType == PT_SEND) {\n _sendAck(_srcChainId, _srcAddress, _nonce, _payload);\n } else if (packetType == PT_SEND_AND_CALL) {\n _sendAndCallAck(_srcChainId, _srcAddress, _nonce, _payload);\n } else {\n revert(\"ComposableOFTCore: unknown packet type\");\n }\n }\n\n function _sendAndCall(\n address _from,\n uint16 _dstChainId,\n bytes memory _toAddress,\n uint _amount,\n bytes calldata _payload,\n uint64 _dstGasForCall,\n address payable _refundAddress,\n address _zroPaymentAddress,\n bytes memory _adapterParams\n ) internal virtual {\n _checkAdapterParams(_dstChainId, PT_SEND_AND_CALL, _adapterParams, _dstGasForCall);\n\n uint amount = _debitFrom(_from, _dstChainId, _toAddress, _amount);\n\n bytes memory lzPayload = abi.encode(\n PT_SEND_AND_CALL,\n abi.encodePacked(msg.sender),\n _toAddress,\n amount,\n _payload,\n _dstGasForCall\n );\n _lzSend(_dstChainId, lzPayload, _refundAddress, _zroPaymentAddress, _adapterParams, msg.value);\n\n emit SendToChain(_dstChainId, _from, _toAddress, amount);\n }\n\n function _sendAndCallAck(\n uint16 _srcChainId,\n bytes memory _srcAddress,\n uint64 _nonce,\n bytes memory _payload\n ) internal virtual {\n (, bytes memory from, bytes memory toAddress, uint amount, bytes memory payload, uint64 gasForCall) = abi\n .decode(_payload, (uint16, bytes, bytes, uint, bytes, uint64));\n\n address to = toAddress.toAddress(0);\n\n amount = _creditTo(_srcChainId, to, amount);\n emit ReceiveFromChain(_srcChainId, to, amount);\n\n if (!_isContract(to)) {\n emit NonContractAddress(to);\n return;\n }\n\n _safeCallOnOFTReceived(_srcChainId, _srcAddress, _nonce, from, to, amount, payload, gasForCall);\n }\n\n function _safeCallOnOFTReceived(\n uint16 _srcChainId,\n bytes memory _srcAddress,\n uint64 _nonce,\n bytes memory _from,\n address _to,\n uint _amount,\n bytes memory _payload,\n uint _gasForCall\n ) internal virtual {\n (bool success, bytes memory reason) = _to.excessivelySafeCall(\n _gasForCall,\n 150,\n abi.encodeWithSelector(\n IOFTReceiverUpgradeable.onOFTReceived.selector,\n _srcChainId,\n _srcAddress,\n _nonce,\n _from,\n _amount,\n _payload\n )\n );\n if (!success) {\n failedOFTReceivedMessages[_srcChainId][_srcAddress][_nonce] = keccak256(\n abi.encode(_from, _to, _amount, _payload)\n );\n emit CallOFTReceivedFailure(_srcChainId, _srcAddress, _nonce, _from, _to, _amount, _payload, reason);\n } else {\n bytes32 hash = keccak256(abi.encode(_from, _to, _amount, _payload));\n emit CallOFTReceivedSuccess(_srcChainId, _srcAddress, _nonce, hash);\n }\n }\n\n function _isContract(address _account) internal view returns (bool) {\n return _account.code.length > 0;\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 uint[49] private __gap;\n}\n" + }, + "contracts/dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/composable/IComposableOFTCoreUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.5.0;\n\nimport \"../IOFTCoreUpgradeable.sol\";\n\n/**\n * @dev Interface of the composable OFT core standard\n */\ninterface IComposableOFTCoreUpgradeable is IOFTCoreUpgradeable {\n function estimateSendAndCallFee(\n uint16 _dstChainId,\n bytes calldata _toAddress,\n uint _amount,\n bytes calldata _payload,\n uint64 _dstGasForCall,\n bool _useZro,\n bytes calldata _adapterParams\n ) external view returns (uint nativeFee, uint zroFee);\n\n function sendAndCall(\n address _from,\n uint16 _dstChainId,\n bytes calldata _toAddress,\n uint _amount,\n bytes calldata _payload,\n uint64 _dstGasForCall,\n address payable _refundAddress,\n address _zroPaymentAddress,\n bytes calldata _adapterParams\n ) external payable;\n\n function retryOFTReceived(\n uint16 _srcChainId,\n bytes calldata _srcAddress,\n uint64 _nonce,\n bytes calldata _from,\n address _to,\n uint _amount,\n bytes calldata _payload\n ) external;\n\n event CallOFTReceivedFailure(\n uint16 indexed _srcChainId,\n bytes _srcAddress,\n uint64 _nonce,\n bytes _from,\n address indexed _to,\n uint _amount,\n bytes _payload,\n bytes _reason\n );\n\n event CallOFTReceivedSuccess(uint16 indexed _srcChainId, bytes _srcAddress, uint64 _nonce, bytes32 _hash);\n\n event RetryOFTReceivedSuccess(bytes32 _messageHash);\n\n event NonContractAddress(address _address);\n}\n" + }, + "contracts/dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/composable/IOFTReceiverUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.5.0;\n\ninterface IOFTReceiverUpgradeable {\n /**\n * @dev Called by the OFT contract when tokens are received from source chain.\n * @param _srcChainId The chain id of the source chain.\n * @param _srcAddress The address of the OFT token contract on the source chain.\n * @param _nonce The nonce of the transaction on the source chain.\n * @param _from The address of the account who calls the sendAndCall() on the source chain.\n * @param _amount The amount of tokens to transfer.\n * @param _payload Additional data with no specified format.\n */\n function onOFTReceived(\n uint16 _srcChainId,\n bytes calldata _srcAddress,\n uint64 _nonce,\n bytes calldata _from,\n uint _amount,\n bytes calldata _payload\n ) external;\n}\n" + }, + "contracts/dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/IOFTCoreUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.2;\n\nimport \"../../../../../openzeppelin-upgradeable/utils/introspection/IERC165Upgradeable.sol\";\n\n/**\n * @dev Interface of the IOFT core standard\n */\ninterface IOFTCoreUpgradeable is IERC165Upgradeable {\n /**\n * @dev estimate send token `_tokenId` to (`_dstChainId`, `_toAddress`)\n * _dstChainId - L0 defined chain id to send tokens too\n * _toAddress - dynamic bytes array which contains the address to whom you are sending tokens to on the dstChain\n * _amount - amount of the tokens to transfer\n * _useZro - indicates to use zro to pay L0 fees\n * _adapterParam - flexible bytes array to indicate messaging adapter services in L0\n */\n function estimateSendFee(\n uint16 _dstChainId,\n bytes calldata _toAddress,\n uint _amount,\n bool _useZro,\n bytes calldata _adapterParams\n ) external view returns (uint nativeFee, uint zroFee);\n\n /**\n * @dev send `_amount` amount of token to (`_dstChainId`, `_toAddress`) from `_from`\n * `_from` the owner of token\n * `_dstChainId` the destination chain identifier\n * `_toAddress` can be any size depending on the `dstChainId`.\n * `_amount` the quantity of tokens in wei\n * `_refundAddress` the address LayerZero refunds if too much message fee is sent\n * `_zroPaymentAddress` set to address(0x0) if not paying in ZRO (LayerZero Token)\n * `_adapterParams` is a flexible bytes array to indicate messaging adapter services\n */\n function sendFrom(\n address _from,\n uint16 _dstChainId,\n bytes calldata _toAddress,\n uint _amount,\n address payable _refundAddress,\n address _zroPaymentAddress,\n bytes calldata _adapterParams\n ) external payable;\n\n /**\n * @dev returns the circulating amount of tokens on current chain\n */\n function circulatingSupply() external view returns (uint);\n\n /**\n * @dev returns the address of the ERC20 token\n */\n function token() external view returns (address);\n\n /**\n * @dev Emitted when `_amount` tokens are moved from the `_sender` to (`_dstChainId`, `_toAddress`)\n * `_nonce` is the outbound nonce\n */\n event SendToChain(uint16 indexed _dstChainId, address indexed _from, bytes _toAddress, uint _amount);\n\n /**\n * @dev Emitted when `_amount` tokens are received from `_srcChainId` into the `_toAddress` on the local chain.\n * `_nonce` is the inbound nonce.\n */\n event ReceiveFromChain(uint16 indexed _srcChainId, address indexed _to, uint _amount);\n\n event SetUseCustomAdapterParams(bool _useCustomAdapterParams);\n}\n" + }, + "contracts/dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/OFTCoreUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.2;\n\nimport \"./IOFTCoreUpgradeable.sol\";\nimport \"../../../../../openzeppelin-upgradeable/utils/introspection/ERC165Upgradeable.sol\";\nimport \"../../lzApp/NonblockingLzAppUpgradeable.sol\";\n\nabstract contract OFTCoreUpgradeable is\n Initializable,\n NonblockingLzAppUpgradeable,\n ERC165Upgradeable,\n IOFTCoreUpgradeable\n{\n using BytesLib for bytes;\n\n uint public constant NO_EXTRA_GAS = 0;\n\n // packet type\n uint16 public constant PT_SEND = 0;\n\n bool public useCustomAdapterParams;\n\n function __OFTCoreUpgradeable_init(address _lzEndpoint) internal onlyInitializing {\n __Ownable_init_unchained();\n __LzAppUpgradeable_init_unchained(_lzEndpoint);\n }\n\n function __OFTCoreUpgradeable_init_unchained() internal onlyInitializing {}\n\n function supportsInterface(\n bytes4 interfaceId\n ) public view virtual override(ERC165Upgradeable, IERC165Upgradeable) returns (bool) {\n return interfaceId == type(IOFTCoreUpgradeable).interfaceId || super.supportsInterface(interfaceId);\n }\n\n function estimateSendFee(\n uint16 _dstChainId,\n bytes calldata _toAddress,\n uint _amount,\n bool _useZro,\n bytes calldata _adapterParams\n ) public view virtual override returns (uint nativeFee, uint zroFee) {\n // mock the payload for sendFrom()\n bytes memory payload = abi.encode(PT_SEND, _toAddress, _amount);\n return lzEndpoint.estimateFees(_dstChainId, address(this), payload, _useZro, _adapterParams);\n }\n\n function sendFrom(\n address _from,\n uint16 _dstChainId,\n bytes calldata _toAddress,\n uint _amount,\n address payable _refundAddress,\n address _zroPaymentAddress,\n bytes calldata _adapterParams\n ) public payable virtual override {\n _send(_from, _dstChainId, _toAddress, _amount, _refundAddress, _zroPaymentAddress, _adapterParams);\n }\n\n function setUseCustomAdapterParams(bool _useCustomAdapterParams) public virtual onlyOwner {\n useCustomAdapterParams = _useCustomAdapterParams;\n emit SetUseCustomAdapterParams(_useCustomAdapterParams);\n }\n\n function _nonblockingLzReceive(\n uint16 _srcChainId,\n bytes memory _srcAddress,\n uint64 _nonce,\n bytes memory _payload\n ) internal virtual override {\n uint16 packetType;\n assembly {\n packetType := mload(add(_payload, 32))\n }\n\n if (packetType == PT_SEND) {\n _sendAck(_srcChainId, _srcAddress, _nonce, _payload);\n } else {\n revert(\"OFTCore: unknown packet type\");\n }\n }\n\n function _send(\n address _from,\n uint16 _dstChainId,\n bytes memory _toAddress,\n uint _amount,\n address payable _refundAddress,\n address _zroPaymentAddress,\n bytes memory _adapterParams\n ) internal virtual {\n _checkAdapterParams(_dstChainId, PT_SEND, _adapterParams, NO_EXTRA_GAS);\n\n uint amount = _debitFrom(_from, _dstChainId, _toAddress, _amount);\n\n bytes memory lzPayload = abi.encode(PT_SEND, _toAddress, amount);\n _lzSend(_dstChainId, lzPayload, _refundAddress, _zroPaymentAddress, _adapterParams, msg.value);\n\n emit SendToChain(_dstChainId, _from, _toAddress, amount);\n }\n\n function _sendAck(uint16 _srcChainId, bytes memory, uint64, bytes memory _payload) internal virtual {\n (, bytes memory toAddressBytes, uint amount) = abi.decode(_payload, (uint16, bytes, uint));\n\n address to = toAddressBytes.toAddress(0);\n\n amount = _creditTo(_srcChainId, to, amount);\n emit ReceiveFromChain(_srcChainId, to, amount);\n }\n\n function _checkAdapterParams(\n uint16 _dstChainId,\n uint16 _pkType,\n bytes memory _adapterParams,\n uint _extraGas\n ) internal virtual {\n if (useCustomAdapterParams) {\n _checkGasLimit(_dstChainId, _pkType, _adapterParams, _extraGas);\n } else {\n require(_adapterParams.length == 0, \"OFTCore: _adapterParams must be empty.\");\n }\n }\n\n function _debitFrom(\n address _from,\n uint16 _dstChainId,\n bytes memory _toAddress,\n uint _amount\n ) internal virtual returns (uint);\n\n function _creditTo(uint16 _srcChainId, address _toAddress, uint _amount) internal virtual returns (uint);\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 uint[49] private __gap;\n}\n" + }, + "contracts/dependencies/@layerzerolabs/solidity-examples/interfaces/ILayerZeroEndpoint.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.5.0;\n\nimport \"./ILayerZeroUserApplicationConfig.sol\";\n\ninterface ILayerZeroEndpoint is ILayerZeroUserApplicationConfig {\n // @notice send a LayerZero message to the specified address at a LayerZero endpoint.\n // @param _dstChainId - the destination chain identifier\n // @param _destination - the address on destination chain (in bytes). address length/format may vary by chains\n // @param _payload - a custom bytes payload to send to the destination contract\n // @param _refundAddress - if the source transaction is cheaper than the amount of value passed, refund the additional amount to this address\n // @param _zroPaymentAddress - the address of the ZRO token holder who would pay for the transaction\n // @param _adapterParams - parameters for custom functionality. e.g. receive airdropped native gas from the relayer on destination\n function send(\n uint16 _dstChainId,\n bytes calldata _destination,\n bytes calldata _payload,\n address payable _refundAddress,\n address _zroPaymentAddress,\n bytes calldata _adapterParams\n ) external payable;\n\n // @notice used by the messaging library to publish verified payload\n // @param _srcChainId - the source chain identifier\n // @param _srcAddress - the source contract (as bytes) at the source chain\n // @param _dstAddress - the address on destination chain\n // @param _nonce - the unbound message ordering nonce\n // @param _gasLimit - the gas limit for external contract execution\n // @param _payload - verified payload to send to the destination contract\n function receivePayload(\n uint16 _srcChainId,\n bytes calldata _srcAddress,\n address _dstAddress,\n uint64 _nonce,\n uint _gasLimit,\n bytes calldata _payload\n ) external;\n\n // @notice get the inboundNonce of a lzApp from a source chain which could be EVM or non-EVM chain\n // @param _srcChainId - the source chain identifier\n // @param _srcAddress - the source chain contract address\n function getInboundNonce(uint16 _srcChainId, bytes calldata _srcAddress) external view returns (uint64);\n\n // @notice get the outboundNonce from this source chain which, consequently, is always an EVM\n // @param _srcAddress - the source chain contract address\n function getOutboundNonce(uint16 _dstChainId, address _srcAddress) external view returns (uint64);\n\n // @notice gets a quote in source native gas, for the amount that send() requires to pay for message delivery\n // @param _dstChainId - the destination chain identifier\n // @param _userApplication - the user app address on this EVM chain\n // @param _payload - the custom message to send over LayerZero\n // @param _payInZRO - if false, user app pays the protocol fee in native token\n // @param _adapterParam - parameters for the adapter service, e.g. send some dust native token to dstChain\n function estimateFees(\n uint16 _dstChainId,\n address _userApplication,\n bytes calldata _payload,\n bool _payInZRO,\n bytes calldata _adapterParam\n ) external view returns (uint nativeFee, uint zroFee);\n\n // @notice get this Endpoint's immutable source identifier\n function getChainId() external view returns (uint16);\n\n // @notice the interface to retry failed message on this Endpoint destination\n // @param _srcChainId - the source chain identifier\n // @param _srcAddress - the source chain contract address\n // @param _payload - the payload to be retried\n function retryPayload(uint16 _srcChainId, bytes calldata _srcAddress, bytes calldata _payload) external;\n\n // @notice query if any STORED payload (message blocking) at the endpoint.\n // @param _srcChainId - the source chain identifier\n // @param _srcAddress - the source chain contract address\n function hasStoredPayload(uint16 _srcChainId, bytes calldata _srcAddress) external view returns (bool);\n\n // @notice query if the _libraryAddress is valid for sending msgs.\n // @param _userApplication - the user app address on this EVM chain\n function getSendLibraryAddress(address _userApplication) external view returns (address);\n\n // @notice query if the _libraryAddress is valid for receiving msgs.\n // @param _userApplication - the user app address on this EVM chain\n function getReceiveLibraryAddress(address _userApplication) external view returns (address);\n\n // @notice query if the non-reentrancy guard for send() is on\n // @return true if the guard is on. false otherwise\n function isSendingPayload() external view returns (bool);\n\n // @notice query if the non-reentrancy guard for receive() is on\n // @return true if the guard is on. false otherwise\n function isReceivingPayload() external view returns (bool);\n\n // @notice get the configuration of the LayerZero messaging library of the specified version\n // @param _version - messaging library version\n // @param _chainId - the chainId for the pending config change\n // @param _userApplication - the contract address of the user application\n // @param _configType - type of configuration. every messaging library has its own convention.\n function getConfig(\n uint16 _version,\n uint16 _chainId,\n address _userApplication,\n uint _configType\n ) external view returns (bytes memory);\n\n // @notice get the send() LayerZero messaging library version\n // @param _userApplication - the contract address of the user application\n function getSendVersion(address _userApplication) external view returns (uint16);\n\n // @notice get the lzReceive() LayerZero messaging library version\n // @param _userApplication - the contract address of the user application\n function getReceiveVersion(address _userApplication) external view returns (uint16);\n}\n" + }, + "contracts/dependencies/@layerzerolabs/solidity-examples/interfaces/ILayerZeroReceiver.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.5.0;\n\ninterface ILayerZeroReceiver {\n // @notice LayerZero endpoint will invoke this function to deliver the message on the destination\n // @param _srcChainId - the source endpoint identifier\n // @param _srcAddress - the source sending contract address from the source chain\n // @param _nonce - the ordered message nonce\n // @param _payload - the signed payload is the UA bytes has encoded to be sent\n function lzReceive(uint16 _srcChainId, bytes calldata _srcAddress, uint64 _nonce, bytes calldata _payload) external;\n}\n" + }, + "contracts/dependencies/@layerzerolabs/solidity-examples/interfaces/ILayerZeroUserApplicationConfig.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.5.0;\n\ninterface ILayerZeroUserApplicationConfig {\n // @notice set the configuration of the LayerZero messaging library of the specified version\n // @param _version - messaging library version\n // @param _chainId - the chainId for the pending config change\n // @param _configType - type of configuration. every messaging library has its own convention.\n // @param _config - configuration in the bytes. can encode arbitrary content.\n function setConfig(uint16 _version, uint16 _chainId, uint _configType, bytes calldata _config) external;\n\n // @notice set the send() LayerZero messaging library version to _version\n // @param _version - new messaging library version\n function setSendVersion(uint16 _version) external;\n\n // @notice set the lzReceive() LayerZero messaging library version to _version\n // @param _version - new messaging library version\n function setReceiveVersion(uint16 _version) external;\n\n // @notice Only when the UA needs to resume the message flow in blocking mode and clear the stored payload\n // @param _srcChainId - the chainId of the source chain\n // @param _srcAddress - the contract address of the source contract at the source chain\n function forceResumeReceive(uint16 _srcChainId, bytes calldata _srcAddress) external;\n}\n" + }, + "contracts/dependencies/@layerzerolabs/solidity-examples/libraries/LzLib.sol": { + "content": "// SPDX-License-Identifier: BUSL-1.1\n\npragma solidity >=0.6.0;\npragma experimental ABIEncoderV2;\n\nlibrary LzLib {\n // LayerZero communication\n struct CallParams {\n address payable refundAddress;\n address zroPaymentAddress;\n }\n\n //---------------------------------------------------------------------------\n // Address type handling\n\n struct AirdropParams {\n uint airdropAmount;\n bytes32 airdropAddress;\n }\n\n function buildAdapterParams(\n LzLib.AirdropParams memory _airdropParams,\n uint _uaGasLimit\n ) internal pure returns (bytes memory adapterParams) {\n if (_airdropParams.airdropAmount == 0 && _airdropParams.airdropAddress == bytes32(0x0)) {\n adapterParams = buildDefaultAdapterParams(_uaGasLimit);\n } else {\n adapterParams = buildAirdropAdapterParams(_uaGasLimit, _airdropParams);\n }\n }\n\n // Build Adapter Params\n function buildDefaultAdapterParams(uint _uaGas) internal pure returns (bytes memory) {\n // txType 1\n // bytes [2 32 ]\n // fields [txType extraGas]\n return abi.encodePacked(uint16(1), _uaGas);\n }\n\n function buildAirdropAdapterParams(uint _uaGas, AirdropParams memory _params) internal pure returns (bytes memory) {\n require(_params.airdropAmount > 0, \"Airdrop amount must be greater than 0\");\n require(_params.airdropAddress != bytes32(0x0), \"Airdrop address must be set\");\n\n // txType 2\n // bytes [2 32 32 bytes[] ]\n // fields [txType extraGas dstNativeAmt dstNativeAddress]\n return abi.encodePacked(uint16(2), _uaGas, _params.airdropAmount, _params.airdropAddress);\n }\n\n function getGasLimit(bytes memory _adapterParams) internal pure returns (uint gasLimit) {\n require(_adapterParams.length == 34 || _adapterParams.length > 66, \"Invalid adapterParams\");\n assembly {\n gasLimit := mload(add(_adapterParams, 34))\n }\n }\n\n // Decode Adapter Params\n function decodeAdapterParams(\n bytes memory _adapterParams\n ) internal pure returns (uint16 txType, uint uaGas, uint airdropAmount, address payable airdropAddress) {\n require(_adapterParams.length == 34 || _adapterParams.length > 66, \"Invalid adapterParams\");\n assembly {\n txType := mload(add(_adapterParams, 2))\n uaGas := mload(add(_adapterParams, 34))\n }\n require(txType == 1 || txType == 2, \"Unsupported txType\");\n require(uaGas > 0, \"Gas too low\");\n\n if (txType == 2) {\n assembly {\n airdropAmount := mload(add(_adapterParams, 66))\n airdropAddress := mload(add(_adapterParams, 86))\n }\n }\n }\n\n //---------------------------------------------------------------------------\n // Address type handling\n function bytes32ToAddress(bytes32 _bytes32Address) internal pure returns (address _address) {\n return address(uint160(uint(_bytes32Address)));\n }\n\n function addressToBytes32(address _address) internal pure returns (bytes32 _bytes32Address) {\n return bytes32(uint(uint160(_address)));\n }\n}\n" + }, + "contracts/dependencies/@layerzerolabs/solidity-examples/lzApp/LzApp.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../../../openzeppelin/access/Ownable.sol\";\nimport \"../interfaces/ILayerZeroReceiver.sol\";\nimport \"../interfaces/ILayerZeroUserApplicationConfig.sol\";\nimport \"../interfaces/ILayerZeroEndpoint.sol\";\nimport \"../util/BytesLib.sol\";\n\n/*\n * a generic LzReceiver implementation\n */\nabstract contract LzApp is Ownable, ILayerZeroReceiver, ILayerZeroUserApplicationConfig {\n using BytesLib for bytes;\n\n // ua can not send payload larger than this by default, but it can be changed by the ua owner\n uint public constant DEFAULT_PAYLOAD_SIZE_LIMIT = 10000;\n\n ILayerZeroEndpoint public immutable lzEndpoint;\n mapping(uint16 => bytes) public trustedRemoteLookup;\n mapping(uint16 => mapping(uint16 => uint)) public minDstGasLookup;\n mapping(uint16 => uint) public payloadSizeLimitLookup;\n address public precrime;\n\n event SetPrecrime(address precrime);\n event SetTrustedRemote(uint16 _remoteChainId, bytes _path);\n event SetTrustedRemoteAddress(uint16 _remoteChainId, bytes _remoteAddress);\n event SetMinDstGas(uint16 _dstChainId, uint16 _type, uint _minDstGas);\n\n constructor(address _endpoint) {\n lzEndpoint = ILayerZeroEndpoint(_endpoint);\n }\n\n function lzReceive(\n uint16 _srcChainId,\n bytes calldata _srcAddress,\n uint64 _nonce,\n bytes calldata _payload\n ) public virtual override {\n // lzReceive must be called by the endpoint for security\n require(_msgSender() == address(lzEndpoint), \"LzApp: invalid endpoint caller\");\n\n bytes memory trustedRemote = trustedRemoteLookup[_srcChainId];\n // if will still block the message pathway from (srcChainId, srcAddress). should not receive message from untrusted remote.\n require(\n _srcAddress.length == trustedRemote.length &&\n trustedRemote.length > 0 &&\n keccak256(_srcAddress) == keccak256(trustedRemote),\n \"LzApp: invalid source sending contract\"\n );\n\n _blockingLzReceive(_srcChainId, _srcAddress, _nonce, _payload);\n }\n\n // abstract function - the default behaviour of LayerZero is blocking. See: NonblockingLzApp if you dont need to enforce ordered messaging\n function _blockingLzReceive(\n uint16 _srcChainId,\n bytes memory _srcAddress,\n uint64 _nonce,\n bytes memory _payload\n ) internal virtual;\n\n function _lzSend(\n uint16 _dstChainId,\n bytes memory _payload,\n address payable _refundAddress,\n address _zroPaymentAddress,\n bytes memory _adapterParams,\n uint _nativeFee\n ) internal virtual {\n bytes memory trustedRemote = trustedRemoteLookup[_dstChainId];\n require(trustedRemote.length != 0, \"LzApp: destination chain is not a trusted source\");\n _checkPayloadSize(_dstChainId, _payload.length);\n lzEndpoint.send{value: _nativeFee}(\n _dstChainId,\n trustedRemote,\n _payload,\n _refundAddress,\n _zroPaymentAddress,\n _adapterParams\n );\n }\n\n function _checkGasLimit(\n uint16 _dstChainId,\n uint16 _type,\n bytes memory _adapterParams,\n uint _extraGas\n ) internal view virtual {\n uint providedGasLimit = _getGasLimit(_adapterParams);\n uint minGasLimit = minDstGasLookup[_dstChainId][_type] + _extraGas;\n require(minGasLimit > 0, \"LzApp: minGasLimit not set\");\n require(providedGasLimit >= minGasLimit, \"LzApp: gas limit is too low\");\n }\n\n function _getGasLimit(bytes memory _adapterParams) internal pure virtual returns (uint gasLimit) {\n require(_adapterParams.length >= 34, \"LzApp: invalid adapterParams\");\n assembly {\n gasLimit := mload(add(_adapterParams, 34))\n }\n }\n\n function _checkPayloadSize(uint16 _dstChainId, uint _payloadSize) internal view virtual {\n uint payloadSizeLimit = payloadSizeLimitLookup[_dstChainId];\n if (payloadSizeLimit == 0) {\n // use default if not set\n payloadSizeLimit = DEFAULT_PAYLOAD_SIZE_LIMIT;\n }\n require(_payloadSize <= payloadSizeLimit, \"LzApp: payload size is too large\");\n }\n\n //---------------------------UserApplication config----------------------------------------\n function getConfig(\n uint16 _version,\n uint16 _chainId,\n address,\n uint _configType\n ) external view returns (bytes memory) {\n return lzEndpoint.getConfig(_version, _chainId, address(this), _configType);\n }\n\n // generic config for LayerZero user Application\n function setConfig(\n uint16 _version,\n uint16 _chainId,\n uint _configType,\n bytes calldata _config\n ) external override onlyOwner {\n lzEndpoint.setConfig(_version, _chainId, _configType, _config);\n }\n\n function setSendVersion(uint16 _version) external override onlyOwner {\n lzEndpoint.setSendVersion(_version);\n }\n\n function setReceiveVersion(uint16 _version) external override onlyOwner {\n lzEndpoint.setReceiveVersion(_version);\n }\n\n function forceResumeReceive(uint16 _srcChainId, bytes calldata _srcAddress) external override onlyOwner {\n lzEndpoint.forceResumeReceive(_srcChainId, _srcAddress);\n }\n\n // _path = abi.encodePacked(remoteAddress, localAddress)\n // this function set the trusted path for the cross-chain communication\n function setTrustedRemote(uint16 _remoteChainId, bytes calldata _path) external onlyOwner {\n trustedRemoteLookup[_remoteChainId] = _path;\n emit SetTrustedRemote(_remoteChainId, _path);\n }\n\n function setTrustedRemoteAddress(uint16 _remoteChainId, bytes calldata _remoteAddress) external onlyOwner {\n trustedRemoteLookup[_remoteChainId] = abi.encodePacked(_remoteAddress, address(this));\n emit SetTrustedRemoteAddress(_remoteChainId, _remoteAddress);\n }\n\n function getTrustedRemoteAddress(uint16 _remoteChainId) external view returns (bytes memory) {\n bytes memory path = trustedRemoteLookup[_remoteChainId];\n require(path.length != 0, \"LzApp: no trusted path record\");\n return path.slice(0, path.length - 20); // the last 20 bytes should be address(this)\n }\n\n function setPrecrime(address _precrime) external onlyOwner {\n precrime = _precrime;\n emit SetPrecrime(_precrime);\n }\n\n function setMinDstGas(uint16 _dstChainId, uint16 _packetType, uint _minGas) external onlyOwner {\n require(_minGas > 0, \"LzApp: invalid minGas\");\n minDstGasLookup[_dstChainId][_packetType] = _minGas;\n emit SetMinDstGas(_dstChainId, _packetType, _minGas);\n }\n\n // if the size is 0, it means default size limit\n function setPayloadSizeLimit(uint16 _dstChainId, uint _size) external onlyOwner {\n payloadSizeLimitLookup[_dstChainId] = _size;\n }\n\n //--------------------------- VIEW FUNCTION ----------------------------------------\n function isTrustedRemote(uint16 _srcChainId, bytes calldata _srcAddress) external view returns (bool) {\n bytes memory trustedSource = trustedRemoteLookup[_srcChainId];\n return keccak256(trustedSource) == keccak256(_srcAddress);\n }\n}\n" + }, + "contracts/dependencies/@layerzerolabs/solidity-examples/lzApp/NonblockingLzApp.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./LzApp.sol\";\nimport \"../util/ExcessivelySafeCall.sol\";\n\n/*\n * the default LayerZero messaging behaviour is blocking, i.e. any failed message will block the channel\n * this abstract class try-catch all fail messages and store locally for future retry. hence, non-blocking\n * NOTE: if the srcAddress is not configured properly, it will still block the message pathway from (srcChainId, srcAddress)\n */\nabstract contract NonblockingLzApp is LzApp {\n using ExcessivelySafeCall for address;\n\n constructor(address _endpoint) LzApp(_endpoint) {}\n\n mapping(uint16 => mapping(bytes => mapping(uint64 => bytes32))) public failedMessages;\n\n event MessageFailed(uint16 _srcChainId, bytes _srcAddress, uint64 _nonce, bytes _payload, bytes _reason);\n event RetryMessageSuccess(uint16 _srcChainId, bytes _srcAddress, uint64 _nonce, bytes32 _payloadHash);\n\n // overriding the virtual function in LzReceiver\n function _blockingLzReceive(\n uint16 _srcChainId,\n bytes memory _srcAddress,\n uint64 _nonce,\n bytes memory _payload\n ) internal virtual override {\n (bool success, bytes memory reason) = address(this).excessivelySafeCall(\n gasleft(),\n 150,\n abi.encodeWithSelector(this.nonblockingLzReceive.selector, _srcChainId, _srcAddress, _nonce, _payload)\n );\n // try-catch all errors/exceptions\n if (!success) {\n _storeFailedMessage(_srcChainId, _srcAddress, _nonce, _payload, reason);\n }\n }\n\n function _storeFailedMessage(\n uint16 _srcChainId,\n bytes memory _srcAddress,\n uint64 _nonce,\n bytes memory _payload,\n bytes memory _reason\n ) internal virtual {\n failedMessages[_srcChainId][_srcAddress][_nonce] = keccak256(_payload);\n emit MessageFailed(_srcChainId, _srcAddress, _nonce, _payload, _reason);\n }\n\n function nonblockingLzReceive(\n uint16 _srcChainId,\n bytes calldata _srcAddress,\n uint64 _nonce,\n bytes calldata _payload\n ) public virtual {\n // only internal transaction\n require(_msgSender() == address(this), \"NonblockingLzApp: caller must be LzApp\");\n _nonblockingLzReceive(_srcChainId, _srcAddress, _nonce, _payload);\n }\n\n //@notice override this function\n function _nonblockingLzReceive(\n uint16 _srcChainId,\n bytes memory _srcAddress,\n uint64 _nonce,\n bytes memory _payload\n ) internal virtual;\n\n function retryMessage(\n uint16 _srcChainId,\n bytes calldata _srcAddress,\n uint64 _nonce,\n bytes calldata _payload\n ) public payable virtual {\n // assert there is message to retry\n bytes32 payloadHash = failedMessages[_srcChainId][_srcAddress][_nonce];\n require(payloadHash != bytes32(0), \"NonblockingLzApp: no stored message\");\n require(keccak256(_payload) == payloadHash, \"NonblockingLzApp: invalid payload\");\n // clear the stored message\n failedMessages[_srcChainId][_srcAddress][_nonce] = bytes32(0);\n // execute the message. revert if it fails again\n _nonblockingLzReceive(_srcChainId, _srcAddress, _nonce, _payload);\n emit RetryMessageSuccess(_srcChainId, _srcAddress, _nonce, payloadHash);\n }\n}\n" + }, + "contracts/dependencies/@layerzerolabs/solidity-examples/token/oft/composable/ComposableBasedOFT.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./ComposableOFT.sol\";\n\ncontract ComposableBasedOFT is ComposableOFT {\n constructor(\n string memory _name,\n string memory _symbol,\n address _lzEndpoint\n ) ComposableOFT(_name, _symbol, _lzEndpoint) {}\n\n function circulatingSupply() public view virtual override returns (uint) {\n unchecked {\n return totalSupply() - balanceOf(address(this));\n }\n }\n\n function _debitFrom(address _from, uint16, bytes memory, uint _amount) internal virtual override returns (uint) {\n address spender = _msgSender();\n if (_from != spender) _spendAllowance(_from, spender, _amount);\n _transfer(_from, address(this), _amount);\n return _amount;\n }\n\n function _creditTo(uint16, address _toAddress, uint _amount) internal virtual override returns (uint) {\n _transfer(address(this), _toAddress, _amount);\n return _amount;\n }\n}\n" + }, + "contracts/dependencies/@layerzerolabs/solidity-examples/token/oft/composable/ComposableOFT.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../../../../../openzeppelin/token/ERC20/ERC20.sol\";\nimport \"./IComposableOFT.sol\";\nimport \"./ComposableOFTCore.sol\";\n\ncontract ComposableOFT is ComposableOFTCore, ERC20, IComposableOFT {\n constructor(\n string memory _name,\n string memory _symbol,\n address _lzEndpoint\n ) ERC20(_name, _symbol) ComposableOFTCore(_lzEndpoint) {}\n\n function supportsInterface(\n bytes4 interfaceId\n ) public view virtual override(ComposableOFTCore, IERC165) returns (bool) {\n return\n interfaceId == type(IComposableOFT).interfaceId ||\n interfaceId == type(IOFT).interfaceId ||\n interfaceId == type(IERC20).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n function circulatingSupply() public view virtual override returns (uint) {\n return totalSupply();\n }\n\n function token() public view virtual override returns (address) {\n return address(this);\n }\n\n function _debitFrom(address _from, uint16, bytes memory, uint _amount) internal virtual override returns (uint) {\n address spender = _msgSender();\n if (_from != spender) _spendAllowance(_from, spender, _amount);\n _burn(_from, _amount);\n return _amount;\n }\n\n function _creditTo(uint16, address _toAddress, uint _amount) internal virtual override returns (uint) {\n _mint(_toAddress, _amount);\n return _amount;\n }\n}\n" + }, + "contracts/dependencies/@layerzerolabs/solidity-examples/token/oft/composable/ComposableOFTCore.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../OFTCore.sol\";\nimport \"./IOFTReceiver.sol\";\nimport \"./IComposableOFTCore.sol\";\nimport \"../../../util/ExcessivelySafeCall.sol\";\n\nabstract contract ComposableOFTCore is OFTCore, IComposableOFTCore {\n using ExcessivelySafeCall for address;\n using BytesLib for bytes;\n\n // packet type\n uint16 public constant PT_SEND_AND_CALL = 1;\n\n mapping(uint16 => mapping(bytes => mapping(uint64 => bytes32))) public failedOFTReceivedMessages;\n\n constructor(address _lzEndpoint) OFTCore(_lzEndpoint) {}\n\n function supportsInterface(bytes4 interfaceId) public view virtual override(OFTCore, IERC165) returns (bool) {\n return interfaceId == type(IComposableOFTCore).interfaceId || super.supportsInterface(interfaceId);\n }\n\n function estimateSendAndCallFee(\n uint16 _dstChainId,\n bytes calldata _toAddress,\n uint _amount,\n bytes calldata _payload,\n uint64 _dstGasForCall,\n bool _useZro,\n bytes calldata _adapterParams\n ) public view virtual override returns (uint nativeFee, uint zroFee) {\n // mock the payload for sendAndCall()\n bytes memory payload = abi.encode(\n PT_SEND_AND_CALL,\n abi.encodePacked(msg.sender),\n _toAddress,\n _amount,\n _payload,\n _dstGasForCall\n );\n return lzEndpoint.estimateFees(_dstChainId, address(this), payload, _useZro, _adapterParams);\n }\n\n function sendAndCall(\n address _from,\n uint16 _dstChainId,\n bytes calldata _toAddress,\n uint _amount,\n bytes calldata _payload,\n uint64 _dstGasForCall,\n address payable _refundAddress,\n address _zroPaymentAddress,\n bytes calldata _adapterParams\n ) public payable virtual override {\n _sendAndCall(\n _from,\n _dstChainId,\n _toAddress,\n _amount,\n _payload,\n _dstGasForCall,\n _refundAddress,\n _zroPaymentAddress,\n _adapterParams\n );\n }\n\n function retryOFTReceived(\n uint16 _srcChainId,\n bytes calldata _srcAddress,\n uint64 _nonce,\n bytes calldata _from,\n address _to,\n uint _amount,\n bytes calldata _payload\n ) public virtual override {\n bytes32 msgHash = failedOFTReceivedMessages[_srcChainId][_srcAddress][_nonce];\n require(msgHash != bytes32(0), \"ComposableOFTCore: no failed message to retry\");\n\n bytes32 hash = keccak256(abi.encode(_from, _to, _amount, _payload));\n require(hash == msgHash, \"ComposableOFTCore: failed message hash mismatch\");\n\n delete failedOFTReceivedMessages[_srcChainId][_srcAddress][_nonce];\n IOFTReceiver(_to).onOFTReceived(_srcChainId, _srcAddress, _nonce, _from, _amount, _payload);\n emit RetryOFTReceivedSuccess(hash);\n }\n\n function _nonblockingLzReceive(\n uint16 _srcChainId,\n bytes memory _srcAddress,\n uint64 _nonce,\n bytes memory _payload\n ) internal virtual override {\n uint16 packetType;\n assembly {\n packetType := mload(add(_payload, 32))\n }\n\n if (packetType == PT_SEND) {\n _sendAck(_srcChainId, _srcAddress, _nonce, _payload);\n } else if (packetType == PT_SEND_AND_CALL) {\n _sendAndCallAck(_srcChainId, _srcAddress, _nonce, _payload);\n } else {\n revert(\"ComposableOFTCore: unknown packet type\");\n }\n }\n\n function _sendAndCall(\n address _from,\n uint16 _dstChainId,\n bytes memory _toAddress,\n uint _amount,\n bytes calldata _payload,\n uint64 _dstGasForCall,\n address payable _refundAddress,\n address _zroPaymentAddress,\n bytes memory _adapterParams\n ) internal virtual {\n _checkAdapterParams(_dstChainId, PT_SEND_AND_CALL, _adapterParams, _dstGasForCall);\n\n uint amount = _debitFrom(_from, _dstChainId, _toAddress, _amount);\n\n bytes memory lzPayload = abi.encode(\n PT_SEND_AND_CALL,\n abi.encodePacked(msg.sender),\n _toAddress,\n amount,\n _payload,\n _dstGasForCall\n );\n _lzSend(_dstChainId, lzPayload, _refundAddress, _zroPaymentAddress, _adapterParams, msg.value);\n\n emit SendToChain(_dstChainId, _from, _toAddress, amount);\n }\n\n function _sendAndCallAck(\n uint16 _srcChainId,\n bytes memory _srcAddress,\n uint64 _nonce,\n bytes memory _payload\n ) internal virtual {\n (, bytes memory from, bytes memory toAddress, uint amount, bytes memory payload, uint64 gasForCall) = abi\n .decode(_payload, (uint16, bytes, bytes, uint, bytes, uint64));\n\n address to = toAddress.toAddress(0);\n\n amount = _creditTo(_srcChainId, to, amount);\n emit ReceiveFromChain(_srcChainId, to, amount);\n\n if (!_isContract(to)) {\n emit NonContractAddress(to);\n return;\n }\n\n _safeCallOnOFTReceived(_srcChainId, _srcAddress, _nonce, from, to, amount, payload, gasForCall);\n }\n\n function _safeCallOnOFTReceived(\n uint16 _srcChainId,\n bytes memory _srcAddress,\n uint64 _nonce,\n bytes memory _from,\n address _to,\n uint _amount,\n bytes memory _payload,\n uint _gasForCall\n ) internal virtual {\n (bool success, bytes memory reason) = _to.excessivelySafeCall(\n _gasForCall,\n 150,\n abi.encodeWithSelector(\n IOFTReceiver.onOFTReceived.selector,\n _srcChainId,\n _srcAddress,\n _nonce,\n _from,\n _amount,\n _payload\n )\n );\n if (!success) {\n failedOFTReceivedMessages[_srcChainId][_srcAddress][_nonce] = keccak256(\n abi.encode(_from, _to, _amount, _payload)\n );\n emit CallOFTReceivedFailure(_srcChainId, _srcAddress, _nonce, _from, _to, _amount, _payload, reason);\n } else {\n bytes32 hash = keccak256(abi.encode(_from, _to, _amount, _payload));\n emit CallOFTReceivedSuccess(_srcChainId, _srcAddress, _nonce, hash);\n }\n }\n\n function _isContract(address _account) internal view returns (bool) {\n return _account.code.length > 0;\n }\n}\n" + }, + "contracts/dependencies/@layerzerolabs/solidity-examples/token/oft/composable/ComposableProxyOFT.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"./ComposableOFTCore.sol\";\nimport \"../../../../../openzeppelin/token/ERC20/utils/SafeERC20.sol\";\n\ncontract ComposableProxyOFT is ComposableOFTCore {\n using SafeERC20 for IERC20;\n\n IERC20 internal immutable innerToken;\n\n constructor(address _lzEndpoint, address _proxyToken) ComposableOFTCore(_lzEndpoint) {\n innerToken = IERC20(_proxyToken);\n }\n\n function circulatingSupply() public view virtual override returns (uint) {\n unchecked {\n return innerToken.totalSupply() - innerToken.balanceOf(address(this));\n }\n }\n\n function token() public view virtual override returns (address) {\n return address(innerToken);\n }\n\n function _debitFrom(address _from, uint16, bytes memory, uint _amount) internal virtual override returns (uint) {\n require(_from == _msgSender(), \"ComposableProxyOFT: owner is not send caller\");\n uint before = innerToken.balanceOf(address(this));\n innerToken.safeTransferFrom(_from, address(this), _amount);\n return innerToken.balanceOf(address(this)) - before;\n }\n\n function _creditTo(uint16, address _toAddress, uint _amount) internal virtual override returns (uint) {\n uint before = innerToken.balanceOf(_toAddress);\n innerToken.safeTransfer(_toAddress, _amount);\n return innerToken.balanceOf(_toAddress) - before;\n }\n}\n" + }, + "contracts/dependencies/@layerzerolabs/solidity-examples/token/oft/composable/IComposableOFT.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.5.0;\n\nimport \"./IComposableOFTCore.sol\";\nimport \"../IOFT.sol\";\n\n/**\n * @dev Interface of the OFT standard\n */\ninterface IComposableOFT is IOFT, IComposableOFTCore {\n\n}\n" + }, + "contracts/dependencies/@layerzerolabs/solidity-examples/token/oft/composable/IComposableOFTCore.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.5.0;\n\nimport \"../IOFTCore.sol\";\n\n/**\n * @dev Interface of the composable OFT core standard\n */\ninterface IComposableOFTCore is IOFTCore {\n function estimateSendAndCallFee(\n uint16 _dstChainId,\n bytes calldata _toAddress,\n uint _amount,\n bytes calldata _payload,\n uint64 _dstGasForCall,\n bool _useZro,\n bytes calldata _adapterParams\n ) external view returns (uint nativeFee, uint zroFee);\n\n function sendAndCall(\n address _from,\n uint16 _dstChainId,\n bytes calldata _toAddress,\n uint _amount,\n bytes calldata _payload,\n uint64 _dstGasForCall,\n address payable _refundAddress,\n address _zroPaymentAddress,\n bytes calldata _adapterParams\n ) external payable;\n\n function retryOFTReceived(\n uint16 _srcChainId,\n bytes calldata _srcAddress,\n uint64 _nonce,\n bytes calldata _from,\n address _to,\n uint _amount,\n bytes calldata _payload\n ) external;\n\n event CallOFTReceivedFailure(\n uint16 indexed _srcChainId,\n bytes _srcAddress,\n uint64 _nonce,\n bytes _from,\n address indexed _to,\n uint _amount,\n bytes _payload,\n bytes _reason\n );\n\n event CallOFTReceivedSuccess(uint16 indexed _srcChainId, bytes _srcAddress, uint64 _nonce, bytes32 _hash);\n\n event RetryOFTReceivedSuccess(bytes32 _messageHash);\n\n event NonContractAddress(address _address);\n}\n" + }, + "contracts/dependencies/@layerzerolabs/solidity-examples/token/oft/composable/IOFTReceiver.sol": { + "content": "// SPDX-License-Identifier: BUSL-1.1\n\npragma solidity >=0.5.0;\n\ninterface IOFTReceiver {\n /**\n * @dev Called by the OFT contract when tokens are received from source chain.\n * @param _srcChainId The chain id of the source chain.\n * @param _srcAddress The address of the OFT token contract on the source chain.\n * @param _nonce The nonce of the transaction on the source chain.\n * @param _from The address of the account who calls the sendAndCall() on the source chain.\n * @param _amount The amount of tokens to transfer.\n * @param _payload Additional data with no specified format.\n */\n function onOFTReceived(\n uint16 _srcChainId,\n bytes calldata _srcAddress,\n uint64 _nonce,\n bytes calldata _from,\n uint _amount,\n bytes calldata _payload\n ) external;\n}\n" + }, + "contracts/dependencies/@layerzerolabs/solidity-examples/token/oft/IOFT.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.5.0;\n\nimport \"./IOFTCore.sol\";\nimport \"../../../../openzeppelin/token/ERC20/IERC20.sol\";\n\n/**\n * @dev Interface of the OFT standard\n */\ninterface IOFT is IOFTCore, IERC20 {\n\n}\n" + }, + "contracts/dependencies/@layerzerolabs/solidity-examples/token/oft/IOFTCore.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.5.0;\n\nimport \"../../../../openzeppelin/utils/introspection/IERC165.sol\";\n\n/**\n * @dev Interface of the IOFT core standard\n */\ninterface IOFTCore is IERC165 {\n /**\n * @dev estimate send token `_tokenId` to (`_dstChainId`, `_toAddress`)\n * _dstChainId - L0 defined chain id to send tokens too\n * _toAddress - dynamic bytes array which contains the address to whom you are sending tokens to on the dstChain\n * _amount - amount of the tokens to transfer\n * _useZro - indicates to use zro to pay L0 fees\n * _adapterParam - flexible bytes array to indicate messaging adapter services in L0\n */\n function estimateSendFee(\n uint16 _dstChainId,\n bytes calldata _toAddress,\n uint _amount,\n bool _useZro,\n bytes calldata _adapterParams\n ) external view returns (uint nativeFee, uint zroFee);\n\n /**\n * @dev send `_amount` amount of token to (`_dstChainId`, `_toAddress`) from `_from`\n * `_from` the owner of token\n * `_dstChainId` the destination chain identifier\n * `_toAddress` can be any size depending on the `dstChainId`.\n * `_amount` the quantity of tokens in wei\n * `_refundAddress` the address LayerZero refunds if too much message fee is sent\n * `_zroPaymentAddress` set to address(0x0) if not paying in ZRO (LayerZero Token)\n * `_adapterParams` is a flexible bytes array to indicate messaging adapter services\n */\n function sendFrom(\n address _from,\n uint16 _dstChainId,\n bytes calldata _toAddress,\n uint _amount,\n address payable _refundAddress,\n address _zroPaymentAddress,\n bytes calldata _adapterParams\n ) external payable;\n\n /**\n * @dev returns the circulating amount of tokens on current chain\n */\n function circulatingSupply() external view returns (uint);\n\n /**\n * @dev returns the address of the ERC20 token\n */\n function token() external view returns (address);\n\n /**\n * @dev Emitted when `_amount` tokens are moved from the `_sender` to (`_dstChainId`, `_toAddress`)\n * `_nonce` is the outbound nonce\n */\n event SendToChain(uint16 indexed _dstChainId, address indexed _from, bytes _toAddress, uint _amount);\n\n /**\n * @dev Emitted when `_amount` tokens are received from `_srcChainId` into the `_toAddress` on the local chain.\n * `_nonce` is the inbound nonce.\n */\n event ReceiveFromChain(uint16 indexed _srcChainId, address indexed _to, uint _amount);\n\n event SetUseCustomAdapterParams(bool _useCustomAdapterParams);\n}\n" + }, + "contracts/dependencies/@layerzerolabs/solidity-examples/token/oft/OFTCore.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../../lzApp/NonblockingLzApp.sol\";\nimport \"./IOFTCore.sol\";\nimport \"../../../../../dependencies/openzeppelin/utils/introspection/ERC165.sol\";\n\nabstract contract OFTCore is NonblockingLzApp, ERC165, IOFTCore {\n using BytesLib for bytes;\n\n uint public constant NO_EXTRA_GAS = 0;\n\n // packet type\n uint16 public constant PT_SEND = 0;\n\n bool public useCustomAdapterParams;\n\n constructor(address _lzEndpoint) NonblockingLzApp(_lzEndpoint) {}\n\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\n return interfaceId == type(IOFTCore).interfaceId || super.supportsInterface(interfaceId);\n }\n\n function estimateSendFee(\n uint16 _dstChainId,\n bytes calldata _toAddress,\n uint _amount,\n bool _useZro,\n bytes calldata _adapterParams\n ) public view virtual override returns (uint nativeFee, uint zroFee) {\n // mock the payload for sendFrom()\n bytes memory payload = abi.encode(PT_SEND, _toAddress, _amount);\n return lzEndpoint.estimateFees(_dstChainId, address(this), payload, _useZro, _adapterParams);\n }\n\n function sendFrom(\n address _from,\n uint16 _dstChainId,\n bytes calldata _toAddress,\n uint _amount,\n address payable _refundAddress,\n address _zroPaymentAddress,\n bytes calldata _adapterParams\n ) public payable virtual override {\n _send(_from, _dstChainId, _toAddress, _amount, _refundAddress, _zroPaymentAddress, _adapterParams);\n }\n\n function setUseCustomAdapterParams(bool _useCustomAdapterParams) public virtual onlyOwner {\n useCustomAdapterParams = _useCustomAdapterParams;\n emit SetUseCustomAdapterParams(_useCustomAdapterParams);\n }\n\n function _nonblockingLzReceive(\n uint16 _srcChainId,\n bytes memory _srcAddress,\n uint64 _nonce,\n bytes memory _payload\n ) internal virtual override {\n uint16 packetType;\n assembly {\n packetType := mload(add(_payload, 32))\n }\n\n if (packetType == PT_SEND) {\n _sendAck(_srcChainId, _srcAddress, _nonce, _payload);\n } else {\n revert(\"OFTCore: unknown packet type\");\n }\n }\n\n function _send(\n address _from,\n uint16 _dstChainId,\n bytes memory _toAddress,\n uint _amount,\n address payable _refundAddress,\n address _zroPaymentAddress,\n bytes memory _adapterParams\n ) internal virtual {\n _checkAdapterParams(_dstChainId, PT_SEND, _adapterParams, NO_EXTRA_GAS);\n\n uint amount = _debitFrom(_from, _dstChainId, _toAddress, _amount);\n\n bytes memory lzPayload = abi.encode(PT_SEND, _toAddress, amount);\n _lzSend(_dstChainId, lzPayload, _refundAddress, _zroPaymentAddress, _adapterParams, msg.value);\n\n emit SendToChain(_dstChainId, _from, _toAddress, amount);\n }\n\n function _sendAck(uint16 _srcChainId, bytes memory, uint64, bytes memory _payload) internal virtual {\n (, bytes memory toAddressBytes, uint amount) = abi.decode(_payload, (uint16, bytes, uint));\n\n address to = toAddressBytes.toAddress(0);\n\n amount = _creditTo(_srcChainId, to, amount);\n emit ReceiveFromChain(_srcChainId, to, amount);\n }\n\n function _checkAdapterParams(\n uint16 _dstChainId,\n uint16 _pkType,\n bytes memory _adapterParams,\n uint _extraGas\n ) internal virtual {\n if (useCustomAdapterParams) {\n _checkGasLimit(_dstChainId, _pkType, _adapterParams, _extraGas);\n } else {\n require(_adapterParams.length == 0, \"OFTCore: _adapterParams must be empty.\");\n }\n }\n\n function _debitFrom(\n address _from,\n uint16 _dstChainId,\n bytes memory _toAddress,\n uint _amount\n ) internal virtual returns (uint);\n\n function _creditTo(uint16 _srcChainId, address _toAddress, uint _amount) internal virtual returns (uint);\n}\n" + }, + "contracts/dependencies/@layerzerolabs/solidity-examples/util/BytesLib.sol": { + "content": "// SPDX-License-Identifier: Unlicense\n/*\n * @title Solidity Bytes Arrays Utils\n * @author Gonçalo Sá \n *\n * @dev Bytes tightly packed arrays utility library for ethereum contracts written in Solidity.\n * The library lets you concatenate, slice and type cast bytes arrays both in memory and storage.\n */\npragma solidity >=0.8.0 <0.9.0;\n\nlibrary BytesLib {\n function concat(bytes memory _preBytes, bytes memory _postBytes) internal pure returns (bytes memory) {\n bytes memory tempBytes;\n\n assembly {\n // Get a location of some free memory and store it in tempBytes as\n // Solidity does for memory variables.\n tempBytes := mload(0x40)\n\n // Store the length of the first bytes array at the beginning of\n // the memory for tempBytes.\n let length := mload(_preBytes)\n mstore(tempBytes, length)\n\n // Maintain a memory counter for the current write location in the\n // temp bytes array by adding the 32 bytes for the array length to\n // the starting location.\n let mc := add(tempBytes, 0x20)\n // Stop copying when the memory counter reaches the length of the\n // first bytes array.\n let end := add(mc, length)\n\n for {\n // Initialize a copy counter to the start of the _preBytes data,\n // 32 bytes into its memory.\n let cc := add(_preBytes, 0x20)\n } lt(mc, end) {\n // Increase both counters by 32 bytes each iteration.\n mc := add(mc, 0x20)\n cc := add(cc, 0x20)\n } {\n // Write the _preBytes data into the tempBytes memory 32 bytes\n // at a time.\n mstore(mc, mload(cc))\n }\n\n // Add the length of _postBytes to the current length of tempBytes\n // and store it as the new length in the first 32 bytes of the\n // tempBytes memory.\n length := mload(_postBytes)\n mstore(tempBytes, add(length, mload(tempBytes)))\n\n // Move the memory counter back from a multiple of 0x20 to the\n // actual end of the _preBytes data.\n mc := end\n // Stop copying when the memory counter reaches the new combined\n // length of the arrays.\n end := add(mc, length)\n\n for {\n let cc := add(_postBytes, 0x20)\n } lt(mc, end) {\n mc := add(mc, 0x20)\n cc := add(cc, 0x20)\n } {\n mstore(mc, mload(cc))\n }\n\n // Update the free-memory pointer by padding our last write location\n // to 32 bytes: add 31 bytes to the end of tempBytes to move to the\n // next 32 byte block, then round down to the nearest multiple of\n // 32. If the sum of the length of the two arrays is zero then add\n // one before rounding down to leave a blank 32 bytes (the length block with 0).\n mstore(\n 0x40,\n and(\n add(add(end, iszero(add(length, mload(_preBytes)))), 31),\n not(31) // Round down to the nearest 32 bytes.\n )\n )\n }\n\n return tempBytes;\n }\n\n function concatStorage(bytes storage _preBytes, bytes memory _postBytes) internal {\n assembly {\n // Read the first 32 bytes of _preBytes storage, which is the length\n // of the array. (We don't need to use the offset into the slot\n // because arrays use the entire slot.)\n let fslot := sload(_preBytes.slot)\n // Arrays of 31 bytes or less have an even value in their slot,\n // while longer arrays have an odd value. The actual length is\n // the slot divided by two for odd values, and the lowest order\n // byte divided by two for even values.\n // If the slot is even, bitwise and the slot with 255 and divide by\n // two to get the length. If the slot is odd, bitwise and the slot\n // with -1 and divide by two.\n let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2)\n let mlength := mload(_postBytes)\n let newlength := add(slength, mlength)\n // slength can contain both the length and contents of the array\n // if length < 32 bytes so let's prepare for that\n // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage\n switch add(lt(slength, 32), lt(newlength, 32))\n case 2 {\n // Since the new array still fits in the slot, we just need to\n // update the contents of the slot.\n // uint256(bytes_storage) = uint256(bytes_storage) + uint256(bytes_memory) + new_length\n sstore(\n _preBytes.slot,\n // all the modifications to the slot are inside this\n // next block\n add(\n // we can just add to the slot contents because the\n // bytes we want to change are the LSBs\n fslot,\n add(\n mul(\n div(\n // load the bytes from memory\n mload(add(_postBytes, 0x20)),\n // zero all bytes to the right\n exp(0x100, sub(32, mlength))\n ),\n // and now shift left the number of bytes to\n // leave space for the length in the slot\n exp(0x100, sub(32, newlength))\n ),\n // increase length by the double of the memory\n // bytes length\n mul(mlength, 2)\n )\n )\n )\n }\n case 1 {\n // The stored value fits in the slot, but the combined value\n // will exceed it.\n // get the keccak hash to get the contents of the array\n mstore(0x0, _preBytes.slot)\n let sc := add(keccak256(0x0, 0x20), div(slength, 32))\n\n // save new length\n sstore(_preBytes.slot, add(mul(newlength, 2), 1))\n\n // The contents of the _postBytes array start 32 bytes into\n // the structure. Our first read should obtain the `submod`\n // bytes that can fit into the unused space in the last word\n // of the stored array. To get this, we read 32 bytes starting\n // from `submod`, so the data we read overlaps with the array\n // contents by `submod` bytes. Masking the lowest-order\n // `submod` bytes allows us to add that value directly to the\n // stored value.\n\n let submod := sub(32, slength)\n let mc := add(_postBytes, submod)\n let end := add(_postBytes, mlength)\n let mask := sub(exp(0x100, submod), 1)\n\n sstore(\n sc,\n add(\n and(fslot, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00),\n and(mload(mc), mask)\n )\n )\n\n for {\n mc := add(mc, 0x20)\n sc := add(sc, 1)\n } lt(mc, end) {\n sc := add(sc, 1)\n mc := add(mc, 0x20)\n } {\n sstore(sc, mload(mc))\n }\n\n mask := exp(0x100, sub(mc, end))\n\n sstore(sc, mul(div(mload(mc), mask), mask))\n }\n default {\n // get the keccak hash to get the contents of the array\n mstore(0x0, _preBytes.slot)\n // Start copying to the last used word of the stored array.\n let sc := add(keccak256(0x0, 0x20), div(slength, 32))\n\n // save new length\n sstore(_preBytes.slot, add(mul(newlength, 2), 1))\n\n // Copy over the first `submod` bytes of the new data as in\n // case 1 above.\n let slengthmod := mod(slength, 32)\n let mlengthmod := mod(mlength, 32)\n let submod := sub(32, slengthmod)\n let mc := add(_postBytes, submod)\n let end := add(_postBytes, mlength)\n let mask := sub(exp(0x100, submod), 1)\n\n sstore(sc, add(sload(sc), and(mload(mc), mask)))\n\n for {\n sc := add(sc, 1)\n mc := add(mc, 0x20)\n } lt(mc, end) {\n sc := add(sc, 1)\n mc := add(mc, 0x20)\n } {\n sstore(sc, mload(mc))\n }\n\n mask := exp(0x100, sub(mc, end))\n\n sstore(sc, mul(div(mload(mc), mask), mask))\n }\n }\n }\n\n function slice(bytes memory _bytes, uint256 _start, uint256 _length) internal pure returns (bytes memory) {\n require(_length + 31 >= _length, \"slice_overflow\");\n require(_bytes.length >= _start + _length, \"slice_outOfBounds\");\n\n bytes memory tempBytes;\n\n assembly {\n switch iszero(_length)\n case 0 {\n // Get a location of some free memory and store it in tempBytes as\n // Solidity does for memory variables.\n tempBytes := mload(0x40)\n\n // The first word of the slice result is potentially a partial\n // word read from the original array. To read it, we calculate\n // the length of that partial word and start copying that many\n // bytes into the array. The first word we copy will start with\n // data we don't care about, but the last `lengthmod` bytes will\n // land at the beginning of the contents of the new array. When\n // we're done copying, we overwrite the full first word with\n // the actual length of the slice.\n let lengthmod := and(_length, 31)\n\n // The multiplication in the next line is necessary\n // because when slicing multiples of 32 bytes (lengthmod == 0)\n // the following copy loop was copying the origin's length\n // and then ending prematurely not copying everything it should.\n let mc := add(add(tempBytes, lengthmod), mul(0x20, iszero(lengthmod)))\n let end := add(mc, _length)\n\n for {\n // The multiplication in the next line has the same exact purpose\n // as the one above.\n let cc := add(add(add(_bytes, lengthmod), mul(0x20, iszero(lengthmod))), _start)\n } lt(mc, end) {\n mc := add(mc, 0x20)\n cc := add(cc, 0x20)\n } {\n mstore(mc, mload(cc))\n }\n\n mstore(tempBytes, _length)\n\n //update free-memory pointer\n //allocating the array padded to 32 bytes like the compiler does now\n mstore(0x40, and(add(mc, 31), not(31)))\n }\n //if we want a zero-length slice let's just return a zero-length array\n default {\n tempBytes := mload(0x40)\n //zero out the 32 bytes slice we are about to return\n //we need to do it because Solidity does not garbage collect\n mstore(tempBytes, 0)\n\n mstore(0x40, add(tempBytes, 0x20))\n }\n }\n\n return tempBytes;\n }\n\n function toAddress(bytes memory _bytes, uint256 _start) internal pure returns (address) {\n require(_bytes.length >= _start + 20, \"toAddress_outOfBounds\");\n address tempAddress;\n\n assembly {\n tempAddress := div(mload(add(add(_bytes, 0x20), _start)), 0x1000000000000000000000000)\n }\n\n return tempAddress;\n }\n\n function toUint8(bytes memory _bytes, uint256 _start) internal pure returns (uint8) {\n require(_bytes.length >= _start + 1, \"toUint8_outOfBounds\");\n uint8 tempUint;\n\n assembly {\n tempUint := mload(add(add(_bytes, 0x1), _start))\n }\n\n return tempUint;\n }\n\n function toUint16(bytes memory _bytes, uint256 _start) internal pure returns (uint16) {\n require(_bytes.length >= _start + 2, \"toUint16_outOfBounds\");\n uint16 tempUint;\n\n assembly {\n tempUint := mload(add(add(_bytes, 0x2), _start))\n }\n\n return tempUint;\n }\n\n function toUint32(bytes memory _bytes, uint256 _start) internal pure returns (uint32) {\n require(_bytes.length >= _start + 4, \"toUint32_outOfBounds\");\n uint32 tempUint;\n\n assembly {\n tempUint := mload(add(add(_bytes, 0x4), _start))\n }\n\n return tempUint;\n }\n\n function toUint64(bytes memory _bytes, uint256 _start) internal pure returns (uint64) {\n require(_bytes.length >= _start + 8, \"toUint64_outOfBounds\");\n uint64 tempUint;\n\n assembly {\n tempUint := mload(add(add(_bytes, 0x8), _start))\n }\n\n return tempUint;\n }\n\n function toUint96(bytes memory _bytes, uint256 _start) internal pure returns (uint96) {\n require(_bytes.length >= _start + 12, \"toUint96_outOfBounds\");\n uint96 tempUint;\n\n assembly {\n tempUint := mload(add(add(_bytes, 0xc), _start))\n }\n\n return tempUint;\n }\n\n function toUint128(bytes memory _bytes, uint256 _start) internal pure returns (uint128) {\n require(_bytes.length >= _start + 16, \"toUint128_outOfBounds\");\n uint128 tempUint;\n\n assembly {\n tempUint := mload(add(add(_bytes, 0x10), _start))\n }\n\n return tempUint;\n }\n\n function toUint256(bytes memory _bytes, uint256 _start) internal pure returns (uint256) {\n require(_bytes.length >= _start + 32, \"toUint256_outOfBounds\");\n uint256 tempUint;\n\n assembly {\n tempUint := mload(add(add(_bytes, 0x20), _start))\n }\n\n return tempUint;\n }\n\n function toBytes32(bytes memory _bytes, uint256 _start) internal pure returns (bytes32) {\n require(_bytes.length >= _start + 32, \"toBytes32_outOfBounds\");\n bytes32 tempBytes32;\n\n assembly {\n tempBytes32 := mload(add(add(_bytes, 0x20), _start))\n }\n\n return tempBytes32;\n }\n\n function equal(bytes memory _preBytes, bytes memory _postBytes) internal pure returns (bool) {\n bool success = true;\n\n assembly {\n let length := mload(_preBytes)\n\n // if lengths don't match the arrays are not equal\n switch eq(length, mload(_postBytes))\n case 1 {\n // cb is a circuit breaker in the for loop since there's\n // no said feature for inline assembly loops\n // cb = 1 - don't breaker\n // cb = 0 - break\n let cb := 1\n\n let mc := add(_preBytes, 0x20)\n let end := add(mc, length)\n\n for {\n let cc := add(_postBytes, 0x20)\n // the next line is the loop condition:\n // while(uint256(mc < end) + cb == 2)\n } eq(add(lt(mc, end), cb), 2) {\n mc := add(mc, 0x20)\n cc := add(cc, 0x20)\n } {\n // if any of these checks fails then arrays are not equal\n if iszero(eq(mload(mc), mload(cc))) {\n // unsuccess:\n success := 0\n cb := 0\n }\n }\n }\n default {\n // unsuccess:\n success := 0\n }\n }\n\n return success;\n }\n\n function equalStorage(bytes storage _preBytes, bytes memory _postBytes) internal view returns (bool) {\n bool success = true;\n\n assembly {\n // we know _preBytes_offset is 0\n let fslot := sload(_preBytes.slot)\n // Decode the length of the stored array like in concatStorage().\n let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2)\n let mlength := mload(_postBytes)\n\n // if lengths don't match the arrays are not equal\n switch eq(slength, mlength)\n case 1 {\n // slength can contain both the length and contents of the array\n // if length < 32 bytes so let's prepare for that\n // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage\n if iszero(iszero(slength)) {\n switch lt(slength, 32)\n case 1 {\n // blank the last byte which is the length\n fslot := mul(div(fslot, 0x100), 0x100)\n\n if iszero(eq(fslot, mload(add(_postBytes, 0x20)))) {\n // unsuccess:\n success := 0\n }\n }\n default {\n // cb is a circuit breaker in the for loop since there's\n // no said feature for inline assembly loops\n // cb = 1 - don't breaker\n // cb = 0 - break\n let cb := 1\n\n // get the keccak hash to get the contents of the array\n mstore(0x0, _preBytes.slot)\n let sc := keccak256(0x0, 0x20)\n\n let mc := add(_postBytes, 0x20)\n let end := add(mc, mlength)\n\n // the next line is the loop condition:\n // while(uint256(mc < end) + cb == 2)\n for {\n\n } eq(add(lt(mc, end), cb), 2) {\n sc := add(sc, 1)\n mc := add(mc, 0x20)\n } {\n if iszero(eq(sload(sc), mload(mc))) {\n // unsuccess:\n success := 0\n cb := 0\n }\n }\n }\n }\n }\n default {\n // unsuccess:\n success := 0\n }\n }\n\n return success;\n }\n}\n" + }, + "contracts/dependencies/@layerzerolabs/solidity-examples/util/ExcessivelySafeCall.sol": { + "content": "// SPDX-License-Identifier: MIT OR Apache-2.0\npragma solidity >=0.7.6;\n\nlibrary ExcessivelySafeCall {\n uint256 constant LOW_28_MASK = 0x00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff;\n\n /// @notice Use when you _really_ really _really_ don't trust the called\n /// contract. This prevents the called contract from causing reversion of\n /// the caller in as many ways as we can.\n /// @dev The main difference between this and a solidity low-level call is\n /// that we limit the number of bytes that the callee can cause to be\n /// copied to caller memory. This prevents stupid things like malicious\n /// contracts returning 10,000,000 bytes causing a local OOG when copying\n /// to memory.\n /// @param _target The address to call\n /// @param _gas The amount of gas to forward to the remote contract\n /// @param _maxCopy The maximum number of bytes of returndata to copy\n /// to memory.\n /// @param _calldata The data to send to the remote contract\n /// @return success and returndata, as `.call()`. Returndata is capped to\n /// `_maxCopy` bytes.\n function excessivelySafeCall(\n address _target,\n uint256 _gas,\n uint16 _maxCopy,\n bytes memory _calldata\n ) internal returns (bool, bytes memory) {\n // set up for assembly call\n uint256 _toCopy;\n bool _success;\n bytes memory _returnData = new bytes(_maxCopy);\n // dispatch message to recipient\n // by assembly calling \"handle\" function\n // we call via assembly to avoid memcopying a very large returndata\n // returned by a malicious contract\n assembly {\n _success := call(\n _gas, // gas\n _target, // recipient\n 0, // ether value\n add(_calldata, 0x20), // inloc\n mload(_calldata), // inlen\n 0, // outloc\n 0 // outlen\n )\n // limit our copy to 256 bytes\n _toCopy := returndatasize()\n if gt(_toCopy, _maxCopy) {\n _toCopy := _maxCopy\n }\n // Store the length of the copied bytes\n mstore(_returnData, _toCopy)\n // copy the bytes from returndata[0:_toCopy]\n returndatacopy(add(_returnData, 0x20), 0, _toCopy)\n }\n return (_success, _returnData);\n }\n\n /// @notice Use when you _really_ really _really_ don't trust the called\n /// contract. This prevents the called contract from causing reversion of\n /// the caller in as many ways as we can.\n /// @dev The main difference between this and a solidity low-level call is\n /// that we limit the number of bytes that the callee can cause to be\n /// copied to caller memory. This prevents stupid things like malicious\n /// contracts returning 10,000,000 bytes causing a local OOG when copying\n /// to memory.\n /// @param _target The address to call\n /// @param _gas The amount of gas to forward to the remote contract\n /// @param _maxCopy The maximum number of bytes of returndata to copy\n /// to memory.\n /// @param _calldata The data to send to the remote contract\n /// @return success and returndata, as `.call()`. Returndata is capped to\n /// `_maxCopy` bytes.\n function excessivelySafeStaticCall(\n address _target,\n uint256 _gas,\n uint16 _maxCopy,\n bytes memory _calldata\n ) internal view returns (bool, bytes memory) {\n // set up for assembly call\n uint256 _toCopy;\n bool _success;\n bytes memory _returnData = new bytes(_maxCopy);\n // dispatch message to recipient\n // by assembly calling \"handle\" function\n // we call via assembly to avoid memcopying a very large returndata\n // returned by a malicious contract\n assembly {\n _success := staticcall(\n _gas, // gas\n _target, // recipient\n add(_calldata, 0x20), // inloc\n mload(_calldata), // inlen\n 0, // outloc\n 0 // outlen\n )\n // limit our copy to 256 bytes\n _toCopy := returndatasize()\n if gt(_toCopy, _maxCopy) {\n _toCopy := _maxCopy\n }\n // Store the length of the copied bytes\n mstore(_returnData, _toCopy)\n // copy the bytes from returndata[0:_toCopy]\n returndatacopy(add(_returnData, 0x20), 0, _toCopy)\n }\n return (_success, _returnData);\n }\n\n /**\n * @notice Swaps function selectors in encoded contract calls\n * @dev Allows reuse of encoded calldata for functions with identical\n * argument types but different names. It simply swaps out the first 4 bytes\n * for the new selector. This function modifies memory in place, and should\n * only be used with caution.\n * @param _newSelector The new 4-byte selector\n * @param _buf The encoded contract args\n */\n function swapSelector(bytes4 _newSelector, bytes memory _buf) internal pure {\n require(_buf.length >= 4);\n uint256 _mask = LOW_28_MASK;\n assembly {\n // load the first word of\n let _word := mload(add(_buf, 0x20))\n // mask out the top 4 bytes\n // /x\n _word := and(_word, _mask)\n _word := or(_newSelector, _word)\n mstore(add(_buf, 0x20), _word)\n }\n }\n}\n" + }, + "contracts/dependencies/openzeppelin-upgradeable/access/OwnableUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (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 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 /**\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" + }, + "contracts/dependencies/openzeppelin-upgradeable/proxy/utils/Initializable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.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 * ```\n * contract MyToken is ERC20Upgradeable {\n * function initialize() initializer public {\n * __ERC20_init(\"MyToken\", \"MTK\");\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. Equivalent to `reinitializer(1)`.\n */\n modifier initializer() {\n bool isTopLevelCall = _setInitializedVersion(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 * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original\n * initialization step. This is essential to configure modules that are added through upgrades and that require\n * initialization.\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 modifier reinitializer(uint8 version) {\n bool isTopLevelCall = _setInitializedVersion(version);\n if (isTopLevelCall) {\n _initializing = true;\n }\n _;\n if (isTopLevelCall) {\n _initializing = false;\n emit Initialized(version);\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} 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 function _disableInitializers() internal virtual {\n _setInitializedVersion(type(uint8).max);\n }\n\n function _setInitializedVersion(uint8 version) private returns (bool) {\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, and for the lowest level\n // of initializers, because in other contexts the contract may have been reentered.\n if (_initializing) {\n require(\n version == 1 && !AddressUpgradeable.isContract(address(this)),\n \"Initializable: contract is already initialized\"\n );\n return false;\n } else {\n require(_initialized < version, \"Initializable: contract is already initialized\");\n _initialized = version;\n return true;\n }\n }\n}\n" + }, + "contracts/dependencies/openzeppelin-upgradeable/utils/AddressUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.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 *\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 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" + }, + "contracts/dependencies/openzeppelin-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" + }, + "contracts/dependencies/openzeppelin-upgradeable/utils/introspection/ERC165Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC165Upgradeable.sol\";\nimport \"../../proxy/utils/Initializable.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 ERC165Upgradeable is Initializable, IERC165Upgradeable {\n function __ERC165_init() internal onlyInitializing {\n }\n\n function __ERC165_init_unchained() internal onlyInitializing {\n }\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IERC165Upgradeable).interfaceId;\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" + }, + "contracts/dependencies/openzeppelin-upgradeable/utils/introspection/IERC165Upgradeable.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 IERC165Upgradeable {\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" + }, + "contracts/dependencies/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() {\n _transferOwnership(_msgSender());\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" + }, + "contracts/dependencies/openzeppelin/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" + }, + "contracts/dependencies/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" + }, + "contracts/dependencies/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" + }, + "contracts/dependencies/openzeppelin/proxy/ERC1967/ERC1967Upgrade.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.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 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(\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(\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" + }, + "contracts/dependencies/openzeppelin/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" + }, + "contracts/dependencies/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 * @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" + }, + "contracts/dependencies/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" + }, + "contracts/dependencies/openzeppelin/proxy/utils/Initializable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.2;\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 * 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 * ```\n * contract MyToken is ERC20Upgradeable {\n * function initialize() initializer public {\n * __ERC20_init(\"MyToken\", \"MTK\");\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. Equivalent to `reinitializer(1)`.\n */\n modifier initializer() {\n bool isTopLevelCall = _setInitializedVersion(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 * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original\n * initialization step. This is essential to configure modules that are added through upgrades and that require\n * initialization.\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 modifier reinitializer(uint8 version) {\n bool isTopLevelCall = _setInitializedVersion(version);\n if (isTopLevelCall) {\n _initializing = true;\n }\n _;\n if (isTopLevelCall) {\n _initializing = false;\n emit Initialized(version);\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} 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 function _disableInitializers() internal virtual {\n _setInitializedVersion(type(uint8).max);\n }\n\n function _setInitializedVersion(uint8 version) private returns (bool) {\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, and for the lowest level\n // of initializers, because in other contexts the contract may have been reentered.\n if (_initializing) {\n require(\n version == 1 && !Address.isContract(address(this)),\n \"Initializable: contract is already initialized\"\n );\n return false;\n } else {\n require(_initialized < version, \"Initializable: contract is already initialized\");\n _initialized = version;\n return true;\n }\n }\n}\n" + }, + "contracts/dependencies/openzeppelin/security/ReentrancyGuard.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)\n\npragma solidity ^0.8.0;\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 ReentrancyGuard {\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 constructor() {\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 // On the first call to nonReentrant, _notEntered will be true\n require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n // Any calls to nonReentrant after this point will fail\n _status = _ENTERED;\n\n _;\n\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" + }, + "contracts/dependencies/openzeppelin/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n\n// OpenZeppelin Contracts (last updated v4.8.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" + }, + "contracts/dependencies/openzeppelin/token/ERC20/extensions/IERC20Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\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" + }, + "contracts/dependencies/openzeppelin/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\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 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 `recipient`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address recipient, 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 `sender` to `recipient` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) external returns (bool);\n\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" + }, + "contracts/dependencies/openzeppelin/token/ERC20/utils/SafeERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\nimport \"../../../utils/Address.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n using Address for address;\n\n function safeTransfer(\n IERC20 token,\n address to,\n uint256 value\n ) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n }\n\n function safeTransferFrom(\n IERC20 token,\n address from,\n address to,\n uint256 value\n ) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\n }\n\n /**\n * @dev Deprecated. This function has issues similar to the ones found in\n * {IERC20-approve}, and its usage is discouraged.\n *\n * Whenever possible, use {safeIncreaseAllowance} and\n * {safeDecreaseAllowance} instead.\n */\n function safeApprove(\n IERC20 token,\n address spender,\n uint256 value\n ) internal {\n // safeApprove should only be called when setting an initial allowance,\n // or when resetting it to zero. To increase and decrease it, use\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\n require(\n (value == 0) || (token.allowance(address(this), spender) == 0),\n \"SafeERC20: approve from non-zero to non-zero allowance\"\n );\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\n }\n\n function safeIncreaseAllowance(\n IERC20 token,\n address spender,\n uint256 value\n ) internal {\n uint256 newAllowance = token.allowance(address(this), spender) + value;\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n\n function safeDecreaseAllowance(\n IERC20 token,\n address spender,\n uint256 value\n ) internal {\n unchecked {\n uint256 oldAllowance = token.allowance(address(this), spender);\n require(oldAllowance >= value, \"SafeERC20: decreased allowance below zero\");\n uint256 newAllowance = oldAllowance - value;\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n }\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data, \"SafeERC20: low-level call failed\");\n if (returndata.length > 0) {\n // Return data is optional\n require(abi.decode(returndata, (bool)), \"SafeERC20: ERC20 operation did not succeed\");\n }\n }\n}\n" + }, + "contracts/dependencies/openzeppelin/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.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" + }, + "contracts/dependencies/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" + }, + "contracts/dependencies/openzeppelin/utils/cryptography/MerkleProof.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev These functions deal with verification of Merkle Trees proofs.\n *\n * The proofs can be generated using the JavaScript library\n * https://github.com/miguelmota/merkletreejs[merkletreejs].\n * Note: the hashing algorithm should be keccak256 and pair sorting should be enabled.\n *\n * See `test/utils/cryptography/MerkleProof.test.js` for some examples.\n */\nlibrary MerkleProof {\n /**\n * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree\n * defined by `root`. For this, a `proof` must be provided, containing\n * sibling hashes on the branch from the leaf to the root of the tree. Each\n * pair of leaves and each pair of pre-images are assumed to be sorted.\n */\n function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf) internal pure returns (bool) {\n bytes32 computedHash = leaf;\n\n for (uint256 i = 0; i < proof.length; i++) {\n bytes32 proofElement = proof[i];\n\n if (computedHash <= proofElement) {\n // Hash(current computed hash + current element of the proof)\n computedHash = keccak256(abi.encodePacked(computedHash, proofElement));\n } else {\n // Hash(current element of the proof + current computed hash)\n computedHash = keccak256(abi.encodePacked(proofElement, computedHash));\n }\n }\n\n // Check if the computed hash (root) is equal to the provided root\n return computedHash == root;\n }\n}\n" + }, + "contracts/dependencies/openzeppelin/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" + }, + "contracts/dependencies/openzeppelin/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" + }, + "contracts/dependencies/openzeppelin/utils/math/Math.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.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 /**\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 / b + (a % b == 0 ? 0 : 1);\n }\n}\n" + }, + "contracts/dependencies/openzeppelin/utils/math/SafeCast.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/math/SafeCast.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow\n * checks.\n *\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\n * easily result in undesired exploitation or bugs, since developers usually\n * assume that overflows raise errors. `SafeCast` restores this intuition by\n * reverting the transaction when such an operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n *\n * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing\n * all math on `uint256` and `int256` and then downcasting.\n */\nlibrary SafeCast {\n /**\n * @dev Returns the downcasted uint224 from uint256, reverting on\n * overflow (when the input is greater than largest uint224).\n *\n * Counterpart to Solidity's `uint224` operator.\n *\n * Requirements:\n *\n * - input must fit into 224 bits\n */\n function toUint224(uint256 value) internal pure returns (uint224) {\n require(value <= type(uint224).max, \"SafeCast: value doesn't fit in 224 bits\");\n return uint224(value);\n }\n\n /**\n * @dev Returns the downcasted uint128 from uint256, reverting on\n * overflow (when the input is greater than largest uint128).\n *\n * Counterpart to Solidity's `uint128` operator.\n *\n * Requirements:\n *\n * - input must fit into 128 bits\n */\n function toUint128(uint256 value) internal pure returns (uint128) {\n require(value <= type(uint128).max, \"SafeCast: value doesn't fit in 128 bits\");\n return uint128(value);\n }\n\n /**\n * @dev Returns the downcasted uint96 from uint256, reverting on\n * overflow (when the input is greater than largest uint96).\n *\n * Counterpart to Solidity's `uint96` operator.\n *\n * Requirements:\n *\n * - input must fit into 96 bits\n */\n function toUint96(uint256 value) internal pure returns (uint96) {\n require(value <= type(uint96).max, \"SafeCast: value doesn't fit in 96 bits\");\n return uint96(value);\n }\n\n /**\n * @dev Returns the downcasted uint64 from uint256, reverting on\n * overflow (when the input is greater than largest uint64).\n *\n * Counterpart to Solidity's `uint64` operator.\n *\n * Requirements:\n *\n * - input must fit into 64 bits\n */\n function toUint64(uint256 value) internal pure returns (uint64) {\n require(value <= type(uint64).max, \"SafeCast: value doesn't fit in 64 bits\");\n return uint64(value);\n }\n\n /**\n * @dev Returns the downcasted uint32 from uint256, reverting on\n * overflow (when the input is greater than largest uint32).\n *\n * Counterpart to Solidity's `uint32` operator.\n *\n * Requirements:\n *\n * - input must fit into 32 bits\n */\n function toUint32(uint256 value) internal pure returns (uint32) {\n require(value <= type(uint32).max, \"SafeCast: value doesn't fit in 32 bits\");\n return uint32(value);\n }\n\n /**\n * @dev Returns the downcasted uint16 from uint256, reverting on\n * overflow (when the input is greater than largest uint16).\n *\n * Counterpart to Solidity's `uint16` operator.\n *\n * Requirements:\n *\n * - input must fit into 16 bits\n */\n function toUint16(uint256 value) internal pure returns (uint16) {\n require(value <= type(uint16).max, \"SafeCast: value doesn't fit in 16 bits\");\n return uint16(value);\n }\n\n /**\n * @dev Returns the downcasted uint8 from uint256, reverting on\n * overflow (when the input is greater than largest uint8).\n *\n * Counterpart to Solidity's `uint8` operator.\n *\n * Requirements:\n *\n * - input must fit into 8 bits.\n */\n function toUint8(uint256 value) internal pure returns (uint8) {\n require(value <= type(uint8).max, \"SafeCast: value doesn't fit in 8 bits\");\n return uint8(value);\n }\n\n /**\n * @dev Converts a signed int256 into an unsigned uint256.\n *\n * Requirements:\n *\n * - input must be greater than or equal to 0.\n */\n function toUint256(int256 value) internal pure returns (uint256) {\n require(value >= 0, \"SafeCast: value must be positive\");\n return uint256(value);\n }\n\n /**\n * @dev Returns the downcasted int128 from int256, reverting on\n * overflow (when the input is less than smallest int128 or\n * greater than largest int128).\n *\n * Counterpart to Solidity's `int128` operator.\n *\n * Requirements:\n *\n * - input must fit into 128 bits\n *\n * _Available since v3.1._\n */\n function toInt128(int256 value) internal pure returns (int128) {\n require(value >= type(int128).min && value <= type(int128).max, \"SafeCast: value doesn't fit in 128 bits\");\n return int128(value);\n }\n\n /**\n * @dev Returns the downcasted int64 from int256, reverting on\n * overflow (when the input is less than smallest int64 or\n * greater than largest int64).\n *\n * Counterpart to Solidity's `int64` operator.\n *\n * Requirements:\n *\n * - input must fit into 64 bits\n *\n * _Available since v3.1._\n */\n function toInt64(int256 value) internal pure returns (int64) {\n require(value >= type(int64).min && value <= type(int64).max, \"SafeCast: value doesn't fit in 64 bits\");\n return int64(value);\n }\n\n /**\n * @dev Returns the downcasted int32 from int256, reverting on\n * overflow (when the input is less than smallest int32 or\n * greater than largest int32).\n *\n * Counterpart to Solidity's `int32` operator.\n *\n * Requirements:\n *\n * - input must fit into 32 bits\n *\n * _Available since v3.1._\n */\n function toInt32(int256 value) internal pure returns (int32) {\n require(value >= type(int32).min && value <= type(int32).max, \"SafeCast: value doesn't fit in 32 bits\");\n return int32(value);\n }\n\n /**\n * @dev Returns the downcasted int16 from int256, reverting on\n * overflow (when the input is less than smallest int16 or\n * greater than largest int16).\n *\n * Counterpart to Solidity's `int16` operator.\n *\n * Requirements:\n *\n * - input must fit into 16 bits\n *\n * _Available since v3.1._\n */\n function toInt16(int256 value) internal pure returns (int16) {\n require(value >= type(int16).min && value <= type(int16).max, \"SafeCast: value doesn't fit in 16 bits\");\n return int16(value);\n }\n\n /**\n * @dev Returns the downcasted int8 from int256, reverting on\n * overflow (when the input is less than smallest int8 or\n * greater than largest int8).\n *\n * Counterpart to Solidity's `int8` operator.\n *\n * Requirements:\n *\n * - input must fit into 8 bits.\n *\n * _Available since v3.1._\n */\n function toInt8(int256 value) internal pure returns (int8) {\n require(value >= type(int8).min && value <= type(int8).max, \"SafeCast: value doesn't fit in 8 bits\");\n return int8(value);\n }\n\n /**\n * @dev Converts an unsigned uint256 into a signed int256.\n *\n * Requirements:\n *\n * - input must be less than or equal to maxInt256.\n */\n function toInt256(uint256 value) internal pure returns (int256) {\n // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\n require(value <= uint256(type(int256).max), \"SafeCast: value doesn't fit in an int256\");\n return int256(value);\n }\n}\n" + }, + "contracts/dependencies/openzeppelin/utils/math/SafeMath.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (utils/math/SafeMath.sol)\n\npragma solidity ^0.8.0;\n\n// CAUTION\n// This version of SafeMath should only be used with Solidity 0.8 or later,\n// because it relies on the compiler's built in overflow checks.\n\n/**\n * @dev Wrappers over Solidity's arithmetic operations.\n *\n * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler\n * now has built in overflow checking.\n */\nlibrary SafeMath {\n /**\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n unchecked {\n uint256 c = a + b;\n if (c < a) return (false, 0);\n return (true, c);\n }\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n unchecked {\n if (b > a) return (false, 0);\n return (true, a - b);\n }\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\n *\n * _Available since v3.4._\n */\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n unchecked {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n if (a == 0) return (true, 0);\n uint256 c = a * b;\n if (c / a != b) return (false, 0);\n return (true, c);\n }\n }\n\n /**\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n unchecked {\n if (b == 0) return (false, 0);\n return (true, a / b);\n }\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\n *\n * _Available since v3.4._\n */\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n unchecked {\n if (b == 0) return (false, 0);\n return (true, a % b);\n }\n }\n\n /**\n * @dev Returns the addition of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `+` operator.\n *\n * Requirements:\n *\n * - Addition cannot overflow.\n */\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n return a + b;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting on\n * overflow (when the result is negative).\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n return a - b;\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `*` operator.\n *\n * Requirements:\n *\n * - Multiplication cannot overflow.\n */\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n return a * b;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting on\n * division by zero. The result is rounded towards zero.\n *\n * Counterpart to Solidity's `/` operator.\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\n return a / b;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting when dividing by zero.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n return a % b;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\n * overflow (when the result is negative).\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {trySub}.\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n *\n * - Subtraction cannot overflow.\n */\n function sub(\n uint256 a,\n uint256 b,\n string memory errorMessage\n ) internal pure returns (uint256) {\n unchecked {\n require(b <= a, errorMessage);\n return a - b;\n }\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\n * division by zero. The result is rounded towards zero.\n *\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\n * uses an invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function div(\n uint256 a,\n uint256 b,\n string memory errorMessage\n ) internal pure returns (uint256) {\n unchecked {\n require(b > 0, errorMessage);\n return a / b;\n }\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * reverting with custom message when dividing by zero.\n *\n * CAUTION: This function is deprecated because it requires allocating memory for the error\n * message unnecessarily. For custom revert reasons use {tryMod}.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n *\n * - The divisor cannot be zero.\n */\n function mod(\n uint256 a,\n uint256 b,\n string memory errorMessage\n ) internal pure returns (uint256) {\n unchecked {\n require(b > 0, errorMessage);\n return a % b;\n }\n }\n}\n" + }, + "contracts/dependencies/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" + }, + "contracts/dependencies/openzeppelin/utils/structs/EnumerableSet.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (utils/structs/EnumerableSet.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```\n * contract Example {\n * // Add the library methods\n * using EnumerableSet for EnumerableSet.AddressSet;\n *\n * // Declare a set state variable\n * EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n */\nlibrary EnumerableSet {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Set type with\n // bytes32 values.\n // The Set implementation uses private functions, and user-facing\n // implementations (such as AddressSet) are just wrappers around the\n // underlying Set.\n // This means that we can only create new EnumerableSets for types that fit\n // in bytes32.\n\n struct Set {\n // Storage of set values\n bytes32[] _values;\n // Position of the value in the `values` array, plus 1 because index 0\n // means a value is not in the set.\n mapping(bytes32 => uint256) _indexes;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function _add(Set storage set, bytes32 value) private returns (bool) {\n if (!_contains(set, value)) {\n set._values.push(value);\n // The value is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n set._indexes[value] = set._values.length;\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function _remove(Set storage set, bytes32 value) private returns (bool) {\n // We read and store the value's index to prevent multiple reads from the same storage slot\n uint256 valueIndex = set._indexes[value];\n\n if (valueIndex != 0) {\n // Equivalent to contains(set, value)\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n // the array, and then remove the last element (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 toDeleteIndex = valueIndex - 1;\n uint256 lastIndex = set._values.length - 1;\n\n if (lastIndex != toDeleteIndex) {\n bytes32 lastValue = set._values[lastIndex];\n\n // Move the last value to the index where the value to delete is\n set._values[toDeleteIndex] = lastValue;\n // Update the index for the moved value\n set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex\n }\n\n // Delete the slot where the moved value was stored\n set._values.pop();\n\n // Delete the index for the deleted slot\n delete set._indexes[value];\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\n return set._indexes[value] != 0;\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function _length(Set storage set) private view returns (uint256) {\n return set._values.length;\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\n return set._values[index];\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function _values(Set storage set) private view returns (bytes32[] memory) {\n return set._values;\n }\n\n // Bytes32Set\n\n struct Bytes32Set {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _add(set._inner, value);\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _remove(set._inner, value);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n return _contains(set._inner, value);\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(Bytes32Set storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n return _at(set._inner, index);\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\n return _values(set._inner);\n }\n\n // AddressSet\n\n struct AddressSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(AddressSet storage set, address value) internal view returns (bool) {\n return _contains(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(AddressSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\n return address(uint160(uint256(_at(set._inner, index))));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(AddressSet storage set) internal view returns (address[] memory) {\n bytes32[] memory store = _values(set._inner);\n address[] memory result;\n\n assembly {\n result := store\n }\n\n return result;\n }\n\n // UintSet\n\n struct UintSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(UintSet storage set, uint256 value) internal returns (bool) {\n return _add(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\n return _remove(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n return _contains(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function length(UintSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n return uint256(_at(set._inner, index));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(UintSet storage set) internal view returns (uint256[] memory) {\n bytes32[] memory store = _values(set._inner);\n uint256[] memory result;\n\n assembly {\n result := store\n }\n\n return result;\n }\n}\n" + }, + "contracts/dependencies/stargate-protocol/interfaces/IStargateComposer.sol": { + "content": "// SPDX-License-Identifier: BUSL-1.1\n\npragma solidity 0.8.9;\n\nimport \"./IStargateRouter.sol\";\n\ninterface IStargateComposer {\n function swap(\n uint16 _dstChainId,\n uint256 _srcPoolId,\n uint256 _dstPoolId,\n address payable _refundAddress,\n uint256 _amountLD,\n uint256 _minAmountLD,\n IStargateRouter.lzTxObj memory _lzTxParams,\n bytes calldata _to,\n bytes calldata _payload\n ) external payable;\n\n function factory() external view returns (address);\n\n function stargateBridge() external view returns (address);\n\n function stargateRouter() external view returns (IStargateRouter);\n\n function quoteLayerZeroFee(\n uint16 _dstChainId,\n uint8 _functionType,\n bytes calldata _toAddress,\n bytes calldata _transferAndCallPayload,\n IStargateRouter.lzTxObj memory _lzTxParams\n ) external view returns (uint256, uint256);\n\n function peers(uint16 _chainId) external view returns (address);\n}\n" + }, + "contracts/dependencies/stargate-protocol/interfaces/IStargateFeeLibrary.sol": { + "content": "// SPDX-License-Identifier: BUSL-1.1\n\npragma solidity 0.8.9;\npragma abicoder v2;\nimport \"../Pool.sol\";\n\ninterface IStargateFeeLibrary {\n function getFees(\n uint256 _srcPoolId,\n uint256 _dstPoolId,\n uint16 _dstChainId,\n address _from,\n uint256 _amountSD\n ) external returns (Pool.SwapObj memory s);\n\n function getVersion() external view returns (string memory);\n}\n" + }, + "contracts/dependencies/stargate-protocol/interfaces/IStargateReceiver.sol": { + "content": "// SPDX-License-Identifier: BUSL-1.1\n\npragma solidity 0.8.9;\n\ninterface IStargateReceiver {\n function sgReceive(\n uint16 _chainId,\n bytes memory _srcAddress,\n uint256 _nonce,\n address _token,\n uint256 amountLD,\n bytes memory payload\n ) external;\n}\n" + }, + "contracts/dependencies/stargate-protocol/interfaces/IStargateRouter.sol": { + "content": "// SPDX-License-Identifier: BUSL-1.1\n\npragma solidity 0.8.9;\n\ninterface IStargateRouter {\n struct lzTxObj {\n uint256 dstGasForCall;\n uint256 dstNativeAmount;\n bytes dstNativeAddr;\n }\n\n function addLiquidity(uint256 _poolId, uint256 _amountLD, address _to) external;\n\n function swap(\n uint16 _dstChainId,\n uint256 _srcPoolId,\n uint256 _dstPoolId,\n address payable _refundAddress,\n uint256 _amountLD,\n uint256 _minAmountLD,\n lzTxObj memory _lzTxParams,\n bytes calldata _to,\n bytes calldata _payload\n ) external payable;\n\n function redeemRemote(\n uint16 _dstChainId,\n uint256 _srcPoolId,\n uint256 _dstPoolId,\n address payable _refundAddress,\n uint256 _amountLP,\n uint256 _minAmountLD,\n bytes calldata _to,\n lzTxObj memory _lzTxParams\n ) external payable;\n\n function instantRedeemLocal(uint16 _srcPoolId, uint256 _amountLP, address _to) external returns (uint256);\n\n function redeemLocal(\n uint16 _dstChainId,\n uint256 _srcPoolId,\n uint256 _dstPoolId,\n address payable _refundAddress,\n uint256 _amountLP,\n bytes calldata _to,\n lzTxObj memory _lzTxParams\n ) external payable;\n\n function sendCredits(\n uint16 _dstChainId,\n uint256 _srcPoolId,\n uint256 _dstPoolId,\n address payable _refundAddress\n ) external payable;\n\n function quoteLayerZeroFee(\n uint16 _dstChainId,\n uint8 _functionType,\n bytes calldata _toAddress,\n bytes calldata _transferAndCallPayload,\n lzTxObj memory _lzTxParams\n ) external view returns (uint256, uint256);\n\n function clearCachedSwap(uint16 _srcChainId, bytes calldata _srcAddress, uint256 _nonce) external;\n\n function factory() external view returns (address);\n\n function bridge() external view returns (address);\n\n function cachedSwapLookup(\n uint16 _chainId_,\n bytes calldata _srcAddress,\n uint256 _nonce\n ) external view returns (address token, uint256 amountLD, address to, bytes memory payload);\n}\n" + }, + "contracts/dependencies/stargate-protocol/LPTokenERC20.sol": { + "content": "// SPDX-License-Identifier: BUSL-1.1\n\npragma solidity 0.8.9;\n\n// libraries\nimport \"../openzeppelin/utils/math/SafeMath.sol\";\n\ncontract LPTokenERC20 {\n using SafeMath for uint256;\n\n //---------------------------------------------------------------------------\n // CONSTANTS\n string public name;\n string public symbol;\n bytes32 public constant PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;\n // set in constructor\n bytes32 public DOMAIN_SEPARATOR;\n\n //---------------------------------------------------------------------------\n // VARIABLES\n uint256 public decimals;\n uint256 public totalSupply;\n mapping(address => uint256) public balanceOf;\n mapping(address => mapping(address => uint256)) public allowance;\n mapping(address => uint256) public nonces;\n\n //---------------------------------------------------------------------------\n // EVENTS\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(string memory _name, string memory _symbol) {\n name = _name;\n symbol = _symbol;\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 }\n\n function _mint(address to, uint256 value) internal {\n totalSupply = totalSupply.add(value);\n balanceOf[to] = balanceOf[to].add(value);\n emit Transfer(address(0), to, value);\n }\n\n function _burn(address from, uint256 value) internal {\n balanceOf[from] = balanceOf[from].sub(value);\n totalSupply = totalSupply.sub(value);\n emit Transfer(from, address(0), value);\n }\n\n function _approve(address owner, address spender, uint256 value) private {\n allowance[owner][spender] = value;\n emit Approval(owner, spender, value);\n }\n\n function _transfer(address from, address to, uint256 value) private {\n balanceOf[from] = balanceOf[from].sub(value);\n balanceOf[to] = balanceOf[to].add(value);\n emit Transfer(from, to, value);\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(address from, address to, uint256 value) external returns (bool) {\n if (allowance[from][msg.sender] != type(uint256).max) {\n allowance[from][msg.sender] = allowance[from][msg.sender].sub(value);\n }\n _transfer(from, to, value);\n return true;\n }\n\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n _approve(msg.sender, spender, allowance[msg.sender][spender].add(addedValue));\n return true;\n }\n\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n _approve(\n msg.sender,\n spender,\n allowance[msg.sender][spender].sub(subtractedValue, \"ERC20: decreased allowance below zero\")\n );\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, \"Bridge: 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, \"Bridge: INVALID_SIGNATURE\");\n _approve(owner, spender, value);\n }\n}\n" + }, + "contracts/dependencies/stargate-protocol/Pool.sol": { + "content": "// SPDX-License-Identifier: BUSL-1.1\n\npragma solidity 0.8.9;\npragma abicoder v2;\n\n// imports\nimport \"../openzeppelin/access/Ownable.sol\";\nimport \"../openzeppelin/security/ReentrancyGuard.sol\";\nimport \"./LPTokenERC20.sol\";\nimport \"./interfaces/IStargateFeeLibrary.sol\";\n\n// libraries\nimport \"../openzeppelin/utils/math/SafeMath.sol\";\n\n/// Pool contracts on other chains and managed by the Stargate protocol.\ncontract Pool is LPTokenERC20, ReentrancyGuard {\n using SafeMath for uint256;\n\n //---------------------------------------------------------------------------\n // CONSTANTS\n bytes4 private constant SELECTOR = bytes4(keccak256(bytes(\"transfer(address,uint256)\")));\n uint256 public constant BP_DENOMINATOR = 10000;\n\n //---------------------------------------------------------------------------\n // STRUCTS\n struct ChainPath {\n bool ready; // indicate if the counter chainPath has been created.\n uint16 dstChainId;\n uint256 dstPoolId;\n uint256 weight;\n uint256 balance;\n uint256 lkb;\n uint256 credits;\n uint256 idealBalance;\n }\n\n struct SwapObj {\n uint256 amount;\n uint256 eqFee;\n uint256 eqReward;\n uint256 lpFee;\n uint256 protocolFee;\n uint256 lkbRemove;\n }\n\n struct CreditObj {\n uint256 credits;\n uint256 idealBalance;\n }\n\n //---------------------------------------------------------------------------\n // VARIABLES\n\n // chainPath\n ChainPath[] public chainPaths; // list of connected chains with shared pools\n mapping(uint16 => mapping(uint256 => uint256)) public chainPathIndexLookup; // lookup for chainPath by chainId => poolId =>index\n\n // metadata\n uint256 public immutable poolId; // shared id between chains to represent same pool\n uint256 public sharedDecimals; // the shared decimals (lowest common decimals between chains)\n uint256 public localDecimals; // the decimals for the token\n uint256 public immutable convertRate; // the decimals for the token\n address public immutable token; // the token for the pool\n address public immutable router; // the token for the pool\n\n bool public stopSwap; // flag to stop swapping in extreme cases\n\n // Fee and Liquidity\n uint256 public totalLiquidity; // the total amount of tokens added on this side of the chain (fees + deposits - withdrawals)\n uint256 public totalWeight; // total weight for pool percentages\n uint256 public mintFeeBP; // fee basis points for the mint/deposit\n uint256 public protocolFeeBalance; // fee balance created from dao fee\n uint256 public mintFeeBalance; // fee balance created from mint fee\n uint256 public eqFeePool; // pool rewards in Shared Decimal format. indicate the total budget for reverse swap incentive\n address public feeLibrary; // address for retrieving fee params for swaps\n\n // Delta related\n uint256 public deltaCredit; // credits accumulated from txn\n bool public batched; // flag to indicate if we want batch processing.\n bool public defaultSwapMode; // flag for the default mode for swap\n bool public defaultLPMode; // flag for the default mode for lp\n uint256 public swapDeltaBP; // basis points of poolCredits to activate Delta in swap\n uint256 public lpDeltaBP; // basis points of poolCredits to activate Delta in liquidity events\n\n //---------------------------------------------------------------------------\n // EVENTS\n event Mint(address to, uint256 amountLP, uint256 amountSD, uint256 mintFeeAmountSD);\n event Burn(address from, uint256 amountLP, uint256 amountSD);\n event RedeemLocalCallback(address _to, uint256 _amountSD, uint256 _amountToMintSD);\n event Swap(\n uint16 chainId,\n uint256 dstPoolId,\n address from,\n uint256 amountSD,\n uint256 eqReward,\n uint256 eqFee,\n uint256 protocolFee,\n uint256 lpFee\n );\n event SendCredits(uint16 dstChainId, uint256 dstPoolId, uint256 credits, uint256 idealBalance);\n event RedeemRemote(uint16 chainId, uint256 dstPoolId, address from, uint256 amountLP, uint256 amountSD);\n event RedeemLocal(address from, uint256 amountLP, uint256 amountSD, uint16 chainId, uint256 dstPoolId, bytes to);\n event InstantRedeemLocal(address from, uint256 amountLP, uint256 amountSD, address to);\n event CreditChainPath(uint16 chainId, uint256 srcPoolId, uint256 amountSD, uint256 idealBalance);\n event SwapRemote(address to, uint256 amountSD, uint256 protocolFee, uint256 dstFee);\n event WithdrawRemote(uint16 srcChainId, uint256 srcPoolId, uint256 swapAmount, uint256 mintAmount);\n event ChainPathUpdate(uint16 dstChainId, uint256 dstPoolId, uint256 weight);\n event FeesUpdated(uint256 mintFeeBP);\n event FeeLibraryUpdated(address feeLibraryAddr);\n event StopSwapUpdated(bool swapStop);\n event WithdrawProtocolFeeBalance(address to, uint256 amountSD);\n event WithdrawMintFeeBalance(address to, uint256 amountSD);\n event DeltaParamUpdated(\n bool batched,\n uint256 swapDeltaBP,\n uint256 lpDeltaBP,\n bool defaultSwapMode,\n bool defaultLPMode\n );\n\n //---------------------------------------------------------------------------\n // MODIFIERS\n modifier onlyRouter() {\n require(msg.sender == router, \"Stargate: only the router can call this method\");\n _;\n }\n\n constructor(\n uint256 _poolId,\n address _router,\n address _token,\n uint256 _sharedDecimals,\n uint256 _localDecimals,\n address _feeLibrary,\n string memory _name,\n string memory _symbol\n ) LPTokenERC20(_name, _symbol) {\n require(_token != address(0x0), \"Stargate: _token cannot be 0x0\");\n require(_router != address(0x0), \"Stargate: _router cannot be 0x0\");\n poolId = _poolId;\n router = _router;\n token = _token;\n sharedDecimals = _sharedDecimals;\n decimals = uint8(_sharedDecimals);\n localDecimals = _localDecimals;\n convertRate = 10 ** (uint256(localDecimals).sub(sharedDecimals));\n totalWeight = 0;\n feeLibrary = _feeLibrary;\n\n //delta algo related\n batched = false;\n defaultSwapMode = true;\n defaultLPMode = true;\n }\n\n function getChainPathsLength() public view returns (uint256) {\n return chainPaths.length;\n }\n\n //---------------------------------------------------------------------------\n // LOCAL CHAIN FUNCTIONS\n\n function mint(address _to, uint256 _amountLD) external nonReentrant onlyRouter returns (uint256) {\n return _mintLocal(_to, _amountLD, true, true);\n }\n\n // Local Remote\n // ------- ---------\n // swap -> swapRemote\n function swap(\n uint16 _dstChainId,\n uint256 _dstPoolId,\n address _from,\n uint256 _amountLD,\n uint256 _minAmountLD,\n bool newLiquidity\n ) external nonReentrant onlyRouter returns (SwapObj memory) {\n require(!stopSwap, \"Stargate: swap func stopped\");\n ChainPath storage cp = getAndCheckCP(_dstChainId, _dstPoolId);\n require(cp.ready == true, \"Stargate: counter chainPath is not ready\");\n\n uint256 amountSD = amountLDtoSD(_amountLD);\n uint256 minAmountSD = amountLDtoSD(_minAmountLD);\n\n // request fee params from library\n SwapObj memory s = IStargateFeeLibrary(feeLibrary).getFees(poolId, _dstPoolId, _dstChainId, _from, amountSD);\n\n // equilibrium fee and reward. note eqFee/eqReward are separated from swap liquidity\n eqFeePool = eqFeePool.sub(s.eqReward);\n // update the new amount the user gets minus the fees\n s.amount = amountSD.sub(s.eqFee).sub(s.protocolFee).sub(s.lpFee);\n // users will also get the eqReward\n require(s.amount.add(s.eqReward) >= minAmountSD, \"Stargate: slippage too high\");\n\n // behaviours\n // - protocolFee: booked, stayed and withdrawn at remote.\n // - eqFee: booked, stayed and withdrawn at remote.\n // - lpFee: booked and stayed at remote, can be withdrawn anywhere\n\n s.lkbRemove = amountSD.sub(s.lpFee).add(s.eqReward);\n // check for transfer solvency.\n require(cp.balance >= s.lkbRemove, \"Stargate: dst balance too low\");\n cp.balance = cp.balance.sub(s.lkbRemove);\n\n if (newLiquidity) {\n deltaCredit = deltaCredit.add(amountSD).add(s.eqReward);\n } else if (s.eqReward > 0) {\n deltaCredit = deltaCredit.add(s.eqReward);\n }\n\n // distribute credits on condition.\n if (!batched || deltaCredit >= totalLiquidity.mul(swapDeltaBP).div(BP_DENOMINATOR)) {\n _delta(defaultSwapMode);\n }\n\n emit Swap(_dstChainId, _dstPoolId, _from, s.amount, s.eqReward, s.eqFee, s.protocolFee, s.lpFee);\n return s;\n }\n\n // Local Remote\n // ------- ---------\n // sendCredits -> creditChainPath\n function sendCredits(\n uint16 _dstChainId,\n uint256 _dstPoolId\n ) external nonReentrant onlyRouter returns (CreditObj memory c) {\n ChainPath storage cp = getAndCheckCP(_dstChainId, _dstPoolId);\n require(cp.ready == true, \"Stargate: counter chainPath is not ready\");\n cp.lkb = cp.lkb.add(cp.credits);\n c.idealBalance = totalLiquidity.mul(cp.weight).div(totalWeight);\n c.credits = cp.credits;\n cp.credits = 0;\n emit SendCredits(_dstChainId, _dstPoolId, c.credits, c.idealBalance);\n }\n\n // Local Remote\n // ------- ---------\n // redeemRemote -> swapRemote\n function redeemRemote(\n uint16 _dstChainId,\n uint256 _dstPoolId,\n address _from,\n uint256 _amountLP\n ) external nonReentrant onlyRouter {\n require(_from != address(0x0), \"Stargate: _from cannot be 0x0\");\n uint256 amountSD = _burnLocal(_from, _amountLP);\n //run Delta\n if (!batched || deltaCredit > totalLiquidity.mul(lpDeltaBP).div(BP_DENOMINATOR)) {\n _delta(defaultLPMode);\n }\n uint256 amountLD = amountSDtoLD(amountSD);\n emit RedeemRemote(_dstChainId, _dstPoolId, _from, _amountLP, amountLD);\n }\n\n function instantRedeemLocal(\n address _from,\n uint256 _amountLP,\n address _to\n ) external nonReentrant onlyRouter returns (uint256 amountSD) {\n require(_from != address(0x0), \"Stargate: _from cannot be 0x0\");\n uint256 _deltaCredit = deltaCredit; // sload optimization.\n uint256 _capAmountLP = _amountSDtoLP(_deltaCredit);\n\n if (_amountLP > _capAmountLP) _amountLP = _capAmountLP;\n\n amountSD = _burnLocal(_from, _amountLP);\n deltaCredit = _deltaCredit.sub(amountSD);\n uint256 amountLD = amountSDtoLD(amountSD);\n _safeTransfer(token, _to, amountLD);\n emit InstantRedeemLocal(_from, _amountLP, amountSD, _to);\n }\n\n // Local Remote\n // ------- ---------\n // redeemLocal -> redeemLocalCheckOnRemote\n // redeemLocalCallback <-\n function redeemLocal(\n address _from,\n uint256 _amountLP,\n uint16 _dstChainId,\n uint256 _dstPoolId,\n bytes calldata _to\n ) external nonReentrant onlyRouter returns (uint256 amountSD) {\n require(_from != address(0x0), \"Stargate: _from cannot be 0x0\");\n\n // safeguard.\n require(\n chainPaths[chainPathIndexLookup[_dstChainId][_dstPoolId]].ready == true,\n \"Stargate: counter chainPath is not ready\"\n );\n amountSD = _burnLocal(_from, _amountLP);\n\n // run Delta\n if (!batched || deltaCredit > totalLiquidity.mul(lpDeltaBP).div(BP_DENOMINATOR)) {\n _delta(false);\n }\n emit RedeemLocal(_from, _amountLP, amountSD, _dstChainId, _dstPoolId, _to);\n }\n\n //---------------------------------------------------------------------------\n // REMOTE CHAIN FUNCTIONS\n\n // Local Remote\n // ------- ---------\n // sendCredits -> creditChainPath\n function creditChainPath(\n uint16 _dstChainId,\n uint256 _dstPoolId,\n CreditObj memory _c\n ) external nonReentrant onlyRouter {\n ChainPath storage cp = chainPaths[chainPathIndexLookup[_dstChainId][_dstPoolId]];\n cp.balance = cp.balance.add(_c.credits);\n if (cp.idealBalance != _c.idealBalance) {\n cp.idealBalance = _c.idealBalance;\n }\n emit CreditChainPath(_dstChainId, _dstPoolId, _c.credits, _c.idealBalance);\n }\n\n // Local Remote\n // ------- ---------\n // swap -> swapRemote\n function swapRemote(\n uint16 _srcChainId,\n uint256 _srcPoolId,\n address _to,\n SwapObj memory _s\n ) external nonReentrant onlyRouter returns (uint256 amountLD) {\n // booking lpFee\n totalLiquidity = totalLiquidity.add(_s.lpFee);\n // booking eqFee\n eqFeePool = eqFeePool.add(_s.eqFee);\n // booking stargateFee\n protocolFeeBalance = protocolFeeBalance.add(_s.protocolFee);\n\n // update LKB\n uint256 chainPathIndex = chainPathIndexLookup[_srcChainId][_srcPoolId];\n chainPaths[chainPathIndex].lkb = chainPaths[chainPathIndex].lkb.sub(_s.lkbRemove);\n\n // user receives the amount + the srcReward\n amountLD = amountSDtoLD(_s.amount.add(_s.eqReward));\n _safeTransfer(token, _to, amountLD);\n emit SwapRemote(_to, _s.amount.add(_s.eqReward), _s.protocolFee, _s.eqFee);\n }\n\n // Local Remote\n // ------- ---------\n // redeemLocal -> redeemLocalCheckOnRemote\n // redeemLocalCallback <-\n function redeemLocalCallback(\n uint16 _srcChainId,\n uint256 _srcPoolId,\n address _to,\n uint256 _amountSD,\n uint256 _amountToMintSD\n ) external nonReentrant onlyRouter {\n if (_amountToMintSD > 0) {\n _mintLocal(_to, amountSDtoLD(_amountToMintSD), false, false);\n }\n\n ChainPath storage cp = getAndCheckCP(_srcChainId, _srcPoolId);\n cp.lkb = cp.lkb.sub(_amountSD);\n\n uint256 amountLD = amountSDtoLD(_amountSD);\n _safeTransfer(token, _to, amountLD);\n emit RedeemLocalCallback(_to, _amountSD, _amountToMintSD);\n }\n\n // Local Remote\n // ------- ---------\n // redeemLocal(amount) -> redeemLocalCheckOnRemote\n // redeemLocalCallback <-\n function redeemLocalCheckOnRemote(\n uint16 _srcChainId,\n uint256 _srcPoolId,\n uint256 _amountSD\n ) external nonReentrant onlyRouter returns (uint256 swapAmount, uint256 mintAmount) {\n ChainPath storage cp = getAndCheckCP(_srcChainId, _srcPoolId);\n if (_amountSD > cp.balance) {\n mintAmount = _amountSD - cp.balance;\n swapAmount = cp.balance;\n cp.balance = 0;\n } else {\n cp.balance = cp.balance.sub(_amountSD);\n swapAmount = _amountSD;\n mintAmount = 0;\n }\n emit WithdrawRemote(_srcChainId, _srcPoolId, swapAmount, mintAmount);\n }\n\n //---------------------------------------------------------------------------\n // DAO Calls\n function createChainPath(uint16 _dstChainId, uint256 _dstPoolId, uint256 _weight) external onlyRouter {\n for (uint256 i = 0; i < chainPaths.length; ++i) {\n ChainPath memory cp = chainPaths[i];\n bool exists = cp.dstChainId == _dstChainId && cp.dstPoolId == _dstPoolId;\n require(!exists, \"Stargate: cant createChainPath of existing dstChainId and _dstPoolId\");\n }\n totalWeight = totalWeight.add(_weight);\n chainPathIndexLookup[_dstChainId][_dstPoolId] = chainPaths.length;\n chainPaths.push(ChainPath(false, _dstChainId, _dstPoolId, _weight, 0, 0, 0, 0));\n emit ChainPathUpdate(_dstChainId, _dstPoolId, _weight);\n }\n\n function setWeightForChainPath(uint16 _dstChainId, uint256 _dstPoolId, uint16 _weight) external onlyRouter {\n ChainPath storage cp = getAndCheckCP(_dstChainId, _dstPoolId);\n totalWeight = totalWeight.sub(cp.weight).add(_weight);\n cp.weight = _weight;\n emit ChainPathUpdate(_dstChainId, _dstPoolId, _weight);\n }\n\n function setFee(uint256 _mintFeeBP) external onlyRouter {\n require(_mintFeeBP <= BP_DENOMINATOR, \"Bridge: cum fees > 100%\");\n mintFeeBP = _mintFeeBP;\n emit FeesUpdated(mintFeeBP);\n }\n\n function setFeeLibrary(address _feeLibraryAddr) external onlyRouter {\n require(_feeLibraryAddr != address(0x0), \"Stargate: fee library cant be 0x0\");\n feeLibrary = _feeLibraryAddr;\n emit FeeLibraryUpdated(_feeLibraryAddr);\n }\n\n function setSwapStop(bool _swapStop) external onlyRouter {\n stopSwap = _swapStop;\n emit StopSwapUpdated(_swapStop);\n }\n\n function setDeltaParam(\n bool _batched,\n uint256 _swapDeltaBP,\n uint256 _lpDeltaBP,\n bool _defaultSwapMode,\n bool _defaultLPMode\n ) external onlyRouter {\n require(_swapDeltaBP <= BP_DENOMINATOR && _lpDeltaBP <= BP_DENOMINATOR, \"Stargate: wrong Delta param\");\n batched = _batched;\n swapDeltaBP = _swapDeltaBP;\n lpDeltaBP = _lpDeltaBP;\n defaultSwapMode = _defaultSwapMode;\n defaultLPMode = _defaultLPMode;\n emit DeltaParamUpdated(_batched, _swapDeltaBP, _lpDeltaBP, _defaultSwapMode, _defaultLPMode);\n }\n\n function callDelta(bool _fullMode) external onlyRouter {\n _delta(_fullMode);\n }\n\n function activateChainPath(uint16 _dstChainId, uint256 _dstPoolId) external onlyRouter {\n ChainPath storage cp = getAndCheckCP(_dstChainId, _dstPoolId);\n require(cp.ready == false, \"Stargate: chainPath is already active\");\n // this func will only be called once\n cp.ready = true;\n }\n\n function withdrawProtocolFeeBalance(address _to) external onlyRouter {\n if (protocolFeeBalance > 0) {\n uint256 amountOfLD = amountSDtoLD(protocolFeeBalance);\n protocolFeeBalance = 0;\n _safeTransfer(token, _to, amountOfLD);\n emit WithdrawProtocolFeeBalance(_to, amountOfLD);\n }\n }\n\n function withdrawMintFeeBalance(address _to) external onlyRouter {\n if (mintFeeBalance > 0) {\n uint256 amountOfLD = amountSDtoLD(mintFeeBalance);\n mintFeeBalance = 0;\n _safeTransfer(token, _to, amountOfLD);\n emit WithdrawMintFeeBalance(_to, amountOfLD);\n }\n }\n\n //---------------------------------------------------------------------------\n // INTERNAL\n // Conversion Helpers\n //---------------------------------------------------------------------------\n function amountLPtoLD(uint256 _amountLP) external view returns (uint256) {\n return amountSDtoLD(_amountLPtoSD(_amountLP));\n }\n\n function _amountLPtoSD(uint256 _amountLP) internal view returns (uint256) {\n require(totalSupply > 0, \"Stargate: cant convert LPtoSD when totalSupply == 0\");\n return _amountLP.mul(totalLiquidity).div(totalSupply);\n }\n\n function _amountSDtoLP(uint256 _amountSD) internal view returns (uint256) {\n require(totalLiquidity > 0, \"Stargate: cant convert SDtoLP when totalLiq == 0\");\n return _amountSD.mul(totalSupply).div(totalLiquidity);\n }\n\n function amountSDtoLD(uint256 _amount) internal view returns (uint256) {\n return _amount.mul(convertRate);\n }\n\n function amountLDtoSD(uint256 _amount) internal view returns (uint256) {\n return _amount.div(convertRate);\n }\n\n function getAndCheckCP(uint16 _dstChainId, uint256 _dstPoolId) internal view returns (ChainPath storage) {\n require(chainPaths.length > 0, \"Stargate: no chainpaths exist\");\n ChainPath storage cp = chainPaths[chainPathIndexLookup[_dstChainId][_dstPoolId]];\n require(cp.dstChainId == _dstChainId && cp.dstPoolId == _dstPoolId, \"Stargate: local chainPath does not exist\");\n return cp;\n }\n\n function getChainPath(uint16 _dstChainId, uint256 _dstPoolId) external view returns (ChainPath memory) {\n ChainPath memory cp = chainPaths[chainPathIndexLookup[_dstChainId][_dstPoolId]];\n require(cp.dstChainId == _dstChainId && cp.dstPoolId == _dstPoolId, \"Stargate: local chainPath does not exist\");\n return cp;\n }\n\n function _burnLocal(address _from, uint256 _amountLP) internal returns (uint256) {\n require(totalSupply > 0, \"Stargate: cant burn when totalSupply == 0\");\n uint256 amountOfLPTokens = balanceOf[_from];\n require(amountOfLPTokens >= _amountLP, \"Stargate: not enough LP tokens to burn\");\n\n uint256 amountSD = _amountLP.mul(totalLiquidity).div(totalSupply);\n //subtract totalLiquidity accordingly\n totalLiquidity = totalLiquidity.sub(amountSD);\n\n _burn(_from, _amountLP);\n emit Burn(_from, _amountLP, amountSD);\n return amountSD;\n }\n\n function _delta(bool fullMode) internal {\n if (deltaCredit > 0 && totalWeight > 0) {\n uint256 cpLength = chainPaths.length;\n uint256[] memory deficit = new uint256[](cpLength);\n uint256 totalDeficit = 0;\n\n // algorithm steps 6-9: calculate the total and the amounts required to get to balance state\n for (uint256 i = 0; i < cpLength; ++i) {\n ChainPath storage cp = chainPaths[i];\n // (liquidity * (weight/totalWeight)) - (lkb+credits)\n uint256 balLiq = totalLiquidity.mul(cp.weight).div(totalWeight);\n uint256 currLiq = cp.lkb.add(cp.credits);\n if (balLiq > currLiq) {\n // save gas since we know balLiq > currLiq and we know deficit[i] > 0\n deficit[i] = balLiq - currLiq;\n totalDeficit = totalDeficit.add(deficit[i]);\n }\n }\n\n // indicates how much delta credit is distributed\n uint256 spent;\n\n // handle credits with 2 tranches. the [ < totalDeficit] [excessCredit]\n // run full Delta, allocate all credits\n if (totalDeficit == 0) {\n // only fullMode delta will allocate excess credits\n if (fullMode && deltaCredit > 0) {\n // credit ChainPath by weights\n for (uint256 i = 0; i < cpLength; ++i) {\n ChainPath storage cp = chainPaths[i];\n // credits = credits + toBalanceChange + remaining allocation based on weight\n uint256 amtToCredit = deltaCredit.mul(cp.weight).div(totalWeight);\n spent = spent.add(amtToCredit);\n cp.credits = cp.credits.add(amtToCredit);\n }\n } // else do nth\n } else if (totalDeficit <= deltaCredit) {\n if (fullMode) {\n // algorithm step 13: calculate amount to disperse to bring to balance state or as close as possible\n uint256 excessCredit = deltaCredit - totalDeficit;\n // algorithm steps 14-16: calculate credits\n for (uint256 i = 0; i < cpLength; ++i) {\n if (deficit[i] > 0) {\n ChainPath storage cp = chainPaths[i];\n // credits = credits + deficit + remaining allocation based on weight\n uint256 amtToCredit = deficit[i].add(excessCredit.mul(cp.weight).div(totalWeight));\n spent = spent.add(amtToCredit);\n cp.credits = cp.credits.add(amtToCredit);\n }\n }\n } else {\n // totalDeficit <= deltaCredit but not running fullMode\n // credit chainPaths as is if any deficit, not using all deltaCredit\n for (uint256 i = 0; i < cpLength; ++i) {\n if (deficit[i] > 0) {\n ChainPath storage cp = chainPaths[i];\n uint256 amtToCredit = deficit[i];\n spent = spent.add(amtToCredit);\n cp.credits = cp.credits.add(amtToCredit);\n }\n }\n }\n } else {\n // totalDeficit > deltaCredit, fullMode or not, normalize the deficit by deltaCredit\n for (uint256 i = 0; i < cpLength; ++i) {\n if (deficit[i] > 0) {\n ChainPath storage cp = chainPaths[i];\n uint256 proportionalDeficit = deficit[i].mul(deltaCredit).div(totalDeficit);\n spent = spent.add(proportionalDeficit);\n cp.credits = cp.credits.add(proportionalDeficit);\n }\n }\n }\n\n // deduct the amount of credit sent\n deltaCredit = deltaCredit.sub(spent);\n }\n }\n\n function _mintLocal(\n address _to,\n uint256 _amountLD,\n bool _feesEnabled,\n bool _creditDelta\n ) internal returns (uint256 amountSD) {\n require(totalWeight > 0, \"Stargate: No ChainPaths exist\");\n amountSD = amountLDtoSD(_amountLD);\n\n uint256 mintFeeSD = 0;\n if (_feesEnabled) {\n mintFeeSD = amountSD.mul(mintFeeBP).div(BP_DENOMINATOR);\n amountSD = amountSD.sub(mintFeeSD);\n mintFeeBalance = mintFeeBalance.add(mintFeeSD);\n }\n\n if (_creditDelta) {\n deltaCredit = deltaCredit.add(amountSD);\n }\n\n uint256 amountLPTokens = amountSD;\n if (totalSupply != 0) {\n amountLPTokens = amountSD.mul(totalSupply).div(totalLiquidity);\n }\n totalLiquidity = totalLiquidity.add(amountSD);\n\n _mint(_to, amountLPTokens);\n emit Mint(_to, amountLPTokens, amountSD, mintFeeSD);\n\n // add to credits and call delta. short circuit to save gas\n if (!batched || deltaCredit > totalLiquidity.mul(lpDeltaBP).div(BP_DENOMINATOR)) {\n _delta(defaultLPMode);\n }\n }\n\n function _safeTransfer(address _token, address _to, uint256 _value) private {\n (bool success, bytes memory data) = _token.call(abi.encodeWithSelector(SELECTOR, _to, _value));\n require(success && (data.length == 0 || abi.decode(data, (bool))), \"Stargate: TRANSFER_FAILED\");\n }\n}\n" + }, + "contracts/DepositToken.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"./dependencies/openzeppelin/utils/math/Math.sol\";\nimport \"./utils/ReentrancyGuard.sol\";\nimport \"./lib/WadRayMath.sol\";\nimport \"./utils/TokenHolder.sol\";\nimport \"./access/Manageable.sol\";\nimport \"./storage/DepositTokenStorage.sol\";\n\nerror CollateralIsInexistent();\nerror DepositTokenIsInactive();\nerror NotEnoughFreeBalance();\nerror UnderlyingAssetIsNull();\nerror PoolIsNull();\nerror SymbolIsNull();\nerror DecimalsIsNull();\nerror CollateralFactorTooHigh();\nerror CollateralFactorTooLow();\nerror DecreasedAllowanceBelowZero();\nerror AmountIsZero();\nerror BeneficiaryIsNull();\nerror AmountExceedsAllowance();\nerror RecipientIsNull();\nerror AmountIsInvalid();\nerror ApproveFromTheZeroAddress();\nerror ApproveToTheZeroAddress();\nerror BurnFromTheZeroAddress();\nerror BurnAmountExceedsBalance();\nerror MintToTheZeroAddress();\nerror SurpassMaxDepositSupply();\nerror TransferFromTheZeroAddress();\nerror TransferToTheZeroAddress();\nerror TransferAmountExceedsBalance();\nerror NewValueIsSameAsCurrent();\nerror SenderIsNotSmartFarmingManager();\n\n/**\n * @title Represents the users' deposits\n */\ncontract DepositToken is ReentrancyGuard, TokenHolder, Manageable, DepositTokenStorageV1 {\n using SafeERC20 for IERC20;\n using WadRayMath for uint256;\n\n string public constant VERSION = \"1.3.0\";\n\n /// @notice Emitted when collateral is deposited\n event CollateralDeposited(\n address indexed from,\n address indexed account,\n uint256 amount,\n uint256 deposited,\n uint256 fee\n );\n\n /// @notice Emitted when CF is updated\n event CollateralFactorUpdated(uint256 oldCollateralFactor, uint256 newCollateralFactor);\n\n /// @notice Emitted when collateral is withdrawn\n event CollateralWithdrawn(\n address indexed account,\n address indexed to,\n uint256 amount,\n uint256 withdrawn,\n uint256 fee\n );\n\n /// @notice Emitted when active flag is updated\n event DepositTokenActiveUpdated(bool newActive);\n\n /// @notice Emitted when max total supply is updated\n event MaxTotalSupplyUpdated(uint256 oldMaxTotalSupply, uint256 newMaxTotalSupply);\n\n /**\n * @dev Throws if sender is SmartFarmingManager\n */\n modifier onlyIfSmartFarmingManager() {\n if (msg.sender != address(pool.smartFarmingManager())) revert SenderIsNotSmartFarmingManager();\n _;\n }\n\n /**\n * @dev Throws if sender can't seize\n */\n modifier onlyIfCanSeize() {\n if (msg.sender != address(pool)) revert SenderIsNotPool();\n _;\n }\n\n /**\n * @dev Throws if deposit token doesn't exist\n */\n modifier onlyIfDepositTokenExists() {\n if (!pool.doesDepositTokenExist(this)) revert CollateralIsInexistent();\n _;\n }\n\n /**\n * @dev Throws if deposit token isn't enabled\n */\n modifier onlyIfDepositTokenIsActive() {\n if (!isActive) revert DepositTokenIsInactive();\n _;\n }\n\n /**\n * @notice Requires that amount is lower than the account's unlocked balance\n */\n modifier onlyIfUnlocked(address account_, uint256 amount_) {\n if (unlockedBalanceOf(account_) < amount_) revert NotEnoughFreeBalance();\n _;\n }\n\n /**\n * @notice Update reward contracts' states\n * @dev Should be called before balance changes (i.e. mint/burn)\n */\n modifier updateRewardsBeforeMintOrBurn(address account_) {\n address[] memory _rewardsDistributors = pool.getRewardsDistributors();\n uint256 _length = _rewardsDistributors.length;\n for (uint256 i; i < _length; ++i) {\n IRewardsDistributor(_rewardsDistributors[i]).updateBeforeMintOrBurn(this, account_);\n }\n _;\n }\n\n /**\n * @notice Update reward contracts' states\n * @dev Should be called before balance changes (i.e. transfer)\n */\n modifier updateRewardsBeforeTransfer(address sender_, address recipient_) {\n address[] memory _rewardsDistributors = pool.getRewardsDistributors();\n uint256 _length = _rewardsDistributors.length;\n for (uint256 i; i < _length; ++i) {\n IRewardsDistributor(_rewardsDistributors[i]).updateBeforeTransfer(this, sender_, recipient_);\n }\n _;\n }\n\n constructor() {\n _disableInitializers();\n }\n\n function initialize(\n IERC20 underlying_,\n IPool pool_,\n string calldata name_,\n string calldata symbol_,\n uint8 decimals_,\n uint128 collateralFactor_,\n uint256 maxTotalSupply_\n ) external initializer {\n if (address(underlying_) == address(0)) revert UnderlyingAssetIsNull();\n if (address(pool_) == address(0)) revert PoolIsNull();\n if (bytes(symbol_).length == 0) revert SymbolIsNull();\n if (decimals_ == 0) revert DecimalsIsNull();\n if (collateralFactor_ == 0) revert CollateralFactorTooLow();\n if (collateralFactor_ >= 1e18) revert CollateralFactorTooHigh();\n\n __ReentrancyGuard_init();\n __Manageable_init(pool_);\n\n name = name_;\n symbol = symbol_;\n underlying = underlying_;\n isActive = true;\n decimals = decimals_;\n collateralFactor = collateralFactor_;\n maxTotalSupply = maxTotalSupply_;\n }\n\n /**\n * @notice Set `amount` as the allowance of `spender` over the caller's tokens\n */\n function approve(address spender_, uint256 amount_) external override returns (bool) {\n _approve(msg.sender, spender_, amount_);\n return true;\n }\n\n /**\n * @notice Atomically decrease the allowance granted to `spender` by the caller\n */\n function decreaseAllowance(address spender_, uint256 subtractedValue_) external returns (bool) {\n uint256 _currentAllowance = allowance[msg.sender][spender_];\n if (_currentAllowance < subtractedValue_) revert DecreasedAllowanceBelowZero();\n unchecked {\n _approve(msg.sender, spender_, _currentAllowance - subtractedValue_);\n }\n return true;\n }\n\n /**\n * @notice Deposit collateral and mint msdTOKEN (tokenized deposit position)\n * @param amount_ The amount of collateral tokens to deposit\n * @param onBehalfOf_ The account to deposit to\n * @return _deposited The amount deposited after fees\n */\n function deposit(\n uint256 amount_,\n address onBehalfOf_\n ) external override whenNotPaused nonReentrant onlyIfDepositTokenExists returns (uint256 _deposited, uint256 _fee) {\n if (amount_ == 0) revert AmountIsZero();\n if (onBehalfOf_ == address(0)) revert BeneficiaryIsNull();\n\n IPool _pool = pool;\n IERC20 _underlying = underlying;\n\n address _treasury = address(_pool.treasury());\n\n uint256 _balanceBefore = _underlying.balanceOf(_treasury);\n _underlying.safeTransferFrom(msg.sender, _treasury, amount_);\n amount_ = _underlying.balanceOf(_treasury) - _balanceBefore;\n\n (_deposited, _fee) = quoteDepositOut(amount_);\n if (_fee > 0) {\n _mint(_pool.feeCollector(), _fee);\n }\n\n _mint(onBehalfOf_, _deposited);\n\n emit CollateralDeposited(msg.sender, onBehalfOf_, amount_, _deposited, _fee);\n }\n\n /**\n * @notice Burn msdTOKEN, withdraw collateral and transfer to `msg.sender` (i.e. SmartFarmingManager)\n * @param account_ The account where deposit token will be burnt from\n * @param amount_ The amount of collateral to withdraw\n * @return _withdrawn The amount withdrawn after fees\n */\n function flashWithdraw(\n address account_,\n uint256 amount_\n ) external override onlyIfSmartFarmingManager returns (uint256 _withdrawn, uint256 _fee) {\n return _withdraw({account_: account_, amount_: amount_, to_: msg.sender});\n }\n\n /**\n * @notice Atomically increase the allowance granted to `spender` by the caller\n */\n function increaseAllowance(address spender_, uint256 addedValue_) external returns (bool) {\n _approve(msg.sender, spender_, allowance[msg.sender][spender_] + addedValue_);\n return true;\n }\n\n /**\n * @notice Get the locked balance\n * @param account_ The account to check\n * @return _lockedBalance The locked amount\n */\n function lockedBalanceOf(address account_) external view override returns (uint256 _lockedBalance) {\n unchecked {\n return balanceOf[account_] - unlockedBalanceOf(account_);\n }\n }\n\n /**\n * @notice Quote gross `_amount` to deposit `amountToDeposit_` collateral\n * @param amountToDeposit_ Collateral to deposit\n * @return _amount Gross amount\n * @return _fee Fee amount to collect\n */\n function quoteDepositIn(uint256 amountToDeposit_) external view override returns (uint256 _amount, uint256 _fee) {\n uint256 _depositFee = pool.feeProvider().depositFee();\n if (_depositFee == 0) {\n return (amountToDeposit_, _fee);\n }\n\n _amount = amountToDeposit_.wadDiv(1e18 - _depositFee);\n _fee = _amount - amountToDeposit_;\n }\n\n /**\n * @notice Quote collateral `_amountToDeposit` by using gross `amount_`\n * @param amount_ Gross amount\n * @return _amountToDeposit Collateral to deposit\n * @return _fee Fee amount to collect\n */\n function quoteDepositOut(uint256 amount_) public view override returns (uint256 _amountToDeposit, uint256 _fee) {\n uint256 _depositFee = pool.feeProvider().depositFee();\n if (_depositFee == 0) {\n return (amount_, _fee);\n }\n\n _fee = amount_.wadMul(_depositFee);\n _amountToDeposit = amount_ - _fee;\n }\n\n /**\n * @notice Quote gross `_amount` to withdraw `amountToWithdraw_` collateral\n * @param amountToWithdraw_ Collateral to withdraw\n * @return _amount Gross amount\n * @return _fee Fee amount to collect\n */\n function quoteWithdrawIn(uint256 amountToWithdraw_) external view override returns (uint256 _amount, uint256 _fee) {\n uint256 _withdrawFee = pool.feeProvider().withdrawFee();\n if (_withdrawFee == 0) {\n return (amountToWithdraw_, _fee);\n }\n\n _amount = amountToWithdraw_.wadDiv(1e18 - _withdrawFee);\n _fee = _amount - amountToWithdraw_;\n }\n\n /**\n * @notice Quote collateral `_amountToWithdraw` by using gross `_amount`\n * @param amount_ Gross amount\n * @return _amountToWithdraw Collateral to withdraw\n * @return _fee Fee amount to collect\n */\n function quoteWithdrawOut(uint256 amount_) public view override returns (uint256 _amountToWithdraw, uint256 _fee) {\n uint256 _withdrawFee = pool.feeProvider().withdrawFee();\n if (_withdrawFee == 0) {\n return (amount_, _fee);\n }\n\n _fee = amount_.wadMul(_withdrawFee);\n _amountToWithdraw = amount_ - _fee;\n }\n\n /**\n * @notice Seize tokens\n * @dev Same as _transfer\n * @param from_ The account to seize from\n * @param to_ The beneficiary account\n * @param amount_ The amount to seize\n */\n function seize(address from_, address to_, uint256 amount_) external override onlyIfCanSeize {\n _transfer(from_, to_, amount_);\n }\n\n /// @inheritdoc IERC20\n function transfer(\n address to_,\n uint256 amount_\n ) external override onlyIfUnlocked(msg.sender, amount_) returns (bool) {\n _transfer(msg.sender, to_, amount_);\n return true;\n }\n\n /// @inheritdoc IERC20\n function transferFrom(\n address sender_,\n address recipient_,\n uint256 amount_\n ) external override nonReentrant onlyIfUnlocked(sender_, amount_) returns (bool) {\n uint256 _currentAllowance = allowance[sender_][msg.sender];\n if (_currentAllowance != type(uint256).max) {\n if (_currentAllowance < amount_) revert AmountExceedsAllowance();\n unchecked {\n _approve(sender_, msg.sender, _currentAllowance - amount_);\n }\n }\n\n _transfer(sender_, recipient_, amount_);\n\n return true;\n }\n\n /**\n * @notice Get the unlocked balance (i.e. transferable, withdrawable)\n * @param account_ The account to check\n * @return _unlockedBalance The amount that user can transfer or withdraw\n */\n function unlockedBalanceOf(address account_) public view override returns (uint256 _unlockedBalance) {\n IPool _pool = pool;\n\n (, , uint256 _debtInUsd, , uint256 _issuableInUsd) = _pool.debtPositionOf(account_);\n\n if (_debtInUsd == 0) {\n return balanceOf[account_];\n }\n\n if (_issuableInUsd > 0) {\n _unlockedBalance = Math.min(\n balanceOf[account_],\n _pool.masterOracle().quoteUsdToToken(address(underlying), _issuableInUsd.wadDiv(collateralFactor))\n );\n }\n }\n\n /**\n * @notice Burn msdTOKEN and withdraw collateral\n * @param amount_ The amount of collateral to withdraw\n * @param to_ The account that will receive withdrawn collateral\n * @return _withdrawn The amount withdrawn after fees\n */\n function withdraw(\n uint256 amount_,\n address to_\n ) external override onlyIfUnlocked(msg.sender, amount_) returns (uint256 _withdrawn, uint256 _fee) {\n if (to_ == address(0)) revert RecipientIsNull();\n return _withdraw({account_: msg.sender, amount_: amount_, to_: to_});\n }\n\n /**\n * @notice Burn msdTOKEN and withdraw collateral from a given account\n * @param from_ The account to withdraw from\n * @param amount_ The amount of collateral to withdraw\n * @return _withdrawn The amount withdrawn after fees\n */\n function withdrawFrom(\n address from_,\n uint256 amount_\n )\n external\n override\n onlyIfSmartFarmingManager\n onlyIfUnlocked(from_, amount_)\n returns (uint256 _withdrawn, uint256 _fee)\n {\n return _withdraw({account_: from_, amount_: amount_, to_: msg.sender});\n }\n\n /**\n * @notice Set `amount` as the allowance of `spender` over the caller's tokens\n */\n function _approve(address owner_, address spender_, uint256 amount_) private {\n if (owner_ == address(0)) revert ApproveFromTheZeroAddress();\n if (spender_ == address(0)) revert ApproveToTheZeroAddress();\n\n allowance[owner_][spender_] = amount_;\n emit Approval(owner_, spender_, amount_);\n }\n\n /**\n * @notice Destroy `amount` tokens from `account`, reducing the\n * total supply\n */\n function _burn(address _account, uint256 _amount) private updateRewardsBeforeMintOrBurn(_account) {\n if (_account == address(0)) revert BurnFromTheZeroAddress();\n\n uint256 _balanceBefore = balanceOf[_account];\n if (_balanceBefore < _amount) revert BurnAmountExceedsBalance();\n uint256 _balanceAfter;\n unchecked {\n _balanceAfter = _balanceBefore - _amount;\n totalSupply -= _amount;\n }\n\n balanceOf[_account] = _balanceAfter;\n\n emit Transfer(_account, address(0), _amount);\n\n // Remove this token from the deposit tokens list if the sender's balance goes to zero\n if (_amount > 0 && _balanceAfter == 0) {\n pool.removeFromDepositTokensOfAccount(_account);\n }\n }\n\n /**\n * @notice Create `amount` tokens and assigns them to `account`, increasing\n * the total supply\n */\n function _mint(\n address account_,\n uint256 amount_\n ) private onlyIfDepositTokenIsActive updateRewardsBeforeMintOrBurn(account_) {\n if (account_ == address(0)) revert MintToTheZeroAddress();\n\n totalSupply += amount_;\n if (totalSupply > maxTotalSupply) revert SurpassMaxDepositSupply();\n\n uint256 _balanceBefore = balanceOf[account_];\n unchecked {\n balanceOf[account_] = _balanceBefore + amount_;\n }\n\n emit Transfer(address(0), account_, amount_);\n\n // Add this token to the deposit tokens list if the recipient is receiving it for the 1st time\n if (_balanceBefore == 0 && amount_ > 0) {\n pool.addToDepositTokensOfAccount(account_);\n }\n }\n\n /// @inheritdoc TokenHolder\n // solhint-disable-next-line no-empty-blocks\n function _requireCanSweep() internal view override onlyGovernor {}\n\n /**\n * @notice Move `amount` of tokens from `sender` to `recipient`\n */\n function _transfer(\n address sender_,\n address recipient_,\n uint256 amount_\n ) private updateRewardsBeforeTransfer(sender_, recipient_) {\n if (sender_ == address(0)) revert TransferFromTheZeroAddress();\n if (recipient_ == address(0)) revert TransferToTheZeroAddress();\n\n uint256 _senderBalanceBefore = balanceOf[sender_];\n if (_senderBalanceBefore < amount_) revert TransferAmountExceedsBalance();\n uint256 _recipientBalanceBefore = balanceOf[recipient_];\n\n unchecked {\n balanceOf[sender_] = _senderBalanceBefore - amount_;\n balanceOf[recipient_] += amount_;\n }\n\n emit Transfer(sender_, recipient_, amount_);\n\n // Add this token to the deposit tokens list if the recipient is receiving it for the 1st time\n if (_recipientBalanceBefore == 0 && amount_ > 0) {\n pool.addToDepositTokensOfAccount(recipient_);\n }\n\n // Remove this token from the deposit tokens list if the sender's balance goes to zero\n if (amount_ > 0 && balanceOf[sender_] == 0) {\n pool.removeFromDepositTokensOfAccount(sender_);\n }\n }\n\n /**\n * @notice Burn msdTOKEN, withdraw collateral and transfer to `msg.sender` (i.e. Pool)\n * @dev This function doesn't check if the amount is unlocked!\n * @param account_ The account where deposit token will be burnt from\n * @param amount_ The amount of collateral to withdraw\n * @param to_ The account that will receive withdrawn collateral\n * @return _withdrawn The amount withdrawn after fees\n */\n function _withdraw(\n address account_,\n uint256 amount_,\n address to_\n ) private whenNotShutdown nonReentrant onlyIfDepositTokenExists returns (uint256 _withdrawn, uint256 _fee) {\n if (amount_ == 0) revert AmountIsZero();\n\n IPool _pool = pool;\n\n (_withdrawn, _fee) = quoteWithdrawOut(amount_);\n if (_fee > 0) {\n _transfer(account_, _pool.feeCollector(), _fee);\n }\n\n _burn(account_, _withdrawn);\n _pool.treasury().pull(to_, _withdrawn);\n\n emit CollateralWithdrawn(account_, to_, amount_, _withdrawn, _fee);\n }\n\n /**\n * @notice Enable/Disable the Deposit Token\n */\n function toggleIsActive() external override onlyGovernor {\n bool _newIsActive = !isActive;\n emit DepositTokenActiveUpdated(_newIsActive);\n isActive = _newIsActive;\n }\n\n /**\n * @notice Update collateral factor\n * @param newCollateralFactor_ The new CF value\n */\n function updateCollateralFactor(uint128 newCollateralFactor_) external override onlyGovernor {\n if (newCollateralFactor_ == 0) revert CollateralFactorTooLow();\n if (newCollateralFactor_ >= 1e18) revert CollateralFactorTooHigh();\n uint256 _currentCollateralFactor = collateralFactor;\n if (newCollateralFactor_ == _currentCollateralFactor) revert NewValueIsSameAsCurrent();\n emit CollateralFactorUpdated(_currentCollateralFactor, newCollateralFactor_);\n collateralFactor = newCollateralFactor_;\n }\n\n /**\n * @notice Update max total supply\n * @param newMaxTotalSupply_ The new max total supply\n */\n function updateMaxTotalSupply(uint256 newMaxTotalSupply_) external override onlyGovernor {\n uint256 _currentMaxTotalSupply = maxTotalSupply;\n if (newMaxTotalSupply_ == _currentMaxTotalSupply) revert NewValueIsSameAsCurrent();\n emit MaxTotalSupplyUpdated(_currentMaxTotalSupply, newMaxTotalSupply_);\n maxTotalSupply = newMaxTotalSupply_;\n }\n}\n" + }, + "contracts/FeeProvider.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"./dependencies/openzeppelin-upgradeable/proxy/utils/Initializable.sol\";\nimport \"./storage/FeeProviderStorage.sol\";\nimport \"./lib/WadRayMath.sol\";\n\nerror SenderIsNotGovernor();\nerror PoolRegistryIsNull();\nerror NewValueIsSameAsCurrent();\nerror FeeIsGreaterThanTheMax();\nerror TierDiscountTooHigh();\nerror TiersNotOrderedByMin();\n\n/**\n * @title FeeProvider contract\n */\ncontract FeeProvider is Initializable, FeeProviderStorageV1 {\n using WadRayMath for uint256;\n\n string public constant VERSION = \"1.3.0\";\n\n uint256 internal constant MAX_FEE_VALUE = 0.25e18; // 25%\n uint256 internal constant MAX_FEE_DISCOUNT = 1e18; // 100%\n\n /// @notice Emitted when deposit fee is updated\n event DepositFeeUpdated(uint256 oldDepositFee, uint256 newDepositFee);\n\n /// @notice Emitted when issue fee is updated\n event IssueFeeUpdated(uint256 oldIssueFee, uint256 newIssueFee);\n\n /// @notice Emitted when liquidator incentive is updated\n event LiquidatorIncentiveUpdated(uint256 oldLiquidatorIncentive, uint256 newLiquidatorIncentive);\n\n /// @notice Emitted when protocol liquidation fee is updated\n event ProtocolLiquidationFeeUpdated(uint256 oldProtocolLiquidationFee, uint256 newProtocolLiquidationFee);\n\n /// @notice Emitted when repay fee is updated\n event RepayFeeUpdated(uint256 oldRepayFee, uint256 newRepayFee);\n\n /// @notice Emitted when swap fee is updated\n event SwapDefaultFeeUpdated(uint256 oldSwapFee, uint256 newSwapFee);\n\n /// @notice Emitted when tiers are updated\n event TiersUpdated(Tier[] oldTiers, Tier[] newTiers);\n\n /// @notice Emitted when withdraw fee is updated\n event WithdrawFeeUpdated(uint256 oldWithdrawFee, uint256 newWithdrawFee);\n\n /**\n * @notice Throws if caller isn't the governor\n */\n modifier onlyGovernor() {\n if (msg.sender != poolRegistry.governor()) revert SenderIsNotGovernor();\n _;\n }\n\n constructor() {\n _disableInitializers();\n }\n\n function initialize(IPoolRegistry poolRegistry_, IESMET esMET_) public initializer {\n if (address(poolRegistry_) == address(0)) revert PoolRegistryIsNull();\n\n poolRegistry = poolRegistry_;\n esMET = esMET_;\n\n liquidationFees = LiquidationFees({\n liquidatorIncentive: 1e17, // 10%\n protocolFee: 8e16 // 8%\n });\n defaultSwapFee = 25e14; // 0.25%\n }\n\n /**\n * @notice Get fee discount tiers\n */\n function getTiers() external view returns (Tier[] memory _tiers) {\n return tiers;\n }\n\n /**\n * @notice Get the swap fee for a given account\n * Fee discount are applied on top of the default swap fee depending on user's esMET balance\n * @param account_ The account address\n * @return _swapFee The account's swap fee\n */\n function swapFeeFor(address account_) external view override returns (uint256 _swapFee) {\n uint256 _len = tiers.length;\n\n if (_len == 0) {\n return defaultSwapFee;\n }\n\n uint256 _balance = esMET.balanceOf(account_);\n\n if (_balance < tiers[0].min) {\n return defaultSwapFee;\n }\n\n uint256 i = 1;\n while (i < _len) {\n if (_balance < tiers[i].min) {\n unchecked {\n // Note: `discount` is always <= `1e18`\n return defaultSwapFee.wadMul(1e18 - tiers[i - 1].discount);\n }\n }\n\n unchecked {\n ++i;\n }\n }\n\n unchecked {\n // Note: `discount` is always <= `1e18`\n return defaultSwapFee.wadMul(1e18 - tiers[_len - 1].discount);\n }\n }\n\n /**\n * @notice Update deposit fee\n */\n function updateDepositFee(uint256 newDepositFee_) external onlyGovernor {\n if (newDepositFee_ > MAX_FEE_VALUE) revert FeeIsGreaterThanTheMax();\n uint256 _currentDepositFee = depositFee;\n if (newDepositFee_ == _currentDepositFee) revert NewValueIsSameAsCurrent();\n emit DepositFeeUpdated(_currentDepositFee, newDepositFee_);\n depositFee = newDepositFee_;\n }\n\n /**\n * @notice Update issue fee\n */\n function updateIssueFee(uint256 newIssueFee_) external onlyGovernor {\n if (newIssueFee_ > MAX_FEE_VALUE) revert FeeIsGreaterThanTheMax();\n uint256 _currentIssueFee = issueFee;\n if (newIssueFee_ == _currentIssueFee) revert NewValueIsSameAsCurrent();\n emit IssueFeeUpdated(_currentIssueFee, newIssueFee_);\n issueFee = newIssueFee_;\n }\n\n /**\n * @notice Update liquidator incentive\n * @dev liquidatorIncentive + protocolFee can't surpass max\n */\n function updateLiquidatorIncentive(uint128 newLiquidatorIncentive_) external onlyGovernor {\n LiquidationFees memory _current = liquidationFees;\n if (newLiquidatorIncentive_ + _current.protocolFee > MAX_FEE_VALUE) revert FeeIsGreaterThanTheMax();\n if (newLiquidatorIncentive_ == _current.liquidatorIncentive) revert NewValueIsSameAsCurrent();\n emit LiquidatorIncentiveUpdated(_current.liquidatorIncentive, newLiquidatorIncentive_);\n liquidationFees.liquidatorIncentive = newLiquidatorIncentive_;\n }\n\n /**\n * @notice Update protocol liquidation fee\n * @dev liquidatorIncentive + protocolFee can't surpass max\n */\n function updateProtocolLiquidationFee(uint128 newProtocolLiquidationFee_) external onlyGovernor {\n LiquidationFees memory _current = liquidationFees;\n if (newProtocolLiquidationFee_ + _current.liquidatorIncentive > MAX_FEE_VALUE) revert FeeIsGreaterThanTheMax();\n if (newProtocolLiquidationFee_ == _current.protocolFee) revert NewValueIsSameAsCurrent();\n emit ProtocolLiquidationFeeUpdated(_current.protocolFee, newProtocolLiquidationFee_);\n liquidationFees.protocolFee = newProtocolLiquidationFee_;\n }\n\n /**\n * @notice Update repay fee\n */\n function updateRepayFee(uint256 newRepayFee_) external onlyGovernor {\n if (newRepayFee_ > MAX_FEE_VALUE) revert FeeIsGreaterThanTheMax();\n uint256 _currentRepayFee = repayFee;\n if (newRepayFee_ == _currentRepayFee) revert NewValueIsSameAsCurrent();\n emit RepayFeeUpdated(_currentRepayFee, newRepayFee_);\n repayFee = newRepayFee_;\n }\n\n /**\n * @notice Update swap fee\n */\n function updateDefaultSwapFee(uint256 newDefaultSwapFee_) external onlyGovernor {\n if (newDefaultSwapFee_ > MAX_FEE_VALUE) revert FeeIsGreaterThanTheMax();\n uint256 _current = defaultSwapFee;\n if (newDefaultSwapFee_ == _current) revert NewValueIsSameAsCurrent();\n emit SwapDefaultFeeUpdated(_current, newDefaultSwapFee_);\n defaultSwapFee = newDefaultSwapFee_;\n }\n\n /**\n * @notice Update fee discount tiers\n */\n function updateTiers(Tier[] memory tiers_) external onlyGovernor {\n emit TiersUpdated(tiers, tiers_);\n delete tiers;\n\n uint256 _len = tiers_.length;\n for (uint256 i; i < _len; ++i) {\n Tier memory _tier = tiers_[i];\n if (_tier.discount > MAX_FEE_DISCOUNT) revert TierDiscountTooHigh();\n if (i > 0 && tiers_[i - 1].min > _tier.min) revert TiersNotOrderedByMin();\n tiers.push(_tier);\n }\n }\n\n /**\n * @notice Update withdraw fee\n */\n function updateWithdrawFee(uint256 newWithdrawFee_) external onlyGovernor {\n if (newWithdrawFee_ > MAX_FEE_VALUE) revert FeeIsGreaterThanTheMax();\n uint256 _currentWithdrawFee = withdrawFee;\n if (newWithdrawFee_ == _currentWithdrawFee) revert NewValueIsSameAsCurrent();\n emit WithdrawFeeUpdated(_currentWithdrawFee, newWithdrawFee_);\n withdrawFee = newWithdrawFee_;\n }\n}\n" + }, + "contracts/interfaces/external/IESMET.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"../../dependencies/openzeppelin/token/ERC20/IERC20.sol\";\n\ninterface IESMET is IERC20 {\n struct LockPosition {\n uint256 lockedAmount; // MET locked\n uint256 boostedAmount; // based on the `lockPeriod`\n uint256 unlockTime; // now + `lockPeriod`\n }\n\n function positions(uint256) external view returns (LockPosition memory);\n\n function MINIMUM_LOCK_PERIOD() external view returns (uint256);\n\n function MAXIMUM_LOCK_PERIOD() external view returns (uint256);\n\n function balanceOf(address account_) external view returns (uint256);\n\n function lock(uint256 amount_, uint256 lockPeriod_) external;\n\n function lockFor(address to_, uint256 amount_, uint256 lockPeriod_) external;\n}\n" + }, + "contracts/interfaces/external/IMasterOracle.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\ninterface IMasterOracle {\n function quoteTokenToUsd(address _asset, uint256 _amount) external view returns (uint256 _amountInUsd);\n\n function quoteUsdToToken(address _asset, uint256 _amountInUsd) external view returns (uint256 _amount);\n\n function quote(address _assetIn, address _assetOut, uint256 _amountIn) external view returns (uint256 _amountOut);\n}\n" + }, + "contracts/interfaces/external/IMulticall.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\ninterface IMulticall {\n struct Call {\n address target;\n bytes callData;\n }\n\n function aggregate(Call[] calldata calls) external returns (uint256 blockNumber, bytes[] memory returnData);\n}\n" + }, + "contracts/interfaces/external/IPoolRewards.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\ninterface IPoolRewards {\n function claimReward(address) external;\n\n function updateReward(address) external;\n\n function getRewardTokens() external view returns (address[] memory);\n}\n" + }, + "contracts/interfaces/external/IStargateBridge.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"../../dependencies/@layerzerolabs/solidity-examples/interfaces/ILayerZeroEndpoint.sol\";\n\ninterface IStargateBridge {\n function layerZeroEndpoint() external view returns (ILayerZeroEndpoint _lzEndpoint);\n}\n" + }, + "contracts/interfaces/external/IStargateComposerWithRetry.sol": { + "content": "// SPDX-License-Identifier: BUSL-1.1\n\npragma solidity 0.8.9;\n\nimport \"../../dependencies/stargate-protocol/interfaces/IStargateComposer.sol\";\n\n// Note: Extending interface instead of adding those function to avoid triggering upgrade for other contracts\n// We may move functions to `IStargateComposer` on the next major upgrade\n// Refs: https://github.com/autonomoussoftware/metronome-synth/issues/877\ninterface IStargateComposerWithRetry is IStargateComposer {\n function payloadHashes(\n uint16 _srcChainId,\n bytes calldata _srcAddress,\n uint256 _nonce\n ) external view returns (bytes32);\n\n function clearCachedSwap(\n uint16 _srcChainId,\n bytes calldata _srcAddress,\n uint64 _nonce,\n address _receiver,\n bytes calldata _sgReceiveCallData\n ) external;\n}\n" + }, + "contracts/interfaces/external/IStargateFactory.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\ninterface IStargateFactory {\n function getPool(uint256 _id) external view returns (address _pool);\n}\n" + }, + "contracts/interfaces/external/IStargatePool.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\ninterface IStargatePool {\n function token() external view returns (address _token);\n}\n" + }, + "contracts/interfaces/external/ISwapper.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\ninterface ISwapper {\n function swapExactInput(\n address tokenIn_,\n address tokenOut_,\n uint256 amountIn_,\n uint256 amountOutMin_,\n address receiver_\n ) external returns (uint256 _amountOut);\n}\n" + }, + "contracts/interfaces/external/IVPool.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"../../dependencies/openzeppelin/token/ERC20/IERC20.sol\";\n\ninterface IVPool is IERC20 {\n function token() external view returns (address _token);\n\n function deposit(uint256 _amount) external;\n\n function withdraw(uint256 _shares) external;\n\n function poolRewards() external view returns (address);\n}\n" + }, + "contracts/interfaces/external/IWETH.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"../../dependencies/openzeppelin/token/ERC20/IERC20.sol\";\n\ninterface IWETH is IERC20 {\n function deposit() external payable;\n\n function withdraw(uint256) external;\n}\n" + }, + "contracts/interfaces/ICrossChainDispatcher.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"../dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/composable/IOFTReceiverUpgradeable.sol\";\nimport \"../dependencies/stargate-protocol/interfaces/IStargateReceiver.sol\";\nimport \"../dependencies/stargate-protocol/interfaces/IStargateRouter.sol\";\nimport \"../dependencies/stargate-protocol/interfaces/IStargateComposer.sol\";\nimport \"./IProxyOFT.sol\";\n\ninterface ICrossChainDispatcher is IStargateReceiver, IOFTReceiverUpgradeable {\n function crossChainDispatcherOf(uint16 chainId_) external view returns (address);\n\n function triggerFlashRepaySwap(\n uint256 id_,\n address payable account_,\n address tokenIn_,\n address tokenOut_,\n uint256 amountIn_,\n uint256 amountOutMin_,\n bytes calldata lzArgs_\n ) external payable;\n\n function triggerLeverageSwap(\n uint256 id_,\n address payable account_,\n address tokenIn_,\n address tokenOut_,\n uint256 amountIn_,\n uint256 amountOutMin,\n bytes calldata lzArgs_\n ) external payable;\n\n function isBridgingActive() external view returns (bool);\n\n function flashRepayCallbackTxGasLimit() external view returns (uint64);\n\n function flashRepaySwapTxGasLimit() external view returns (uint64);\n\n function leverageCallbackTxGasLimit() external view returns (uint64);\n\n function leverageSwapTxGasLimit() external view returns (uint64);\n\n function lzBaseGasLimit() external view returns (uint256);\n\n function stargateComposer() external view returns (IStargateComposer);\n\n function stargateSlippage() external view returns (uint256);\n\n function stargatePoolIdOf(address token_) external view returns (uint256);\n}\n" + }, + "contracts/interfaces/IDebtToken.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"../dependencies/openzeppelin/token/ERC20/extensions/IERC20Metadata.sol\";\nimport \"./ISyntheticToken.sol\";\n\ninterface IDebtToken is IERC20Metadata {\n function lastTimestampAccrued() external view returns (uint256);\n\n function isActive() external view returns (bool);\n\n function syntheticToken() external view returns (ISyntheticToken);\n\n function accrueInterest() external;\n\n function debtIndex() external returns (uint256 debtIndex_);\n\n function burn(address from_, uint256 amount_) external;\n\n function issue(uint256 amount_, address to_) external returns (uint256 _issued, uint256 _fee);\n\n function flashIssue(address to_, uint256 amount_) external returns (uint256 _issued, uint256 _fee);\n\n function mint(address to_, uint256 amount_) external;\n\n function repay(address onBehalfOf_, uint256 amount_) external returns (uint256 _repaid, uint256 _fee);\n\n function repayAll(address onBehalfOf_) external returns (uint256 _repaid, uint256 _fee);\n\n function quoteIssueIn(uint256 amountToIssue_) external view returns (uint256 _amount, uint256 _fee);\n\n function quoteIssueOut(uint256 amount_) external view returns (uint256 _amountToIssue, uint256 _fee);\n\n function quoteRepayIn(uint256 amountToRepay_) external view returns (uint256 _amount, uint256 _fee);\n\n function quoteRepayOut(uint256 amount_) external view returns (uint256 _amountToRepay, uint256 _fee);\n\n function updateMaxTotalSupply(uint256 newMaxTotalSupply_) external;\n\n function updateInterestRate(uint256 newInterestRate_) external;\n\n function maxTotalSupply() external view returns (uint256);\n\n function interestRate() external view returns (uint256);\n\n function interestRatePerSecond() external view returns (uint256);\n\n function toggleIsActive() external;\n}\n" + }, + "contracts/interfaces/IDepositToken.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"../dependencies/openzeppelin/token/ERC20/extensions/IERC20Metadata.sol\";\n\ninterface IDepositToken is IERC20Metadata {\n function underlying() external view returns (IERC20);\n\n function collateralFactor() external view returns (uint256);\n\n function unlockedBalanceOf(address account_) external view returns (uint256);\n\n function lockedBalanceOf(address account_) external view returns (uint256);\n\n function flashWithdraw(address account_, uint256 amount_) external returns (uint256 _withdrawn, uint256 _fee);\n\n function deposit(uint256 amount_, address onBehalfOf_) external returns (uint256 _deposited, uint256 _fee);\n\n function quoteDepositIn(uint256 amountToDeposit_) external view returns (uint256 _amount, uint256 _fee);\n\n function quoteDepositOut(uint256 amount_) external view returns (uint256 _amountToDeposit, uint256 _fee);\n\n function quoteWithdrawIn(uint256 amountToWithdraw_) external view returns (uint256 _amount, uint256 _fee);\n\n function quoteWithdrawOut(uint256 amount_) external view returns (uint256 _amountToWithdraw, uint256 _fee);\n\n function withdraw(uint256 amount_, address to_) external returns (uint256 _withdrawn, uint256 _fee);\n\n function seize(address from_, address to_, uint256 amount_) external;\n\n function updateCollateralFactor(uint128 newCollateralFactor_) external;\n\n function isActive() external view returns (bool);\n\n function toggleIsActive() external;\n\n function maxTotalSupply() external view returns (uint256);\n\n function updateMaxTotalSupply(uint256 newMaxTotalSupply_) external;\n\n function withdrawFrom(address from_, uint256 amount_) external returns (uint256 _withdrawn, uint256 _fee);\n}\n" + }, + "contracts/interfaces/IFeeProvider.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\n/**\n * @notice FeeProvider interface\n */\ninterface IFeeProvider {\n struct LiquidationFees {\n uint128 liquidatorIncentive;\n uint128 protocolFee;\n }\n\n function defaultSwapFee() external view returns (uint256);\n\n function depositFee() external view returns (uint256);\n\n function issueFee() external view returns (uint256);\n\n function liquidationFees() external view returns (uint128 liquidatorIncentive, uint128 protocolFee);\n\n function repayFee() external view returns (uint256);\n\n function swapFeeFor(address account_) external view returns (uint256);\n\n function withdrawFee() external view returns (uint256);\n}\n" + }, + "contracts/interfaces/IGovernable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\n/**\n * @notice Governable interface\n */\ninterface IGovernable {\n function governor() external view returns (address _governor);\n\n function transferGovernorship(address _proposedGovernor) external;\n}\n" + }, + "contracts/interfaces/IManageable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"./IPool.sol\";\n\n/**\n * @notice Manageable interface\n */\ninterface IManageable {\n function pool() external view returns (IPool _pool);\n}\n" + }, + "contracts/interfaces/INativeTokenGateway.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"./IPool.sol\";\n\ninterface INativeTokenGateway {\n function deposit(IPool pool_) external payable;\n\n function withdraw(IPool pool_, uint256 amount_) external;\n}\n" + }, + "contracts/interfaces/IPauseable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\ninterface IPauseable {\n function paused() external view returns (bool);\n\n function everythingStopped() external view returns (bool);\n}\n" + }, + "contracts/interfaces/IPool.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"./IDepositToken.sol\";\nimport \"./IDebtToken.sol\";\nimport \"./ITreasury.sol\";\nimport \"./IRewardsDistributor.sol\";\nimport \"./IPoolRegistry.sol\";\nimport \"./IFeeProvider.sol\";\nimport \"./ISmartFarmingManager.sol\";\nimport \"./external/ISwapper.sol\";\nimport \"../interfaces/IFeeProvider.sol\";\n\n/**\n * @notice Pool interface\n */\ninterface IPool is IPauseable, IGovernable {\n function debtFloorInUsd() external view returns (uint256);\n\n function feeCollector() external view returns (address);\n\n function feeProvider() external view returns (IFeeProvider);\n\n function maxLiquidable() external view returns (uint256);\n\n function doesSyntheticTokenExist(ISyntheticToken syntheticToken_) external view returns (bool);\n\n function doesDebtTokenExist(IDebtToken debtToken_) external view returns (bool);\n\n function doesDepositTokenExist(IDepositToken depositToken_) external view returns (bool);\n\n function depositTokenOf(IERC20 underlying_) external view returns (IDepositToken);\n\n function debtTokenOf(ISyntheticToken syntheticToken_) external view returns (IDebtToken);\n\n function getDepositTokens() external view returns (address[] memory);\n\n function getDebtTokens() external view returns (address[] memory);\n\n function getRewardsDistributors() external view returns (address[] memory);\n\n function debtOf(address account_) external view returns (uint256 _debtInUsd);\n\n function depositOf(address account_) external view returns (uint256 _depositInUsd, uint256 _issuableLimitInUsd);\n\n function debtPositionOf(\n address account_\n )\n external\n view\n returns (\n bool _isHealthy,\n uint256 _depositInUsd,\n uint256 _debtInUsd,\n uint256 _issuableLimitInUsd,\n uint256 _issuableInUsd\n );\n\n function liquidate(\n ISyntheticToken syntheticToken_,\n address account_,\n uint256 amountToRepay_,\n IDepositToken depositToken_\n ) external returns (uint256 _totalSeized, uint256 _toLiquidator, uint256 _fee);\n\n function quoteLiquidateIn(\n ISyntheticToken syntheticToken_,\n uint256 totalToSeized_,\n IDepositToken depositToken_\n ) external view returns (uint256 _amountToRepay, uint256 _toLiquidator, uint256 _fee);\n\n function quoteLiquidateMax(\n ISyntheticToken syntheticToken_,\n address account_,\n IDepositToken depositToken_\n ) external view returns (uint256 _maxAmountToRepay);\n\n function quoteLiquidateOut(\n ISyntheticToken syntheticToken_,\n uint256 amountToRepay_,\n IDepositToken depositToken_\n ) external view returns (uint256 _totalSeized, uint256 _toLiquidator, uint256 _fee);\n\n function quoteSwapIn(\n ISyntheticToken syntheticTokenIn_,\n ISyntheticToken syntheticTokenOut_,\n uint256 amountOut_\n ) external view returns (uint256 _amountIn, uint256 _fee);\n\n function quoteSwapOut(\n ISyntheticToken syntheticTokenIn_,\n ISyntheticToken syntheticTokenOut_,\n uint256 amountIn_\n ) external view returns (uint256 _amountOut, uint256 _fee);\n\n function swap(\n ISyntheticToken syntheticTokenIn_,\n ISyntheticToken syntheticTokenOut_,\n uint256 amountIn_\n ) external returns (uint256 _amountOut, uint256 _fee);\n\n function treasury() external view returns (ITreasury);\n\n function masterOracle() external view returns (IMasterOracle);\n\n function poolRegistry() external view returns (IPoolRegistry);\n\n function addToDepositTokensOfAccount(address account_) external;\n\n function removeFromDepositTokensOfAccount(address account_) external;\n\n function addToDebtTokensOfAccount(address account_) external;\n\n function removeFromDebtTokensOfAccount(address account_) external;\n\n function getDepositTokensOfAccount(address account_) external view returns (address[] memory);\n\n function getDebtTokensOfAccount(address account_) external view returns (address[] memory);\n\n function isSwapActive() external view returns (bool);\n\n function smartFarmingManager() external view returns (ISmartFarmingManager);\n}\n" + }, + "contracts/interfaces/IPoolRegistry.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"./external/IMasterOracle.sol\";\nimport \"./IPauseable.sol\";\nimport \"./IGovernable.sol\";\nimport \"./ISyntheticToken.sol\";\nimport \"./external/ISwapper.sol\";\nimport \"./IQuoter.sol\";\nimport \"./ICrossChainDispatcher.sol\";\n\ninterface IPoolRegistry is IPauseable, IGovernable {\n function feeCollector() external view returns (address);\n\n function isPoolRegistered(address pool_) external view returns (bool);\n\n function nativeTokenGateway() external view returns (address);\n\n function getPools() external view returns (address[] memory);\n\n function registerPool(address pool_) external;\n\n function unregisterPool(address pool_) external;\n\n function masterOracle() external view returns (IMasterOracle);\n\n function updateFeeCollector(address newFeeCollector_) external;\n\n function idOfPool(address pool_) external view returns (uint256);\n\n function nextPoolId() external view returns (uint256);\n\n function swapper() external view returns (ISwapper);\n\n function quoter() external view returns (IQuoter);\n\n function crossChainDispatcher() external view returns (ICrossChainDispatcher);\n\n function doesSyntheticTokenExist(ISyntheticToken syntheticToken_) external view returns (bool _exists);\n}\n" + }, + "contracts/interfaces/IProxyOFT.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"../dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/composable/IComposableOFTCoreUpgradeable.sol\";\n\ninterface IProxyOFT is IComposableOFTCoreUpgradeable {\n function getProxyOFTOf(uint16 chainId_) external view returns (address _proxyOFT);\n}\n" + }, + "contracts/interfaces/IQuoter.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"./IPoolRegistry.sol\";\nimport \"./IProxyOFT.sol\";\n\ninterface IQuoter {\n function quoteCrossChainFlashRepayNativeFee(\n IProxyOFT proxyOFT_,\n bytes calldata lzArgs_\n ) external view returns (uint256 _nativeFee);\n\n function quoteCrossChainLeverageNativeFee(\n IProxyOFT proxyOFT_,\n bytes calldata lzArgs_\n ) external view returns (uint256 _nativeFee);\n\n function quoteLeverageCallbackNativeFee(uint16 dstChainId_) external view returns (uint256 _callbackTxNativeFee);\n\n function quoteFlashRepayCallbackNativeFee(uint16 dstChainId_) external view returns (uint256 _callbackTxNativeFee);\n\n function getFlashRepaySwapAndCallbackLzArgs(\n uint16 srcChainId_,\n uint16 dstChainId_\n ) external view returns (bytes memory lzArgs_);\n\n function getLeverageSwapAndCallbackLzArgs(\n uint16 srcChainId_,\n uint16 dstChainId_\n ) external view returns (bytes memory lzArgs_);\n}\n" + }, + "contracts/interfaces/IRewardsDistributor.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"../dependencies/openzeppelin/token/ERC20/IERC20.sol\";\n\n/**\n * @notice Reward Distributor interface\n */\ninterface IRewardsDistributor {\n function rewardToken() external view returns (IERC20);\n\n function tokenSpeeds(IERC20 token_) external view returns (uint256);\n\n function tokensAccruedOf(address account_) external view returns (uint256);\n\n function updateBeforeMintOrBurn(IERC20 token_, address account_) external;\n\n function updateBeforeTransfer(IERC20 token_, address from_, address to_) external;\n\n function claimable(address account_) external view returns (uint256 _claimable);\n\n function claimable(address account_, IERC20 token_) external view returns (uint256 _claimable);\n\n function claimRewards(address account_) external;\n\n function claimRewards(address account_, IERC20[] memory tokens_) external;\n\n function claimRewards(address[] memory accounts_, IERC20[] memory tokens_) external;\n\n function updateTokenSpeed(IERC20 token_, uint256 newSpeed_) external;\n\n function updateTokenSpeeds(IERC20[] calldata tokens_, uint256[] calldata speeds_) external;\n\n function tokens(uint256) external view returns (IERC20);\n\n function tokenStates(IERC20) external view returns (uint224 index, uint32 timestamp);\n\n function accountIndexOf(IERC20, address) external view returns (uint256);\n}\n" + }, + "contracts/interfaces/ISmartFarmingManager.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"./IManageable.sol\";\nimport \"./IDepositToken.sol\";\nimport \"./IDebtToken.sol\";\n\n/**\n * @notice SmartFarmingManager interface\n */\ninterface ISmartFarmingManager {\n function flashRepay(\n ISyntheticToken syntheticToken_,\n IDepositToken depositToken_,\n uint256 withdrawAmount_,\n uint256 repayAmountMin_\n ) external returns (uint256 _withdrawn, uint256 _repaid);\n\n function crossChainFlashRepay(\n ISyntheticToken syntheticToken_,\n IDepositToken depositToken_,\n uint256 withdrawAmount_,\n IERC20 bridgeToken_,\n uint256 bridgeTokenAmountMin_,\n uint256 swapAmountOutMin_,\n uint256 repayAmountMin_,\n bytes calldata lzArgs_\n ) external payable;\n\n function crossChainLeverage(\n IERC20 tokenIn_,\n IDepositToken depositToken_,\n ISyntheticToken syntheticToken_,\n uint256 amountIn_,\n uint256 leverage_,\n uint256 swapAmountOutMin_,\n uint256 depositAmountMin_,\n bytes calldata lzArgs_\n ) external payable;\n\n function crossChainLeverageCallback(uint256 id_, uint256 swapAmountOut_) external returns (uint256 _deposited);\n\n function crossChainFlashRepayCallback(uint256 id_, uint256 swapAmountOut_) external returns (uint256 _repaid);\n\n function leverage(\n IERC20 tokenIn_,\n IDepositToken depositToken_,\n ISyntheticToken syntheticToken_,\n uint256 amountIn_,\n uint256 leverage_,\n uint256 depositAmountMin_\n ) external returns (uint256 _deposited, uint256 _issued);\n}\n" + }, + "contracts/interfaces/ISyntheticToken.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"../dependencies/openzeppelin/token/ERC20/extensions/IERC20Metadata.sol\";\nimport \"./IDebtToken.sol\";\nimport \"./IPoolRegistry.sol\";\nimport \"../interfaces/IProxyOFT.sol\";\n\ninterface ISyntheticToken is IERC20Metadata {\n function isActive() external view returns (bool);\n\n function mint(address to_, uint256 amount_) external;\n\n function burn(address from_, uint256 amount) external;\n\n function poolRegistry() external view returns (IPoolRegistry);\n\n function toggleIsActive() external;\n\n function seize(address from_, address to_, uint256 amount_) external;\n\n function updateMaxTotalSupply(uint256 newMaxTotalSupply_) external;\n\n function updateProxyOFT(IProxyOFT newProxyOFT_) external;\n\n function maxTotalSupply() external view returns (uint256);\n\n function proxyOFT() external view returns (IProxyOFT);\n}\n" + }, + "contracts/interfaces/ITreasury.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\ninterface ITreasury {\n function pull(address to_, uint256 amount_) external;\n\n function migrateTo(address newTreasury_) external;\n}\n" + }, + "contracts/interfaces/IVesperGateway.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"./IPool.sol\";\nimport \"./external/IVPool.sol\";\n\ninterface IVesperGateway {\n function deposit(IPool pool_, IVPool vToken_, uint256 amount_) external;\n\n function withdraw(IPool pool_, IVPool vToken_, uint256 amount_) external;\n}\n" + }, + "contracts/lib/CrossChainLib.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nlibrary CrossChainLib {\n /**\n * @notice Supported cross-chain operations\n */\n uint8 public constant LEVERAGE = 1;\n uint8 public constant FLASH_REPAY = 2;\n\n function getOperationType(bytes memory payload_) internal pure returns (uint8 _op) {\n (_op, ) = abi.decode(payload_, (uint8, bytes));\n }\n\n function encodeLeverageCallbackPayload(\n address srcSmartFarmingManager_,\n uint256 requestId_\n ) internal pure returns (bytes memory _payload) {\n return abi.encode(LEVERAGE, abi.encode(srcSmartFarmingManager_, requestId_));\n }\n\n function decodeLeverageCallbackPayload(\n bytes memory payload_\n ) internal pure returns (address _srcSmartFarmingManager, uint256 _requestId) {\n (, payload_) = abi.decode(payload_, (uint8, bytes));\n return abi.decode(payload_, (address, uint256));\n }\n\n function encodeFlashRepayCallbackPayload(\n address srcProxyOFT_,\n address srcSmartFarmingManager_,\n uint256 requestId_\n ) internal pure returns (bytes memory _payload) {\n return abi.encode(FLASH_REPAY, abi.encode(srcProxyOFT_, srcSmartFarmingManager_, requestId_));\n }\n\n function decodeFlashRepayCallbackPayload(\n bytes memory payload_\n ) internal pure returns (address srcProxyOFT_, address _srcSmartFarmingManager, uint256 _requestId) {\n (, payload_) = abi.decode(payload_, (uint8, bytes));\n return abi.decode(payload_, (address, address, uint256));\n }\n\n function encodeFlashRepaySwapPayload(\n address srcSmartFarmingManager_,\n address dstProxyOFT_,\n uint256 requestId_,\n address account_,\n uint256 amountOutMin_,\n uint256 callbackTxNativeFee_\n ) internal pure returns (bytes memory _payload) {\n return\n abi.encode(\n FLASH_REPAY,\n abi.encode(\n srcSmartFarmingManager_,\n dstProxyOFT_,\n requestId_,\n account_,\n amountOutMin_,\n callbackTxNativeFee_\n )\n );\n }\n\n function decodeFlashRepaySwapPayload(\n bytes memory payload_\n )\n internal\n pure\n returns (\n address _srcSmartFarmingManager,\n address _dstProxyOFT,\n uint256 _requestId,\n address _account,\n uint256 _amountOutMin,\n uint256 _callbackTxNativeFee\n )\n {\n (, payload_) = abi.decode(payload_, (uint8, bytes));\n return abi.decode(payload_, (address, address, uint256, address, uint256, uint256));\n }\n\n function encodeLeverageSwapPayload(\n address srcSmartFarmingManager_,\n address dstProxyOFT_,\n uint256 requestId_,\n uint256 sgPoolId_,\n address account_,\n uint256 amountOutMin_,\n uint256 callbackTxNativeFee_\n ) internal pure returns (bytes memory _payload) {\n return\n abi.encode(\n LEVERAGE,\n abi.encode(\n srcSmartFarmingManager_,\n dstProxyOFT_,\n requestId_,\n sgPoolId_,\n account_,\n amountOutMin_,\n callbackTxNativeFee_\n )\n );\n }\n\n function decodeLeverageSwapPayload(\n bytes memory payload_\n )\n internal\n pure\n returns (\n address _srcSmartFarmingManager,\n address _dstProxyOFT,\n uint256 _requestId,\n uint256 _sgPoolId,\n address _account,\n uint256 _amountOutMin,\n uint256 _callbackTxNativeFee\n )\n {\n (, payload_) = abi.decode(payload_, (uint8, bytes));\n return abi.decode(payload_, (address, address, uint256, uint256, address, uint256, uint256));\n }\n\n function encodeLzArgs(\n uint16 dstChainId_,\n uint256 callbackNativeFee_,\n uint64 swapTxGasLimit_\n ) internal pure returns (bytes memory _lzArgs) {\n return abi.encode(dstChainId_, callbackNativeFee_, swapTxGasLimit_);\n }\n\n function decodeLzArgs(\n bytes memory lzArgs_\n ) internal pure returns (uint16 _dstChainId, uint256 _callbackNativeFee, uint64 _swapTxGasLimit) {\n return abi.decode(lzArgs_, (uint16, uint256, uint64));\n }\n}\n" + }, + "contracts/lib/MappedEnumerableSet.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\n/**\n * @dev EnumerableSet fork to support `address => address[]` mapping\n * @dev Forked from OZ 4.3.2\n */\nlibrary MappedEnumerableSet {\n struct Set {\n // Storage of set values\n address[] _values;\n // Position of the value in the `values` array, plus 1 because index 0\n // means a value is not in the set.\n mapping(address => uint256) _indexes;\n }\n\n struct AddressSet {\n mapping(address => Set) _ofAddress;\n }\n\n function _add(AddressSet storage set, address _key, address value) private returns (bool) {\n if (!_contains(set, _key, value)) {\n set._ofAddress[_key]._values.push(value);\n // The value is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n set._ofAddress[_key]._indexes[value] = set._ofAddress[_key]._values.length;\n return true;\n } else {\n return false;\n }\n }\n\n function _remove(AddressSet storage set, address _key, address value) private returns (bool) {\n // We read and store the value's index to prevent multiple reads from the same storage slot\n uint256 valueIndex = set._ofAddress[_key]._indexes[value];\n\n if (valueIndex != 0) {\n // Equivalent to contains(set, value)\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n // the array, and then remove the last element (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 toDeleteIndex = valueIndex - 1;\n uint256 lastIndex = set._ofAddress[_key]._values.length - 1;\n\n if (lastIndex != toDeleteIndex) {\n address lastvalue = set._ofAddress[_key]._values[lastIndex];\n\n // Move the last value to the index where the value to delete is\n set._ofAddress[_key]._values[toDeleteIndex] = lastvalue;\n // Update the index for the moved value\n set._ofAddress[_key]._indexes[lastvalue] = valueIndex; // Replace lastvalue's index to valueIndex\n }\n\n // Delete the slot where the moved value was stored\n set._ofAddress[_key]._values.pop();\n\n // Delete the index for the deleted slot\n delete set._ofAddress[_key]._indexes[value];\n\n return true;\n } else {\n return false;\n }\n }\n\n function _contains(AddressSet storage set, address _key, address value) private view returns (bool) {\n return set._ofAddress[_key]._indexes[value] != 0;\n }\n\n function _length(AddressSet storage set, address _key) private view returns (uint256) {\n return set._ofAddress[_key]._values.length;\n }\n\n function _at(AddressSet storage set, address _key, uint256 index) private view returns (address) {\n return set._ofAddress[_key]._values[index];\n }\n\n function _values(AddressSet storage set, address _key) private view returns (address[] memory) {\n return set._ofAddress[_key]._values;\n }\n\n function add(AddressSet storage set, address key, address value) internal returns (bool) {\n return _add(set, key, value);\n }\n\n function remove(AddressSet storage set, address key, address value) internal returns (bool) {\n return _remove(set, key, value);\n }\n\n function contains(AddressSet storage set, address key, address value) internal view returns (bool) {\n return _contains(set, key, value);\n }\n\n function length(AddressSet storage set, address key) internal view returns (uint256) {\n return _length(set, key);\n }\n\n function at(AddressSet storage set, address key, uint256 index) internal view returns (address) {\n return _at(set, key, index);\n }\n\n function values(AddressSet storage set, address key) internal view returns (address[] memory) {\n address[] memory store = _values(set, key);\n address[] memory result;\n\n assembly {\n result := store\n }\n\n return result;\n }\n}\n" + }, + "contracts/lib/WadRayMath.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\n/**\n * @title Math library\n * @dev Provides mul and div function for wads (decimal numbers with 18 digits precision) and rays (decimals with 27 digits)\n * @dev Based on https://github.com/dapphub/ds-math/blob/master/src/math.sol\n */\nlibrary WadRayMath {\n uint256 internal constant WAD = 1e18;\n uint256 internal constant HALF_WAD = WAD / 2;\n\n uint256 internal constant RAY = 1e27;\n uint256 internal constant HALF_RAY = RAY / 2;\n\n uint256 internal constant WAD_RAY_RATIO = 1e9;\n\n /**\n * @dev Multiplies two wad, rounding half up to the nearest wad\n * @param a Wad\n * @param b Wad\n * @return The result of a*b, in wad\n */\n function wadMul(uint256 a, uint256 b) internal pure returns (uint256) {\n if (a == 0 || b == 0) {\n return 0;\n }\n\n return (a * b + HALF_WAD) / WAD;\n }\n\n /**\n * @dev Divides two wad, rounding half up to the nearest wad\n * @param a Wad\n * @param b Wad\n * @return The result of a/b, in wad\n */\n function wadDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n return (a * WAD + b / 2) / b;\n }\n}\n" + }, + "contracts/MetAirdrop.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"./dependencies/openzeppelin/utils/math/Math.sol\";\nimport \"./utils/RecurringAirdrop.sol\";\nimport \"./interfaces/external/IESMET.sol\";\n\n/**\n * @title MET Airdrop contract\n */\ncontract MetAirdrop is RecurringAirdrop {\n using SafeERC20 for IERC20;\n using Math for uint256;\n\n IESMET public constant ESMET = IESMET(0xA28D70795a61Dc925D4c220762A4344803876bb8);\n IERC20 public constant MET = IERC20(0x2Ebd53d035150f328bd754D6DC66B99B0eDB89aa);\n\n /// @notice For how long `MET` tokens will be locked\n uint256 public lockPeriod = 7 days;\n\n constructor() RecurringAirdrop(MET) {}\n\n /**\n * @inheritdoc RecurringAirdrop\n * @dev Locks the `MET` into `esMET` on user's behalf.\n * The `lockPeriod` starts from the current merkle root update (i.e. `updatedAt`)\n */\n function _transferReward(address to_, uint256 amount_) internal override {\n uint256 _end = updatedAt + lockPeriod;\n\n if (_end < block.timestamp) {\n MET.safeTransfer(to_, amount_);\n return;\n }\n\n uint256 _min = ESMET.MINIMUM_LOCK_PERIOD() + 1;\n uint256 _max = ESMET.MAXIMUM_LOCK_PERIOD();\n\n // Ensures valid lock period\n uint256 _remainLockPeriod = Math.min(Math.max(_end - block.timestamp, _min), _max);\n\n token.safeApprove(address(ESMET), 0);\n token.safeApprove(address(ESMET), amount_);\n ESMET.lockFor(to_, amount_, _remainLockPeriod);\n }\n\n /**\n * @notice Update esMET lock period\n * @param lockPeriod_ The new value\n */\n function updateLockPeriod(uint256 lockPeriod_) public onlyGovernor {\n lockPeriod = lockPeriod_;\n }\n}\n" + }, + "contracts/mock/ERC20Mock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\n// Note: Minimalist ERC20 based on https://github.com/maple-labs/erc20\n\npragma solidity 0.8.9;\n\nimport \"../dependencies/openzeppelin/token/ERC20/extensions/IERC20Metadata.sol\";\n\ncontract ERC20Mock is IERC20Metadata {\n string public override name;\n string public override symbol;\n\n uint8 public immutable override decimals;\n\n uint256 public override totalSupply;\n\n mapping(address => uint256) public override balanceOf;\n\n mapping(address => mapping(address => uint256)) public override allowance;\n\n uint256 public fee;\n\n constructor(string memory name_, string memory symbol_, uint8 decimals_) {\n name = name_;\n symbol = symbol_;\n decimals = decimals_;\n }\n\n /**************************/\n /*** External Functions ***/\n /**************************/\n\n function approve(address spender_, uint256 amount_) external override returns (bool success_) {\n _approve(msg.sender, spender_, amount_);\n return true;\n }\n\n function transfer(address recipient_, uint256 amount_) external override returns (bool success_) {\n _transfer(msg.sender, recipient_, amount_);\n return true;\n }\n\n function transferFrom(\n address owner_,\n address recipient_,\n uint256 amount_\n ) external override returns (bool success_) {\n _approve(owner_, msg.sender, allowance[owner_][msg.sender] - amount_);\n _transfer(owner_, recipient_, amount_);\n return true;\n }\n\n function mint(address _to, uint256 _amount) external {\n _mint(_to, _amount);\n }\n\n function burn(address _to, uint256 _amount) external {\n _burn(_to, _amount);\n }\n\n function updateFee(uint256 _fee) external {\n fee = _fee;\n }\n\n /**************************/\n /*** Internal Functions ***/\n /**************************/\n\n function _approve(address owner_, address spender_, uint256 amount_) internal {\n emit Approval(owner_, spender_, allowance[owner_][spender_] = amount_);\n }\n\n function _transfer(address owner_, address recipient_, uint256 amount_) internal {\n uint256 feeAmount = fee > 0 ? (amount_ * fee) / 1e18 : 0;\n balanceOf[owner_] -= amount_;\n balanceOf[recipient_] += amount_ - feeAmount;\n\n if (feeAmount > 0) {\n balanceOf[address(0)] = feeAmount;\n }\n\n emit Transfer(owner_, recipient_, amount_);\n }\n\n function _mint(address recipient_, uint256 amount_) internal {\n totalSupply += amount_;\n balanceOf[recipient_] += amount_;\n\n emit Transfer(address(0), recipient_, amount_);\n }\n\n function _burn(address owner_, uint256 amount_) internal {\n balanceOf[owner_] -= amount_;\n totalSupply -= amount_;\n\n emit Transfer(owner_, address(0), amount_);\n }\n}\n" + }, + "contracts/mock/MasterOracleMock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"../dependencies/openzeppelin/token/ERC20/extensions/IERC20Metadata.sol\";\nimport \"../interfaces/external/IMasterOracle.sol\";\n\ncontract MasterOracleMock is IMasterOracle {\n mapping(address => uint256) public prices;\n\n function updatePrice(address _asset, uint256 _price) external {\n prices[_asset] = _price;\n }\n\n function quoteTokenToUsd(address _asset, uint256 _amount) public view override returns (uint256 _amountInUsd) {\n _amountInUsd = (_amount * prices[_asset]) / 10 ** IERC20Metadata(address(_asset)).decimals();\n }\n\n function quoteUsdToToken(address _asset, uint256 _amountInUsd) public view override returns (uint256 _amount) {\n _amount = (_amountInUsd * 10 ** IERC20Metadata(address(_asset)).decimals()) / prices[_asset];\n }\n\n function quote(\n address _assetIn,\n address _assetOut,\n uint256 _amountIn\n ) public view override returns (uint256 _amountOut) {\n uint256 _amountInUsd = quoteTokenToUsd(_assetIn, _amountIn);\n _amountOut = quoteUsdToToken(_assetOut, _amountInUsd);\n }\n}\n" + }, + "contracts/mock/PauseableMock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"../utils/Pauseable.sol\";\n\ncontract PauseableMock is Pauseable {}\n" + }, + "contracts/mock/PoolMock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\n// solhint-disable no-unused-vars\n// solhint-disable avoid-low-level-calls\n// solhint-disable use-forbidden-name\n// solhint-disable no-empty-blocks\n\npragma solidity 0.8.9;\n\nimport \"../lib/WadRayMath.sol\";\nimport \"../utils/Pauseable.sol\";\nimport \"../interfaces/IPool.sol\";\nimport \"../interfaces/IFeeProvider.sol\";\nimport \"../access/Governable.sol\";\n\ncontract PoolMock is IPool, Governable, Pauseable {\n using WadRayMath for uint256;\n\n ITreasury public treasury;\n ISyntheticToken public syntheticToken;\n IDebtToken public debtToken;\n IDepositToken public depositToken;\n IMasterOracle public masterOracle;\n IPoolRegistry public poolRegistry;\n IFeeProvider public feeProvider;\n ISmartFarmingManager public smartFarmingManager;\n uint256 public debtFloorInUsd;\n uint256 public maxLiquidable;\n bool public isSwapActive;\n\n constructor(\n IDepositToken _depositToken,\n IMasterOracle _masterOracle,\n ISyntheticToken _syntheticToken,\n IDebtToken _debtToken,\n IPoolRegistry _poolRegistry,\n IFeeProvider _feeProvider\n ) {\n depositToken = _depositToken;\n masterOracle = _masterOracle;\n syntheticToken = _syntheticToken;\n debtToken = _debtToken;\n poolRegistry = _poolRegistry;\n feeProvider = _feeProvider;\n }\n\n function feeCollector() external view returns (address) {\n return poolRegistry.feeCollector();\n }\n\n function getDepositTokens() external pure override returns (address[] memory) {\n revert(\"mock-does-not-implement\");\n }\n\n function getDebtTokens() external pure override returns (address[] memory) {\n revert(\"mock-does-not-implement\");\n }\n\n function debtOf(address _account) public view override returns (uint256 _debtInUsd) {\n if (address(syntheticToken) != address(0)) {\n uint256 _debtBalance = debtToken.balanceOf(_account);\n return masterOracle.quoteTokenToUsd(address(syntheticToken), _debtBalance);\n }\n }\n\n function depositOf(address) external pure override returns (uint256, uint256) {\n revert(\"mock-does-not-implement\");\n }\n\n function debtPositionOf(\n address _account\n )\n public\n view\n override\n returns (\n bool _isHealthy,\n uint256 _depositInUsd,\n uint256 _debtInUsd,\n uint256 _issuableLimitInUsd,\n uint256 _issuableInUsd\n )\n {\n _isHealthy = true;\n uint256 _deposit = depositToken.balanceOf(_account);\n _depositInUsd = masterOracle.quoteTokenToUsd(address(depositToken.underlying()), _deposit);\n _debtInUsd = debtOf(_account);\n _issuableLimitInUsd = _depositInUsd.wadMul(depositToken.collateralFactor());\n _issuableInUsd = _debtInUsd < _issuableLimitInUsd ? _issuableLimitInUsd - _debtInUsd : 0;\n }\n\n function liquidate(\n ISyntheticToken,\n address,\n uint256,\n IDepositToken\n ) external pure override returns (uint256, uint256, uint256) {\n revert(\"mock-does-not-implement\");\n }\n\n function quoteLiquidateIn(\n ISyntheticToken,\n uint256,\n IDepositToken\n ) external pure returns (uint256, uint256, uint256) {\n revert(\"mock-does-not-implement\");\n }\n\n function quoteLiquidateMax(ISyntheticToken, address, IDepositToken) external pure returns (uint256) {\n revert(\"mock-does-not-implement\");\n }\n\n function quoteLiquidateOut(\n ISyntheticToken,\n uint256,\n IDepositToken\n ) external pure returns (uint256, uint256, uint256) {\n revert(\"mock-does-not-implement\");\n }\n\n function quoteSwapIn(ISyntheticToken, ISyntheticToken, uint256) external pure override returns (uint256, uint256) {\n revert(\"mock-does-not-implement\");\n }\n\n function quoteSwapOut(ISyntheticToken, ISyntheticToken, uint256) public pure override returns (uint256, uint256) {\n revert(\"mock-does-not-implement\");\n }\n\n function swap(ISyntheticToken, ISyntheticToken, uint256) external pure override returns (uint256, uint256) {\n revert(\"mock-does-not-implement\");\n }\n\n function updateDebtFloor(uint256 _newDebtFloorInUsd) external {\n debtFloorInUsd = _newDebtFloorInUsd;\n }\n\n function doesSyntheticTokenExist(ISyntheticToken _syntheticToken) external view override returns (bool) {\n return address(_syntheticToken) == address(syntheticToken);\n }\n\n function doesDebtTokenExist(IDebtToken) external pure returns (bool) {\n return true;\n }\n\n function doesDepositTokenExist(IDepositToken) external pure override returns (bool) {\n return true;\n }\n\n function updateTreasury(ITreasury _treasury) external {\n treasury = _treasury;\n }\n\n function debtTokenOf(ISyntheticToken) external view override returns (IDebtToken) {\n return debtToken;\n }\n\n function depositTokenOf(IERC20) external view override returns (IDepositToken) {\n return depositToken;\n }\n\n function addToDepositTokensOfAccount(address) external pure override {}\n\n function removeFromDepositTokensOfAccount(address) external pure override {}\n\n function addToDebtTokensOfAccount(address) external pure override {}\n\n function removeFromDebtTokensOfAccount(address) external pure override {}\n\n function getDepositTokensOfAccount(address) external pure override returns (address[] memory) {\n revert(\"mock-does-not-implement\");\n }\n\n function getDebtTokensOfAccount(address) external pure override returns (address[] memory) {\n revert(\"mock-does-not-implement\");\n }\n\n function getRewardsDistributors() external pure override returns (address[] memory _rewardsDistributors) {}\n}\n" + }, + "contracts/mock/PoolRewardsMock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"../dependencies/openzeppelin/token/ERC20/IERC20.sol\";\n\ncontract PoolRewardsMock {\n address[] public rewardTokens;\n\n function updateReward(address) external {}\n\n function getRewardTokens() external view returns (address[] memory) {\n return rewardTokens;\n }\n\n function claimReward(address) external {\n for (uint256 i; i < rewardTokens.length; ++i) {\n uint256 _balance = IERC20(rewardTokens[i]).balanceOf(address(this));\n if (_balance > 0) {\n IERC20(rewardTokens[i]).transfer(msg.sender, _balance);\n }\n }\n }\n\n function setRewardTokens(address[] memory rewardTokens_) external {\n rewardTokens = rewardTokens_;\n }\n}\n" + }, + "contracts/mock/SwapperMock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"../dependencies/openzeppelin/token/ERC20/IERC20.sol\";\nimport \"../interfaces/external/IMasterOracle.sol\";\nimport \"../interfaces/external/ISwapper.sol\";\n\ncontract SwapperMock is ISwapper {\n uint256 public rate = 1e18;\n IMasterOracle masterOracle;\n\n constructor(IMasterOracle masterOracle_) {\n masterOracle = masterOracle_;\n }\n\n function swapExactInput(\n address tokenIn_,\n address tokenOut_,\n uint256 amountIn_,\n uint256 amountOutMin_,\n address receiver_\n ) external returns (uint256 _amountOut) {\n IERC20(tokenIn_).transferFrom(msg.sender, address(this), amountIn_);\n _amountOut = (masterOracle.quote(tokenIn_, tokenOut_, amountIn_) * rate) / 1e18;\n require(_amountOut >= amountOutMin_, \"swapper-mock-slippage\");\n require(_amountOut > 100, \"amount-out-zero\");\n IERC20(tokenOut_).transfer(receiver_, _amountOut);\n }\n\n function updateRate(uint256 rate_) external {\n rate = rate_;\n }\n}\n" + }, + "contracts/mock/TokenHolderMock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"../utils/TokenHolder.sol\";\n\ncontract TokenHolderMock is TokenHolder {\n address public sweeper;\n bool public acceptETH;\n\n constructor(address _sweeper) {\n sweeper = _sweeper;\n }\n\n function _requireCanSweep() internal view override {\n require(msg.sender == sweeper, \"not-sweeper\");\n }\n\n function toggleAcceptETH() public {\n acceptETH = !acceptETH;\n }\n\n receive() external payable override {\n require(acceptETH, \"not-allowed-to-receive-eth\");\n }\n}\n" + }, + "contracts/mock/TokenOracleMock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"../dependencies/openzeppelin/token/ERC20/extensions/IERC20Metadata.sol\";\n\ncontract TokenOracleMock {\n mapping(address => uint256) public prices;\n\n function updatePrice(address token_, uint256 price_) external {\n prices[token_] = price_;\n }\n\n function getPriceInUsd(address token_) external view returns (uint256 _priceInUsd) {\n return prices[token_];\n }\n}\n" + }, + "contracts/mock/VPoolMock.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"../dependencies/openzeppelin/token/ERC20/ERC20.sol\";\nimport \"../interfaces/external/IVPool.sol\";\n\ncontract VPoolMock is IVPool, ERC20 {\n address public token;\n\n constructor(string memory name_, string memory symbol_, address token_) ERC20(name_, symbol_) {\n token = token_;\n }\n\n function deposit(uint256 amount_) external {\n IERC20(token).transferFrom(msg.sender, address(this), amount_);\n _mint(msg.sender, amount_ * (10 ** (decimals() - IERC20Metadata(token).decimals())));\n }\n\n function withdraw(uint256 shares_) external {\n _burn(msg.sender, shares_);\n IERC20(token).transfer(msg.sender, shares_ / (10 ** (decimals() - IERC20Metadata(token).decimals())));\n }\n\n function mint(address to_, uint256 amount_) external {\n _mint(to_, amount_);\n }\n\n function poolRewards() external pure returns (address) {\n revert(\"mock-does-not-implement\");\n }\n}\n" + }, + "contracts/NativeTokenGateway.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"./utils/ReentrancyGuard.sol\";\nimport \"./utils/TokenHolder.sol\";\nimport \"./interfaces/external/IWETH.sol\";\nimport \"./interfaces/INativeTokenGateway.sol\";\nimport \"./interfaces/IDepositToken.sol\";\n\nerror SenderIsNotGovernor();\nerror SenderIsNotNativeToken();\nerror UnregisteredPool();\n\n/**\n * @title Helper contract to easily support native tokens (e.g. ETH/AVAX) as collateral\n */\ncontract NativeTokenGateway is ReentrancyGuard, TokenHolder, INativeTokenGateway {\n using SafeERC20 for IERC20;\n using SafeERC20 for IWETH;\n using SafeERC20 for IDepositToken;\n\n IPoolRegistry public immutable poolRegistry;\n IWETH public immutable nativeToken;\n\n modifier onlyGovernor() {\n if (poolRegistry.governor() != msg.sender) revert SenderIsNotGovernor();\n _;\n }\n\n constructor(IPoolRegistry poolRegistry_, IWETH nativeToken_) initializer {\n // Note: `NativeTokenGateway` isn't upgradable but extends `ReentrancyGuard` therefore we need to initialize it\n __ReentrancyGuard_init();\n poolRegistry = poolRegistry_;\n nativeToken = nativeToken_;\n }\n\n /**\n * @notice deposits NATIVE_TOKEN as collateral using native. A corresponding amount of the deposit token is minted.\n * @param pool_ The Pool contract\n */\n function deposit(IPool pool_) external payable override {\n if (!poolRegistry.isPoolRegistered(address(pool_))) revert UnregisteredPool();\n\n nativeToken.deposit{value: msg.value}();\n IDepositToken _depositToken = pool_.depositTokenOf(nativeToken);\n nativeToken.safeApprove(address(_depositToken), 0);\n nativeToken.safeApprove(address(_depositToken), msg.value);\n _depositToken.deposit(msg.value, msg.sender);\n }\n\n /**\n * @notice withdraws the NATIVE_TOKEN deposit of msg.sender.\n * @param pool_ The Pool contract\n * @param amount_ The amount of deposit tokens to withdraw and receive native ETH\n */\n function withdraw(IPool pool_, uint256 amount_) external override nonReentrant {\n if (!poolRegistry.isPoolRegistered(address(pool_))) revert UnregisteredPool();\n\n IDepositToken _depositToken = pool_.depositTokenOf(nativeToken);\n _depositToken.safeTransferFrom(msg.sender, address(this), amount_);\n (uint256 _withdrawn, ) = _depositToken.withdraw(amount_, address(this));\n nativeToken.withdraw(_withdrawn);\n Address.sendValue(payable(msg.sender), _withdrawn);\n }\n\n /// @inheritdoc TokenHolder\n // solhint-disable-next-line no-empty-blocks\n function _requireCanSweep() internal view override onlyGovernor {}\n\n /**\n * @dev Only `nativeToken` contract is allowed to transfer to here. Prevent other addresses to send coins to this contract.\n */\n receive() external payable override {\n if (msg.sender != address(nativeToken)) revert SenderIsNotNativeToken();\n }\n}\n" + }, + "contracts/Pool.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"./utils/ReentrancyGuard.sol\";\nimport \"./storage/PoolStorage.sol\";\nimport \"./lib/WadRayMath.sol\";\nimport \"./utils/Pauseable.sol\";\n\nerror SyntheticDoesNotExist();\nerror SenderIsNotDebtToken();\nerror SenderIsNotDepositToken();\nerror UserReachedMaxTokens();\nerror PoolRegistryIsNull();\nerror DebtTokenAlreadyExists();\nerror DepositTokenAlreadyExists();\nerror AmountIsZero();\nerror CanNotLiquidateOwnPosition();\nerror PositionIsHealthy();\nerror AmountGreaterThanMaxLiquidable();\nerror RemainingDebtIsLowerThanTheFloor();\nerror AmountIsTooHigh();\nerror DebtTokenDoesNotExist();\nerror DepositTokenDoesNotExist();\nerror SwapFeatureIsInactive();\nerror AmountInIsInvalid();\nerror AddressIsNull();\nerror SyntheticIsNull();\nerror SyntheticIsInUse();\nerror UnderlyingAssetInUse();\nerror ReachedMaxDepositTokens();\nerror RewardDistributorAlreadyExists();\nerror RewardDistributorDoesNotExist();\nerror TotalSupplyIsNotZero();\nerror NewValueIsSameAsCurrent();\nerror MaxLiquidableTooHigh();\n\n/**\n * @title Pool contract\n */\ncontract Pool is ReentrancyGuard, Pauseable, PoolStorageV4 {\n using SafeERC20 for IERC20;\n using SafeERC20 for ISyntheticToken;\n using WadRayMath for uint256;\n using EnumerableSet for EnumerableSet.AddressSet;\n using MappedEnumerableSet for MappedEnumerableSet.AddressSet;\n\n string public constant VERSION = \"1.3.0\";\n\n /**\n * @notice Maximum tokens per pool a user may have\n */\n uint256 public constant MAX_TOKENS_PER_USER = 30;\n\n /// @notice Emitted when flag for pause bridge transfer is toggled\n event BridgingIsActiveUpdated(bool newIsActive);\n\n /// @notice Emitted when protocol liquidation fee is updated\n event DebtFloorUpdated(uint256 oldDebtFloorInUsd, uint256 newDebtFloorInUsd);\n\n /// @notice Emitted when debt token is enabled\n event DebtTokenAdded(IDebtToken indexed debtToken);\n\n /// @notice Emitted when debt token is disabled\n event DebtTokenRemoved(IDebtToken indexed debtToken);\n\n /// @notice Emitted when deposit token is enabled\n event DepositTokenAdded(address indexed depositToken);\n\n /// @notice Emitted when deposit token is disabled\n event DepositTokenRemoved(IDepositToken indexed depositToken);\n\n /// @notice Emitted when fee provider contract is updated\n event FeeProviderUpdated(IFeeProvider indexed oldFeeProvider, IFeeProvider indexed newFeeProvider);\n\n /// @notice Emitted when maxLiquidable (liquidation cap) is updated\n event MaxLiquidableUpdated(uint256 oldMaxLiquidable, uint256 newMaxLiquidable);\n\n /// @notice Emitted when a position is liquidated\n event PositionLiquidated(\n address indexed liquidator,\n address indexed account,\n ISyntheticToken indexed syntheticToken,\n uint256 amountRepaid,\n uint256 depositSeized,\n uint256 fee\n );\n\n /// @notice Emitted when rewards distributor contract is added\n event RewardsDistributorAdded(IRewardsDistributor indexed _distributor);\n\n /// @notice Emitted when rewards distributor contract is removed\n event RewardsDistributorRemoved(IRewardsDistributor _distributor);\n\n /// @notice Emitted when SmartFarmingManager contract is updated\n event SmartFarmingManagerUpdated(\n ISmartFarmingManager oldSmartFarmingManager,\n ISmartFarmingManager newSmartFarmingManager\n );\n\n /// @notice Emitted when the swap active flag is updated\n event SwapActiveUpdated(bool newActive);\n\n /// @notice Emitted when synthetic token is swapped\n event SyntheticTokenSwapped(\n address indexed account,\n ISyntheticToken indexed syntheticTokenIn,\n ISyntheticToken indexed syntheticTokenOut,\n uint256 amountIn,\n uint256 amountOut,\n uint256 fee\n );\n\n /// @notice Emitted when treasury contract is updated\n event TreasuryUpdated(ITreasury indexed oldTreasury, ITreasury indexed newTreasury);\n\n /**\n * @dev Throws if token addition will reach the `account_`'s max\n */\n modifier onlyIfAdditionWillNotReachMaxTokens(address account_) {\n if (debtTokensOfAccount.length(account_) + depositTokensOfAccount.length(account_) >= MAX_TOKENS_PER_USER) {\n revert UserReachedMaxTokens();\n }\n _;\n }\n\n /**\n * @dev Throws if deposit token doesn't exist\n */\n modifier onlyIfDepositTokenExists(IDepositToken depositToken_) {\n if (!doesDepositTokenExist(depositToken_)) revert DepositTokenDoesNotExist();\n _;\n }\n\n /**\n * @dev Throws if synthetic token doesn't exist\n */\n modifier onlyIfSyntheticTokenExists(ISyntheticToken syntheticToken_) {\n if (!doesSyntheticTokenExist(syntheticToken_)) revert SyntheticDoesNotExist();\n _;\n }\n\n /**\n * @dev Throws if `msg.sender` isn't a debt token\n */\n modifier onlyIfMsgSenderIsDebtToken() {\n if (!doesDebtTokenExist(IDebtToken(msg.sender))) revert SenderIsNotDebtToken();\n _;\n }\n\n /**\n * @dev Throws if `msg.sender` isn't a deposit token\n */\n modifier onlyIfMsgSenderIsDepositToken() {\n if (!doesDepositTokenExist(IDepositToken(msg.sender))) revert SenderIsNotDepositToken();\n _;\n }\n\n constructor() {\n _disableInitializers();\n }\n\n function initialize(IPoolRegistry poolRegistry_) public initializer {\n if (address(poolRegistry_) == address(0)) revert PoolRegistryIsNull();\n __ReentrancyGuard_init();\n __Pauseable_init();\n\n poolRegistry = poolRegistry_;\n isSwapActive = true;\n maxLiquidable = 0.5e18; // 50%\n }\n\n /**\n * @notice Add a debt token to the per-account list\n * @dev This function is called from `DebtToken` when user's balance changes from `0`\n * @dev The caller should ensure to not pass `address(0)` as `_account`\n * @param account_ The account address\n */\n function addToDebtTokensOfAccount(\n address account_\n ) external onlyIfMsgSenderIsDebtToken onlyIfAdditionWillNotReachMaxTokens(account_) {\n if (!debtTokensOfAccount.add(account_, msg.sender)) revert DebtTokenAlreadyExists();\n }\n\n /**\n * @notice Add a deposit token to the per-account list\n * @dev This function is called from `DepositToken` when user's balance changes from `0`\n * @dev The caller should ensure to not pass `address(0)` as `_account`\n * @param account_ The account address\n */\n function addToDepositTokensOfAccount(\n address account_\n ) external onlyIfMsgSenderIsDepositToken onlyIfAdditionWillNotReachMaxTokens(account_) {\n if (!depositTokensOfAccount.add(account_, msg.sender)) revert DepositTokenAlreadyExists();\n }\n\n /**\n * @notice Get account's debt by querying latest prices from oracles\n * @param account_ The account to check\n * @return _debtInUsd The debt value in USD\n */\n function debtOf(address account_) public view override returns (uint256 _debtInUsd) {\n IMasterOracle _masterOracle = masterOracle();\n uint256 _length = debtTokensOfAccount.length(account_);\n for (uint256 i; i < _length; ++i) {\n IDebtToken _debtToken = IDebtToken(debtTokensOfAccount.at(account_, i));\n _debtInUsd += _masterOracle.quoteTokenToUsd(\n address(_debtToken.syntheticToken()),\n _debtToken.balanceOf(account_)\n );\n }\n }\n\n /**\n * @notice Returns whether the debt position from an account is healthy\n * @param account_ The account to check\n * @return _isHealthy Whether the account's position is healthy\n * @return _depositInUsd The total collateral deposited in USD\n * @return _debtInUsd The total debt in USD\n * @return _issuableLimitInUsd The max amount of debt (is USD) that can be created (considering collateral factors)\n * @return _issuableInUsd The amount of debt (is USD) that is free (i.e. can be used to issue synthetic tokens)\n */\n function debtPositionOf(\n address account_\n )\n public\n view\n override\n returns (\n bool _isHealthy,\n uint256 _depositInUsd,\n uint256 _debtInUsd,\n uint256 _issuableLimitInUsd,\n uint256 _issuableInUsd\n )\n {\n _debtInUsd = debtOf(account_);\n (_depositInUsd, _issuableLimitInUsd) = depositOf(account_);\n _isHealthy = _debtInUsd <= _issuableLimitInUsd;\n _issuableInUsd = _debtInUsd < _issuableLimitInUsd ? _issuableLimitInUsd - _debtInUsd : 0;\n }\n\n /**\n * @notice Get account's total collateral deposited by querying latest prices from oracles\n * @param account_ The account to check\n * @return _depositInUsd The total deposit value in USD among all collaterals\n * @return _issuableLimitInUsd The max value in USD that can be used to issue synthetic tokens\n */\n function depositOf(\n address account_\n ) public view override returns (uint256 _depositInUsd, uint256 _issuableLimitInUsd) {\n IMasterOracle _masterOracle = masterOracle();\n uint256 _length = depositTokensOfAccount.length(account_);\n for (uint256 i; i < _length; ++i) {\n IDepositToken _depositToken = IDepositToken(depositTokensOfAccount.at(account_, i));\n uint256 _amountInUsd = _masterOracle.quoteTokenToUsd(\n address(_depositToken.underlying()),\n _depositToken.balanceOf(account_)\n );\n _depositInUsd += _amountInUsd;\n _issuableLimitInUsd += _amountInUsd.wadMul(_depositToken.collateralFactor());\n }\n }\n\n /**\n * @inheritdoc Pauseable\n */\n function everythingStopped() public view override(IPauseable, Pauseable) returns (bool) {\n return super.everythingStopped() || poolRegistry.everythingStopped();\n }\n\n /**\n * @notice Returns fee collector address\n */\n function feeCollector() external view override returns (address) {\n return poolRegistry.feeCollector();\n }\n\n /**\n * @notice Get all debt tokens\n * @dev WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees.\n */\n function getDebtTokens() external view override returns (address[] memory) {\n return debtTokens.values();\n }\n\n /**\n * @notice Get all debt tokens\n * @dev WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees.\n */\n function getDebtTokensOfAccount(address account_) external view override returns (address[] memory) {\n return debtTokensOfAccount.values(account_);\n }\n\n /**\n * @notice Get all deposit tokens\n * @dev WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees.\n */\n function getDepositTokens() external view override returns (address[] memory) {\n return depositTokens.values();\n }\n\n /**\n * @notice Get deposit tokens of an account\n * @dev WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees.\n */\n function getDepositTokensOfAccount(address account_) external view override returns (address[] memory) {\n return depositTokensOfAccount.values(account_);\n }\n\n /**\n * @notice Get all rewards distributors\n */\n function getRewardsDistributors() external view override returns (address[] memory) {\n return rewardsDistributors.values();\n }\n\n /**\n * @notice Check if token is part of the debt offerings\n * @param debtToken_ Asset to check\n * @return true if exist\n */\n function doesDebtTokenExist(IDebtToken debtToken_) public view override returns (bool) {\n return debtTokens.contains(address(debtToken_));\n }\n\n /**\n * @notice Check if collateral is supported\n * @param depositToken_ Asset to check\n * @return true if exist\n */\n function doesDepositTokenExist(IDepositToken depositToken_) public view override returns (bool) {\n return depositTokens.contains(address(depositToken_));\n }\n\n /**\n * @notice Check if token is part of the synthetic offerings\n * @param syntheticToken_ Asset to check\n * @return true if exist\n */\n function doesSyntheticTokenExist(ISyntheticToken syntheticToken_) public view override returns (bool) {\n return address(debtTokenOf[syntheticToken_]) != address(0);\n }\n\n /**\n * @notice Quote synth `_amountToRepay` in order to seize `totalToSeized_`\n * @param syntheticToken_ Synth for repayment\n * @param totalToSeize_ Collateral total amount to size\n * @param depositToken_ Collateral's deposit token\n * @return _amountToRepay Synth amount to burn\n * @return _toLiquidator Seized amount to the liquidator\n * @return _fee The fee amount to collect\n */\n function quoteLiquidateIn(\n ISyntheticToken syntheticToken_,\n uint256 totalToSeize_,\n IDepositToken depositToken_\n ) public view override returns (uint256 _amountToRepay, uint256 _toLiquidator, uint256 _fee) {\n (uint128 _liquidatorIncentive, uint128 _protocolFee) = feeProvider.liquidationFees();\n uint256 _totalFees = _protocolFee + _liquidatorIncentive;\n uint256 _repayAmountInCollateral = totalToSeize_;\n\n if (_totalFees > 0) {\n _repayAmountInCollateral = _repayAmountInCollateral.wadDiv(1e18 + _totalFees);\n }\n\n _amountToRepay = masterOracle().quote(\n address(depositToken_.underlying()),\n address(syntheticToken_),\n _repayAmountInCollateral\n );\n\n if (_protocolFee > 0) {\n _fee = _repayAmountInCollateral.wadMul(_protocolFee);\n }\n\n if (_liquidatorIncentive > 0) {\n _toLiquidator = _repayAmountInCollateral.wadMul(1e18 + _liquidatorIncentive);\n }\n }\n\n /**\n * @notice Quote max allowed synth to repay\n * @dev I.e. Considers the min amount between collateral's balance and `maxLiquidable` param\n * @param syntheticToken_ Synth for repayment\n * @param account_ The account to liquidate\n * @param depositToken_ Collateral's deposit token\n * @return _maxAmountToRepay Synth amount to burn\n */\n function quoteLiquidateMax(\n ISyntheticToken syntheticToken_,\n address account_,\n IDepositToken depositToken_\n ) external view override returns (uint256 _maxAmountToRepay) {\n (bool _isHealthy, , , , ) = debtPositionOf(account_);\n if (_isHealthy) {\n return 0;\n }\n\n (uint256 _amountToRepay, , ) = quoteLiquidateIn(\n syntheticToken_,\n depositToken_.balanceOf(account_),\n depositToken_\n );\n\n _maxAmountToRepay = debtTokenOf[syntheticToken_].balanceOf(account_).wadMul(maxLiquidable);\n\n if (_amountToRepay < _maxAmountToRepay) {\n _maxAmountToRepay = _amountToRepay;\n }\n }\n\n /**\n * @notice Quote collateral `totalToSeized_` by repaying `amountToRepay_`\n * @param syntheticToken_ Synth for repayment\n * @param amountToRepay_ Synth amount to burn\n * @param depositToken_ Collateral's deposit token\n * @return _totalToSeize Collateral total amount to size\n * @return _toLiquidator Seized amount to the liquidator\n * @return _fee The fee amount to collect\n */\n function quoteLiquidateOut(\n ISyntheticToken syntheticToken_,\n uint256 amountToRepay_,\n IDepositToken depositToken_\n ) public view override returns (uint256 _totalToSeize, uint256 _toLiquidator, uint256 _fee) {\n _toLiquidator = masterOracle().quote(\n address(syntheticToken_),\n address(depositToken_.underlying()),\n amountToRepay_\n );\n\n (uint128 _liquidatorIncentive, uint128 _protocolFee) = feeProvider.liquidationFees();\n\n if (_protocolFee > 0) {\n _fee = _toLiquidator.wadMul(_protocolFee);\n }\n if (_liquidatorIncentive > 0) {\n _toLiquidator += _toLiquidator.wadMul(_liquidatorIncentive);\n }\n\n _totalToSeize = _fee + _toLiquidator;\n }\n\n /**\n * @notice Quote `_amountIn` to get `amountOut_`\n * @param syntheticTokenIn_ Synth in\n * @param syntheticTokenOut_ Synth out\n * @param amountOut_ Amount out\n * @return _amountIn Amount in\n * @return _fee Fee to charge in `syntheticTokenOut_`\n */\n function quoteSwapIn(\n ISyntheticToken syntheticTokenIn_,\n ISyntheticToken syntheticTokenOut_,\n uint256 amountOut_\n ) external view override returns (uint256 _amountIn, uint256 _fee) {\n uint256 _swapFee = feeProvider.swapFeeFor(msg.sender);\n if (_swapFee > 0) {\n amountOut_ = amountOut_.wadDiv(1e18 - _swapFee);\n _fee = amountOut_.wadMul(_swapFee);\n }\n\n _amountIn = poolRegistry.masterOracle().quote(\n address(syntheticTokenOut_),\n address(syntheticTokenIn_),\n amountOut_\n );\n }\n\n /**\n * @notice Quote `amountOut_` get from `amountIn_`\n * @param syntheticTokenIn_ Synth in\n * @param syntheticTokenOut_ Synth out\n * @param amountIn_ Amount in\n * @return _amountOut Amount out\n * @return _fee Fee to charge in `syntheticTokenOut_`\n */\n function quoteSwapOut(\n ISyntheticToken syntheticTokenIn_,\n ISyntheticToken syntheticTokenOut_,\n uint256 amountIn_\n ) public view override returns (uint256 _amountOut, uint256 _fee) {\n _amountOut = poolRegistry.masterOracle().quote(\n address(syntheticTokenIn_),\n address(syntheticTokenOut_),\n amountIn_\n );\n\n uint256 _swapFee = feeProvider.swapFeeFor(msg.sender);\n if (_swapFee > 0) {\n _fee = _amountOut.wadMul(_swapFee);\n _amountOut -= _fee;\n }\n }\n\n /**\n * @notice Burn synthetic token, unlock deposit token and send liquidator incentive\n * @param syntheticToken_ The msAsset to use for repayment\n * @param account_ The account with an unhealthy position\n * @param amountToRepay_ The amount to repay in synthetic token\n * @param depositToken_ The collateral to seize from\n * @return _totalSeized Total deposit amount seized from the liquidated account\n * @return _toLiquidator Share of `_totalSeized` sent to the liquidator\n * @return _fee Share of `_totalSeized` collected as fee\n */\n function liquidate(\n ISyntheticToken syntheticToken_,\n address account_,\n uint256 amountToRepay_,\n IDepositToken depositToken_\n )\n external\n override\n whenNotShutdown\n nonReentrant\n onlyIfSyntheticTokenExists(syntheticToken_)\n onlyIfDepositTokenExists(depositToken_)\n returns (uint256 _totalSeized, uint256 _toLiquidator, uint256 _fee)\n {\n if (amountToRepay_ == 0) revert AmountIsZero();\n if (msg.sender == account_) revert CanNotLiquidateOwnPosition();\n\n IDebtToken _debtToken = debtTokenOf[syntheticToken_];\n _debtToken.accrueInterest();\n\n (bool _isHealthy, , , , ) = debtPositionOf(account_);\n\n if (_isHealthy) {\n revert PositionIsHealthy();\n }\n\n uint256 _debtTokenBalance = _debtToken.balanceOf(account_);\n\n if (amountToRepay_.wadDiv(_debtTokenBalance) > maxLiquidable) {\n revert AmountGreaterThanMaxLiquidable();\n }\n\n IMasterOracle _masterOracle = masterOracle();\n\n if (debtFloorInUsd > 0) {\n uint256 _newDebtInUsd = _masterOracle.quoteTokenToUsd(\n address(syntheticToken_),\n _debtTokenBalance - amountToRepay_\n );\n if (_newDebtInUsd > 0 && _newDebtInUsd < debtFloorInUsd) {\n revert RemainingDebtIsLowerThanTheFloor();\n }\n }\n\n (_totalSeized, _toLiquidator, _fee) = quoteLiquidateOut(syntheticToken_, amountToRepay_, depositToken_);\n\n if (_totalSeized > depositToken_.balanceOf(account_)) {\n revert AmountIsTooHigh();\n }\n\n syntheticToken_.burn(msg.sender, amountToRepay_);\n _debtToken.burn(account_, amountToRepay_);\n depositToken_.seize(account_, msg.sender, _toLiquidator);\n\n if (_fee > 0) {\n depositToken_.seize(account_, poolRegistry.feeCollector(), _fee);\n }\n\n emit PositionLiquidated(msg.sender, account_, syntheticToken_, amountToRepay_, _totalSeized, _fee);\n }\n\n /**\n * @notice Get MasterOracle contract\n */\n function masterOracle() public view override returns (IMasterOracle) {\n return poolRegistry.masterOracle();\n }\n\n /**\n * @inheritdoc Pauseable\n */\n function paused() public view override(IPauseable, Pauseable) returns (bool) {\n return super.paused() || poolRegistry.paused();\n }\n\n /**\n * @notice Remove a debt token from the per-account list\n * @dev This function is called from `DebtToken` when user's balance changes to `0`\n * @dev The caller should ensure to not pass `address(0)` as `_account`\n * @param account_ The account address\n */\n function removeFromDebtTokensOfAccount(address account_) external onlyIfMsgSenderIsDebtToken {\n if (!debtTokensOfAccount.remove(account_, msg.sender)) revert DebtTokenDoesNotExist();\n }\n\n /**\n * @notice Remove a deposit token from the per-account list\n * @dev This function is called from `DepositToken` when user's balance changes to `0`\n * @dev The caller should ensure to not pass `address(0)` as `_account`\n * @param account_ The account address\n */\n function removeFromDepositTokensOfAccount(address account_) external onlyIfMsgSenderIsDepositToken {\n if (!depositTokensOfAccount.remove(account_, msg.sender)) revert DepositTokenDoesNotExist();\n }\n\n /**\n * @notice Swap synthetic tokens\n * @param syntheticTokenIn_ Synthetic token to sell\n * @param syntheticTokenOut_ Synthetic token to buy\n * @param amountIn_ Amount to swap\n */\n function swap(\n ISyntheticToken syntheticTokenIn_,\n ISyntheticToken syntheticTokenOut_,\n uint256 amountIn_\n )\n external\n override\n whenNotShutdown\n nonReentrant\n onlyIfSyntheticTokenExists(syntheticTokenIn_)\n onlyIfSyntheticTokenExists(syntheticTokenOut_)\n returns (uint256 _amountOut, uint256 _fee)\n {\n if (!isSwapActive) revert SwapFeatureIsInactive();\n if (amountIn_ == 0 || amountIn_ > syntheticTokenIn_.balanceOf(msg.sender)) revert AmountInIsInvalid();\n\n syntheticTokenIn_.burn(msg.sender, amountIn_);\n\n (_amountOut, _fee) = quoteSwapOut(syntheticTokenIn_, syntheticTokenOut_, amountIn_);\n\n if (_fee > 0) {\n syntheticTokenOut_.mint(poolRegistry.feeCollector(), _fee);\n }\n\n syntheticTokenOut_.mint(msg.sender, _amountOut);\n\n emit SyntheticTokenSwapped(msg.sender, syntheticTokenIn_, syntheticTokenOut_, amountIn_, _amountOut, _fee);\n }\n\n /**\n * @notice Add debt token to offerings\n * @dev Must keep `debtTokenOf` mapping updated\n */\n function addDebtToken(IDebtToken debtToken_) external onlyGovernor {\n if (address(debtToken_) == address(0)) revert AddressIsNull();\n ISyntheticToken _syntheticToken = debtToken_.syntheticToken();\n if (address(_syntheticToken) == address(0)) revert SyntheticIsNull();\n if (address(debtTokenOf[_syntheticToken]) != address(0)) revert SyntheticIsInUse();\n\n if (!debtTokens.add(address(debtToken_))) revert DebtTokenAlreadyExists();\n\n debtTokenOf[_syntheticToken] = debtToken_;\n\n emit DebtTokenAdded(debtToken_);\n }\n\n /**\n * @notice Add deposit token (i.e. collateral) to Synth\n */\n function addDepositToken(address depositToken_) external onlyGovernor {\n if (depositToken_ == address(0)) revert AddressIsNull();\n IERC20 _underlying = IDepositToken(depositToken_).underlying();\n if (address(depositTokenOf[_underlying]) != address(0)) revert UnderlyingAssetInUse();\n // Note: Fee collector collects deposit tokens as fee\n if (depositTokens.length() >= MAX_TOKENS_PER_USER) revert ReachedMaxDepositTokens();\n\n if (!depositTokens.add(depositToken_)) revert DepositTokenAlreadyExists();\n\n depositTokenOf[_underlying] = IDepositToken(depositToken_);\n\n emit DepositTokenAdded(depositToken_);\n }\n\n /**\n * @notice Add a RewardsDistributor contract\n */\n function addRewardsDistributor(IRewardsDistributor distributor_) external onlyGovernor {\n if (address(distributor_) == address(0)) revert AddressIsNull();\n if (!rewardsDistributors.add(address(distributor_))) revert RewardDistributorAlreadyExists();\n emit RewardsDistributorAdded(distributor_);\n }\n\n /**\n * @notice Remove debt token from offerings\n * @dev Must keep `debtTokenOf` mapping updated\n */\n function removeDebtToken(IDebtToken debtToken_) external onlyGovernor {\n if (debtToken_.totalSupply() > 0) revert TotalSupplyIsNotZero();\n if (!debtTokens.remove(address(debtToken_))) revert DebtTokenDoesNotExist();\n\n delete debtTokenOf[debtToken_.syntheticToken()];\n\n emit DebtTokenRemoved(debtToken_);\n }\n\n /**\n * @notice Remove deposit token (i.e. collateral) from Synth\n */\n function removeDepositToken(IDepositToken depositToken_) external onlyGovernor {\n if (depositToken_.totalSupply() > 0) revert TotalSupplyIsNotZero();\n\n if (!depositTokens.remove(address(depositToken_))) revert DepositTokenDoesNotExist();\n delete depositTokenOf[depositToken_.underlying()];\n\n emit DepositTokenRemoved(depositToken_);\n }\n\n /**\n * @notice Remove a RewardsDistributor contract\n */\n function removeRewardsDistributor(IRewardsDistributor distributor_) external onlyGovernor {\n if (address(distributor_) == address(0)) revert AddressIsNull();\n if (!rewardsDistributors.remove(address(distributor_))) revert RewardDistributorDoesNotExist();\n\n emit RewardsDistributorRemoved(distributor_);\n }\n\n /**\n * @notice Turn swap on/off\n */\n function toggleIsSwapActive() external onlyGovernor {\n bool _newIsSwapActive = !isSwapActive;\n emit SwapActiveUpdated(_newIsSwapActive);\n isSwapActive = _newIsSwapActive;\n }\n\n /**\n * @notice Update debt floor\n */\n function updateDebtFloor(uint256 newDebtFloorInUsd_) external onlyGovernor {\n uint256 _currentDebtFloorInUsd = debtFloorInUsd;\n if (newDebtFloorInUsd_ == _currentDebtFloorInUsd) revert NewValueIsSameAsCurrent();\n emit DebtFloorUpdated(_currentDebtFloorInUsd, newDebtFloorInUsd_);\n debtFloorInUsd = newDebtFloorInUsd_;\n }\n\n /**\n * @notice Update maxLiquidable (liquidation cap)\n */\n function updateMaxLiquidable(uint256 newMaxLiquidable_) external onlyGovernor {\n if (newMaxLiquidable_ > 1e18) revert MaxLiquidableTooHigh();\n uint256 _currentMaxLiquidable = maxLiquidable;\n if (newMaxLiquidable_ == _currentMaxLiquidable) revert NewValueIsSameAsCurrent();\n emit MaxLiquidableUpdated(_currentMaxLiquidable, newMaxLiquidable_);\n maxLiquidable = newMaxLiquidable_;\n }\n\n /**\n * @notice Update treasury contract - will migrate funds to the new contract\n */\n function updateTreasury(ITreasury newTreasury_) external onlyGovernor {\n if (address(newTreasury_) == address(0)) revert AddressIsNull();\n ITreasury _currentTreasury = treasury;\n if (newTreasury_ == _currentTreasury) revert NewValueIsSameAsCurrent();\n\n if (address(_currentTreasury) != address(0)) {\n _currentTreasury.migrateTo(address(newTreasury_));\n }\n\n emit TreasuryUpdated(_currentTreasury, newTreasury_);\n treasury = newTreasury_;\n }\n\n /**\n * @notice Update FeeProvider contract\n */\n function updateFeeProvider(IFeeProvider feeProvider_) external onlyGovernor {\n if (address(feeProvider_) == address(0)) revert AddressIsNull();\n IFeeProvider _current = feeProvider;\n if (feeProvider_ == _current) revert NewValueIsSameAsCurrent();\n emit FeeProviderUpdated(_current, feeProvider_);\n feeProvider = feeProvider_;\n }\n\n /**\n * @notice Update SmartFarmingManager contract\n */\n function updateSmartFarmingManager(ISmartFarmingManager newSmartFarmingManager_) external onlyGovernor {\n if (address(newSmartFarmingManager_) == address(0)) revert AddressIsNull();\n ISmartFarmingManager _current = smartFarmingManager;\n if (newSmartFarmingManager_ == _current) revert NewValueIsSameAsCurrent();\n\n emit SmartFarmingManagerUpdated(_current, newSmartFarmingManager_);\n smartFarmingManager = newSmartFarmingManager_;\n }\n\n /**\n * @notice Pause/Unpause bridge transfers\n */\n function toggleBridgingIsActive() external onlyGovernor {\n bool _newIsBridgingActive = !isBridgingActive;\n emit BridgingIsActiveUpdated(_newIsBridgingActive);\n isBridgingActive = _newIsBridgingActive;\n }\n}\n" + }, + "contracts/PoolRegistry.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"./utils/ReentrancyGuard.sol\";\nimport \"./lib/WadRayMath.sol\";\nimport \"./storage/PoolRegistryStorage.sol\";\nimport \"./interfaces/IPool.sol\";\nimport \"./utils/Pauseable.sol\";\n\nerror AddressIsNull();\nerror OracleIsNull();\nerror FeeCollectorIsNull();\nerror NativeTokenGatewayIsNull();\nerror AlreadyRegistered();\nerror UnregisteredPool();\nerror NewValueIsSameAsCurrent();\n\n/**\n * @title PoolRegistry contract\n */\ncontract PoolRegistry is ReentrancyGuard, Pauseable, PoolRegistryStorageV3 {\n using WadRayMath for uint256;\n using EnumerableSet for EnumerableSet.AddressSet;\n\n string public constant VERSION = \"1.3.0\";\n\n /// @notice Emitted when fee collector is updated\n event FeeCollectorUpdated(address indexed oldFeeCollector, address indexed newFeeCollector);\n\n /// @notice Emitted when master oracle contract is updated\n event MasterOracleUpdated(IMasterOracle indexed oldOracle, IMasterOracle indexed newOracle);\n\n /// @notice Emitted when native token gateway is updated\n event NativeTokenGatewayUpdated(address indexed oldGateway, address indexed newGateway);\n\n /// @notice Emitted when a pool is registered\n event PoolRegistered(uint256 indexed id, address indexed pool);\n\n /// @notice Emitted when a pool is unregistered\n event PoolUnregistered(uint256 indexed id, address indexed pool);\n\n /// @notice Emitted when Swapper contract is updated\n event SwapperUpdated(ISwapper oldSwapFee, ISwapper newSwapFee);\n\n /// @notice Emitted when Quoter contract is updated\n event QuoterUpdated(IQuoter oldQuoter, IQuoter newQuoter);\n\n /// @notice Emitted when Cross-chain dispatcher contract is updated\n event CrossChainDispatcherUpdated(\n ICrossChainDispatcher oldCrossChainDispatcher,\n ICrossChainDispatcher newCrossChainDispatcher\n );\n\n /// @notice Emitted when flag for pause cross-chain flash repay is toggled\n event CrossChainFlashRepayActiveUpdated(bool newIsActive);\n\n constructor() {\n _disableInitializers();\n }\n\n function initialize(IMasterOracle masterOracle_, address feeCollector_) external initializer {\n if (address(masterOracle_) == address(0)) revert OracleIsNull();\n if (feeCollector_ == address(0)) revert FeeCollectorIsNull();\n\n __ReentrancyGuard_init();\n __Pauseable_init();\n\n masterOracle = masterOracle_;\n feeCollector = feeCollector_;\n\n nextPoolId = 1;\n }\n\n /**\n * @notice Check if any pool has the token as part of its offerings\n * @param syntheticToken_ Asset to check\n * @return _exists Return true if exists\n */\n function doesSyntheticTokenExist(ISyntheticToken syntheticToken_) external view returns (bool _exists) {\n uint256 _length = pools.length();\n for (uint256 i; i < _length; ++i) {\n if (IPool(pools.at(i)).doesSyntheticTokenExist(syntheticToken_)) {\n return true;\n }\n }\n }\n\n /**\n * @notice Get all pools\n * @dev WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees.\n */\n function getPools() external view override returns (address[] memory) {\n return pools.values();\n }\n\n /**\n * @notice Check if pool is registered\n * @param pool_ Pool to check\n * @return true if exists\n */\n function isPoolRegistered(address pool_) external view override returns (bool) {\n return pools.contains(pool_);\n }\n\n /**\n * @notice Register pool\n */\n function registerPool(address pool_) external override onlyGovernor {\n if (pool_ == address(0)) revert AddressIsNull();\n if (!pools.add(pool_)) revert AlreadyRegistered();\n uint256 _id = idOfPool[pool_];\n if (_id == 0) {\n _id = nextPoolId++;\n idOfPool[pool_] = _id;\n }\n emit PoolRegistered(_id, pool_);\n }\n\n /**\n * @notice Unregister pool\n */\n function unregisterPool(address pool_) external override onlyGovernor {\n if (!pools.remove(pool_)) revert UnregisteredPool();\n emit PoolUnregistered(idOfPool[pool_], pool_);\n }\n\n /**\n * @notice Update fee collector\n */\n function updateFeeCollector(address newFeeCollector_) external override onlyGovernor {\n if (newFeeCollector_ == address(0)) revert FeeCollectorIsNull();\n address _currentFeeCollector = feeCollector;\n if (newFeeCollector_ == _currentFeeCollector) revert NewValueIsSameAsCurrent();\n emit FeeCollectorUpdated(_currentFeeCollector, newFeeCollector_);\n feeCollector = newFeeCollector_;\n }\n\n /**\n * @notice Update master oracle contract\n */\n function updateMasterOracle(IMasterOracle newMasterOracle_) external onlyGovernor {\n if (address(newMasterOracle_) == address(0)) revert OracleIsNull();\n IMasterOracle _currentMasterOracle = masterOracle;\n if (newMasterOracle_ == _currentMasterOracle) revert NewValueIsSameAsCurrent();\n emit MasterOracleUpdated(_currentMasterOracle, newMasterOracle_);\n masterOracle = newMasterOracle_;\n }\n\n /**\n * @notice Update native token gateway\n */\n function updateNativeTokenGateway(address newGateway_) external onlyGovernor {\n if (address(newGateway_) == address(0)) revert NativeTokenGatewayIsNull();\n address _currentGateway = nativeTokenGateway;\n if (newGateway_ == _currentGateway) revert NewValueIsSameAsCurrent();\n emit NativeTokenGatewayUpdated(_currentGateway, newGateway_);\n nativeTokenGateway = newGateway_;\n }\n\n /**\n * @notice Update Swapper contract\n */\n function updateSwapper(ISwapper newSwapper_) external onlyGovernor {\n if (address(newSwapper_) == address(0)) revert AddressIsNull();\n ISwapper _currentSwapper = swapper;\n if (newSwapper_ == _currentSwapper) revert NewValueIsSameAsCurrent();\n\n emit SwapperUpdated(_currentSwapper, newSwapper_);\n swapper = newSwapper_;\n }\n\n /**\n * @notice Update Quoter contract\n */\n function updateQuoter(IQuoter newQuoter_) external onlyGovernor {\n if (address(newQuoter_) == address(0)) revert AddressIsNull();\n IQuoter _currentQuoter = quoter;\n if (newQuoter_ == _currentQuoter) revert NewValueIsSameAsCurrent();\n\n emit QuoterUpdated(_currentQuoter, newQuoter_);\n quoter = newQuoter_;\n }\n\n /**\n * @notice Update Cross-chain dispatcher contract\n */\n function updateCrossChainDispatcher(ICrossChainDispatcher crossChainDispatcher_) external onlyGovernor {\n if (address(crossChainDispatcher_) == address(0)) revert AddressIsNull();\n ICrossChainDispatcher _current = crossChainDispatcher;\n if (crossChainDispatcher_ == _current) revert NewValueIsSameAsCurrent();\n\n emit CrossChainDispatcherUpdated(_current, crossChainDispatcher_);\n crossChainDispatcher = crossChainDispatcher_;\n }\n\n /**\n * @notice Pause/Unpause bridge transfers\n */\n function toggleCrossChainFlashRepayIsActive() external onlyGovernor {\n bool _newIsCrossChainFlashRepayActive = !isCrossChainFlashRepayActive;\n emit CrossChainFlashRepayActiveUpdated(_newIsCrossChainFlashRepayActive);\n isCrossChainFlashRepayActive = _newIsCrossChainFlashRepayActive;\n }\n}\n" + }, + "contracts/ProxyOFT.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"./dependencies/@layerzerolabs/solidity-examples/contracts-upgradeable/token/oft/composable/ComposableOFTCoreUpgradeable.sol\";\nimport \"./storage/ProxyOFTStorage.sol\";\nimport \"./interfaces/ICrossChainDispatcher.sol\";\n\nerror AddressIsNull();\nerror SenderIsNotTheOwner();\nerror BridgingIsPaused();\nerror SenderIsNotCrossChainDispatcher();\nerror DestinationChainNotAllowed();\n\n// Note: The `ICrossChainDispatcher` wasn't updated to avoid changing interface\n// Refs: https://github.com/autonomoussoftware/metronome-synth/issues/877\ninterface ICrossChainDispatcherExtended is ICrossChainDispatcher {\n function isDestinationChainSupported(uint16 dstChainId_) external view returns (bool);\n}\n\n/**\n * @title The ProxyOFT contract\n */\ncontract ProxyOFT is ComposableOFTCoreUpgradeable, ProxyOFTStorageV1 {\n using BytesLib for bytes;\n\n string public constant VERSION = \"1.3.0\";\n\n constructor() {\n _disableInitializers();\n }\n\n function initialize(address lzEndpoint_, ISyntheticToken syntheticToken_) external initializer {\n if (address(syntheticToken_) == address(0)) revert AddressIsNull();\n if (address(lzEndpoint_) == address(0)) revert AddressIsNull();\n\n __ComposableOFTCoreUpgradeable_init(lzEndpoint_);\n\n syntheticToken = syntheticToken_;\n }\n\n /// @inheritdoc IOFTCoreUpgradeable\n function circulatingSupply() public view override returns (uint) {\n return syntheticToken.totalSupply();\n }\n\n /**\n * @notice Get other chains Proxy OFT contracts\n * @param chainId_ the chain to get contract from\n */\n function getProxyOFTOf(uint16 chainId_) public view returns (address _proxyOFT) {\n return trustedRemoteLookup[chainId_].toAddress(0);\n }\n\n /// @inheritdoc IOFTCoreUpgradeable\n function token() public view override returns (address) {\n return address(syntheticToken);\n }\n\n /// @inheritdoc OFTCoreUpgradeable\n function _debitFrom(\n address from_,\n uint16 dstChainId_,\n bytes memory /*toAddress_*/,\n uint amount_\n ) internal override returns (uint256 _sent) {\n ICrossChainDispatcher _crossChainDispatcher = syntheticToken.poolRegistry().crossChainDispatcher();\n if (msg.sender != from_) revert SenderIsNotTheOwner();\n if (!_crossChainDispatcher.isBridgingActive()) revert BridgingIsPaused();\n if (!ICrossChainDispatcherExtended(address(_crossChainDispatcher)).isDestinationChainSupported(dstChainId_))\n revert DestinationChainNotAllowed();\n\n syntheticToken.burn(from_, amount_);\n return amount_;\n }\n\n /// @inheritdoc OFTCoreUpgradeable\n function _creditTo(\n uint16 /*srcChainId_*/,\n address toAddress_,\n uint amount_\n ) internal override returns (uint256 _received) {\n syntheticToken.mint(toAddress_, amount_);\n return amount_;\n }\n\n /// @inheritdoc ComposableOFTCoreUpgradeable\n function sendAndCall(\n address from_,\n uint16 dstChainId_,\n bytes calldata toAddress_,\n uint amount_,\n bytes calldata payload_,\n uint64 dstGasForCall_,\n address payable refundAddress_,\n address zroPaymentAddress_,\n bytes calldata adapterParams_\n ) public payable override(ComposableOFTCoreUpgradeable, IComposableOFTCoreUpgradeable) {\n if (msg.sender != address(syntheticToken.poolRegistry().crossChainDispatcher()))\n revert SenderIsNotCrossChainDispatcher();\n\n _sendAndCall(\n from_,\n dstChainId_,\n toAddress_,\n amount_,\n payload_,\n dstGasForCall_,\n refundAddress_,\n zroPaymentAddress_,\n adapterParams_\n );\n }\n\n /**\n * @notice User friendly `sendFrom()` function\n */\n function sendFrom(address from_, uint16 dstChainId_, address to_, uint256 amount_) external payable {\n _send({\n _from: from_,\n _dstChainId: dstChainId_,\n _toAddress: abi.encodePacked(to_),\n _amount: amount_,\n _refundAddress: payable(from_),\n _zroPaymentAddress: address(0),\n _adapterParams: abi.encodePacked(\n uint16(1), // LZ_ADAPTER_PARAMS_VERSION\n syntheticToken.poolRegistry().crossChainDispatcher().lzBaseGasLimit()\n )\n });\n }\n\n /**\n * @notice User friendly `sendFrom()` function\n */\n function estimateSendFee(\n uint16 dstChainId_,\n address to_,\n uint256 amount_\n ) external view returns (uint256 _nativeFee) {\n (_nativeFee, ) = this.estimateSendFee({\n _dstChainId: dstChainId_,\n _toAddress: abi.encodePacked(to_),\n _amount: amount_,\n _useZro: false,\n _adapterParams: abi.encodePacked(\n uint16(1), // LZ_ADAPTER_PARAMS_VERSION\n syntheticToken.poolRegistry().crossChainDispatcher().lzBaseGasLimit()\n )\n });\n }\n\n /// @inheritdoc OwnableUpgradeable\n function owner() public view override returns (address) {\n return syntheticToken.poolRegistry().governor();\n }\n\n /// @inheritdoc OwnableUpgradeable\n function renounceOwnership() public override {\n revert(\"disabled\");\n }\n\n /// @inheritdoc OwnableUpgradeable\n function transferOwnership(address) public override {\n revert(\"disabled\");\n }\n}\n" + }, + "contracts/Quoter.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"./dependencies/openzeppelin-upgradeable/proxy/utils/Initializable.sol\";\nimport \"./storage/QuoterStorage.sol\";\nimport \"./interfaces/external/IStargateBridge.sol\";\nimport \"./lib/CrossChainLib.sol\";\n\nerror AddressIsNull();\nerror NotAvailableOnThisChain();\n\n/**\n * @title Quoter contract\n */\ncontract Quoter is Initializable, QuoterStorageV1 {\n string public constant VERSION = \"1.3.0\";\n\n /**\n * @dev LayerZero adapter param version\n * See more: https://layerzero.gitbook.io/docs/evm-guides/advanced/relayer-adapter-parameters\n */\n uint16 public constant LZ_ADAPTER_PARAMS_VERSION = 2;\n\n /**\n * @dev Stargate swap function type\n * See more: https://stargateprotocol.gitbook.io/stargate/developers/function-types\n */\n uint8 public constant SG_TYPE_SWAP_REMOTE = 1;\n\n /**\n * @dev OFT packet type\n */\n uint16 public constant PT_SEND_AND_CALL = 1;\n\n constructor() {\n _disableInitializers();\n }\n\n function initialize(IPoolRegistry poolRegistry_) external initializer {\n if (address(poolRegistry_) == address(0)) revert AddressIsNull();\n poolRegistry = poolRegistry_;\n }\n\n /**\n * @notice Get LZ args for the swap and callback's trigger execution\n * @dev Must be called on the chain where the swap will be executed (a.k.a. destination chain)\n * @param srcChainId_ Source chain's LZ id (i.e. user-facing chain)\n * @param dstChainId_ Destination chain's LZ id (i.e. chain used for swap)\n */\n function getFlashRepaySwapAndCallbackLzArgs(\n uint16 srcChainId_,\n uint16 dstChainId_\n ) external view returns (bytes memory _lzArgs) {\n return\n CrossChainLib.encodeLzArgs({\n dstChainId_: dstChainId_,\n callbackNativeFee_: quoteFlashRepayCallbackNativeFee(srcChainId_),\n swapTxGasLimit_: _getCrossChainDispatcher().flashRepaySwapTxGasLimit()\n });\n }\n\n /**\n * @notice Get LZ args for the swap and callback's trigger execution\n * @dev Must be called on the chain where the swap will be executed (a.k.a. destination chain)\n * @param srcChainId_ Source chain's LZ id (i.e. user-facing chain)\n * @param dstChainId_ Destination chain's LZ id (i.e. chain used for swap)\n */\n function getLeverageSwapAndCallbackLzArgs(\n uint16 srcChainId_,\n uint16 dstChainId_\n ) external view returns (bytes memory _lzArgs) {\n return\n CrossChainLib.encodeLzArgs({\n dstChainId_: dstChainId_,\n callbackNativeFee_: quoteLeverageCallbackNativeFee(srcChainId_),\n swapTxGasLimit_: _getCrossChainDispatcher().leverageSwapTxGasLimit()\n });\n }\n\n /**\n * @notice Get the LZ (native) fee for the `crossChainLeverageCallback()` call\n * @param srcChainId_ Source chain's LZ id (i.e. user-facing chain)\n * @return _callbackTxNativeFee The fee in native coin\n */\n function quoteLeverageCallbackNativeFee(uint16 srcChainId_) public view returns (uint256 _callbackTxNativeFee) {\n ICrossChainDispatcher _crossChainDispatcher = _getCrossChainDispatcher();\n (_callbackTxNativeFee, ) = _crossChainDispatcher.stargateComposer().quoteLayerZeroFee({\n _dstChainId: srcChainId_,\n _functionType: SG_TYPE_SWAP_REMOTE,\n _toAddress: abi.encodePacked(address(type(uint160).max)),\n _transferAndCallPayload: CrossChainLib.encodeLeverageCallbackPayload(\n address(type(uint160).max),\n type(uint256).max\n ),\n _lzTxParams: IStargateRouter.lzTxObj({\n dstGasForCall: _crossChainDispatcher.leverageCallbackTxGasLimit(),\n dstNativeAmount: 0,\n dstNativeAddr: \"\"\n })\n });\n }\n\n /**\n * @notice Get the LZ (native) fee for the `crossChainFlashRepayCallback()` call\n * @param srcChainId_ Source chain's LZ id (i.e. user-facing chain)\n * @return _callbackTxNativeFee The fee in native coin\n */\n function quoteFlashRepayCallbackNativeFee(uint16 srcChainId_) public view returns (uint256 _callbackTxNativeFee) {\n ICrossChainDispatcher _crossChainDispatcher = _getCrossChainDispatcher();\n uint64 _callbackTxGasLimit = _crossChainDispatcher.flashRepayCallbackTxGasLimit();\n\n bytes memory _lzPayload = abi.encode(\n PT_SEND_AND_CALL,\n abi.encodePacked(msg.sender),\n abi.encodePacked(address(type(uint160).max)),\n type(uint256).max,\n CrossChainLib.encodeFlashRepayCallbackPayload(\n address(type(uint160).max),\n address(type(uint160).max),\n type(uint256).max\n ),\n _callbackTxGasLimit\n );\n\n (_callbackTxNativeFee, ) = IStargateBridge(_crossChainDispatcher.stargateComposer().stargateBridge())\n .layerZeroEndpoint()\n .estimateFees(\n srcChainId_,\n address(this),\n _lzPayload,\n false,\n abi.encodePacked(\n LZ_ADAPTER_PARAMS_VERSION,\n uint256(_crossChainDispatcher.lzBaseGasLimit() + _callbackTxGasLimit),\n uint256(0),\n address(0)\n )\n );\n }\n\n /**\n * @notice Get the LZ (native) fee for the `triggerFlashRepay()` call\n * @param proxyOFT_ The synthetic token's Proxy OFT contract\n * @param lzArgs_ The LZ args for swap transaction (See: `getFlashRepaySwapAndCallbackLzArgs()`)\n * @return _nativeFee The fee in native coin\n */\n function quoteCrossChainFlashRepayNativeFee(\n IProxyOFT proxyOFT_,\n bytes calldata lzArgs_\n ) external view returns (uint256 _nativeFee) {\n (uint16 _dstChainId, uint256 _callbackTxNativeFee, uint64 _swapTxGasLimit_) = CrossChainLib.decodeLzArgs(\n lzArgs_\n );\n\n bytes memory _dstProxyOFT = abi.encodePacked(proxyOFT_.getProxyOFTOf(_dstChainId));\n\n (_nativeFee, ) = _getCrossChainDispatcher().stargateComposer().quoteLayerZeroFee({\n _dstChainId: _dstChainId,\n _functionType: SG_TYPE_SWAP_REMOTE,\n _toAddress: _dstProxyOFT,\n _transferAndCallPayload: CrossChainLib.encodeFlashRepaySwapPayload(\n address(type(uint160).max),\n address(type(uint160).max),\n type(uint256).max,\n address(type(uint160).max),\n type(uint256).max,\n type(uint256).max\n ),\n _lzTxParams: IStargateRouter.lzTxObj({\n dstGasForCall: _swapTxGasLimit_,\n dstNativeAmount: _callbackTxNativeFee,\n dstNativeAddr: _dstProxyOFT\n })\n });\n }\n\n /**\n * @notice Get the LZ (native) fee for the `triggerLeverageSwap()` call\n * @param proxyOFT_ The synthetic token's Proxy OFT contract\n * @param lzArgs_ The LZ args for swap transaction (See: `getLeverageSwapAndCallbackLzArgs()`)\n * @return _nativeFee The fee in native coin\n */\n function quoteCrossChainLeverageNativeFee(\n IProxyOFT proxyOFT_,\n bytes calldata lzArgs_\n ) public view returns (uint256 _nativeFee) {\n uint16 _dstChainId;\n address _dstProxyOFT;\n bytes memory _payload;\n bytes memory _adapterParams;\n uint64 _swapTxGasLimit;\n {\n _payload = CrossChainLib.encodeLeverageSwapPayload(\n address(type(uint160).max),\n address(type(uint160).max),\n type(uint256).max,\n type(uint256).max,\n address(type(uint160).max),\n type(uint256).max,\n type(uint256).max\n );\n\n uint256 _callbackTxNativeFee;\n (_dstChainId, _callbackTxNativeFee, _swapTxGasLimit) = CrossChainLib.decodeLzArgs(lzArgs_);\n\n _dstProxyOFT = proxyOFT_.getProxyOFTOf(_dstChainId);\n\n _adapterParams = abi.encodePacked(\n LZ_ADAPTER_PARAMS_VERSION,\n uint256(_getCrossChainDispatcher().lzBaseGasLimit() + _swapTxGasLimit),\n _callbackTxNativeFee,\n _dstProxyOFT\n );\n }\n\n (_nativeFee, ) = proxyOFT_.estimateSendAndCallFee({\n _dstChainId: _dstChainId,\n _toAddress: abi.encodePacked(_dstProxyOFT),\n _amount: type(uint256).max,\n _payload: _payload,\n _dstGasForCall: _swapTxGasLimit,\n _useZro: false,\n _adapterParams: _adapterParams\n });\n }\n\n function _getCrossChainDispatcher() private view returns (ICrossChainDispatcher) {\n return poolRegistry.crossChainDispatcher();\n }\n}\n" + }, + "contracts/RewardsDistributor.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"./dependencies/openzeppelin/utils/math/SafeCast.sol\";\nimport \"./dependencies/openzeppelin/token/ERC20/utils/SafeERC20.sol\";\nimport \"./utils/ReentrancyGuard.sol\";\nimport \"./interfaces/IDebtToken.sol\";\nimport \"./interfaces/IDepositToken.sol\";\nimport \"./access/Manageable.sol\";\nimport \"./storage/RewardsDistributorStorage.sol\";\nimport \"./lib/WadRayMath.sol\";\nimport \"./interfaces/external/IVPool.sol\";\nimport \"./interfaces/external/IPoolRewards.sol\";\n\n/// @notice Updated to IPoolRewards will trigger treasury upgrade and we want to avoid it.\n/// Hence defining new interface here.\ninterface IPoolRewardsExt is IPoolRewards {\n function rewardRates(address rewardToken_) external returns (uint256);\n}\n\nerror AddressIsNull();\nerror NotTokenSpeedKeeper();\n\nerror DistributorDoesNotExist();\nerror InvalidToken();\nerror RewardTokenIsNull();\nerror ReachedMaxRewardTokens();\nerror ArraysLengthDoNotMatch();\n\n/**\n * @title RewardsDistributor contract\n */\ncontract RewardsDistributor is ReentrancyGuard, Manageable, RewardsDistributorStorageV2 {\n using SafeERC20 for IERC20;\n using SafeCast for uint256;\n using WadRayMath for uint256;\n\n string public constant VERSION = \"1.3.0\";\n\n /// @notice The initial index\n uint224 public constant INITIAL_INDEX = 1e18;\n\n /// @notice Max reward tokens to avoid DoS scenario\n uint224 public constant MAX_REWARD_TOKENS = 20;\n\n /// @notice Emitted when reward is claimed\n event RewardClaimed(address indexed account, uint256 amount);\n\n /// @notice Emitted when updating accrued token\n event TokensAccruedUpdated(IERC20 indexed token, address indexed account, uint256 tokensDelta, uint256 supplyIndex);\n\n /// @notice Emitted when updating token speed\n event TokenSpeedUpdated(IERC20 indexed token, uint256 oldSpeed, uint256 newSpeed);\n\n /// @notice Emitted when updating token index\n event TokenIndexUpdated(uint224 newIndex, uint32 newTimestamp);\n\n /**\n * @dev Throws if this contract isn't registered on pool\n */\n modifier onlyIfDistributorExists() {\n bool _distributorAdded = false;\n address[] memory _rewardsDistributors = pool.getRewardsDistributors();\n uint256 _length = _rewardsDistributors.length;\n for (uint256 i; i < _length; ++i) {\n if (_rewardsDistributors[i] == address(this)) {\n _distributorAdded = true;\n break;\n }\n }\n if (!_distributorAdded) revert DistributorDoesNotExist();\n _;\n }\n\n /**\n * @dev Throws if token doesn't exist\n * @dev Should be a DepositToken (suppliers) or DebtToken (borrowers)\n */\n modifier onlyIfTokenExists(address token_) {\n IPool _pool = pool;\n if (!_pool.doesDebtTokenExist(IDebtToken(token_)) && !_pool.doesDepositTokenExist(IDepositToken(token_))) {\n revert InvalidToken();\n }\n _;\n }\n\n constructor() {\n _disableInitializers();\n }\n\n function initialize(IPool pool_, IERC20 rewardToken_) external initializer {\n if (address(rewardToken_) == address(0)) revert RewardTokenIsNull();\n\n __ReentrancyGuard_init();\n __Manageable_init(pool_);\n\n rewardToken = rewardToken_;\n }\n\n /**\n * @notice Returns claimable amount consider all tokens\n */\n function claimable(address account_) external view override returns (uint256 _claimable) {\n _claimable = tokensAccruedOf[account_];\n for (uint256 i; i < tokens.length; ++i) {\n _claimable += _claimableRewards(account_, tokens[i]);\n }\n }\n\n /**\n * @notice Returns updated claimable amount for given token\n * @dev Removing this function will change interface and will result\n * updating other contracts using interface.\n */\n function claimable(address, IERC20) public view override returns (uint256) {\n revert(\"Unsupported\");\n }\n\n /**\n * @notice Claim tokens accrued by account in all tokens\n */\n function claimRewards(address account_) external override {\n claimRewards(account_, tokens);\n }\n\n /**\n * @notice Claim tokens accrued by account in the specified tokens\n */\n function claimRewards(address account_, IERC20[] memory tokens_) public override {\n address[] memory _accounts = new address[](1);\n _accounts[0] = account_;\n claimRewards(_accounts, tokens_);\n }\n\n /**\n * @notice Claim tokens accrued by the accounts in the specified tokens\n */\n function claimRewards(address[] memory accounts_, IERC20[] memory tokens_) public override nonReentrant {\n uint256 _accountsLength = accounts_.length;\n uint256 _tokensLength = tokens_.length;\n for (uint256 i; i < _tokensLength; ++i) {\n IERC20 _token = tokens_[i];\n\n if (tokenStates[_token].index > 0) {\n _updateTokenIndex(_token);\n for (uint256 j; j < _accountsLength; j++) {\n _updateTokensAccruedOf(_token, accounts_[j]);\n }\n }\n }\n\n for (uint256 j; j < _accountsLength; j++) {\n address _account = accounts_[j];\n _transferRewardIfEnoughTokens(_account, tokensAccruedOf[_account]);\n }\n }\n\n /**\n * @notice Update indexes on pre-mint and pre-burn\n * @dev Called by DepositToken and DebtToken contracts\n * This function also may be called by anyone to update stored indexes\n */\n function updateBeforeMintOrBurn(IERC20 token_, address account_) external override {\n if (tokenStates[token_].index > 0) {\n _updateTokenIndex(token_);\n _updateTokensAccruedOf(token_, account_);\n }\n }\n\n /**\n * @notice Update indexes on pre-transfer\n * @dev Called by DepositToken and DebtToken contracts\n */\n function updateBeforeTransfer(IERC20 token_, address from_, address to_) external override {\n if (tokenStates[token_].index > 0) {\n _updateTokenIndex(token_);\n _updateTokensAccruedOf(token_, from_);\n _updateTokensAccruedOf(token_, to_);\n }\n }\n\n /**\n * @notice Calculate updated token index values\n */\n function _calculateTokenIndex(\n TokenState memory _supplyState,\n IERC20 token_\n ) private view returns (uint224 _newIndex, uint32 _newTimestamp) {\n uint256 _speed = tokenSpeeds[token_];\n uint256 _deltaTimestamps = block.timestamp - uint256(_supplyState.timestamp);\n if (_deltaTimestamps > 0 && _speed > 0) {\n uint256 _totalSupply = token_.totalSupply();\n uint256 _tokensAccrued = _deltaTimestamps * _speed;\n uint256 _ratio = _totalSupply > 0 ? _tokensAccrued.wadDiv(_totalSupply) : 0;\n _newIndex = (_supplyState.index + _ratio).toUint224();\n _newTimestamp = block.timestamp.toUint32();\n } else if (_deltaTimestamps > 0 && _supplyState.index > 0) {\n _newTimestamp = block.timestamp.toUint32();\n }\n }\n\n /**\n * @notice Calculate updated account index and claimable values\n */\n function _calculateTokenDelta(\n TokenState memory _tokenState,\n IERC20 token_,\n address account_\n ) private view returns (uint256 _tokenIndex, uint256 _tokensDelta) {\n _tokenIndex = _tokenState.index;\n uint256 _accountIndex = accountIndexOf[token_][account_];\n\n if (_accountIndex == 0 && _tokenIndex > INITIAL_INDEX) {\n _accountIndex = INITIAL_INDEX;\n }\n\n uint256 _deltaIndex = _tokenIndex - _accountIndex;\n _tokensDelta = token_.balanceOf(account_).wadMul(_deltaIndex);\n }\n\n function _claimableRewards(address account_, IERC20 token_) internal view returns (uint256 _claimableDelta) {\n TokenState memory _tokenState = tokenStates[token_];\n (uint224 _newIndex, uint32 _newTimestamp) = _calculateTokenIndex(_tokenState, token_);\n if (_newIndex > 0 && _newTimestamp > 0) {\n _tokenState = TokenState({index: _newIndex, timestamp: _newTimestamp});\n } else if (_newTimestamp > 0) {\n _tokenState.timestamp = _newTimestamp;\n }\n (, _claimableDelta) = _calculateTokenDelta(_tokenState, token_, account_);\n }\n\n /**\n * @notice Transfer tokens to the user\n * @dev If there is not enough tokens, we do not perform the transfer\n */\n function _transferRewardIfEnoughTokens(address account_, uint256 amount_) private {\n IERC20 _rewardToken = rewardToken;\n uint256 _balance = _rewardToken.balanceOf(address(this));\n if (amount_ > 0 && amount_ <= _balance) {\n tokensAccruedOf[account_] = 0;\n _rewardToken.safeTransfer(account_, amount_);\n emit RewardClaimed(account_, amount_);\n }\n }\n\n /**\n * @notice Calculate tokens accrued by an account\n */\n function _updateTokensAccruedOf(IERC20 token_, address account_) private {\n (uint256 _tokenIndex, uint256 _tokensDelta) = _calculateTokenDelta(tokenStates[token_], token_, account_);\n accountIndexOf[token_][account_] = _tokenIndex;\n tokensAccruedOf[account_] = tokensAccruedOf[account_] + _tokensDelta;\n emit TokensAccruedUpdated(token_, account_, _tokensDelta, _tokenIndex);\n }\n\n /**\n * @notice Accrue reward token by updating the index\n */\n function _updateTokenIndex(IERC20 token_) private {\n TokenState storage _supplyState = tokenStates[token_];\n (uint224 _newIndex, uint32 _newTimestamp) = _calculateTokenIndex(_supplyState, token_);\n if (_newIndex > 0 && _newTimestamp > 0) {\n _supplyState.index = _newIndex;\n _supplyState.timestamp = _newTimestamp;\n emit TokenIndexUpdated(_newIndex, _newTimestamp);\n } else if (_newTimestamp > 0) {\n _supplyState.timestamp = _newTimestamp;\n emit TokenIndexUpdated(_supplyState.index, _newTimestamp);\n }\n }\n\n /**\n * @notice Update the speed for token\n */\n function _updateTokenSpeed(\n IERC20 token_,\n uint256 newSpeed_\n ) private onlyIfDistributorExists onlyIfTokenExists(address(token_)) {\n uint256 _currentSpeed = tokenSpeeds[token_];\n if (_currentSpeed > 0) {\n _updateTokenIndex(token_);\n } else if (newSpeed_ > 0) {\n // Add token to the list\n if (tokenStates[token_].index == 0) {\n if (tokens.length == MAX_REWARD_TOKENS) revert ReachedMaxRewardTokens();\n tokenStates[token_] = TokenState({index: INITIAL_INDEX, timestamp: block.timestamp.toUint32()});\n tokens.push(token_);\n } else {\n // Update timestamp to ensure extra interest is not accrued during the prior period\n tokenStates[token_].timestamp = block.timestamp.toUint32();\n }\n }\n\n if (_currentSpeed != newSpeed_) {\n tokenSpeeds[token_] = newSpeed_;\n emit TokenSpeedUpdated(token_, _currentSpeed, newSpeed_);\n }\n }\n\n /**\n * @notice Update speed for a single deposit token\n */\n function updateTokenSpeed(IERC20 token_, uint256 newSpeed_) external override onlyGovernor {\n _updateTokenSpeed(token_, newSpeed_);\n }\n\n /**\n * @notice Update token speeds\n */\n function updateTokenSpeeds(IERC20[] calldata tokens_, uint256[] calldata speeds_) external override onlyGovernor {\n uint256 _tokensLength = tokens_.length;\n if (_tokensLength != speeds_.length) revert ArraysLengthDoNotMatch();\n\n for (uint256 i; i < _tokensLength; ++i) {\n _updateTokenSpeed(tokens_[i], speeds_[i]);\n }\n }\n\n //******************************** TokenSpeed and RewardRate sync fix ***********************************/\n /// @notice This is temporary fix to keep tokenSpeed and rewardRate from Vesper in sync.\n function syncTokenSpeed(IDepositToken depositToken_) external {\n if (msg.sender != tokenSpeedKeeper) revert NotTokenSpeedKeeper();\n\n IVPool _vPool = IVPool(address(depositToken_.underlying()));\n IPoolRewardsExt _rewards = IPoolRewardsExt(_vPool.poolRewards());\n uint256 _speed = (_rewards.rewardRates(address(rewardToken)) * _vPool.balanceOf(address(pool.treasury()))) /\n _vPool.totalSupply();\n _updateTokenSpeed(IERC20(address(depositToken_)), _speed);\n }\n\n /// @notice This function is part of temporary fix to keep tokenSpeed and rewardRate in sync.\n function updateTokenSpeedKeeper(address keeper_) external onlyGovernor {\n if (keeper_ == address(0)) revert AddressIsNull();\n tokenSpeedKeeper = keeper_;\n }\n}\n" + }, + "contracts/SmartFarmingManager.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"./utils/ReentrancyGuard.sol\";\nimport \"./dependencies/openzeppelin/token/ERC20/utils/SafeERC20.sol\";\nimport \"./dependencies/openzeppelin/utils/math/Math.sol\";\nimport \"./interfaces/external/IStargateComposerWithRetry.sol\";\nimport \"./access/Manageable.sol\";\nimport \"./storage/SmartFarmingManagerStorage.sol\";\nimport \"./lib/WadRayMath.sol\";\nimport \"./lib/CrossChainLib.sol\";\n\nerror SyntheticDoesNotExist();\nerror PoolIsNull();\nerror FlashRepaySlippageTooHigh();\nerror LeverageTooLow();\nerror LeverageTooHigh();\nerror LeverageSlippageTooHigh();\nerror PositionIsNotHealthy();\nerror AmountIsZero();\nerror AmountIsTooHigh();\nerror DepositTokenDoesNotExist();\nerror AddressIsNull();\nerror NewValueIsSameAsCurrent();\nerror CrossChainRequestInvalidKey();\nerror SenderIsNotCrossChainDispatcher();\nerror CrossChainRequestCompletedAlready();\nerror TokenInIsNull();\nerror BridgeTokenIsNull();\nerror CrossChainFlashRepayInactive();\n\n// Note: The `IPoolRegistry` wasn't updated to avoid changing interface\n// Refs: https://github.com/autonomoussoftware/metronome-synth/issues/877\ninterface IPoolRegistryV3 is IPoolRegistry {\n function isCrossChainFlashRepayActive() external view returns (bool);\n}\n\n/**\n * @title SmartFarmingManager contract\n */\ncontract SmartFarmingManager is ReentrancyGuard, Manageable, SmartFarmingManagerStorageV1 {\n using SafeERC20 for IERC20;\n using SafeERC20 for ISyntheticToken;\n using WadRayMath for uint256;\n\n string public constant VERSION = \"1.3.0\";\n\n /// @notice Emitted when a cross-chain leverage request is finalized\n event CrossChainLeverageFinished(uint256 indexed id);\n\n /// @notice Emitted when a cross-chain leverage request is created\n event CrossChainLeverageStarted(uint256 indexed id);\n\n /// @notice Emitted when a cross-chain flash repay request is finalized\n event CrossChainFlashRepayFinished(uint256 indexed id);\n\n /// @notice Emitted when a cross-chain flash repay request is created\n event CrossChainFlashRepayStarted(uint256 indexed id);\n\n /// @notice Emitted when debt is flash repaid\n event FlashRepaid(\n ISyntheticToken indexed syntheticToken,\n IDepositToken indexed depositToken,\n uint256 withdrawn,\n uint256 repaid\n );\n\n /// @notice Emitted when deposit is leveraged\n event Leveraged(\n IERC20 indexed tokenIn,\n IDepositToken indexed depositToken,\n ISyntheticToken indexed syntheticToken,\n uint256 leverage,\n uint256 amountIn,\n uint256 issued,\n uint256 deposited\n );\n\n /**\n * @dev Throws if sender isn't a valid ProxyOFT contract\n */\n modifier onlyIfCrossChainDispatcher() {\n if (msg.sender != address(crossChainDispatcher())) revert SenderIsNotCrossChainDispatcher();\n _;\n }\n\n /**\n * @dev Throws if deposit token doesn't exist\n */\n modifier onlyIfDepositTokenExists(IDepositToken depositToken_) {\n if (!pool.doesDepositTokenExist(depositToken_)) revert DepositTokenDoesNotExist();\n _;\n }\n\n /**\n * @dev Throws if synthetic token doesn't exist\n */\n modifier onlyIfSyntheticTokenExists(ISyntheticToken syntheticToken_) {\n if (!pool.doesSyntheticTokenExist(syntheticToken_)) revert SyntheticDoesNotExist();\n _;\n }\n\n constructor() {\n _disableInitializers();\n }\n\n function initialize(IPool pool_) public initializer {\n if (address(pool_) == address(0)) revert PoolIsNull();\n __ReentrancyGuard_init();\n __Manageable_init(pool_);\n }\n\n /**\n * @notice Get the Cross-chain dispatcher contract\n */\n function crossChainDispatcher() public view returns (ICrossChainDispatcher _crossChainDispatcher) {\n return pool.poolRegistry().crossChainDispatcher();\n }\n\n /***\n * @notice Cross-chain flash debt repayment\n * @dev Not calling `whenNotShutdown` here because nested function already does it\n * @param syntheticToken_ The debt token to repay\n * @param depositToken_ The collateral to withdraw\n * @param withdrawAmount_ The amount to withdraw\n * @param bridgeToken_ The asset that will be bridged out and used to swap for msAsset\n * @param bridgeTokenAmountMin_ The minimum amount out when converting collateral for bridgeToken if they aren't the same (slippage check)\n * @param swapAmountOutMin_ The minimum amount out from the bridgeToken->msAsset swap (slippage check)\n * @param repayAmountMin_ The minimum amount to repay (slippage check)\n * @param lzArgs_ The LayerZero params (See: `Quoter.getFlashRepaySwapAndCallbackLzArgs()`)\n */\n function crossChainFlashRepay(\n ISyntheticToken syntheticToken_,\n IDepositToken depositToken_,\n uint256 withdrawAmount_,\n IERC20 bridgeToken_,\n uint256 bridgeTokenAmountMin_,\n uint256 swapAmountOutMin_,\n uint256 repayAmountMin_,\n bytes calldata lzArgs_\n )\n external\n payable\n override\n nonReentrant\n onlyIfDepositTokenExists(depositToken_)\n onlyIfSyntheticTokenExists(syntheticToken_)\n {\n if (withdrawAmount_ == 0) revert AmountIsZero();\n if (!IPoolRegistryV3(address(pool.poolRegistry())).isCrossChainFlashRepayActive())\n revert CrossChainFlashRepayInactive();\n\n ICrossChainDispatcher _crossChainDispatcher;\n {\n IDebtToken _debtToken = pool.debtTokenOf(syntheticToken_);\n _debtToken.accrueInterest();\n if (repayAmountMin_ > _debtToken.balanceOf(msg.sender)) revert AmountIsTooHigh();\n\n _crossChainDispatcher = crossChainDispatcher();\n }\n\n uint256 _amountIn;\n {\n // 1. withdraw collateral\n // Note: No need to check healthy because this function ensures withdrawing only from unlocked balance\n (_amountIn, ) = depositToken_.withdrawFrom(msg.sender, withdrawAmount_);\n\n // 2. swap collateral for bridge token\n _amountIn = _swap({\n swapper_: swapper(),\n tokenIn_: _collateralOf(depositToken_),\n tokenOut_: bridgeToken_,\n amountIn_: _amountIn,\n amountOutMin_: bridgeTokenAmountMin_,\n to_: address(_crossChainDispatcher)\n });\n }\n\n // 3. store request and trigger swap\n _triggerFlashRepaySwap({\n crossChainDispatcher_: _crossChainDispatcher,\n swapTokenIn_: bridgeToken_,\n swapTokenOut_: syntheticToken_,\n swapAmountIn_: _amountIn,\n swapAmountOutMin_: swapAmountOutMin_,\n repayAmountMin_: repayAmountMin_,\n lzArgs_: lzArgs_\n });\n }\n\n /**\n * @dev Stores flash repay cross-chain request and triggers swap on the destination chain\n */\n function _triggerFlashRepaySwap(\n ICrossChainDispatcher crossChainDispatcher_,\n IERC20 swapTokenIn_,\n ISyntheticToken swapTokenOut_,\n uint256 swapAmountIn_,\n uint256 swapAmountOutMin_,\n uint256 repayAmountMin_,\n bytes calldata lzArgs_\n ) private {\n uint256 _id = _nextCrossChainRequestId();\n\n (uint16 _dstChainId, , ) = CrossChainLib.decodeLzArgs(lzArgs_);\n\n crossChainFlashRepays[_id] = CrossChainFlashRepay({\n dstChainId: _dstChainId,\n syntheticToken: swapTokenOut_,\n repayAmountMin: repayAmountMin_,\n account: msg.sender,\n finished: false\n });\n\n crossChainDispatcher_.triggerFlashRepaySwap{value: msg.value}({\n id_: _id,\n account_: payable(msg.sender),\n tokenIn_: address(swapTokenIn_),\n tokenOut_: address(swapTokenOut_),\n amountIn_: swapAmountIn_,\n amountOutMin_: swapAmountOutMin_,\n lzArgs_: lzArgs_\n });\n\n emit CrossChainFlashRepayStarted(_id);\n }\n\n /**\n * @notice Finalize cross-chain flash debt repayment process\n * @dev Receives msAsset from L1 and use it to repay\n * @param id_ The id of the request\n * @param swapAmountOut_ The msAsset amount received from L1 swap\n * @return _repaid The debt amount repaid\n */\n function crossChainFlashRepayCallback(\n uint256 id_,\n uint256 swapAmountOut_\n ) external override whenNotShutdown nonReentrant onlyIfCrossChainDispatcher returns (uint256 _repaid) {\n CrossChainFlashRepay memory _request = crossChainFlashRepays[id_];\n\n if (_request.account == address(0)) revert CrossChainRequestInvalidKey();\n if (_request.finished) revert CrossChainRequestCompletedAlready();\n\n // 1. update state\n crossChainFlashRepays[id_].finished = true;\n\n // 2. transfer synthetic token\n swapAmountOut_ = _safeTransferFrom(_request.syntheticToken, msg.sender, swapAmountOut_);\n\n // 3. repay debt\n IDebtToken _debtToken = pool.debtTokenOf(_request.syntheticToken);\n (uint256 _maxRepayAmount, ) = _debtToken.quoteRepayIn(_debtToken.balanceOf(_request.account));\n uint256 _repayAmount = Math.min(swapAmountOut_, _maxRepayAmount);\n if (_repayAmount > 0) (_repaid, ) = _debtToken.repay(_request.account, _repayAmount);\n if (_repaid < _request.repayAmountMin) revert FlashRepaySlippageTooHigh();\n\n // 4. refund synthetic token in excess\n if (swapAmountOut_ > _repayAmount) {\n _request.syntheticToken.safeTransfer(_request.account, swapAmountOut_ - _repayAmount);\n }\n\n emit CrossChainFlashRepayFinished(id_);\n }\n\n /**\n * @dev Keep this function to avoid changing interface\n * Refs: https://github.com/autonomoussoftware/metronome-synth/issues/877\n */\n function crossChainLeverage(\n IERC20,\n IDepositToken,\n ISyntheticToken,\n uint256,\n uint256,\n uint256,\n uint256,\n bytes calldata\n ) external payable override {\n revert(\"deprecated\");\n }\n\n /***\n * @notice Cross-chain Leverage\n * @dev Not calling `whenNotShutdown` here because nested function already does it\n * @param tokenIn_ The token to transfer\n * @param syntheticToken_ The msAsset to mint\n * @param bridgeToken_ The asset that will be used to swap from msAsset and bridged back\n * @param depositToken_ The collateral to deposit\n * @param amountIn_ The amount to deposit\n * @param leverage_ The leverage X param (e.g. 1.5e18 for 1.5X)\n * @param swapAmountOutMin_ The minimum amount out from msAsset->bridgeToken swap (slippage check)\n * @param depositAmountMin_ The minimum final amount to deposit (slippage check)\n * @param lzArgs_ The LayerZero params (See: `Quoter.getLeverageSwapAndCallbackLzArgs()`)\n */\n function crossChainLeverage(\n IERC20 tokenIn_,\n ISyntheticToken syntheticToken_,\n IERC20 bridgeToken_,\n IDepositToken depositToken_,\n uint256 amountIn_,\n uint256 leverage_,\n uint256 swapAmountOutMin_,\n uint256 depositAmountMin_,\n bytes calldata lzArgs_\n )\n external\n payable\n // Note: Not adding this function to the `ISmartFarmingInterface` to avoid changing interface\n // Refs: https://github.com/autonomoussoftware/metronome-synth/issues/877\n // override\n nonReentrant\n onlyIfDepositTokenExists(depositToken_)\n onlyIfSyntheticTokenExists(syntheticToken_)\n {\n IERC20 _tokenIn = tokenIn_; // stack too deep\n\n if (amountIn_ == 0) revert AmountIsZero();\n if (leverage_ <= 1e18) revert LeverageTooLow();\n if (leverage_ > uint256(1e18).wadDiv(1e18 - depositToken_.collateralFactor())) revert LeverageTooHigh();\n if (address(_tokenIn) == address(0)) revert TokenInIsNull();\n if (address(bridgeToken_) == address(0)) revert BridgeTokenIsNull();\n\n uint256 _debtAmount;\n uint256 _issued;\n {\n // 1. transfer tokenIn\n amountIn_ = _safeTransferFrom(_tokenIn, msg.sender, amountIn_);\n\n // 2. mint synth\n _debtAmount = _calculateLeverageDebtAmount(_tokenIn, syntheticToken_, amountIn_, leverage_);\n (_issued, ) = pool.debtTokenOf(syntheticToken_).flashIssue(address(crossChainDispatcher()), _debtAmount);\n }\n\n bytes memory _swapArgs = abi.encode(syntheticToken_, bridgeToken_, _issued, swapAmountOutMin_); // stack too deep\n IDepositToken _depositToken = depositToken_; // stack too deep\n\n // 3. store request and trigger swap\n _triggerCrossChainLeverageSwap({\n tokenIn_: _tokenIn,\n amountIn_: amountIn_,\n debtAmount_: _debtAmount,\n swapArgs_: _swapArgs,\n depositToken_: _depositToken,\n depositAmountMin_: depositAmountMin_,\n lzArgs_: lzArgs_\n });\n }\n\n /**\n * @dev Stores leverage cross-chain request and triggers swap on the destination chain\n */\n function _triggerCrossChainLeverageSwap(\n IERC20 tokenIn_,\n uint256 amountIn_,\n uint256 debtAmount_,\n bytes memory swapArgs_,\n IDepositToken depositToken_,\n uint256 depositAmountMin_,\n bytes calldata lzArgs_\n ) private {\n uint256 _id = _nextCrossChainRequestId();\n\n (ISyntheticToken _swapTokenIn, IERC20 _swapTokenOut, uint256 _swapAmountIn, uint256 _swapAmountOutMin) = abi\n .decode(swapArgs_, (ISyntheticToken, IERC20, uint256, uint256));\n\n {\n (uint16 _dstChainId, , ) = CrossChainLib.decodeLzArgs(lzArgs_);\n\n crossChainLeverages[_id] = CrossChainLeverage({\n dstChainId: _dstChainId,\n tokenIn: tokenIn_,\n syntheticToken: _swapTokenIn,\n bridgeToken: _swapTokenOut,\n depositToken: depositToken_,\n amountIn: amountIn_,\n debtAmount: debtAmount_,\n depositAmountMin: depositAmountMin_,\n account: msg.sender,\n finished: false\n });\n }\n\n crossChainDispatcher().triggerLeverageSwap{value: msg.value}({\n id_: _id,\n account_: payable(msg.sender),\n tokenIn_: address(_swapTokenIn),\n tokenOut_: address(_swapTokenOut),\n amountIn_: _swapAmountIn,\n amountOutMin: _swapAmountOutMin,\n lzArgs_: lzArgs_\n });\n\n emit CrossChainLeverageStarted(_id);\n }\n\n /**\n * @notice Finalize cross-chain leverage process\n * @dev Receives bridged token (aka naked token) use it to deposit\n * @param id_ The id of the request\n * @param swapAmountOut_ The amount received from swap\n * @return _deposited The amount deposited\n */\n function crossChainLeverageCallback(\n uint256 id_,\n uint256 swapAmountOut_\n ) external override whenNotShutdown nonReentrant onlyIfCrossChainDispatcher returns (uint256 _deposited) {\n CrossChainLeverage memory _request = crossChainLeverages[id_];\n\n if (_request.account == address(0)) revert CrossChainRequestInvalidKey();\n if (_request.finished) revert CrossChainRequestCompletedAlready();\n IERC20 _collateral = _collateralOf(_request.depositToken);\n\n // 1. update state\n crossChainLeverages[id_].finished = true;\n\n // 2. transfer swap's tokenOut (aka bridged token)\n swapAmountOut_ = _safeTransferFrom(_request.bridgeToken, msg.sender, swapAmountOut_);\n\n // 3. swap received tokens for collateral if needed\n // Note: The internal `_swap()` doesn't swap if `tokenIn` and `tokenOut` are the same\n uint256 _depositAmount;\n if (_request.tokenIn == _request.bridgeToken) {\n _depositAmount = _swap(swapper(), _request.tokenIn, _collateral, _request.amountIn + swapAmountOut_, 0);\n } else {\n _depositAmount = _swap(swapper(), _request.tokenIn, _collateral, _request.amountIn, 0);\n _depositAmount += _swap(swapper(), _request.bridgeToken, _collateral, swapAmountOut_, 0);\n }\n\n if (_depositAmount < _request.depositAmountMin) revert LeverageSlippageTooHigh();\n\n // 4. deposit collateral\n _collateral.safeApprove(address(_request.depositToken), 0);\n _collateral.safeApprove(address(_request.depositToken), _depositAmount);\n (_deposited, ) = _request.depositToken.deposit(_depositAmount, _request.account);\n\n // 5. mint debt\n IPool _pool = pool;\n _pool.debtTokenOf(_request.syntheticToken).mint(_request.account, _request.debtAmount);\n\n // 6. check the health of the outcome position\n (bool _isHealthy, , , , ) = _pool.debtPositionOf(_request.account);\n if (!_isHealthy) revert PositionIsNotHealthy();\n\n emit CrossChainLeverageFinished(id_);\n }\n\n /**\n * @notice Flash debt repayment\n * @param syntheticToken_ The debt token to repay\n * @param depositToken_ The collateral to withdraw\n * @param withdrawAmount_ The amount to withdraw\n * @param repayAmountMin_ The minimum amount to repay (slippage check)\n */\n function flashRepay(\n ISyntheticToken syntheticToken_,\n IDepositToken depositToken_,\n uint256 withdrawAmount_,\n uint256 repayAmountMin_\n )\n external\n override\n whenNotShutdown\n nonReentrant\n onlyIfDepositTokenExists(depositToken_)\n onlyIfSyntheticTokenExists(syntheticToken_)\n returns (uint256 _withdrawn, uint256 _repaid)\n {\n if (withdrawAmount_ == 0) revert AmountIsZero();\n if (withdrawAmount_ > depositToken_.balanceOf(msg.sender)) revert AmountIsTooHigh();\n IPool _pool = pool;\n IDebtToken _debtToken = _pool.debtTokenOf(syntheticToken_);\n if (repayAmountMin_ > _debtToken.balanceOf(msg.sender)) revert AmountIsTooHigh();\n\n // 1. withdraw collateral\n (_withdrawn, ) = depositToken_.flashWithdraw(msg.sender, withdrawAmount_);\n\n // 2. swap it for synth\n uint256 _amountToRepay = _swap(swapper(), _collateralOf(depositToken_), syntheticToken_, _withdrawn, 0);\n\n // 3. repay debt\n (_repaid, ) = _debtToken.repay(msg.sender, _amountToRepay);\n if (_repaid < repayAmountMin_) revert FlashRepaySlippageTooHigh();\n\n // 4. check the health of the outcome position\n (bool _isHealthy, , , , ) = _pool.debtPositionOf(msg.sender);\n if (!_isHealthy) revert PositionIsNotHealthy();\n\n emit FlashRepaid(syntheticToken_, depositToken_, _withdrawn, _repaid);\n }\n\n /**\n * @notice Leverage yield position\n * @param tokenIn_ The token to transfer\n * @param depositToken_ The collateral to deposit\n * @param syntheticToken_ The msAsset to mint\n * @param amountIn_ The amount to deposit\n * @param leverage_ The leverage X param (e.g. 1.5e18 for 1.5X)\n * @param depositAmountMin_ The min final deposit amount (slippage)\n */\n function leverage(\n IERC20 tokenIn_,\n IDepositToken depositToken_,\n ISyntheticToken syntheticToken_,\n uint256 amountIn_,\n uint256 leverage_,\n uint256 depositAmountMin_\n )\n external\n override\n whenNotShutdown\n nonReentrant\n onlyIfDepositTokenExists(depositToken_)\n onlyIfSyntheticTokenExists(syntheticToken_)\n returns (uint256 _deposited, uint256 _issued)\n {\n if (amountIn_ == 0) revert AmountIsZero();\n if (leverage_ <= 1e18) revert LeverageTooLow();\n if (leverage_ > uint256(1e18).wadDiv(1e18 - depositToken_.collateralFactor())) revert LeverageTooHigh();\n\n ISwapper _swapper = swapper();\n\n // 1. transfer collateral\n IERC20 _collateral = _collateralOf(depositToken_);\n if (address(tokenIn_) == address(0)) tokenIn_ = _collateral;\n amountIn_ = _safeTransferFrom(tokenIn_, msg.sender, amountIn_);\n if (tokenIn_ != _collateral) {\n // Note: `amountOutMin_` is `0` because slippage will be checked later on\n amountIn_ = _swap(_swapper, tokenIn_, _collateral, amountIn_, 0);\n }\n\n {\n // 2. mint synth + debt\n uint256 _debtAmount = _calculateLeverageDebtAmount(_collateral, syntheticToken_, amountIn_, leverage_);\n IDebtToken _debtToken = pool.debtTokenOf(syntheticToken_);\n (_issued, ) = _debtToken.flashIssue(address(this), _debtAmount);\n _debtToken.mint(msg.sender, _debtAmount);\n }\n\n // 3. swap synth for collateral\n uint256 _depositAmount = amountIn_ + _swap(_swapper, syntheticToken_, _collateral, _issued, 0);\n if (_depositAmount < depositAmountMin_) revert LeverageSlippageTooHigh();\n\n // 4. deposit collateral\n _collateral.safeApprove(address(depositToken_), 0);\n _collateral.safeApprove(address(depositToken_), _depositAmount);\n (_deposited, ) = depositToken_.deposit(_depositAmount, msg.sender);\n\n // 5. check the health of the outcome position\n (bool _isHealthy, , , , ) = pool.debtPositionOf(msg.sender);\n if (!_isHealthy) revert PositionIsNotHealthy();\n\n emit Leveraged(tokenIn_, depositToken_, syntheticToken_, leverage_, amountIn_, _issued, _deposited);\n }\n\n /**\n * @notice Retry cross-chain flash repay callback\n * @dev This function is used to recover from callback failures due to slippage\n * @param srcChainId_ The source chain of failed tx\n * @param srcAddress_ The source path of failed tx\n * @param nonce_ The nonce of failed tx\n * @param amount_ The amount of failed tx\n * @param payload_ The payload of failed tx\n * @param newRepayAmountMin_ If repayment failed due to slippage, caller may send lower newRepayAmountMin_\n */\n function retryCrossChainFlashRepayCallback(\n uint16 srcChainId_,\n bytes calldata srcAddress_,\n uint64 nonce_,\n uint256 amount_,\n bytes calldata payload_,\n uint256 newRepayAmountMin_\n ) external {\n (, , uint256 _requestId) = CrossChainLib.decodeFlashRepayCallbackPayload(payload_);\n\n CrossChainFlashRepay memory _request = crossChainFlashRepays[_requestId];\n\n if (_request.account == address(0)) revert CrossChainRequestInvalidKey();\n if (_request.finished) revert CrossChainRequestCompletedAlready();\n\n // Note: Only user can change slippage param\n if (msg.sender == _request.account) {\n crossChainFlashRepays[_requestId].repayAmountMin = newRepayAmountMin_;\n }\n\n ICrossChainDispatcher _crossChainDispatcher = crossChainDispatcher();\n bytes memory _from = abi.encodePacked(_crossChainDispatcher.crossChainDispatcherOf(srcChainId_));\n\n _request.syntheticToken.proxyOFT().retryOFTReceived({\n _srcChainId: srcChainId_,\n _srcAddress: srcAddress_,\n _nonce: nonce_,\n _from: _from,\n _to: address(_crossChainDispatcher),\n _amount: amount_,\n _payload: payload_\n });\n }\n\n /**\n * @notice Retry cross-chain leverage callback\n * @dev This function is used to recover from callback failures due to slippage\n * @param srcChainId_ The source chain of failed tx\n * @param srcAddress_ The source path of failed tx\n * @param nonce_ The nonce of failed tx\n * @param token_ The token of failed tx\n * @param amount_ The amountIn of failed tx\n * @param payload_ The payload of failed tx\n * @param newDepositAmountMin_ If deposit failed due to slippage, caller may send lower newDepositAmountMin_\n */\n function retryCrossChainLeverageCallback(\n uint16 srcChainId_,\n bytes calldata srcAddress_,\n uint64 nonce_,\n address token_,\n uint256 amount_,\n bytes calldata payload_,\n uint256 newDepositAmountMin_\n ) external {\n (, uint256 _requestId) = CrossChainLib.decodeLeverageCallbackPayload(payload_);\n\n CrossChainLeverage memory _request = crossChainLeverages[_requestId];\n\n if (_request.account == address(0)) revert CrossChainRequestInvalidKey();\n if (_request.finished) revert CrossChainRequestCompletedAlready();\n\n // Note: Only user can change slippage param\n if (msg.sender == _request.account) {\n crossChainLeverages[_requestId].depositAmountMin = newDepositAmountMin_;\n }\n\n ICrossChainDispatcher _crossChainDispatcher = crossChainDispatcher();\n\n address _from = _crossChainDispatcher.crossChainDispatcherOf(srcChainId_);\n bytes memory _sgReceiveCallData = abi.encodeWithSelector(\n IStargateReceiver.sgReceive.selector,\n srcChainId_,\n abi.encodePacked(_from),\n nonce_,\n token_,\n amount_,\n payload_\n );\n\n IStargateComposerWithRetry(address(_crossChainDispatcher.stargateComposer())).clearCachedSwap(\n srcChainId_,\n srcAddress_,\n nonce_,\n address(_crossChainDispatcher),\n _sgReceiveCallData\n );\n }\n\n /**\n * @notice Get the swapper contract\n */\n function swapper() public view returns (ISwapper _swapper) {\n return pool.poolRegistry().swapper();\n }\n\n /**\n * @notice Calculate debt to issue for a leverage operation\n * @param collateral_ The collateral to deposit\n * @param syntheticToken_ The msAsset to mint\n * @param amountIn_ The amount to deposit\n * @param leverage_ The leverage X param (e.g. 1.5e18 for 1.5X)\n * @return _debtAmount The debt issue\n */\n function _calculateLeverageDebtAmount(\n IERC20 collateral_,\n ISyntheticToken syntheticToken_,\n uint256 amountIn_,\n uint256 leverage_\n ) private view returns (uint256 _debtAmount) {\n return\n pool.masterOracle().quote(\n address(collateral_),\n address(syntheticToken_),\n (leverage_ - 1e18).wadMul(amountIn_)\n );\n }\n\n /**\n * @dev `collateral` is a better name than `underlying`\n * See more: https://github.com/autonomoussoftware/metronome-synth/issues/905\n */\n function _collateralOf(IDepositToken depositToken_) private view returns (IERC20) {\n return depositToken_.underlying();\n }\n\n /**\n * @dev Generates cross-chain request id by hashing `chainId`+`requestId` in order to avoid\n * having same id across supported chains\n * Note: The cross-chain code mostly uses LZ chain ids but in this case, we're using native id.\n */\n function _nextCrossChainRequestId() private returns (uint256 _id) {\n return uint256(keccak256(abi.encode(block.chainid, address(this), ++crossChainRequestsLength)));\n }\n\n /**\n * @notice Transfer token and check actual amount transferred\n * @param token_ The token to transfer\n * @param from_ The account to get tokens from\n * @param amount_ The amount to transfer\n * @return _transferred The actual transferred amount\n */\n function _safeTransferFrom(IERC20 token_, address from_, uint256 amount_) private returns (uint256 _transferred) {\n uint256 _before = token_.balanceOf(address(this));\n token_.safeTransferFrom(from_, address(this), amount_);\n return token_.balanceOf(address(this)) - _before;\n }\n\n /**\n * @notice Swap assets using Swapper contract\n * @dev Use `address(this)` as amount out receiver\n * @param swapper_ The Swapper contract\n * @param tokenIn_ The token to swap from\n * @param tokenOut_ The token to swap to\n * @param amountIn_ The amount in\n * @param amountOutMin_ The minimum amount out (slippage check)\n * @return _amountOut The actual amount out\n */\n function _swap(\n ISwapper swapper_,\n IERC20 tokenIn_,\n IERC20 tokenOut_,\n uint256 amountIn_,\n uint256 amountOutMin_\n ) private returns (uint256 _amountOut) {\n return _swap(swapper_, tokenIn_, tokenOut_, amountIn_, amountOutMin_, address(this));\n }\n\n /**\n * @notice Swap assets using Swapper contract\n * @param swapper_ The Swapper contract\n * @param tokenIn_ The token to swap from\n * @param tokenOut_ The token to swap to\n * @param amountIn_ The amount in\n * @param amountOutMin_ The minimum amount out (slippage check)\n * @param to_ The amount out receiver\n * @return _amountOut The actual amount out\n */\n function _swap(\n ISwapper swapper_,\n IERC20 tokenIn_,\n IERC20 tokenOut_,\n uint256 amountIn_,\n uint256 amountOutMin_,\n address to_\n ) private returns (uint256 _amountOut) {\n if (tokenIn_ != tokenOut_) {\n tokenIn_.safeApprove(address(swapper_), 0);\n tokenIn_.safeApprove(address(swapper_), amountIn_);\n uint256 _tokenOutBefore = tokenOut_.balanceOf(to_);\n swapper_.swapExactInput(address(tokenIn_), address(tokenOut_), amountIn_, amountOutMin_, to_);\n return tokenOut_.balanceOf(to_) - _tokenOutBefore;\n } else if (to_ != address(this)) {\n tokenIn_.safeTransfer(to_, amountIn_);\n }\n return amountIn_;\n }\n}\n" + }, + "contracts/storage/CrossChainDispatcherStorage.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"../interfaces/ICrossChainDispatcher.sol\";\nimport \"../interfaces/IPoolRegistry.sol\";\n\nabstract contract CrossChainDispatcherStorageV1 is ICrossChainDispatcher {\n /**\n * @notice The pool registry contract\n */\n IPoolRegistry public poolRegistry;\n\n /**\n * @notice Overwritten swap slippage params\n * @dev Used by retry functions in case of swap failure due to slippage (See: `_swap()`)\n */\n mapping(uint256 => uint256) public swapAmountOutMin;\n\n /**\n * @notice Maps other chains `CrossChainDispatcher` contracts\n */\n mapping(uint16 => address) public crossChainDispatcherOf;\n\n /**\n * @notice The base gas to pay for cross-chain calls\n * @dev This limit covers basic token transfer LZ cost\n */\n uint256 public lzBaseGasLimit;\n\n /**\n * @notice The slippage we're willing to accept for SG like:like transfers\n */\n uint256 public stargateSlippage;\n\n /**\n * @notice The gas limit to cover `_crossChainFlashRepayCallback()` call\n */\n uint64 public flashRepayCallbackTxGasLimit;\n\n /**\n * @notice The gas limit to cover `_swapAndTriggerFlashRepayCallback()` call\n */\n uint64 public flashRepaySwapTxGasLimit;\n\n /**\n * @notice The gas limit to cover `_crossChainLeverageCallback()` call\n */\n uint64 public leverageCallbackTxGasLimit;\n\n /**\n * @notice The gas limit to cover `_swapAndTriggerLeverageCallback()` call\n */\n uint64 public leverageSwapTxGasLimit;\n\n /**\n * @notice Flag that pause/unpause all cross-chain activities\n */\n bool public isBridgingActive;\n\n /**\n * @notice The Stargate Router contract\n */\n IStargateComposer public stargateComposer;\n\n /**\n * @notice Maps Stargate's token pools\n */\n mapping(address => uint256) public stargatePoolIdOf;\n\n /**\n * @notice Maps supported cross-chain routes (i.e. which chains are allowed to be used as source of liquidity)\n */\n mapping(uint16 => bool) public isDestinationChainSupported;\n\n /**\n * @notice WETH contract\n */\n address public weth;\n\n /**\n * @notice SGETH contract\n */\n address public sgeth;\n}\n\nabstract contract CrossChainDispatcherStorageV2 is CrossChainDispatcherStorageV1 {\n /**\n * @notice Store extra amount sent when retrying a failed tx due to low native fee\n */\n mapping(uint256 => uint256) public extraCallbackTxNativeFee;\n}\n" + }, + "contracts/storage/DebtTokenStorage.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"../interfaces/IDebtToken.sol\";\n\nabstract contract DebtTokenStorageV1 is IDebtToken {\n /**\n * @notice The name of the token\n */\n string public override name;\n\n /**\n * @notice The symbol of the token\n */\n string public override symbol;\n\n /**\n * @notice The mapping of the users' minted tokens\n * @dev This value changes within the mint and burn operations\n */\n mapping(address => uint256) internal principalOf;\n\n /**\n * @notice The `debtIndex` \"snapshot\" of the account's latest `principalOf` update (i.e. mint/burn)\n */\n mapping(address => uint256) internal debtIndexOf;\n\n /**\n * @notice The supply cap\n */\n uint256 public override maxTotalSupply;\n\n /**\n * @notice The total amount of minted tokens\n */\n uint256 internal totalSupply_;\n\n /**\n * @notice The timestamp when interest accrual was calculated for the last time\n */\n uint256 public override lastTimestampAccrued;\n\n /**\n * @notice Accumulator of the total earned interest rate since the beginning\n */\n uint256 public override debtIndex;\n\n /**\n * @notice Interest rate\n * @dev Use 0.1e18 for 10% APR\n */\n uint256 public override interestRate;\n\n /**\n * @notice The Synthetic token\n */\n ISyntheticToken public override syntheticToken;\n\n /**\n * @notice If true, disables msAsset minting on this pool\n */\n bool public override isActive;\n\n /**\n * @notice The decimals of the token\n */\n uint8 public override decimals;\n}\n\nabstract contract DebtTokenStorageV2 is DebtTokenStorageV1 {\n /**\n * @notice Pending interest fee to collect\n */\n uint256 public pendingInterestFee;\n}\n" + }, + "contracts/storage/DepositTokenStorage.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"../interfaces/IDepositToken.sol\";\n\nabstract contract DepositTokenStorageV1 is IDepositToken {\n /**\n * @dev The amount of tokens owned by `account`\n */\n mapping(address => uint256) public override balanceOf;\n\n /**\n * @dev The remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}\n */\n mapping(address => mapping(address => uint256)) public override allowance;\n\n /**\n * @notice The name of the token\n */\n string public override name;\n\n /**\n * @notice The symbol of the token\n */\n string public override symbol;\n\n /**\n * @dev Amount of tokens in existence\n */\n uint256 public override totalSupply;\n\n /**\n * @notice The supply cap (in USD)\n */\n uint256 public override maxTotalSupply;\n\n /**\n * @notice Collateral factor for the deposit token\n * @dev Use 18 decimals (e.g. 0.66e18 = 66%)\n */\n uint256 public override collateralFactor;\n\n /**\n * @notice Deposit underlying asset (e.g. MET)\n */\n IERC20 public override underlying;\n\n /**\n * @notice If a collateral isn't active, it disables minting new tokens\n */\n bool public override isActive;\n\n /**\n * @notice The decimals of the token\n */\n uint8 public override decimals;\n}\n" + }, + "contracts/storage/FeeProviderStorage.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"../interfaces/IFeeProvider.sol\";\nimport \"../interfaces/IPoolRegistry.sol\";\nimport \"../interfaces/external/IESMET.sol\";\n\nabstract contract FeeProviderStorageV1 is IFeeProvider {\n struct Tier {\n uint128 min; // esMET min balance needed to be eligible for `discount`\n uint128 discount; // discount in percentage to apply. Use 18 decimals (e.g. 1e16 = 1%)\n }\n\n /**\n * @notice The fee discount tiers\n */\n Tier[] public tiers;\n\n /**\n * @notice The default fee charged when swapping synthetic tokens\n * @dev Use 18 decimals (e.g. 1e16 = 1%)\n */\n uint256 public override defaultSwapFee;\n\n /**\n * @notice The fee charged when depositing collateral\n * @dev Use 18 decimals (e.g. 1e16 = 1%)\n */\n uint256 public override depositFee;\n\n /**\n * @notice The fee charged when minting a synthetic token\n * @dev Use 18 decimals (e.g. 1e16 = 1%)\n */\n uint256 public override issueFee;\n\n /**\n * @notice The fee charged when withdrawing collateral\n * @dev Use 18 decimals (e.g. 1e16 = 1%)\n */\n uint256 public override withdrawFee;\n\n /**\n * @notice The fee charged when repaying debt\n * @dev Use 18 decimals (e.g. 1e16 = 1%)\n */\n uint256 public override repayFee;\n\n /**\n * @notice The fees charged when liquidating a position\n * @dev Use 18 decimals (e.g. 1e16 = 1%)\n */\n LiquidationFees public override liquidationFees;\n\n /**\n * @dev The Pool Registry\n */\n IPoolRegistry public poolRegistry;\n\n /**\n * @notice The esMET contract\n */\n IESMET public esMET;\n}\n" + }, + "contracts/storage/PoolRegistryStorage.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"../dependencies/openzeppelin/utils/structs/EnumerableSet.sol\";\nimport \"../interfaces/IPoolRegistry.sol\";\n\nabstract contract PoolRegistryStorageV1 is IPoolRegistry {\n /**\n * @notice Pools collection\n */\n EnumerableSet.AddressSet internal pools;\n\n /**\n * @notice Prices' oracle\n */\n IMasterOracle public override masterOracle;\n\n /**\n * @notice Fee collector address\n */\n address public override feeCollector;\n\n /**\n * @notice Native token gateway address\n */\n address public override nativeTokenGateway;\n\n /**\n * @notice Map of the ids of the pools\n */\n mapping(address => uint256) public override idOfPool;\n\n /**\n * @notice Counter of ids of the pools\n */\n uint256 public override nextPoolId;\n\n /**\n * @notice Swapper contract\n */\n ISwapper public swapper;\n}\n\nabstract contract PoolRegistryStorageV2 is PoolRegistryStorageV1 {\n /**\n * @notice The Quoter contract\n */\n IQuoter public quoter;\n\n /**\n * @notice The Cross-chain dispatcher contract\n */\n ICrossChainDispatcher public crossChainDispatcher;\n}\n\nabstract contract PoolRegistryStorageV3 is PoolRegistryStorageV2 {\n /**\n * @notice Flag that pause/unpause all cross-chain flash repay operations\n */\n bool public isCrossChainFlashRepayActive;\n}\n" + }, + "contracts/storage/PoolStorage.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"../dependencies/openzeppelin/utils/structs/EnumerableSet.sol\";\nimport \"../lib/MappedEnumerableSet.sol\";\nimport \"../interfaces/IPool.sol\";\nimport \"../interfaces/ISmartFarmingManager.sol\";\n\n// solhint-disable var-name-mixedcase, max-states-count\nabstract contract PoolStorageV1 is IPool {\n /**\n * @notice The debt floor (in USD) for each synthetic token\n * This parameters is used to keep incentive for liquidators (i.e. cover gas and provide enough profit)\n */\n uint256 public override debtFloorInUsd;\n\n uint256 private depositFee__DEPRECATED;\n\n uint256 private issueFee__DEPRECATED;\n\n uint256 private withdrawFee__DEPRECATED;\n\n uint256 private repayFee__DEPRECATED;\n\n uint256 private swapFee__DEPRECATED;\n\n uint256 private liquidationFees__DEPRECATED;\n\n /**\n * @notice The max percent of the debt allowed to liquidate\n * @dev Use 18 decimals (e.g. 1e16 = 1%)\n */\n uint256 public override maxLiquidable;\n\n /**\n * @notice PoolRegistry\n */\n IPoolRegistry public override poolRegistry;\n\n /**\n * @notice Swap feature on/off flag\n */\n bool public override isSwapActive;\n\n /**\n * @notice Treasury contract\n */\n ITreasury public override treasury;\n\n /**\n * @notice Represents collateral's deposits\n */\n EnumerableSet.AddressSet internal depositTokens;\n\n /**\n * @notice Get the deposit token's address from given underlying asset\n */\n mapping(IERC20 => IDepositToken) public override depositTokenOf;\n\n /**\n * @notice Available debt tokens\n */\n EnumerableSet.AddressSet internal debtTokens;\n\n /**\n * @notice Per-account deposit tokens (i.e. tokens that user has balance > 0)\n */\n MappedEnumerableSet.AddressSet internal depositTokensOfAccount;\n\n /**\n * @notice Per-account debt tokens (i.e. tokens that user has balance > 0)\n */\n MappedEnumerableSet.AddressSet internal debtTokensOfAccount;\n\n /**\n * @notice RewardsDistributor contracts\n */\n IRewardsDistributor[] internal rewardsDistributors__DEPRECATED;\n\n /**\n * @notice Get the debt token's address from given synthetic asset\n */\n mapping(ISyntheticToken => IDebtToken) public override debtTokenOf;\n}\n\nabstract contract PoolStorageV2 is PoolStorageV1 {\n ISwapper private swapper__DEPRECATED;\n\n /**\n * @notice FeeProvider contract\n */\n IFeeProvider public override feeProvider;\n\n /**\n * @notice RewardsDistributor contracts\n */\n EnumerableSet.AddressSet internal rewardsDistributors;\n}\n\nabstract contract PoolStorageV3 is PoolStorageV2 {\n /**\n * @notice SmartFarmingManager contract\n */\n ISmartFarmingManager public smartFarmingManager;\n}\n\nabstract contract PoolStorageV4 is PoolStorageV3 {\n /**\n * @notice Flag that pause/unpause pool's cross-chain activities\n */\n bool public isBridgingActive;\n}\n" + }, + "contracts/storage/ProxyOFTStorage.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"../interfaces/ISyntheticToken.sol\";\nimport \"../interfaces/IProxyOFT.sol\";\n\nabstract contract ProxyOFTStorageV1 is IProxyOFT {\n /**\n * @notice The synthetic token contract\n */\n ISyntheticToken internal syntheticToken;\n}\n" + }, + "contracts/storage/QuoterStorage.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"../interfaces/IPoolRegistry.sol\";\nimport \"../interfaces/IQuoter.sol\";\n\nabstract contract QuoterStorageV1 is IQuoter {\n /**\n * @notice The pool registry contract\n */\n IPoolRegistry public poolRegistry;\n}\n" + }, + "contracts/storage/RewardsDistributorStorage.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"../interfaces/IRewardsDistributor.sol\";\n\nabstract contract RewardsDistributorStorageV1 is IRewardsDistributor {\n struct TokenState {\n uint224 index; // The last updated index\n uint32 timestamp; // The timestamp of the latest index update\n }\n\n /**\n * @notice The token to reward\n */\n IERC20 public override rewardToken;\n\n /**\n * @notice Track tokens for reward\n */\n IERC20[] public override tokens;\n\n /**\n * @notice The amount of token distributed for each token per second\n */\n mapping(IERC20 => uint256) public override tokenSpeeds;\n\n /**\n * @notice The reward state for each token\n */\n mapping(IERC20 => TokenState) public override tokenStates;\n\n /**\n * @notice The supply index for each token for each account as of the last time they accrued token\n */\n mapping(IERC20 => mapping(address => uint256)) public override accountIndexOf;\n\n /**\n * @notice The token accrued but not yet transferred to each user\n */\n mapping(address => uint256) public override tokensAccruedOf;\n}\n\nabstract contract RewardsDistributorStorageV2 is RewardsDistributorStorageV1 {\n address public tokenSpeedKeeper;\n}\n" + }, + "contracts/storage/SmartFarmingManagerStorage.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"../interfaces/ISmartFarmingManager.sol\";\n\n// solhint-disable var-name-mixedcase, max-states-count\nabstract contract SmartFarmingManagerStorageV1 is ISmartFarmingManager {\n /**\n * @notice Cross-chain Leverage request data\n */\n struct CrossChainLeverage {\n uint16 dstChainId;\n IERC20 bridgeToken;\n IDepositToken depositToken;\n ISyntheticToken syntheticToken;\n uint256 amountIn;\n uint256 debtAmount;\n uint256 depositAmountMin;\n address account;\n bool finished;\n IERC20 tokenIn;\n }\n\n /**\n * @notice Cross-chain Flash repay request data\n */\n struct CrossChainFlashRepay {\n uint16 dstChainId;\n ISyntheticToken syntheticToken;\n uint256 repayAmountMin;\n address account;\n bool finished;\n }\n\n /**\n * @notice Cross-chain requests counter\n */\n uint256 public crossChainRequestsLength;\n\n /**\n * @notice Cross-chain leverage requests\n */\n mapping(uint256 => CrossChainLeverage) public crossChainLeverages;\n\n /**\n * @notice Cross-chain flash repay requests\n */\n mapping(uint256 => CrossChainFlashRepay) public crossChainFlashRepays;\n}\n" + }, + "contracts/storage/SyntheticTokenStorage.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"../interfaces/ISyntheticToken.sol\";\n\nabstract contract SyntheticTokenStorageV1 is ISyntheticToken {\n /**\n * @notice The name of the token\n */\n string public override name;\n\n /**\n * @notice The symbol of the token\n */\n string public override symbol;\n\n /**\n * @dev The amount of tokens owned by `account`\n */\n mapping(address => uint256) public override balanceOf;\n\n /**\n * @dev The remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}\n */\n mapping(address => mapping(address => uint256)) public override allowance;\n\n /**\n * @dev Amount of tokens in existence\n */\n uint256 public override totalSupply;\n\n /**\n * @notice The supply cap\n */\n uint256 public override maxTotalSupply;\n\n /**\n * @dev The Pool Registry\n */\n IPoolRegistry public override poolRegistry;\n\n /**\n * @notice If true, disables msAsset minting globally\n */\n bool public override isActive;\n\n /**\n * @notice The decimals of the token\n */\n uint8 public override decimals;\n\n /**\n * @notice The ProxyOFT contract\n */\n IProxyOFT public override proxyOFT;\n\n /**\n * @notice Track amount received cross-chain\n */\n uint256 public totalBridgedIn;\n\n /**\n * @notice Track amount sent cross-chain\n */\n uint256 public totalBridgedOut;\n\n /**\n * @notice Maximum allowed bridged-in (mint-related) supply\n */\n uint256 public maxBridgedInSupply;\n\n /**\n * @notice Maximum allowed bridged-out (burn-related) supply\n */\n uint256 public maxBridgedOutSupply;\n}\n" + }, + "contracts/storage/TreasuryStorage.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"../interfaces/ITreasury.sol\";\n\n// solhint-disable-next-line no-empty-blocks\nabstract contract TreasuryStorageV1 is ITreasury {\n\n}\n" + }, + "contracts/SyntheticToken.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"./dependencies/openzeppelin-upgradeable/proxy/utils/Initializable.sol\";\nimport \"./interfaces/IPool.sol\";\nimport \"./interfaces/IManageable.sol\";\nimport \"./lib/WadRayMath.sol\";\nimport \"./storage/SyntheticTokenStorage.sol\";\n\nerror SenderIsNotGovernor();\nerror SenderCanNotBurn();\nerror SenderCanNotMint();\nerror SenderCanNotSeize();\nerror SyntheticIsInactive();\nerror NameIsNull();\nerror SymbolIsNull();\nerror DecimalsIsNull();\nerror PoolRegistryIsNull();\nerror DecreasedAllowanceBelowZero();\nerror AmountExceedsAllowance();\nerror ApproveFromTheZeroAddress();\nerror ApproveToTheZeroAddress();\nerror BurnFromTheZeroAddress();\nerror BurnAmountExceedsBalance();\nerror MintToTheZeroAddress();\nerror SurpassMaxBridgingSupply();\nerror SurpassMaxSynthSupply();\nerror TransferFromTheZeroAddress();\nerror TransferToTheZeroAddress();\nerror TransferAmountExceedsBalance();\nerror NewValueIsSameAsCurrent();\nerror AddressIsNull();\n\n/**\n * @title Synthetic Token contract\n */\ncontract SyntheticToken is Initializable, SyntheticTokenStorageV1 {\n using WadRayMath for uint256;\n\n string public constant VERSION = \"1.3.0\";\n\n /// @notice Emitted when active flag is updated\n event SyntheticTokenActiveUpdated(bool newActive);\n\n /// @notice Emitted when max total supply is updated\n event MaxTotalSupplyUpdated(uint256 oldMaxTotalSupply, uint256 newMaxTotalSupply);\n\n /// @notice Emitted when max bridged-in supply is updated\n event MaxBridgedInSupplyUpdated(uint256 oldMaxBridgedInSupply, uint256 newMaxBridgedInSupply);\n\n /// @notice Emitted when max bridged-out supply is updated\n event MaxBridgedOutSupplyUpdated(uint256 oldMaxBridgedOutSupply, uint256 newMaxBridgedOutSupply);\n\n /// @notice Emitted when proxyOFT is updated\n event ProxyOFTUpdated(IProxyOFT oldProxyOFT, IProxyOFT newProxyOFT);\n\n /**\n * @notice Throws if caller isn't the governor\n */\n modifier onlyGovernor() {\n if (msg.sender != poolRegistry.governor()) revert SenderIsNotGovernor();\n _;\n }\n\n /**\n * @dev Throws if sender can't burn\n */\n modifier onlyIfCanBurn() {\n if (!_isMsgSenderProxyOFT() && !_isMsgSenderPool() && !_isMsgSenderDebtToken()) revert SenderCanNotBurn();\n _;\n }\n\n /**\n * @dev Throws if sender can't mint\n */\n modifier onlyIfCanMint() {\n if (!_isMsgSenderProxyOFT() && !_isMsgSenderPool() && !_isMsgSenderDebtToken()) revert SenderCanNotMint();\n _;\n }\n\n /**\n * @dev Throws if sender can't seize\n */\n modifier onlyIfCanSeize() {\n if (!_isMsgSenderPool() && !_isMsgSenderDebtToken()) revert SenderCanNotSeize();\n _;\n }\n\n /**\n * @dev Throws if synthetic token isn't enabled\n */\n modifier onlyIfSyntheticTokenIsActive() {\n if (!isActive) revert SyntheticIsInactive();\n _;\n }\n\n constructor() {\n _disableInitializers();\n }\n\n function initialize(\n string calldata name_,\n string calldata symbol_,\n uint8 decimals_,\n IPoolRegistry poolRegistry_\n ) external initializer {\n if (bytes(name_).length == 0) revert NameIsNull();\n if (bytes(symbol_).length == 0) revert SymbolIsNull();\n if (decimals_ == 0) revert DecimalsIsNull();\n if (address(poolRegistry_) == address(0)) revert PoolRegistryIsNull();\n\n poolRegistry = poolRegistry_;\n name = name_;\n symbol = symbol_;\n decimals = decimals_;\n isActive = true;\n maxTotalSupply = type(uint256).max;\n }\n\n /**\n * @notice Set `amount` as the allowance of `spender` over the caller's tokens\n */\n function approve(address spender_, uint256 amount_) external override returns (bool) {\n _approve(msg.sender, spender_, amount_);\n return true;\n }\n\n /**\n * @notice Get net bridged-in circulating supply\n * @dev The supply is calculated using `MAX(totalBridgedIn - totalBridgedOut, 0)`\n */\n function bridgedInSupply() public view returns (uint256 _supply) {\n uint256 _totalBridgedIn = totalBridgedIn;\n uint256 _totalBridgedOut = totalBridgedOut;\n\n if (_totalBridgedIn > _totalBridgedOut) {\n return _totalBridgedIn - _totalBridgedOut;\n }\n }\n\n /**\n * @notice Get net bridged-out circulating supply\n * @dev The supply is calculated using `MAX(totalBridgedOut - totalBridgedIn, 0)`\n */\n function bridgedOutSupply() public view returns (uint256 _supply) {\n uint256 _totalBridgedIn = totalBridgedIn;\n uint256 _totalBridgedOut = totalBridgedOut;\n\n if (_totalBridgedOut > _totalBridgedIn) {\n return _totalBridgedOut - _totalBridgedIn;\n }\n }\n\n /**\n * @notice Burn synthetic token\n * @param from_ The account to burn from\n * @param amount_ The amount to burn\n */\n function burn(address from_, uint256 amount_) external override onlyIfCanBurn {\n _burn(from_, amount_);\n }\n\n /**\n * @notice Atomically decrease the allowance granted to `spender` by the caller\n */\n function decreaseAllowance(address spender_, uint256 subtractedValue_) external returns (bool) {\n uint256 _currentAllowance = allowance[msg.sender][spender_];\n if (_currentAllowance < subtractedValue_) revert DecreasedAllowanceBelowZero();\n unchecked {\n _approve(msg.sender, spender_, _currentAllowance - subtractedValue_);\n }\n return true;\n }\n\n /**\n * @notice Atomically increase the allowance granted to `spender` by the caller\n */\n function increaseAllowance(address spender_, uint256 addedValue_) external returns (bool) {\n _approve(msg.sender, spender_, allowance[msg.sender][spender_] + addedValue_);\n return true;\n }\n\n /**\n * @notice Mint synthetic token\n * @param to_ The account to mint to\n * @param amount_ The amount to mint\n */\n function mint(address to_, uint256 amount_) external override onlyIfCanMint {\n _mint(to_, amount_);\n }\n\n /**\n * @notice Seize synthetic tokens\n * @dev Same as _transfer\n * @param to_ The account to seize from\n * @param to_ The beneficiary account\n * @param amount_ The amount to seize\n */\n function seize(address from_, address to_, uint256 amount_) external override onlyIfCanSeize {\n _transfer(from_, to_, amount_);\n }\n\n /// @inheritdoc IERC20\n function transfer(address recipient_, uint256 amount_) external override returns (bool) {\n _transfer(msg.sender, recipient_, amount_);\n return true;\n }\n\n /// @inheritdoc IERC20\n function transferFrom(address sender_, address recipient_, uint256 amount_) external override returns (bool) {\n uint256 _currentAllowance = allowance[sender_][msg.sender];\n if (_currentAllowance != type(uint256).max) {\n if (_currentAllowance < amount_) revert AmountExceedsAllowance();\n unchecked {\n _approve(sender_, msg.sender, _currentAllowance - amount_);\n }\n }\n\n _transfer(sender_, recipient_, amount_);\n\n return true;\n }\n\n /**\n * @notice Set `amount` as the allowance of `spender` over the `owner` s tokens\n */\n function _approve(address owner_, address spender_, uint256 amount_) private {\n if (owner_ == address(0)) revert ApproveFromTheZeroAddress();\n if (spender_ == address(0)) revert ApproveToTheZeroAddress();\n\n allowance[owner_][spender_] = amount_;\n emit Approval(owner_, spender_, amount_);\n }\n\n /**\n * @notice Destroy `amount` tokens from `account`, reducing the\n * total supply\n */\n function _burn(address account_, uint256 amount_) private {\n if (account_ == address(0)) revert BurnFromTheZeroAddress();\n\n if (_isMsgSenderProxyOFT()) {\n totalBridgedOut += amount_;\n if (bridgedOutSupply() > maxBridgedOutSupply) revert SurpassMaxBridgingSupply();\n }\n\n uint256 _currentBalance = balanceOf[account_];\n if (_currentBalance < amount_) revert BurnAmountExceedsBalance();\n unchecked {\n balanceOf[account_] = _currentBalance - amount_;\n totalSupply -= amount_;\n }\n\n emit Transfer(account_, address(0), amount_);\n }\n\n /**\n * @dev Check if the sender is proxyOFT\n */\n function _isMsgSenderProxyOFT() private view returns (bool) {\n return msg.sender == address(proxyOFT);\n }\n\n /**\n * @notice Check if the sender is a valid DebtToken contract\n */\n function _isMsgSenderDebtToken() private view returns (bool) {\n IPool _pool = IManageable(msg.sender).pool();\n\n return\n poolRegistry.isPoolRegistered(address(_pool)) &&\n _pool.doesDebtTokenExist(IDebtToken(msg.sender)) &&\n IDebtToken(msg.sender).syntheticToken() == this;\n }\n\n /**\n * @notice Check if the sender is a valid Pool contract\n */\n function _isMsgSenderPool() private view returns (bool) {\n return poolRegistry.isPoolRegistered(msg.sender) && IPool(msg.sender).doesSyntheticTokenExist(this);\n }\n\n /**\n * @notice Create `amount` tokens and assigns them to `account`, increasing\n * the total supply\n */\n function _mint(address account_, uint256 amount_) private onlyIfSyntheticTokenIsActive {\n if (account_ == address(0)) revert MintToTheZeroAddress();\n\n if (_isMsgSenderProxyOFT()) {\n totalBridgedIn += amount_;\n if (bridgedInSupply() > maxBridgedInSupply) revert SurpassMaxBridgingSupply();\n }\n\n totalSupply += amount_;\n if (totalSupply > maxTotalSupply) revert SurpassMaxSynthSupply();\n balanceOf[account_] += amount_;\n emit Transfer(address(0), account_, amount_);\n }\n\n /**\n * @notice Move `amount` of tokens from `sender` to `recipient`\n */\n function _transfer(address sender_, address recipient_, uint256 amount_) private {\n if (sender_ == address(0)) revert TransferFromTheZeroAddress();\n if (recipient_ == address(0)) revert TransferToTheZeroAddress();\n\n uint256 senderBalance = balanceOf[sender_];\n if (senderBalance < amount_) revert TransferAmountExceedsBalance();\n unchecked {\n balanceOf[sender_] = senderBalance - amount_;\n balanceOf[recipient_] += amount_;\n }\n\n emit Transfer(sender_, recipient_, amount_);\n }\n\n /**\n * @notice Enable/Disable Synthetic Token\n */\n function toggleIsActive() external override onlyGovernor {\n bool _newIsActive = !isActive;\n emit SyntheticTokenActiveUpdated(_newIsActive);\n isActive = _newIsActive;\n }\n\n /**\n * @notice Update max total supply\n * @param newMaxTotalSupply_ The new max total supply\n */\n function updateMaxTotalSupply(uint256 newMaxTotalSupply_) external override onlyGovernor {\n uint256 _currentMaxTotalSupply = maxTotalSupply;\n if (newMaxTotalSupply_ == _currentMaxTotalSupply) revert NewValueIsSameAsCurrent();\n emit MaxTotalSupplyUpdated(_currentMaxTotalSupply, newMaxTotalSupply_);\n maxTotalSupply = newMaxTotalSupply_;\n }\n\n /**\n * @notice Update max bridged-in supply\n */\n function updateMaxBridgedInSupply(uint256 maxBridgedInSupply_) external onlyGovernor {\n uint256 _currentMaxBridgedInBalance = maxBridgedInSupply;\n if (maxBridgedInSupply_ == _currentMaxBridgedInBalance) revert NewValueIsSameAsCurrent();\n emit MaxBridgedInSupplyUpdated(_currentMaxBridgedInBalance, maxBridgedInSupply_);\n maxBridgedInSupply = maxBridgedInSupply_;\n }\n\n /**\n * @notice Update max bridged-out supply\n */\n function updateMaxBridgedOutSupply(uint256 maxBridgedOutSupply_) external onlyGovernor {\n uint256 _currentMaxBridgedOutBalance = maxBridgedOutSupply;\n if (maxBridgedOutSupply_ == _currentMaxBridgedOutBalance) revert NewValueIsSameAsCurrent();\n emit MaxBridgedOutSupplyUpdated(_currentMaxBridgedOutBalance, maxBridgedOutSupply_);\n maxBridgedOutSupply = maxBridgedOutSupply_;\n }\n\n /**\n * @notice Update proxyOFT\n * @param newProxyOFT_ Address of new ProxyOFT\n */\n function updateProxyOFT(IProxyOFT newProxyOFT_) external override onlyGovernor {\n if (address(newProxyOFT_) == address(0)) revert AddressIsNull();\n IProxyOFT _currentProxyOFT = proxyOFT;\n if (newProxyOFT_ == _currentProxyOFT) revert NewValueIsSameAsCurrent();\n emit ProxyOFTUpdated(_currentProxyOFT, newProxyOFT_);\n proxyOFT = newProxyOFT_;\n }\n}\n" + }, + "contracts/Treasury.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"./utils/ReentrancyGuard.sol\";\nimport \"./dependencies/openzeppelin/token/ERC20/utils/SafeERC20.sol\";\nimport \"./access/Manageable.sol\";\nimport \"./storage/TreasuryStorage.sol\";\nimport \"./interfaces/external/IVPool.sol\";\nimport \"./interfaces/external/IPoolRewards.sol\";\n\nerror SenderIsNotDepositToken();\nerror AddressIsNull();\nerror RecipientIsNull();\nerror AmountIsZero();\n\n/**\n * @title Treasury contract\n */\ncontract Treasury is ReentrancyGuard, Manageable, TreasuryStorageV1 {\n using SafeERC20 for IERC20;\n using SafeERC20 for IDepositToken;\n\n string public constant VERSION = \"1.3.0\";\n\n /**\n * @dev Throws if caller isn't a deposit token\n */\n modifier onlyIfDepositToken() {\n if (!pool.doesDepositTokenExist(IDepositToken(msg.sender))) revert SenderIsNotDepositToken();\n _;\n }\n\n constructor() {\n _disableInitializers();\n }\n\n function initialize(IPool pool_) external initializer {\n __ReentrancyGuard_init();\n __Manageable_init(pool_);\n }\n\n /**\n * @notice Transfer all funds to another contract\n * @dev This function can become too expensive depending on the length of the arrays\n * @param newTreasury_ The new treasury\n */\n function migrateTo(address newTreasury_) external override onlyPool {\n if (newTreasury_ == address(0)) revert AddressIsNull();\n\n address[] memory _depositTokens = pool.getDepositTokens();\n uint256 _depositTokensLength = _depositTokens.length;\n\n for (uint256 i; i < _depositTokensLength; ++i) {\n IERC20 _underlying = IDepositToken(_depositTokens[i]).underlying();\n\n uint256 _underlyingBalance = _underlying.balanceOf(address(this));\n\n if (_underlyingBalance > 0) {\n _underlying.safeTransfer(newTreasury_, _underlyingBalance);\n }\n }\n }\n\n /**\n * @notice Pull token from the Treasury\n * @param to_ The transfer recipient\n * @param amount_ The transfer amount\n */\n function pull(address to_, uint256 amount_) external override nonReentrant onlyIfDepositToken {\n if (to_ == address(0)) revert RecipientIsNull();\n if (amount_ == 0) revert AmountIsZero();\n IDepositToken(msg.sender).underlying().safeTransfer(to_, amount_);\n }\n\n /**\n * @notice Claim and withdraw rewards from Vesper\n * @param vPool_ The Vesper pool to collect rewards from\n * @param to_ The transfer recipient\n */\n function claimFromVesper(IVPool vPool_, address to_) external onlyGovernor {\n IPoolRewards _rewards = IPoolRewards(vPool_.poolRewards());\n _rewards.updateReward(address(this));\n _rewards.claimReward(address(this));\n\n address[] memory _rewardTokens = _rewards.getRewardTokens();\n uint256 _len = _rewardTokens.length;\n for (uint256 i; i < _len; ++i) {\n IERC20 _token = IERC20(_rewardTokens[i]);\n uint256 _amount = _token.balanceOf(address(this));\n\n // Note: If the reward token is a collateral, transfer the surpass balance only\n IDepositToken _depositToken = pool.depositTokenOf(_token);\n if (address(_depositToken) != address(0)) {\n _amount -= _depositToken.totalSupply();\n }\n\n if (_amount > 0) {\n _token.safeTransfer(to_, _amount);\n }\n }\n }\n}\n" + }, + "contracts/upgraders/CrossChainDispatcherUpgrader.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"./UpgraderBase.sol\";\n\ncontract CrossChainDispatcherUpgrader is UpgraderBase {\n constructor(address _owner) {\n transferOwnership(_owner);\n }\n\n /// @inheritdoc UpgraderBase\n function _calls() internal pure virtual override returns (bytes[] memory _callsList) {\n _callsList = new bytes[](9);\n _callsList[0] = abi.encodeWithSignature(\"poolRegistry()\");\n _callsList[1] = abi.encodeWithSignature(\"lzBaseGasLimit()\");\n _callsList[2] = abi.encodeWithSignature(\"stargateSlippage()\");\n _callsList[3] = abi.encodeWithSignature(\"flashRepayCallbackTxGasLimit()\");\n _callsList[4] = abi.encodeWithSignature(\"flashRepaySwapTxGasLimit()\");\n _callsList[5] = abi.encodeWithSignature(\"leverageCallbackTxGasLimit()\");\n _callsList[6] = abi.encodeWithSignature(\"leverageSwapTxGasLimit()\");\n _callsList[7] = abi.encodeWithSignature(\"isBridgingActive()\");\n _callsList[8] = abi.encodeWithSignature(\"stargateRouter()\");\n }\n}\n\ncontract CrossChainDispatcherUpgraderV2 is CrossChainDispatcherUpgrader {\n constructor(address _owner) CrossChainDispatcherUpgrader(_owner) {}\n\n /// @inheritdoc UpgraderBase\n function _calls() internal pure override returns (bytes[] memory _callsList) {\n _callsList = new bytes[](9);\n _callsList[0] = abi.encodeWithSignature(\"poolRegistry()\");\n _callsList[1] = abi.encodeWithSignature(\"lzBaseGasLimit()\");\n _callsList[2] = abi.encodeWithSignature(\"stargateSlippage()\");\n _callsList[3] = abi.encodeWithSignature(\"flashRepayCallbackTxGasLimit()\");\n _callsList[4] = abi.encodeWithSignature(\"flashRepaySwapTxGasLimit()\");\n _callsList[5] = abi.encodeWithSignature(\"leverageCallbackTxGasLimit()\");\n _callsList[6] = abi.encodeWithSignature(\"leverageSwapTxGasLimit()\");\n _callsList[7] = abi.encodeWithSignature(\"isBridgingActive()\");\n _callsList[8] = abi.encodeWithSignature(\"stargateComposer()\");\n }\n}\n" + }, + "contracts/upgraders/DebtTokenUpgrader.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"./UpgraderBase.sol\";\n\ncontract DebtTokenUpgrader is UpgraderBase {\n constructor(address _owner) {\n transferOwnership(_owner);\n }\n\n /// @inheritdoc UpgraderBase\n function _calls() internal pure override returns (bytes[] memory _callsList) {\n _callsList = new bytes[](11);\n _callsList[0] = abi.encodeWithSignature(\"totalSupply()\");\n _callsList[1] = abi.encodeWithSignature(\"lastTimestampAccrued()\");\n _callsList[2] = abi.encodeWithSignature(\"maxTotalSupply()\");\n _callsList[3] = abi.encodeWithSignature(\"interestRate()\");\n _callsList[4] = abi.encodeWithSignature(\"debtIndex()\");\n _callsList[5] = abi.encodeWithSignature(\"decimals()\");\n _callsList[6] = abi.encodeWithSignature(\"name()\");\n _callsList[7] = abi.encodeWithSignature(\"symbol()\");\n _callsList[8] = abi.encodeWithSignature(\"syntheticToken()\");\n _callsList[9] = abi.encodeWithSignature(\"isActive()\");\n _callsList[10] = abi.encodeWithSignature(\"governor()\");\n }\n}\n" + }, + "contracts/upgraders/DepositTokenUpgrader.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"./UpgraderBase.sol\";\n\ncontract DepositTokenUpgrader is UpgraderBase {\n constructor(address _owner) {\n transferOwnership(_owner);\n }\n\n /// @inheritdoc UpgraderBase\n function _calls() internal pure override returns (bytes[] memory _callsList) {\n _callsList = new bytes[](9);\n _callsList[0] = abi.encodeWithSignature(\"name()\");\n _callsList[1] = abi.encodeWithSignature(\"symbol()\");\n _callsList[2] = abi.encodeWithSignature(\"decimals()\");\n _callsList[3] = abi.encodeWithSignature(\"totalSupply()\");\n _callsList[4] = abi.encodeWithSignature(\"maxTotalSupply()\");\n _callsList[5] = abi.encodeWithSignature(\"collateralFactor()\");\n _callsList[6] = abi.encodeWithSignature(\"underlying()\");\n _callsList[7] = abi.encodeWithSignature(\"isActive()\");\n _callsList[8] = abi.encodeWithSignature(\"governor()\");\n }\n}\n" + }, + "contracts/upgraders/FeeProviderUpgrader.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"./UpgraderBase.sol\";\n\ncontract FeeProviderUpgrader is UpgraderBase {\n constructor(address owner_) {\n transferOwnership(owner_);\n }\n\n /// @inheritdoc UpgraderBase\n function _calls() internal pure override returns (bytes[] memory callsList_) {\n callsList_ = new bytes[](6);\n callsList_[0] = abi.encodeWithSignature(\"depositFee()\");\n callsList_[1] = abi.encodeWithSignature(\"issueFee()\");\n callsList_[2] = abi.encodeWithSignature(\"withdrawFee()\");\n callsList_[3] = abi.encodeWithSignature(\"repayFee()\");\n callsList_[4] = abi.encodeWithSignature(\"liquidationFees()\");\n callsList_[5] = abi.encodeWithSignature(\"defaultSwapFee()\");\n }\n}\n" + }, + "contracts/upgraders/PoolRegistryUpgrader.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"./UpgraderBase.sol\";\n\ncontract PoolRegistryUpgrader is UpgraderBase {\n constructor(address _owner) {\n transferOwnership(_owner);\n }\n\n /// @inheritdoc UpgraderBase\n function _calls() internal pure virtual override returns (bytes[] memory _callsList) {\n _callsList = new bytes[](3);\n _callsList[0] = abi.encodeWithSignature(\"masterOracle()\");\n _callsList[1] = abi.encodeWithSignature(\"feeCollector()\");\n _callsList[2] = abi.encodeWithSignature(\"governor()\");\n }\n}\n\ncontract PoolRegistryUpgraderV2 is PoolRegistryUpgrader {\n // solhint-disable-next-line no-empty-blocks\n constructor(address _owner) PoolRegistryUpgrader(_owner) {}\n\n /// @inheritdoc UpgraderBase\n function _calls() internal pure override returns (bytes[] memory _callsList) {\n _callsList = new bytes[](8);\n _callsList[0] = abi.encodeWithSignature(\"governor()\");\n _callsList[1] = abi.encodeWithSignature(\"masterOracle()\");\n _callsList[2] = abi.encodeWithSignature(\"feeCollector()\");\n _callsList[3] = abi.encodeWithSignature(\"nativeTokenGateway()\");\n _callsList[4] = abi.encodeWithSignature(\"nextPoolId()\");\n _callsList[5] = abi.encodeWithSignature(\"swapper()\");\n _callsList[6] = abi.encodeWithSignature(\"quoter()\");\n _callsList[7] = abi.encodeWithSignature(\"crossChainDispatcher()\");\n }\n}\n" + }, + "contracts/upgraders/PoolUpgrader.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"./UpgraderBase.sol\";\n\ncontract PoolUpgrader is UpgraderBase {\n constructor(address _owner) {\n transferOwnership(_owner);\n }\n\n /// @inheritdoc UpgraderBase\n function _calls() internal pure virtual override returns (bytes[] memory _callsList) {\n _callsList = new bytes[](12);\n _callsList[0] = abi.encodeWithSignature(\"debtFloorInUsd()\");\n _callsList[1] = abi.encodeWithSignature(\"depositFee()\");\n _callsList[2] = abi.encodeWithSignature(\"issueFee()\");\n _callsList[3] = abi.encodeWithSignature(\"withdrawFee()\");\n _callsList[4] = abi.encodeWithSignature(\"repayFee()\");\n _callsList[5] = abi.encodeWithSignature(\"liquidationFees()\");\n _callsList[6] = abi.encodeWithSignature(\"swapFee()\");\n _callsList[7] = abi.encodeWithSignature(\"maxLiquidable()\");\n _callsList[8] = abi.encodeWithSignature(\"treasury()\");\n _callsList[9] = abi.encodeWithSignature(\"poolRegistry()\");\n _callsList[10] = abi.encodeWithSignature(\"isSwapActive()\");\n _callsList[11] = abi.encodeWithSignature(\"governor()\");\n }\n}\n\ncontract PoolUpgraderV2 is PoolUpgrader {\n // solhint-disable-next-line no-empty-blocks\n constructor(address _owner) PoolUpgrader(_owner) {}\n\n /// @inheritdoc UpgraderBase\n function _calls() internal pure virtual override returns (bytes[] memory _callsList) {\n _callsList = new bytes[](6);\n _callsList[0] = abi.encodeWithSignature(\"debtFloorInUsd()\");\n _callsList[1] = abi.encodeWithSignature(\"maxLiquidable()\");\n _callsList[2] = abi.encodeWithSignature(\"treasury()\");\n _callsList[3] = abi.encodeWithSignature(\"poolRegistry()\");\n _callsList[4] = abi.encodeWithSignature(\"isSwapActive()\");\n _callsList[5] = abi.encodeWithSignature(\"governor()\");\n }\n}\n\ncontract PoolUpgraderV3 is PoolUpgraderV2 {\n // solhint-disable-next-line no-empty-blocks\n constructor(address _owner) PoolUpgraderV2(_owner) {}\n\n /// @inheritdoc UpgraderBase\n function _calls() internal pure virtual override returns (bytes[] memory _callsList) {\n _callsList = new bytes[](8);\n _callsList[0] = abi.encodeWithSignature(\"governor()\");\n _callsList[1] = abi.encodeWithSignature(\"debtFloorInUsd()\");\n _callsList[2] = abi.encodeWithSignature(\"maxLiquidable()\");\n _callsList[3] = abi.encodeWithSignature(\"poolRegistry()\");\n _callsList[4] = abi.encodeWithSignature(\"isSwapActive()\");\n _callsList[5] = abi.encodeWithSignature(\"treasury()\");\n _callsList[6] = abi.encodeWithSignature(\"feeProvider()\");\n _callsList[7] = abi.encodeWithSignature(\"smartFarmingManager()\");\n }\n}\n" + }, + "contracts/upgraders/ProxyOFTUpgrader.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"./UpgraderBase.sol\";\n\ncontract ProxyOFTUpgrader is UpgraderBase {\n constructor(address _owner) {\n transferOwnership(_owner);\n }\n\n /// @inheritdoc UpgraderBase\n function _calls() internal pure virtual override returns (bytes[] memory _callsList) {\n _callsList = new bytes[](1);\n _callsList[0] = abi.encodeWithSignature(\"syntheticToken()\");\n }\n}\n\ncontract ProxyOFTUpgraderV2 is ProxyOFTUpgrader {\n // solhint-disable-next-line no-empty-blocks\n constructor(address _owner) ProxyOFTUpgrader(_owner) {}\n\n /// @inheritdoc UpgraderBase\n function _calls() internal pure virtual override returns (bytes[] memory _callsList) {\n _callsList = new bytes[](1);\n _callsList[0] = abi.encodeWithSignature(\"token()\");\n }\n}\n" + }, + "contracts/upgraders/QuoterUpgrader.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"./UpgraderBase.sol\";\n\ncontract QuoterUpgrader is UpgraderBase {\n constructor(address _owner) {\n transferOwnership(_owner);\n }\n\n /// @inheritdoc UpgraderBase\n function _calls() internal pure override returns (bytes[] memory _callsList) {\n _callsList = new bytes[](1);\n _callsList[0] = abi.encodeWithSignature(\"poolRegistry()\");\n }\n}\n" + }, + "contracts/upgraders/RewardsDistributorUpgrader.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"./UpgraderBase.sol\";\n\ncontract RewardsDistributorUpgrader is UpgraderBase {\n constructor(address _owner) {\n transferOwnership(_owner);\n }\n\n /// @inheritdoc UpgraderBase\n function _calls() internal pure override returns (bytes[] memory _callsList) {\n _callsList = new bytes[](2);\n _callsList[0] = abi.encodeWithSignature(\"rewardToken()\");\n _callsList[1] = abi.encodeWithSignature(\"governor()\");\n }\n}\n" + }, + "contracts/upgraders/SmartFarmingManagerUpgrader.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"./UpgraderBase.sol\";\n\ncontract SmartFarmingManagerUpgrader is UpgraderBase {\n constructor(address _owner) {\n transferOwnership(_owner);\n }\n\n /// @inheritdoc UpgraderBase\n function _calls() internal pure override returns (bytes[] memory _callsList) {\n _callsList = new bytes[](2);\n _callsList[0] = abi.encodeWithSignature(\"pool()\");\n _callsList[1] = abi.encodeWithSignature(\"crossChainRequestsLength()\");\n }\n}\n" + }, + "contracts/upgraders/SyntheticTokenUpgrader.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"./UpgraderBase.sol\";\n\ncontract SyntheticTokenUpgrader is UpgraderBase {\n constructor(address _owner) {\n transferOwnership(_owner);\n }\n\n /// @inheritdoc UpgraderBase\n function _calls() internal pure virtual override returns (bytes[] memory _callsList) {\n _callsList = new bytes[](7);\n _callsList[0] = abi.encodeWithSignature(\"name()\");\n _callsList[1] = abi.encodeWithSignature(\"symbol()\");\n _callsList[2] = abi.encodeWithSignature(\"decimals()\");\n _callsList[3] = abi.encodeWithSignature(\"totalSupply()\");\n _callsList[4] = abi.encodeWithSignature(\"maxTotalSupply()\");\n _callsList[5] = abi.encodeWithSignature(\"isActive()\");\n _callsList[6] = abi.encodeWithSignature(\"poolRegistry()\");\n }\n}\n\ncontract SyntheticTokenUpgraderV2 is SyntheticTokenUpgrader {\n constructor(address _owner) SyntheticTokenUpgrader(_owner) {\n transferOwnership(_owner);\n }\n\n /// @inheritdoc UpgraderBase\n function _calls() internal pure virtual override returns (bytes[] memory _callsList) {\n _callsList = new bytes[](12);\n _callsList[0] = abi.encodeWithSignature(\"name()\");\n _callsList[1] = abi.encodeWithSignature(\"symbol()\");\n _callsList[2] = abi.encodeWithSignature(\"decimals()\");\n _callsList[3] = abi.encodeWithSignature(\"totalSupply()\");\n _callsList[4] = abi.encodeWithSignature(\"maxTotalSupply()\");\n _callsList[5] = abi.encodeWithSignature(\"isActive()\");\n _callsList[6] = abi.encodeWithSignature(\"poolRegistry()\");\n _callsList[7] = abi.encodeWithSignature(\"proxyOFT()\");\n _callsList[8] = abi.encodeWithSignature(\"totalBridgedIn()\");\n _callsList[9] = abi.encodeWithSignature(\"totalBridgedOut()\");\n _callsList[10] = abi.encodeWithSignature(\"maxBridgedInSupply()\");\n _callsList[11] = abi.encodeWithSignature(\"maxBridgedOutSupply()\");\n }\n}\n" + }, + "contracts/upgraders/TreasuryUpgrader.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"./UpgraderBase.sol\";\n\ncontract TreasuryUpgrader is UpgraderBase {\n constructor(address _owner) {\n transferOwnership(_owner);\n }\n\n /// @inheritdoc UpgraderBase\n function _calls() internal pure override returns (bytes[] memory _callsList) {\n _callsList = new bytes[](1);\n _callsList[0] = abi.encodeWithSignature(\"governor()\");\n }\n}\n" + }, + "contracts/upgraders/UpgraderBase.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"../dependencies/openzeppelin/proxy/transparent/ProxyAdmin.sol\";\nimport \"../dependencies/openzeppelin//proxy/transparent/TransparentUpgradeableProxy.sol\";\nimport \"../interfaces/external/IMulticall.sol\";\n\nerror StorageValueIsNotEqual();\n\nabstract contract UpgraderBase is ProxyAdmin {\n // Note: `Multicall3` contract has same address for all chains\n // solhint-disable-next-line const-name-snakecase\n address public constant multicall = 0xcA11bde05977b3631167028862bE2a173976CA11;\n\n /// @inheritdoc ProxyAdmin\n function upgrade(TransparentUpgradeableProxy proxy_, address implementation_) public override onlyOwner {\n bytes[] memory _callsList = _calls();\n bytes[] memory _beforeResults = _aggregate(proxy_, _callsList);\n\n proxy_.upgradeTo(implementation_);\n\n bytes[] memory _afterResults = _aggregate(proxy_, _callsList);\n _checkResults(_beforeResults, _afterResults);\n }\n\n /// @inheritdoc ProxyAdmin\n function upgradeAndCall(\n TransparentUpgradeableProxy proxy_,\n address implementation_,\n bytes calldata data_\n ) public payable override onlyOwner {\n bytes[] memory _callsList = _calls();\n bytes[] memory _beforeResults = _aggregate(proxy_, _callsList);\n\n TransparentUpgradeableProxy(payable(proxy_)).upgradeToAndCall{value: msg.value}(implementation_, data_);\n\n bytes[] memory _afterResults = _aggregate(proxy_, _callsList);\n _checkResults(_beforeResults, _afterResults);\n }\n\n /**\n * @notice Execute storage check calls using `Multicall3` contract\n * @param proxy_ The proxy being upgraded is the target contract\n * @param callDatas_ The array of storage calls to check\n * @return _results The storage values\n */\n function _aggregate(\n TransparentUpgradeableProxy proxy_,\n bytes[] memory callDatas_\n ) private returns (bytes[] memory _results) {\n uint256 _length = callDatas_.length;\n IMulticall.Call[] memory _callsList = new IMulticall.Call[](_length);\n for (uint256 i; i < _length; ++i) {\n _callsList[i].target = address(proxy_);\n _callsList[i].callData = callDatas_[i];\n }\n (, _results) = IMulticall(multicall).aggregate(_callsList);\n }\n\n /**\n * @notice Return list of storage calls\n * @dev The values of those calls will be compared before and after upgrade to check storage integrity\n */\n function _calls() internal virtual returns (bytes[] memory _callsList);\n\n /**\n * @notice Compare values\n * @dev Throws if values are inconsistent\n */\n function _checkResults(bytes[] memory before_, bytes[] memory after_) private pure {\n uint256 _length = before_.length;\n for (uint256 i; i < _length; ++i) {\n if (keccak256(before_[i]) != keccak256(after_[i])) revert StorageValueIsNotEqual();\n }\n }\n}\n" + }, + "contracts/utils/Pauseable.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"../interfaces/IPauseable.sol\";\nimport \"../access/Governable.sol\";\n\nerror IsPaused();\nerror IsShutdown();\nerror IsNotPaused();\nerror IsNotShutdown();\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 */\nabstract contract Pauseable is IPauseable, Governable {\n /// @notice Emitted when contract is turned on\n event Open(address indexed caller);\n\n /// @notice Emitted when contract is paused\n event Paused(address indexed caller);\n\n /// @notice Emitted when contract is shuted down\n event Shutdown(address indexed caller);\n\n /// @notice Emitted when contract is unpaused\n event Unpaused(address indexed caller);\n\n bool private _paused;\n bool private _everythingStopped;\n\n /**\n * @dev Throws if contract is paused\n */\n modifier whenNotPaused() {\n if (paused()) revert IsPaused();\n _;\n }\n\n /**\n * @dev Throws if contract is shutdown\n */\n modifier whenNotShutdown() {\n if (everythingStopped()) revert IsShutdown();\n _;\n }\n\n /**\n * @dev Throws if contract is not paused\n */\n modifier whenPaused() {\n if (!paused()) revert IsNotPaused();\n _;\n }\n\n /**\n * @dev Throws if contract is not shutdown\n */\n modifier whenShutdown() {\n if (!everythingStopped()) revert IsNotShutdown();\n _;\n }\n\n /**\n * @dev If inheriting child is using proxy then child contract can use\n * __Pauseable_init() function to initialization this contract\n */\n // solhint-disable-next-line func-name-mixedcase\n function __Pauseable_init() internal onlyInitializing {\n __Governable_init();\n }\n\n /**\n * @notice Return `true` if contract is shutdown\n */\n function everythingStopped() public view virtual returns (bool) {\n return _everythingStopped;\n }\n\n /**\n * @notice Return `true` if contract is paused\n */\n function paused() public view virtual returns (bool) {\n return _paused;\n }\n\n /**\n * @dev Open contract operations, if contract is in shutdown state\n */\n function open() external virtual whenShutdown onlyGovernor {\n _everythingStopped = false;\n emit Open(msg.sender);\n }\n\n /**\n * @dev Suspend deposit feature, if contract is not paused.\n */\n function pause() external virtual whenNotPaused onlyGovernor {\n _paused = true;\n emit Paused(msg.sender);\n }\n\n /**\n * @dev Suspend all features (issue, repay, deposit, withdraw, liquidate and swap), if not already shutdown.\n */\n function shutdown() external virtual whenNotShutdown onlyGovernor {\n _everythingStopped = true;\n _paused = true;\n emit Shutdown(msg.sender);\n }\n\n /**\n * @dev Unpause contract operations, allow only if contract is paused and not shutdown.\n */\n function unpause() external virtual whenPaused whenNotShutdown onlyGovernor {\n _paused = false;\n emit Unpaused(msg.sender);\n }\n}\n" + }, + "contracts/utils/RecurringAirdrop.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"../dependencies/openzeppelin/token/ERC20/utils/SafeERC20.sol\";\nimport \"../dependencies/openzeppelin/security/ReentrancyGuard.sol\";\nimport \"../dependencies/openzeppelin/utils/cryptography/MerkleProof.sol\";\nimport \"../access/Governable.sol\";\n\nerror NothingToClaim();\nerror InvalidProof();\nerror NewMerkleRootSameAsCurrent();\nerror ProofsFileIsNull();\n\n/**\n * @title Generic Recurring Airdrop contract\n */\ncontract RecurringAirdrop is ReentrancyGuard, Governable {\n using SafeERC20 for IERC20;\n\n /// @notice The token to distribute\n IERC20 public immutable token;\n\n /// @notice The merkle root for the current distribution\n bytes32 public merkleRoot;\n\n /// @notice The proofs file's IPFS hash\n bytes32 public proofsFileHash;\n\n /// @notice The timestamp of the latest merkle root update\n uint256 public updatedAt;\n\n /// @notice The Accumulated amount claimed for a given account\n mapping(address => uint256) public claimed;\n\n /// @notice Emitted when an account claims reward\n event RewardClaimed(address indexed to, uint256 amount);\n\n /// @notice Emitted when the merkle root is updated\n event MerkleRootUpdated(bytes32 merkleRoot, uint256 createdAt);\n\n constructor(IERC20 token_) {\n token = token_;\n }\n\n /**\n * @notice Claim reward\n * @dev Every tree leaf is a `[account, amount]` tuple, we assume that the `msg.sender` is the account\n * @param amount_ The amount to claim\n * @param proof_ The merkle tree proof for the given leaf\n */\n function claim(uint256 amount_, bytes32[] calldata proof_) external nonReentrant {\n if (merkleRoot == bytes32(0)) revert NothingToClaim();\n\n bytes32 _leaf = keccak256(abi.encodePacked(msg.sender, amount_));\n if (!MerkleProof.verify(proof_, merkleRoot, _leaf)) revert InvalidProof();\n\n uint256 _claimable = amount_ - claimed[msg.sender];\n if (_claimable == 0) revert NothingToClaim();\n\n claimed[msg.sender] += _claimable;\n\n _transferReward(msg.sender, _claimable);\n\n emit RewardClaimed(msg.sender, _claimable);\n }\n\n /**\n * @notice Transfer reward to the user\n * @param to_ The claim account\n * @param amount_ The reward amount\n */\n function _transferReward(address to_, uint256 amount_) internal virtual {\n token.safeTransfer(to_, amount_);\n }\n\n /**\n * @notice Update merkle tree root\n * @param merkleRoot_ The merkle root\n */\n function updateMerkleRoot(bytes32 merkleRoot_, bytes32 proofsFileHash_) external onlyGovernor {\n if (merkleRoot_ == merkleRoot) revert NewMerkleRootSameAsCurrent();\n if (proofsFileHash_ == bytes32(0)) revert ProofsFileIsNull();\n\n merkleRoot = merkleRoot_;\n updatedAt = block.timestamp;\n proofsFileHash = proofsFileHash_;\n\n emit MerkleRootUpdated(merkleRoot_, block.timestamp);\n }\n}\n" + }, + "contracts/utils/ReentrancyGuard.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)\n\npragma solidity ^0.8.0;\nimport \"../dependencies/openzeppelin-upgradeable/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 ReentrancyGuard 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 // On the first call to nonReentrant, _notEntered will be true\n require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n // Any calls to nonReentrant after this point will fail\n _status = _ENTERED;\n\n _;\n\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" + }, + "contracts/utils/TokenHolder.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"../dependencies/openzeppelin/token/ERC20/utils/SafeERC20.sol\";\n\nerror FallbackIsNotAllowed();\nerror ReceiveIsNotAllowed();\n\n/**\n * @title Utils contract that handles tokens sent to it\n */\nabstract contract TokenHolder {\n using SafeERC20 for IERC20;\n\n /**\n * @dev Revert fallback calls\n */\n fallback() external payable {\n revert FallbackIsNotAllowed();\n }\n\n /**\n * @dev Revert when receiving by default\n */\n receive() external payable virtual {\n revert ReceiveIsNotAllowed();\n }\n\n /**\n * @notice ERC20 recovery in case of stuck tokens due direct transfers to the contract address.\n * @param token_ The token to transfer\n * @param to_ The recipient of the transfer\n * @param amount_ The amount to send\n */\n function sweep(IERC20 token_, address to_, uint256 amount_) external {\n _requireCanSweep();\n\n if (address(token_) == address(0)) {\n Address.sendValue(payable(to_), amount_);\n } else {\n token_.safeTransfer(to_, amount_);\n }\n }\n\n /**\n * @notice Function that reverts if the caller isn't allowed to sweep tokens\n * @dev Usually requires the owner or governor as the caller\n */\n function _requireCanSweep() internal view virtual;\n}\n" + }, + "contracts/VesperGateway.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.9;\n\nimport \"./utils/ReentrancyGuard.sol\";\nimport \"./utils/TokenHolder.sol\";\nimport \"./interfaces/IVesperGateway.sol\";\nimport \"./interfaces/IDepositToken.sol\";\n\nerror SenderIsNotGovernor();\nerror UnregisteredPool();\n\n/**\n * @title Helper contract to easily support vTokens as collateral\n */\ncontract VesperGateway is ReentrancyGuard, TokenHolder, IVesperGateway {\n using SafeERC20 for IERC20;\n using SafeERC20 for IDepositToken;\n using SafeERC20 for IVPool;\n\n IPoolRegistry public immutable poolRegistry;\n\n modifier onlyGovernor() {\n if (poolRegistry.governor() != msg.sender) revert SenderIsNotGovernor();\n _;\n }\n\n constructor(IPoolRegistry poolRegistry_) initializer {\n // Note: This contract isn't upgradable but extends `ReentrancyGuard` therefore we need to initialize it\n __ReentrancyGuard_init();\n poolRegistry = poolRegistry_;\n }\n\n /**\n * @notice Deposit `vToken` as collateral using underlying asset.\n * @param pool_ The Pool contract\n * @param vToken_ The vToken to deposit\n * @param amount_ The amount of `underlying` asset to deposit\n */\n function deposit(IPool pool_, IVPool vToken_, uint256 amount_) external override {\n if (!poolRegistry.isPoolRegistered(address(pool_))) revert UnregisteredPool();\n\n // 1. Get `underlying` asset\n IERC20 _underlying = IERC20(vToken_.token());\n _underlying.safeTransferFrom(msg.sender, address(this), amount_);\n\n // 2. Deposit `underlying` to `VPool`\n _underlying.safeApprove(address(vToken_), 0);\n _underlying.safeApprove(address(vToken_), amount_);\n uint256 _balanceBefore = vToken_.balanceOf(address(this));\n vToken_.deposit(amount_);\n uint256 _vTokenAmount = vToken_.balanceOf(address(this)) - _balanceBefore;\n\n // 3. Deposit `VPool` to `Synth` and send `msdTokens` to the `msg.sender`\n IDepositToken _depositToken = pool_.depositTokenOf(vToken_);\n vToken_.safeApprove(address(_depositToken), 0);\n vToken_.safeApprove(address(_depositToken), _vTokenAmount);\n _depositToken.deposit(_vTokenAmount, msg.sender);\n }\n\n /**\n * @notice Withdraws the `vToken` deposit of msg.sender.\n * @param pool_ The Pool contract\n * @param vToken_ The vToken to withdraw\n * @param amount_ The amount of deposit tokens to withdraw and receive underlying\n */\n function withdraw(IPool pool_, IVPool vToken_, uint256 amount_) external override nonReentrant {\n if (!poolRegistry.isPoolRegistered(address(pool_))) revert UnregisteredPool();\n\n // 1. Get `msdTokens`\n IDepositToken _depositToken = pool_.depositTokenOf(vToken_);\n _depositToken.safeTransferFrom(msg.sender, address(this), amount_);\n\n // 2. Withdraw `vTokens` from `Synth`\n (uint256 _vTokenAmount, ) = _depositToken.withdraw(amount_, address(this));\n\n // 3. Withdraw `underlying` from `VPool`\n IERC20 _underlying = IERC20(vToken_.token());\n uint256 _balanceBefore = _underlying.balanceOf(address(this));\n vToken_.withdraw(_vTokenAmount);\n uint256 _underlyingAmount = _underlying.balanceOf(address(this)) - _balanceBefore;\n\n // 4. Transfer `underlying` to the `msg.sender`\n _underlying.safeTransfer(msg.sender, _underlyingAmount);\n }\n\n /// @inheritdoc TokenHolder\n // solhint-disable-next-line no-empty-blocks\n function _requireCanSweep() internal view override onlyGovernor {}\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 200 + }, + "outputSelection": { + "*": { + "*": [ + "storageLayout", + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/docs/routes.json b/docs/routes.json index 5a273d0..f97ba57 100644 --- a/docs/routes.json +++ b/docs/routes.json @@ -197,7 +197,10 @@ }, { "synth": "0x33bCa143d9b41322479E8d26072a00a352404721", - "collaterals": ["0x4200000000000000000000000000000000000042", "0x19382707d5a47E74f60053b652Ab34b6e30Febad"] + "collaterals": [ + "0x4200000000000000000000000000000000000042", + "0x19382707d5a47E74f60053b652Ab34b6e30Febad" + ] }, { "synth": "0x9dAbAE7274D28A45F0B65Bf8ED201A5731492ca0", @@ -210,5 +213,81 @@ ] } ] + }, + "base": { + "bridge_token_mapping": [], + "routes": [ + { + "pool": "0xc614136d6c5AB85bc2aCF0ec2652351642d7F54E", + "leverage_routes": [ + { + "tokenIn": "0x82562507429876486B60AF4F32390ef0947b3d13", + "collateral": "0x82562507429876486B60AF4F32390ef0947b3d13", + "synth": "0x7Ba6F01772924a82D9626c126347A28299E98c98" + }, + { + "tokenIn": "0x4200000000000000000000000000000000000006", + "collateral": "0x82562507429876486B60AF4F32390ef0947b3d13", + "synth": "0x7Ba6F01772924a82D9626c126347A28299E98c98" + }, + { + "tokenIn": "0x46fb68Eb2b1Fc43654AbaE5691D39D18D933E4b4", + "collateral": "0x46fb68Eb2b1Fc43654AbaE5691D39D18D933E4b4", + "synth": "0x7Ba6F01772924a82D9626c126347A28299E98c98" + }, + { + "tokenIn": "0x4200000000000000000000000000000000000006", + "collateral": "0x46fb68Eb2b1Fc43654AbaE5691D39D18D933E4b4", + "synth": "0x7Ba6F01772924a82D9626c126347A28299E98c98" + }, + { + "tokenIn": "0x3899a6090c5C178dB8A1800DA39daD0D06EeEFBE", + "collateral": "0x3899a6090c5C178dB8A1800DA39daD0D06EeEFBE", + "synth": "0x7Ba6F01772924a82D9626c126347A28299E98c98" + }, + { + "tokenIn": "0x4200000000000000000000000000000000000006", + "collateral": "0x3899a6090c5C178dB8A1800DA39daD0D06EeEFBE", + "synth": "0x7Ba6F01772924a82D9626c126347A28299E98c98" + }, + { + "tokenIn": "0x1e41238aCd3A9fF90b0DCB9ea96Cf45F104e09Ef", + "collateral": "0x1e41238aCd3A9fF90b0DCB9ea96Cf45F104e09Ef", + "synth": "0x526728DBc96689597F85ae4cd716d4f7fCcBAE9d" + }, + { + "tokenIn": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", + "collateral": "0x1e41238aCd3A9fF90b0DCB9ea96Cf45F104e09Ef", + "synth": "0x526728DBc96689597F85ae4cd716d4f7fCcBAE9d" + } + ], + "flash_repay_routes": [ + { + "synth": "0x526728DBc96689597F85ae4cd716d4f7fCcBAE9d", + "collaterals": [ + "0x4200000000000000000000000000000000000006", + "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", + "0x1e41238aCd3A9fF90b0DCB9ea96Cf45F104e09Ef", + "0x82562507429876486B60AF4F32390ef0947b3d13", + "0x82562507429876486B60AF4F32390ef0947b3d13", + "0x46fb68Eb2b1Fc43654AbaE5691D39D18D933E4b4", + "0x3899a6090c5C178dB8A1800DA39daD0D06EeEFBE" + ] + }, + { + "synth": "0x7Ba6F01772924a82D9626c126347A28299E98c98", + "collaterals": [ + "0x4200000000000000000000000000000000000006", + "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", + "0x1e41238aCd3A9fF90b0DCB9ea96Cf45F104e09Ef", + "0x82562507429876486B60AF4F32390ef0947b3d13", + "0x82562507429876486B60AF4F32390ef0947b3d13", + "0x46fb68Eb2b1Fc43654AbaE5691D39D18D933E4b4", + "0x3899a6090c5C178dB8A1800DA39daD0D06EeEFBE" + ] + } + ] + } + ] } -} +} \ No newline at end of file diff --git a/helpers/address.ts b/helpers/address.ts index c28ba4e..fae0d58 100644 --- a/helpers/address.ts +++ b/helpers/address.ts @@ -122,8 +122,8 @@ const Address: Addresses = { STARGATE_COMPOSER: '0xeCc19E177d24551aA7ed6Bc6FE566eCa726CC8a9', }, [8453]: { + SWAPPER_ADDRESS: '0xd7c751fA32590451548B100C4f6442F062C9bc8E', MASTER_ORACLE_ADDRESS: '0x99866a6074ADb027f09c9AF31929dB5941D36DA7', - MASTER_ORACLE_GOVERNOR_ADDRESS: '0x76d266DFD3754f090488ae12F6Bd115cD7E77eBD', // TODO: Update FEE_COLLECTOR: '0x76d266DFD3754f090488ae12F6Bd115cD7E77eBD', NATIVE_TOKEN_ADDRESS: '0x4200000000000000000000000000000000000006', @@ -131,9 +131,13 @@ const Address: Addresses = { WETH_ADDRESS: '0x4200000000000000000000000000000000000006', SGETH_ADDRESS: '0x224D8Fd7aB6AD4c6eb4611Ce56EF35Dec2277F03', GNOSIS_SAFE_ADDRESS: '0xE01Df4ac1E1e57266900E62C37F12C986495A618', - LZ_ENDPOINT: '0x1a44076050125825900e736c501f859c50fE728c', + LZ_ENDPOINT: '0xb6319cC6c8c27A8F5dAF0dD3DF91EA35C4720dd7', STARGATE_ROUTER: '0x45f1A95A4D3f3836523F5c83673c797f4d4d263B', STARGATE_COMPOSER: '0xeCc19E177d24551aA7ed6Bc6FE566eCa726CC8a9', + VACBETH_ADDRESS: '0x3899a6090c5C178dB8A1800DA39daD0D06EeEFBE', + VAETH_ADDRESS: '0x82562507429876486B60AF4F32390ef0947b3d13', + VAUSDC_ADDRESS: '0x1e41238aCd3A9fF90b0DCB9ea96Cf45F104e09Ef', + VAWSTETH_ADDRESS: '0x46fb68Eb2b1Fc43654AbaE5691D39D18D933E4b4', }, } diff --git a/releases/1.3.0/contracts.json b/releases/1.3.0/contracts.json index fed4e0e..122bd74 100644 --- a/releases/1.3.0/contracts.json +++ b/releases/1.3.0/contracts.json @@ -241,7 +241,7 @@ "base": { "CrossChainDispatcher": "0x3A04BF2cAca1345D475e0241B465C0EA4d4Ce950", "CrossChainDispatcherUpgraderV2": "0xed6673F4bFaDD4D269BE68C7dbCC516218C0baD9", - "CrossChainDispatcher_Implementation": "0x747b4932D6166C30eA34F425498272E65d99eA67", + "CrossChainDispatcher_Implementation": "0xD911e197f8e4797061817dDbf11a93d8D4573d97", "CrossChainDispatcher_Proxy": "0x3A04BF2cAca1345D475e0241B465C0EA4d4Ce950", "DebtToken": "0xbE1eDc53663212A464dDc37f02f381A116d3738E", "DebtTokenUpgrader": "0x1a8ea5ab935285dc96Cb853e8Dd7d21eEb245771", @@ -249,61 +249,82 @@ "DepositTokenUpgrader": "0x3506B5EfEa8d0719E47cDcabC81b6E60B5Fa73B5", "FeeProvider": "0x98dAC76F26C6b067eB9FC13714b068d787C899DE", "FeeProviderUpgrader": "0xeD0AB2997A87d738e630eB9C287BDD0EE6f059D1", + "FeeProvider_Implementation": "0x98dAC76F26C6b067eB9FC13714b068d787C899DE", "FeeProvider_Pool1": "0xE1525Aa6D21A172F4e0C4420Ff68C73FD38B0CC6", "FeeProvider_Pool1_Implementation": "0x98dAC76F26C6b067eB9FC13714b068d787C899DE", "FeeProvider_Pool1_Proxy": "0xE1525Aa6D21A172F4e0C4420Ff68C73FD38B0CC6", + "FeeProvider_Proxy": "0xE1525Aa6D21A172F4e0C4420Ff68C73FD38B0CC6", + "MsETHDebt": "0x6F622b037F9146bdE102db84FC9152dF1042aa98", + "MsETHDebt_Implementation": "0xbE1eDc53663212A464dDc37f02f381A116d3738E", "MsETHDebt_Pool1": "0x6F622b037F9146bdE102db84FC9152dF1042aa98", "MsETHDebt_Pool1_Implementation": "0xbE1eDc53663212A464dDc37f02f381A116d3738E", "MsETHDebt_Pool1_Proxy": "0x6F622b037F9146bdE102db84FC9152dF1042aa98", - "MsETHProxyOFT": "0xDF2Aa7026bAE7e131D7D5af30345173843D22AFb", - "MsETHProxyOFT_Implementation": "0xF3ecd63bb9A4934C85026F8924b49ed7Deb69985", - "MsETHProxyOFT_Proxy": "0xDF2Aa7026bAE7e131D7D5af30345173843D22AFb", + "MsETHDebt_Proxy": "0x6F622b037F9146bdE102db84FC9152dF1042aa98", + "MsETHProxyOFT": "0x30EAc06D1e495411eE15cB59714Eb9DA29fc200e", + "MsETHProxyOFT_Implementation": "0xdDd9864C68072a4723889644b5E7075452718deD", + "MsETHProxyOFT_Proxy": "0x30EAc06D1e495411eE15cB59714Eb9DA29fc200e", "MsETHSynthetic": "0x7Ba6F01772924a82D9626c126347A28299E98c98", "MsETHSynthetic_Implementation": "0xD7A192F7CFC7cc28275C7c0FE81359913D64e6bb", "MsETHSynthetic_Proxy": "0x7Ba6F01772924a82D9626c126347A28299E98c98", + "MsUSDDebt": "0x7bcC1DEcCaa98D52Bf89485f17a3E8607011cFde", + "MsUSDDebt_Implementation": "0xbE1eDc53663212A464dDc37f02f381A116d3738E", "MsUSDDebt_Pool1": "0x7bcC1DEcCaa98D52Bf89485f17a3E8607011cFde", "MsUSDDebt_Pool1_Implementation": "0xbE1eDc53663212A464dDc37f02f381A116d3738E", "MsUSDDebt_Pool1_Proxy": "0x7bcC1DEcCaa98D52Bf89485f17a3E8607011cFde", - "MsUSDProxyOFT": "0xf014336Fd2e817b1e7F62baD1Aef5908809c9c07", - "MsUSDProxyOFT_Implementation": "0xF3ecd63bb9A4934C85026F8924b49ed7Deb69985", - "MsUSDProxyOFT_Proxy": "0xf014336Fd2e817b1e7F62baD1Aef5908809c9c07", + "MsUSDDebt_Proxy": "0x7bcC1DEcCaa98D52Bf89485f17a3E8607011cFde", + "MsUSDProxyOFT": "0x2AF13BF84F8B452cB86839330F514Cc5c2899217", + "MsUSDProxyOFT_Implementation": "0xdDd9864C68072a4723889644b5E7075452718deD", + "MsUSDProxyOFT_Proxy": "0x2AF13BF84F8B452cB86839330F514Cc5c2899217", "MsUSDSynthetic": "0x526728DBc96689597F85ae4cd716d4f7fCcBAE9d", "MsUSDSynthetic_Implementation": "0xD7A192F7CFC7cc28275C7c0FE81359913D64e6bb", "MsUSDSynthetic_Proxy": "0x526728DBc96689597F85ae4cd716d4f7fCcBAE9d", "NativeTokenGateway": "0xBd700f301DC8e644DC074023369fe5Bdf6051b29", - "Pool": "0x7c18646ac536d5186B6F6Fc47D593E4127216C39", + "Pool": "0x2144B696bEbA98f077531e96023A7DF821Bc4586", "Pool1": "0xc614136d6c5AB85bc2aCF0ec2652351642d7F54E", - "Pool1_Implementation": "0x7c18646ac536d5186B6F6Fc47D593E4127216C39", + "Pool1_Implementation": "0x2144B696bEbA98f077531e96023A7DF821Bc4586", "Pool1_Proxy": "0xc614136d6c5AB85bc2aCF0ec2652351642d7F54E", "PoolRegistry": "0x4372A2b9304296c06197a823f25Cf03119d2Fd82", "PoolRegistryUpgraderV2": "0xd493DB09Ee4EaddDb6036Ea3aF49F093017A9792", "PoolRegistry_Implementation": "0x2A62975b1Dc4f6F8201E15C97E400f51724C8158", "PoolRegistry_Proxy": "0x4372A2b9304296c06197a823f25Cf03119d2Fd82", "PoolUpgraderV3": "0x5A9f5fC7Ee767EAA43688c1822F5352BA19fe735", - "ProxyOFT": "0xF3ecd63bb9A4934C85026F8924b49ed7Deb69985", + "Pool_Implementation": "0x2144B696bEbA98f077531e96023A7DF821Bc4586", + "Pool_Proxy": "0xc614136d6c5AB85bc2aCF0ec2652351642d7F54E", + "ProxyOFT": "0xdDd9864C68072a4723889644b5E7075452718deD", "ProxyOFTUpgrader": "0x305b30dC978e931642D243852b4AA5D31a0dA8c4", + "ProxyOFTUpgraderV2": "0xecfE7634aBCd2140bede1fb34753A7F5d412c881", "Quoter": "0x2f4F85be85245c91779C3e36cBddf87b4eD73E3d", "QuoterUpgrader": "0xa3C6d5E857943346B7F6Dee3F3053DF55357Ef69", - "Quoter_Implementation": "0x61129aAFaa83dfd817fe827D7570eE478Ed5A4eA", + "Quoter_Implementation": "0xBf6CcBBFa9D488A944E7637531102b490112Ad07", "Quoter_Proxy": "0x2f4F85be85245c91779C3e36cBddf87b4eD73E3d", - "SmartFarmingManager": "0xf55d146D5A496D6B5576a1661E8861cF5c5ffF9f", + "SmartFarmingManager": "0x1D62a9C4A8e7D38E4d78B40de8278786f09696bD", "SmartFarmingManagerUpgrader": "0x720501250D7937Ac3b6b308E24466c03A61EFB70", + "SmartFarmingManager_Implementation": "0x1D62a9C4A8e7D38E4d78B40de8278786f09696bD", "SmartFarmingManager_Pool1": "0x2f12dfb525564055B4A007B0b15eA5CD0BfF986C", - "SmartFarmingManager_Pool1_Implementation": "0xf55d146D5A496D6B5576a1661E8861cF5c5ffF9f", + "SmartFarmingManager_Pool1_Implementation": "0x1D62a9C4A8e7D38E4d78B40de8278786f09696bD", "SmartFarmingManager_Pool1_Proxy": "0x2f12dfb525564055B4A007B0b15eA5CD0BfF986C", + "SmartFarmingManager_Proxy": "0x2f12dfb525564055B4A007B0b15eA5CD0BfF986C", "SyntheticToken": "0xD7A192F7CFC7cc28275C7c0FE81359913D64e6bb", "SyntheticTokenUpgraderV2": "0xF3F1B456fB3a61d96024DfbB8ef9bE510B689bA6", "Treasury": "0x934aB2262C6258fafd619Cb63bE7d89B20C19633", "TreasuryUpgrader": "0x0EFbFE4979da0Cb457a6a80Db6F3da6861E120fc", + "Treasury_Implementation": "0x934aB2262C6258fafd619Cb63bE7d89B20C19633", "Treasury_Pool1": "0xAeDF96597338FE03E8c07a1077A296df5422320e", "Treasury_Pool1_Implementation": "0x934aB2262C6258fafd619Cb63bE7d89B20C19633", "Treasury_Pool1_Proxy": "0xAeDF96597338FE03E8c07a1077A296df5422320e", + "Treasury_Proxy": "0xAeDF96597338FE03E8c07a1077A296df5422320e", + "USDCDepositToken": "0xC7F2f79Daa7Ea4FBbF60b45b5D6028BDE2453476", + "USDCDepositToken_Implementation": "0x9bF24739310FB7F79af48ECc38557E2172469EEE", "USDCDepositToken_Pool1": "0xC7F2f79Daa7Ea4FBbF60b45b5D6028BDE2453476", "USDCDepositToken_Pool1_Implementation": "0x9bF24739310FB7F79af48ECc38557E2172469EEE", "USDCDepositToken_Pool1_Proxy": "0xC7F2f79Daa7Ea4FBbF60b45b5D6028BDE2453476", + "USDCDepositToken_Proxy": "0xC7F2f79Daa7Ea4FBbF60b45b5D6028BDE2453476", + "WETHDepositToken": "0x8b581d0013F571a792c3Aa8AF2a0366A309BF51E", + "WETHDepositToken_Implementation": "0x9bF24739310FB7F79af48ECc38557E2172469EEE", "WETHDepositToken_Pool1": "0x8b581d0013F571a792c3Aa8AF2a0366A309BF51E", "WETHDepositToken_Pool1_Implementation": "0x9bF24739310FB7F79af48ECc38557E2172469EEE", - "WETHDepositToken_Pool1_Proxy": "0x8b581d0013F571a792c3Aa8AF2a0366A309BF51E" + "WETHDepositToken_Pool1_Proxy": "0x8b581d0013F571a792c3Aa8AF2a0366A309BF51E", + "WETHDepositToken_Proxy": "0x8b581d0013F571a792c3Aa8AF2a0366A309BF51E" } } -} +} \ No newline at end of file diff --git a/scripts/test-next-deployment-on-fork.sh b/scripts/test-next-deployment-on-fork.sh index dec0fe2..5532c0d 100755 --- a/scripts/test-next-deployment-on-fork.sh +++ b/scripts/test-next-deployment-on-fork.sh @@ -24,17 +24,6 @@ read # Prepare deployment data cp -r deployments/$network deployments/localhost -if [[ "$network" == "base" ]]; -then - # Sync BASE setup - patch deploy/helpers/index.ts < scripts/proxy_oft_to_v1.patch - - # Deployment (1/2) - Upgrade `ProxyOFTUpgrader` - npx hardhat deploy --network localhost --tags Upgraders,MultisigTxs #> DEPLOYMENT_TEST_OUTPUT.log - - # Update `ProxyOFTUpgrader` setup - patch deploy/helpers/index.ts < scripts/proxy_oft_to_v2.patch -fi # Deployment (2/2) diff --git a/test/E2E.base.next.test.ts b/test/E2E.base.next.test.ts index edefcb1..6dba417 100644 --- a/test/E2E.base.next.test.ts +++ b/test/E2E.base.next.test.ts @@ -24,6 +24,10 @@ import { let POOL_REGISTRY_ADDRESS: string let USDC_DEPOSIT_ADDRESS: string let WETH_DEPOSIT_ADDRESS: string +let VAUSDC_DEPOSIT_ADDRESS: string +let VAETH_DEPOSIT_ADDRESS: string +let VACBETH_DEPOSIT_ADDRESS: string +let VAWSTETH_DEPOSIT_ADDRESS: string let MSUSD_DEBT_ADDRESS: string let MSETH_DEBT_ADDRESS: string let MSUSD_SYNTHETIC_ADDRESS: string @@ -54,6 +58,10 @@ describe('E2E tests (next base release)', function () { let bob: SignerWithAddress let weth: IWETH let usdc: ERC20 + let vaETH: ERC20 + let vaCBETH: ERC20 + let vaUSDC: ERC20 + let vaWSTETH: ERC20 let masterOracle: Contract let poolRegistry: PoolRegistry let nativeGateway: NativeTokenGateway @@ -63,6 +71,11 @@ describe('E2E tests (next base release)', function () { let pool: Pool let msdWETH: DepositToken let msdUSDC: DepositToken + let msdVaETH: DepositToken + let msdVaCBETH: DepositToken + let msdVaUSDC: DepositToken + let msdVaWSTETH: DepositToken + let msUSDDebt: DebtToken let msETHDebt: DebtToken let msUSD: SyntheticToken @@ -81,6 +94,10 @@ describe('E2E tests (next base release)', function () { ;({address: MSETH_SYNTHETIC_ADDRESS} = await import('../deployments/localhost/MsETHSynthetic.json')) ;({address: MSUSD_PROXYOFT_ADDRESS} = await import('../deployments/localhost/MsUSDProxyOFT.json')) ;({address: MSETH_PROXYOFT_ADDRESS} = await import('../deployments/localhost/MsETHProxyOFT.json')) + ;({address: VAETH_DEPOSIT_ADDRESS} = await import('../deployments/localhost/VaETHDepositToken_Pool1.json')) + ;({address: VACBETH_DEPOSIT_ADDRESS} = await import('../deployments/localhost/VaCBETHDepositToken_Pool1.json')) + ;({address: VAUSDC_DEPOSIT_ADDRESS} = await import('../deployments/localhost/VaUSDCDepositToken_Pool1.json')) + ;({address: VAWSTETH_DEPOSIT_ADDRESS} = await import('../deployments/localhost/VaWSTETHDepositToken_Pool1.json')) ;({address: NATIVE_TOKEN_GATEWAY_ADDRESS} = await import('../deployments/localhost/NativeTokenGateway.json')) ;({address: QUOTER_ADDRESS} = await import('../deployments/localhost/Quoter.json')) ;({address: SFM_ADDRESS} = await import('../deployments/localhost/SmartFarmingManager_Pool1.json')) @@ -90,6 +107,10 @@ describe('E2E tests (next base release)', function () { ;[, alice, bob] = await ethers.getSigners() usdc = await ethers.getContractAt('ERC20', Address.USDC_ADDRESS, alice) weth = await ethers.getContractAt('IWETH', Address.WETH_ADDRESS, alice) + vaUSDC = await ethers.getContractAt('ERC20', Address.VAUSDC_ADDRESS, alice) + vaETH = await ethers.getContractAt('ERC20', Address.VAETH_ADDRESS, alice) + vaWSTETH = await ethers.getContractAt('ERC20', Address.VAWSTETH_ADDRESS, alice) + vaCBETH = await ethers.getContractAt('ERC20', Address.VACBETH_ADDRESS, alice) poolRegistry = await ethers.getContractAt('PoolRegistry', POOL_REGISTRY_ADDRESS, alice) governor = await impersonateAccount(await poolRegistry.governor()) @@ -100,6 +121,10 @@ describe('E2E tests (next base release)', function () { msdWETH = await ethers.getContractAt('DepositToken', WETH_DEPOSIT_ADDRESS, alice) msdUSDC = await ethers.getContractAt('DepositToken', USDC_DEPOSIT_ADDRESS, alice) // 6 decimals. + msdVaETH = await ethers.getContractAt('DepositToken', VAETH_DEPOSIT_ADDRESS, alice) + msdVaCBETH = await ethers.getContractAt('DepositToken', VACBETH_DEPOSIT_ADDRESS, alice) + msdVaUSDC = await ethers.getContractAt('DepositToken', VAUSDC_DEPOSIT_ADDRESS, alice) + msdVaWSTETH = await ethers.getContractAt('DepositToken', VAWSTETH_DEPOSIT_ADDRESS, alice) msUSDDebt = await ethers.getContractAt('DebtToken', MSUSD_DEBT_ADDRESS, alice) msETHDebt = await ethers.getContractAt('DebtToken', MSETH_DEBT_ADDRESS, alice) @@ -116,9 +141,17 @@ describe('E2E tests (next base release)', function () { await setTokenBalance(usdc.address, alice.address, parseUnits('10,000', 6)) await setTokenBalance(weth.address, alice.address, parseUnits('20', 18)) + await setTokenBalance(vaCBETH.address, alice.address, parseUnits('1000', 18)) + await setTokenBalance(vaUSDC.address, alice.address, parseUnits('1000', 18)) + await setTokenBalance(vaETH.address, alice.address, parseUnits('1000', 18)) + await setTokenBalance(vaWSTETH.address, alice.address, parseUnits('20', 18)) await usdc.connect(alice).approve(msdUSDC.address, MaxUint256) await weth.connect(alice).approve(msdWETH.address, MaxUint256) + await vaUSDC.connect(alice).approve(msdVaUSDC.address, MaxUint256) + await vaETH.connect(alice).approve(msdVaETH.address, MaxUint256) + await vaWSTETH.connect(alice).approve(msdVaWSTETH.address, MaxUint256) + await vaCBETH.connect(alice).approve(msdVaCBETH.address, MaxUint256) const masterOracleGovernor = await impersonateAccount(Address.MASTER_ORACLE_GOVERNOR_ADDRESS) masterOracle = new ethers.Contract( @@ -138,6 +171,11 @@ describe('E2E tests (next base release)', function () { await msUSD.connect(governor).toggleIsActive() await msETH.connect(governor).toggleIsActive() + await msdVaUSDC.connect(governor).updateMaxTotalSupply(ethers.constants.MaxUint256) + await msdVaETH.connect(governor).updateMaxTotalSupply(ethers.constants.MaxUint256) + await msdVaWSTETH.connect(governor).updateMaxTotalSupply(ethers.constants.MaxUint256) + await msdVaCBETH.connect(governor).updateMaxTotalSupply(ethers.constants.MaxUint256) + if (await pool.everythingStopped()) { await pool.connect(governor).open() } @@ -196,6 +234,10 @@ describe('E2E tests (next base release)', function () { expect(USDC_DEPOSIT_ADDRESS).eq(await pool.depositTokenOf(usdc.address)) expect(WETH_DEPOSIT_ADDRESS).eq(await pool.depositTokenOf(weth.address)) + expect(VAUSDC_DEPOSIT_ADDRESS).eq(await pool.depositTokenOf(vaUSDC.address)) + expect(VAETH_DEPOSIT_ADDRESS).eq(await pool.depositTokenOf(vaETH.address)) + expect(VACBETH_DEPOSIT_ADDRESS).eq(await pool.depositTokenOf(vaCBETH.address)) + expect(VAWSTETH_DEPOSIT_ADDRESS).eq(await pool.depositTokenOf(vaWSTETH.address)) expect(MSUSD_SYNTHETIC_ADDRESS).eq(await msUSDProxyOFT.token()) expect(MSETH_SYNTHETIC_ADDRESS).eq(await msETHProxyOFT.token()) @@ -212,6 +254,10 @@ describe('E2E tests (next base release)', function () { expect(await masterOracle.getPriceInUsd(weth.address)).gt(0) expect(await masterOracle.getPriceInUsd(msUSD.address)).gt(0) expect(await masterOracle.getPriceInUsd(msETH.address)).gt(0) + expect(await masterOracle.getPriceInUsd(vaCBETH.address)).gt(0) + expect(await masterOracle.getPriceInUsd(vaUSDC.address)).gt(0) + expect(await masterOracle.getPriceInUsd(vaETH.address)).gt(0) + expect(await masterOracle.getPriceInUsd(vaWSTETH.address)).gt(0) }) }) @@ -249,6 +295,62 @@ describe('E2E tests (next base release)', function () { await expect(tx).changeTokenBalance(msdWETH, alice, amount) }) + it('should deposit vaUSDC using USDC', async function () { + // + // Deploy `VesperGateway` implementation + // Note: It won't be necessary when this contract get online + // + const vesperGatewayFactory = await ethers.getContractFactory('VesperGateway', alice) + const vesperGateway = await vesperGatewayFactory.deploy(poolRegistry.address) + + // given + const amount6 = parseUnits('1', 6) + const amount18 = parseUnits('1', 18) + const before = await msdVaUSDC.balanceOf(alice.address) + expect(before).eq(0) + + // when + await usdc.approve(vesperGateway.address, amount6) + await vesperGateway.deposit(pool.address, vaUSDC.address, amount6) + + // then + const after = await msdVaUSDC.balanceOf(alice.address) + expect(after).closeTo(amount18, parseUnits('0.1', 18)) + }) + + it('should deposit vaETH', async function () { + // given + const amount = parseUnits('1', 18) + + // when + const tx = () => msdVaETH.deposit(amount, alice.address) + + // then + await expect(tx).changeTokenBalance(msdVaETH, alice, amount) + }) + + it('should deposit vaWSTETH', async function () { + // given + const amount = parseUnits('1', 18) + + // when + const tx = () => msdVaWSTETH.deposit(amount, alice.address) + + // then + await expect(tx).changeTokenBalance(msdVaWSTETH, alice, amount) + }) + + it('should deposit vaCBETH', async function () { + // given + const amount = parseUnits('1', 18) + + // when + const tx = () => msdVaCBETH.deposit(amount, alice.address) + + // then + await expect(tx).changeTokenBalance(msdVaCBETH, alice, amount) + }) + it('should issue msUSD', async function () { // given await msdUSDC.deposit(parseUnits('10', await usdc.decimals()), alice.address) diff --git a/test/E2E.base.test.ts b/test/E2E.base.test.ts index 8796db0..f1307e7 100644 --- a/test/E2E.base.test.ts +++ b/test/E2E.base.test.ts @@ -22,17 +22,21 @@ import { ProxyOFT, } from '../typechain' import {address as POOL_REGISTRY_ADDRESS} from '../deployments/base/PoolRegistry.json' -import {address as WETH_DEPOSIT_ADDRESS} from '../deployments/base/WETHDepositToken.json' -import {address as USDC_DEPOSIT_ADDRESS} from '../deployments/base/USDCDepositToken.json' -import {address as MSUSD_DEBT_ADDRESS} from '../deployments/base/MsUSDDebt.json' -import {address as MSETH_DEBT_ADDRESS} from '../deployments/base/MsETHDebt.json' +import {address as WETH_DEPOSIT_ADDRESS} from '../deployments/base/WETHDepositToken_Pool1.json' +import {address as USDC_DEPOSIT_ADDRESS} from '../deployments/base/USDCDepositToken_Pool1.json' +import {address as VAETH_DEPOSIT_ADDRESS} from '../deployments/base/VaETHDepositToken_Pool1.json' +import {address as VAWSTETH_DEPOSIT_ADDRESS} from '../deployments/base/VaWSTETHDepositToken_Pool1.json' +import {address as VAUSDC_DEPOSIT_ADDRESS} from '../deployments/base/VaUSDCDepositToken_Pool1.json' +import {address as VACBETH_DEPOSIT_ADDRESS} from '../deployments/base/VaCBETHDepositToken_Pool1.json' +import {address as MSUSD_DEBT_ADDRESS} from '../deployments/base/MsUSDDebt_Pool1.json' +import {address as MSETH_DEBT_ADDRESS} from '../deployments/base/MsETHDebt_Pool1.json' import {address as MSUSD_SYNTHETIC_ADDRESS} from '../deployments/base/MsUSDSynthetic.json' import {address as MSETH_SYNTHETIC_ADDRESS} from '../deployments/base/MsETHSynthetic.json' import {address as MSUSD_PROXYOFT_ADDRESS} from '../deployments/base/MsUSDProxyOFT.json' import {address as MSETH_PROXYOFT_ADDRESS} from '../deployments/base/MsETHProxyOFT.json' import {address as NATIVE_TOKEN_GATEWAY_ADDRESS} from '../deployments/base/NativeTokenGateway.json' import {address as QUOTER_ADDRESS} from '../deployments/base/Quoter.json' -import {address as SMART_FARMING_MANAGER_ADDRESS} from '../deployments/base/SmartFarmingManager.json' +import {address as SMART_FARMING_MANAGER_ADDRESS} from '../deployments/base/SmartFarmingManager_Pool1.json' import {address as CROSS_CHAIN_DISPATCHER_ADDRESS} from '../deployments/base/CrossChainDispatcher.json' const {MaxUint256} = ethers.constants @@ -51,6 +55,11 @@ describe.skip('E2E tests (base)', function () { let bob: SignerWithAddress let weth: IWETH let usdc: ERC20 + let vaUSDC: ERC20 + let vaETH: ERC20 + let vaWstETH: ERC20 + let vaCbETH: ERC20 + let masterOracle: Contract let poolRegistry: PoolRegistry let nativeGateway: NativeTokenGateway @@ -60,6 +69,10 @@ describe.skip('E2E tests (base)', function () { let pool: Pool let msdWETH: DepositToken let msdUSDC: DepositToken + let msdVaETH: DepositToken + let msdVaUSDC: DepositToken + let msdVaWstETH: DepositToken + let msdVaCbETH: DepositToken let msUSDDebt: DebtToken let msETHDebt: DebtToken let msUSD: SyntheticToken @@ -78,6 +91,10 @@ describe.skip('E2E tests (base)', function () { ;[, alice, bob] = await ethers.getSigners() usdc = await ethers.getContractAt('ERC20', Address.USDC_ADDRESS, alice) weth = await ethers.getContractAt('IWETH', Address.WETH_ADDRESS, alice) + vaUSDC = await ethers.getContractAt('ERC20', Address.VAUSDC_ADDRESS, alice) + vaETH = await ethers.getContractAt('ERC20', Address.VAETH_ADDRESS, alice) + vaWstETH = await ethers.getContractAt('ERC20', Address.VAWSTETH_ADDRESS, alice) + vaCbETH = await ethers.getContractAt('ERC20', Address.VACBETH_ADDRESS, alice) poolRegistry = await ethers.getContractAt('PoolRegistry', POOL_REGISTRY_ADDRESS, alice) governor = await impersonateAccount(await poolRegistry.governor()) @@ -88,6 +105,10 @@ describe.skip('E2E tests (base)', function () { msdWETH = await ethers.getContractAt('DepositToken', WETH_DEPOSIT_ADDRESS, alice) msdUSDC = await ethers.getContractAt('DepositToken', USDC_DEPOSIT_ADDRESS, alice) // 6 decimals. + msdVaETH = await ethers.getContractAt('DepositToken', VAETH_DEPOSIT_ADDRESS, alice) + msdVaUSDC = await ethers.getContractAt('DepositToken', VAUSDC_DEPOSIT_ADDRESS, alice) + msdVaWstETH = await ethers.getContractAt('DepositToken', VAWSTETH_DEPOSIT_ADDRESS, alice) + msdVaCbETH = await ethers.getContractAt('DepositToken', VACBETH_DEPOSIT_ADDRESS, alice) msUSDDebt = await ethers.getContractAt('DebtToken', MSUSD_DEBT_ADDRESS, alice) msETHDebt = await ethers.getContractAt('DebtToken', MSETH_DEBT_ADDRESS, alice) @@ -104,20 +125,30 @@ describe.skip('E2E tests (base)', function () { await setTokenBalance(usdc.address, alice.address, parseUnits('10,000', 6)) await setTokenBalance(weth.address, alice.address, parseUnits('20', 18)) + await setTokenBalance(vaETH.address, alice.address, parseUnits('12', 18)) + await setTokenBalance(vaUSDC.address, alice.address, parseUnits('10,000', 18)) + await setTokenBalance(vaWstETH.address, alice.address, parseUnits('20', 18)) + await setTokenBalance(vaCbETH.address, alice.address, parseUnits('20', 18)) await usdc.connect(alice).approve(msdUSDC.address, MaxUint256) await weth.connect(alice).approve(msdWETH.address, MaxUint256) + await vaETH.connect(alice).approve(msdVaETH.address, MaxUint256) + await vaUSDC.connect(alice).approve(msdVaUSDC.address, MaxUint256) + await vaWstETH.connect(alice).approve(msdVaWstETH.address, MaxUint256) + await vaCbETH.connect(alice).approve(msdVaCbETH.address, MaxUint256) + + await poolRegistry.connect(governor).unpause() + await poolRegistry.connect(governor).updateSwapper(Address.SWAPPER_ADDRESS) - const masterOracleGovernor = await impersonateAccount(Address.MASTER_ORACLE_GOVERNOR_ADDRESS) masterOracle = new ethers.Contract( Address.MASTER_ORACLE_ADDRESS, ['function defaultOracle() view returns(address)', 'function getPriceInUsd(address) view returns(uint256)'], - masterOracleGovernor + governor ) const defaultOracle = new ethers.Contract( await masterOracle.defaultOracle(), ['function updateDefaultStalePeriod(uint256)'], - masterOracleGovernor + governor ) await defaultOracle.updateDefaultStalePeriod(ethers.constants.MaxUint256) @@ -337,6 +368,130 @@ describe.skip('E2E tests (base)', function () { expect(_debtInUsd).eq(0) expect(_depositInUsd).eq(0) }) + + it('should leverage vaUSDC->msUSD', async function () { + // when + const amountIn = parseUnits('100', 18) + const leverage = parseEther('1.5') + await vaUSDC.connect(alice).approve(smartFarmingManager.address, MaxUint256) + const tx = await smartFarmingManager.leverage( + vaUSDC.address, + msdVaUSDC.address, + msUSD.address, + amountIn, + leverage, + 0 + ) + + // then + const {gasUsed} = await tx.wait() + expect(gasUsed.lt(1.4e6)) + const {_debtInUsd, _depositInUsd} = await pool.debtPositionOf(alice.address) + expect(_depositInUsd).closeTo(parseEther('150'), parseEther('10')) + expect(_debtInUsd).closeTo(amountIn.mul(leverage.sub(parseEther('1'))).div(parseEther('1')), parseEther('10')) // ~$50 + }) + + it('should leverage vaETH->msETH', async function () { + // when + const amountIn = parseUnits('0.1', 18) + const amountInUsd = parseUnits('300', 18) // approx. + const leverage = parseEther('1.5') + await vaETH.connect(alice).approve(smartFarmingManager.address, MaxUint256) + const tx = await smartFarmingManager.leverage( + vaETH.address, + msdVaETH.address, + msETH.address, + amountIn, + leverage, + 0 + ) + + // then + const {gasUsed} = await tx.wait() + expect(gasUsed.lt(1.4e6)) + const {_debtInUsd, _depositInUsd} = await pool.debtPositionOf(alice.address) + expect(_depositInUsd).closeTo(amountInUsd.mul(leverage).div(parseEther('1')), parseEther('100')) + expect(_debtInUsd).closeTo( + amountInUsd.mul(leverage.sub(parseEther('1'))).div(parseEther('1')), + parseEther('100') + ) // ~$95 + }) + + it('should leverage vastETH->msETH', async function () { + // when + const amountIn = parseUnits('0.1', 18) + const amountInUsd = parseUnits('355', 18) // approx. + const leverage = parseEther('1.5') + await vaWstETH.connect(alice).approve(smartFarmingManager.address, MaxUint256) + const tx = await smartFarmingManager.leverage( + vaWstETH.address, + msdVaWstETH.address, + msETH.address, + amountIn, + leverage, + 0 + ) + + // then + const {gasUsed} = await tx.wait() + expect(gasUsed.lt(1.4e6)) + const {_debtInUsd, _depositInUsd} = await pool.debtPositionOf(alice.address) + expect(_depositInUsd).closeTo(amountInUsd.mul(leverage).div(parseEther('1')), parseEther('100')) + expect(_debtInUsd).closeTo( + amountInUsd.mul(leverage.sub(parseEther('1'))).div(parseEther('1')), + parseEther('100') + ) // ~$97 + }) + + it('should leverage vacbETH->msETH', async function () { + // when + const amountIn = parseUnits('0.1', 18) + const amountInUsd = parseUnits('355', 18) // approx. + const leverage = parseEther('1.5') + await vaCbETH.connect(alice).approve(smartFarmingManager.address, MaxUint256) + const tx = await smartFarmingManager.leverage( + vaCbETH.address, + msdVaCbETH.address, + msETH.address, + amountIn, + leverage, + 0 + ) + + // then + const {gasUsed} = await tx.wait() + expect(gasUsed.lt(1.4e6)) + const {_debtInUsd, _depositInUsd} = await pool.debtPositionOf(alice.address) + expect(_depositInUsd).closeTo(amountInUsd.mul(leverage).div(parseEther('1')), parseEther('100')) + expect(_debtInUsd).closeTo( + amountInUsd.mul(leverage.sub(parseEther('1'))).div(parseEther('1')), + parseEther('100') + ) // ~$95 + }) + }) + + describe('flashRepay', function () { + beforeEach(async function () { + const {_debtInUsd, _depositInUsd} = await pool.debtPositionOf(alice.address) + expect(_debtInUsd).eq(0) + expect(_depositInUsd).eq(0) + const amountIn = parseUnits('100', 18) + const leverage = parseEther('1.5') + await vaUSDC.connect(alice).approve(smartFarmingManager.address, MaxUint256) + await smartFarmingManager.leverage(vaUSDC.address, msdVaUSDC.address, msUSD.address, amountIn, leverage, 0) + }) + + it('should flash repay msUSD debt using vaUSDC', async function () { + // when + const withdrawAmount = parseEther('45') + const tx = await smartFarmingManager.flashRepay(msUSD.address, msdVaUSDC.address, withdrawAmount, 0) + + // then + const {gasUsed} = await tx.wait() + expect(gasUsed.lt(1e6)) + const {_debtInUsd} = await pool.debtPositionOf(alice.address) + expect(_debtInUsd).closeTo(0, parseEther('10')) + }) }) }) }) diff --git a/test/helpers/index.ts b/test/helpers/index.ts index de50110..604812c 100644 --- a/test/helpers/index.ts +++ b/test/helpers/index.ts @@ -128,6 +128,10 @@ const getBalancesSlot = (token: string) => { [8453]: { [Address.USDC_ADDRESS]: 9, [Address.WETH_ADDRESS]: 3, + [Address.VAUSDC_ADDRESS]: 0, + [Address.VAETH_ADDRESS]: 0, + [Address.VAWSTETH_ADDRESS]: 0, + [Address.VACBETH_ADDRESS]: 0, }, }