diff --git a/deployments/mainnet/.migrations.json b/deployments/mainnet/.migrations.json index 389a6978a..fc963d63d 100644 --- a/deployments/mainnet/.migrations.json +++ b/deployments/mainnet/.migrations.json @@ -58,5 +58,8 @@ "000057-upgrade-v2-liquidity-protection-v5": 1669191829, "000058-bancor-arbitrage": 1677763108, "000059-bancor-arbitrage-upgrade": 1678818388, - "000060-bancor-network-pool-collection-type1-v11-upgrade": 1678818774 + "000060-bancor-network-pool-collection-type1-v11-upgrade": 1678818774, + "000061-upgrade-network-settings-v4": 1694606550, + "000062-pool-collection-type1-v12": 1694606727, + "000063-upgrade-network-v9": 1694606812 } \ No newline at end of file diff --git a/deployments/mainnet/BancorNetwork.json b/deployments/mainnet/BancorNetwork.json index 7d2a6eb63..937650111 100644 --- a/deployments/mainnet/BancorNetwork.json +++ b/deployments/mainnet/BancorNetwork.json @@ -151,6 +151,11 @@ "name": "InsufficientFlashLoanReturn", "type": "error" }, + { + "inputs": [], + "name": "InvalidFee", + "type": "error" + }, { "inputs": [], "name": "InvalidPool", @@ -176,11 +181,21 @@ "name": "NotWhitelisted", "type": "error" }, + { + "inputs": [], + "name": "NotWhitelistedForPOL", + "type": "error" + }, { "inputs": [], "name": "Overflow", "type": "error" }, + { + "inputs": [], + "name": "PoolNotInSurplus", + "type": "error" + }, { "inputs": [], "name": "ZeroValue", @@ -285,6 +300,56 @@ "name": "NetworkFeesWithdrawn", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "oldRewardsPPM", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "newRewardsPPM", + "type": "uint32" + } + ], + "name": "POLRewardsPPMUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "polTokenAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "userReward", + "type": "uint256" + } + ], + "name": "POLWithdrawn", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -966,6 +1031,19 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "polRewardsPPM", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "poolCollections", @@ -1100,6 +1178,19 @@ "stateMutability": "pure", "type": "function" }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "newRewardsPPM", + "type": "uint32" + } + ], + "name": "setPOLRewardsPPM", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -1359,6 +1450,25 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "contract Token", + "name": "pool", + "type": "address" + } + ], + "name": "withdrawPOL", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -1381,8 +1491,8 @@ "type": "constructor" } ], - "numDeployments": 8, - "solcInputHash": "e56f1a79e4d0bb7951ba6b01e2324a81", + "numDeployments": 9, + "solcInputHash": "4a12fa84003cd14a8d58a795b8fd43b8", "metadata": "{\"compiler\":{\"version\":\"0.8.13+commit.abaa5c0e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"initAdmin\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AccessDenied\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidAddress\",\"type\":\"error\"},{\"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\":\"\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"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 is a slightly optimized version of the original TransparentUpgradeableProxy solely designed to work with the ProxyAdmin contract: - the address of the admin is stored as an immutable state variables and as the result: - the address of the admin can't be change, so the changeAdmin() function was subsequently removed note that we're using the Transparent Upgradeable Proxy pattern and *not* the Universal Upgradeable Proxy Standard (UUPS) pattern, therefore initializing the implementation contracts is not necessary or required\",\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"returns the current admin requirements: - the caller must be the admin of the contract\"},\"constructor\":{\"details\":\"initializes an upgradeable proxy managed by `initAdmin`, backed by the implementation at `logic`, and optionally initialized with `data` as explained in {ERC1967Proxy-constructor}\"},\"implementation()\":{\"details\":\"returns the current implementation. requirements: - the caller must be the admin of the contract\"},\"upgradeTo(address)\":{\"details\":\"upgrades the implementation of the proxy requirements: - the caller must be the admin of the contract\"},\"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 requirements: - the caller must be the admin of the contract\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/utility/TransparentUpgradeableProxyImmutable.sol\":\"TransparentUpgradeableProxyImmutable\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"none\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/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\"},\"@openzeppelin/contracts/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\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.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\":\"0x0edeb16b9821ae2b16e9d69c383b38d3ad2fbb3e0c06cf809a0786d96e602551\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.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\"},\"@openzeppelin/contracts/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/utility/Constants.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nuint32 constant PPM_RESOLUTION = 1_000_000;\\n\",\"keccak256\":\"0x5215535db0a4e580cd19380cc1cf3a2b7edcbb8ee039e416319fe9f8867724ad\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/utility/TransparentUpgradeableProxyImmutable.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { ERC1967Proxy } from \\\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\\\";\\n\\nimport { AccessDenied, Utils } from \\\"./Utils.sol\\\";\\n\\n/**\\n * @dev this contract is a slightly optimized version of the original TransparentUpgradeableProxy solely designed to\\n * work with the ProxyAdmin contract:\\n *\\n * - the address of the admin is stored as an immutable state variables and as the result:\\n * - the address of the admin can't be change, so the changeAdmin() function was subsequently removed\\n *\\n * note that we're using the Transparent Upgradeable Proxy pattern and *not* the Universal Upgradeable Proxy Standard\\n * (UUPS) pattern, therefore initializing the implementation contracts is not necessary or required\\n */\\ncontract TransparentUpgradeableProxyImmutable is ERC1967Proxy, Utils {\\n address internal immutable _admin;\\n\\n /**\\n * @dev initializes an upgradeable proxy managed by `initAdmin`, 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 initAdmin,\\n bytes memory data\\n ) payable ERC1967Proxy(logic, data) validAddress(initAdmin) {\\n _admin = initAdmin;\\n\\n // still store it to work with EIP-1967\\n _changeAdmin(initAdmin);\\n }\\n\\n modifier ifAdmin() {\\n if (msg.sender == _admin) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev returns the current admin\\n *\\n * requirements:\\n *\\n * - the caller must be the admin of the contract\\n */\\n function admin() external ifAdmin returns (address) {\\n return _admin;\\n }\\n\\n /**\\n * @dev returns the current implementation.\\n *\\n * requirements:\\n *\\n * - the caller must be the admin of the contract\\n */\\n function implementation() external ifAdmin returns (address) {\\n return _implementation();\\n }\\n\\n /**\\n * @dev upgrades the implementation of the proxy\\n *\\n * requirements:\\n *\\n * - the caller must be the admin of the contract\\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 * requirements:\\n *\\n * - the caller must be the admin of the contract\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev makes sure the admin cannot access the fallback function\\n */\\n function _beforeFallback() internal virtual override {\\n if (msg.sender == _admin) {\\n revert AccessDenied();\\n }\\n\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0xd5b7343190a9781de9ab9abecc267fd8d38d95e35a58481858e8313180b8f8a9\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/utility/Utils.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { PPM_RESOLUTION } from \\\"./Constants.sol\\\";\\n\\nerror AccessDenied();\\nerror AlreadyExists();\\nerror DoesNotExist();\\nerror InvalidAddress();\\nerror InvalidExternalAddress();\\nerror InvalidFee();\\nerror InvalidPool();\\nerror InvalidPoolCollection();\\nerror InvalidStakedBalance();\\nerror InvalidToken();\\nerror InvalidParam();\\nerror NotEmpty();\\nerror NotPayable();\\nerror ZeroValue();\\n\\n/**\\n * @dev common utilities\\n */\\nabstract contract Utils {\\n // allows execution by the caller only\\n modifier only(address caller) {\\n _only(caller);\\n\\n _;\\n }\\n\\n function _only(address caller) internal view {\\n if (msg.sender != caller) {\\n revert AccessDenied();\\n }\\n }\\n\\n // verifies that a value is greater than zero\\n modifier greaterThanZero(uint256 value) {\\n _greaterThanZero(value);\\n\\n _;\\n }\\n\\n // error message binary size optimization\\n function _greaterThanZero(uint256 value) internal pure {\\n if (value == 0) {\\n revert ZeroValue();\\n }\\n }\\n\\n // validates an address - currently only checks that it isn't null\\n modifier validAddress(address addr) {\\n _validAddress(addr);\\n\\n _;\\n }\\n\\n // error message binary size optimization\\n function _validAddress(address addr) internal pure {\\n if (addr == address(0)) {\\n revert InvalidAddress();\\n }\\n }\\n\\n // validates an external address - currently only checks that it isn't null or this\\n modifier validExternalAddress(address addr) {\\n _validExternalAddress(addr);\\n\\n _;\\n }\\n\\n // error message binary size optimization\\n function _validExternalAddress(address addr) internal view {\\n if (addr == address(0) || addr == address(this)) {\\n revert InvalidExternalAddress();\\n }\\n }\\n\\n // ensures that the fee is valid\\n modifier validFee(uint32 fee) {\\n _validFee(fee);\\n\\n _;\\n }\\n\\n // error message binary size optimization\\n function _validFee(uint32 fee) internal pure {\\n if (fee > PPM_RESOLUTION) {\\n revert InvalidFee();\\n }\\n }\\n}\\n\",\"keccak256\":\"0x62b8b81d3069467eb6402b8f61adcc24f5b2e310db1a2ee64d719229306ab823\",\"license\":\"SEE LICENSE IN LICENSE\"}},\"version\":1}", "bytecode": "0x60a060405260405162000dfe38038062000dfe83398101604081905262000026916200050e565b82816200005560017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd620005ee565b60008051602062000db78339815191521462000075576200007562000614565b6200008382826000620000b4565b508290506200009281620000f1565b6001600160a01b038316608052620000aa836200011c565b505050506200067d565b620000bf8362000174565b600082511180620000cd5750805b15620000ec57620000ea8383620001b660201b620002641760201c565b505b505050565b6001600160a01b038116620001195760405163e6c4247b60e01b815260040160405180910390fd5b50565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f62000147620001e5565b604080516001600160a01b03928316815291841660208301520160405180910390a162000119816200021e565b6200017f81620002d3565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060620001de838360405180606001604052806027815260200162000dd76027913962000376565b9392505050565b60006200020f60008051602062000d9783398151915260001b6200045c60201b6200020a1760201c565b546001600160a01b0316919050565b6001600160a01b038116620002895760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b80620002b260008051602062000d9783398151915260001b6200045c60201b6200020a1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002e9816200045f60201b620002901760201c565b6200034d5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b606482015260840162000280565b80620002b260008051602062000db783398151915260001b6200045c60201b6200020a1760201c565b60606001600160a01b0384163b620003e05760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b606482015260840162000280565b600080856001600160a01b031685604051620003fd91906200062a565b600060405180830381855af49150503d80600081146200043a576040519150601f19603f3d011682016040523d82523d6000602084013e6200043f565b606091505b509092509050620004528282866200046e565b9695505050505050565b90565b6001600160a01b03163b151590565b606083156200047f575081620001de565b825115620004905782518084602001fd5b8160405162461bcd60e51b815260040162000280919062000648565b80516001600160a01b0381168114620004c457600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620004fc578181015183820152602001620004e2565b83811115620000ea5750506000910152565b6000806000606084860312156200052457600080fd5b6200052f84620004ac565b92506200053f60208501620004ac565b60408501519092506001600160401b03808211156200055d57600080fd5b818601915086601f8301126200057257600080fd5b815181811115620005875762000587620004c9565b604051601f8201601f19908116603f01168101908382118183101715620005b257620005b2620004c9565b81604052828152896020848701011115620005cc57600080fd5b620005df836020830160208801620004df565b80955050505050509250925092565b6000828210156200060f57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b600082516200063e818460208701620004df565b9190910192915050565b602081526000825180602084015262000669816040850160208701620004df565b601f01601f19169190910160400192915050565b6080516106dc620006bb6000396000818160f70152818161014d015281816101cf015281816102190152818161024201526102a901526106dc6000f3fe6080604052600436106100435760003560e01c80633659cfe61461005a5780634f1ef2861461007a5780635c60da1b1461008d578063f851a440146100be57610052565b36610052576100506100d3565b005b6100506100d3565b34801561006657600080fd5b5061005061007536600461058f565b6100ed565b6100506100883660046105aa565b610143565b34801561009957600080fd5b506100a26101c3565b6040516001600160a01b03909116815260200160405180910390f35b3480156100ca57600080fd5b506100a261020d565b6100db61029f565b6100eb6100e66102e8565b61031b565b565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016330361013b576101388160405180602001604052806000815250600061033f565b50565b6101386100d3565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633036101bb576101b68383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061033f915050565b505050565b6101b66100d3565b60006001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163303610202576101fd6102e8565b905090565b61020a6100d3565b90565b60006001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016330361020257507f000000000000000000000000000000000000000000000000000000000000000090565b606061028983836040518060600160405280602781526020016106a96027913961036a565b9392505050565b6001600160a01b03163b151590565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633036100eb57604051634ca8886760e01b815260040160405180910390fd5b60006101fd7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b3660008037600080366000845af43d6000803e80801561033a573d6000f35b3d6000fd5b6103488361044c565b6000825111806103555750805b156101b6576103648383610264565b50505050565b60606001600160a01b0384163b6103d75760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084015b60405180910390fd5b600080856001600160a01b0316856040516103f29190610659565b600060405180830381855af49150503d806000811461042d576040519150601f19603f3d011682016040523d82523d6000602084013e610432565b606091505b509150915061044282828661048c565b9695505050505050565b610455816104c5565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060831561049b575081610289565b8251156104ab5782518084602001fd5b8160405162461bcd60e51b81526004016103ce9190610675565b6001600160a01b0381163b6105325760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016103ce565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b80356001600160a01b038116811461058a57600080fd5b919050565b6000602082840312156105a157600080fd5b61028982610573565b6000806000604084860312156105bf57600080fd5b6105c884610573565b9250602084013567ffffffffffffffff808211156105e557600080fd5b818601915086601f8301126105f957600080fd5b81358181111561060857600080fd5b87602082850101111561061a57600080fd5b6020830194508093505050509250925092565b60005b83811015610648578181015183820152602001610630565b838111156103645750506000910152565b6000825161066b81846020870161062d565b9190910192915050565b602081526000825180602084015261069481604085016020870161062d565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a164736f6c634300080d000ab53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", "deployedBytecode": "0x6080604052600436106100435760003560e01c80633659cfe61461005a5780634f1ef2861461007a5780635c60da1b1461008d578063f851a440146100be57610052565b36610052576100506100d3565b005b6100506100d3565b34801561006657600080fd5b5061005061007536600461058f565b6100ed565b6100506100883660046105aa565b610143565b34801561009957600080fd5b506100a26101c3565b6040516001600160a01b03909116815260200160405180910390f35b3480156100ca57600080fd5b506100a261020d565b6100db61029f565b6100eb6100e66102e8565b61031b565b565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016330361013b576101388160405180602001604052806000815250600061033f565b50565b6101386100d3565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633036101bb576101b68383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061033f915050565b505050565b6101b66100d3565b60006001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163303610202576101fd6102e8565b905090565b61020a6100d3565b90565b60006001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016330361020257507f000000000000000000000000000000000000000000000000000000000000000090565b606061028983836040518060600160405280602781526020016106a96027913961036a565b9392505050565b6001600160a01b03163b151590565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633036100eb57604051634ca8886760e01b815260040160405180910390fd5b60006101fd7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b3660008037600080366000845af43d6000803e80801561033a573d6000f35b3d6000fd5b6103488361044c565b6000825111806103555750805b156101b6576103648383610264565b50505050565b60606001600160a01b0384163b6103d75760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084015b60405180910390fd5b600080856001600160a01b0316856040516103f29190610659565b600060405180830381855af49150503d806000811461042d576040519150601f19603f3d011682016040523d82523d6000602084013e610432565b606091505b509150915061044282828661048c565b9695505050505050565b610455816104c5565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060831561049b575081610289565b8251156104ab5782518084602001fd5b8160405162461bcd60e51b81526004016103ce9190610675565b6001600160a01b0381163b6105325760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016103ce565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b80356001600160a01b038116811461058a57600080fd5b919050565b6000602082840312156105a157600080fd5b61028982610573565b6000806000604084860312156105bf57600080fd5b6105c884610573565b9250602084013567ffffffffffffffff808211156105e557600080fd5b818601915086601f8301126105f957600080fd5b81358181111561060857600080fd5b87602082850101111561061a57600080fd5b6020830194508093505050509250925092565b60005b83811015610648578181015183820152602001610630565b838111156103645750506000910152565b6000825161066b81846020870161062d565b9190910192915050565b602081526000825180602084015261069481604085016020870161062d565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a164736f6c634300080d000a", @@ -1392,7 +1502,7 @@ "0x" ] }, - "implementation": "0x955a85437664fE809563dd0fA91B1590b159e1e6", + "implementation": "0xE0CB1BEb84b3289B946Ac7Fa067f4c44AdFFA4Fb", "devdoc": { "details": "this contract is a slightly optimized version of the original TransparentUpgradeableProxy solely designed to work with the ProxyAdmin contract: - the address of the admin is stored as an immutable state variables and as the result: - the address of the admin can't be change, so the changeAdmin() function was subsequently removed note that we're using the Transparent Upgradeable Proxy pattern and *not* the Universal Upgradeable Proxy Standard (UUPS) pattern, therefore initializing the implementation contracts is not necessary or required", "kind": "dev", diff --git a/deployments/mainnet/BancorNetwork_Implementation.json b/deployments/mainnet/BancorNetwork_Implementation.json index 75d1bede1..7e6d6a656 100644 --- a/deployments/mainnet/BancorNetwork_Implementation.json +++ b/deployments/mainnet/BancorNetwork_Implementation.json @@ -1,5 +1,5 @@ { - "address": "0x955a85437664fE809563dd0fA91B1590b159e1e6", + "address": "0xE0CB1BEb84b3289B946Ac7Fa067f4c44AdFFA4Fb", "abi": [ { "inputs": [ @@ -37,6 +37,11 @@ "internalType": "address", "name": "bancorArbitrage", "type": "address" + }, + { + "internalType": "address", + "name": "carbonPOL", + "type": "address" } ], "stateMutability": "nonpayable", @@ -82,6 +87,11 @@ "name": "InvalidAddress", "type": "error" }, + { + "inputs": [], + "name": "InvalidFee", + "type": "error" + }, { "inputs": [], "name": "InvalidPool", @@ -107,11 +117,21 @@ "name": "NotWhitelisted", "type": "error" }, + { + "inputs": [], + "name": "NotWhitelistedForPOL", + "type": "error" + }, { "inputs": [], "name": "Overflow", "type": "error" }, + { + "inputs": [], + "name": "PoolNotInSurplus", + "type": "error" + }, { "inputs": [], "name": "ZeroValue", @@ -216,6 +236,56 @@ "name": "NetworkFeesWithdrawn", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "oldRewardsPPM", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "newRewardsPPM", + "type": "uint32" + } + ], + "name": "POLRewardsPPMUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "polTokenAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "userReward", + "type": "uint256" + } + ], + "name": "POLWithdrawn", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -897,6 +967,19 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "polRewardsPPM", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "poolCollections", @@ -1031,6 +1114,19 @@ "stateMutability": "pure", "type": "function" }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "newRewardsPPM", + "type": "uint32" + } + ], + "name": "setPOLRewardsPPM", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -1290,24 +1386,43 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "contract Token", + "name": "pool", + "type": "address" + } + ], + "name": "withdrawPOL", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, { "stateMutability": "payable", "type": "receive" } ], - "transactionHash": "0x2fffd38a035ceee4887bd67879aa618b6ac685d19a1091c9ef39557aa010dbc3", + "transactionHash": "0x80e14afdb0d8597e308e4720d49e7d1e7dec98606ab47816b4125e49641b7e80", "receipt": { "to": null, "from": "0x5bEBA4D3533a963Dedb270a95ae5f7752fA0Fe22", - "contractAddress": "0x955a85437664fE809563dd0fA91B1590b159e1e6", - "transactionIndex": 40, - "gasUsed": "4916372", + "contractAddress": "0xE0CB1BEb84b3289B946Ac7Fa067f4c44AdFFA4Fb", + "transactionIndex": 78, + "gasUsed": "5246425", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x7d90d9a0c4a0c97fea0bb2f2784f8d48c89a13893ad93bc707d6b42df03ff135", - "transactionHash": "0x2fffd38a035ceee4887bd67879aa618b6ac685d19a1091c9ef39557aa010dbc3", + "blockHash": "0x5f561d766c6837008dc6b69338ba91da3d5b505576148961bf1c64fc0dee8589", + "transactionHash": "0x80e14afdb0d8597e308e4720d49e7d1e7dec98606ab47816b4125e49641b7e80", "logs": [], - "blockNumber": 16827972, - "cumulativeGasUsed": "10016447", + "blockNumber": 18127270, + "cumulativeGasUsed": "10191946", "status": 1, "byzantium": true }, @@ -1318,13 +1433,14 @@ "0x649765821D9f64198c905eC0B2B037a4a52Bc373", "0xFd31662b3d54eddE9B6Bdd32c9c27C8E292cAD57", "0xAB05Cf7C6c3a288cd36326e4f7b8600e7268E344", - "0x41Eeba3355d7D6FF628B7982F3F9D055c39488cB" + "0x41Eeba3355d7D6FF628B7982F3F9D055c39488cB", + "0xD06146D292F9651C1D7cf54A3162791DFc2bEf46" ], - "numDeployments": 7, - "solcInputHash": "e56f1a79e4d0bb7951ba6b01e2324a81", - "metadata": "{\"compiler\":{\"version\":\"0.8.13+commit.abaa5c0e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract ITokenGovernance\",\"name\":\"initBNTGovernance\",\"type\":\"address\"},{\"internalType\":\"contract ITokenGovernance\",\"name\":\"initVBNTGovernance\",\"type\":\"address\"},{\"internalType\":\"contract INetworkSettings\",\"name\":\"initNetworkSettings\",\"type\":\"address\"},{\"internalType\":\"contract IMasterVault\",\"name\":\"initMasterVault\",\"type\":\"address\"},{\"internalType\":\"contract IExternalProtectionVault\",\"name\":\"initExternalProtectionVault\",\"type\":\"address\"},{\"internalType\":\"contract IPoolToken\",\"name\":\"initBNTPoolToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"bancorArbitrage\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AccessDenied\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AlreadyExists\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AlreadyInitialized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DeadlineExpired\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DepositingDisabled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DoesNotExist\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientFlashLoanReturn\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidPool\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidToken\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NativeTokenAmountMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotEmpty\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotWhitelisted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Overflow\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroValue\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract Token\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"borrower\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"}],\"name\":\"FlashLoanCompleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"contextId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"contract Token\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"provider\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"availableAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"originalAmount\",\"type\":\"uint256\"}],\"name\":\"FundsMigrated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"NetworkFeesWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Paused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract Token\",\"name\":\"pool\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"contract IPoolCollection\",\"name\":\"poolCollection\",\"type\":\"address\"}],\"name\":\"PoolAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint16\",\"name\":\"poolType\",\"type\":\"uint16\"},{\"indexed\":true,\"internalType\":\"contract IPoolCollection\",\"name\":\"poolCollection\",\"type\":\"address\"}],\"name\":\"PoolCollectionAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint16\",\"name\":\"poolType\",\"type\":\"uint16\"},{\"indexed\":true,\"internalType\":\"contract IPoolCollection\",\"name\":\"poolCollection\",\"type\":\"address\"}],\"name\":\"PoolCollectionRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract Token\",\"name\":\"pool\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"contract IPoolCollection\",\"name\":\"poolCollection\",\"type\":\"address\"}],\"name\":\"PoolCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract Token\",\"name\":\"pool\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"contract IPoolCollection\",\"name\":\"poolCollection\",\"type\":\"address\"}],\"name\":\"PoolRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"previousAdminRole\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"newAdminRole\",\"type\":\"bytes32\"}],\"name\":\"RoleAdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleGranted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"contextId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"contract Token\",\"name\":\"sourceToken\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"contract Token\",\"name\":\"targetToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"sourceAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"targetAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"bntAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"targetFeeAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"bntFeeAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"trader\",\"type\":\"address\"}],\"name\":\"TokensTraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Unpaused\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DEFAULT_ADMIN_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"cancelWithdrawal\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"collectionByPool\",\"outputs\":[{\"internalType\":\"contract IPoolCollection\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token[]\",\"name\":\"tokens\",\"type\":\"address[]\"},{\"internalType\":\"contract IPoolCollection\",\"name\":\"poolCollection\",\"type\":\"address\"}],\"name\":\"createPools\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"pool\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenAmount\",\"type\":\"uint256\"}],\"name\":\"deposit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"provider\",\"type\":\"address\"},{\"internalType\":\"contract Token\",\"name\":\"pool\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenAmount\",\"type\":\"uint256\"}],\"name\":\"depositFor\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"depositingEnabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"status\",\"type\":\"bool\"}],\"name\":\"enableDepositing\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"contract IFlashLoanRecipient\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"flashLoan\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleAdmin\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"getRoleMember\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleMemberCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"grantRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"hasRole\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IPoolToken\",\"name\":\"poolToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"poolTokenAmount\",\"type\":\"uint256\"}],\"name\":\"initWithdrawal\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IBNTPool\",\"name\":\"initBNTPool\",\"type\":\"address\"},{\"internalType\":\"contract IPendingWithdrawals\",\"name\":\"initPendingWithdrawals\",\"type\":\"address\"},{\"internalType\":\"contract IPoolMigrator\",\"name\":\"initPoolMigrator\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"liquidityPools\",\"outputs\":[{\"internalType\":\"contract Token[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"provider\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"availableAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"originalAmount\",\"type\":\"uint256\"}],\"name\":\"migrateLiquidity\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token[]\",\"name\":\"pools\",\"type\":\"address[]\"},{\"internalType\":\"contract IPoolCollection\",\"name\":\"newPoolCollection\",\"type\":\"address\"}],\"name\":\"migratePools\",\"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\":\"pendingNetworkFeeAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"poolCollections\",\"outputs\":[{\"internalType\":\"contract IPoolCollection[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"postUpgrade\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IPoolCollection\",\"name\":\"newPoolCollection\",\"type\":\"address\"}],\"name\":\"registerPoolCollection\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"renounceRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"resume\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"revokeRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"roleAdmin\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"roleEmergencyStopper\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"roleMigrationManager\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"roleNetworkFeeManager\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"sourceToken\",\"type\":\"address\"},{\"internalType\":\"contract Token\",\"name\":\"targetToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"sourceAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minReturnAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"}],\"name\":\"tradeBySourceAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"sourceToken\",\"type\":\"address\"},{\"internalType\":\"contract Token\",\"name\":\"targetToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"sourceAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minReturnAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"}],\"name\":\"tradeBySourceAmountArb\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"sourceToken\",\"type\":\"address\"},{\"internalType\":\"contract Token\",\"name\":\"targetToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"targetAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxSourceAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"}],\"name\":\"tradeByTargetAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"sourceToken\",\"type\":\"address\"},{\"internalType\":\"contract Token\",\"name\":\"targetToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"targetAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxSourceAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"}],\"name\":\"tradeByTargetAmountArb\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IPoolCollection\",\"name\":\"poolCollection\",\"type\":\"address\"}],\"name\":\"unregisterPoolCollection\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"withdrawNetworkFees\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"Bancor Network contract\",\"events\":{\"FlashLoanCompleted(address,address,uint256,uint256)\":{\"details\":\"triggered when a flash-loan is completed\"},\"FundsMigrated(bytes32,address,address,uint256,uint256,uint256)\":{\"details\":\"triggered when funds are migrated\"},\"NetworkFeesWithdrawn(address,address,uint256)\":{\"details\":\"triggered when network fees are withdrawn\"},\"PoolAdded(address,address)\":{\"details\":\"triggered when a new pool is added to a pool collection\"},\"PoolCollectionAdded(uint16,address)\":{\"details\":\"triggered when a new pool collection is added\"},\"PoolCollectionRemoved(uint16,address)\":{\"details\":\"triggered when an existing pool collection is removed\"},\"PoolCreated(address,address)\":{\"details\":\"triggered when a pool is created\"},\"PoolRemoved(address,address)\":{\"details\":\"triggered when a new pool is removed from a pool collection\"},\"TokensTraded(bytes32,address,address,uint256,uint256,uint256,uint256,uint256,address)\":{\"details\":\"triggered on a successful trade\"}},\"kind\":\"dev\",\"methods\":{\"cancelWithdrawal(uint256)\":{\"details\":\"cancels a withdrawal request, and returns the number of pool token amount associated with the withdrawal request requirements: - the caller must have already initiated a withdrawal and received the specified id\"},\"collectionByPool(address)\":{\"details\":\"returns the respective pool collection for the provided pool\"},\"constructor\":{\"details\":\"a \\\"virtual\\\" constructor that is only used to set immutable state variables\"},\"createPools(address[],address)\":{\"details\":\"creates new pools requirements: - none of the pools already exists\"},\"deposit(address,uint256)\":{\"details\":\"deposits liquidity for the current provider and returns the respective pool token amount requirements: - the caller must have approved the network to transfer the tokens on its behalf (except for in the native token case)\"},\"depositFor(address,address,uint256)\":{\"details\":\"deposits liquidity for the specified provider and returns the respective pool token amount requirements: - the caller must have approved the network to transfer the tokens on its behalf (except for in the native token case)\"},\"depositingEnabled()\":{\"details\":\"returns whether deposits are enabled\"},\"enableDepositing(bool)\":{\"details\":\"enables/disables depositing into a given pool requirements: - the caller must be the owner of the contract\"},\"flashLoan(address,uint256,address,bytes)\":{\"details\":\"provides a flash-loan requirements: - the recipient's callback must return *at least* the borrowed amount and fee back to the specified return address\"},\"getRoleAdmin(bytes32)\":{\"details\":\"Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.\"},\"getRoleMember(bytes32,uint256)\":{\"details\":\"Returns one of the accounts that have `role`. `index` must be a value between 0 and {getRoleMemberCount}, non-inclusive. Role bearers are not sorted in any particular way, and their ordering may change at any point. WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure you perform all queries on the same block. See the following https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] for more information.\"},\"getRoleMemberCount(bytes32)\":{\"details\":\"Returns the number of accounts that have `role`. Can be used together with {getRoleMember} to enumerate all bearers of a role.\"},\"grantRole(bytes32,address)\":{\"details\":\"Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role.\"},\"hasRole(bytes32,address)\":{\"details\":\"Returns `true` if `account` has been granted `role`.\"},\"initWithdrawal(address,uint256)\":{\"details\":\"initiates liquidity withdrawal requirements: - the caller must have approved the contract to transfer the pool token amount on its behalf\"},\"initialize(address,address,address)\":{\"details\":\"fully initializes the contract and its parents\"},\"liquidityPools()\":{\"details\":\"returns the set of all liquidity pools\"},\"migrateLiquidity(address,address,uint256,uint256,uint256)\":{\"details\":\"deposits liquidity during a migration\"},\"migratePools(address[],address)\":{\"details\":\"migrates a list of pools between pool collections notes: - invalid or incompatible pools will be skipped gracefully\"},\"pause()\":{\"details\":\"pauses the network requirements: - the caller must have the ROLE_EMERGENCY_STOPPER privilege\"},\"paused()\":{\"details\":\"Returns true if the contract is paused, and false otherwise.\"},\"pendingNetworkFeeAmount()\":{\"details\":\"returns the pending network fee amount to be burned by the vortex\"},\"poolCollections()\":{\"details\":\"returns the set of all valid pool collections\"},\"postUpgrade(bytes)\":{\"details\":\"performs post-upgrade initialization requirements: - this must can be called only once per-upgrade\"},\"registerPoolCollection(address)\":{\"details\":\"registers new pool collection with the network requirements: - the caller must be the admin of the contract\"},\"renounceRole(bytes32,address)\":{\"details\":\"Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `account`.\"},\"resume()\":{\"details\":\"resumes the network requirements: - the caller must have the ROLE_EMERGENCY_STOPPER privilege\"},\"revokeRole(bytes32,address)\":{\"details\":\"Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role.\"},\"roleAdmin()\":{\"details\":\"returns the admin role\"},\"roleEmergencyStopper()\":{\"details\":\"returns the emergency stopper role\"},\"roleMigrationManager()\":{\"details\":\"returns the migration manager role\"},\"roleNetworkFeeManager()\":{\"details\":\"returns the network fee manager role\"},\"supportsInterface(bytes4)\":{\"details\":\"See {IERC165-supportsInterface}.\"},\"tradeBySourceAmount(address,address,uint256,uint256,uint256,address)\":{\"details\":\"performs a trade by providing the input source amount, sends the proceeds to the optional beneficiary (or to the address of the caller, in case it's not supplied), and returns the trade target amount requirements: - the caller must have approved the network to transfer the source tokens on its behalf (except for in the native token case)\"},\"tradeBySourceAmountArb(address,address,uint256,uint256,uint256,address)\":{\"details\":\"performs a trade by providing the input source amount, sends the proceeds to the optional beneficiary (or to the address of the caller, in case it's not supplied), and returns the trade target amount requirements: - the caller must have approved the network to transfer the source tokens on its behalf (except for in the native token case) - the caller must be the _bancorArbitrage contract\"},\"tradeByTargetAmount(address,address,uint256,uint256,uint256,address)\":{\"details\":\"performs a trade by providing the output target amount, sends the proceeds to the optional beneficiary (or to the address of the caller, in case it's not supplied), and returns the trade source amount requirements: - the caller must have approved the network to transfer the source tokens on its behalf (except for in the native token case)\"},\"tradeByTargetAmountArb(address,address,uint256,uint256,uint256,address)\":{\"details\":\"performs a trade by providing the output target amount, sends the proceeds to the optional beneficiary (or to the address of the caller, in case it's not supplied), and returns the trade source amount requirements: - the caller must have approved the network to transfer the source tokens on its behalf (except for in the native token case) - the caller must be the _bancorArbitrage contract\"},\"unregisterPoolCollection(address)\":{\"details\":\"unregisters an existing pool collection from the network requirements: - the caller must be the admin of the contract\"},\"withdraw(uint256)\":{\"details\":\"withdraws liquidity and returns the withdrawn amount requirements: - the provider must have already initiated a withdrawal and received the specified id - the specified withdrawal request is eligible for completion - the provider must have approved the network to transfer vBNT amount on its behalf, when withdrawing BNT liquidity\"},\"withdrawNetworkFees(address)\":{\"details\":\"withdraws pending network fees, and returns the amount of fees withdrawn requirements: - the caller must have the ROLE_NETWORK_FEE_MANAGER privilege\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/network/BancorNetwork.sol\":\"BancorNetwork\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"none\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@bancor/token-governance/contracts/IClaimable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.6.12;\\n\\n/// @title Claimable contract interface\\ninterface IClaimable {\\n function owner() external view returns (address);\\n\\n function transferOwnership(address newOwner) external;\\n\\n function acceptOwnership() external;\\n}\\n\",\"keccak256\":\"0x52c14ec7eac845d8ca8b3acb46bdf913e6ede14f4e8887f61dc35f93399e2962\",\"license\":\"MIT\"},\"@bancor/token-governance/contracts/IMintableToken.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.6.12;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport \\\"./IClaimable.sol\\\";\\n\\n/// @title Mintable Token interface\\ninterface IMintableToken is IERC20, IClaimable {\\n function issue(address to, uint256 amount) external;\\n\\n function destroy(address from, uint256 amount) external;\\n}\\n\",\"keccak256\":\"0x87ddb17ba18575515a97f615a84225bdb1fdf756eeae626287b94b2a3517a93b\",\"license\":\"MIT\"},\"@bancor/token-governance/contracts/ITokenGovernance.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.6.12;\\n\\nimport \\\"./IMintableToken.sol\\\";\\n\\n/// @title The interface for mintable/burnable token governance.\\ninterface ITokenGovernance {\\n // The address of the mintable ERC20 token.\\n function token() external view returns (IMintableToken);\\n\\n /// @dev Mints new tokens.\\n ///\\n /// @param to Account to receive the new amount.\\n /// @param amount Amount to increase the supply by.\\n ///\\n function mint(address to, uint256 amount) external;\\n\\n /// @dev Burns tokens from the caller.\\n ///\\n /// @param amount Amount to decrease the supply by.\\n ///\\n function burn(uint256 amount) external;\\n}\\n\",\"keccak256\":\"0xebcf7997ed758d71a551597c3f7874b2b2fd91a72bbe50c634b02506f04e95b2\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControlEnumerable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IAccessControlEnumerableUpgradeable.sol\\\";\\nimport \\\"./AccessControlUpgradeable.sol\\\";\\nimport \\\"../utils/structs/EnumerableSetUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Extension of {AccessControl} that allows enumerating the members of each role.\\n */\\nabstract contract AccessControlEnumerableUpgradeable is Initializable, IAccessControlEnumerableUpgradeable, AccessControlUpgradeable {\\n function __AccessControlEnumerable_init() internal onlyInitializing {\\n }\\n\\n function __AccessControlEnumerable_init_unchained() internal onlyInitializing {\\n }\\n using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet;\\n\\n mapping(bytes32 => EnumerableSetUpgradeable.AddressSet) private _roleMembers;\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IAccessControlEnumerableUpgradeable).interfaceId || super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev Returns one of the accounts that have `role`. `index` must be a\\n * value between 0 and {getRoleMemberCount}, non-inclusive.\\n *\\n * Role bearers are not sorted in any particular way, and their ordering may\\n * change at any point.\\n *\\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\\n * you perform all queries on the same block. See the following\\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\\n * for more information.\\n */\\n function getRoleMember(bytes32 role, uint256 index) public view virtual override returns (address) {\\n return _roleMembers[role].at(index);\\n }\\n\\n /**\\n * @dev Returns the number of accounts that have `role`. Can be used\\n * together with {getRoleMember} to enumerate all bearers of a role.\\n */\\n function getRoleMemberCount(bytes32 role) public view virtual override returns (uint256) {\\n return _roleMembers[role].length();\\n }\\n\\n /**\\n * @dev Overload {_grantRole} to track enumerable memberships\\n */\\n function _grantRole(bytes32 role, address account) internal virtual override {\\n super._grantRole(role, account);\\n _roleMembers[role].add(account);\\n }\\n\\n /**\\n * @dev Overload {_revokeRole} to track enumerable memberships\\n */\\n function _revokeRole(bytes32 role, address account) internal virtual override {\\n super._revokeRole(role, account);\\n _roleMembers[role].remove(account);\\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\":\"0xc2dfd6ba9449f61b6b03b262182faf302f093a8c05dd10792aeecb4ed1663c0c\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IAccessControlUpgradeable.sol\\\";\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../utils/StringsUpgradeable.sol\\\";\\nimport \\\"../utils/introspection/ERC165Upgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module that allows children to implement role-based access\\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\\n * members except through off-chain means by accessing the contract event logs. Some\\n * applications may benefit from on-chain enumerability, for those cases see\\n * {AccessControlEnumerable}.\\n *\\n * Roles are referred to by their `bytes32` identifier. These should be exposed\\n * in the external API and be unique. The best way to achieve this is by\\n * using `public constant` hash digests:\\n *\\n * ```\\n * bytes32 public constant MY_ROLE = keccak256(\\\"MY_ROLE\\\");\\n * ```\\n *\\n * Roles can be used to represent a set of permissions. To restrict access to a\\n * function call, use {hasRole}:\\n *\\n * ```\\n * function foo() public {\\n * require(hasRole(MY_ROLE, msg.sender));\\n * ...\\n * }\\n * ```\\n *\\n * Roles can be granted and revoked dynamically via the {grantRole} and\\n * {revokeRole} functions. Each role has an associated admin role, and only\\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\\n *\\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\\n * that only accounts with this role will be able to grant or revoke other\\n * roles. More complex role relationships can be created by using\\n * {_setRoleAdmin}.\\n *\\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\\n * grant and revoke this role. Extra precautions should be taken to secure\\n * accounts that have been granted it.\\n */\\nabstract contract AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControlUpgradeable, ERC165Upgradeable {\\n function __AccessControl_init() internal onlyInitializing {\\n }\\n\\n function __AccessControl_init_unchained() internal onlyInitializing {\\n }\\n struct RoleData {\\n mapping(address => bool) members;\\n bytes32 adminRole;\\n }\\n\\n mapping(bytes32 => RoleData) private _roles;\\n\\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\\n\\n /**\\n * @dev Modifier that checks that an account has a specific role. Reverts\\n * with a standardized message including the required role.\\n *\\n * The format of the revert reason is given by the following regular expression:\\n *\\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\\n *\\n * _Available since v4.1._\\n */\\n modifier onlyRole(bytes32 role) {\\n _checkRole(role, _msgSender());\\n _;\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IAccessControlUpgradeable).interfaceId || super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) public view virtual override returns (bool) {\\n return _roles[role].members[account];\\n }\\n\\n /**\\n * @dev Revert with a standard message if `account` is missing `role`.\\n *\\n * The format of the revert reason is given by the following regular expression:\\n *\\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\\n */\\n function _checkRole(bytes32 role, address account) internal view virtual {\\n if (!hasRole(role, account)) {\\n revert(\\n string(\\n abi.encodePacked(\\n \\\"AccessControl: account \\\",\\n StringsUpgradeable.toHexString(uint160(account), 20),\\n \\\" is missing role \\\",\\n StringsUpgradeable.toHexString(uint256(role), 32)\\n )\\n )\\n );\\n }\\n }\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {\\n return _roles[role].adminRole;\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\\n _grantRole(role, account);\\n }\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\\n _revokeRole(role, account);\\n }\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n */\\n function renounceRole(bytes32 role, address account) public virtual override {\\n require(account == _msgSender(), \\\"AccessControl: can only renounce roles for self\\\");\\n\\n _revokeRole(role, account);\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event. Note that unlike {grantRole}, this function doesn't perform any\\n * checks on the calling account.\\n *\\n * [WARNING]\\n * ====\\n * This function should only be called from the constructor when setting\\n * up the initial roles for the system.\\n *\\n * Using this function in any other way is effectively circumventing the admin\\n * system imposed by {AccessControl}.\\n * ====\\n *\\n * NOTE: This function is deprecated in favor of {_grantRole}.\\n */\\n function _setupRole(bytes32 role, address account) internal virtual {\\n _grantRole(role, account);\\n }\\n\\n /**\\n * @dev Sets `adminRole` as ``role``'s admin role.\\n *\\n * Emits a {RoleAdminChanged} event.\\n */\\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\\n bytes32 previousAdminRole = getRoleAdmin(role);\\n _roles[role].adminRole = adminRole;\\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * Internal function without access restriction.\\n */\\n function _grantRole(bytes32 role, address account) internal virtual {\\n if (!hasRole(role, account)) {\\n _roles[role].members[account] = true;\\n emit RoleGranted(role, account, _msgSender());\\n }\\n }\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * Internal function without access restriction.\\n */\\n function _revokeRole(bytes32 role, address account) internal virtual {\\n if (hasRole(role, account)) {\\n _roles[role].members[account] = false;\\n emit RoleRevoked(role, account, _msgSender());\\n }\\n }\\n\\n /**\\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\":\"0x2ffe9655abbb3741fcb84ad10e2f628d5dbec46b3f84a69ceec4752e807e2757\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/access/IAccessControlEnumerableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IAccessControlUpgradeable.sol\\\";\\n\\n/**\\n * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.\\n */\\ninterface IAccessControlEnumerableUpgradeable is IAccessControlUpgradeable {\\n /**\\n * @dev Returns one of the accounts that have `role`. `index` must be a\\n * value between 0 and {getRoleMemberCount}, non-inclusive.\\n *\\n * Role bearers are not sorted in any particular way, and their ordering may\\n * change at any point.\\n *\\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\\n * you perform all queries on the same block. See the following\\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\\n * for more information.\\n */\\n function getRoleMember(bytes32 role, uint256 index) external view returns (address);\\n\\n /**\\n * @dev Returns the number of accounts that have `role`. Can be used\\n * together with {getRoleMember} to enumerate all bearers of a role.\\n */\\n function getRoleMemberCount(bytes32 role) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x7acbc538aad6eb4614e26612a8c5c0149bb8808db95e2638d245a8365f63e572\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/access/IAccessControlUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev External interface of AccessControl declared to support ERC165 detection.\\n */\\ninterface IAccessControlUpgradeable {\\n /**\\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\\n *\\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\\n * {RoleAdminChanged} not being emitted signaling this.\\n *\\n * _Available since v3.1._\\n */\\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\\n\\n /**\\n * @dev Emitted when `account` is granted `role`.\\n *\\n * `sender` is the account that originated the contract call, an admin role\\n * bearer except when using {AccessControl-_setupRole}.\\n */\\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Emitted when `account` is revoked `role`.\\n *\\n * `sender` is the account that originated the contract call:\\n * - if using `revokeRole`, it is the admin role bearer\\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\\n */\\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) external view returns (bool);\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function grantRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function revokeRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been granted `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n */\\n function renounceRole(bytes32 role, address account) external;\\n}\\n\",\"keccak256\":\"0xb8f5302f12138c5561362e88a78d061573e6298b7a1a5afe84a1e2c8d4d5aeaa\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.0;\\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 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the\\n * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() initializer {}\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n */\\n bool private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Modifier to protect an initializer function from being invoked twice.\\n */\\n modifier initializer() {\\n // If the contract is initializing we ignore whether _initialized is set in order to support multiple\\n // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the\\n // contract may have been reentered.\\n require(_initializing ? _isConstructor() : !_initialized, \\\"Initializable: contract is already initialized\\\");\\n\\n bool isTopLevelCall = !_initializing;\\n if (isTopLevelCall) {\\n _initializing = true;\\n _initialized = true;\\n }\\n\\n _;\\n\\n if (isTopLevelCall) {\\n _initializing = false;\\n }\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} modifier, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n function _isConstructor() private view returns (bool) {\\n return !AddressUpgradeable.isContract(address(this));\\n }\\n}\\n\",\"keccak256\":\"0x372b0bc04e3b4c074559bbbfb1317afddb56de5504158ca25a7f9cd403980445\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which allows children to implement an emergency stop\\n * mechanism that can be triggered by an authorized account.\\n *\\n * This module is used through inheritance. It will make available the\\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\\n * the functions of your contract. Note that they will not be pausable by\\n * simply including this module, only once the modifiers are put in place.\\n */\\nabstract contract PausableUpgradeable is Initializable, ContextUpgradeable {\\n /**\\n * @dev Emitted when the pause is triggered by `account`.\\n */\\n event Paused(address account);\\n\\n /**\\n * @dev Emitted when the pause is lifted by `account`.\\n */\\n event Unpaused(address account);\\n\\n bool private _paused;\\n\\n /**\\n * @dev Initializes the contract in unpaused state.\\n */\\n function __Pausable_init() internal onlyInitializing {\\n __Pausable_init_unchained();\\n }\\n\\n function __Pausable_init_unchained() internal onlyInitializing {\\n _paused = false;\\n }\\n\\n /**\\n * @dev Returns true if the contract is paused, and false otherwise.\\n */\\n function paused() public view virtual returns (bool) {\\n return _paused;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is not paused.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n modifier whenNotPaused() {\\n require(!paused(), \\\"Pausable: paused\\\");\\n _;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is paused.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n modifier whenPaused() {\\n require(paused(), \\\"Pausable: not paused\\\");\\n _;\\n }\\n\\n /**\\n * @dev Triggers stopped state.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n function _pause() internal virtual whenNotPaused {\\n _paused = true;\\n emit Paused(_msgSender());\\n }\\n\\n /**\\n * @dev Returns to normal state.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n function _unpause() internal virtual whenPaused {\\n _paused = false;\\n emit Unpaused(_msgSender());\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x041af89e5e60b74e1203d5a34614c9de379726f52ecb8cf064cab78b9fdcdf9d\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module that helps prevent reentrant calls to a function.\\n *\\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\\n * available, which can be applied to functions to make sure there are no nested\\n * (reentrant) calls to them.\\n *\\n * Note that because there is a single `nonReentrant` guard, functions marked as\\n * `nonReentrant` may not call one another. This can be worked around by making\\n * those functions `private`, and then adding `external` `nonReentrant` entry\\n * points to them.\\n *\\n * TIP: If you would like to learn more about reentrancy and alternative ways\\n * to protect against it, check out our blog post\\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\\n */\\nabstract contract ReentrancyGuardUpgradeable is Initializable {\\n // Booleans are more expensive than uint256 or any type that takes up a full\\n // word because each write operation emits an extra SLOAD to first read the\\n // slot's contents, replace the bits taken up by the boolean, and then write\\n // back. This is the compiler's defense against contract upgrades and\\n // pointer aliasing, and it cannot be disabled.\\n\\n // The values being non-zero value makes deployment a bit more expensive,\\n // but in exchange the refund on every call to nonReentrant will be lower in\\n // amount. Since refunds are capped to a percentage of the total\\n // transaction's gas, it is best to keep them low in cases like this one, to\\n // increase the likelihood of the full refund coming into effect.\\n uint256 private constant _NOT_ENTERED = 1;\\n uint256 private constant _ENTERED = 2;\\n\\n uint256 private _status;\\n\\n function __ReentrancyGuard_init() internal onlyInitializing {\\n __ReentrancyGuard_init_unchained();\\n }\\n\\n function __ReentrancyGuard_init_unchained() internal onlyInitializing {\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Prevents a contract from calling itself, directly or indirectly.\\n * Calling a `nonReentrant` function from another `nonReentrant`\\n * function is not supported. It is possible to prevent this from happening\\n * by making the `nonReentrant` function external, and making it call a\\n * `private` function that does the actual work.\\n */\\n modifier nonReentrant() {\\n // 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 /**\\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\":\"0x8cc03c5ac17e8a7396e487cda41fc1f1dfdb91db7d528e6da84bee3b6dd7e167\",\"license\":\"MIT\"},\"@openzeppelin/contracts-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\"},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract ContextUpgradeable is Initializable {\\n function __Context_init() internal onlyInitializing {\\n }\\n\\n function __Context_init_unchained() internal onlyInitializing {\\n }\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary StringsUpgradeable {\\n bytes16 private constant _HEX_SYMBOLS = \\\"0123456789abcdef\\\";\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n // Inspired by OraclizeAPI's implementation - MIT licence\\n // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol\\n\\n if (value == 0) {\\n return \\\"0\\\";\\n }\\n uint256 temp = value;\\n uint256 digits;\\n while (temp != 0) {\\n digits++;\\n temp /= 10;\\n }\\n bytes memory buffer = new bytes(digits);\\n while (value != 0) {\\n digits -= 1;\\n buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));\\n value /= 10;\\n }\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n if (value == 0) {\\n return \\\"0x00\\\";\\n }\\n uint256 temp = value;\\n uint256 length = 0;\\n while (temp != 0) {\\n length++;\\n temp >>= 8;\\n }\\n return toHexString(value, length);\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _HEX_SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n}\\n\",\"keccak256\":\"0x398d3323c1932a5986bf36be7c57593e121e69d5db5b6574b4ee0d031443de37\",\"license\":\"MIT\"},\"@openzeppelin/contracts-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\"},\"@openzeppelin/contracts-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\"},\"@openzeppelin/contracts-upgradeable/utils/structs/EnumerableSetUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (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 EnumerableSetUpgradeable {\\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\":\"0x0004699ba89fa356eb0d58d815b42dcf52eccd2765e95256631b838bce2556bc\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/ERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.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.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How\\n * to implement supply mechanisms].\\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 * The default value of {decimals} is 18. To select a different value for\\n * {decimals} you should overload it.\\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 value {ERC20} uses, unless this function is\\n * 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(\\n address from,\\n address to,\\n uint256 amount\\n ) 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, _allowances[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 = _allowances[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 `sender` to `recipient`.\\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(\\n address from,\\n address to,\\n uint256 amount\\n ) 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 }\\n _balances[to] += amount;\\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 _balances[account] += amount;\\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 }\\n _totalSupply -= amount;\\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(\\n address owner,\\n address spender,\\n uint256 amount\\n ) 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 Spend `amount` form the allowance of `owner` toward `spender`.\\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(\\n address owner,\\n address spender,\\n uint256 amount\\n ) 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(\\n address from,\\n address to,\\n uint256 amount\\n ) 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(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual {}\\n}\\n\",\"keccak256\":\"0xdadd41acb749920eccf40aeaa8d291adf9751399a7343561bad13e7a8d99be0b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n\\n /**\\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\":\"0xbbc8ac883ac3c0078ce5ad3e288fbb3ffcc8a30c3a98c0fda0114d64fc44fca2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x8de418a5503946cabe331f35fe242d3201a73f67f77aaeb7110acb1f30423aca\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\\n *\\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\\n * need to send a transaction, and thus is not required to hold Ether at all.\\n */\\ninterface IERC20Permit {\\n /**\\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\\n * given ``owner``'s signed approval.\\n *\\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\\n * ordering also apply here.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `deadline` must be a timestamp in the future.\\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\\n * over the EIP712-formatted function arguments.\\n * - the signature must use ``owner``'s current nonce (see {nonces}).\\n *\\n * For more information on the signature format, see the\\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\\n * section].\\n */\\n function permit(\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external;\\n\\n /**\\n * @dev Returns the current nonce for `owner`. This value must be\\n * included whenever a signature is generated for {permit}.\\n *\\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\\n * prevents a signature from being used multiple times.\\n */\\n function nonces(address owner) external view returns (uint256);\\n\\n /**\\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0xf41ca991f30855bf80ffd11e9347856a517b977f0a6c2d52e6421a99b7840329\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)\\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\":\"0xc3d946432c0ddbb1f846a0d3985be71299df331b91d06732152117f62f0be2b5\",\"license\":\"MIT\"},\"@openzeppelin/contracts/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\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/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/network/BancorNetwork.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { Address } from \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport { SafeERC20 } from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\nimport { ReentrancyGuardUpgradeable } from \\\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\\\";\\nimport { EnumerableSetUpgradeable } from \\\"@openzeppelin/contracts-upgradeable/utils/structs/EnumerableSetUpgradeable.sol\\\";\\nimport { PausableUpgradeable } from \\\"@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol\\\";\\n\\nimport { ITokenGovernance } from \\\"@bancor/token-governance/contracts/ITokenGovernance.sol\\\";\\n\\nimport { IVersioned } from \\\"../utility/interfaces/IVersioned.sol\\\";\\nimport { PPM_RESOLUTION } from \\\"../utility/Constants.sol\\\";\\nimport { Upgradeable } from \\\"../utility/Upgradeable.sol\\\";\\nimport { Time } from \\\"../utility/Time.sol\\\";\\nimport { MathEx } from \\\"../utility/MathEx.sol\\\";\\n\\n// prettier-ignore\\nimport {\\n Utils,\\n AlreadyExists,\\n DoesNotExist,\\n InvalidToken,\\n InvalidPool,\\n InvalidPoolCollection,\\n NotEmpty\\n} from \\\"../utility/Utils.sol\\\";\\n\\nimport { ROLE_ASSET_MANAGER } from \\\"../vaults/interfaces/IVault.sol\\\";\\nimport { IMasterVault } from \\\"../vaults/interfaces/IMasterVault.sol\\\";\\nimport { IExternalProtectionVault } from \\\"../vaults/interfaces/IExternalProtectionVault.sol\\\";\\n\\nimport { Token } from \\\"../token/Token.sol\\\";\\nimport { TokenLibrary } from \\\"../token/TokenLibrary.sol\\\";\\n\\nimport { IPoolCollection, TradeAmountAndFee } from \\\"../pools/interfaces/IPoolCollection.sol\\\";\\nimport { IPoolMigrator } from \\\"../pools/interfaces/IPoolMigrator.sol\\\";\\n\\n// prettier-ignore\\nimport {\\n IBNTPool,\\n ROLE_BNT_MANAGER,\\n ROLE_VAULT_MANAGER,\\n ROLE_FUNDING_MANAGER\\n} from \\\"../pools/interfaces/IBNTPool.sol\\\";\\n\\nimport { IPoolToken } from \\\"../pools/interfaces/IPoolToken.sol\\\";\\n\\nimport { INetworkSettings, NotWhitelisted } from \\\"./interfaces/INetworkSettings.sol\\\";\\nimport { IPendingWithdrawals, CompletedWithdrawal } from \\\"./interfaces/IPendingWithdrawals.sol\\\";\\nimport { IBancorNetwork, IFlashLoanRecipient } from \\\"./interfaces/IBancorNetwork.sol\\\";\\n\\n/**\\n * @dev Bancor Network contract\\n */\\ncontract BancorNetwork is IBancorNetwork, Upgradeable, ReentrancyGuardUpgradeable, PausableUpgradeable, Time, Utils {\\n using Address for address payable;\\n using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet;\\n using TokenLibrary for Token;\\n using SafeERC20 for IPoolToken;\\n\\n error DeadlineExpired();\\n error DepositingDisabled();\\n error NativeTokenAmountMismatch();\\n error InsufficientFlashLoanReturn();\\n\\n struct TradeParams {\\n uint256 amount;\\n uint256 limit;\\n bool bySourceAmount;\\n bool ignoreFees;\\n }\\n\\n struct TradeResult {\\n uint256 sourceAmount;\\n uint256 targetAmount;\\n uint256 tradingFeeAmount;\\n uint256 networkFeeAmount;\\n }\\n\\n struct TradeTokens {\\n Token sourceToken;\\n Token targetToken;\\n }\\n\\n struct TraderInfo {\\n address trader;\\n address beneficiary;\\n }\\n\\n // the migration manager role is required for migrating liquidity\\n bytes32 private constant ROLE_MIGRATION_MANAGER = keccak256(\\\"ROLE_MIGRATION_MANAGER\\\");\\n\\n // the emergency manager role is required to pause/unpause the network\\n bytes32 private constant ROLE_EMERGENCY_STOPPER = keccak256(\\\"ROLE_EMERGENCY_STOPPER\\\");\\n\\n // the network fee manager role is required to pull the accumulated pending network fees\\n bytes32 private constant ROLE_NETWORK_FEE_MANAGER = keccak256(\\\"ROLE_NETWORK_FEE_MANAGER\\\");\\n\\n // the address of the BNT token\\n IERC20 private immutable _bnt;\\n\\n // the address of the BNT token governance\\n ITokenGovernance private immutable _bntGovernance;\\n\\n // the address of the vBNT token\\n IERC20 private immutable _vbnt;\\n\\n // the address of the vBNT token governance\\n ITokenGovernance private immutable _vbntGovernance;\\n\\n // the network settings contract\\n INetworkSettings private immutable _networkSettings;\\n\\n // the master vault contract\\n IMasterVault private immutable _masterVault;\\n\\n // the address of the external protection vault\\n IExternalProtectionVault private immutable _externalProtectionVault;\\n\\n // the BNT pool token\\n IPoolToken internal immutable _bntPoolToken;\\n\\n // the Bancor arbitrage contract\\n address internal immutable _bancorArbitrage;\\n\\n // the BNT pool contract\\n IBNTPool internal _bntPool;\\n\\n // the pending withdrawals contract\\n IPendingWithdrawals internal _pendingWithdrawals;\\n\\n // the pool migrator contract\\n IPoolMigrator internal _poolMigrator;\\n\\n // the set of all valid pool collections\\n EnumerableSetUpgradeable.AddressSet private _poolCollections;\\n\\n // DEPRECATED (mapping(uint16 => IPoolCollection) _latestPoolCollections)\\n uint256 private _deprecated0;\\n\\n // the set of all pools\\n EnumerableSetUpgradeable.AddressSet private _liquidityPools;\\n\\n // a mapping between pools and their respective pool collections\\n mapping(Token => IPoolCollection) private _collectionByPool;\\n\\n // the pending network fee amount to be burned by the vortex\\n uint256 internal _pendingNetworkFeeAmount;\\n\\n bool private _depositingEnabled = true;\\n\\n // upgrade forward-compatibility storage gap\\n uint256[MAX_GAP - 11] private __gap;\\n\\n /**\\n * @dev triggered when a new pool collection is added\\n */\\n event PoolCollectionAdded(uint16 indexed poolType, IPoolCollection indexed poolCollection);\\n\\n /**\\n * @dev triggered when an existing pool collection is removed\\n */\\n event PoolCollectionRemoved(uint16 indexed poolType, IPoolCollection indexed poolCollection);\\n\\n /**\\n * @dev triggered when a pool is created\\n */\\n event PoolCreated(Token indexed pool, IPoolCollection indexed poolCollection);\\n\\n /**\\n * @dev triggered when a new pool is added to a pool collection\\n */\\n event PoolAdded(Token indexed pool, IPoolCollection indexed poolCollection);\\n\\n /**\\n * @dev triggered when a new pool is removed from a pool collection\\n */\\n event PoolRemoved(Token indexed pool, IPoolCollection indexed poolCollection);\\n\\n /**\\n * @dev triggered when funds are migrated\\n */\\n event FundsMigrated(\\n bytes32 indexed contextId,\\n Token indexed token,\\n address indexed provider,\\n uint256 amount,\\n uint256 availableAmount,\\n uint256 originalAmount\\n );\\n\\n /**\\n * @dev triggered on a successful trade\\n */\\n event TokensTraded(\\n bytes32 indexed contextId,\\n Token indexed sourceToken,\\n Token indexed targetToken,\\n uint256 sourceAmount,\\n uint256 targetAmount,\\n uint256 bntAmount,\\n uint256 targetFeeAmount,\\n uint256 bntFeeAmount,\\n address trader\\n );\\n\\n /**\\n * @dev triggered when a flash-loan is completed\\n */\\n event FlashLoanCompleted(Token indexed token, address indexed borrower, uint256 amount, uint256 feeAmount);\\n\\n /**\\n * @dev triggered when network fees are withdrawn\\n */\\n event NetworkFeesWithdrawn(address indexed caller, address indexed recipient, uint256 amount);\\n\\n /**\\n * @dev a \\\"virtual\\\" constructor that is only used to set immutable state variables\\n */\\n constructor(\\n ITokenGovernance initBNTGovernance,\\n ITokenGovernance initVBNTGovernance,\\n INetworkSettings initNetworkSettings,\\n IMasterVault initMasterVault,\\n IExternalProtectionVault initExternalProtectionVault,\\n IPoolToken initBNTPoolToken,\\n address bancorArbitrage\\n )\\n validAddress(address(initBNTGovernance))\\n validAddress(address(initVBNTGovernance))\\n validAddress(address(initNetworkSettings))\\n validAddress(address(initMasterVault))\\n validAddress(address(initExternalProtectionVault))\\n validAddress(address(initBNTPoolToken))\\n validAddress(address(bancorArbitrage))\\n {\\n _bntGovernance = initBNTGovernance;\\n _bnt = initBNTGovernance.token();\\n _vbntGovernance = initVBNTGovernance;\\n _vbnt = initVBNTGovernance.token();\\n\\n _networkSettings = initNetworkSettings;\\n _masterVault = initMasterVault;\\n _externalProtectionVault = initExternalProtectionVault;\\n _bntPoolToken = initBNTPoolToken;\\n _bancorArbitrage = bancorArbitrage;\\n }\\n\\n /**\\n * @dev fully initializes the contract and its parents\\n */\\n function initialize(\\n IBNTPool initBNTPool,\\n IPendingWithdrawals initPendingWithdrawals,\\n IPoolMigrator initPoolMigrator\\n )\\n external\\n validAddress(address(initBNTPool))\\n validAddress(address(initPendingWithdrawals))\\n validAddress(address(initPoolMigrator))\\n initializer\\n {\\n __BancorNetwork_init(initBNTPool, initPendingWithdrawals, initPoolMigrator);\\n }\\n\\n // solhint-disable func-name-mixedcase\\n\\n /**\\n * @dev initializes the contract and its parents\\n */\\n function __BancorNetwork_init(\\n IBNTPool initBNTPool,\\n IPendingWithdrawals initPendingWithdrawals,\\n IPoolMigrator initPoolMigrator\\n ) internal onlyInitializing {\\n __Upgradeable_init();\\n __ReentrancyGuard_init();\\n __Pausable_init();\\n\\n __BancorNetwork_init_unchained(initBNTPool, initPendingWithdrawals, initPoolMigrator);\\n }\\n\\n /**\\n * @dev performs contract-specific initialization\\n */\\n function __BancorNetwork_init_unchained(\\n IBNTPool initBNTPool,\\n IPendingWithdrawals initPendingWithdrawals,\\n IPoolMigrator initPoolMigrator\\n ) internal onlyInitializing {\\n _bntPool = initBNTPool;\\n _pendingWithdrawals = initPendingWithdrawals;\\n _poolMigrator = initPoolMigrator;\\n\\n // set up administrative roles\\n _setRoleAdmin(ROLE_MIGRATION_MANAGER, ROLE_ADMIN);\\n _setRoleAdmin(ROLE_EMERGENCY_STOPPER, ROLE_ADMIN);\\n _setRoleAdmin(ROLE_NETWORK_FEE_MANAGER, ROLE_ADMIN);\\n\\n _depositingEnabled = true;\\n }\\n\\n // solhint-enable func-name-mixedcase\\n\\n modifier depositsEnabled() {\\n _depositsEnabled();\\n\\n _;\\n }\\n\\n function _depositsEnabled() internal view {\\n if (!_depositingEnabled) {\\n revert DepositingDisabled();\\n }\\n }\\n\\n receive() external payable {}\\n\\n /**\\n * @inheritdoc Upgradeable\\n */\\n function version() public pure override(IVersioned, Upgradeable) returns (uint16) {\\n return 8;\\n }\\n\\n /**\\n * @dev returns the migration manager role\\n */\\n function roleMigrationManager() external pure returns (bytes32) {\\n return ROLE_MIGRATION_MANAGER;\\n }\\n\\n /**\\n * @dev returns the emergency stopper role\\n */\\n function roleEmergencyStopper() external pure returns (bytes32) {\\n return ROLE_EMERGENCY_STOPPER;\\n }\\n\\n /**\\n * @dev returns the network fee manager role\\n */\\n function roleNetworkFeeManager() external pure returns (bytes32) {\\n return ROLE_NETWORK_FEE_MANAGER;\\n }\\n\\n /**\\n * @dev returns the pending network fee amount to be burned by the vortex\\n */\\n function pendingNetworkFeeAmount() external view returns (uint256) {\\n return _pendingNetworkFeeAmount;\\n }\\n\\n /**\\n * @dev registers new pool collection with the network\\n *\\n * requirements:\\n *\\n * - the caller must be the admin of the contract\\n */\\n function registerPoolCollection(\\n IPoolCollection newPoolCollection\\n ) external validAddress(address(newPoolCollection)) onlyAdmin nonReentrant {\\n // verify that there is no pool collection of the same type and version\\n uint16 newPoolType = newPoolCollection.poolType();\\n uint16 newPoolVersion = newPoolCollection.version();\\n\\n IPoolCollection poolCollection = _findPoolCollection(newPoolType, newPoolVersion);\\n if (poolCollection != IPoolCollection(address(0)) || !_poolCollections.add(address(newPoolCollection))) {\\n revert AlreadyExists();\\n }\\n\\n _setAccessRoles(newPoolCollection, true);\\n\\n emit PoolCollectionAdded({ poolType: newPoolCollection.poolType(), poolCollection: newPoolCollection });\\n }\\n\\n /**\\n * @dev unregisters an existing pool collection from the network\\n *\\n * requirements:\\n *\\n * - the caller must be the admin of the contract\\n */\\n function unregisterPoolCollection(\\n IPoolCollection poolCollection\\n ) external validAddress(address(poolCollection)) onlyAdmin nonReentrant {\\n // verify that no pools are associated with the specified pool collection\\n if (poolCollection.poolCount() != 0) {\\n revert NotEmpty();\\n }\\n\\n if (!_poolCollections.remove(address(poolCollection))) {\\n revert DoesNotExist();\\n }\\n\\n _setAccessRoles(poolCollection, false);\\n\\n emit PoolCollectionRemoved({ poolType: poolCollection.poolType(), poolCollection: poolCollection });\\n }\\n\\n /**\\n * @inheritdoc IBancorNetwork\\n */\\n function poolCollections() external view returns (IPoolCollection[] memory) {\\n uint256 length = _poolCollections.length();\\n IPoolCollection[] memory list = new IPoolCollection[](length);\\n for (uint256 i = 0; i < length; i++) {\\n list[i] = IPoolCollection(_poolCollections.at(i));\\n }\\n return list;\\n }\\n\\n /**\\n * @inheritdoc IBancorNetwork\\n */\\n function liquidityPools() external view returns (Token[] memory) {\\n uint256 length = _liquidityPools.length();\\n Token[] memory list = new Token[](length);\\n for (uint256 i = 0; i < length; i++) {\\n list[i] = Token(_liquidityPools.at(i));\\n }\\n return list;\\n }\\n\\n /**\\n * @inheritdoc IBancorNetwork\\n */\\n function collectionByPool(Token pool) external view returns (IPoolCollection) {\\n return _collectionByPool[pool];\\n }\\n\\n /**\\n * @inheritdoc IBancorNetwork\\n */\\n function createPools(\\n Token[] calldata tokens,\\n IPoolCollection poolCollection\\n ) external validAddress(address(poolCollection)) onlyAdmin nonReentrant {\\n if (!_poolCollections.contains(address(poolCollection))) {\\n revert DoesNotExist();\\n }\\n\\n uint256 length = tokens.length;\\n for (uint256 i = 0; i < length; i++) {\\n _createPool(tokens[i], poolCollection);\\n }\\n }\\n\\n /**\\n * @dev creates a new pool\\n */\\n function _createPool(Token token, IPoolCollection poolCollection) private {\\n _validAddress(address(token));\\n\\n if (token.isEqual(_bnt)) {\\n revert InvalidToken();\\n }\\n\\n if (!_liquidityPools.add(address(token))) {\\n revert AlreadyExists();\\n }\\n\\n // this is where the magic happens...\\n poolCollection.createPool(token);\\n\\n // add the pool collection to the reverse pool collection lookup\\n _collectionByPool[token] = poolCollection;\\n\\n emit PoolCreated({ pool: token, poolCollection: poolCollection });\\n emit PoolAdded({ pool: token, poolCollection: poolCollection });\\n }\\n\\n /**\\n * @inheritdoc IBancorNetwork\\n */\\n function migratePools(Token[] calldata pools, IPoolCollection newPoolCollection) external nonReentrant {\\n if (!_poolCollections.contains(address(newPoolCollection))) {\\n revert DoesNotExist();\\n }\\n\\n uint256 length = pools.length;\\n for (uint256 i = 0; i < length; i++) {\\n Token pool = pools[i];\\n\\n // request the pool migrator to migrate the pool to the new pool collection\\n _poolMigrator.migratePool(pool, newPoolCollection);\\n\\n IPoolCollection prevPoolCollection = _collectionByPool[pool];\\n\\n // update the mapping between pools and their respective pool collections\\n _collectionByPool[pool] = newPoolCollection;\\n\\n emit PoolRemoved(pool, prevPoolCollection);\\n emit PoolAdded(pool, newPoolCollection);\\n }\\n }\\n\\n /**\\n * @inheritdoc IBancorNetwork\\n */\\n function depositFor(\\n address provider,\\n Token pool,\\n uint256 tokenAmount\\n )\\n external\\n payable\\n depositsEnabled\\n validAddress(provider)\\n validAddress(address(pool))\\n greaterThanZero(tokenAmount)\\n whenNotPaused\\n nonReentrant\\n returns (uint256)\\n {\\n return _depositFor(provider, pool, tokenAmount, msg.sender);\\n }\\n\\n /**\\n * @inheritdoc IBancorNetwork\\n */\\n function deposit(\\n Token pool,\\n uint256 tokenAmount\\n )\\n external\\n payable\\n depositsEnabled\\n validAddress(address(pool))\\n greaterThanZero(tokenAmount)\\n whenNotPaused\\n nonReentrant\\n returns (uint256)\\n {\\n return _depositFor(msg.sender, pool, tokenAmount, msg.sender);\\n }\\n\\n /**\\n * @inheritdoc IBancorNetwork\\n */\\n function initWithdrawal(\\n IPoolToken poolToken,\\n uint256 poolTokenAmount\\n )\\n external\\n validAddress(address(poolToken))\\n greaterThanZero(poolTokenAmount)\\n whenNotPaused\\n nonReentrant\\n returns (uint256)\\n {\\n return _initWithdrawal(msg.sender, poolToken, poolTokenAmount);\\n }\\n\\n /**\\n * @inheritdoc IBancorNetwork\\n */\\n function cancelWithdrawal(uint256 id) external whenNotPaused nonReentrant returns (uint256) {\\n return _pendingWithdrawals.cancelWithdrawal(msg.sender, id);\\n }\\n\\n /**\\n * @inheritdoc IBancorNetwork\\n */\\n function withdraw(uint256 id) external whenNotPaused nonReentrant returns (uint256) {\\n address provider = msg.sender;\\n bytes32 contextId = _withdrawContextId(id, provider);\\n\\n // complete the withdrawal and claim the locked pool tokens\\n CompletedWithdrawal memory completedRequest = _pendingWithdrawals.completeWithdrawal(contextId, provider, id);\\n\\n if (completedRequest.poolToken == _bntPoolToken) {\\n return _withdrawBNT(contextId, provider, completedRequest);\\n }\\n\\n return _withdrawBaseToken(contextId, provider, completedRequest);\\n }\\n\\n /**\\n * @inheritdoc IBancorNetwork\\n */\\n function tradeBySourceAmount(\\n Token sourceToken,\\n Token targetToken,\\n uint256 sourceAmount,\\n uint256 minReturnAmount,\\n uint256 deadline,\\n address beneficiary\\n ) external payable whenNotPaused nonReentrant returns (uint256) {\\n return\\n _tradeBySourceAmount(\\n sourceToken,\\n targetToken,\\n sourceAmount,\\n minReturnAmount,\\n deadline,\\n beneficiary,\\n msg.sender\\n );\\n }\\n\\n /**\\n * @inheritdoc IBancorNetwork\\n */\\n function tradeByTargetAmount(\\n Token sourceToken,\\n Token targetToken,\\n uint256 targetAmount,\\n uint256 maxSourceAmount,\\n uint256 deadline,\\n address beneficiary\\n ) external payable whenNotPaused nonReentrant returns (uint256) {\\n return\\n _tradeByTargetAmount(\\n sourceToken,\\n targetToken,\\n targetAmount,\\n maxSourceAmount,\\n deadline,\\n beneficiary,\\n msg.sender\\n );\\n }\\n\\n /**\\n * @inheritdoc IBancorNetwork\\n */\\n function tradeBySourceAmountArb(\\n Token sourceToken,\\n Token targetToken,\\n uint256 sourceAmount,\\n uint256 minReturnAmount,\\n uint256 deadline,\\n address beneficiary\\n ) external payable whenNotPaused only(_bancorArbitrage) returns (uint256) {\\n return\\n _tradeBySourceAmount(\\n sourceToken,\\n targetToken,\\n sourceAmount,\\n minReturnAmount,\\n deadline,\\n beneficiary,\\n msg.sender\\n );\\n }\\n\\n /**\\n * @inheritdoc IBancorNetwork\\n */\\n function tradeByTargetAmountArb(\\n Token sourceToken,\\n Token targetToken,\\n uint256 targetAmount,\\n uint256 maxSourceAmount,\\n uint256 deadline,\\n address beneficiary\\n ) external payable whenNotPaused only(_bancorArbitrage) returns (uint256) {\\n return\\n _tradeByTargetAmount(\\n sourceToken,\\n targetToken,\\n targetAmount,\\n maxSourceAmount,\\n deadline,\\n beneficiary,\\n msg.sender\\n );\\n }\\n\\n /**\\n * @inheritdoc IBancorNetwork\\n */\\n function flashLoan(\\n Token token,\\n uint256 amount,\\n IFlashLoanRecipient recipient,\\n bytes calldata data\\n )\\n external\\n validAddress(address(token))\\n greaterThanZero(amount)\\n validAddress(address(recipient))\\n whenNotPaused\\n nonReentrant\\n {\\n if (!token.isEqual(_bnt) && !_networkSettings.isTokenWhitelisted(token)) {\\n revert NotWhitelisted();\\n }\\n\\n uint256 feeAmount;\\n if (msg.sender == _bancorArbitrage) {\\n // exempt arb contract from fees\\n feeAmount = 0;\\n } else {\\n feeAmount = MathEx.mulDivF(amount, _networkSettings.flashLoanFeePPM(token), PPM_RESOLUTION);\\n }\\n\\n // save the current balance\\n uint256 prevBalance = token.balanceOf(address(this));\\n\\n // transfer the amount from the master vault to the recipient\\n _masterVault.withdrawFunds(token, payable(address(recipient)), amount);\\n\\n // invoke the recipient's callback\\n recipient.onFlashLoan(msg.sender, token.toIERC20(), amount, feeAmount, data);\\n\\n // ensure that the tokens + fee have been deposited back to the network\\n uint256 returnedAmount = token.balanceOf(address(this)) - prevBalance;\\n if (returnedAmount < amount + feeAmount) {\\n revert InsufficientFlashLoanReturn();\\n }\\n\\n // transfer the amount and the fee back to the vault\\n if (token.isNative()) {\\n payable(address(_masterVault)).sendValue(returnedAmount);\\n } else {\\n token.safeTransfer(payable(address(_masterVault)), returnedAmount);\\n }\\n\\n // notify the pool of accrued fees\\n if (token.isEqual(_bnt)) {\\n IBNTPool cachedBNTPool = _bntPool;\\n\\n cachedBNTPool.onFeesCollected(token, feeAmount, false);\\n } else {\\n // get the pool and verify that it exists\\n IPoolCollection poolCollection = _poolCollection(token);\\n poolCollection.onFeesCollected(token, feeAmount);\\n }\\n\\n emit FlashLoanCompleted({ token: token, borrower: msg.sender, amount: amount, feeAmount: feeAmount });\\n }\\n\\n /**\\n * @inheritdoc IBancorNetwork\\n */\\n function migrateLiquidity(\\n Token token,\\n address provider,\\n uint256 amount,\\n uint256 availableAmount,\\n uint256 originalAmount\\n ) external payable whenNotPaused onlyRoleMember(ROLE_MIGRATION_MANAGER) nonReentrant {\\n bytes32 contextId = keccak256(\\n abi.encodePacked(msg.sender, _time(), token, provider, amount, availableAmount, originalAmount)\\n );\\n\\n if (token.isEqual(_bnt)) {\\n _depositBNTFor(contextId, provider, amount, msg.sender, true, originalAmount);\\n } else {\\n _depositBaseTokenFor(contextId, provider, token, amount, msg.sender, availableAmount);\\n }\\n\\n emit FundsMigrated(contextId, token, provider, amount, availableAmount, originalAmount);\\n }\\n\\n /**\\n * @inheritdoc IBancorNetwork\\n */\\n function withdrawNetworkFees(\\n address recipient\\n )\\n external\\n whenNotPaused\\n onlyRoleMember(ROLE_NETWORK_FEE_MANAGER)\\n validAddress(recipient)\\n nonReentrant\\n returns (uint256)\\n {\\n uint256 currentPendingNetworkFeeAmount = _pendingNetworkFeeAmount;\\n if (currentPendingNetworkFeeAmount == 0) {\\n return 0;\\n }\\n\\n _pendingNetworkFeeAmount = 0;\\n\\n _masterVault.withdrawFunds(Token(address(_bnt)), payable(recipient), currentPendingNetworkFeeAmount);\\n\\n emit NetworkFeesWithdrawn(msg.sender, recipient, currentPendingNetworkFeeAmount);\\n\\n return currentPendingNetworkFeeAmount;\\n }\\n\\n /**\\n * @dev pauses the network\\n *\\n * requirements:\\n *\\n * - the caller must have the ROLE_EMERGENCY_STOPPER privilege\\n */\\n function pause() external onlyRoleMember(ROLE_EMERGENCY_STOPPER) {\\n _pause();\\n }\\n\\n /**\\n * @dev resumes the network\\n *\\n * requirements:\\n *\\n * - the caller must have the ROLE_EMERGENCY_STOPPER privilege\\n */\\n function resume() external onlyRoleMember(ROLE_EMERGENCY_STOPPER) {\\n _unpause();\\n }\\n\\n /**\\n * @dev returns whether deposits are enabled\\n */\\n function depositingEnabled() external view returns (bool) {\\n return _depositingEnabled;\\n }\\n\\n /**\\n * @dev enables/disables depositing into a given pool\\n *\\n * requirements:\\n *\\n * - the caller must be the owner of the contract\\n */\\n function enableDepositing(bool status) external onlyAdmin {\\n if (_depositingEnabled == status) {\\n return;\\n }\\n\\n _depositingEnabled = status;\\n }\\n\\n /**\\n * @dev generates context ID for a deposit request\\n */\\n function _depositContextId(\\n address provider,\\n Token pool,\\n uint256 tokenAmount,\\n address caller\\n ) private view returns (bytes32) {\\n return keccak256(abi.encodePacked(caller, _time(), provider, pool, tokenAmount));\\n }\\n\\n /**\\n * @dev generates context ID for a withdraw request\\n */\\n function _withdrawContextId(uint256 id, address caller) private view returns (bytes32) {\\n return keccak256(abi.encodePacked(caller, _time(), id));\\n }\\n\\n /**\\n * @dev deposits liquidity for the specified provider from caller\\n *\\n * requirements:\\n *\\n * - the caller must have approved the network to transfer the liquidity tokens on its behalf\\n */\\n function _depositFor(address provider, Token pool, uint256 tokenAmount, address caller) private returns (uint256) {\\n bytes32 contextId = _depositContextId(provider, pool, tokenAmount, caller);\\n\\n if (pool.isEqual(_bnt)) {\\n return _depositBNTFor(contextId, provider, tokenAmount, caller, false, 0);\\n }\\n\\n return _depositBaseTokenFor(contextId, provider, pool, tokenAmount, caller, tokenAmount);\\n }\\n\\n /**\\n * @dev deposits BNT liquidity for the specified provider from caller\\n *\\n * requirements:\\n *\\n * - the caller must have approved the network to transfer BNT on its behalf\\n */\\n function _depositBNTFor(\\n bytes32 contextId,\\n address provider,\\n uint256 bntAmount,\\n address caller,\\n bool isMigrating,\\n uint256 originalAmount\\n ) private returns (uint256) {\\n if (msg.value > 0) {\\n revert NativeTokenAmountMismatch();\\n }\\n\\n IBNTPool cachedBNTPool = _bntPool;\\n\\n // transfer the tokens from the caller to the BNT pool\\n _bnt.transferFrom(caller, address(cachedBNTPool), bntAmount);\\n\\n // process BNT pool deposit\\n return cachedBNTPool.depositFor(contextId, provider, bntAmount, isMigrating, originalAmount);\\n }\\n\\n /**\\n * @dev deposits base token liquidity for the specified provider from sender\\n *\\n * requirements:\\n *\\n * - the caller must have approved the network to transfer base tokens to on its behalf\\n */\\n function _depositBaseTokenFor(\\n bytes32 contextId,\\n address provider,\\n Token pool,\\n uint256 tokenAmount,\\n address caller,\\n uint256 availableAmount\\n ) private returns (uint256) {\\n // transfer the tokens from the sender to the vault\\n _depositToMasterVault(pool, caller, availableAmount);\\n\\n // get the pool collection that managed this pool\\n IPoolCollection poolCollection = _poolCollection(pool);\\n\\n // process deposit to the base token pool (includes the native token pool)\\n return poolCollection.depositFor(contextId, provider, pool, tokenAmount);\\n }\\n\\n /**\\n * @dev handles BNT withdrawal\\n */\\n function _withdrawBNT(\\n bytes32 contextId,\\n address provider,\\n CompletedWithdrawal memory completedRequest\\n ) private returns (uint256) {\\n IBNTPool cachedBNTPool = _bntPool;\\n\\n // transfer the pool tokens to from the pending withdrawals contract to the BNT pool\\n completedRequest.poolToken.transferFrom(\\n address(_pendingWithdrawals),\\n address(cachedBNTPool),\\n completedRequest.poolTokenAmount\\n );\\n\\n // transfer vBNT from the caller to the BNT pool\\n _vbnt.transferFrom(provider, address(cachedBNTPool), completedRequest.poolTokenAmount);\\n\\n // call withdraw on the BNT pool\\n return\\n cachedBNTPool.withdraw(\\n contextId,\\n provider,\\n completedRequest.poolTokenAmount,\\n completedRequest.reserveTokenAmount\\n );\\n }\\n\\n /**\\n * @dev handles base token withdrawal\\n */\\n function _withdrawBaseToken(\\n bytes32 contextId,\\n address provider,\\n CompletedWithdrawal memory completedRequest\\n ) private returns (uint256) {\\n Token pool = completedRequest.poolToken.reserveToken();\\n\\n // get the pool collection that manages this pool\\n IPoolCollection poolCollection = _poolCollection(pool);\\n\\n // transfer the pool tokens to from the pending withdrawals contract to the pool collection\\n completedRequest.poolToken.transferFrom(\\n address(_pendingWithdrawals),\\n address(poolCollection),\\n completedRequest.poolTokenAmount\\n );\\n\\n // call withdraw on the base token pool - returns the amounts/breakdown\\n return\\n poolCollection.withdraw(\\n contextId,\\n provider,\\n pool,\\n completedRequest.poolTokenAmount,\\n completedRequest.reserveTokenAmount\\n );\\n }\\n\\n /**\\n * @dev verifies that the provided trade params are valid\\n */\\n function _verifyTradeParams(\\n Token sourceToken,\\n Token targetToken,\\n uint256 amount,\\n uint256 limit,\\n uint256 deadline\\n ) internal view {\\n _validAddress(address(sourceToken));\\n _validAddress(address(targetToken));\\n\\n if (sourceToken == targetToken) {\\n revert InvalidToken();\\n }\\n\\n _greaterThanZero(amount);\\n _greaterThanZero(limit);\\n\\n if (deadline < _time()) {\\n revert DeadlineExpired();\\n }\\n }\\n\\n /**\\n * @dev internal trade by source amount logic\\n */\\n function _tradeBySourceAmount(\\n Token sourceToken,\\n Token targetToken,\\n uint256 sourceAmount,\\n uint256 minReturnAmount,\\n uint256 deadline,\\n address beneficiary,\\n address sender\\n ) private returns (uint256) {\\n _verifyTradeParams(sourceToken, targetToken, sourceAmount, minReturnAmount, deadline);\\n bool _ignoreFees = false;\\n if (sender == _bancorArbitrage) {\\n _ignoreFees = true;\\n }\\n\\n return\\n _trade(\\n TradeTokens({ sourceToken: sourceToken, targetToken: targetToken }),\\n TradeParams({\\n bySourceAmount: true,\\n amount: sourceAmount,\\n limit: minReturnAmount,\\n ignoreFees: _ignoreFees\\n }),\\n TraderInfo({ trader: sender, beneficiary: beneficiary }),\\n deadline\\n );\\n }\\n\\n /**\\n * @dev internal trade by target amount logic\\n */\\n function _tradeByTargetAmount(\\n Token sourceToken,\\n Token targetToken,\\n uint256 targetAmount,\\n uint256 maxSourceAmount,\\n uint256 deadline,\\n address beneficiary,\\n address sender\\n ) private returns (uint256) {\\n _verifyTradeParams(sourceToken, targetToken, targetAmount, maxSourceAmount, deadline);\\n bool _ignoreFees = false;\\n if (sender == _bancorArbitrage) {\\n _ignoreFees = true;\\n }\\n\\n return\\n _trade(\\n TradeTokens({ sourceToken: sourceToken, targetToken: targetToken }),\\n TradeParams({\\n bySourceAmount: false,\\n amount: targetAmount,\\n limit: maxSourceAmount,\\n ignoreFees: _ignoreFees\\n }),\\n TraderInfo({ trader: sender, beneficiary: beneficiary }),\\n deadline\\n );\\n }\\n\\n /**\\n * @dev performs a trade by providing either the source or target amount:\\n *\\n * - when trading by the source amount, the amount represents the source amount and the limit is the minimum return\\n * amount\\n * - when trading by the target amount, the amount represents the target amount and the limit is the maximum source\\n * amount\\n *\\n * requirements:\\n *\\n * - the caller must have approved the network to transfer the source tokens on its behalf (except for in the\\n * native token case)\\n */\\n function _trade(\\n TradeTokens memory tokens,\\n TradeParams memory params,\\n TraderInfo memory traderInfo,\\n uint256 deadline\\n ) private returns (uint256) {\\n // ensure the beneficiary is set\\n if (traderInfo.beneficiary == address(0)) {\\n traderInfo.beneficiary = traderInfo.trader;\\n }\\n\\n bytes32 contextId = keccak256(\\n abi.encodePacked(\\n traderInfo.trader,\\n _time(),\\n tokens.sourceToken,\\n tokens.targetToken,\\n params.amount,\\n params.limit,\\n params.bySourceAmount,\\n deadline,\\n traderInfo.beneficiary\\n )\\n );\\n\\n // perform either a single or double hop trade, based on the source and the target pool\\n TradeResult memory firstHopTradeResult;\\n TradeResult memory lastHopTradeResult;\\n uint256 networkFeeAmount;\\n\\n if (tokens.sourceToken.isEqual(_bnt)) {\\n lastHopTradeResult = _tradeBNT(contextId, tokens.targetToken, true, params);\\n\\n firstHopTradeResult = lastHopTradeResult;\\n\\n networkFeeAmount = lastHopTradeResult.networkFeeAmount;\\n\\n emit TokensTraded({\\n contextId: contextId,\\n sourceToken: tokens.sourceToken,\\n targetToken: tokens.targetToken,\\n sourceAmount: lastHopTradeResult.sourceAmount,\\n targetAmount: lastHopTradeResult.targetAmount,\\n bntAmount: lastHopTradeResult.sourceAmount,\\n targetFeeAmount: lastHopTradeResult.tradingFeeAmount,\\n bntFeeAmount: 0,\\n trader: traderInfo.trader\\n });\\n } else if (tokens.targetToken.isEqual(_bnt)) {\\n lastHopTradeResult = _tradeBNT(contextId, tokens.sourceToken, false, params);\\n\\n firstHopTradeResult = lastHopTradeResult;\\n\\n networkFeeAmount = lastHopTradeResult.networkFeeAmount;\\n\\n emit TokensTraded({\\n contextId: contextId,\\n sourceToken: tokens.sourceToken,\\n targetToken: tokens.targetToken,\\n sourceAmount: lastHopTradeResult.sourceAmount,\\n targetAmount: lastHopTradeResult.targetAmount,\\n bntAmount: lastHopTradeResult.targetAmount,\\n targetFeeAmount: lastHopTradeResult.tradingFeeAmount,\\n bntFeeAmount: lastHopTradeResult.tradingFeeAmount,\\n trader: traderInfo.trader\\n });\\n } else {\\n (firstHopTradeResult, lastHopTradeResult) = _tradeBaseTokens(contextId, tokens, params);\\n\\n networkFeeAmount = firstHopTradeResult.networkFeeAmount + lastHopTradeResult.networkFeeAmount;\\n\\n emit TokensTraded({\\n contextId: contextId,\\n sourceToken: tokens.sourceToken,\\n targetToken: tokens.targetToken,\\n sourceAmount: firstHopTradeResult.sourceAmount,\\n targetAmount: lastHopTradeResult.targetAmount,\\n bntAmount: firstHopTradeResult.targetAmount,\\n targetFeeAmount: lastHopTradeResult.tradingFeeAmount,\\n bntFeeAmount: firstHopTradeResult.tradingFeeAmount,\\n trader: traderInfo.trader\\n });\\n }\\n\\n // transfer the tokens from the trader to the vault\\n _depositToMasterVault(tokens.sourceToken, traderInfo.trader, firstHopTradeResult.sourceAmount);\\n\\n // transfer the target tokens/native token to the beneficiary\\n _masterVault.withdrawFunds(\\n tokens.targetToken,\\n payable(traderInfo.beneficiary),\\n lastHopTradeResult.targetAmount\\n );\\n\\n // update the pending network fee amount to be burned by the vortex\\n _pendingNetworkFeeAmount += networkFeeAmount;\\n\\n return params.bySourceAmount ? lastHopTradeResult.targetAmount : firstHopTradeResult.sourceAmount;\\n }\\n\\n /**\\n * @dev performs a single hop between BNT and a base token trade by providing either the source or the target amount\\n *\\n * - when trading by the source amount, the amount represents the source amount and the limit is the minimum return\\n * amount\\n * - when trading by the target amount, the amount represents the target amount and the limit is the maximum source\\n * amount\\n */\\n function _tradeBNT(\\n bytes32 contextId,\\n Token pool,\\n bool fromBNT,\\n TradeParams memory params\\n ) private returns (TradeResult memory) {\\n TradeTokens memory tokens = fromBNT\\n ? TradeTokens({ sourceToken: Token(address(_bnt)), targetToken: pool })\\n : TradeTokens({ sourceToken: pool, targetToken: Token(address(_bnt)) });\\n\\n TradeAmountAndFee memory tradeAmountsAndFee = params.bySourceAmount\\n ? _poolCollection(pool).tradeBySourceAmount(\\n contextId,\\n tokens.sourceToken,\\n tokens.targetToken,\\n params.amount,\\n params.limit,\\n params.ignoreFees\\n )\\n : _poolCollection(pool).tradeByTargetAmount(\\n contextId,\\n tokens.sourceToken,\\n tokens.targetToken,\\n params.amount,\\n params.limit,\\n params.ignoreFees\\n );\\n\\n // if the target token is BNT, notify the BNT pool on collected fees (which shouldn't include the network fee\\n // amount, so we have to deduct it explicitly from the full trading fee amount)\\n if (!fromBNT) {\\n _bntPool.onFeesCollected(\\n pool,\\n tradeAmountsAndFee.tradingFeeAmount - tradeAmountsAndFee.networkFeeAmount,\\n true\\n );\\n }\\n\\n return\\n TradeResult({\\n sourceAmount: params.bySourceAmount ? params.amount : tradeAmountsAndFee.amount,\\n targetAmount: params.bySourceAmount ? tradeAmountsAndFee.amount : params.amount,\\n tradingFeeAmount: tradeAmountsAndFee.tradingFeeAmount,\\n networkFeeAmount: tradeAmountsAndFee.networkFeeAmount\\n });\\n }\\n\\n /**\\n * @dev performs a double hop trade between two base tokens by providing either the source or the target amount\\n *\\n * - when trading by the source amount, the amount represents the source amount and the limit is the minimum return\\n * amount\\n * - when trading by the target amount, the amount represents the target amount and the limit is the maximum source\\n * amount\\n */\\n function _tradeBaseTokens(\\n bytes32 contextId,\\n TradeTokens memory tokens,\\n TradeParams memory params\\n ) private returns (TradeResult memory, TradeResult memory) {\\n if (params.bySourceAmount) {\\n uint256 sourceAmount = params.amount;\\n uint256 minReturnAmount = params.limit;\\n\\n // trade source tokens to BNT (while accepting any return amount)\\n TradeResult memory targetHop1 = _tradeBNT(\\n contextId,\\n tokens.sourceToken,\\n false,\\n TradeParams({ bySourceAmount: true, amount: sourceAmount, limit: 1, ignoreFees: params.ignoreFees })\\n );\\n\\n // trade the received BNT target amount to target tokens (while respecting the minimum return amount)\\n TradeResult memory targetHop2 = _tradeBNT(\\n contextId,\\n tokens.targetToken,\\n true,\\n TradeParams({\\n bySourceAmount: true,\\n amount: targetHop1.targetAmount,\\n limit: minReturnAmount,\\n ignoreFees: params.ignoreFees\\n })\\n );\\n\\n return (targetHop1, targetHop2);\\n }\\n\\n uint256 targetAmount = params.amount;\\n uint256 maxSourceAmount = params.limit;\\n\\n // trade any amount of BNT to get the requested target amount (we will use the actual traded amount to restrict\\n // the trade from the source)\\n TradeResult memory sourceHop2 = _tradeBNT(\\n contextId,\\n tokens.targetToken,\\n true,\\n TradeParams({\\n bySourceAmount: false,\\n amount: targetAmount,\\n limit: type(uint256).max,\\n ignoreFees: params.ignoreFees\\n })\\n );\\n\\n // trade source tokens to the required amount of BNT (while respecting the maximum source amount)\\n TradeResult memory sourceHop1 = _tradeBNT(\\n contextId,\\n tokens.sourceToken,\\n false,\\n TradeParams({\\n bySourceAmount: false,\\n amount: sourceHop2.sourceAmount,\\n limit: maxSourceAmount,\\n ignoreFees: params.ignoreFees\\n })\\n );\\n\\n return (sourceHop1, sourceHop2);\\n }\\n\\n /**\\n * @dev deposits tokens to the master vault and verifies that msg.value corresponds to its type\\n */\\n function _depositToMasterVault(Token token, address caller, uint256 amount) private {\\n if (token.isNative()) {\\n if (msg.value < amount) {\\n revert NativeTokenAmountMismatch();\\n }\\n\\n // using a regular transfer here would revert due to exceeding the 2300 gas limit which is why we're using\\n // call instead (via sendValue), which the 2300 gas limit does not apply for\\n payable(address(_masterVault)).sendValue(amount);\\n\\n // refund the caller for the remaining native token amount\\n if (msg.value > amount) {\\n payable(address(caller)).sendValue(msg.value - amount);\\n }\\n } else {\\n if (msg.value > 0) {\\n revert NativeTokenAmountMismatch();\\n }\\n\\n token.safeTransferFrom(caller, address(_masterVault), amount);\\n }\\n }\\n\\n /**\\n * @dev verifies that the specified pool is managed by a valid pool collection and returns it\\n */\\n function _poolCollection(Token token) private view returns (IPoolCollection) {\\n // verify that the pool is managed by a valid pool collection\\n IPoolCollection poolCollection = _collectionByPool[token];\\n if (address(poolCollection) == address(0)) {\\n revert InvalidToken();\\n }\\n\\n return poolCollection;\\n }\\n\\n /**\\n * @dev initiates liquidity withdrawal\\n */\\n function _initWithdrawal(\\n address provider,\\n IPoolToken poolToken,\\n uint256 poolTokenAmount\\n ) private returns (uint256) {\\n if (poolToken != _bntPoolToken) {\\n Token reserveToken = poolToken.reserveToken();\\n if (_poolCollection(reserveToken).poolToken(reserveToken) != poolToken) {\\n revert InvalidPool();\\n }\\n }\\n\\n // transfer the pool tokens from the provider (we aren't using safeTransferFrom, since the PoolToken is a fully\\n // compliant ERC20 token contract)\\n poolToken.transferFrom(provider, address(_pendingWithdrawals), poolTokenAmount);\\n\\n return _pendingWithdrawals.initWithdrawal(provider, poolToken, poolTokenAmount);\\n }\\n\\n /**\\n * @dev grants/revokes required roles to/from a pool collection\\n */\\n function _setAccessRoles(IPoolCollection poolCollection, bool set) private {\\n address poolCollectionAddress = address(poolCollection);\\n\\n if (set) {\\n _bntPool.grantRole(ROLE_BNT_MANAGER, poolCollectionAddress);\\n _bntPool.grantRole(ROLE_VAULT_MANAGER, poolCollectionAddress);\\n _bntPool.grantRole(ROLE_FUNDING_MANAGER, poolCollectionAddress);\\n _masterVault.grantRole(ROLE_ASSET_MANAGER, poolCollectionAddress);\\n _externalProtectionVault.grantRole(ROLE_ASSET_MANAGER, poolCollectionAddress);\\n } else {\\n _bntPool.revokeRole(ROLE_BNT_MANAGER, poolCollectionAddress);\\n _bntPool.revokeRole(ROLE_VAULT_MANAGER, poolCollectionAddress);\\n _bntPool.revokeRole(ROLE_FUNDING_MANAGER, poolCollectionAddress);\\n _masterVault.revokeRole(ROLE_ASSET_MANAGER, poolCollectionAddress);\\n _externalProtectionVault.revokeRole(ROLE_ASSET_MANAGER, poolCollectionAddress);\\n }\\n }\\n\\n /*\\n * @dev finds a pool collection with the given type and version\\n */\\n function _findPoolCollection(uint16 poolType, uint16 poolVersion) private view returns (IPoolCollection) {\\n // note that there's no risk of using an unbounded loop here since the list of all the active pool collections\\n // is always going to remain sufficiently small\\n uint256 length = _poolCollections.length();\\n for (uint256 i = 0; i < length; i++) {\\n IPoolCollection poolCollection = IPoolCollection(_poolCollections.at(i));\\n if ((poolCollection.poolType() == poolType && poolCollection.version() == poolVersion)) {\\n return poolCollection;\\n }\\n }\\n\\n return IPoolCollection(address(0));\\n }\\n}\\n\",\"keccak256\":\"0x9415aa2546e21c355fb0b9dec73184836ac133c942039a1ddea8ecf469ea5f37\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/network/interfaces/IBancorNetwork.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport { IUpgradeable } from \\\"../../utility/interfaces/IUpgradeable.sol\\\";\\n\\nimport { Token } from \\\"../../token/Token.sol\\\";\\n\\nimport { IPoolCollection } from \\\"../../pools/interfaces/IPoolCollection.sol\\\";\\nimport { IPoolToken } from \\\"../../pools/interfaces/IPoolToken.sol\\\";\\n\\n/**\\n * @dev Flash-loan recipient interface\\n */\\ninterface IFlashLoanRecipient {\\n /**\\n * @dev a flash-loan recipient callback after each the caller must return the borrowed amount and an additional fee\\n */\\n function onFlashLoan(\\n address caller,\\n IERC20 erc20Token,\\n uint256 amount,\\n uint256 feeAmount,\\n bytes memory data\\n ) external;\\n}\\n\\n/**\\n * @dev Bancor Network interface\\n */\\ninterface IBancorNetwork is IUpgradeable {\\n /**\\n * @dev returns the set of all valid pool collections\\n */\\n function poolCollections() external view returns (IPoolCollection[] memory);\\n\\n /**\\n * @dev returns the set of all liquidity pools\\n */\\n function liquidityPools() external view returns (Token[] memory);\\n\\n /**\\n * @dev returns the respective pool collection for the provided pool\\n */\\n function collectionByPool(Token pool) external view returns (IPoolCollection);\\n\\n /**\\n * @dev creates new pools\\n *\\n * requirements:\\n *\\n * - none of the pools already exists\\n */\\n function createPools(Token[] calldata tokens, IPoolCollection poolCollection) external;\\n\\n /**\\n * @dev migrates a list of pools between pool collections\\n *\\n * notes:\\n *\\n * - invalid or incompatible pools will be skipped gracefully\\n */\\n function migratePools(Token[] calldata pools, IPoolCollection newPoolCollection) external;\\n\\n /**\\n * @dev deposits liquidity for the specified provider and returns the respective pool token amount\\n *\\n * requirements:\\n *\\n * - the caller must have approved the network to transfer the tokens on its behalf (except for in the\\n * native token case)\\n */\\n function depositFor(\\n address provider,\\n Token pool,\\n uint256 tokenAmount\\n ) external payable returns (uint256);\\n\\n /**\\n * @dev deposits liquidity for the current provider and returns the respective pool token amount\\n *\\n * requirements:\\n *\\n * - the caller must have approved the network to transfer the tokens on its behalf (except for in the\\n * native token case)\\n */\\n function deposit(Token pool, uint256 tokenAmount) external payable returns (uint256);\\n\\n /**\\n * @dev initiates liquidity withdrawal\\n *\\n * requirements:\\n *\\n * - the caller must have approved the contract to transfer the pool token amount on its behalf\\n */\\n function initWithdrawal(IPoolToken poolToken, uint256 poolTokenAmount) external returns (uint256);\\n\\n /**\\n * @dev cancels a withdrawal request, and returns the number of pool token amount associated with the withdrawal\\n * request\\n *\\n * requirements:\\n *\\n * - the caller must have already initiated a withdrawal and received the specified id\\n */\\n function cancelWithdrawal(uint256 id) external returns (uint256);\\n\\n /**\\n * @dev withdraws liquidity and returns the withdrawn amount\\n *\\n * requirements:\\n *\\n * - the provider must have already initiated a withdrawal and received the specified id\\n * - the specified withdrawal request is eligible for completion\\n * - the provider must have approved the network to transfer vBNT amount on its behalf, when withdrawing BNT\\n * liquidity\\n */\\n function withdraw(uint256 id) external returns (uint256);\\n\\n /**\\n * @dev performs a trade by providing the input source amount, sends the proceeds to the optional beneficiary (or\\n * to the address of the caller, in case it's not supplied), and returns the trade target amount\\n *\\n * requirements:\\n *\\n * - the caller must have approved the network to transfer the source tokens on its behalf (except for in the\\n * native token case)\\n */\\n function tradeBySourceAmount(\\n Token sourceToken,\\n Token targetToken,\\n uint256 sourceAmount,\\n uint256 minReturnAmount,\\n uint256 deadline,\\n address beneficiary\\n ) external payable returns (uint256);\\n\\n /**\\n * @dev performs a trade by providing the output target amount, sends the proceeds to the optional beneficiary (or\\n * to the address of the caller, in case it's not supplied), and returns the trade source amount\\n *\\n * requirements:\\n *\\n * - the caller must have approved the network to transfer the source tokens on its behalf (except for in the\\n * native token case)\\n */\\n function tradeByTargetAmount(\\n Token sourceToken,\\n Token targetToken,\\n uint256 targetAmount,\\n uint256 maxSourceAmount,\\n uint256 deadline,\\n address beneficiary\\n ) external payable returns (uint256);\\n\\n /**\\n * @dev performs a trade by providing the input source amount, sends the proceeds to the optional beneficiary (or\\n * to the address of the caller, in case it's not supplied), and returns the trade target amount\\n *\\n * requirements:\\n *\\n * - the caller must have approved the network to transfer the source tokens on its behalf (except for in the\\n * native token case)\\n * - the caller must be the _bancorArbitrage contract\\n */\\n function tradeBySourceAmountArb(\\n Token sourceToken,\\n Token targetToken,\\n uint256 sourceAmount,\\n uint256 minReturnAmount,\\n uint256 deadline,\\n address beneficiary\\n ) external payable returns (uint256);\\n\\n /**\\n * @dev performs a trade by providing the output target amount, sends the proceeds to the optional beneficiary (or\\n * to the address of the caller, in case it's not supplied), and returns the trade source amount\\n *\\n * requirements:\\n *\\n * - the caller must have approved the network to transfer the source tokens on its behalf (except for in the\\n * native token case)\\n * - the caller must be the _bancorArbitrage contract\\n */\\n function tradeByTargetAmountArb(\\n Token sourceToken,\\n Token targetToken,\\n uint256 targetAmount,\\n uint256 maxSourceAmount,\\n uint256 deadline,\\n address beneficiary\\n ) external payable returns (uint256);\\n\\n /**\\n * @dev provides a flash-loan\\n *\\n * requirements:\\n *\\n * - the recipient's callback must return *at least* the borrowed amount and fee back to the specified return address\\n */\\n function flashLoan(\\n Token token,\\n uint256 amount,\\n IFlashLoanRecipient recipient,\\n bytes calldata data\\n ) external;\\n\\n /**\\n * @dev deposits liquidity during a migration\\n */\\n function migrateLiquidity(\\n Token token,\\n address provider,\\n uint256 amount,\\n uint256 availableAmount,\\n uint256 originalAmount\\n ) external payable;\\n\\n /**\\n * @dev withdraws pending network fees, and returns the amount of fees withdrawn\\n *\\n * requirements:\\n *\\n * - the caller must have the ROLE_NETWORK_FEE_MANAGER privilege\\n */\\n function withdrawNetworkFees(address recipient) external returns (uint256);\\n}\\n\",\"keccak256\":\"0x93eef421378e628af43a49527e1e8299cd1189d788701974af293016ca1479b6\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/network/interfaces/INetworkSettings.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { IUpgradeable } from \\\"../../utility/interfaces/IUpgradeable.sol\\\";\\n\\nimport { Token } from \\\"../../token/Token.sol\\\";\\n\\nerror NotWhitelisted();\\n\\nstruct VortexRewards {\\n // the percentage of converted BNT to be sent to the initiator of the burning event (in units of PPM)\\n uint32 burnRewardPPM;\\n // the maximum burn reward to be sent to the initiator of the burning event\\n uint256 burnRewardMaxAmount;\\n}\\n\\n/**\\n * @dev Network Settings interface\\n */\\ninterface INetworkSettings is IUpgradeable {\\n /**\\n * @dev returns the protected tokens whitelist\\n */\\n function protectedTokenWhitelist() external view returns (Token[] memory);\\n\\n /**\\n * @dev checks whether a given token is whitelisted\\n */\\n function isTokenWhitelisted(Token pool) external view returns (bool);\\n\\n /**\\n * @dev returns the BNT funding limit for a given pool\\n */\\n function poolFundingLimit(Token pool) external view returns (uint256);\\n\\n /**\\n * @dev returns the minimum BNT trading liquidity required before the system enables trading in the relevant pool\\n */\\n function minLiquidityForTrading() external view returns (uint256);\\n\\n /**\\n * @dev returns the withdrawal fee (in units of PPM)\\n */\\n function withdrawalFeePPM() external view returns (uint32);\\n\\n /**\\n * @dev returns the default flash-loan fee (in units of PPM)\\n */\\n function defaultFlashLoanFeePPM() external view returns (uint32);\\n\\n /**\\n * @dev returns the flash-loan fee (in units of PPM) of a pool\\n */\\n function flashLoanFeePPM(Token pool) external view returns (uint32);\\n\\n /**\\n * @dev returns the vortex settings\\n */\\n function vortexRewards() external view returns (VortexRewards memory);\\n}\\n\",\"keccak256\":\"0x92ef678ce3b9dbb2ff12c2bfb59277456ed3e385260f860a81b920439c5252fe\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/network/interfaces/IPendingWithdrawals.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { IPoolToken } from \\\"../../pools/interfaces/IPoolToken.sol\\\";\\n\\nimport { Token } from \\\"../../token/Token.sol\\\";\\n\\nimport { IUpgradeable } from \\\"../../utility/interfaces/IUpgradeable.sol\\\";\\n\\n/**\\n * @dev the data struct representing a pending withdrawal request\\n */\\nstruct WithdrawalRequest {\\n address provider; // the liquidity provider\\n IPoolToken poolToken; // the locked pool token\\n Token reserveToken; // the reserve token to withdraw\\n uint32 createdAt; // the time when the request was created (Unix timestamp)\\n uint256 poolTokenAmount; // the locked pool token amount\\n uint256 reserveTokenAmount; // the expected reserve token amount to withdraw\\n}\\n\\n/**\\n * @dev the data struct representing a completed withdrawal request\\n */\\nstruct CompletedWithdrawal {\\n IPoolToken poolToken; // the withdraw pool token\\n uint256 poolTokenAmount; // the original pool token amount in the withdrawal request\\n uint256 reserveTokenAmount; // the original reserve token amount at the time of the withdrawal init request\\n}\\n\\n/**\\n * @dev Pending Withdrawals interface\\n */\\ninterface IPendingWithdrawals is IUpgradeable {\\n /**\\n * @dev returns the lock duration\\n */\\n function lockDuration() external view returns (uint32);\\n\\n /**\\n * @dev returns the pending withdrawal requests count for a specific provider\\n */\\n function withdrawalRequestCount(address provider) external view returns (uint256);\\n\\n /**\\n * @dev returns the pending withdrawal requests IDs for a specific provider\\n */\\n function withdrawalRequestIds(address provider) external view returns (uint256[] memory);\\n\\n /**\\n * @dev returns the pending withdrawal request with the specified ID\\n */\\n function withdrawalRequest(uint256 id) external view returns (WithdrawalRequest memory);\\n\\n /**\\n * @dev initiates liquidity withdrawal\\n *\\n * requirements:\\n *\\n * - the caller must be the network contract\\n */\\n function initWithdrawal(\\n address provider,\\n IPoolToken poolToken,\\n uint256 poolTokenAmount\\n ) external returns (uint256);\\n\\n /**\\n * @dev cancels a withdrawal request, and returns the number of pool tokens which were sent back to the provider\\n *\\n * requirements:\\n *\\n * - the caller must be the network contract\\n * - the provider must have already initiated a withdrawal and received the specified id\\n */\\n function cancelWithdrawal(address provider, uint256 id) external returns (uint256);\\n\\n /**\\n * @dev completes a withdrawal request, and returns the pool token and its transferred amount\\n *\\n * requirements:\\n *\\n * - the caller must be the network contract\\n * - the provider must have already initiated a withdrawal and received the specified id\\n * - the lock duration has ended\\n */\\n function completeWithdrawal(\\n bytes32 contextId,\\n address provider,\\n uint256 id\\n ) external returns (CompletedWithdrawal memory);\\n\\n /**\\n * @dev returns whether the given request is ready for withdrawal\\n */\\n function isReadyForWithdrawal(uint256 id) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x0eb8cdbc49ef5e1254e20f9835834208316124a00c9a8b4c16e54b25beb4be98\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/pools/interfaces/IBNTPool.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { IPoolToken } from \\\"./IPoolToken.sol\\\";\\n\\nimport { Token } from \\\"../../token/Token.sol\\\";\\n\\nimport { IVault } from \\\"../../vaults/interfaces/IVault.sol\\\";\\n\\n// the BNT pool token manager role is required to access the BNT pool tokens\\nbytes32 constant ROLE_BNT_POOL_TOKEN_MANAGER = keccak256(\\\"ROLE_BNT_POOL_TOKEN_MANAGER\\\");\\n\\n// the BNT manager role is required to request the BNT pool to mint BNT\\nbytes32 constant ROLE_BNT_MANAGER = keccak256(\\\"ROLE_BNT_MANAGER\\\");\\n\\n// the vault manager role is required to request the BNT pool to burn BNT from the master vault\\nbytes32 constant ROLE_VAULT_MANAGER = keccak256(\\\"ROLE_VAULT_MANAGER\\\");\\n\\n// the funding manager role is required to request or renounce funding from the BNT pool\\nbytes32 constant ROLE_FUNDING_MANAGER = keccak256(\\\"ROLE_FUNDING_MANAGER\\\");\\n\\n/**\\n * @dev BNT Pool interface\\n */\\ninterface IBNTPool is IVault {\\n /**\\n * @dev returns the BNT pool token contract\\n */\\n function poolToken() external view returns (IPoolToken);\\n\\n /**\\n * @dev returns the total staked BNT balance in the network\\n */\\n function stakedBalance() external view returns (uint256);\\n\\n /**\\n * @dev returns the current funding of given pool\\n */\\n function currentPoolFunding(Token pool) external view returns (uint256);\\n\\n /**\\n * @dev returns the available BNT funding for a given pool\\n */\\n function availableFunding(Token pool) external view returns (uint256);\\n\\n /**\\n * @dev converts the specified pool token amount to the underlying BNT amount\\n */\\n function poolTokenToUnderlying(uint256 poolTokenAmount) external view returns (uint256);\\n\\n /**\\n * @dev converts the specified underlying BNT amount to pool token amount\\n */\\n function underlyingToPoolToken(uint256 bntAmount) external view returns (uint256);\\n\\n /**\\n * @dev returns the number of pool token to burn in order to increase everyone's underlying value by the specified\\n * amount\\n */\\n function poolTokenAmountToBurn(uint256 bntAmountToDistribute) external view returns (uint256);\\n\\n /**\\n * @dev mints BNT to the recipient\\n *\\n * requirements:\\n *\\n * - the caller must have the ROLE_BNT_MANAGER role\\n */\\n function mint(address recipient, uint256 bntAmount) external;\\n\\n /**\\n * @dev burns BNT from the vault\\n *\\n * requirements:\\n *\\n * - the caller must have the ROLE_VAULT_MANAGER role\\n */\\n function burnFromVault(uint256 bntAmount) external;\\n\\n /**\\n * @dev deposits BNT liquidity on behalf of a specific provider and returns the respective pool token amount\\n *\\n * requirements:\\n *\\n * - the caller must be the network contract\\n * - BNT tokens must have been already deposited into the contract\\n */\\n function depositFor(\\n bytes32 contextId,\\n address provider,\\n uint256 bntAmount,\\n bool isMigrating,\\n uint256 originalVBNTAmount\\n ) external returns (uint256);\\n\\n /**\\n * @dev withdraws BNT liquidity on behalf of a specific provider and returns the withdrawn BNT amount\\n *\\n * requirements:\\n *\\n * - the caller must be the network contract\\n * - bnBNT token must have been already deposited into the contract\\n * - vBNT token must have been already deposited into the contract\\n */\\n function withdraw(\\n bytes32 contextId,\\n address provider,\\n uint256 poolTokenAmount,\\n uint256 bntAmount\\n ) external returns (uint256);\\n\\n /**\\n * @dev returns the withdrawn BNT amount\\n */\\n function withdrawalAmount(uint256 poolTokenAmount) external view returns (uint256);\\n\\n /**\\n * @dev requests BNT funding\\n *\\n * requirements:\\n *\\n * - the caller must have the ROLE_FUNDING_MANAGER role\\n * - the token must have been whitelisted\\n * - the request amount should be below the funding limit for a given pool\\n * - the average rate of the pool must not deviate too much from its spot rate\\n */\\n function requestFunding(\\n bytes32 contextId,\\n Token pool,\\n uint256 bntAmount\\n ) external;\\n\\n /**\\n * @dev renounces BNT funding\\n *\\n * requirements:\\n *\\n * - the caller must have the ROLE_FUNDING_MANAGER role\\n * - the token must have been whitelisted\\n * - the average rate of the pool must not deviate too much from its spot rate\\n */\\n function renounceFunding(\\n bytes32 contextId,\\n Token pool,\\n uint256 bntAmount\\n ) external;\\n\\n /**\\n * @dev notifies the pool of accrued fees\\n *\\n * requirements:\\n *\\n * - the caller must be the network contract\\n */\\n function onFeesCollected(\\n Token pool,\\n uint256 feeAmount,\\n bool isTradeFee\\n ) external;\\n}\\n\",\"keccak256\":\"0xed6a5abb972bdc42e1d32dd4157c0968b5d34d3a6560dcffeb1479ed994fd5a8\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/pools/interfaces/IPoolCollection.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { IVersioned } from \\\"../../utility/interfaces/IVersioned.sol\\\";\\nimport { Fraction112 } from \\\"../../utility/FractionLibrary.sol\\\";\\n\\nimport { Token } from \\\"../../token/Token.sol\\\";\\n\\nimport { IPoolToken } from \\\"./IPoolToken.sol\\\";\\n\\nstruct PoolLiquidity {\\n uint128 bntTradingLiquidity; // the BNT trading liquidity\\n uint128 baseTokenTradingLiquidity; // the base token trading liquidity\\n uint256 stakedBalance; // the staked balance\\n}\\n\\nstruct AverageRates {\\n uint32 blockNumber;\\n Fraction112 rate;\\n Fraction112 invRate;\\n}\\n\\nstruct Pool {\\n IPoolToken poolToken; // the pool token of the pool\\n uint32 tradingFeePPM; // the trading fee (in units of PPM)\\n bool tradingEnabled; // whether trading is enabled\\n bool depositingEnabled; // whether depositing is enabled\\n AverageRates averageRates; // the recent average rates\\n PoolLiquidity liquidity; // the overall liquidity in the pool\\n}\\n\\nstruct WithdrawalAmounts {\\n uint256 totalAmount;\\n uint256 baseTokenAmount;\\n uint256 bntAmount;\\n}\\n\\n// trading enabling/disabling reasons\\nuint8 constant TRADING_STATUS_UPDATE_DEFAULT = 0;\\nuint8 constant TRADING_STATUS_UPDATE_ADMIN = 1;\\nuint8 constant TRADING_STATUS_UPDATE_MIN_LIQUIDITY = 2;\\nuint8 constant TRADING_STATUS_UPDATE_INVALID_STATE = 3;\\n\\nstruct TradeAmountAndFee {\\n uint256 amount; // the source/target amount (depending on the context) resulting from the trade\\n uint256 tradingFeeAmount; // the trading fee amount\\n uint256 networkFeeAmount; // the network fee amount (always in units of BNT)\\n}\\n\\n/**\\n * @dev Pool Collection interface\\n */\\ninterface IPoolCollection is IVersioned {\\n /**\\n * @dev returns the type of the pool\\n */\\n function poolType() external view returns (uint16);\\n\\n /**\\n * @dev returns the default trading fee (in units of PPM)\\n */\\n function defaultTradingFeePPM() external view returns (uint32);\\n\\n /**\\n * @dev returns the network fee (in units of PPM)\\n */\\n function networkFeePPM() external view returns (uint32);\\n\\n /**\\n * @dev returns all the pools which are managed by this pool collection\\n */\\n function pools() external view returns (Token[] memory);\\n\\n /**\\n * @dev returns the number of all the pools which are managed by this pool collection\\n */\\n function poolCount() external view returns (uint256);\\n\\n /**\\n * @dev returns whether a pool is valid\\n */\\n function isPoolValid(Token pool) external view returns (bool);\\n\\n /**\\n * @dev returns the overall liquidity in the pool\\n */\\n function poolLiquidity(Token pool) external view returns (PoolLiquidity memory);\\n\\n /**\\n * @dev returns the pool token of the pool\\n */\\n function poolToken(Token pool) external view returns (IPoolToken);\\n\\n /**\\n * @dev returns the trading fee (in units of PPM)\\n */\\n function tradingFeePPM(Token pool) external view returns (uint32);\\n\\n /**\\n * @dev returns whether trading is enabled\\n */\\n function tradingEnabled(Token pool) external view returns (bool);\\n\\n /**\\n * @dev returns whether depositing is enabled\\n */\\n function depositingEnabled(Token pool) external view returns (bool);\\n\\n /**\\n * @dev returns whether the pool is stable\\n */\\n function isPoolStable(Token pool) external view returns (bool);\\n\\n /**\\n * @dev converts the specified pool token amount to the underlying base token amount\\n */\\n function poolTokenToUnderlying(Token pool, uint256 poolTokenAmount) external view returns (uint256);\\n\\n /**\\n * @dev converts the specified underlying base token amount to pool token amount\\n */\\n function underlyingToPoolToken(Token pool, uint256 baseTokenAmount) external view returns (uint256);\\n\\n /**\\n * @dev returns the number of pool token to burn in order to increase everyone's underlying value by the specified\\n * amount\\n */\\n function poolTokenAmountToBurn(\\n Token pool,\\n uint256 baseTokenAmountToDistribute,\\n uint256 protocolPoolTokenAmount\\n ) external view returns (uint256);\\n\\n /**\\n * @dev creates a new pool\\n *\\n * requirements:\\n *\\n * - the caller must be the network contract\\n * - the pool should have been whitelisted\\n * - the pool isn't already defined in the collection\\n */\\n function createPool(Token token) external;\\n\\n /**\\n * @dev deposits base token liquidity on behalf of a specific provider and returns the respective pool token amount\\n *\\n * requirements:\\n *\\n * - the caller must be the network contract\\n * - assumes that the base token has been already deposited in the vault\\n */\\n function depositFor(\\n bytes32 contextId,\\n address provider,\\n Token pool,\\n uint256 baseTokenAmount\\n ) external returns (uint256);\\n\\n /**\\n * @dev handles some of the withdrawal-related actions and returns the withdrawn base token amount\\n *\\n * requirements:\\n *\\n * - the caller must be the network contract\\n * - the caller must have approved the collection to transfer/burn the pool token amount on its behalf\\n */\\n function withdraw(\\n bytes32 contextId,\\n address provider,\\n Token pool,\\n uint256 poolTokenAmount,\\n uint256 baseTokenAmount\\n ) external returns (uint256);\\n\\n /**\\n * @dev returns the amounts that would be returned if the position is currently withdrawn,\\n * along with the breakdown of the base token and the BNT compensation\\n */\\n function withdrawalAmounts(Token pool, uint256 poolTokenAmount) external view returns (WithdrawalAmounts memory);\\n\\n /**\\n * @dev performs a trade by providing the source amount and returns the target amount and the associated fee\\n *\\n * requirements:\\n *\\n * - the caller must be the network contract\\n */\\n function tradeBySourceAmount(\\n bytes32 contextId,\\n Token sourceToken,\\n Token targetToken,\\n uint256 sourceAmount,\\n uint256 minReturnAmount,\\n bool ignoreFees\\n ) external returns (TradeAmountAndFee memory);\\n\\n /**\\n * @dev performs a trade by providing the target amount and returns the required source amount and the associated fee\\n *\\n * requirements:\\n *\\n * - the caller must be the network contract\\n */\\n function tradeByTargetAmount(\\n bytes32 contextId,\\n Token sourceToken,\\n Token targetToken,\\n uint256 targetAmount,\\n uint256 maxSourceAmount,\\n bool ignoreFees\\n ) external returns (TradeAmountAndFee memory);\\n\\n /**\\n * @dev returns the output amount and fee when trading by providing the source amount\\n */\\n function tradeOutputAndFeeBySourceAmount(\\n Token sourceToken,\\n Token targetToken,\\n uint256 sourceAmount\\n ) external view returns (TradeAmountAndFee memory);\\n\\n /**\\n * @dev returns the input amount and fee when trading by providing the target amount\\n */\\n function tradeInputAndFeeByTargetAmount(\\n Token sourceToken,\\n Token targetToken,\\n uint256 targetAmount\\n ) external view returns (TradeAmountAndFee memory);\\n\\n /**\\n * @dev notifies the pool of accrued fees\\n *\\n * requirements:\\n *\\n * - the caller must be the network contract\\n */\\n function onFeesCollected(Token pool, uint256 feeAmount) external;\\n\\n /**\\n * @dev migrates a pool to this pool collection\\n *\\n * requirements:\\n *\\n * - the caller must be the pool migrator contract\\n */\\n function migratePoolIn(Token pool, Pool calldata data) external;\\n\\n /**\\n * @dev migrates a pool from this pool collection\\n *\\n * requirements:\\n *\\n * - the caller must be the pool migrator contract\\n */\\n function migratePoolOut(Token pool, IPoolCollection targetPoolCollection) external;\\n}\\n\",\"keccak256\":\"0x503bc144b6c43bef3d1f3cae44c59e57a02e7e1f834f2bc0ac8efaebeb59d827\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/pools/interfaces/IPoolMigrator.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { Token } from \\\"../../token/Token.sol\\\";\\n\\nimport { IVersioned } from \\\"../../utility/interfaces/IVersioned.sol\\\";\\n\\nimport { IPoolCollection } from \\\"./IPoolCollection.sol\\\";\\n\\n/**\\n * @dev Pool Migrator interface\\n */\\ninterface IPoolMigrator is IVersioned {\\n /**\\n * @dev migrates a pool and returns the new pool collection it exists in\\n *\\n * notes:\\n *\\n * - invalid or incompatible pools will be skipped gracefully\\n *\\n * requirements:\\n *\\n * - the caller must be the network contract\\n */\\n function migratePool(Token pool, IPoolCollection newPoolCollection) external;\\n}\\n\",\"keccak256\":\"0x3dde1a08987c3d1a79bf10746c772ea68d1daa69b165b638dfdfeb6bfb269102\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/pools/interfaces/IPoolToken.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport { IERC20Permit } from \\\"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\\\";\\n\\nimport { IERC20Burnable } from \\\"../../token/interfaces/IERC20Burnable.sol\\\";\\nimport { Token } from \\\"../../token/Token.sol\\\";\\n\\nimport { IVersioned } from \\\"../../utility/interfaces/IVersioned.sol\\\";\\nimport { IOwned } from \\\"../../utility/interfaces/IOwned.sol\\\";\\n\\n/**\\n * @dev Pool Token interface\\n */\\ninterface IPoolToken is IVersioned, IOwned, IERC20, IERC20Permit, IERC20Burnable {\\n /**\\n * @dev returns the address of the reserve token\\n */\\n function reserveToken() external view returns (Token);\\n\\n /**\\n * @dev increases the token supply and sends the new tokens to the given account\\n *\\n * requirements:\\n *\\n * - the caller must be the owner of the contract\\n */\\n function mint(address recipient, uint256 amount) external;\\n}\\n\",\"keccak256\":\"0x698423b0fc59424e60d5effe3b79b8aeb5d478b04e5569e3a4ba5fe6936fb2b7\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/token/SafeERC20Ex.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport { SafeERC20 } from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\n\\n/**\\n * @dev extends the SafeERC20 library with additional operations\\n */\\nlibrary SafeERC20Ex {\\n using SafeERC20 for IERC20;\\n\\n /**\\n * @dev ensures that the spender has sufficient allowance\\n */\\n function ensureApprove(IERC20 token, address spender, uint256 amount) internal {\\n if (amount == 0) {\\n return;\\n }\\n\\n uint256 allowance = token.allowance(address(this), spender);\\n if (allowance >= amount) {\\n return;\\n }\\n\\n if (allowance > 0) {\\n token.safeApprove(spender, 0);\\n }\\n token.safeApprove(spender, amount);\\n }\\n}\\n\",\"keccak256\":\"0x8976816df06d18659fd6c95611aa32aa48ca2d1d4f64e63235bf5c9802bf85bf\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/token/Token.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\n/**\\n * @dev the main purpose of the Token interfaces is to ensure artificially that we won't use ERC20's standard functions,\\n * but only their safe versions, which are provided by SafeERC20 and SafeERC20Ex via the TokenLibrary contract\\n */\\ninterface Token {\\n\\n}\\n\",\"keccak256\":\"0x49d0e5ac0dab272f4001a63e7f4117eb13b42c655ee788c42a333f56f19ac2e9\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/token/TokenLibrary.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport { ERC20 } from \\\"@openzeppelin/contracts/token/ERC20/ERC20.sol\\\";\\nimport { SafeERC20 } from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\nimport { IERC20Permit } from \\\"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\\\";\\n\\nimport { SafeERC20Ex } from \\\"./SafeERC20Ex.sol\\\";\\n\\nimport { Token } from \\\"./Token.sol\\\";\\n\\n/**\\n * @dev This library implements ERC20 and SafeERC20 utilities for both the native token and for ERC20 tokens\\n */\\nlibrary TokenLibrary {\\n using SafeERC20 for IERC20;\\n using SafeERC20Ex for IERC20;\\n\\n error PermitUnsupported();\\n\\n // the address that represents the native token reserve\\n address private constant NATIVE_TOKEN_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\\n\\n // the symbol that represents the native token\\n string private constant NATIVE_TOKEN_SYMBOL = \\\"ETH\\\";\\n\\n // the decimals for the native token\\n uint8 private constant NATIVE_TOKEN_DECIMALS = 18;\\n\\n // the token representing the native token\\n Token public constant NATIVE_TOKEN = Token(NATIVE_TOKEN_ADDRESS);\\n\\n /**\\n * @dev returns whether the provided token represents an ERC20 or the native token reserve\\n */\\n function isNative(Token token) internal pure returns (bool) {\\n return address(token) == NATIVE_TOKEN_ADDRESS;\\n }\\n\\n /**\\n * @dev returns the symbol of the native token/ERC20 token\\n */\\n function symbol(Token token) internal view returns (string memory) {\\n if (isNative(token)) {\\n return NATIVE_TOKEN_SYMBOL;\\n }\\n\\n return toERC20(token).symbol();\\n }\\n\\n /**\\n * @dev returns the decimals of the native token/ERC20 token\\n */\\n function decimals(Token token) internal view returns (uint8) {\\n if (isNative(token)) {\\n return NATIVE_TOKEN_DECIMALS;\\n }\\n\\n return toERC20(token).decimals();\\n }\\n\\n /**\\n * @dev returns the balance of the native token/ERC20 token\\n */\\n function balanceOf(Token token, address account) internal view returns (uint256) {\\n if (isNative(token)) {\\n return account.balance;\\n }\\n\\n return toIERC20(token).balanceOf(account);\\n }\\n\\n /**\\n * @dev transfers a specific amount of the native token/ERC20 token\\n */\\n function safeTransfer(Token token, address to, uint256 amount) internal {\\n if (amount == 0) {\\n return;\\n }\\n\\n if (isNative(token)) {\\n payable(to).transfer(amount);\\n } else {\\n toIERC20(token).safeTransfer(to, amount);\\n }\\n }\\n\\n /**\\n * @dev transfers a specific amount of the native token/ERC20 token from a specific holder using the allowance mechanism\\n *\\n * note that the function does not perform any action if the native token is provided\\n */\\n function safeTransferFrom(Token token, address from, address to, uint256 amount) internal {\\n if (amount == 0 || isNative(token)) {\\n return;\\n }\\n\\n toIERC20(token).safeTransferFrom(from, to, amount);\\n }\\n\\n /**\\n * @dev approves a specific amount of the native token/ERC20 token from a specific holder\\n *\\n * note that the function does not perform any action if the native token is provided\\n */\\n function safeApprove(Token token, address spender, uint256 amount) internal {\\n if (isNative(token)) {\\n return;\\n }\\n\\n toIERC20(token).safeApprove(spender, amount);\\n }\\n\\n /**\\n * @dev increases allowance of the native token/ERC20 token from a specific holder\\n *\\n * note that the function does not perform any action if the native token is provided\\n */\\n function safeIncreaseAllowance(Token token, address spender, uint256 amount) internal {\\n if (isNative(token)) {\\n return;\\n }\\n\\n toIERC20(token).safeIncreaseAllowance(spender, amount);\\n }\\n\\n /**\\n * @dev ensures that the spender has sufficient allowance\\n *\\n * note that the function does not perform any action if the native token is provided\\n */\\n function ensureApprove(Token token, address spender, uint256 amount) internal {\\n if (isNative(token)) {\\n return;\\n }\\n\\n toIERC20(token).ensureApprove(spender, amount);\\n }\\n\\n /**\\n * @dev compares between a token and another raw ERC20 token\\n */\\n function isEqual(Token token, IERC20 erc20Token) internal pure returns (bool) {\\n return toIERC20(token) == erc20Token;\\n }\\n\\n /**\\n * @dev utility function that converts a token to an IERC20\\n */\\n function toIERC20(Token token) internal pure returns (IERC20) {\\n return IERC20(address(token));\\n }\\n\\n /**\\n * @dev utility function that converts a token to an ERC20\\n */\\n function toERC20(Token token) internal pure returns (ERC20) {\\n return ERC20(address(token));\\n }\\n}\\n\",\"keccak256\":\"0x6b55383a12ebbdf82814f216b9750b2d1d684a131d50f8158919ec0ad6d903e6\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/token/interfaces/IERC20Burnable.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\n/**\\n * @dev burnable ERC20 interface\\n */\\ninterface IERC20Burnable {\\n /**\\n * @dev Destroys tokens from the caller.\\n */\\n function burn(uint256 amount) external;\\n\\n /**\\n * @dev Destroys tokens from a recipient, deducting from the caller's allowance\\n *\\n * requirements:\\n *\\n * - the caller must have allowance for recipient's tokens of at least the specified amount\\n */\\n function burnFrom(address recipient, uint256 amount) external;\\n}\\n\",\"keccak256\":\"0x222a3ba8286edf54d3e75a70683ffcbe6eb3c5ba5f6b3c6a6d98a716e9bd5332\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/utility/Constants.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nuint32 constant PPM_RESOLUTION = 1_000_000;\\n\",\"keccak256\":\"0x5215535db0a4e580cd19380cc1cf3a2b7edcbb8ee039e416319fe9f8867724ad\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/utility/Fraction.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nstruct Fraction {\\n uint256 n;\\n uint256 d;\\n}\\n\\nstruct Fraction112 {\\n uint112 n;\\n uint112 d;\\n}\\n\\nerror InvalidFraction();\\n\",\"keccak256\":\"0xb965a448e314353c82bc9fb7c0552057427a90100ebda4450b21fc932356a4d1\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/utility/FractionLibrary.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { Fraction, Fraction112, InvalidFraction } from \\\"./Fraction.sol\\\";\\nimport { MathEx } from \\\"./MathEx.sol\\\";\\n\\n// solhint-disable-next-line func-visibility\\nfunction zeroFraction() pure returns (Fraction memory) {\\n return Fraction({ n: 0, d: 1 });\\n}\\n\\n// solhint-disable-next-line func-visibility\\nfunction zeroFraction112() pure returns (Fraction112 memory) {\\n return Fraction112({ n: 0, d: 1 });\\n}\\n\\n/**\\n * @dev this library provides a set of fraction operations\\n */\\nlibrary FractionLibrary {\\n /**\\n * @dev returns whether a standard fraction is valid\\n */\\n function isValid(Fraction memory fraction) internal pure returns (bool) {\\n return fraction.d != 0;\\n }\\n\\n /**\\n * @dev returns whether a 112-bit fraction is valid\\n */\\n function isValid(Fraction112 memory fraction) internal pure returns (bool) {\\n return fraction.d != 0;\\n }\\n\\n /**\\n * @dev returns whether a standard fraction is positive\\n */\\n function isPositive(Fraction memory fraction) internal pure returns (bool) {\\n return isValid(fraction) && fraction.n != 0;\\n }\\n\\n /**\\n * @dev returns whether a 112-bit fraction is positive\\n */\\n function isPositive(Fraction112 memory fraction) internal pure returns (bool) {\\n return isValid(fraction) && fraction.n != 0;\\n }\\n\\n /**\\n * @dev returns the inverse of a given fraction\\n */\\n function inverse(Fraction memory fraction) internal pure returns (Fraction memory) {\\n Fraction memory invFraction = Fraction({ n: fraction.d, d: fraction.n });\\n\\n if (!isValid(invFraction)) {\\n revert InvalidFraction();\\n }\\n\\n return invFraction;\\n }\\n\\n /**\\n * @dev returns the inverse of a given fraction\\n */\\n function inverse(Fraction112 memory fraction) internal pure returns (Fraction112 memory) {\\n Fraction112 memory invFraction = Fraction112({ n: fraction.d, d: fraction.n });\\n\\n if (!isValid(invFraction)) {\\n revert InvalidFraction();\\n }\\n\\n return invFraction;\\n }\\n\\n /**\\n * @dev reduces a standard fraction to a 112-bit fraction\\n */\\n function toFraction112(Fraction memory fraction) internal pure returns (Fraction112 memory) {\\n Fraction memory truncatedFraction = MathEx.truncatedFraction(fraction, type(uint112).max);\\n\\n return Fraction112({ n: uint112(truncatedFraction.n), d: uint112(truncatedFraction.d) });\\n }\\n\\n /**\\n * @dev expands a 112-bit fraction to a standard fraction\\n */\\n function fromFraction112(Fraction112 memory fraction) internal pure returns (Fraction memory) {\\n return Fraction({ n: fraction.n, d: fraction.d });\\n }\\n}\\n\",\"keccak256\":\"0x480325242afb487705c5e7fafb3a1268ec1ac118ca99c7a52da3577e16a53606\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/utility/MathEx.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { Math } from \\\"@openzeppelin/contracts/utils/math/Math.sol\\\";\\nimport { Fraction, InvalidFraction } from \\\"./Fraction.sol\\\";\\n\\nimport { PPM_RESOLUTION } from \\\"./Constants.sol\\\";\\n\\nuint256 constant ONE = 0x80000000000000000000000000000000;\\nuint256 constant LN2 = 0x58b90bfbe8e7bcd5e4f1d9cc01f97b57;\\n\\nstruct Uint512 {\\n uint256 hi; // 256 most significant bits\\n uint256 lo; // 256 least significant bits\\n}\\n\\nstruct Sint256 {\\n uint256 value;\\n bool isNeg;\\n}\\n\\n/**\\n * @dev this library provides a set of complex math operations\\n */\\nlibrary MathEx {\\n error Overflow();\\n\\n /**\\n * @dev returns `2 ^ f` by calculating `e ^ (f * ln(2))`, where `e` is Euler's number:\\n * - Rewrite the input as a sum of binary exponents and a single residual r, as small as possible\\n * - The exponentiation of each binary exponent is given (pre-calculated)\\n * - The exponentiation of r is calculated via Taylor series for e^x, where x = r\\n * - The exponentiation of the input is calculated by multiplying the intermediate results above\\n * - For example: e^5.521692859 = e^(4 + 1 + 0.5 + 0.021692859) = e^4 * e^1 * e^0.5 * e^0.021692859\\n */\\n function exp2(Fraction memory f) internal pure returns (Fraction memory) {\\n uint256 x = MathEx.mulDivF(LN2, f.n, f.d);\\n uint256 y;\\n uint256 z;\\n uint256 n;\\n\\n if (x >= (ONE << 4)) {\\n revert Overflow();\\n }\\n\\n unchecked {\\n z = y = x % (ONE >> 3); // get the input modulo 2^(-3)\\n z = (z * y) / ONE;\\n n += z * 0x10e1b3be415a0000; // add y^02 * (20! / 02!)\\n z = (z * y) / ONE;\\n n += z * 0x05a0913f6b1e0000; // add y^03 * (20! / 03!)\\n z = (z * y) / ONE;\\n n += z * 0x0168244fdac78000; // add y^04 * (20! / 04!)\\n z = (z * y) / ONE;\\n n += z * 0x004807432bc18000; // add y^05 * (20! / 05!)\\n z = (z * y) / ONE;\\n n += z * 0x000c0135dca04000; // add y^06 * (20! / 06!)\\n z = (z * y) / ONE;\\n n += z * 0x0001b707b1cdc000; // add y^07 * (20! / 07!)\\n z = (z * y) / ONE;\\n n += z * 0x000036e0f639b800; // add y^08 * (20! / 08!)\\n z = (z * y) / ONE;\\n n += z * 0x00000618fee9f800; // add y^09 * (20! / 09!)\\n z = (z * y) / ONE;\\n n += z * 0x0000009c197dcc00; // add y^10 * (20! / 10!)\\n z = (z * y) / ONE;\\n n += z * 0x0000000e30dce400; // add y^11 * (20! / 11!)\\n z = (z * y) / ONE;\\n n += z * 0x000000012ebd1300; // add y^12 * (20! / 12!)\\n z = (z * y) / ONE;\\n n += z * 0x0000000017499f00; // add y^13 * (20! / 13!)\\n z = (z * y) / ONE;\\n n += z * 0x0000000001a9d480; // add y^14 * (20! / 14!)\\n z = (z * y) / ONE;\\n n += z * 0x00000000001c6380; // add y^15 * (20! / 15!)\\n z = (z * y) / ONE;\\n n += z * 0x000000000001c638; // add y^16 * (20! / 16!)\\n z = (z * y) / ONE;\\n n += z * 0x0000000000001ab8; // add y^17 * (20! / 17!)\\n z = (z * y) / ONE;\\n n += z * 0x000000000000017c; // add y^18 * (20! / 18!)\\n z = (z * y) / ONE;\\n n += z * 0x0000000000000014; // add y^19 * (20! / 19!)\\n z = (z * y) / ONE;\\n n += z * 0x0000000000000001; // add y^20 * (20! / 20!)\\n n = n / 0x21c3677c82b40000 + y + ONE; // divide by 20! and then add y^1 / 1! + y^0 / 0!\\n\\n if ((x & (ONE >> 3)) != 0)\\n n = (n * 0x1c3d6a24ed82218787d624d3e5eba95f9) / 0x18ebef9eac820ae8682b9793ac6d1e776; // multiply by e^(2^-3)\\n if ((x & (ONE >> 2)) != 0)\\n n = (n * 0x18ebef9eac820ae8682b9793ac6d1e778) / 0x1368b2fc6f9609fe7aceb46aa619baed4; // multiply by e^(2^-2)\\n if ((x & (ONE >> 1)) != 0)\\n n = (n * 0x1368b2fc6f9609fe7aceb46aa619baed5) / 0x0bc5ab1b16779be3575bd8f0520a9f21f; // multiply by e^(2^-1)\\n if ((x & (ONE << 0)) != 0)\\n n = (n * 0x0bc5ab1b16779be3575bd8f0520a9f21e) / 0x0454aaa8efe072e7f6ddbab84b40a55c9; // multiply by e^(2^+0)\\n if ((x & (ONE << 1)) != 0)\\n n = (n * 0x0454aaa8efe072e7f6ddbab84b40a55c5) / 0x00960aadc109e7a3bf4578099615711ea; // multiply by e^(2^+1)\\n if ((x & (ONE << 2)) != 0)\\n n = (n * 0x00960aadc109e7a3bf4578099615711d7) / 0x0002bf84208204f5977f9a8cf01fdce3d; // multiply by e^(2^+2)\\n if ((x & (ONE << 3)) != 0)\\n n = (n * 0x0002bf84208204f5977f9a8cf01fdc307) / 0x0000003c6ab775dd0b95b4cbee7e65d11; // multiply by e^(2^+3)\\n }\\n\\n return Fraction({ n: n, d: ONE });\\n }\\n\\n /**\\n * @dev returns a fraction with truncated components\\n * note that since the input value is truncated, the use of the method incurs precision loss\\n */\\n function truncatedFraction(Fraction memory fraction, uint256 max) internal pure returns (Fraction memory) {\\n uint256 scale = Math.ceilDiv(Math.max(fraction.n, fraction.d), max);\\n Fraction memory truncated = Fraction({ n: fraction.n / scale, d: fraction.d / scale });\\n if (truncated.d == 0) {\\n revert InvalidFraction();\\n }\\n\\n return truncated;\\n }\\n\\n /**\\n * @dev returns the weighted average of two fractions\\n */\\n function weightedAverage(\\n Fraction memory fraction1,\\n Fraction memory fraction2,\\n uint256 weight1,\\n uint256 weight2\\n ) internal pure returns (Fraction memory) {\\n return\\n Fraction({\\n n: fraction1.n * fraction2.d * weight1 + fraction1.d * fraction2.n * weight2,\\n d: fraction1.d * fraction2.d * (weight1 + weight2)\\n });\\n }\\n\\n /**\\n * @dev returns whether or not the deviation of an offset sample from a base sample is within a permitted range\\n * for example, if the maximum permitted deviation is 5%, then evaluate `95% * base <= offset <= 105% * base`\\n */\\n function isInRange(\\n Fraction memory baseSample,\\n Fraction memory offsetSample,\\n uint32 maxDeviationPPM\\n ) internal pure returns (bool) {\\n Uint512 memory min = mul512(baseSample.n, offsetSample.d * (PPM_RESOLUTION - maxDeviationPPM));\\n Uint512 memory mid = mul512(baseSample.d, offsetSample.n * PPM_RESOLUTION);\\n Uint512 memory max = mul512(baseSample.n, offsetSample.d * (PPM_RESOLUTION + maxDeviationPPM));\\n return lte512(min, mid) && lte512(mid, max);\\n }\\n\\n /**\\n * @dev returns an `Sint256` positive representation of an unsigned integer\\n */\\n function toPos256(uint256 n) internal pure returns (Sint256 memory) {\\n return Sint256({ value: n, isNeg: false });\\n }\\n\\n /**\\n * @dev returns an `Sint256` negative representation of an unsigned integer\\n */\\n function toNeg256(uint256 n) internal pure returns (Sint256 memory) {\\n return Sint256({ value: n, isNeg: true });\\n }\\n\\n /**\\n * @dev returns the largest integer smaller than or equal to `x * y / z`\\n */\\n function mulDivF(uint256 x, uint256 y, uint256 z) internal pure returns (uint256) {\\n Uint512 memory xy = mul512(x, y);\\n\\n // if `x * y < 2 ^ 256`\\n if (xy.hi == 0) {\\n return xy.lo / z;\\n }\\n\\n // assert `x * y / z < 2 ^ 256`\\n if (xy.hi >= z) {\\n revert Overflow();\\n }\\n\\n uint256 m = _mulMod(x, y, z); // `m = x * y % z`\\n Uint512 memory n = _sub512(xy, m); // `n = x * y - m` hence `n / z = floor(x * y / z)`\\n\\n // if `n < 2 ^ 256`\\n if (n.hi == 0) {\\n return n.lo / z;\\n }\\n\\n uint256 p = _unsafeSub(0, z) & z; // `p` is the largest power of 2 which `z` is divisible by\\n uint256 q = _div512(n, p); // `n` is divisible by `p` because `n` is divisible by `z` and `z` is divisible by `p`\\n uint256 r = _inv256(z / p); // `z / p = 1 mod 2` hence `inverse(z / p) = 1 mod 2 ^ 256`\\n return _unsafeMul(q, r); // `q * r = (n / p) * inverse(z / p) = n / z`\\n }\\n\\n /**\\n * @dev returns the smallest integer larger than or equal to `x * y / z`\\n */\\n function mulDivC(uint256 x, uint256 y, uint256 z) internal pure returns (uint256) {\\n uint256 w = mulDivF(x, y, z);\\n if (_mulMod(x, y, z) > 0) {\\n if (w >= type(uint256).max) {\\n revert Overflow();\\n }\\n\\n return w + 1;\\n }\\n return w;\\n }\\n\\n /**\\n * @dev returns the maximum of `n1 - n2` and 0\\n */\\n function subMax0(uint256 n1, uint256 n2) internal pure returns (uint256) {\\n return n1 > n2 ? n1 - n2 : 0;\\n }\\n\\n /**\\n * @dev returns the value of `x > y`\\n */\\n function gt512(Uint512 memory x, Uint512 memory y) internal pure returns (bool) {\\n return x.hi > y.hi || (x.hi == y.hi && x.lo > y.lo);\\n }\\n\\n /**\\n * @dev returns the value of `x < y`\\n */\\n function lt512(Uint512 memory x, Uint512 memory y) internal pure returns (bool) {\\n return x.hi < y.hi || (x.hi == y.hi && x.lo < y.lo);\\n }\\n\\n /**\\n * @dev returns the value of `x >= y`\\n */\\n function gte512(Uint512 memory x, Uint512 memory y) internal pure returns (bool) {\\n return !lt512(x, y);\\n }\\n\\n /**\\n * @dev returns the value of `x <= y`\\n */\\n function lte512(Uint512 memory x, Uint512 memory y) internal pure returns (bool) {\\n return !gt512(x, y);\\n }\\n\\n /**\\n * @dev returns the value of `x * y`\\n */\\n function mul512(uint256 x, uint256 y) internal pure returns (Uint512 memory) {\\n uint256 p = _mulModMax(x, y);\\n uint256 q = _unsafeMul(x, y);\\n if (p >= q) {\\n return Uint512({ hi: p - q, lo: q });\\n }\\n return Uint512({ hi: _unsafeSub(p, q) - 1, lo: q });\\n }\\n\\n /**\\n * @dev returns the value of `x - y`, given that `x >= y`\\n */\\n function _sub512(Uint512 memory x, uint256 y) private pure returns (Uint512 memory) {\\n if (x.lo >= y) {\\n return Uint512({ hi: x.hi, lo: x.lo - y });\\n }\\n return Uint512({ hi: x.hi - 1, lo: _unsafeSub(x.lo, y) });\\n }\\n\\n /**\\n * @dev returns the value of `x / pow2n`, given that `x` is divisible by `pow2n`\\n */\\n function _div512(Uint512 memory x, uint256 pow2n) private pure returns (uint256) {\\n uint256 pow2nInv = _unsafeAdd(_unsafeSub(0, pow2n) / pow2n, 1); // `1 << (256 - n)`\\n return _unsafeMul(x.hi, pow2nInv) | (x.lo / pow2n); // `(x.hi << (256 - n)) | (x.lo >> n)`\\n }\\n\\n /**\\n * @dev returns the inverse of `d` modulo `2 ^ 256`, given that `d` is congruent to `1` modulo `2`\\n */\\n function _inv256(uint256 d) private pure returns (uint256) {\\n // approximate the root of `f(x) = 1 / x - d` using the newton\\u2013raphson convergence method\\n uint256 x = 1;\\n for (uint256 i = 0; i < 8; i++) {\\n x = _unsafeMul(x, _unsafeSub(2, _unsafeMul(x, d))); // `x = x * (2 - x * d) mod 2 ^ 256`\\n }\\n return x;\\n }\\n\\n /**\\n * @dev returns `(x + y) % 2 ^ 256`\\n */\\n function _unsafeAdd(uint256 x, uint256 y) private pure returns (uint256) {\\n unchecked {\\n return x + y;\\n }\\n }\\n\\n /**\\n * @dev returns `(x - y) % 2 ^ 256`\\n */\\n function _unsafeSub(uint256 x, uint256 y) private pure returns (uint256) {\\n unchecked {\\n return x - y;\\n }\\n }\\n\\n /**\\n * @dev returns `(x * y) % 2 ^ 256`\\n */\\n function _unsafeMul(uint256 x, uint256 y) private pure returns (uint256) {\\n unchecked {\\n return x * y;\\n }\\n }\\n\\n /**\\n * @dev returns `x * y % (2 ^ 256 - 1)`\\n */\\n function _mulModMax(uint256 x, uint256 y) private pure returns (uint256) {\\n return mulmod(x, y, type(uint256).max);\\n }\\n\\n /**\\n * @dev returns `x * y % z`\\n */\\n function _mulMod(uint256 x, uint256 y, uint256 z) private pure returns (uint256) {\\n return mulmod(x, y, z);\\n }\\n}\\n\",\"keccak256\":\"0xabe13aa0b2ffde5e2c234a00f97656216a4cc818c85a3f4adbb09a702d2c7fa5\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/utility/Time.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\n/**\\n * @dev this contract abstracts the block timestamp in order to allow for more flexible control in tests\\n */\\nabstract contract Time {\\n /**\\n * @dev returns the current time\\n */\\n function _time() internal view virtual returns (uint32) {\\n return uint32(block.timestamp);\\n }\\n}\\n\",\"keccak256\":\"0x9d1b2e564c5c980eeab286a14d39872b41b23b7adfba8df5d89f906d5a2e58ad\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/utility/Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { AccessControlEnumerableUpgradeable } from \\\"@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol\\\";\\n\\nimport { IUpgradeable } from \\\"./interfaces/IUpgradeable.sol\\\";\\n\\nimport { AccessDenied } from \\\"./Utils.sol\\\";\\n\\n/**\\n * @dev this contract provides common utilities for upgradeable contracts\\n *\\n * note that we're using the Transparent Upgradeable Proxy pattern and *not* the Universal Upgradeable Proxy Standard\\n * (UUPS) pattern, therefore initializing the implementation contracts is not necessary or required\\n */\\nabstract contract Upgradeable is IUpgradeable, AccessControlEnumerableUpgradeable {\\n error AlreadyInitialized();\\n\\n // the admin role is used to allow a non-proxy admin to perform additional initialization/setup during contract\\n // upgrades\\n bytes32 internal constant ROLE_ADMIN = keccak256(\\\"ROLE_ADMIN\\\");\\n\\n uint32 internal constant MAX_GAP = 50;\\n\\n uint16 internal _initializations;\\n\\n // upgrade forward-compatibility storage gap\\n uint256[MAX_GAP - 1] private __gap;\\n\\n // solhint-disable func-name-mixedcase\\n\\n /**\\n * @dev initializes the contract and its parents\\n */\\n function __Upgradeable_init() internal onlyInitializing {\\n __AccessControl_init();\\n\\n __Upgradeable_init_unchained();\\n }\\n\\n /**\\n * @dev performs contract-specific initialization\\n */\\n function __Upgradeable_init_unchained() internal onlyInitializing {\\n _initializations = 1;\\n\\n // set up administrative roles\\n _setRoleAdmin(ROLE_ADMIN, ROLE_ADMIN);\\n\\n // allow the deployer to initially be the admin of the contract\\n _setupRole(ROLE_ADMIN, msg.sender);\\n }\\n\\n // solhint-enable func-name-mixedcase\\n\\n modifier onlyAdmin() {\\n _hasRole(ROLE_ADMIN, msg.sender);\\n\\n _;\\n }\\n\\n modifier onlyRoleMember(bytes32 role) {\\n _hasRole(role, msg.sender);\\n\\n _;\\n }\\n\\n function version() public view virtual override returns (uint16);\\n\\n /**\\n * @dev returns the admin role\\n */\\n function roleAdmin() external pure returns (bytes32) {\\n return ROLE_ADMIN;\\n }\\n\\n /**\\n * @dev performs post-upgrade initialization\\n *\\n * requirements:\\n *\\n * - this must can be called only once per-upgrade\\n */\\n function postUpgrade(bytes calldata data) external {\\n uint16 initializations = _initializations + 1;\\n\\n if (initializations != version()) {\\n revert AlreadyInitialized();\\n }\\n\\n _initializations = initializations;\\n\\n _postUpgrade(data);\\n }\\n\\n /**\\n * @dev an optional post-upgrade callback that can be implemented by child contracts\\n */\\n function _postUpgrade(bytes calldata /* data */) internal virtual {}\\n\\n function _hasRole(bytes32 role, address account) internal view {\\n if (!hasRole(role, account)) {\\n revert AccessDenied();\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3a7fc26c8bcb7332218193111fc775e4aa19af2f5c81b5826f8075490bd3cf48\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/utility/Utils.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { PPM_RESOLUTION } from \\\"./Constants.sol\\\";\\n\\nerror AccessDenied();\\nerror AlreadyExists();\\nerror DoesNotExist();\\nerror InvalidAddress();\\nerror InvalidExternalAddress();\\nerror InvalidFee();\\nerror InvalidPool();\\nerror InvalidPoolCollection();\\nerror InvalidStakedBalance();\\nerror InvalidToken();\\nerror InvalidParam();\\nerror NotEmpty();\\nerror NotPayable();\\nerror ZeroValue();\\n\\n/**\\n * @dev common utilities\\n */\\nabstract contract Utils {\\n // allows execution by the caller only\\n modifier only(address caller) {\\n _only(caller);\\n\\n _;\\n }\\n\\n function _only(address caller) internal view {\\n if (msg.sender != caller) {\\n revert AccessDenied();\\n }\\n }\\n\\n // verifies that a value is greater than zero\\n modifier greaterThanZero(uint256 value) {\\n _greaterThanZero(value);\\n\\n _;\\n }\\n\\n // error message binary size optimization\\n function _greaterThanZero(uint256 value) internal pure {\\n if (value == 0) {\\n revert ZeroValue();\\n }\\n }\\n\\n // validates an address - currently only checks that it isn't null\\n modifier validAddress(address addr) {\\n _validAddress(addr);\\n\\n _;\\n }\\n\\n // error message binary size optimization\\n function _validAddress(address addr) internal pure {\\n if (addr == address(0)) {\\n revert InvalidAddress();\\n }\\n }\\n\\n // validates an external address - currently only checks that it isn't null or this\\n modifier validExternalAddress(address addr) {\\n _validExternalAddress(addr);\\n\\n _;\\n }\\n\\n // error message binary size optimization\\n function _validExternalAddress(address addr) internal view {\\n if (addr == address(0) || addr == address(this)) {\\n revert InvalidExternalAddress();\\n }\\n }\\n\\n // ensures that the fee is valid\\n modifier validFee(uint32 fee) {\\n _validFee(fee);\\n\\n _;\\n }\\n\\n // error message binary size optimization\\n function _validFee(uint32 fee) internal pure {\\n if (fee > PPM_RESOLUTION) {\\n revert InvalidFee();\\n }\\n }\\n}\\n\",\"keccak256\":\"0x62b8b81d3069467eb6402b8f61adcc24f5b2e310db1a2ee64d719229306ab823\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/utility/interfaces/IOwned.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\n/**\\n * @dev Owned interface\\n */\\ninterface IOwned {\\n /**\\n * @dev returns the address of the current owner\\n */\\n function owner() external view returns (address);\\n\\n /**\\n * @dev allows transferring the contract ownership\\n *\\n * requirements:\\n *\\n * - the caller must be the owner of the contract\\n * - the new owner still needs to accept the transfer\\n */\\n function transferOwnership(address ownerCandidate) external;\\n\\n /**\\n * @dev used by a new owner to accept an ownership transfer\\n */\\n function acceptOwnership() external;\\n}\\n\",\"keccak256\":\"0xe6141c9a7cb5853352f35dc83e9504e2c552feadac7c70dd1e029c1b4368b6bb\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/utility/interfaces/IUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { IVersioned } from \\\"./IVersioned.sol\\\";\\n\\nimport { IAccessControlEnumerableUpgradeable } from \\\"@openzeppelin/contracts-upgradeable/access/IAccessControlEnumerableUpgradeable.sol\\\";\\n\\n/**\\n * @dev this is the common interface for upgradeable contracts\\n */\\ninterface IUpgradeable is IAccessControlEnumerableUpgradeable, IVersioned {\\n\\n}\\n\",\"keccak256\":\"0x6019e5e9c706cc023b96313932f5aa7fc3734f446fd0936a2c6530d0d25330da\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/utility/interfaces/IVersioned.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\n/**\\n * @dev an interface for a versioned contract\\n */\\ninterface IVersioned {\\n function version() external view returns (uint16);\\n}\\n\",\"keccak256\":\"0x1969c895e9adc0bc8a85e975517d2f2b9357e0c9011f159d01b90f7d1a464d76\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/vaults/interfaces/IExternalProtectionVault.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { IVault } from \\\"./IVault.sol\\\";\\n\\ninterface IExternalProtectionVault is IVault {}\\n\",\"keccak256\":\"0x0ae5812ccd4166ba2df080b90df2ec128806a237d3ce9359ca6bb23025d63d85\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/vaults/interfaces/IMasterVault.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { IVault } from \\\"./IVault.sol\\\";\\n\\ninterface IMasterVault is IVault {}\\n\",\"keccak256\":\"0x875a0f6792439d100fade7ffb778a34d8eac7ededb43b65d0160281d3d5a83f0\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/vaults/interfaces/IVault.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { IUpgradeable } from \\\"../../utility/interfaces/IUpgradeable.sol\\\";\\n\\nimport { Token } from \\\"../../token/Token.sol\\\";\\n\\n// the asset manager role is required to access all the funds\\nbytes32 constant ROLE_ASSET_MANAGER = keccak256(\\\"ROLE_ASSET_MANAGER\\\");\\n\\ninterface IVault is IUpgradeable {\\n /**\\n * @dev triggered when tokens have been withdrawn from the vault\\n */\\n event FundsWithdrawn(Token indexed token, address indexed caller, address indexed target, uint256 amount);\\n\\n /**\\n * @dev triggered when tokens have been burned from the vault\\n */\\n event FundsBurned(Token indexed token, address indexed caller, uint256 amount);\\n\\n /**\\n * @dev tells whether the vault accepts native token deposits\\n */\\n function isPayable() external view returns (bool);\\n\\n /**\\n * @dev withdraws funds held by the contract and sends them to an account\\n */\\n function withdrawFunds(\\n Token token,\\n address payable target,\\n uint256 amount\\n ) external;\\n\\n /**\\n * @dev burns funds held by the contract\\n */\\n function burn(Token token, uint256 amount) external;\\n}\\n\",\"keccak256\":\"0x1ac16bcccd209b3a73c00144df2b5c53fbd328434277e72457063c26645872d5\",\"license\":\"SEE LICENSE IN LICENSE\"}},\"version\":1}", - "bytecode": "0x6101a0604052610169805460ff191660011790553480156200002057600080fd5b5060405162005b4138038062005b41833981016040819052620000439162000200565b866200004f81620001bf565b866200005b81620001bf565b866200006781620001bf565b866200007381620001bf565b866200007f81620001bf565b866200008b81620001bf565b866200009781620001bf565b6001600160a01b038e1660a081905260408051637e062a3560e11b8152905163fc0c546a916004808201926020929091908290030181865afa158015620000e2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001089190620002ab565b6001600160a01b039081166080528d1660e081905260408051637e062a3560e11b8152905163fc0c546a916004808201926020929091908290030181865afa15801562000159573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200017f9190620002ab565b6001600160a01b0390811660c0529b8c166101005250505050958716610120525050918416610140528316610160529091166101805250620002d2915050565b6001600160a01b038116620001e75760405163e6c4247b60e01b815260040160405180910390fd5b50565b6001600160a01b0381168114620001e757600080fd5b600080600080600080600060e0888a0312156200021c57600080fd5b87516200022981620001ea565b60208901519097506200023c81620001ea565b60408901519096506200024f81620001ea565b60608901519095506200026281620001ea565b60808901519094506200027581620001ea565b60a08901519093506200028881620001ea565b60c08901519092506200029b81620001ea565b8091505092959891949750929550565b600060208284031215620002be57600080fd5b8151620002cb81620001ea565b9392505050565b60805160a05160c05160e0516101005161012051610140516101605161018051615755620003ec6000396000818161170201528181611e8501528181612029015281816130820152613794015260008181610ad80152612ac00152600081816123e60152612693015260008181610dd4015281816118010152818161195c01528181611996015281816123570152818161260401528181613c3701528181613cb101526140bf01526000818161166b0152611755015260005050600061276b01526000505060008181610e0101528181610fa201528181611616015281816119c501528181612d7501528181612f11015281816131d401528181613e6401528181613f39015281816145b601526145f301526157556000f3fe60806040526004361061024a5760003560e01c80637bf6a42511610139578063b3db428b116100b6578063d0d145811161007a578063d0d14581146106c3578063d3a4acd3146106d6578063d547741f146106e9578063d6efd7c314610709578063d895feee1461071e578063e6aac07e1461073157600080fd5b8063b3db428b1461061d578063c0c53b8b14610630578063c109ba1314610650578063c844748714610670578063ca15c873146106a357600080fd5b806393867fb5116100fd57806393867fb51461056d5780639bca0e701461058e578063a217fddf146105c8578063a8bf9046146105dd578063adf51de1146105fd57600080fd5b80637bf6a425146104ca5780638456cb59146104e05780638cd2403d146104f55780639010d07c1461051557806391d148541461054d57600080fd5b80633cd11924116101c757806345d6602c1161018b57806345d6602c1461045657806347e7ef241461046957806354fd4d501461047c5780635c975abb1461049857806371f43f9a146104b157600080fd5b80633cd11924146103c25780633d1c24e7146103e25780633efcfda4146103f557806341f435b314610415578063426599641461043657600080fd5b80632e1a7d4d1161020e5780632e1a7d4d146103205780632f2ff15d14610340578063357a03331461036057806336568abe1461038057806339fadf98146103a057600080fd5b806301ffc9a714610256578063046f7da21461028b578063230df83a146102a2578063248a9ca3146102c257806326e6b6971461030057600080fd5b3661025157005b600080fd5b34801561026257600080fd5b50610276610271366004614deb565b610764565b60405190151581526020015b60405180910390f35b34801561029757600080fd5b506102a061078f565b005b3480156102ae57600080fd5b506102a06102bd366004614e2a565b6107b3565b3480156102ce57600080fd5b506102f26102dd366004614e47565b60009081526065602052604090206001015490565b604051908152602001610282565b34801561030c57600080fd5b506102a061031b366004614e6e565b610961565b34801561032c57600080fd5b506102f261033b366004614e47565b61099e565b34801561034c57600080fd5b506102a061035b366004614e8b565b610b43565b34801561036c57600080fd5b506102f261037b366004614ebb565b610b6e565b34801561038c57600080fd5b506102a061039b366004614e8b565b610be8565b3480156103ac57600080fd5b506103b5610c66565b6040516102829190614ee7565b3480156103ce57600080fd5b506102f26103dd366004614e2a565b610d18565b6102a06103f0366004614f34565b610eae565b34801561040157600080fd5b506102f2610410366004614e47565b611050565b34801561042157600080fd5b506000805160206156e98339815191526102f2565b34801561044257600080fd5b506102a0610451366004614f85565b611124565b6102f261046436600461500b565b6111f1565b6102f2610477366004614ebb565b611263565b34801561048857600080fd5b5060405160088152602001610282565b3480156104a457600080fd5b5061012d5460ff16610276565b3480156104bd57600080fd5b506101695460ff16610276565b3480156104d657600080fd5b50610168546102f2565b3480156104ec57600080fd5b506102a06112d8565b34801561050157600080fd5b506102a06105103660046150bb565b6112f9565b34801561052157600080fd5b506105356105303660046150fd565b61134a565b6040516001600160a01b039091168152602001610282565b34801561055957600080fd5b50610276610568366004614e8b565b611369565b34801561057957600080fd5b506000805160206157298339815191526102f2565b34801561059a57600080fd5b506105356105a9366004614e2a565b6001600160a01b03908116600090815261016760205260409020541690565b3480156105d457600080fd5b506102f2600081565b3480156105e957600080fd5b506102a06105f8366004614e2a565b611394565b34801561060957600080fd5b506102a061061836600461511f565b6115ab565b6102f261062b366004615192565b611b2f565b34801561063c57600080fd5b506102a061064b3660046151d3565b611bae565b34801561065c57600080fd5b506102a061066b366004614f85565b611c96565b34801561067c57600080fd5b507f657d38169ed9612cb2d9de7040b7b6a1adebf7a8433a66ccb49c08554ac9b8a56102f2565b3480156106af57600080fd5b506102f26106be366004614e47565b611e40565b6102f26106d136600461500b565b611e57565b6102f26106e436600461500b565b611ec8565b3480156106f557600080fd5b506102a0610704366004614e8b565b611f2a565b34801561071557600080fd5b506103b5611f50565b6102f261072c36600461500b565b611ffb565b34801561073d57600080fd5b507fdf8c9529ea4b244b569bac557a549516f317e7b5cf82dc5e0d8b6d874930a3f56102f2565b60006001600160e01b03198216635a05180f60e01b1480610789575061078982612060565b92915050565b6000805160206156e98339815191526107a88133612095565b6107b06120bc565b50565b806107bd81612151565b6107d560008051602061572983398151915233612095565b600260fb54036108005760405162461bcd60e51b81526004016107f790615213565b60405180910390fd5b600260fb81905550816001600160a01b031663f525cb686040518163ffffffff1660e01b8152600401602060405180830381865afa158015610846573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061086a919061524a565b15610888576040516332e7879360e01b815260040160405180910390fd5b61089461016283612178565b6108b15760405163b0ce759160e01b815260040160405180910390fd5b6108bc82600061218d565b816001600160a01b0316826001600160a01b031663b1dd61b66040518163ffffffff1660e01b8152600401602060405180830381865afa158015610904573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109289190615263565b61ffff167fa0c1e3924f995e5ba38f53b4effb6d4b3eeb84176a2951c589115140f638ac0960405160405180910390a35050600160fb55565b61097960008051602061572983398151915233612095565b6101695460ff161515811515146107b057610169805482151560ff1990911617905550565b60006109ad61012d5460ff1690565b156109ca5760405162461bcd60e51b81526004016107f790615287565b600260fb54036109ec5760405162461bcd60e51b81526004016107f790615213565b600260fb55336000610a4f84836000814260405160609290921b6001600160601b031916602083015260e01b6001600160e01b03191660348201526038810184905260580160405160208183030381529060405280519060200120905092915050565b6101605460405163158591ab60e11b8152600481018390526001600160a01b0385811660248301526044820188905292935060009290911690632b0b2356906064016060604051808303816000875af1158015610ab0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ad491906152fe565b90507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031681600001516001600160a01b031603610b2857610b1e8284836126c4565b9350505050610b39565b610b3382848361287e565b93505050505b600160fb55919050565b600082815260656020526040902060010154610b5f8133612a15565b610b698383612a79565b505050565b600082610b7a81612151565b82610b8481612a9b565b61012d5460ff1615610ba85760405162461bcd60e51b81526004016107f790615287565b600260fb5403610bca5760405162461bcd60e51b81526004016107f790615213565b600260fb55610bda338686612abc565b600160fb5595945050505050565b6001600160a01b0381163314610c585760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016107f7565b610c628282612cfd565b5050565b60606000610c75610162612d1f565b905060008167ffffffffffffffff811115610c9257610c926152b1565b604051908082528060200260200182016040528015610cbb578160200160208202803683370190505b50905060005b82811015610d1157610cd561016282612d29565b828281518110610ce757610ce7615342565b6001600160a01b039092166020928302919091019091015280610d098161536e565b915050610cc1565b5092915050565b6000610d2761012d5460ff1690565b15610d445760405162461bcd60e51b81526004016107f790615287565b7f657d38169ed9612cb2d9de7040b7b6a1adebf7a8433a66ccb49c08554ac9b8a5610d6f8133612095565b82610d7981612151565b600260fb5403610d9b5760405162461bcd60e51b81526004016107f790615213565b600260fb55610168546000819003610db7576000935050610ea2565b600061016855604051631c20fadd60e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690631c20fadd90610e2d907f00000000000000000000000000000000000000000000000000000000000000009089908690600401615387565b600060405180830381600087803b158015610e4757600080fd5b505af1158015610e5b573d6000803e3d6000fd5b50506040518381526001600160a01b03881692503391507f328c9cc28e75030423307e732b07659ae452a620281f3e54e838000a7f4675389060200160405180910390a392505b5050600160fb55919050565b61012d5460ff1615610ed25760405162461bcd60e51b81526004016107f790615287565b7fdf8c9529ea4b244b569bac557a549516f317e7b5cf82dc5e0d8b6d874930a3f5610efd8133612095565b600260fb5403610f1f5760405162461bcd60e51b81526004016107f790615213565b600260fb55604080516001600160601b031933606090811b82166020808501919091526001600160e01b03194260e01b1660348501528a821b8316603885015289821b909216604c84015282018790526080820186905260a08083018690528351808403909101815260c090920190925280519101206001600160a01b038088167f00000000000000000000000000000000000000000000000000000000000000009190911603610fdf57610fd981878733600188612d35565b50610fef565b610fed818789883389612e7c565b505b60408051868152602081018690529081018490526001600160a01b03808816919089169083907f102bce4e43a6a8cf0306fde6154221c1f5460f64ba63b92b156bce998ef0db569060600160405180910390a45050600160fb555050505050565b600061105f61012d5460ff1690565b1561107c5760405162461bcd60e51b81526004016107f790615287565b600260fb540361109e5760405162461bcd60e51b81526004016107f790615213565b600260fb5561016054604051635f23b6c560e11b8152336004820152602481018490526001600160a01b039091169063be476d8a906044016020604051808303816000875af11580156110f5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611119919061524a565b600160fb5592915050565b8061112e81612151565b61114660008051602061572983398151915233612095565b600260fb54036111685760405162461bcd60e51b81526004016107f790615213565b600260fb5561117961016283612edc565b6111965760405163b0ce759160e01b815260040160405180910390fd5b8260005b818110156111e4576111d28686838181106111b7576111b7615342565b90506020020160208101906111cc9190614e2a565b85612efe565b806111dc8161536e565b91505061119a565b5050600160fb5550505050565b600061120061012d5460ff1690565b1561121d5760405162461bcd60e51b81526004016107f790615287565b600260fb540361123f5760405162461bcd60e51b81526004016107f790615213565b600260fb556112538787878787873361306f565b600160fb55979650505050505050565b600061126d613147565b8261127781612151565b8261128181612a9b565b61012d5460ff16156112a55760405162461bcd60e51b81526004016107f790615287565b600260fb54036112c75760405162461bcd60e51b81526004016107f790615213565b600260fb55610bda3386868261316d565b6000805160206156e98339815191526112f18133612095565b6107b061322b565b60c95460009061130e9061ffff1660016153ab565b905061ffff81166008146113345760405162dc149f60e41b815260040160405180910390fd5b60c9805461ffff191661ffff8316179055505050565b60008281526097602052604081206113629083612d29565b9392505050565b60009182526065602090815260408084206001600160a01b0393909316845291905290205460ff1690565b8061139e81612151565b6113b660008051602061572983398151915233612095565b600260fb54036113d85760405162461bcd60e51b81526004016107f790615213565b600260fb819055506000826001600160a01b031663b1dd61b66040518163ffffffff1660e01b8152600401602060405180830381865afa158015611420573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114449190615263565b90506000836001600160a01b03166354fd4d506040518163ffffffff1660e01b8152600401602060405180830381865afa158015611486573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114aa9190615263565b905060006114b88383613285565b90506001600160a01b0381161515806114da57506114d8610162866133bd565b155b156114f85760405163119b4fd360e11b815260040160405180910390fd5b61150385600161218d565b846001600160a01b0316856001600160a01b031663b1dd61b66040518163ffffffff1660e01b8152600401602060405180830381865afa15801561154b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061156f9190615263565b61ffff167f5ae87719d73cb0fabb219f0e4b6e0a614ed7506f8a08bdb20bebf313573151b760405160405180910390a35050600160fb55505050565b846115b581612151565b846115bf81612a9b565b846115c981612151565b61012d5460ff16156115ed5760405162461bcd60e51b81526004016107f790615287565b600260fb540361160f5760405162461bcd60e51b81526004016107f790615213565b600260fb557f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03908116908916141580156116d8575060405163b5af090f60e01b81526001600160a01b0389811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063b5af090f90602401602060405180830381865afa1580156116b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116d691906153d1565b155b156116f657604051630b094f2760e31b815260040160405180910390fd5b60006001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163303611730575060006117d2565b604051637c36afad60e01b81526001600160a01b038a811660048301526117cf918a917f00000000000000000000000000000000000000000000000000000000000000001690637c36afad90602401602060405180830381865afa15801561179c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117c091906153ee565b63ffffffff16620f42406133d2565b90505b60006117e76001600160a01b038b163061349e565b604051631c20fadd60e01b81529091506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690631c20fadd9061183a908d908c908e90600401615387565b600060405180830381600087803b15801561185457600080fd5b505af1158015611868573d6000803e3d6000fd5b50505050876001600160a01b03166323e30c8b3361188c8d6001600160a01b031690565b8c868c8c6040518763ffffffff1660e01b81526004016118b196959493929190615414565b600060405180830381600087803b1580156118cb57600080fd5b505af11580156118df573d6000803e3d6000fd5b50505050600081611902308d6001600160a01b031661349e90919063ffffffff16565b61190c9190615470565b9050611918838b615487565b8110156119385760405163b7ed78bf60e01b815260040160405180910390fd5b61194a8b6001600160a01b031661352c565b15611987576119826001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168261354e565b6119bb565b6119bb6001600160a01b038c167f000000000000000000000000000000000000000000000000000000000000000083613667565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116908c1603611a645761015f54604051637c8f622d60e01b81526001600160a01b038d811660048301526024820186905260006044830152909116908190637c8f622d90606401600060405180830381600087803b158015611a4657600080fd5b505af1158015611a5a573d6000803e3d6000fd5b5050505050611ad7565b6000611a6f8c6136d2565b604051631510748b60e01b81526001600160a01b038e811660048301526024820187905291925090821690631510748b90604401600060405180830381600087803b158015611abd57600080fd5b505af1158015611ad1573d6000803e3d6000fd5b50505050505b604080518b81526020810185905233916001600160a01b038e16917f0da3485ef1bb570df7bb888887eae5aa01d81b83cd8ccc80c0ea0922a677ecef910160405180910390a35050600160fb55505050505050505050565b6000611b39613147565b83611b4381612151565b83611b4d81612151565b83611b5781612a9b565b61012d5460ff1615611b7b5760405162461bcd60e51b81526004016107f790615287565b600260fb5403611b9d5760405162461bcd60e51b81526004016107f790615213565b600260fb556112538787873361316d565b82611bb881612151565b82611bc281612151565b82611bcc81612151565b600054610100900460ff16611be75760005460ff1615611beb565b303b155b611c4e5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016107f7565b600054610100900460ff16158015611c70576000805461ffff19166101011790555b611c7b87878761370e565b8015611c8d576000805461ff00191690555b50505050505050565b600260fb5403611cb85760405162461bcd60e51b81526004016107f790615213565b600260fb55611cc961016282612edc565b611ce65760405163b0ce759160e01b815260040160405180910390fd5b8160005b81811015611e34576000858583818110611d0657611d06615342565b9050602002016020810190611d1b9190614e2a565b6101615460405163772b7e9760e01b81526001600160a01b038084166004830152878116602483015292935091169063772b7e9790604401600060405180830381600087803b158015611d6d57600080fd5b505af1158015611d81573d6000803e3d6000fd5b5050506001600160a01b038083166000818152610167602052604080822080548a86166001600160a01b031982161790915590519316935083927f987eb3c2f78454541205f72f34839b434c306c9eaf4922efd7c0c3060fdb2e4c9190a3846001600160a01b0316826001600160a01b03167f95f865c2808f8b2a85eea2611db7843150ee7835ef1403f9755918a97d76933c60405160405180910390a350508080611e2c9061536e565b915050611cea565b5050600160fb55505050565b600081815260976020526040812061078990612d1f565b6000611e6661012d5460ff1690565b15611e835760405162461bcd60e51b81526004016107f790615287565b7f0000000000000000000000000000000000000000000000000000000000000000611ead81613758565b611ebc8888888888883361306f565b98975050505050505050565b6000611ed761012d5460ff1690565b15611ef45760405162461bcd60e51b81526004016107f790615287565b600260fb5403611f165760405162461bcd60e51b81526004016107f790615213565b600260fb5561125387878787878733613781565b600082815260656020526040902060010154611f468133612a15565b610b698383612cfd565b60606000611f5f610165612d1f565b905060008167ffffffffffffffff811115611f7c57611f7c6152b1565b604051908082528060200260200182016040528015611fa5578160200160208202803683370190505b50905060005b82811015610d1157611fbf61016582612d29565b828281518110611fd157611fd1615342565b6001600160a01b039092166020928302919091019091015280611ff38161536e565b915050611fab565b600061200a61012d5460ff1690565b156120275760405162461bcd60e51b81526004016107f790615287565b7f000000000000000000000000000000000000000000000000000000000000000061205181613758565b611ebc88888888888833613781565b60006001600160e01b03198216637965db0b60e01b148061078957506301ffc9a760e01b6001600160e01b0319831614610789565b61209f8282611369565b610c6257604051634ca8886760e01b815260040160405180910390fd5b61012d5460ff166121065760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016107f7565b61012d805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6001600160a01b0381166107b05760405163e6c4247b60e01b815260040160405180910390fd5b6000611362836001600160a01b03841661384c565b8181156124415761015f54604051632f2ff15d60e01b81527f4cbb5676e6e25e1a3b8a36de10472bcac96f97bd8dd87af6f330881b84739eb860048201526001600160a01b03838116602483015290911690632f2ff15d90604401600060405180830381600087803b15801561220257600080fd5b505af1158015612216573d6000803e3d6000fd5b505061015f54604051632f2ff15d60e01b81527f0d0d17bf5382c809d9a3899d6a94e57386dfb2036f0401b94ef3cf6c1a9ab73f60048201526001600160a01b0385811660248301529091169250632f2ff15d9150604401600060405180830381600087803b15801561228857600080fd5b505af115801561229c573d6000803e3d6000fd5b505061015f54604051632f2ff15d60e01b81527fca51b9188e78415f30da725e0d94567b4d65bc6777d4e5d573191e9f55b88a3260048201526001600160a01b0385811660248301529091169250632f2ff15d9150604401600060405180830381600087803b15801561230e57600080fd5b505af1158015612322573d6000803e3d6000fd5b5050604051632f2ff15d60e01b815260008051602061570983398151915260048201526001600160a01b0384811660248301527f0000000000000000000000000000000000000000000000000000000000000000169250632f2ff15d9150604401600060405180830381600087803b15801561239d57600080fd5b505af11580156123b1573d6000803e3d6000fd5b5050604051632f2ff15d60e01b815260008051602061570983398151915260048201526001600160a01b0384811660248301527f0000000000000000000000000000000000000000000000000000000000000000169250632f2ff15d91506044015b600060405180830381600087803b15801561242d57600080fd5b505af1158015611c8d573d6000803e3d6000fd5b61015f5460405163d547741f60e01b81527f4cbb5676e6e25e1a3b8a36de10472bcac96f97bd8dd87af6f330881b84739eb860048201526001600160a01b0383811660248301529091169063d547741f90604401600060405180830381600087803b1580156124af57600080fd5b505af11580156124c3573d6000803e3d6000fd5b505061015f5460405163d547741f60e01b81527f0d0d17bf5382c809d9a3899d6a94e57386dfb2036f0401b94ef3cf6c1a9ab73f60048201526001600160a01b038581166024830152909116925063d547741f9150604401600060405180830381600087803b15801561253557600080fd5b505af1158015612549573d6000803e3d6000fd5b505061015f5460405163d547741f60e01b81527fca51b9188e78415f30da725e0d94567b4d65bc6777d4e5d573191e9f55b88a3260048201526001600160a01b038581166024830152909116925063d547741f9150604401600060405180830381600087803b1580156125bb57600080fd5b505af11580156125cf573d6000803e3d6000fd5b505060405163d547741f60e01b815260008051602061570983398151915260048201526001600160a01b0384811660248301527f000000000000000000000000000000000000000000000000000000000000000016925063d547741f9150604401600060405180830381600087803b15801561264a57600080fd5b505af115801561265e573d6000803e3d6000fd5b505060405163d547741f60e01b815260008051602061570983398151915260048201526001600160a01b0384811660248301527f000000000000000000000000000000000000000000000000000000000000000016925063d547741f9150604401612413565b61015f5481516101605460208401516040516323b872dd60e01b81526000946001600160a01b03908116948116936323b872dd9361270b9391909216918691600401615387565b6020604051808303816000875af115801561272a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061274e91906153d1565b5060208301516040516323b872dd60e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016916323b872dd916127a3918891869190600401615387565b6020604051808303816000875af11580156127c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127e691906153d1565b50602083015160408085015190516372026c6760e11b8152600481018890526001600160a01b038781166024830152604482019390935260648101919091529082169063e404d8ce906084016020604051808303816000875af1158015612851573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612875919061524a565b95945050505050565b60008082600001516001600160a01b031663f4325d676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156128c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128e7919061549f565b905060006128f4826136d2565b84516101605460208701516040516323b872dd60e01b81529394506001600160a01b03928316936323b872dd936129319316918691600401615387565b6020604051808303816000875af1158015612950573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061297491906153d1565b50602084015160408086015190516356aca36f60e01b8152600481018990526001600160a01b038881166024830152858116604483015260648201939093526084810191909152908216906356aca36f9060a4016020604051808303816000875af11580156129e7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a0b919061524a565b9695505050505050565b612a1f8282611369565b610c6257612a37816001600160a01b0316601461393f565b612a4283602061393f565b604051602001612a539291906154e8565b60408051601f198184030181529082905262461bcd60e51b82526107f79160040161555d565b612a838282613adb565b6000828152609760205260409020610b6990826133bd565b806000036107b057604051637c946ed760e01b815260040160405180910390fd5b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b031614612c04576000836001600160a01b031663f4325d676040518163ffffffff1660e01b8152600401602060405180830381865afa158015612b37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b5b919061549f565b9050836001600160a01b0316612b70826136d2565b604051635768adcf60e01b81526001600160a01b0384811660048301529190911690635768adcf90602401602060405180830381865afa158015612bb8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bdc919061549f565b6001600160a01b031614612c025760405162820f3560e61b815260040160405180910390fd5b505b610160546040516323b872dd60e01b81526001600160a01b03808616926323b872dd92612c3992899216908790600401615387565b6020604051808303816000875af1158015612c58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c7c91906153d1565b50610160546040516313e7e7d160e11b81526001600160a01b03909116906327cfcfa290612cb290879087908790600401615387565b6020604051808303816000875af1158015612cd1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612cf5919061524a565b949350505050565b612d078282613b61565b6000828152609760205260409020610b699082612178565b6000610789825490565b60006113628383613bc8565b60003415612d56576040516342f7487960e11b815260040160405180910390fd5b61015f546040516323b872dd60e01b81526001600160a01b03918216917f000000000000000000000000000000000000000000000000000000000000000016906323b872dd90612dae90889085908b90600401615387565b6020604051808303816000875af1158015612dcd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612df191906153d1565b5060405163e06bf20d60e01b8152600481018990526001600160a01b0388811660248301526044820188905285151560648301526084820185905282169063e06bf20d9060a4015b6020604051808303816000875af1158015612e58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ebc919061524a565b6000612e89858484613bf2565b6000612e94866136d2565b604051639f5c734b60e01b8152600481018a90526001600160a01b03898116602483015288811660448301526064820188905291925090821690639f5c734b90608401612e39565b6001600160a01b03811660009081526001830160205260408120541515611362565b612f0782612151565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811690831603612f535760405163c1ab6dc160e01b815260040160405180910390fd5b612f5f610165836133bd565b612f7c5760405163119b4fd360e11b815260040160405180910390fd5b604051634824fce960e11b81526001600160a01b038381166004830152821690639049f9d290602401600060405180830381600087803b158015612fbf57600080fd5b505af1158015612fd3573d6000803e3d6000fd5b505050506001600160a01b038281166000818152610167602052604080822080546001600160a01b0319169486169485179055517f4f2ce4e40f623ca765fc0167a25cb7842ceaafb8d82d3dec26ca0d0e0d2d48969190a3806001600160a01b0316826001600160a01b03167f95f865c2808f8b2a85eea2611db7843150ee7835ef1403f9755918a97d76933c60405160405180910390a35050565b600061307e8888888888613cd6565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b0316036130bd575060015b61313a60405180604001604052808b6001600160a01b031681526020018a6001600160a01b031681525060405180608001604052808a81526020018981526020016000151581526020018415158152506040518060400160405280876001600160a01b03168152602001886001600160a01b031681525088613d5a565b9998505050505050505050565b6101695460ff1661316b576040516303a5be3f60e31b815260040160405180910390fd5b565b604080516001600160601b0319606084811b82166020808501919091526001600160e01b03194260e01b16603485015288821b8316603885015287821b909216604c84015280830186905283518084039091018152608090920190925280519101206000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b039081169086160361321d5761321581878686600080612d35565b915050612cf5565b612a0b818787878789612e7c565b61012d5460ff161561324f5760405162461bcd60e51b81526004016107f790615287565b61012d805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586121343390565b600080613293610162612d1f565b905060005b818110156133b25760006132ae61016283612d29565b90508561ffff16816001600160a01b031663b1dd61b66040518163ffffffff1660e01b8152600401602060405180830381865afa1580156132f3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133179190615263565b61ffff1614801561339057508461ffff16816001600160a01b03166354fd4d506040518163ffffffff1660e01b8152600401602060405180830381865afa158015613366573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061338a9190615263565b61ffff16145b1561339f579250610789915050565b50806133aa8161536e565b915050613298565b506000949350505050565b6000611362836001600160a01b03841661415e565b6000806133df85856141ad565b8051909150600003613403578281602001516133fb91906155a6565b915050611362565b8051831161342457604051631a93c68960e11b815260040160405180910390fd5b6000613431868686614234565b9050600061343f838361424f565b80519091506000036134655784816020015161345b91906155a6565b9350505050611362565b600085810386169061347783836142d4565b9050600061348d613488848a6155a6565b61430b565b919091029998505050505050505050565b60006134a98361352c565b156134bf57506001600160a01b03811631610789565b826040516370a0823160e01b81526001600160a01b03848116600483015291909116906370a0823190602401602060405180830381865afa158015613508573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611362919061524a565b6001600160a01b031673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1490565b8047101561359e5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e636500000060448201526064016107f7565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146135eb576040519150601f19603f3d011682016040523d82523d6000602084013e6135f0565b606091505b5050905080610b695760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d6179206861766520726576657274656400000000000060648201526084016107f7565b8060000361367457505050565b61367d8361352c565b156136be576040516001600160a01b0383169082156108fc029083906000818181858888f193505050501580156136b8573d6000803e3d6000fd5b50505050565b610b696001600160a01b0384168383614336565b6001600160a01b0380821660009081526101676020526040812054909116806107895760405163c1ab6dc160e01b815260040160405180910390fd5b600054610100900460ff166137355760405162461bcd60e51b81526004016107f7906155c8565b61373d614399565b6137456143d0565b61374d6143ff565b610b6983838361442e565b336001600160a01b038216146107b057604051634ca8886760e01b815260040160405180910390fd5b60006137908888888888613cd6565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b0316036137cf575060015b61313a60405180604001604052808b6001600160a01b031681526020018a6001600160a01b031681525060405180608001604052808a81526020018981526020016001151581526020018415158152506040518060400160405280876001600160a01b03168152602001886001600160a01b031681525088613d5a565b60008181526001830160205260408120548015613935576000613870600183615470565b855490915060009061388490600190615470565b90508181146138e95760008660000182815481106138a4576138a4615342565b90600052602060002001549050808760000184815481106138c7576138c7615342565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806138fa576138fa615613565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610789565b6000915050610789565b6060600061394e836002615629565b613959906002615487565b67ffffffffffffffff811115613971576139716152b1565b6040519080825280601f01601f19166020018201604052801561399b576020820181803683370190505b509050600360fc1b816000815181106139b6576139b6615342565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106139e5576139e5615342565b60200101906001600160f81b031916908160001a9053506000613a09846002615629565b613a14906001615487565b90505b6001811115613a8c576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110613a4857613a48615342565b1a60f81b828281518110613a5e57613a5e615342565b60200101906001600160f81b031916908160001a90535060049490941c93613a8581615648565b9050613a17565b5083156113625760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016107f7565b613ae58282611369565b610c625760008281526065602090815260408083206001600160a01b03851684529091529020805460ff19166001179055613b1d3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b613b6b8282611369565b15610c625760008281526065602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000826000018281548110613bdf57613bdf615342565b9060005260206000200154905092915050565b613c04836001600160a01b031661352c565b15613c825780341015613c2a576040516342f7487960e11b815260040160405180910390fd5b613c5d6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168261354e565b80341115610b6957610b69613c728234615470565b6001600160a01b0384169061354e565b3415613ca1576040516342f7487960e11b815260040160405180910390fd5b610b696001600160a01b038416837f00000000000000000000000000000000000000000000000000000000000000008461453e565b613cdf85612151565b613ce884612151565b836001600160a01b0316856001600160a01b031603613d1a5760405163c1ab6dc160e01b815260040160405180910390fd5b613d2383612a9b565b613d2c82612a9b565b4263ffffffff16811015613d5357604051631ab7da6b60e01b815260040160405180910390fd5b5050505050565b60208201516000906001600160a01b0316613d805782516001600160a01b031660208401525b825185516020808801518751888301516040808b0151858b015182516001600160601b031960609a8b1b8116828a01526001600160e01b03194260e01b166034830152988a1b8916603882015295891b8816604c87015288860194909452608080860193909352151560f81b60a085015260a1840189905291861b90941660c1830152805160b581840301815260d5830180835281519185019190912061015584018352600080835260f5850181905261011585018190526101359094018490528251958601835283865293850183905290840182905293830152919087516000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03908116911603613f2a57613ea6848a6020015160018b614568565b91508192508160600151905088602001516001600160a01b031689600001516001600160a01b0316857f5c02c2bb2d1d082317eb23916ca27b3e7c294398b60061a2ad54f1c3c018c318856000015186602001518760000151886040015160008f60000151604051613f1d9695949392919061565f565b60405180910390a4614089565b60208901516001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116911603613fec57613f72848a6000015160008b614568565b91508192508160600151905088602001516001600160a01b031689600001516001600160a01b0316857f5c02c2bb2d1d082317eb23916ca27b3e7c294398b60061a2ad54f1c3c018c318856000015186602001518760200151886040015189604001518f60000151604051613f1d9695949392919061565f565b613ff7848a8a61488a565b6060808201519083015192955090935061401091615487565b905088602001516001600160a01b031689600001516001600160a01b0316857f5c02c2bb2d1d082317eb23916ca27b3e7c294398b60061a2ad54f1c3c018c31886600001518660200151886020015188604001518a604001518f600001516040516140809695949392919061565f565b60405180910390a45b88518751845161409a929190613bf2565b6020808a01518882015191840151604051631c20fadd60e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001693631c20fadd936140f4939092600401615387565b600060405180830381600087803b15801561410e57600080fd5b505af1158015614122573d6000803e3d6000fd5b505050508061016860008282546141399190615487565b9091555050604088015161414e57825161313a565b5060200151979650505050505050565b60008181526001830160205260408120546141a557508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610789565b506000610789565b604080518082019091526000808252602082015260006141cd8484614a2d565b905083830280821061420257604051806040016040528082846141f09190615470565b81526020018281525092505050610789565b604051806040016040528060016142198585900390565b6142239190615470565b815260200191909152949350505050565b6000818061424457614244615590565b838509949350505050565b60408051808201909152600080825260208201528183602001511061429c576040518060400160405280846000015181526020018385602001516142939190615470565b90529050610789565b6040518060400160405280600185600001516142b89190615470565b81526020016142cb856020015185900390565b90529392505050565b6000806142ec6142e6848084036155a6565b60010190565b90508284602001516142fe91906155a6565b8451820217949350505050565b60006001815b6008811015610d1157838202600203820291508061432e8161536e565b915050614311565b6040516001600160a01b038316602482015260448101829052610b6990849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152614a3c565b600054610100900460ff166143c05760405162461bcd60e51b81526004016107f7906155c8565b6143c8614b0e565b61316b614b35565b600054610100900460ff166143f75760405162461bcd60e51b81526004016107f7906155c8565b61316b614b9a565b600054610100900460ff166144265760405162461bcd60e51b81526004016107f7906155c8565b61316b614bc8565b600054610100900460ff166144555760405162461bcd60e51b81526004016107f7906155c8565b61015f80546001600160a01b038086166001600160a01b03199283161790925561016080548584169083161790556101618054928416929091169190911790556144cd7fdf8c9529ea4b244b569bac557a549516f317e7b5cf82dc5e0d8b6d874930a3f5600080516020615729833981519152614bfc565b6144f36000805160206156e9833981519152600080516020615729833981519152614bfc565b61452b7f657d38169ed9612cb2d9de7040b7b6a1adebf7a8433a66ccb49c08554ac9b8a5600080516020615729833981519152614bfc565b5050610169805460ff1916600117905550565b80158061454f575061454f8461352c565b6136b8576136b86001600160a01b038516848484614c47565b6145936040518060800160405280600081526020016000815260200160008152602001600081525090565b6000836145e6576040518060400160405280866001600160a01b031681526020017f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031681525061462e565b60405180604001604052807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602001866001600160a01b03168152505b9050600083604001516146ec57614644866136d2565b825160208085015187519188015160608901516040516337cb0ead60e21b8152600481018e90526001600160a01b03958616602482015292851660448401526064830193909352608482015290151560a482015291169063df2c3ab49060c4016060604051808303816000875af11580156146c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906146e79190615690565b614798565b6146f5866136d2565b8251602080850151875191880151606089015160405163d1aebfc760e01b8152600481018e90526001600160a01b03958616602482015292851660448401526064830193909352608482015290151560a482015291169063d1aebfc79060c4016060604051808303816000875af1158015614774573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906147989190615690565b9050846148315761015f54604082015160208301516001600160a01b0390921691637c8f622d9189916147cb9190615470565b6040516001600160e01b031960e085901b1681526001600160a01b039092166004830152602482015260016044820152606401600060405180830381600087803b15801561481857600080fd5b505af115801561482c573d6000803e3d6000fd5b505050505b6040518060800160405280856040015161484c57825161484f565b85515b81526020018560400151614864578551614867565b82515b815260200182602001518152602001826040015181525092505050949350505050565b6148b56040518060800160405280600081526020016000815260200160008152602001600081525090565b6148e06040518060800160405280600081526020016000815260200160008152602001600081525090565b82604001511561498a57600083600001519050600084602001519050600061493988886000015160006040518060800160405280888152602001600181526020016001151581526020018b606001511515815250614568565b9050600061497b89896020015160016040518060800160405280876020015181526020018881526020016001151581526020018c606001511515815250614568565b919550909350614a2592505050565b60008360000151905060008460200151905060006149da8888602001516001604051806080016040528088815260200160001981526020016000151581526020018b606001511515815250614568565b90506000614a1c89896000015160006040518060800160405280876000015181526020018881526020016000151581526020018c606001511515815250614568565b95509093505050505b935093915050565b60006000198284099392505050565b6000614a91826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316614c689092919063ffffffff16565b805190915015610b695780806020019051810190614aaf91906153d1565b610b695760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016107f7565b600054610100900460ff1661316b5760405162461bcd60e51b81526004016107f7906155c8565b600054610100900460ff16614b5c5760405162461bcd60e51b81526004016107f7906155c8565b60c9805461ffff19166001179055614b8260008051602061572983398151915280614bfc565b61316b60008051602061572983398151915233614c77565b600054610100900460ff16614bc15760405162461bcd60e51b81526004016107f7906155c8565b600160fb55565b600054610100900460ff16614bef5760405162461bcd60e51b81526004016107f7906155c8565b61012d805460ff19169055565b600082815260656020526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6136b8846323b872dd60e01b85858560405160240161436293929190615387565b6060612cf58484600085614c81565b610c628282612a79565b606082471015614ce25760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016107f7565b6001600160a01b0385163b614d395760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016107f7565b600080866001600160a01b03168587604051614d5591906156cc565b60006040518083038185875af1925050503d8060008114614d92576040519150601f19603f3d011682016040523d82523d6000602084013e614d97565b606091505b5091509150614da7828286614db2565b979650505050505050565b60608315614dc1575081611362565b825115614dd15782518084602001fd5b8160405162461bcd60e51b81526004016107f7919061555d565b600060208284031215614dfd57600080fd5b81356001600160e01b03198116811461136257600080fd5b6001600160a01b03811681146107b057600080fd5b600060208284031215614e3c57600080fd5b813561136281614e15565b600060208284031215614e5957600080fd5b5035919050565b80151581146107b057600080fd5b600060208284031215614e8057600080fd5b813561136281614e60565b60008060408385031215614e9e57600080fd5b823591506020830135614eb081614e15565b809150509250929050565b60008060408385031215614ece57600080fd5b8235614ed981614e15565b946020939093013593505050565b6020808252825182820181905260009190848201906040850190845b81811015614f285783516001600160a01b031683529284019291840191600101614f03565b50909695505050505050565b600080600080600060a08688031215614f4c57600080fd5b8535614f5781614e15565b94506020860135614f6781614e15565b94979496505050506040830135926060810135926080909101359150565b600080600060408486031215614f9a57600080fd5b833567ffffffffffffffff80821115614fb257600080fd5b818601915086601f830112614fc657600080fd5b813581811115614fd557600080fd5b8760208260051b8501011115614fea57600080fd5b6020928301955093505084013561500081614e15565b809150509250925092565b60008060008060008060c0878903121561502457600080fd5b863561502f81614e15565b9550602087013561503f81614e15565b945060408701359350606087013592506080870135915060a087013561506481614e15565b809150509295509295509295565b60008083601f84011261508457600080fd5b50813567ffffffffffffffff81111561509c57600080fd5b6020830191508360208285010111156150b457600080fd5b9250929050565b600080602083850312156150ce57600080fd5b823567ffffffffffffffff8111156150e557600080fd5b6150f185828601615072565b90969095509350505050565b6000806040838503121561511057600080fd5b50508035926020909101359150565b60008060008060006080868803121561513757600080fd5b853561514281614e15565b945060208601359350604086013561515981614e15565b9250606086013567ffffffffffffffff81111561517557600080fd5b61518188828901615072565b969995985093965092949392505050565b6000806000606084860312156151a757600080fd5b83356151b281614e15565b925060208401356151c281614e15565b929592945050506040919091013590565b6000806000606084860312156151e857600080fd5b83356151f381614e15565b9250602084013561520381614e15565b9150604084013561500081614e15565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60006020828403121561525c57600080fd5b5051919050565b60006020828403121561527557600080fd5b815161ffff8116811461136257600080fd5b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b634e487b7160e01b600052604160045260246000fd5b6040516060810167ffffffffffffffff811182821017156152f857634e487b7160e01b600052604160045260246000fd5b60405290565b60006060828403121561531057600080fd5b6153186152c7565b825161532381614e15565b8152602083810151908201526040928301519281019290925250919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161538057615380615358565b5060010190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b600061ffff8083168185168083038211156153c8576153c8615358565b01949350505050565b6000602082840312156153e357600080fd5b815161136281614e60565b60006020828403121561540057600080fd5b815163ffffffff8116811461136257600080fd5b6001600160a01b03878116825286166020820152604081018590526060810184905260a06080820181905281018290526000828460c0840137600060c0848401015260c0601f19601f8501168301019050979650505050505050565b60008282101561548257615482615358565b500390565b6000821982111561549a5761549a615358565b500190565b6000602082840312156154b157600080fd5b815161136281614e15565b60005b838110156154d75781810151838201526020016154bf565b838111156136b85750506000910152565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516155208160178501602088016154bc565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516155518160288401602088016154bc565b01602801949350505050565b602081526000825180602084015261557c8160408501602087016154bc565b601f01601f19169190910160400192915050565b634e487b7160e01b600052601260045260246000fd5b6000826155c357634e487b7160e01b600052601260045260246000fd5b500490565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b634e487b7160e01b600052603160045260246000fd5b600081600019048311821515161561564357615643615358565b500290565b60008161565757615657615358565b506000190190565b95865260208601949094526040850192909252606084015260808301526001600160a01b031660a082015260c00190565b6000606082840312156156a257600080fd5b6156aa6152c7565b8251815260208301516020820152604083015160408201528091505092915050565b600082516156de8184602087016154bc565b919091019291505056fef28f409b8cbe6b50c7ca45afe893f01f69626f8a4e33cb480bc1bc2d618c084589ce14d20697a788f57260f7690044299bde7ea88cfb7e43d120a0c031f1ffc12172861495e7b85edac73e3cd5fbb42dd675baadf627720e687bcfdaca025096a164736f6c634300080d000a", - "deployedBytecode": "0x60806040526004361061024a5760003560e01c80637bf6a42511610139578063b3db428b116100b6578063d0d145811161007a578063d0d14581146106c3578063d3a4acd3146106d6578063d547741f146106e9578063d6efd7c314610709578063d895feee1461071e578063e6aac07e1461073157600080fd5b8063b3db428b1461061d578063c0c53b8b14610630578063c109ba1314610650578063c844748714610670578063ca15c873146106a357600080fd5b806393867fb5116100fd57806393867fb51461056d5780639bca0e701461058e578063a217fddf146105c8578063a8bf9046146105dd578063adf51de1146105fd57600080fd5b80637bf6a425146104ca5780638456cb59146104e05780638cd2403d146104f55780639010d07c1461051557806391d148541461054d57600080fd5b80633cd11924116101c757806345d6602c1161018b57806345d6602c1461045657806347e7ef241461046957806354fd4d501461047c5780635c975abb1461049857806371f43f9a146104b157600080fd5b80633cd11924146103c25780633d1c24e7146103e25780633efcfda4146103f557806341f435b314610415578063426599641461043657600080fd5b80632e1a7d4d1161020e5780632e1a7d4d146103205780632f2ff15d14610340578063357a03331461036057806336568abe1461038057806339fadf98146103a057600080fd5b806301ffc9a714610256578063046f7da21461028b578063230df83a146102a2578063248a9ca3146102c257806326e6b6971461030057600080fd5b3661025157005b600080fd5b34801561026257600080fd5b50610276610271366004614deb565b610764565b60405190151581526020015b60405180910390f35b34801561029757600080fd5b506102a061078f565b005b3480156102ae57600080fd5b506102a06102bd366004614e2a565b6107b3565b3480156102ce57600080fd5b506102f26102dd366004614e47565b60009081526065602052604090206001015490565b604051908152602001610282565b34801561030c57600080fd5b506102a061031b366004614e6e565b610961565b34801561032c57600080fd5b506102f261033b366004614e47565b61099e565b34801561034c57600080fd5b506102a061035b366004614e8b565b610b43565b34801561036c57600080fd5b506102f261037b366004614ebb565b610b6e565b34801561038c57600080fd5b506102a061039b366004614e8b565b610be8565b3480156103ac57600080fd5b506103b5610c66565b6040516102829190614ee7565b3480156103ce57600080fd5b506102f26103dd366004614e2a565b610d18565b6102a06103f0366004614f34565b610eae565b34801561040157600080fd5b506102f2610410366004614e47565b611050565b34801561042157600080fd5b506000805160206156e98339815191526102f2565b34801561044257600080fd5b506102a0610451366004614f85565b611124565b6102f261046436600461500b565b6111f1565b6102f2610477366004614ebb565b611263565b34801561048857600080fd5b5060405160088152602001610282565b3480156104a457600080fd5b5061012d5460ff16610276565b3480156104bd57600080fd5b506101695460ff16610276565b3480156104d657600080fd5b50610168546102f2565b3480156104ec57600080fd5b506102a06112d8565b34801561050157600080fd5b506102a06105103660046150bb565b6112f9565b34801561052157600080fd5b506105356105303660046150fd565b61134a565b6040516001600160a01b039091168152602001610282565b34801561055957600080fd5b50610276610568366004614e8b565b611369565b34801561057957600080fd5b506000805160206157298339815191526102f2565b34801561059a57600080fd5b506105356105a9366004614e2a565b6001600160a01b03908116600090815261016760205260409020541690565b3480156105d457600080fd5b506102f2600081565b3480156105e957600080fd5b506102a06105f8366004614e2a565b611394565b34801561060957600080fd5b506102a061061836600461511f565b6115ab565b6102f261062b366004615192565b611b2f565b34801561063c57600080fd5b506102a061064b3660046151d3565b611bae565b34801561065c57600080fd5b506102a061066b366004614f85565b611c96565b34801561067c57600080fd5b507f657d38169ed9612cb2d9de7040b7b6a1adebf7a8433a66ccb49c08554ac9b8a56102f2565b3480156106af57600080fd5b506102f26106be366004614e47565b611e40565b6102f26106d136600461500b565b611e57565b6102f26106e436600461500b565b611ec8565b3480156106f557600080fd5b506102a0610704366004614e8b565b611f2a565b34801561071557600080fd5b506103b5611f50565b6102f261072c36600461500b565b611ffb565b34801561073d57600080fd5b507fdf8c9529ea4b244b569bac557a549516f317e7b5cf82dc5e0d8b6d874930a3f56102f2565b60006001600160e01b03198216635a05180f60e01b1480610789575061078982612060565b92915050565b6000805160206156e98339815191526107a88133612095565b6107b06120bc565b50565b806107bd81612151565b6107d560008051602061572983398151915233612095565b600260fb54036108005760405162461bcd60e51b81526004016107f790615213565b60405180910390fd5b600260fb81905550816001600160a01b031663f525cb686040518163ffffffff1660e01b8152600401602060405180830381865afa158015610846573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061086a919061524a565b15610888576040516332e7879360e01b815260040160405180910390fd5b61089461016283612178565b6108b15760405163b0ce759160e01b815260040160405180910390fd5b6108bc82600061218d565b816001600160a01b0316826001600160a01b031663b1dd61b66040518163ffffffff1660e01b8152600401602060405180830381865afa158015610904573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109289190615263565b61ffff167fa0c1e3924f995e5ba38f53b4effb6d4b3eeb84176a2951c589115140f638ac0960405160405180910390a35050600160fb55565b61097960008051602061572983398151915233612095565b6101695460ff161515811515146107b057610169805482151560ff1990911617905550565b60006109ad61012d5460ff1690565b156109ca5760405162461bcd60e51b81526004016107f790615287565b600260fb54036109ec5760405162461bcd60e51b81526004016107f790615213565b600260fb55336000610a4f84836000814260405160609290921b6001600160601b031916602083015260e01b6001600160e01b03191660348201526038810184905260580160405160208183030381529060405280519060200120905092915050565b6101605460405163158591ab60e11b8152600481018390526001600160a01b0385811660248301526044820188905292935060009290911690632b0b2356906064016060604051808303816000875af1158015610ab0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ad491906152fe565b90507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031681600001516001600160a01b031603610b2857610b1e8284836126c4565b9350505050610b39565b610b3382848361287e565b93505050505b600160fb55919050565b600082815260656020526040902060010154610b5f8133612a15565b610b698383612a79565b505050565b600082610b7a81612151565b82610b8481612a9b565b61012d5460ff1615610ba85760405162461bcd60e51b81526004016107f790615287565b600260fb5403610bca5760405162461bcd60e51b81526004016107f790615213565b600260fb55610bda338686612abc565b600160fb5595945050505050565b6001600160a01b0381163314610c585760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016107f7565b610c628282612cfd565b5050565b60606000610c75610162612d1f565b905060008167ffffffffffffffff811115610c9257610c926152b1565b604051908082528060200260200182016040528015610cbb578160200160208202803683370190505b50905060005b82811015610d1157610cd561016282612d29565b828281518110610ce757610ce7615342565b6001600160a01b039092166020928302919091019091015280610d098161536e565b915050610cc1565b5092915050565b6000610d2761012d5460ff1690565b15610d445760405162461bcd60e51b81526004016107f790615287565b7f657d38169ed9612cb2d9de7040b7b6a1adebf7a8433a66ccb49c08554ac9b8a5610d6f8133612095565b82610d7981612151565b600260fb5403610d9b5760405162461bcd60e51b81526004016107f790615213565b600260fb55610168546000819003610db7576000935050610ea2565b600061016855604051631c20fadd60e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690631c20fadd90610e2d907f00000000000000000000000000000000000000000000000000000000000000009089908690600401615387565b600060405180830381600087803b158015610e4757600080fd5b505af1158015610e5b573d6000803e3d6000fd5b50506040518381526001600160a01b03881692503391507f328c9cc28e75030423307e732b07659ae452a620281f3e54e838000a7f4675389060200160405180910390a392505b5050600160fb55919050565b61012d5460ff1615610ed25760405162461bcd60e51b81526004016107f790615287565b7fdf8c9529ea4b244b569bac557a549516f317e7b5cf82dc5e0d8b6d874930a3f5610efd8133612095565b600260fb5403610f1f5760405162461bcd60e51b81526004016107f790615213565b600260fb55604080516001600160601b031933606090811b82166020808501919091526001600160e01b03194260e01b1660348501528a821b8316603885015289821b909216604c84015282018790526080820186905260a08083018690528351808403909101815260c090920190925280519101206001600160a01b038088167f00000000000000000000000000000000000000000000000000000000000000009190911603610fdf57610fd981878733600188612d35565b50610fef565b610fed818789883389612e7c565b505b60408051868152602081018690529081018490526001600160a01b03808816919089169083907f102bce4e43a6a8cf0306fde6154221c1f5460f64ba63b92b156bce998ef0db569060600160405180910390a45050600160fb555050505050565b600061105f61012d5460ff1690565b1561107c5760405162461bcd60e51b81526004016107f790615287565b600260fb540361109e5760405162461bcd60e51b81526004016107f790615213565b600260fb5561016054604051635f23b6c560e11b8152336004820152602481018490526001600160a01b039091169063be476d8a906044016020604051808303816000875af11580156110f5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611119919061524a565b600160fb5592915050565b8061112e81612151565b61114660008051602061572983398151915233612095565b600260fb54036111685760405162461bcd60e51b81526004016107f790615213565b600260fb5561117961016283612edc565b6111965760405163b0ce759160e01b815260040160405180910390fd5b8260005b818110156111e4576111d28686838181106111b7576111b7615342565b90506020020160208101906111cc9190614e2a565b85612efe565b806111dc8161536e565b91505061119a565b5050600160fb5550505050565b600061120061012d5460ff1690565b1561121d5760405162461bcd60e51b81526004016107f790615287565b600260fb540361123f5760405162461bcd60e51b81526004016107f790615213565b600260fb556112538787878787873361306f565b600160fb55979650505050505050565b600061126d613147565b8261127781612151565b8261128181612a9b565b61012d5460ff16156112a55760405162461bcd60e51b81526004016107f790615287565b600260fb54036112c75760405162461bcd60e51b81526004016107f790615213565b600260fb55610bda3386868261316d565b6000805160206156e98339815191526112f18133612095565b6107b061322b565b60c95460009061130e9061ffff1660016153ab565b905061ffff81166008146113345760405162dc149f60e41b815260040160405180910390fd5b60c9805461ffff191661ffff8316179055505050565b60008281526097602052604081206113629083612d29565b9392505050565b60009182526065602090815260408084206001600160a01b0393909316845291905290205460ff1690565b8061139e81612151565b6113b660008051602061572983398151915233612095565b600260fb54036113d85760405162461bcd60e51b81526004016107f790615213565b600260fb819055506000826001600160a01b031663b1dd61b66040518163ffffffff1660e01b8152600401602060405180830381865afa158015611420573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114449190615263565b90506000836001600160a01b03166354fd4d506040518163ffffffff1660e01b8152600401602060405180830381865afa158015611486573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114aa9190615263565b905060006114b88383613285565b90506001600160a01b0381161515806114da57506114d8610162866133bd565b155b156114f85760405163119b4fd360e11b815260040160405180910390fd5b61150385600161218d565b846001600160a01b0316856001600160a01b031663b1dd61b66040518163ffffffff1660e01b8152600401602060405180830381865afa15801561154b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061156f9190615263565b61ffff167f5ae87719d73cb0fabb219f0e4b6e0a614ed7506f8a08bdb20bebf313573151b760405160405180910390a35050600160fb55505050565b846115b581612151565b846115bf81612a9b565b846115c981612151565b61012d5460ff16156115ed5760405162461bcd60e51b81526004016107f790615287565b600260fb540361160f5760405162461bcd60e51b81526004016107f790615213565b600260fb557f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03908116908916141580156116d8575060405163b5af090f60e01b81526001600160a01b0389811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063b5af090f90602401602060405180830381865afa1580156116b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116d691906153d1565b155b156116f657604051630b094f2760e31b815260040160405180910390fd5b60006001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163303611730575060006117d2565b604051637c36afad60e01b81526001600160a01b038a811660048301526117cf918a917f00000000000000000000000000000000000000000000000000000000000000001690637c36afad90602401602060405180830381865afa15801561179c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117c091906153ee565b63ffffffff16620f42406133d2565b90505b60006117e76001600160a01b038b163061349e565b604051631c20fadd60e01b81529091506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690631c20fadd9061183a908d908c908e90600401615387565b600060405180830381600087803b15801561185457600080fd5b505af1158015611868573d6000803e3d6000fd5b50505050876001600160a01b03166323e30c8b3361188c8d6001600160a01b031690565b8c868c8c6040518763ffffffff1660e01b81526004016118b196959493929190615414565b600060405180830381600087803b1580156118cb57600080fd5b505af11580156118df573d6000803e3d6000fd5b50505050600081611902308d6001600160a01b031661349e90919063ffffffff16565b61190c9190615470565b9050611918838b615487565b8110156119385760405163b7ed78bf60e01b815260040160405180910390fd5b61194a8b6001600160a01b031661352c565b15611987576119826001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168261354e565b6119bb565b6119bb6001600160a01b038c167f000000000000000000000000000000000000000000000000000000000000000083613667565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116908c1603611a645761015f54604051637c8f622d60e01b81526001600160a01b038d811660048301526024820186905260006044830152909116908190637c8f622d90606401600060405180830381600087803b158015611a4657600080fd5b505af1158015611a5a573d6000803e3d6000fd5b5050505050611ad7565b6000611a6f8c6136d2565b604051631510748b60e01b81526001600160a01b038e811660048301526024820187905291925090821690631510748b90604401600060405180830381600087803b158015611abd57600080fd5b505af1158015611ad1573d6000803e3d6000fd5b50505050505b604080518b81526020810185905233916001600160a01b038e16917f0da3485ef1bb570df7bb888887eae5aa01d81b83cd8ccc80c0ea0922a677ecef910160405180910390a35050600160fb55505050505050505050565b6000611b39613147565b83611b4381612151565b83611b4d81612151565b83611b5781612a9b565b61012d5460ff1615611b7b5760405162461bcd60e51b81526004016107f790615287565b600260fb5403611b9d5760405162461bcd60e51b81526004016107f790615213565b600260fb556112538787873361316d565b82611bb881612151565b82611bc281612151565b82611bcc81612151565b600054610100900460ff16611be75760005460ff1615611beb565b303b155b611c4e5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016107f7565b600054610100900460ff16158015611c70576000805461ffff19166101011790555b611c7b87878761370e565b8015611c8d576000805461ff00191690555b50505050505050565b600260fb5403611cb85760405162461bcd60e51b81526004016107f790615213565b600260fb55611cc961016282612edc565b611ce65760405163b0ce759160e01b815260040160405180910390fd5b8160005b81811015611e34576000858583818110611d0657611d06615342565b9050602002016020810190611d1b9190614e2a565b6101615460405163772b7e9760e01b81526001600160a01b038084166004830152878116602483015292935091169063772b7e9790604401600060405180830381600087803b158015611d6d57600080fd5b505af1158015611d81573d6000803e3d6000fd5b5050506001600160a01b038083166000818152610167602052604080822080548a86166001600160a01b031982161790915590519316935083927f987eb3c2f78454541205f72f34839b434c306c9eaf4922efd7c0c3060fdb2e4c9190a3846001600160a01b0316826001600160a01b03167f95f865c2808f8b2a85eea2611db7843150ee7835ef1403f9755918a97d76933c60405160405180910390a350508080611e2c9061536e565b915050611cea565b5050600160fb55505050565b600081815260976020526040812061078990612d1f565b6000611e6661012d5460ff1690565b15611e835760405162461bcd60e51b81526004016107f790615287565b7f0000000000000000000000000000000000000000000000000000000000000000611ead81613758565b611ebc8888888888883361306f565b98975050505050505050565b6000611ed761012d5460ff1690565b15611ef45760405162461bcd60e51b81526004016107f790615287565b600260fb5403611f165760405162461bcd60e51b81526004016107f790615213565b600260fb5561125387878787878733613781565b600082815260656020526040902060010154611f468133612a15565b610b698383612cfd565b60606000611f5f610165612d1f565b905060008167ffffffffffffffff811115611f7c57611f7c6152b1565b604051908082528060200260200182016040528015611fa5578160200160208202803683370190505b50905060005b82811015610d1157611fbf61016582612d29565b828281518110611fd157611fd1615342565b6001600160a01b039092166020928302919091019091015280611ff38161536e565b915050611fab565b600061200a61012d5460ff1690565b156120275760405162461bcd60e51b81526004016107f790615287565b7f000000000000000000000000000000000000000000000000000000000000000061205181613758565b611ebc88888888888833613781565b60006001600160e01b03198216637965db0b60e01b148061078957506301ffc9a760e01b6001600160e01b0319831614610789565b61209f8282611369565b610c6257604051634ca8886760e01b815260040160405180910390fd5b61012d5460ff166121065760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016107f7565b61012d805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6001600160a01b0381166107b05760405163e6c4247b60e01b815260040160405180910390fd5b6000611362836001600160a01b03841661384c565b8181156124415761015f54604051632f2ff15d60e01b81527f4cbb5676e6e25e1a3b8a36de10472bcac96f97bd8dd87af6f330881b84739eb860048201526001600160a01b03838116602483015290911690632f2ff15d90604401600060405180830381600087803b15801561220257600080fd5b505af1158015612216573d6000803e3d6000fd5b505061015f54604051632f2ff15d60e01b81527f0d0d17bf5382c809d9a3899d6a94e57386dfb2036f0401b94ef3cf6c1a9ab73f60048201526001600160a01b0385811660248301529091169250632f2ff15d9150604401600060405180830381600087803b15801561228857600080fd5b505af115801561229c573d6000803e3d6000fd5b505061015f54604051632f2ff15d60e01b81527fca51b9188e78415f30da725e0d94567b4d65bc6777d4e5d573191e9f55b88a3260048201526001600160a01b0385811660248301529091169250632f2ff15d9150604401600060405180830381600087803b15801561230e57600080fd5b505af1158015612322573d6000803e3d6000fd5b5050604051632f2ff15d60e01b815260008051602061570983398151915260048201526001600160a01b0384811660248301527f0000000000000000000000000000000000000000000000000000000000000000169250632f2ff15d9150604401600060405180830381600087803b15801561239d57600080fd5b505af11580156123b1573d6000803e3d6000fd5b5050604051632f2ff15d60e01b815260008051602061570983398151915260048201526001600160a01b0384811660248301527f0000000000000000000000000000000000000000000000000000000000000000169250632f2ff15d91506044015b600060405180830381600087803b15801561242d57600080fd5b505af1158015611c8d573d6000803e3d6000fd5b61015f5460405163d547741f60e01b81527f4cbb5676e6e25e1a3b8a36de10472bcac96f97bd8dd87af6f330881b84739eb860048201526001600160a01b0383811660248301529091169063d547741f90604401600060405180830381600087803b1580156124af57600080fd5b505af11580156124c3573d6000803e3d6000fd5b505061015f5460405163d547741f60e01b81527f0d0d17bf5382c809d9a3899d6a94e57386dfb2036f0401b94ef3cf6c1a9ab73f60048201526001600160a01b038581166024830152909116925063d547741f9150604401600060405180830381600087803b15801561253557600080fd5b505af1158015612549573d6000803e3d6000fd5b505061015f5460405163d547741f60e01b81527fca51b9188e78415f30da725e0d94567b4d65bc6777d4e5d573191e9f55b88a3260048201526001600160a01b038581166024830152909116925063d547741f9150604401600060405180830381600087803b1580156125bb57600080fd5b505af11580156125cf573d6000803e3d6000fd5b505060405163d547741f60e01b815260008051602061570983398151915260048201526001600160a01b0384811660248301527f000000000000000000000000000000000000000000000000000000000000000016925063d547741f9150604401600060405180830381600087803b15801561264a57600080fd5b505af115801561265e573d6000803e3d6000fd5b505060405163d547741f60e01b815260008051602061570983398151915260048201526001600160a01b0384811660248301527f000000000000000000000000000000000000000000000000000000000000000016925063d547741f9150604401612413565b61015f5481516101605460208401516040516323b872dd60e01b81526000946001600160a01b03908116948116936323b872dd9361270b9391909216918691600401615387565b6020604051808303816000875af115801561272a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061274e91906153d1565b5060208301516040516323b872dd60e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016916323b872dd916127a3918891869190600401615387565b6020604051808303816000875af11580156127c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127e691906153d1565b50602083015160408085015190516372026c6760e11b8152600481018890526001600160a01b038781166024830152604482019390935260648101919091529082169063e404d8ce906084016020604051808303816000875af1158015612851573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612875919061524a565b95945050505050565b60008082600001516001600160a01b031663f4325d676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156128c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128e7919061549f565b905060006128f4826136d2565b84516101605460208701516040516323b872dd60e01b81529394506001600160a01b03928316936323b872dd936129319316918691600401615387565b6020604051808303816000875af1158015612950573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061297491906153d1565b50602084015160408086015190516356aca36f60e01b8152600481018990526001600160a01b038881166024830152858116604483015260648201939093526084810191909152908216906356aca36f9060a4016020604051808303816000875af11580156129e7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a0b919061524a565b9695505050505050565b612a1f8282611369565b610c6257612a37816001600160a01b0316601461393f565b612a4283602061393f565b604051602001612a539291906154e8565b60408051601f198184030181529082905262461bcd60e51b82526107f79160040161555d565b612a838282613adb565b6000828152609760205260409020610b6990826133bd565b806000036107b057604051637c946ed760e01b815260040160405180910390fd5b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b031614612c04576000836001600160a01b031663f4325d676040518163ffffffff1660e01b8152600401602060405180830381865afa158015612b37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b5b919061549f565b9050836001600160a01b0316612b70826136d2565b604051635768adcf60e01b81526001600160a01b0384811660048301529190911690635768adcf90602401602060405180830381865afa158015612bb8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bdc919061549f565b6001600160a01b031614612c025760405162820f3560e61b815260040160405180910390fd5b505b610160546040516323b872dd60e01b81526001600160a01b03808616926323b872dd92612c3992899216908790600401615387565b6020604051808303816000875af1158015612c58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c7c91906153d1565b50610160546040516313e7e7d160e11b81526001600160a01b03909116906327cfcfa290612cb290879087908790600401615387565b6020604051808303816000875af1158015612cd1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612cf5919061524a565b949350505050565b612d078282613b61565b6000828152609760205260409020610b699082612178565b6000610789825490565b60006113628383613bc8565b60003415612d56576040516342f7487960e11b815260040160405180910390fd5b61015f546040516323b872dd60e01b81526001600160a01b03918216917f000000000000000000000000000000000000000000000000000000000000000016906323b872dd90612dae90889085908b90600401615387565b6020604051808303816000875af1158015612dcd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612df191906153d1565b5060405163e06bf20d60e01b8152600481018990526001600160a01b0388811660248301526044820188905285151560648301526084820185905282169063e06bf20d9060a4015b6020604051808303816000875af1158015612e58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ebc919061524a565b6000612e89858484613bf2565b6000612e94866136d2565b604051639f5c734b60e01b8152600481018a90526001600160a01b03898116602483015288811660448301526064820188905291925090821690639f5c734b90608401612e39565b6001600160a01b03811660009081526001830160205260408120541515611362565b612f0782612151565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811690831603612f535760405163c1ab6dc160e01b815260040160405180910390fd5b612f5f610165836133bd565b612f7c5760405163119b4fd360e11b815260040160405180910390fd5b604051634824fce960e11b81526001600160a01b038381166004830152821690639049f9d290602401600060405180830381600087803b158015612fbf57600080fd5b505af1158015612fd3573d6000803e3d6000fd5b505050506001600160a01b038281166000818152610167602052604080822080546001600160a01b0319169486169485179055517f4f2ce4e40f623ca765fc0167a25cb7842ceaafb8d82d3dec26ca0d0e0d2d48969190a3806001600160a01b0316826001600160a01b03167f95f865c2808f8b2a85eea2611db7843150ee7835ef1403f9755918a97d76933c60405160405180910390a35050565b600061307e8888888888613cd6565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b0316036130bd575060015b61313a60405180604001604052808b6001600160a01b031681526020018a6001600160a01b031681525060405180608001604052808a81526020018981526020016000151581526020018415158152506040518060400160405280876001600160a01b03168152602001886001600160a01b031681525088613d5a565b9998505050505050505050565b6101695460ff1661316b576040516303a5be3f60e31b815260040160405180910390fd5b565b604080516001600160601b0319606084811b82166020808501919091526001600160e01b03194260e01b16603485015288821b8316603885015287821b909216604c84015280830186905283518084039091018152608090920190925280519101206000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b039081169086160361321d5761321581878686600080612d35565b915050612cf5565b612a0b818787878789612e7c565b61012d5460ff161561324f5760405162461bcd60e51b81526004016107f790615287565b61012d805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586121343390565b600080613293610162612d1f565b905060005b818110156133b25760006132ae61016283612d29565b90508561ffff16816001600160a01b031663b1dd61b66040518163ffffffff1660e01b8152600401602060405180830381865afa1580156132f3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133179190615263565b61ffff1614801561339057508461ffff16816001600160a01b03166354fd4d506040518163ffffffff1660e01b8152600401602060405180830381865afa158015613366573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061338a9190615263565b61ffff16145b1561339f579250610789915050565b50806133aa8161536e565b915050613298565b506000949350505050565b6000611362836001600160a01b03841661415e565b6000806133df85856141ad565b8051909150600003613403578281602001516133fb91906155a6565b915050611362565b8051831161342457604051631a93c68960e11b815260040160405180910390fd5b6000613431868686614234565b9050600061343f838361424f565b80519091506000036134655784816020015161345b91906155a6565b9350505050611362565b600085810386169061347783836142d4565b9050600061348d613488848a6155a6565b61430b565b919091029998505050505050505050565b60006134a98361352c565b156134bf57506001600160a01b03811631610789565b826040516370a0823160e01b81526001600160a01b03848116600483015291909116906370a0823190602401602060405180830381865afa158015613508573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611362919061524a565b6001600160a01b031673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1490565b8047101561359e5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e636500000060448201526064016107f7565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146135eb576040519150601f19603f3d011682016040523d82523d6000602084013e6135f0565b606091505b5050905080610b695760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d6179206861766520726576657274656400000000000060648201526084016107f7565b8060000361367457505050565b61367d8361352c565b156136be576040516001600160a01b0383169082156108fc029083906000818181858888f193505050501580156136b8573d6000803e3d6000fd5b50505050565b610b696001600160a01b0384168383614336565b6001600160a01b0380821660009081526101676020526040812054909116806107895760405163c1ab6dc160e01b815260040160405180910390fd5b600054610100900460ff166137355760405162461bcd60e51b81526004016107f7906155c8565b61373d614399565b6137456143d0565b61374d6143ff565b610b6983838361442e565b336001600160a01b038216146107b057604051634ca8886760e01b815260040160405180910390fd5b60006137908888888888613cd6565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b0316036137cf575060015b61313a60405180604001604052808b6001600160a01b031681526020018a6001600160a01b031681525060405180608001604052808a81526020018981526020016001151581526020018415158152506040518060400160405280876001600160a01b03168152602001886001600160a01b031681525088613d5a565b60008181526001830160205260408120548015613935576000613870600183615470565b855490915060009061388490600190615470565b90508181146138e95760008660000182815481106138a4576138a4615342565b90600052602060002001549050808760000184815481106138c7576138c7615342565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806138fa576138fa615613565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610789565b6000915050610789565b6060600061394e836002615629565b613959906002615487565b67ffffffffffffffff811115613971576139716152b1565b6040519080825280601f01601f19166020018201604052801561399b576020820181803683370190505b509050600360fc1b816000815181106139b6576139b6615342565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106139e5576139e5615342565b60200101906001600160f81b031916908160001a9053506000613a09846002615629565b613a14906001615487565b90505b6001811115613a8c576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110613a4857613a48615342565b1a60f81b828281518110613a5e57613a5e615342565b60200101906001600160f81b031916908160001a90535060049490941c93613a8581615648565b9050613a17565b5083156113625760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016107f7565b613ae58282611369565b610c625760008281526065602090815260408083206001600160a01b03851684529091529020805460ff19166001179055613b1d3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b613b6b8282611369565b15610c625760008281526065602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000826000018281548110613bdf57613bdf615342565b9060005260206000200154905092915050565b613c04836001600160a01b031661352c565b15613c825780341015613c2a576040516342f7487960e11b815260040160405180910390fd5b613c5d6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168261354e565b80341115610b6957610b69613c728234615470565b6001600160a01b0384169061354e565b3415613ca1576040516342f7487960e11b815260040160405180910390fd5b610b696001600160a01b038416837f00000000000000000000000000000000000000000000000000000000000000008461453e565b613cdf85612151565b613ce884612151565b836001600160a01b0316856001600160a01b031603613d1a5760405163c1ab6dc160e01b815260040160405180910390fd5b613d2383612a9b565b613d2c82612a9b565b4263ffffffff16811015613d5357604051631ab7da6b60e01b815260040160405180910390fd5b5050505050565b60208201516000906001600160a01b0316613d805782516001600160a01b031660208401525b825185516020808801518751888301516040808b0151858b015182516001600160601b031960609a8b1b8116828a01526001600160e01b03194260e01b166034830152988a1b8916603882015295891b8816604c87015288860194909452608080860193909352151560f81b60a085015260a1840189905291861b90941660c1830152805160b581840301815260d5830180835281519185019190912061015584018352600080835260f5850181905261011585018190526101359094018490528251958601835283865293850183905290840182905293830152919087516000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03908116911603613f2a57613ea6848a6020015160018b614568565b91508192508160600151905088602001516001600160a01b031689600001516001600160a01b0316857f5c02c2bb2d1d082317eb23916ca27b3e7c294398b60061a2ad54f1c3c018c318856000015186602001518760000151886040015160008f60000151604051613f1d9695949392919061565f565b60405180910390a4614089565b60208901516001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116911603613fec57613f72848a6000015160008b614568565b91508192508160600151905088602001516001600160a01b031689600001516001600160a01b0316857f5c02c2bb2d1d082317eb23916ca27b3e7c294398b60061a2ad54f1c3c018c318856000015186602001518760200151886040015189604001518f60000151604051613f1d9695949392919061565f565b613ff7848a8a61488a565b6060808201519083015192955090935061401091615487565b905088602001516001600160a01b031689600001516001600160a01b0316857f5c02c2bb2d1d082317eb23916ca27b3e7c294398b60061a2ad54f1c3c018c31886600001518660200151886020015188604001518a604001518f600001516040516140809695949392919061565f565b60405180910390a45b88518751845161409a929190613bf2565b6020808a01518882015191840151604051631c20fadd60e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001693631c20fadd936140f4939092600401615387565b600060405180830381600087803b15801561410e57600080fd5b505af1158015614122573d6000803e3d6000fd5b505050508061016860008282546141399190615487565b9091555050604088015161414e57825161313a565b5060200151979650505050505050565b60008181526001830160205260408120546141a557508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610789565b506000610789565b604080518082019091526000808252602082015260006141cd8484614a2d565b905083830280821061420257604051806040016040528082846141f09190615470565b81526020018281525092505050610789565b604051806040016040528060016142198585900390565b6142239190615470565b815260200191909152949350505050565b6000818061424457614244615590565b838509949350505050565b60408051808201909152600080825260208201528183602001511061429c576040518060400160405280846000015181526020018385602001516142939190615470565b90529050610789565b6040518060400160405280600185600001516142b89190615470565b81526020016142cb856020015185900390565b90529392505050565b6000806142ec6142e6848084036155a6565b60010190565b90508284602001516142fe91906155a6565b8451820217949350505050565b60006001815b6008811015610d1157838202600203820291508061432e8161536e565b915050614311565b6040516001600160a01b038316602482015260448101829052610b6990849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152614a3c565b600054610100900460ff166143c05760405162461bcd60e51b81526004016107f7906155c8565b6143c8614b0e565b61316b614b35565b600054610100900460ff166143f75760405162461bcd60e51b81526004016107f7906155c8565b61316b614b9a565b600054610100900460ff166144265760405162461bcd60e51b81526004016107f7906155c8565b61316b614bc8565b600054610100900460ff166144555760405162461bcd60e51b81526004016107f7906155c8565b61015f80546001600160a01b038086166001600160a01b03199283161790925561016080548584169083161790556101618054928416929091169190911790556144cd7fdf8c9529ea4b244b569bac557a549516f317e7b5cf82dc5e0d8b6d874930a3f5600080516020615729833981519152614bfc565b6144f36000805160206156e9833981519152600080516020615729833981519152614bfc565b61452b7f657d38169ed9612cb2d9de7040b7b6a1adebf7a8433a66ccb49c08554ac9b8a5600080516020615729833981519152614bfc565b5050610169805460ff1916600117905550565b80158061454f575061454f8461352c565b6136b8576136b86001600160a01b038516848484614c47565b6145936040518060800160405280600081526020016000815260200160008152602001600081525090565b6000836145e6576040518060400160405280866001600160a01b031681526020017f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031681525061462e565b60405180604001604052807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602001866001600160a01b03168152505b9050600083604001516146ec57614644866136d2565b825160208085015187519188015160608901516040516337cb0ead60e21b8152600481018e90526001600160a01b03958616602482015292851660448401526064830193909352608482015290151560a482015291169063df2c3ab49060c4016060604051808303816000875af11580156146c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906146e79190615690565b614798565b6146f5866136d2565b8251602080850151875191880151606089015160405163d1aebfc760e01b8152600481018e90526001600160a01b03958616602482015292851660448401526064830193909352608482015290151560a482015291169063d1aebfc79060c4016060604051808303816000875af1158015614774573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906147989190615690565b9050846148315761015f54604082015160208301516001600160a01b0390921691637c8f622d9189916147cb9190615470565b6040516001600160e01b031960e085901b1681526001600160a01b039092166004830152602482015260016044820152606401600060405180830381600087803b15801561481857600080fd5b505af115801561482c573d6000803e3d6000fd5b505050505b6040518060800160405280856040015161484c57825161484f565b85515b81526020018560400151614864578551614867565b82515b815260200182602001518152602001826040015181525092505050949350505050565b6148b56040518060800160405280600081526020016000815260200160008152602001600081525090565b6148e06040518060800160405280600081526020016000815260200160008152602001600081525090565b82604001511561498a57600083600001519050600084602001519050600061493988886000015160006040518060800160405280888152602001600181526020016001151581526020018b606001511515815250614568565b9050600061497b89896020015160016040518060800160405280876020015181526020018881526020016001151581526020018c606001511515815250614568565b919550909350614a2592505050565b60008360000151905060008460200151905060006149da8888602001516001604051806080016040528088815260200160001981526020016000151581526020018b606001511515815250614568565b90506000614a1c89896000015160006040518060800160405280876000015181526020018881526020016000151581526020018c606001511515815250614568565b95509093505050505b935093915050565b60006000198284099392505050565b6000614a91826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316614c689092919063ffffffff16565b805190915015610b695780806020019051810190614aaf91906153d1565b610b695760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016107f7565b600054610100900460ff1661316b5760405162461bcd60e51b81526004016107f7906155c8565b600054610100900460ff16614b5c5760405162461bcd60e51b81526004016107f7906155c8565b60c9805461ffff19166001179055614b8260008051602061572983398151915280614bfc565b61316b60008051602061572983398151915233614c77565b600054610100900460ff16614bc15760405162461bcd60e51b81526004016107f7906155c8565b600160fb55565b600054610100900460ff16614bef5760405162461bcd60e51b81526004016107f7906155c8565b61012d805460ff19169055565b600082815260656020526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6136b8846323b872dd60e01b85858560405160240161436293929190615387565b6060612cf58484600085614c81565b610c628282612a79565b606082471015614ce25760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016107f7565b6001600160a01b0385163b614d395760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016107f7565b600080866001600160a01b03168587604051614d5591906156cc565b60006040518083038185875af1925050503d8060008114614d92576040519150601f19603f3d011682016040523d82523d6000602084013e614d97565b606091505b5091509150614da7828286614db2565b979650505050505050565b60608315614dc1575081611362565b825115614dd15782518084602001fd5b8160405162461bcd60e51b81526004016107f7919061555d565b600060208284031215614dfd57600080fd5b81356001600160e01b03198116811461136257600080fd5b6001600160a01b03811681146107b057600080fd5b600060208284031215614e3c57600080fd5b813561136281614e15565b600060208284031215614e5957600080fd5b5035919050565b80151581146107b057600080fd5b600060208284031215614e8057600080fd5b813561136281614e60565b60008060408385031215614e9e57600080fd5b823591506020830135614eb081614e15565b809150509250929050565b60008060408385031215614ece57600080fd5b8235614ed981614e15565b946020939093013593505050565b6020808252825182820181905260009190848201906040850190845b81811015614f285783516001600160a01b031683529284019291840191600101614f03565b50909695505050505050565b600080600080600060a08688031215614f4c57600080fd5b8535614f5781614e15565b94506020860135614f6781614e15565b94979496505050506040830135926060810135926080909101359150565b600080600060408486031215614f9a57600080fd5b833567ffffffffffffffff80821115614fb257600080fd5b818601915086601f830112614fc657600080fd5b813581811115614fd557600080fd5b8760208260051b8501011115614fea57600080fd5b6020928301955093505084013561500081614e15565b809150509250925092565b60008060008060008060c0878903121561502457600080fd5b863561502f81614e15565b9550602087013561503f81614e15565b945060408701359350606087013592506080870135915060a087013561506481614e15565b809150509295509295509295565b60008083601f84011261508457600080fd5b50813567ffffffffffffffff81111561509c57600080fd5b6020830191508360208285010111156150b457600080fd5b9250929050565b600080602083850312156150ce57600080fd5b823567ffffffffffffffff8111156150e557600080fd5b6150f185828601615072565b90969095509350505050565b6000806040838503121561511057600080fd5b50508035926020909101359150565b60008060008060006080868803121561513757600080fd5b853561514281614e15565b945060208601359350604086013561515981614e15565b9250606086013567ffffffffffffffff81111561517557600080fd5b61518188828901615072565b969995985093965092949392505050565b6000806000606084860312156151a757600080fd5b83356151b281614e15565b925060208401356151c281614e15565b929592945050506040919091013590565b6000806000606084860312156151e857600080fd5b83356151f381614e15565b9250602084013561520381614e15565b9150604084013561500081614e15565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60006020828403121561525c57600080fd5b5051919050565b60006020828403121561527557600080fd5b815161ffff8116811461136257600080fd5b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b634e487b7160e01b600052604160045260246000fd5b6040516060810167ffffffffffffffff811182821017156152f857634e487b7160e01b600052604160045260246000fd5b60405290565b60006060828403121561531057600080fd5b6153186152c7565b825161532381614e15565b8152602083810151908201526040928301519281019290925250919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161538057615380615358565b5060010190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b600061ffff8083168185168083038211156153c8576153c8615358565b01949350505050565b6000602082840312156153e357600080fd5b815161136281614e60565b60006020828403121561540057600080fd5b815163ffffffff8116811461136257600080fd5b6001600160a01b03878116825286166020820152604081018590526060810184905260a06080820181905281018290526000828460c0840137600060c0848401015260c0601f19601f8501168301019050979650505050505050565b60008282101561548257615482615358565b500390565b6000821982111561549a5761549a615358565b500190565b6000602082840312156154b157600080fd5b815161136281614e15565b60005b838110156154d75781810151838201526020016154bf565b838111156136b85750506000910152565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516155208160178501602088016154bc565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516155518160288401602088016154bc565b01602801949350505050565b602081526000825180602084015261557c8160408501602087016154bc565b601f01601f19169190910160400192915050565b634e487b7160e01b600052601260045260246000fd5b6000826155c357634e487b7160e01b600052601260045260246000fd5b500490565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b634e487b7160e01b600052603160045260246000fd5b600081600019048311821515161561564357615643615358565b500290565b60008161565757615657615358565b506000190190565b95865260208601949094526040850192909252606084015260808301526001600160a01b031660a082015260c00190565b6000606082840312156156a257600080fd5b6156aa6152c7565b8251815260208301516020820152604083015160408201528091505092915050565b600082516156de8184602087016154bc565b919091019291505056fef28f409b8cbe6b50c7ca45afe893f01f69626f8a4e33cb480bc1bc2d618c084589ce14d20697a788f57260f7690044299bde7ea88cfb7e43d120a0c031f1ffc12172861495e7b85edac73e3cd5fbb42dd675baadf627720e687bcfdaca025096a164736f6c634300080d000a", + "numDeployments": 8, + "solcInputHash": "4a12fa84003cd14a8d58a795b8fd43b8", + "metadata": "{\"compiler\":{\"version\":\"0.8.13+commit.abaa5c0e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract ITokenGovernance\",\"name\":\"initBNTGovernance\",\"type\":\"address\"},{\"internalType\":\"contract ITokenGovernance\",\"name\":\"initVBNTGovernance\",\"type\":\"address\"},{\"internalType\":\"contract INetworkSettings\",\"name\":\"initNetworkSettings\",\"type\":\"address\"},{\"internalType\":\"contract IMasterVault\",\"name\":\"initMasterVault\",\"type\":\"address\"},{\"internalType\":\"contract IExternalProtectionVault\",\"name\":\"initExternalProtectionVault\",\"type\":\"address\"},{\"internalType\":\"contract IPoolToken\",\"name\":\"initBNTPoolToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"bancorArbitrage\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"carbonPOL\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AccessDenied\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AlreadyExists\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AlreadyInitialized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DeadlineExpired\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DepositingDisabled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DoesNotExist\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientFlashLoanReturn\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidFee\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidPool\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidToken\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NativeTokenAmountMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotEmpty\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotWhitelisted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotWhitelistedForPOL\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Overflow\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PoolNotInSurplus\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroValue\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract Token\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"borrower\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"}],\"name\":\"FlashLoanCompleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"contextId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"contract Token\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"provider\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"availableAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"originalAmount\",\"type\":\"uint256\"}],\"name\":\"FundsMigrated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"NetworkFeesWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"oldRewardsPPM\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"newRewardsPPM\",\"type\":\"uint32\"}],\"name\":\"POLRewardsPPMUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"polTokenAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"userReward\",\"type\":\"uint256\"}],\"name\":\"POLWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Paused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract Token\",\"name\":\"pool\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"contract IPoolCollection\",\"name\":\"poolCollection\",\"type\":\"address\"}],\"name\":\"PoolAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint16\",\"name\":\"poolType\",\"type\":\"uint16\"},{\"indexed\":true,\"internalType\":\"contract IPoolCollection\",\"name\":\"poolCollection\",\"type\":\"address\"}],\"name\":\"PoolCollectionAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint16\",\"name\":\"poolType\",\"type\":\"uint16\"},{\"indexed\":true,\"internalType\":\"contract IPoolCollection\",\"name\":\"poolCollection\",\"type\":\"address\"}],\"name\":\"PoolCollectionRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract Token\",\"name\":\"pool\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"contract IPoolCollection\",\"name\":\"poolCollection\",\"type\":\"address\"}],\"name\":\"PoolCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract Token\",\"name\":\"pool\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"contract IPoolCollection\",\"name\":\"poolCollection\",\"type\":\"address\"}],\"name\":\"PoolRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"previousAdminRole\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"newAdminRole\",\"type\":\"bytes32\"}],\"name\":\"RoleAdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleGranted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"contextId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"contract Token\",\"name\":\"sourceToken\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"contract Token\",\"name\":\"targetToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"sourceAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"targetAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"bntAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"targetFeeAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"bntFeeAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"trader\",\"type\":\"address\"}],\"name\":\"TokensTraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Unpaused\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DEFAULT_ADMIN_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"cancelWithdrawal\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"collectionByPool\",\"outputs\":[{\"internalType\":\"contract IPoolCollection\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token[]\",\"name\":\"tokens\",\"type\":\"address[]\"},{\"internalType\":\"contract IPoolCollection\",\"name\":\"poolCollection\",\"type\":\"address\"}],\"name\":\"createPools\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"pool\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenAmount\",\"type\":\"uint256\"}],\"name\":\"deposit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"provider\",\"type\":\"address\"},{\"internalType\":\"contract Token\",\"name\":\"pool\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenAmount\",\"type\":\"uint256\"}],\"name\":\"depositFor\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"depositingEnabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"status\",\"type\":\"bool\"}],\"name\":\"enableDepositing\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"contract IFlashLoanRecipient\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"flashLoan\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleAdmin\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"getRoleMember\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleMemberCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"grantRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"hasRole\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IPoolToken\",\"name\":\"poolToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"poolTokenAmount\",\"type\":\"uint256\"}],\"name\":\"initWithdrawal\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IBNTPool\",\"name\":\"initBNTPool\",\"type\":\"address\"},{\"internalType\":\"contract IPendingWithdrawals\",\"name\":\"initPendingWithdrawals\",\"type\":\"address\"},{\"internalType\":\"contract IPoolMigrator\",\"name\":\"initPoolMigrator\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"liquidityPools\",\"outputs\":[{\"internalType\":\"contract Token[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"provider\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"availableAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"originalAmount\",\"type\":\"uint256\"}],\"name\":\"migrateLiquidity\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token[]\",\"name\":\"pools\",\"type\":\"address[]\"},{\"internalType\":\"contract IPoolCollection\",\"name\":\"newPoolCollection\",\"type\":\"address\"}],\"name\":\"migratePools\",\"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\":\"pendingNetworkFeeAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"polRewardsPPM\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"poolCollections\",\"outputs\":[{\"internalType\":\"contract IPoolCollection[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"postUpgrade\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IPoolCollection\",\"name\":\"newPoolCollection\",\"type\":\"address\"}],\"name\":\"registerPoolCollection\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"renounceRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"resume\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"revokeRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"roleAdmin\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"roleEmergencyStopper\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"roleMigrationManager\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"roleNetworkFeeManager\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"newRewardsPPM\",\"type\":\"uint32\"}],\"name\":\"setPOLRewardsPPM\",\"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\":[{\"internalType\":\"contract Token\",\"name\":\"sourceToken\",\"type\":\"address\"},{\"internalType\":\"contract Token\",\"name\":\"targetToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"sourceAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minReturnAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"}],\"name\":\"tradeBySourceAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"sourceToken\",\"type\":\"address\"},{\"internalType\":\"contract Token\",\"name\":\"targetToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"sourceAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minReturnAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"}],\"name\":\"tradeBySourceAmountArb\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"sourceToken\",\"type\":\"address\"},{\"internalType\":\"contract Token\",\"name\":\"targetToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"targetAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxSourceAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"}],\"name\":\"tradeByTargetAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"sourceToken\",\"type\":\"address\"},{\"internalType\":\"contract Token\",\"name\":\"targetToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"targetAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxSourceAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"}],\"name\":\"tradeByTargetAmountArb\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IPoolCollection\",\"name\":\"poolCollection\",\"type\":\"address\"}],\"name\":\"unregisterPoolCollection\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"withdrawNetworkFees\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"withdrawPOL\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"Bancor Network contract\",\"events\":{\"FlashLoanCompleted(address,address,uint256,uint256)\":{\"details\":\"triggered when a flash-loan is completed\"},\"FundsMigrated(bytes32,address,address,uint256,uint256,uint256)\":{\"details\":\"triggered when funds are migrated\"},\"NetworkFeesWithdrawn(address,address,uint256)\":{\"details\":\"triggered when network fees are withdrawn\"},\"POLRewardsPPMUpdated(uint32,uint32)\":{\"details\":\"triggered when POL rewards ppm is updated\"},\"POLWithdrawn(address,address,uint256,uint256)\":{\"details\":\"triggered when pool surplus tokens are withdrawn\"},\"PoolAdded(address,address)\":{\"details\":\"triggered when a new pool is added to a pool collection\"},\"PoolCollectionAdded(uint16,address)\":{\"details\":\"triggered when a new pool collection is added\"},\"PoolCollectionRemoved(uint16,address)\":{\"details\":\"triggered when an existing pool collection is removed\"},\"PoolCreated(address,address)\":{\"details\":\"triggered when a pool is created\"},\"PoolRemoved(address,address)\":{\"details\":\"triggered when a new pool is removed from a pool collection\"},\"TokensTraded(bytes32,address,address,uint256,uint256,uint256,uint256,uint256,address)\":{\"details\":\"triggered on a successful trade\"}},\"kind\":\"dev\",\"methods\":{\"cancelWithdrawal(uint256)\":{\"details\":\"cancels a withdrawal request, and returns the number of pool token amount associated with the withdrawal request requirements: - the caller must have already initiated a withdrawal and received the specified id\"},\"collectionByPool(address)\":{\"details\":\"returns the respective pool collection for the provided pool\"},\"constructor\":{\"details\":\"a \\\"virtual\\\" constructor that is only used to set immutable state variables\"},\"createPools(address[],address)\":{\"details\":\"creates new pools requirements: - none of the pools already exists\"},\"deposit(address,uint256)\":{\"details\":\"deposits liquidity for the current provider and returns the respective pool token amount requirements: - the caller must have approved the network to transfer the tokens on its behalf (except for in the native token case)\"},\"depositFor(address,address,uint256)\":{\"details\":\"deposits liquidity for the specified provider and returns the respective pool token amount requirements: - the caller must have approved the network to transfer the tokens on its behalf (except for in the native token case)\"},\"depositingEnabled()\":{\"details\":\"returns whether deposits are enabled\"},\"enableDepositing(bool)\":{\"details\":\"enables/disables depositing into a given pool requirements: - the caller must be the owner of the contract\"},\"flashLoan(address,uint256,address,bytes)\":{\"details\":\"provides a flash-loan requirements: - the recipient's callback must return *at least* the borrowed amount and fee back to the specified return address\"},\"getRoleAdmin(bytes32)\":{\"details\":\"Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.\"},\"getRoleMember(bytes32,uint256)\":{\"details\":\"Returns one of the accounts that have `role`. `index` must be a value between 0 and {getRoleMemberCount}, non-inclusive. Role bearers are not sorted in any particular way, and their ordering may change at any point. WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure you perform all queries on the same block. See the following https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] for more information.\"},\"getRoleMemberCount(bytes32)\":{\"details\":\"Returns the number of accounts that have `role`. Can be used together with {getRoleMember} to enumerate all bearers of a role.\"},\"grantRole(bytes32,address)\":{\"details\":\"Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role.\"},\"hasRole(bytes32,address)\":{\"details\":\"Returns `true` if `account` has been granted `role`.\"},\"initWithdrawal(address,uint256)\":{\"details\":\"initiates liquidity withdrawal requirements: - the caller must have approved the contract to transfer the pool token amount on its behalf\"},\"initialize(address,address,address)\":{\"details\":\"fully initializes the contract and its parents\"},\"liquidityPools()\":{\"details\":\"returns the set of all liquidity pools\"},\"migrateLiquidity(address,address,uint256,uint256,uint256)\":{\"details\":\"deposits liquidity during a migration\"},\"migratePools(address[],address)\":{\"details\":\"migrates a list of pools between pool collections notes: - invalid or incompatible pools will be skipped gracefully\"},\"pause()\":{\"details\":\"pauses the network requirements: - the caller must have the ROLE_EMERGENCY_STOPPER privilege\"},\"paused()\":{\"details\":\"Returns true if the contract is paused, and false otherwise.\"},\"pendingNetworkFeeAmount()\":{\"details\":\"returns the pending network fee amount to be burned by the vortex\"},\"polRewardsPPM()\":{\"details\":\"returns the POL rewards ppm\"},\"poolCollections()\":{\"details\":\"returns the set of all valid pool collections\"},\"postUpgrade(bytes)\":{\"details\":\"performs post-upgrade initialization requirements: - this must can be called only once per-upgrade\"},\"registerPoolCollection(address)\":{\"details\":\"registers new pool collection with the network requirements: - the caller must be the admin of the contract\"},\"renounceRole(bytes32,address)\":{\"details\":\"Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `account`.\"},\"resume()\":{\"details\":\"resumes the network requirements: - the caller must have the ROLE_EMERGENCY_STOPPER privilege\"},\"revokeRole(bytes32,address)\":{\"details\":\"Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role.\"},\"roleAdmin()\":{\"details\":\"returns the admin role\"},\"roleEmergencyStopper()\":{\"details\":\"returns the emergency stopper role\"},\"roleMigrationManager()\":{\"details\":\"returns the migration manager role\"},\"roleNetworkFeeManager()\":{\"details\":\"returns the network fee manager role\"},\"setPOLRewardsPPM(uint32)\":{\"details\":\"set the POL rewards ppm\"},\"supportsInterface(bytes4)\":{\"details\":\"See {IERC165-supportsInterface}.\"},\"tradeBySourceAmount(address,address,uint256,uint256,uint256,address)\":{\"details\":\"performs a trade by providing the input source amount, sends the proceeds to the optional beneficiary (or to the address of the caller, in case it's not supplied), and returns the trade target amount requirements: - the caller must have approved the network to transfer the source tokens on its behalf (except for in the native token case)\"},\"tradeBySourceAmountArb(address,address,uint256,uint256,uint256,address)\":{\"details\":\"performs a trade by providing the input source amount, sends the proceeds to the optional beneficiary (or to the address of the caller, in case it's not supplied), and returns the trade target amount requirements: - the caller must have approved the network to transfer the source tokens on its behalf (except for in the native token case) - the caller must be the _bancorArbitrage contract\"},\"tradeByTargetAmount(address,address,uint256,uint256,uint256,address)\":{\"details\":\"performs a trade by providing the output target amount, sends the proceeds to the optional beneficiary (or to the address of the caller, in case it's not supplied), and returns the trade source amount requirements: - the caller must have approved the network to transfer the source tokens on its behalf (except for in the native token case)\"},\"tradeByTargetAmountArb(address,address,uint256,uint256,uint256,address)\":{\"details\":\"performs a trade by providing the output target amount, sends the proceeds to the optional beneficiary (or to the address of the caller, in case it's not supplied), and returns the trade source amount requirements: - the caller must have approved the network to transfer the source tokens on its behalf (except for in the native token case) - the caller must be the _bancorArbitrage contract\"},\"unregisterPoolCollection(address)\":{\"details\":\"unregisters an existing pool collection from the network requirements: - the caller must be the admin of the contract\"},\"withdraw(uint256)\":{\"details\":\"withdraws liquidity and returns the withdrawn amount requirements: - the provider must have already initiated a withdrawal and received the specified id - the specified withdrawal request is eligible for completion - the provider must have approved the network to transfer vBNT amount on its behalf, when withdrawing BNT liquidity\"},\"withdrawNetworkFees(address)\":{\"details\":\"withdraws pending network fees, and returns the amount of fees withdrawn requirements: - the caller must have the ROLE_NETWORK_FEE_MANAGER privilege\"},\"withdrawPOL(address)\":{\"details\":\"withdraws surplus tokens from a given pool to CarbonPOL contract, and disables trading on the given pool if it is not already disabled\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/network/BancorNetwork.sol\":\"BancorNetwork\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"none\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@bancor/token-governance/contracts/IClaimable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.6.12;\\n\\n/// @title Claimable contract interface\\ninterface IClaimable {\\n function owner() external view returns (address);\\n\\n function transferOwnership(address newOwner) external;\\n\\n function acceptOwnership() external;\\n}\\n\",\"keccak256\":\"0x52c14ec7eac845d8ca8b3acb46bdf913e6ede14f4e8887f61dc35f93399e2962\",\"license\":\"MIT\"},\"@bancor/token-governance/contracts/IMintableToken.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.6.12;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport \\\"./IClaimable.sol\\\";\\n\\n/// @title Mintable Token interface\\ninterface IMintableToken is IERC20, IClaimable {\\n function issue(address to, uint256 amount) external;\\n\\n function destroy(address from, uint256 amount) external;\\n}\\n\",\"keccak256\":\"0x87ddb17ba18575515a97f615a84225bdb1fdf756eeae626287b94b2a3517a93b\",\"license\":\"MIT\"},\"@bancor/token-governance/contracts/ITokenGovernance.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.6.12;\\n\\nimport \\\"./IMintableToken.sol\\\";\\n\\n/// @title The interface for mintable/burnable token governance.\\ninterface ITokenGovernance {\\n // The address of the mintable ERC20 token.\\n function token() external view returns (IMintableToken);\\n\\n /// @dev Mints new tokens.\\n ///\\n /// @param to Account to receive the new amount.\\n /// @param amount Amount to increase the supply by.\\n ///\\n function mint(address to, uint256 amount) external;\\n\\n /// @dev Burns tokens from the caller.\\n ///\\n /// @param amount Amount to decrease the supply by.\\n ///\\n function burn(uint256 amount) external;\\n}\\n\",\"keccak256\":\"0xebcf7997ed758d71a551597c3f7874b2b2fd91a72bbe50c634b02506f04e95b2\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControlEnumerable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IAccessControlEnumerableUpgradeable.sol\\\";\\nimport \\\"./AccessControlUpgradeable.sol\\\";\\nimport \\\"../utils/structs/EnumerableSetUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Extension of {AccessControl} that allows enumerating the members of each role.\\n */\\nabstract contract AccessControlEnumerableUpgradeable is Initializable, IAccessControlEnumerableUpgradeable, AccessControlUpgradeable {\\n function __AccessControlEnumerable_init() internal onlyInitializing {\\n }\\n\\n function __AccessControlEnumerable_init_unchained() internal onlyInitializing {\\n }\\n using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet;\\n\\n mapping(bytes32 => EnumerableSetUpgradeable.AddressSet) private _roleMembers;\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IAccessControlEnumerableUpgradeable).interfaceId || super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev Returns one of the accounts that have `role`. `index` must be a\\n * value between 0 and {getRoleMemberCount}, non-inclusive.\\n *\\n * Role bearers are not sorted in any particular way, and their ordering may\\n * change at any point.\\n *\\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\\n * you perform all queries on the same block. See the following\\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\\n * for more information.\\n */\\n function getRoleMember(bytes32 role, uint256 index) public view virtual override returns (address) {\\n return _roleMembers[role].at(index);\\n }\\n\\n /**\\n * @dev Returns the number of accounts that have `role`. Can be used\\n * together with {getRoleMember} to enumerate all bearers of a role.\\n */\\n function getRoleMemberCount(bytes32 role) public view virtual override returns (uint256) {\\n return _roleMembers[role].length();\\n }\\n\\n /**\\n * @dev Overload {_grantRole} to track enumerable memberships\\n */\\n function _grantRole(bytes32 role, address account) internal virtual override {\\n super._grantRole(role, account);\\n _roleMembers[role].add(account);\\n }\\n\\n /**\\n * @dev Overload {_revokeRole} to track enumerable memberships\\n */\\n function _revokeRole(bytes32 role, address account) internal virtual override {\\n super._revokeRole(role, account);\\n _roleMembers[role].remove(account);\\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\":\"0xc2dfd6ba9449f61b6b03b262182faf302f093a8c05dd10792aeecb4ed1663c0c\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IAccessControlUpgradeable.sol\\\";\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../utils/StringsUpgradeable.sol\\\";\\nimport \\\"../utils/introspection/ERC165Upgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module that allows children to implement role-based access\\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\\n * members except through off-chain means by accessing the contract event logs. Some\\n * applications may benefit from on-chain enumerability, for those cases see\\n * {AccessControlEnumerable}.\\n *\\n * Roles are referred to by their `bytes32` identifier. These should be exposed\\n * in the external API and be unique. The best way to achieve this is by\\n * using `public constant` hash digests:\\n *\\n * ```\\n * bytes32 public constant MY_ROLE = keccak256(\\\"MY_ROLE\\\");\\n * ```\\n *\\n * Roles can be used to represent a set of permissions. To restrict access to a\\n * function call, use {hasRole}:\\n *\\n * ```\\n * function foo() public {\\n * require(hasRole(MY_ROLE, msg.sender));\\n * ...\\n * }\\n * ```\\n *\\n * Roles can be granted and revoked dynamically via the {grantRole} and\\n * {revokeRole} functions. Each role has an associated admin role, and only\\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\\n *\\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\\n * that only accounts with this role will be able to grant or revoke other\\n * roles. More complex role relationships can be created by using\\n * {_setRoleAdmin}.\\n *\\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\\n * grant and revoke this role. Extra precautions should be taken to secure\\n * accounts that have been granted it.\\n */\\nabstract contract AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControlUpgradeable, ERC165Upgradeable {\\n function __AccessControl_init() internal onlyInitializing {\\n }\\n\\n function __AccessControl_init_unchained() internal onlyInitializing {\\n }\\n struct RoleData {\\n mapping(address => bool) members;\\n bytes32 adminRole;\\n }\\n\\n mapping(bytes32 => RoleData) private _roles;\\n\\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\\n\\n /**\\n * @dev Modifier that checks that an account has a specific role. Reverts\\n * with a standardized message including the required role.\\n *\\n * The format of the revert reason is given by the following regular expression:\\n *\\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\\n *\\n * _Available since v4.1._\\n */\\n modifier onlyRole(bytes32 role) {\\n _checkRole(role, _msgSender());\\n _;\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IAccessControlUpgradeable).interfaceId || super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) public view virtual override returns (bool) {\\n return _roles[role].members[account];\\n }\\n\\n /**\\n * @dev Revert with a standard message if `account` is missing `role`.\\n *\\n * The format of the revert reason is given by the following regular expression:\\n *\\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\\n */\\n function _checkRole(bytes32 role, address account) internal view virtual {\\n if (!hasRole(role, account)) {\\n revert(\\n string(\\n abi.encodePacked(\\n \\\"AccessControl: account \\\",\\n StringsUpgradeable.toHexString(uint160(account), 20),\\n \\\" is missing role \\\",\\n StringsUpgradeable.toHexString(uint256(role), 32)\\n )\\n )\\n );\\n }\\n }\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {\\n return _roles[role].adminRole;\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\\n _grantRole(role, account);\\n }\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\\n _revokeRole(role, account);\\n }\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n */\\n function renounceRole(bytes32 role, address account) public virtual override {\\n require(account == _msgSender(), \\\"AccessControl: can only renounce roles for self\\\");\\n\\n _revokeRole(role, account);\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event. Note that unlike {grantRole}, this function doesn't perform any\\n * checks on the calling account.\\n *\\n * [WARNING]\\n * ====\\n * This function should only be called from the constructor when setting\\n * up the initial roles for the system.\\n *\\n * Using this function in any other way is effectively circumventing the admin\\n * system imposed by {AccessControl}.\\n * ====\\n *\\n * NOTE: This function is deprecated in favor of {_grantRole}.\\n */\\n function _setupRole(bytes32 role, address account) internal virtual {\\n _grantRole(role, account);\\n }\\n\\n /**\\n * @dev Sets `adminRole` as ``role``'s admin role.\\n *\\n * Emits a {RoleAdminChanged} event.\\n */\\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\\n bytes32 previousAdminRole = getRoleAdmin(role);\\n _roles[role].adminRole = adminRole;\\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * Internal function without access restriction.\\n */\\n function _grantRole(bytes32 role, address account) internal virtual {\\n if (!hasRole(role, account)) {\\n _roles[role].members[account] = true;\\n emit RoleGranted(role, account, _msgSender());\\n }\\n }\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * Internal function without access restriction.\\n */\\n function _revokeRole(bytes32 role, address account) internal virtual {\\n if (hasRole(role, account)) {\\n _roles[role].members[account] = false;\\n emit RoleRevoked(role, account, _msgSender());\\n }\\n }\\n\\n /**\\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\":\"0x2ffe9655abbb3741fcb84ad10e2f628d5dbec46b3f84a69ceec4752e807e2757\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/access/IAccessControlEnumerableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IAccessControlUpgradeable.sol\\\";\\n\\n/**\\n * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.\\n */\\ninterface IAccessControlEnumerableUpgradeable is IAccessControlUpgradeable {\\n /**\\n * @dev Returns one of the accounts that have `role`. `index` must be a\\n * value between 0 and {getRoleMemberCount}, non-inclusive.\\n *\\n * Role bearers are not sorted in any particular way, and their ordering may\\n * change at any point.\\n *\\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\\n * you perform all queries on the same block. See the following\\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\\n * for more information.\\n */\\n function getRoleMember(bytes32 role, uint256 index) external view returns (address);\\n\\n /**\\n * @dev Returns the number of accounts that have `role`. Can be used\\n * together with {getRoleMember} to enumerate all bearers of a role.\\n */\\n function getRoleMemberCount(bytes32 role) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x7acbc538aad6eb4614e26612a8c5c0149bb8808db95e2638d245a8365f63e572\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/access/IAccessControlUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev External interface of AccessControl declared to support ERC165 detection.\\n */\\ninterface IAccessControlUpgradeable {\\n /**\\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\\n *\\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\\n * {RoleAdminChanged} not being emitted signaling this.\\n *\\n * _Available since v3.1._\\n */\\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\\n\\n /**\\n * @dev Emitted when `account` is granted `role`.\\n *\\n * `sender` is the account that originated the contract call, an admin role\\n * bearer except when using {AccessControl-_setupRole}.\\n */\\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Emitted when `account` is revoked `role`.\\n *\\n * `sender` is the account that originated the contract call:\\n * - if using `revokeRole`, it is the admin role bearer\\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\\n */\\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) external view returns (bool);\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function grantRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function revokeRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been granted `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n */\\n function renounceRole(bytes32 role, address account) external;\\n}\\n\",\"keccak256\":\"0xb8f5302f12138c5561362e88a78d061573e6298b7a1a5afe84a1e2c8d4d5aeaa\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.0;\\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 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the\\n * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() initializer {}\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n */\\n bool private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Modifier to protect an initializer function from being invoked twice.\\n */\\n modifier initializer() {\\n // If the contract is initializing we ignore whether _initialized is set in order to support multiple\\n // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the\\n // contract may have been reentered.\\n require(_initializing ? _isConstructor() : !_initialized, \\\"Initializable: contract is already initialized\\\");\\n\\n bool isTopLevelCall = !_initializing;\\n if (isTopLevelCall) {\\n _initializing = true;\\n _initialized = true;\\n }\\n\\n _;\\n\\n if (isTopLevelCall) {\\n _initializing = false;\\n }\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} modifier, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n function _isConstructor() private view returns (bool) {\\n return !AddressUpgradeable.isContract(address(this));\\n }\\n}\\n\",\"keccak256\":\"0x372b0bc04e3b4c074559bbbfb1317afddb56de5504158ca25a7f9cd403980445\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which allows children to implement an emergency stop\\n * mechanism that can be triggered by an authorized account.\\n *\\n * This module is used through inheritance. It will make available the\\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\\n * the functions of your contract. Note that they will not be pausable by\\n * simply including this module, only once the modifiers are put in place.\\n */\\nabstract contract PausableUpgradeable is Initializable, ContextUpgradeable {\\n /**\\n * @dev Emitted when the pause is triggered by `account`.\\n */\\n event Paused(address account);\\n\\n /**\\n * @dev Emitted when the pause is lifted by `account`.\\n */\\n event Unpaused(address account);\\n\\n bool private _paused;\\n\\n /**\\n * @dev Initializes the contract in unpaused state.\\n */\\n function __Pausable_init() internal onlyInitializing {\\n __Pausable_init_unchained();\\n }\\n\\n function __Pausable_init_unchained() internal onlyInitializing {\\n _paused = false;\\n }\\n\\n /**\\n * @dev Returns true if the contract is paused, and false otherwise.\\n */\\n function paused() public view virtual returns (bool) {\\n return _paused;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is not paused.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n modifier whenNotPaused() {\\n require(!paused(), \\\"Pausable: paused\\\");\\n _;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is paused.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n modifier whenPaused() {\\n require(paused(), \\\"Pausable: not paused\\\");\\n _;\\n }\\n\\n /**\\n * @dev Triggers stopped state.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n function _pause() internal virtual whenNotPaused {\\n _paused = true;\\n emit Paused(_msgSender());\\n }\\n\\n /**\\n * @dev Returns to normal state.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n function _unpause() internal virtual whenPaused {\\n _paused = false;\\n emit Unpaused(_msgSender());\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x041af89e5e60b74e1203d5a34614c9de379726f52ecb8cf064cab78b9fdcdf9d\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module that helps prevent reentrant calls to a function.\\n *\\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\\n * available, which can be applied to functions to make sure there are no nested\\n * (reentrant) calls to them.\\n *\\n * Note that because there is a single `nonReentrant` guard, functions marked as\\n * `nonReentrant` may not call one another. This can be worked around by making\\n * those functions `private`, and then adding `external` `nonReentrant` entry\\n * points to them.\\n *\\n * TIP: If you would like to learn more about reentrancy and alternative ways\\n * to protect against it, check out our blog post\\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\\n */\\nabstract contract ReentrancyGuardUpgradeable is Initializable {\\n // Booleans are more expensive than uint256 or any type that takes up a full\\n // word because each write operation emits an extra SLOAD to first read the\\n // slot's contents, replace the bits taken up by the boolean, and then write\\n // back. This is the compiler's defense against contract upgrades and\\n // pointer aliasing, and it cannot be disabled.\\n\\n // The values being non-zero value makes deployment a bit more expensive,\\n // but in exchange the refund on every call to nonReentrant will be lower in\\n // amount. Since refunds are capped to a percentage of the total\\n // transaction's gas, it is best to keep them low in cases like this one, to\\n // increase the likelihood of the full refund coming into effect.\\n uint256 private constant _NOT_ENTERED = 1;\\n uint256 private constant _ENTERED = 2;\\n\\n uint256 private _status;\\n\\n function __ReentrancyGuard_init() internal onlyInitializing {\\n __ReentrancyGuard_init_unchained();\\n }\\n\\n function __ReentrancyGuard_init_unchained() internal onlyInitializing {\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Prevents a contract from calling itself, directly or indirectly.\\n * Calling a `nonReentrant` function from another `nonReentrant`\\n * function is not supported. It is possible to prevent this from happening\\n * by making the `nonReentrant` function external, and making it call a\\n * `private` function that does the actual work.\\n */\\n modifier nonReentrant() {\\n // 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 /**\\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\":\"0x8cc03c5ac17e8a7396e487cda41fc1f1dfdb91db7d528e6da84bee3b6dd7e167\",\"license\":\"MIT\"},\"@openzeppelin/contracts-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\"},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract ContextUpgradeable is Initializable {\\n function __Context_init() internal onlyInitializing {\\n }\\n\\n function __Context_init_unchained() internal onlyInitializing {\\n }\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary StringsUpgradeable {\\n bytes16 private constant _HEX_SYMBOLS = \\\"0123456789abcdef\\\";\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n // Inspired by OraclizeAPI's implementation - MIT licence\\n // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol\\n\\n if (value == 0) {\\n return \\\"0\\\";\\n }\\n uint256 temp = value;\\n uint256 digits;\\n while (temp != 0) {\\n digits++;\\n temp /= 10;\\n }\\n bytes memory buffer = new bytes(digits);\\n while (value != 0) {\\n digits -= 1;\\n buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));\\n value /= 10;\\n }\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n if (value == 0) {\\n return \\\"0x00\\\";\\n }\\n uint256 temp = value;\\n uint256 length = 0;\\n while (temp != 0) {\\n length++;\\n temp >>= 8;\\n }\\n return toHexString(value, length);\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _HEX_SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n}\\n\",\"keccak256\":\"0x398d3323c1932a5986bf36be7c57593e121e69d5db5b6574b4ee0d031443de37\",\"license\":\"MIT\"},\"@openzeppelin/contracts-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\"},\"@openzeppelin/contracts-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\"},\"@openzeppelin/contracts-upgradeable/utils/structs/EnumerableSetUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (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 EnumerableSetUpgradeable {\\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\":\"0x0004699ba89fa356eb0d58d815b42dcf52eccd2765e95256631b838bce2556bc\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/ERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.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.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How\\n * to implement supply mechanisms].\\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 * The default value of {decimals} is 18. To select a different value for\\n * {decimals} you should overload it.\\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 value {ERC20} uses, unless this function is\\n * 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(\\n address from,\\n address to,\\n uint256 amount\\n ) 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, _allowances[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 = _allowances[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 `sender` to `recipient`.\\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(\\n address from,\\n address to,\\n uint256 amount\\n ) 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 }\\n _balances[to] += amount;\\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 _balances[account] += amount;\\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 }\\n _totalSupply -= amount;\\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(\\n address owner,\\n address spender,\\n uint256 amount\\n ) 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 Spend `amount` form the allowance of `owner` toward `spender`.\\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(\\n address owner,\\n address spender,\\n uint256 amount\\n ) 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(\\n address from,\\n address to,\\n uint256 amount\\n ) 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(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual {}\\n}\\n\",\"keccak256\":\"0xdadd41acb749920eccf40aeaa8d291adf9751399a7343561bad13e7a8d99be0b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n\\n /**\\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\":\"0xbbc8ac883ac3c0078ce5ad3e288fbb3ffcc8a30c3a98c0fda0114d64fc44fca2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x8de418a5503946cabe331f35fe242d3201a73f67f77aaeb7110acb1f30423aca\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\\n *\\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\\n * need to send a transaction, and thus is not required to hold Ether at all.\\n */\\ninterface IERC20Permit {\\n /**\\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\\n * given ``owner``'s signed approval.\\n *\\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\\n * ordering also apply here.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `deadline` must be a timestamp in the future.\\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\\n * over the EIP712-formatted function arguments.\\n * - the signature must use ``owner``'s current nonce (see {nonces}).\\n *\\n * For more information on the signature format, see the\\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\\n * section].\\n */\\n function permit(\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external;\\n\\n /**\\n * @dev Returns the current nonce for `owner`. This value must be\\n * included whenever a signature is generated for {permit}.\\n *\\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\\n * prevents a signature from being used multiple times.\\n */\\n function nonces(address owner) external view returns (uint256);\\n\\n /**\\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0xf41ca991f30855bf80ffd11e9347856a517b977f0a6c2d52e6421a99b7840329\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)\\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\":\"0xc3d946432c0ddbb1f846a0d3985be71299df331b91d06732152117f62f0be2b5\",\"license\":\"MIT\"},\"@openzeppelin/contracts/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\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/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/network/BancorNetwork.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { Address } from \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport { SafeERC20 } from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\nimport { ReentrancyGuardUpgradeable } from \\\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\\\";\\nimport { EnumerableSetUpgradeable } from \\\"@openzeppelin/contracts-upgradeable/utils/structs/EnumerableSetUpgradeable.sol\\\";\\nimport { PausableUpgradeable } from \\\"@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol\\\";\\n\\nimport { ITokenGovernance } from \\\"@bancor/token-governance/contracts/ITokenGovernance.sol\\\";\\n\\nimport { IVersioned } from \\\"../utility/interfaces/IVersioned.sol\\\";\\nimport { PPM_RESOLUTION } from \\\"../utility/Constants.sol\\\";\\nimport { Upgradeable } from \\\"../utility/Upgradeable.sol\\\";\\nimport { Time } from \\\"../utility/Time.sol\\\";\\nimport { MathEx } from \\\"../utility/MathEx.sol\\\";\\n\\n// prettier-ignore\\nimport {\\n Utils,\\n AlreadyExists,\\n DoesNotExist,\\n InvalidToken,\\n InvalidPool,\\nNotEmpty\\n} from \\\"../utility/Utils.sol\\\";\\n\\nimport { ROLE_ASSET_MANAGER } from \\\"../vaults/interfaces/IVault.sol\\\";\\nimport { IMasterVault } from \\\"../vaults/interfaces/IMasterVault.sol\\\";\\nimport { IExternalProtectionVault } from \\\"../vaults/interfaces/IExternalProtectionVault.sol\\\";\\n\\nimport { Token } from \\\"../token/Token.sol\\\";\\nimport { TokenLibrary } from \\\"../token/TokenLibrary.sol\\\";\\n\\nimport { IPoolCollection, TradeAmountAndFee, PoolLiquidity } from \\\"../pools/interfaces/IPoolCollection.sol\\\";\\nimport { IPoolMigrator } from \\\"../pools/interfaces/IPoolMigrator.sol\\\";\\n\\n// prettier-ignore\\nimport {\\n IBNTPool,\\n ROLE_BNT_MANAGER,\\n ROLE_VAULT_MANAGER,\\n ROLE_FUNDING_MANAGER\\n} from \\\"../pools/interfaces/IBNTPool.sol\\\";\\n\\nimport { IPoolToken } from \\\"../pools/interfaces/IPoolToken.sol\\\";\\n\\nimport { INetworkSettings, NotWhitelisted, NotWhitelistedForPOL } from \\\"./interfaces/INetworkSettings.sol\\\";\\nimport { IPendingWithdrawals, CompletedWithdrawal } from \\\"./interfaces/IPendingWithdrawals.sol\\\";\\nimport { IBancorNetwork, IFlashLoanRecipient } from \\\"./interfaces/IBancorNetwork.sol\\\";\\n\\n/**\\n * @dev Bancor Network contract\\n */\\ncontract BancorNetwork is IBancorNetwork, Upgradeable, ReentrancyGuardUpgradeable, PausableUpgradeable, Time, Utils {\\n using Address for address payable;\\n using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet;\\n using TokenLibrary for Token;\\n using SafeERC20 for IPoolToken;\\n\\n error DeadlineExpired();\\n error DepositingDisabled();\\n error NativeTokenAmountMismatch();\\n error InsufficientFlashLoanReturn();\\n error PoolNotInSurplus();\\n\\n struct TradeParams {\\n uint256 amount;\\n uint256 limit;\\n bool bySourceAmount;\\n bool ignoreFees;\\n }\\n\\n struct TradeResult {\\n uint256 sourceAmount;\\n uint256 targetAmount;\\n uint256 tradingFeeAmount;\\n uint256 networkFeeAmount;\\n }\\n\\n struct TradeTokens {\\n Token sourceToken;\\n Token targetToken;\\n }\\n\\n struct TraderInfo {\\n address trader;\\n address beneficiary;\\n }\\n\\n // the migration manager role is required for migrating liquidity\\n bytes32 private constant ROLE_MIGRATION_MANAGER = keccak256(\\\"ROLE_MIGRATION_MANAGER\\\");\\n\\n // the emergency manager role is required to pause/unpause the network\\n bytes32 private constant ROLE_EMERGENCY_STOPPER = keccak256(\\\"ROLE_EMERGENCY_STOPPER\\\");\\n\\n // the network fee manager role is required to pull the accumulated pending network fees\\n bytes32 private constant ROLE_NETWORK_FEE_MANAGER = keccak256(\\\"ROLE_NETWORK_FEE_MANAGER\\\");\\n\\n // the address of the BNT token\\n IERC20 private immutable _bnt;\\n\\n // the address of the BNT token governance\\n ITokenGovernance private immutable _bntGovernance;\\n\\n // the address of the vBNT token\\n IERC20 private immutable _vbnt;\\n\\n // the address of the vBNT token governance\\n ITokenGovernance private immutable _vbntGovernance;\\n\\n // the network settings contract\\n INetworkSettings private immutable _networkSettings;\\n\\n // the master vault contract\\n IMasterVault private immutable _masterVault;\\n\\n // the address of the external protection vault\\n IExternalProtectionVault private immutable _externalProtectionVault;\\n\\n // the BNT pool token\\n IPoolToken internal immutable _bntPoolToken;\\n\\n // the Bancor arbitrage contract\\n address internal immutable _bancorArbitrage;\\n\\n // the carbon POL contract\\n address internal immutable _carbonPOL;\\n\\n // the BNT pool contract\\n IBNTPool internal _bntPool;\\n\\n // the pending withdrawals contract\\n IPendingWithdrawals internal _pendingWithdrawals;\\n\\n // the pool migrator contract\\n IPoolMigrator internal _poolMigrator;\\n\\n // the set of all valid pool collections\\n EnumerableSetUpgradeable.AddressSet private _poolCollections;\\n\\n // DEPRECATED (mapping(uint16 => IPoolCollection) _latestPoolCollections)\\n uint256 private _deprecated0;\\n\\n // the set of all pools\\n EnumerableSetUpgradeable.AddressSet private _liquidityPools;\\n\\n // a mapping between pools and their respective pool collections\\n mapping(Token => IPoolCollection) private _collectionByPool;\\n\\n // the pending network fee amount to be burned by the vortex\\n uint256 internal _pendingNetworkFeeAmount;\\n\\n bool private _depositingEnabled = true;\\n\\n uint32 private _polRewardsPPM;\\n\\n // upgrade forward-compatibility storage gap\\n uint256[MAX_GAP - 11] private __gap;\\n\\n /**\\n * @dev triggered when a new pool collection is added\\n */\\n event PoolCollectionAdded(uint16 indexed poolType, IPoolCollection indexed poolCollection);\\n\\n /**\\n * @dev triggered when an existing pool collection is removed\\n */\\n event PoolCollectionRemoved(uint16 indexed poolType, IPoolCollection indexed poolCollection);\\n\\n /**\\n * @dev triggered when a pool is created\\n */\\n event PoolCreated(Token indexed pool, IPoolCollection indexed poolCollection);\\n\\n /**\\n * @dev triggered when a new pool is added to a pool collection\\n */\\n event PoolAdded(Token indexed pool, IPoolCollection indexed poolCollection);\\n\\n /**\\n * @dev triggered when a new pool is removed from a pool collection\\n */\\n event PoolRemoved(Token indexed pool, IPoolCollection indexed poolCollection);\\n\\n /**\\n * @dev triggered when funds are migrated\\n */\\n event FundsMigrated(\\n bytes32 indexed contextId,\\n Token indexed token,\\n address indexed provider,\\n uint256 amount,\\n uint256 availableAmount,\\n uint256 originalAmount\\n );\\n\\n /**\\n * @dev triggered on a successful trade\\n */\\n event TokensTraded(\\n bytes32 indexed contextId,\\n Token indexed sourceToken,\\n Token indexed targetToken,\\n uint256 sourceAmount,\\n uint256 targetAmount,\\n uint256 bntAmount,\\n uint256 targetFeeAmount,\\n uint256 bntFeeAmount,\\n address trader\\n );\\n\\n /**\\n * @dev triggered when a flash-loan is completed\\n */\\n event FlashLoanCompleted(Token indexed token, address indexed borrower, uint256 amount, uint256 feeAmount);\\n\\n /**\\n * @dev triggered when network fees are withdrawn\\n */\\n event NetworkFeesWithdrawn(address indexed caller, address indexed recipient, uint256 amount);\\n\\n /**\\n * @dev triggered when pool surplus tokens are withdrawn\\n */\\n event POLWithdrawn(address indexed caller, address indexed token, uint256 polTokenAmount, uint256 userReward);\\n\\n /**\\n * @dev triggered when POL rewards ppm is updated\\n */\\n event POLRewardsPPMUpdated(uint32 oldRewardsPPM, uint32 newRewardsPPM);\\n\\n /**\\n * @dev a \\\"virtual\\\" constructor that is only used to set immutable state variables\\n */\\n constructor(\\n ITokenGovernance initBNTGovernance,\\n ITokenGovernance initVBNTGovernance,\\n INetworkSettings initNetworkSettings,\\n IMasterVault initMasterVault,\\n IExternalProtectionVault initExternalProtectionVault,\\n IPoolToken initBNTPoolToken,\\n address bancorArbitrage,\\n address carbonPOL\\n )\\n validAddress(address(initBNTGovernance))\\n validAddress(address(initVBNTGovernance))\\n validAddress(address(initNetworkSettings))\\n validAddress(address(initMasterVault))\\n validAddress(address(initExternalProtectionVault))\\n validAddress(address(initBNTPoolToken))\\n validAddress(address(bancorArbitrage))\\n validAddress(address(carbonPOL))\\n {\\n _bntGovernance = initBNTGovernance;\\n _bnt = initBNTGovernance.token();\\n _vbntGovernance = initVBNTGovernance;\\n _vbnt = initVBNTGovernance.token();\\n\\n _networkSettings = initNetworkSettings;\\n _masterVault = initMasterVault;\\n _externalProtectionVault = initExternalProtectionVault;\\n _bntPoolToken = initBNTPoolToken;\\n _bancorArbitrage = bancorArbitrage;\\n _carbonPOL = carbonPOL;\\n }\\n\\n /**\\n * @dev fully initializes the contract and its parents\\n */\\n function initialize(\\n IBNTPool initBNTPool,\\n IPendingWithdrawals initPendingWithdrawals,\\n IPoolMigrator initPoolMigrator\\n )\\n external\\n validAddress(address(initBNTPool))\\n validAddress(address(initPendingWithdrawals))\\n validAddress(address(initPoolMigrator))\\n initializer\\n {\\n __BancorNetwork_init(initBNTPool, initPendingWithdrawals, initPoolMigrator);\\n }\\n\\n // solhint-disable func-name-mixedcase\\n\\n /**\\n * @dev initializes the contract and its parents\\n */\\n function __BancorNetwork_init(\\n IBNTPool initBNTPool,\\n IPendingWithdrawals initPendingWithdrawals,\\n IPoolMigrator initPoolMigrator\\n ) internal onlyInitializing {\\n __Upgradeable_init();\\n __ReentrancyGuard_init();\\n __Pausable_init();\\n\\n __BancorNetwork_init_unchained(initBNTPool, initPendingWithdrawals, initPoolMigrator);\\n }\\n\\n /**\\n * @dev performs contract-specific initialization\\n */\\n function __BancorNetwork_init_unchained(\\n IBNTPool initBNTPool,\\n IPendingWithdrawals initPendingWithdrawals,\\n IPoolMigrator initPoolMigrator\\n ) internal onlyInitializing {\\n _bntPool = initBNTPool;\\n _pendingWithdrawals = initPendingWithdrawals;\\n _poolMigrator = initPoolMigrator;\\n\\n // set up administrative roles\\n _setRoleAdmin(ROLE_MIGRATION_MANAGER, ROLE_ADMIN);\\n _setRoleAdmin(ROLE_EMERGENCY_STOPPER, ROLE_ADMIN);\\n _setRoleAdmin(ROLE_NETWORK_FEE_MANAGER, ROLE_ADMIN);\\n\\n _depositingEnabled = true;\\n\\n _setPOLRewardsPPM(2000);\\n }\\n\\n // solhint-enable func-name-mixedcase\\n\\n modifier depositsEnabled() {\\n _depositsEnabled();\\n\\n _;\\n }\\n\\n function _depositsEnabled() internal view {\\n if (!_depositingEnabled) {\\n revert DepositingDisabled();\\n }\\n }\\n\\n receive() external payable {}\\n\\n /**\\n * @inheritdoc Upgradeable\\n */\\n function version() public pure override(IVersioned, Upgradeable) returns (uint16) {\\n return 9;\\n }\\n\\n /**\\n * @dev returns the migration manager role\\n */\\n function roleMigrationManager() external pure returns (bytes32) {\\n return ROLE_MIGRATION_MANAGER;\\n }\\n\\n /**\\n * @dev returns the emergency stopper role\\n */\\n function roleEmergencyStopper() external pure returns (bytes32) {\\n return ROLE_EMERGENCY_STOPPER;\\n }\\n\\n /**\\n * @dev returns the network fee manager role\\n */\\n function roleNetworkFeeManager() external pure returns (bytes32) {\\n return ROLE_NETWORK_FEE_MANAGER;\\n }\\n\\n /**\\n * @dev returns the pending network fee amount to be burned by the vortex\\n */\\n function pendingNetworkFeeAmount() external view returns (uint256) {\\n return _pendingNetworkFeeAmount;\\n }\\n\\n /**\\n * @dev registers new pool collection with the network\\n *\\n * requirements:\\n *\\n * - the caller must be the admin of the contract\\n */\\n function registerPoolCollection(\\n IPoolCollection newPoolCollection\\n ) external validAddress(address(newPoolCollection)) onlyAdmin nonReentrant {\\n // verify that there is no pool collection of the same type and version\\n uint16 newPoolType = newPoolCollection.poolType();\\n uint16 newPoolVersion = newPoolCollection.version();\\n\\n IPoolCollection poolCollection = _findPoolCollection(newPoolType, newPoolVersion);\\n if (poolCollection != IPoolCollection(address(0)) || !_poolCollections.add(address(newPoolCollection))) {\\n revert AlreadyExists();\\n }\\n\\n _setAccessRoles(newPoolCollection, true);\\n\\n emit PoolCollectionAdded({ poolType: newPoolCollection.poolType(), poolCollection: newPoolCollection });\\n }\\n\\n /**\\n * @dev unregisters an existing pool collection from the network\\n *\\n * requirements:\\n *\\n * - the caller must be the admin of the contract\\n */\\n function unregisterPoolCollection(\\n IPoolCollection poolCollection\\n ) external validAddress(address(poolCollection)) onlyAdmin nonReentrant {\\n // verify that no pools are associated with the specified pool collection\\n if (poolCollection.poolCount() != 0) {\\n revert NotEmpty();\\n }\\n\\n if (!_poolCollections.remove(address(poolCollection))) {\\n revert DoesNotExist();\\n }\\n\\n _setAccessRoles(poolCollection, false);\\n\\n emit PoolCollectionRemoved({ poolType: poolCollection.poolType(), poolCollection: poolCollection });\\n }\\n\\n /**\\n * @inheritdoc IBancorNetwork\\n */\\n function poolCollections() external view returns (IPoolCollection[] memory) {\\n uint256 length = _poolCollections.length();\\n IPoolCollection[] memory list = new IPoolCollection[](length);\\n for (uint256 i = 0; i < length; i++) {\\n list[i] = IPoolCollection(_poolCollections.at(i));\\n }\\n return list;\\n }\\n\\n /**\\n * @inheritdoc IBancorNetwork\\n */\\n function liquidityPools() external view returns (Token[] memory) {\\n uint256 length = _liquidityPools.length();\\n Token[] memory list = new Token[](length);\\n for (uint256 i = 0; i < length; i++) {\\n list[i] = Token(_liquidityPools.at(i));\\n }\\n return list;\\n }\\n\\n /**\\n * @inheritdoc IBancorNetwork\\n */\\n function collectionByPool(Token pool) external view returns (IPoolCollection) {\\n return _collectionByPool[pool];\\n }\\n\\n /**\\n * @inheritdoc IBancorNetwork\\n */\\n function createPools(\\n Token[] calldata tokens,\\n IPoolCollection poolCollection\\n ) external validAddress(address(poolCollection)) onlyAdmin nonReentrant {\\n if (!_poolCollections.contains(address(poolCollection))) {\\n revert DoesNotExist();\\n }\\n\\n uint256 length = tokens.length;\\n for (uint256 i = 0; i < length; i++) {\\n _createPool(tokens[i], poolCollection);\\n }\\n }\\n\\n /**\\n * @dev creates a new pool\\n */\\n function _createPool(Token token, IPoolCollection poolCollection) private {\\n _validAddress(address(token));\\n\\n if (token.isEqual(_bnt)) {\\n revert InvalidToken();\\n }\\n\\n if (!_liquidityPools.add(address(token))) {\\n revert AlreadyExists();\\n }\\n\\n // this is where the magic happens...\\n poolCollection.createPool(token);\\n\\n // add the pool collection to the reverse pool collection lookup\\n _collectionByPool[token] = poolCollection;\\n\\n emit PoolCreated({ pool: token, poolCollection: poolCollection });\\n emit PoolAdded({ pool: token, poolCollection: poolCollection });\\n }\\n\\n /**\\n * @inheritdoc IBancorNetwork\\n */\\n function migratePools(Token[] calldata pools, IPoolCollection newPoolCollection) external nonReentrant {\\n if (!_poolCollections.contains(address(newPoolCollection))) {\\n revert DoesNotExist();\\n }\\n\\n uint256 length = pools.length;\\n for (uint256 i = 0; i < length; i++) {\\n Token pool = pools[i];\\n\\n // request the pool migrator to migrate the pool to the new pool collection\\n _poolMigrator.migratePool(pool, newPoolCollection);\\n\\n IPoolCollection prevPoolCollection = _collectionByPool[pool];\\n\\n // update the mapping between pools and their respective pool collections\\n _collectionByPool[pool] = newPoolCollection;\\n\\n emit PoolRemoved(pool, prevPoolCollection);\\n emit PoolAdded(pool, newPoolCollection);\\n }\\n }\\n\\n /**\\n * @inheritdoc IBancorNetwork\\n */\\n function depositFor(\\n address provider,\\n Token pool,\\n uint256 tokenAmount\\n )\\n external\\n payable\\n depositsEnabled\\n validAddress(provider)\\n validAddress(address(pool))\\n greaterThanZero(tokenAmount)\\n whenNotPaused\\n nonReentrant\\n returns (uint256)\\n {\\n return _depositFor(provider, pool, tokenAmount, msg.sender);\\n }\\n\\n /**\\n * @inheritdoc IBancorNetwork\\n */\\n function deposit(\\n Token pool,\\n uint256 tokenAmount\\n )\\n external\\n payable\\n depositsEnabled\\n validAddress(address(pool))\\n greaterThanZero(tokenAmount)\\n whenNotPaused\\n nonReentrant\\n returns (uint256)\\n {\\n return _depositFor(msg.sender, pool, tokenAmount, msg.sender);\\n }\\n\\n /**\\n * @inheritdoc IBancorNetwork\\n */\\n function initWithdrawal(\\n IPoolToken poolToken,\\n uint256 poolTokenAmount\\n )\\n external\\n validAddress(address(poolToken))\\n greaterThanZero(poolTokenAmount)\\n whenNotPaused\\n nonReentrant\\n returns (uint256)\\n {\\n return _initWithdrawal(msg.sender, poolToken, poolTokenAmount);\\n }\\n\\n /**\\n * @inheritdoc IBancorNetwork\\n */\\n function cancelWithdrawal(uint256 id) external whenNotPaused nonReentrant returns (uint256) {\\n return _pendingWithdrawals.cancelWithdrawal(msg.sender, id);\\n }\\n\\n /**\\n * @inheritdoc IBancorNetwork\\n */\\n function withdraw(uint256 id) external whenNotPaused nonReentrant returns (uint256) {\\n address provider = msg.sender;\\n bytes32 contextId = _withdrawContextId(id, provider);\\n\\n // complete the withdrawal and claim the locked pool tokens\\n CompletedWithdrawal memory completedRequest = _pendingWithdrawals.completeWithdrawal(contextId, provider, id);\\n\\n if (completedRequest.poolToken == _bntPoolToken) {\\n return _withdrawBNT(contextId, provider, completedRequest);\\n }\\n\\n return _withdrawBaseToken(contextId, provider, completedRequest);\\n }\\n\\n /**\\n * @inheritdoc IBancorNetwork\\n */\\n function withdrawPOL(Token pool) external whenNotPaused nonReentrant returns (uint256) {\\n // verify pool is whitelisted\\n if (!_networkSettings.isTokenWhitelistedForPOL(pool)) {\\n revert NotWhitelistedForPOL();\\n }\\n\\n // verify pool collection exists and retrieve it\\n IPoolCollection poolCollection = _poolCollection(pool);\\n\\n // get token vault balance and staked balance\\n uint256 masterVaultBalance = pool.balanceOf(address(_masterVault));\\n PoolLiquidity memory poolLiquidity = poolCollection.poolLiquidity(pool);\\n uint256 stakedTokenBalance = poolLiquidity.stakedBalance;\\n\\n // verify pool is in surplus\\n if (stakedTokenBalance >= masterVaultBalance) {\\n revert PoolNotInSurplus();\\n }\\n\\n // disable pool trading\\n poolCollection.disableTradingByNetwork(pool);\\n\\n // calculate pool surplus amount and user reward\\n uint256 poolSurplus = masterVaultBalance - stakedTokenBalance;\\n uint256 userReward = MathEx.mulDivF(poolSurplus, _polRewardsPPM, PPM_RESOLUTION);\\n\\n // withdraw surplus tokens from master vault to POL contract\\n _masterVault.withdrawFunds(pool, payable(_carbonPOL), poolSurplus - userReward);\\n // withdraw user reward to caller\\n _masterVault.withdrawFunds(pool, payable(msg.sender), userReward);\\n // emit event\\n emit POLWithdrawn(msg.sender, address(pool), poolSurplus - userReward, userReward);\\n // return pool surplus amount\\n return poolSurplus;\\n }\\n\\n /**\\n * @inheritdoc IBancorNetwork\\n */\\n function tradeBySourceAmount(\\n Token sourceToken,\\n Token targetToken,\\n uint256 sourceAmount,\\n uint256 minReturnAmount,\\n uint256 deadline,\\n address beneficiary\\n ) external payable whenNotPaused nonReentrant returns (uint256) {\\n return\\n _tradeBySourceAmount(\\n sourceToken,\\n targetToken,\\n sourceAmount,\\n minReturnAmount,\\n deadline,\\n beneficiary,\\n msg.sender\\n );\\n }\\n\\n /**\\n * @inheritdoc IBancorNetwork\\n */\\n function tradeByTargetAmount(\\n Token sourceToken,\\n Token targetToken,\\n uint256 targetAmount,\\n uint256 maxSourceAmount,\\n uint256 deadline,\\n address beneficiary\\n ) external payable whenNotPaused nonReentrant returns (uint256) {\\n return\\n _tradeByTargetAmount(\\n sourceToken,\\n targetToken,\\n targetAmount,\\n maxSourceAmount,\\n deadline,\\n beneficiary,\\n msg.sender\\n );\\n }\\n\\n /**\\n * @inheritdoc IBancorNetwork\\n */\\n function tradeBySourceAmountArb(\\n Token sourceToken,\\n Token targetToken,\\n uint256 sourceAmount,\\n uint256 minReturnAmount,\\n uint256 deadline,\\n address beneficiary\\n ) external payable whenNotPaused only(_bancorArbitrage) returns (uint256) {\\n return\\n _tradeBySourceAmount(\\n sourceToken,\\n targetToken,\\n sourceAmount,\\n minReturnAmount,\\n deadline,\\n beneficiary,\\n msg.sender\\n );\\n }\\n\\n /**\\n * @inheritdoc IBancorNetwork\\n */\\n function tradeByTargetAmountArb(\\n Token sourceToken,\\n Token targetToken,\\n uint256 targetAmount,\\n uint256 maxSourceAmount,\\n uint256 deadline,\\n address beneficiary\\n ) external payable whenNotPaused only(_bancorArbitrage) returns (uint256) {\\n return\\n _tradeByTargetAmount(\\n sourceToken,\\n targetToken,\\n targetAmount,\\n maxSourceAmount,\\n deadline,\\n beneficiary,\\n msg.sender\\n );\\n }\\n\\n /**\\n * @inheritdoc IBancorNetwork\\n */\\n function flashLoan(\\n Token token,\\n uint256 amount,\\n IFlashLoanRecipient recipient,\\n bytes calldata data\\n )\\n external\\n validAddress(address(token))\\n greaterThanZero(amount)\\n validAddress(address(recipient))\\n whenNotPaused\\n nonReentrant\\n {\\n if (!token.isEqual(_bnt) && !_networkSettings.isTokenWhitelisted(token)) {\\n revert NotWhitelisted();\\n }\\n\\n uint256 feeAmount;\\n if (msg.sender == _bancorArbitrage) {\\n // exempt arb contract from fees\\n feeAmount = 0;\\n } else {\\n feeAmount = MathEx.mulDivF(amount, _networkSettings.flashLoanFeePPM(token), PPM_RESOLUTION);\\n }\\n\\n // save the current balance\\n uint256 prevBalance = token.balanceOf(address(this));\\n\\n // transfer the amount from the master vault to the recipient\\n _masterVault.withdrawFunds(token, payable(address(recipient)), amount);\\n\\n // invoke the recipient's callback\\n recipient.onFlashLoan(msg.sender, token.toIERC20(), amount, feeAmount, data);\\n\\n // ensure that the tokens + fee have been deposited back to the network\\n uint256 returnedAmount = token.balanceOf(address(this)) - prevBalance;\\n if (returnedAmount < amount + feeAmount) {\\n revert InsufficientFlashLoanReturn();\\n }\\n\\n // transfer the amount and the fee back to the vault\\n if (token.isNative()) {\\n payable(address(_masterVault)).sendValue(returnedAmount);\\n } else {\\n token.safeTransfer(payable(address(_masterVault)), returnedAmount);\\n }\\n\\n // notify the pool of accrued fees\\n if (token.isEqual(_bnt)) {\\n IBNTPool cachedBNTPool = _bntPool;\\n\\n cachedBNTPool.onFeesCollected(token, feeAmount, false);\\n } else {\\n // get the pool and verify that it exists\\n IPoolCollection poolCollection = _poolCollection(token);\\n poolCollection.onFeesCollected(token, feeAmount);\\n }\\n\\n emit FlashLoanCompleted({ token: token, borrower: msg.sender, amount: amount, feeAmount: feeAmount });\\n }\\n\\n /**\\n * @inheritdoc IBancorNetwork\\n */\\n function migrateLiquidity(\\n Token token,\\n address provider,\\n uint256 amount,\\n uint256 availableAmount,\\n uint256 originalAmount\\n ) external payable whenNotPaused onlyRoleMember(ROLE_MIGRATION_MANAGER) nonReentrant {\\n bytes32 contextId = keccak256(\\n abi.encodePacked(msg.sender, _time(), token, provider, amount, availableAmount, originalAmount)\\n );\\n\\n if (token.isEqual(_bnt)) {\\n _depositBNTFor(contextId, provider, amount, msg.sender, true, originalAmount);\\n } else {\\n _depositBaseTokenFor(contextId, provider, token, amount, msg.sender, availableAmount);\\n }\\n\\n emit FundsMigrated(contextId, token, provider, amount, availableAmount, originalAmount);\\n }\\n\\n /**\\n * @inheritdoc IBancorNetwork\\n */\\n function withdrawNetworkFees(\\n address recipient\\n )\\n external\\n whenNotPaused\\n onlyRoleMember(ROLE_NETWORK_FEE_MANAGER)\\n validAddress(recipient)\\n nonReentrant\\n returns (uint256)\\n {\\n uint256 currentPendingNetworkFeeAmount = _pendingNetworkFeeAmount;\\n if (currentPendingNetworkFeeAmount == 0) {\\n return 0;\\n }\\n\\n _pendingNetworkFeeAmount = 0;\\n\\n _masterVault.withdrawFunds(Token(address(_bnt)), payable(recipient), currentPendingNetworkFeeAmount);\\n\\n emit NetworkFeesWithdrawn(msg.sender, recipient, currentPendingNetworkFeeAmount);\\n\\n return currentPendingNetworkFeeAmount;\\n }\\n\\n /**\\n * @dev pauses the network\\n *\\n * requirements:\\n *\\n * - the caller must have the ROLE_EMERGENCY_STOPPER privilege\\n */\\n function pause() external onlyRoleMember(ROLE_EMERGENCY_STOPPER) {\\n _pause();\\n }\\n\\n /**\\n * @dev resumes the network\\n *\\n * requirements:\\n *\\n * - the caller must have the ROLE_EMERGENCY_STOPPER privilege\\n */\\n function resume() external onlyRoleMember(ROLE_EMERGENCY_STOPPER) {\\n _unpause();\\n }\\n\\n /**\\n * @dev returns whether deposits are enabled\\n */\\n function depositingEnabled() external view returns (bool) {\\n return _depositingEnabled;\\n }\\n\\n /**\\n * @dev enables/disables depositing into a given pool\\n *\\n * requirements:\\n *\\n * - the caller must be the owner of the contract\\n */\\n function enableDepositing(bool status) external onlyAdmin {\\n if (_depositingEnabled == status) {\\n return;\\n }\\n\\n _depositingEnabled = status;\\n }\\n\\n /**\\n * @dev returns the POL rewards ppm\\n */\\n function polRewardsPPM() external view returns (uint32) {\\n return _polRewardsPPM;\\n }\\n\\n /**\\n * @dev set the POL rewards ppm\\n */\\n function setPOLRewardsPPM(uint32 newRewardsPPM) external onlyAdmin validFee(newRewardsPPM) {\\n _setPOLRewardsPPM(newRewardsPPM);\\n }\\n\\n /**\\n * @dev set the POL rewards ppm\\n */\\n function _setPOLRewardsPPM(uint32 newRewardsPPM) private {\\n uint32 oldRewardsPPM = _polRewardsPPM;\\n if (oldRewardsPPM == newRewardsPPM) {\\n return;\\n }\\n\\n _polRewardsPPM = newRewardsPPM;\\n emit POLRewardsPPMUpdated(oldRewardsPPM, newRewardsPPM);\\n }\\n\\n /**\\n * @dev generates context ID for a deposit request\\n */\\n function _depositContextId(\\n address provider,\\n Token pool,\\n uint256 tokenAmount,\\n address caller\\n ) private view returns (bytes32) {\\n return keccak256(abi.encodePacked(caller, _time(), provider, pool, tokenAmount));\\n }\\n\\n /**\\n * @dev generates context ID for a withdraw request\\n */\\n function _withdrawContextId(uint256 id, address caller) private view returns (bytes32) {\\n return keccak256(abi.encodePacked(caller, _time(), id));\\n }\\n\\n /**\\n * @dev deposits liquidity for the specified provider from caller\\n *\\n * requirements:\\n *\\n * - the caller must have approved the network to transfer the liquidity tokens on its behalf\\n */\\n function _depositFor(address provider, Token pool, uint256 tokenAmount, address caller) private returns (uint256) {\\n bytes32 contextId = _depositContextId(provider, pool, tokenAmount, caller);\\n\\n if (pool.isEqual(_bnt)) {\\n return _depositBNTFor(contextId, provider, tokenAmount, caller, false, 0);\\n }\\n\\n return _depositBaseTokenFor(contextId, provider, pool, tokenAmount, caller, tokenAmount);\\n }\\n\\n /**\\n * @dev deposits BNT liquidity for the specified provider from caller\\n *\\n * requirements:\\n *\\n * - the caller must have approved the network to transfer BNT on its behalf\\n */\\n function _depositBNTFor(\\n bytes32 contextId,\\n address provider,\\n uint256 bntAmount,\\n address caller,\\n bool isMigrating,\\n uint256 originalAmount\\n ) private returns (uint256) {\\n if (msg.value > 0) {\\n revert NativeTokenAmountMismatch();\\n }\\n\\n IBNTPool cachedBNTPool = _bntPool;\\n\\n // transfer the tokens from the caller to the BNT pool\\n _bnt.transferFrom(caller, address(cachedBNTPool), bntAmount);\\n\\n // process BNT pool deposit\\n return cachedBNTPool.depositFor(contextId, provider, bntAmount, isMigrating, originalAmount);\\n }\\n\\n /**\\n * @dev deposits base token liquidity for the specified provider from sender\\n *\\n * requirements:\\n *\\n * - the caller must have approved the network to transfer base tokens to on its behalf\\n */\\n function _depositBaseTokenFor(\\n bytes32 contextId,\\n address provider,\\n Token pool,\\n uint256 tokenAmount,\\n address caller,\\n uint256 availableAmount\\n ) private returns (uint256) {\\n // transfer the tokens from the sender to the vault\\n _depositToMasterVault(pool, caller, availableAmount);\\n\\n // get the pool collection that managed this pool\\n IPoolCollection poolCollection = _poolCollection(pool);\\n\\n // process deposit to the base token pool (includes the native token pool)\\n return poolCollection.depositFor(contextId, provider, pool, tokenAmount);\\n }\\n\\n /**\\n * @dev handles BNT withdrawal\\n */\\n function _withdrawBNT(\\n bytes32 contextId,\\n address provider,\\n CompletedWithdrawal memory completedRequest\\n ) private returns (uint256) {\\n IBNTPool cachedBNTPool = _bntPool;\\n\\n // transfer the pool tokens to from the pending withdrawals contract to the BNT pool\\n completedRequest.poolToken.transferFrom(\\n address(_pendingWithdrawals),\\n address(cachedBNTPool),\\n completedRequest.poolTokenAmount\\n );\\n\\n // transfer vBNT from the caller to the BNT pool\\n _vbnt.transferFrom(provider, address(cachedBNTPool), completedRequest.poolTokenAmount);\\n\\n // call withdraw on the BNT pool\\n return\\n cachedBNTPool.withdraw(\\n contextId,\\n provider,\\n completedRequest.poolTokenAmount,\\n completedRequest.reserveTokenAmount\\n );\\n }\\n\\n /**\\n * @dev handles base token withdrawal\\n */\\n function _withdrawBaseToken(\\n bytes32 contextId,\\n address provider,\\n CompletedWithdrawal memory completedRequest\\n ) private returns (uint256) {\\n Token pool = completedRequest.poolToken.reserveToken();\\n\\n // get the pool collection that manages this pool\\n IPoolCollection poolCollection = _poolCollection(pool);\\n\\n // transfer the pool tokens to from the pending withdrawals contract to the pool collection\\n completedRequest.poolToken.transferFrom(\\n address(_pendingWithdrawals),\\n address(poolCollection),\\n completedRequest.poolTokenAmount\\n );\\n\\n // call withdraw on the base token pool - returns the amounts/breakdown\\n return\\n poolCollection.withdraw(\\n contextId,\\n provider,\\n pool,\\n completedRequest.poolTokenAmount,\\n completedRequest.reserveTokenAmount\\n );\\n }\\n\\n /**\\n * @dev verifies that the provided trade params are valid\\n */\\n function _verifyTradeParams(\\n Token sourceToken,\\n Token targetToken,\\n uint256 amount,\\n uint256 limit,\\n uint256 deadline\\n ) internal view {\\n _validAddress(address(sourceToken));\\n _validAddress(address(targetToken));\\n\\n if (sourceToken == targetToken) {\\n revert InvalidToken();\\n }\\n\\n _greaterThanZero(amount);\\n _greaterThanZero(limit);\\n\\n if (deadline < _time()) {\\n revert DeadlineExpired();\\n }\\n }\\n\\n /**\\n * @dev internal trade by source amount logic\\n */\\n function _tradeBySourceAmount(\\n Token sourceToken,\\n Token targetToken,\\n uint256 sourceAmount,\\n uint256 minReturnAmount,\\n uint256 deadline,\\n address beneficiary,\\n address sender\\n ) private returns (uint256) {\\n _verifyTradeParams(sourceToken, targetToken, sourceAmount, minReturnAmount, deadline);\\n bool _ignoreFees = false;\\n if (sender == _bancorArbitrage) {\\n _ignoreFees = true;\\n }\\n\\n return\\n _trade(\\n TradeTokens({ sourceToken: sourceToken, targetToken: targetToken }),\\n TradeParams({\\n bySourceAmount: true,\\n amount: sourceAmount,\\n limit: minReturnAmount,\\n ignoreFees: _ignoreFees\\n }),\\n TraderInfo({ trader: sender, beneficiary: beneficiary }),\\n deadline\\n );\\n }\\n\\n /**\\n * @dev internal trade by target amount logic\\n */\\n function _tradeByTargetAmount(\\n Token sourceToken,\\n Token targetToken,\\n uint256 targetAmount,\\n uint256 maxSourceAmount,\\n uint256 deadline,\\n address beneficiary,\\n address sender\\n ) private returns (uint256) {\\n _verifyTradeParams(sourceToken, targetToken, targetAmount, maxSourceAmount, deadline);\\n bool _ignoreFees = false;\\n if (sender == _bancorArbitrage) {\\n _ignoreFees = true;\\n }\\n\\n return\\n _trade(\\n TradeTokens({ sourceToken: sourceToken, targetToken: targetToken }),\\n TradeParams({\\n bySourceAmount: false,\\n amount: targetAmount,\\n limit: maxSourceAmount,\\n ignoreFees: _ignoreFees\\n }),\\n TraderInfo({ trader: sender, beneficiary: beneficiary }),\\n deadline\\n );\\n }\\n\\n /**\\n * @dev performs a trade by providing either the source or target amount:\\n *\\n * - when trading by the source amount, the amount represents the source amount and the limit is the minimum return\\n * amount\\n * - when trading by the target amount, the amount represents the target amount and the limit is the maximum source\\n * amount\\n *\\n * requirements:\\n *\\n * - the caller must have approved the network to transfer the source tokens on its behalf (except for in the\\n * native token case)\\n */\\n function _trade(\\n TradeTokens memory tokens,\\n TradeParams memory params,\\n TraderInfo memory traderInfo,\\n uint256 deadline\\n ) private returns (uint256) {\\n // ensure the beneficiary is set\\n if (traderInfo.beneficiary == address(0)) {\\n traderInfo.beneficiary = traderInfo.trader;\\n }\\n\\n bytes32 contextId = keccak256(\\n abi.encodePacked(\\n traderInfo.trader,\\n _time(),\\n tokens.sourceToken,\\n tokens.targetToken,\\n params.amount,\\n params.limit,\\n params.bySourceAmount,\\n deadline,\\n traderInfo.beneficiary\\n )\\n );\\n\\n // perform either a single or double hop trade, based on the source and the target pool\\n TradeResult memory firstHopTradeResult;\\n TradeResult memory lastHopTradeResult;\\n uint256 networkFeeAmount;\\n\\n if (tokens.sourceToken.isEqual(_bnt)) {\\n lastHopTradeResult = _tradeBNT(contextId, tokens.targetToken, true, params);\\n\\n firstHopTradeResult = lastHopTradeResult;\\n\\n networkFeeAmount = lastHopTradeResult.networkFeeAmount;\\n\\n emit TokensTraded({\\n contextId: contextId,\\n sourceToken: tokens.sourceToken,\\n targetToken: tokens.targetToken,\\n sourceAmount: lastHopTradeResult.sourceAmount,\\n targetAmount: lastHopTradeResult.targetAmount,\\n bntAmount: lastHopTradeResult.sourceAmount,\\n targetFeeAmount: lastHopTradeResult.tradingFeeAmount,\\n bntFeeAmount: 0,\\n trader: traderInfo.trader\\n });\\n } else if (tokens.targetToken.isEqual(_bnt)) {\\n lastHopTradeResult = _tradeBNT(contextId, tokens.sourceToken, false, params);\\n\\n firstHopTradeResult = lastHopTradeResult;\\n\\n networkFeeAmount = lastHopTradeResult.networkFeeAmount;\\n\\n emit TokensTraded({\\n contextId: contextId,\\n sourceToken: tokens.sourceToken,\\n targetToken: tokens.targetToken,\\n sourceAmount: lastHopTradeResult.sourceAmount,\\n targetAmount: lastHopTradeResult.targetAmount,\\n bntAmount: lastHopTradeResult.targetAmount,\\n targetFeeAmount: lastHopTradeResult.tradingFeeAmount,\\n bntFeeAmount: lastHopTradeResult.tradingFeeAmount,\\n trader: traderInfo.trader\\n });\\n } else {\\n (firstHopTradeResult, lastHopTradeResult) = _tradeBaseTokens(contextId, tokens, params);\\n\\n networkFeeAmount = firstHopTradeResult.networkFeeAmount + lastHopTradeResult.networkFeeAmount;\\n\\n emit TokensTraded({\\n contextId: contextId,\\n sourceToken: tokens.sourceToken,\\n targetToken: tokens.targetToken,\\n sourceAmount: firstHopTradeResult.sourceAmount,\\n targetAmount: lastHopTradeResult.targetAmount,\\n bntAmount: firstHopTradeResult.targetAmount,\\n targetFeeAmount: lastHopTradeResult.tradingFeeAmount,\\n bntFeeAmount: firstHopTradeResult.tradingFeeAmount,\\n trader: traderInfo.trader\\n });\\n }\\n\\n // transfer the tokens from the trader to the vault\\n _depositToMasterVault(tokens.sourceToken, traderInfo.trader, firstHopTradeResult.sourceAmount);\\n\\n // transfer the target tokens/native token to the beneficiary\\n _masterVault.withdrawFunds(\\n tokens.targetToken,\\n payable(traderInfo.beneficiary),\\n lastHopTradeResult.targetAmount\\n );\\n\\n // update the pending network fee amount to be burned by the vortex\\n _pendingNetworkFeeAmount += networkFeeAmount;\\n\\n return params.bySourceAmount ? lastHopTradeResult.targetAmount : firstHopTradeResult.sourceAmount;\\n }\\n\\n /**\\n * @dev performs a single hop between BNT and a base token trade by providing either the source or the target amount\\n *\\n * - when trading by the source amount, the amount represents the source amount and the limit is the minimum return\\n * amount\\n * - when trading by the target amount, the amount represents the target amount and the limit is the maximum source\\n * amount\\n */\\n function _tradeBNT(\\n bytes32 contextId,\\n Token pool,\\n bool fromBNT,\\n TradeParams memory params\\n ) private returns (TradeResult memory) {\\n TradeTokens memory tokens = fromBNT\\n ? TradeTokens({ sourceToken: Token(address(_bnt)), targetToken: pool })\\n : TradeTokens({ sourceToken: pool, targetToken: Token(address(_bnt)) });\\n\\n TradeAmountAndFee memory tradeAmountsAndFee = params.bySourceAmount\\n ? _poolCollection(pool).tradeBySourceAmount(\\n contextId,\\n tokens.sourceToken,\\n tokens.targetToken,\\n params.amount,\\n params.limit,\\n params.ignoreFees\\n )\\n : _poolCollection(pool).tradeByTargetAmount(\\n contextId,\\n tokens.sourceToken,\\n tokens.targetToken,\\n params.amount,\\n params.limit,\\n params.ignoreFees\\n );\\n\\n // if the target token is BNT, notify the BNT pool on collected fees (which shouldn't include the network fee\\n // amount, so we have to deduct it explicitly from the full trading fee amount)\\n if (!fromBNT) {\\n _bntPool.onFeesCollected(\\n pool,\\n tradeAmountsAndFee.tradingFeeAmount - tradeAmountsAndFee.networkFeeAmount,\\n true\\n );\\n }\\n\\n return\\n TradeResult({\\n sourceAmount: params.bySourceAmount ? params.amount : tradeAmountsAndFee.amount,\\n targetAmount: params.bySourceAmount ? tradeAmountsAndFee.amount : params.amount,\\n tradingFeeAmount: tradeAmountsAndFee.tradingFeeAmount,\\n networkFeeAmount: tradeAmountsAndFee.networkFeeAmount\\n });\\n }\\n\\n /**\\n * @dev performs a double hop trade between two base tokens by providing either the source or the target amount\\n *\\n * - when trading by the source amount, the amount represents the source amount and the limit is the minimum return\\n * amount\\n * - when trading by the target amount, the amount represents the target amount and the limit is the maximum source\\n * amount\\n */\\n function _tradeBaseTokens(\\n bytes32 contextId,\\n TradeTokens memory tokens,\\n TradeParams memory params\\n ) private returns (TradeResult memory, TradeResult memory) {\\n if (params.bySourceAmount) {\\n uint256 sourceAmount = params.amount;\\n uint256 minReturnAmount = params.limit;\\n\\n // trade source tokens to BNT (while accepting any return amount)\\n TradeResult memory targetHop1 = _tradeBNT(\\n contextId,\\n tokens.sourceToken,\\n false,\\n TradeParams({ bySourceAmount: true, amount: sourceAmount, limit: 1, ignoreFees: params.ignoreFees })\\n );\\n\\n // trade the received BNT target amount to target tokens (while respecting the minimum return amount)\\n TradeResult memory targetHop2 = _tradeBNT(\\n contextId,\\n tokens.targetToken,\\n true,\\n TradeParams({\\n bySourceAmount: true,\\n amount: targetHop1.targetAmount,\\n limit: minReturnAmount,\\n ignoreFees: params.ignoreFees\\n })\\n );\\n\\n return (targetHop1, targetHop2);\\n }\\n\\n uint256 targetAmount = params.amount;\\n uint256 maxSourceAmount = params.limit;\\n\\n // trade any amount of BNT to get the requested target amount (we will use the actual traded amount to restrict\\n // the trade from the source)\\n TradeResult memory sourceHop2 = _tradeBNT(\\n contextId,\\n tokens.targetToken,\\n true,\\n TradeParams({\\n bySourceAmount: false,\\n amount: targetAmount,\\n limit: type(uint256).max,\\n ignoreFees: params.ignoreFees\\n })\\n );\\n\\n // trade source tokens to the required amount of BNT (while respecting the maximum source amount)\\n TradeResult memory sourceHop1 = _tradeBNT(\\n contextId,\\n tokens.sourceToken,\\n false,\\n TradeParams({\\n bySourceAmount: false,\\n amount: sourceHop2.sourceAmount,\\n limit: maxSourceAmount,\\n ignoreFees: params.ignoreFees\\n })\\n );\\n\\n return (sourceHop1, sourceHop2);\\n }\\n\\n /**\\n * @dev deposits tokens to the master vault and verifies that msg.value corresponds to its type\\n */\\n function _depositToMasterVault(Token token, address caller, uint256 amount) private {\\n if (token.isNative()) {\\n if (msg.value < amount) {\\n revert NativeTokenAmountMismatch();\\n }\\n\\n // using a regular transfer here would revert due to exceeding the 2300 gas limit which is why we're using\\n // call instead (via sendValue), which the 2300 gas limit does not apply for\\n payable(address(_masterVault)).sendValue(amount);\\n\\n // refund the caller for the remaining native token amount\\n if (msg.value > amount) {\\n payable(address(caller)).sendValue(msg.value - amount);\\n }\\n } else {\\n if (msg.value > 0) {\\n revert NativeTokenAmountMismatch();\\n }\\n\\n token.safeTransferFrom(caller, address(_masterVault), amount);\\n }\\n }\\n\\n /**\\n * @dev verifies that the specified pool is managed by a valid pool collection and returns it\\n */\\n function _poolCollection(Token token) private view returns (IPoolCollection) {\\n // verify that the pool is managed by a valid pool collection\\n IPoolCollection poolCollection = _collectionByPool[token];\\n if (address(poolCollection) == address(0)) {\\n revert InvalidToken();\\n }\\n\\n return poolCollection;\\n }\\n\\n /**\\n * @dev initiates liquidity withdrawal\\n */\\n function _initWithdrawal(\\n address provider,\\n IPoolToken poolToken,\\n uint256 poolTokenAmount\\n ) private returns (uint256) {\\n if (poolToken != _bntPoolToken) {\\n Token reserveToken = poolToken.reserveToken();\\n if (_poolCollection(reserveToken).poolToken(reserveToken) != poolToken) {\\n revert InvalidPool();\\n }\\n }\\n\\n // transfer the pool tokens from the provider (we aren't using safeTransferFrom, since the PoolToken is a fully\\n // compliant ERC20 token contract)\\n poolToken.transferFrom(provider, address(_pendingWithdrawals), poolTokenAmount);\\n\\n return _pendingWithdrawals.initWithdrawal(provider, poolToken, poolTokenAmount);\\n }\\n\\n /**\\n * @dev grants/revokes required roles to/from a pool collection\\n */\\n function _setAccessRoles(IPoolCollection poolCollection, bool set) private {\\n address poolCollectionAddress = address(poolCollection);\\n\\n if (set) {\\n _bntPool.grantRole(ROLE_BNT_MANAGER, poolCollectionAddress);\\n _bntPool.grantRole(ROLE_VAULT_MANAGER, poolCollectionAddress);\\n _bntPool.grantRole(ROLE_FUNDING_MANAGER, poolCollectionAddress);\\n _masterVault.grantRole(ROLE_ASSET_MANAGER, poolCollectionAddress);\\n _externalProtectionVault.grantRole(ROLE_ASSET_MANAGER, poolCollectionAddress);\\n } else {\\n _bntPool.revokeRole(ROLE_BNT_MANAGER, poolCollectionAddress);\\n _bntPool.revokeRole(ROLE_VAULT_MANAGER, poolCollectionAddress);\\n _bntPool.revokeRole(ROLE_FUNDING_MANAGER, poolCollectionAddress);\\n _masterVault.revokeRole(ROLE_ASSET_MANAGER, poolCollectionAddress);\\n _externalProtectionVault.revokeRole(ROLE_ASSET_MANAGER, poolCollectionAddress);\\n }\\n }\\n\\n /*\\n * @dev finds a pool collection with the given type and version\\n */\\n function _findPoolCollection(uint16 poolType, uint16 poolVersion) private view returns (IPoolCollection) {\\n // note that there's no risk of using an unbounded loop here since the list of all the active pool collections\\n // is always going to remain sufficiently small\\n uint256 length = _poolCollections.length();\\n for (uint256 i = 0; i < length; i++) {\\n IPoolCollection poolCollection = IPoolCollection(_poolCollections.at(i));\\n if ((poolCollection.poolType() == poolType && poolCollection.version() == poolVersion)) {\\n return poolCollection;\\n }\\n }\\n\\n return IPoolCollection(address(0));\\n }\\n}\\n\",\"keccak256\":\"0xfd05fad038e4955eac39aec6d600a8265d1c3ab2431a575d182b7e7ca1c93547\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/network/interfaces/IBancorNetwork.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport { IUpgradeable } from \\\"../../utility/interfaces/IUpgradeable.sol\\\";\\n\\nimport { Token } from \\\"../../token/Token.sol\\\";\\n\\nimport { IPoolCollection } from \\\"../../pools/interfaces/IPoolCollection.sol\\\";\\nimport { IPoolToken } from \\\"../../pools/interfaces/IPoolToken.sol\\\";\\n\\n/**\\n * @dev Flash-loan recipient interface\\n */\\ninterface IFlashLoanRecipient {\\n /**\\n * @dev a flash-loan recipient callback after each the caller must return the borrowed amount and an additional fee\\n */\\n function onFlashLoan(\\n address caller,\\n IERC20 erc20Token,\\n uint256 amount,\\n uint256 feeAmount,\\n bytes memory data\\n ) external;\\n}\\n\\n/**\\n * @dev Bancor Network interface\\n */\\ninterface IBancorNetwork is IUpgradeable {\\n /**\\n * @dev returns the set of all valid pool collections\\n */\\n function poolCollections() external view returns (IPoolCollection[] memory);\\n\\n /**\\n * @dev returns the set of all liquidity pools\\n */\\n function liquidityPools() external view returns (Token[] memory);\\n\\n /**\\n * @dev returns the respective pool collection for the provided pool\\n */\\n function collectionByPool(Token pool) external view returns (IPoolCollection);\\n\\n /**\\n * @dev creates new pools\\n *\\n * requirements:\\n *\\n * - none of the pools already exists\\n */\\n function createPools(Token[] calldata tokens, IPoolCollection poolCollection) external;\\n\\n /**\\n * @dev migrates a list of pools between pool collections\\n *\\n * notes:\\n *\\n * - invalid or incompatible pools will be skipped gracefully\\n */\\n function migratePools(Token[] calldata pools, IPoolCollection newPoolCollection) external;\\n\\n /**\\n * @dev deposits liquidity for the specified provider and returns the respective pool token amount\\n *\\n * requirements:\\n *\\n * - the caller must have approved the network to transfer the tokens on its behalf (except for in the\\n * native token case)\\n */\\n function depositFor(\\n address provider,\\n Token pool,\\n uint256 tokenAmount\\n ) external payable returns (uint256);\\n\\n /**\\n * @dev deposits liquidity for the current provider and returns the respective pool token amount\\n *\\n * requirements:\\n *\\n * - the caller must have approved the network to transfer the tokens on its behalf (except for in the\\n * native token case)\\n */\\n function deposit(Token pool, uint256 tokenAmount) external payable returns (uint256);\\n\\n /**\\n * @dev initiates liquidity withdrawal\\n *\\n * requirements:\\n *\\n * - the caller must have approved the contract to transfer the pool token amount on its behalf\\n */\\n function initWithdrawal(IPoolToken poolToken, uint256 poolTokenAmount) external returns (uint256);\\n\\n /**\\n * @dev cancels a withdrawal request, and returns the number of pool token amount associated with the withdrawal\\n * request\\n *\\n * requirements:\\n *\\n * - the caller must have already initiated a withdrawal and received the specified id\\n */\\n function cancelWithdrawal(uint256 id) external returns (uint256);\\n\\n /**\\n * @dev withdraws liquidity and returns the withdrawn amount\\n *\\n * requirements:\\n *\\n * - the provider must have already initiated a withdrawal and received the specified id\\n * - the specified withdrawal request is eligible for completion\\n * - the provider must have approved the network to transfer vBNT amount on its behalf, when withdrawing BNT\\n * liquidity\\n */\\n function withdraw(uint256 id) external returns (uint256);\\n\\n /**\\n * @dev performs a trade by providing the input source amount, sends the proceeds to the optional beneficiary (or\\n * to the address of the caller, in case it's not supplied), and returns the trade target amount\\n *\\n * requirements:\\n *\\n * - the caller must have approved the network to transfer the source tokens on its behalf (except for in the\\n * native token case)\\n */\\n function tradeBySourceAmount(\\n Token sourceToken,\\n Token targetToken,\\n uint256 sourceAmount,\\n uint256 minReturnAmount,\\n uint256 deadline,\\n address beneficiary\\n ) external payable returns (uint256);\\n\\n /**\\n * @dev performs a trade by providing the output target amount, sends the proceeds to the optional beneficiary (or\\n * to the address of the caller, in case it's not supplied), and returns the trade source amount\\n *\\n * requirements:\\n *\\n * - the caller must have approved the network to transfer the source tokens on its behalf (except for in the\\n * native token case)\\n */\\n function tradeByTargetAmount(\\n Token sourceToken,\\n Token targetToken,\\n uint256 targetAmount,\\n uint256 maxSourceAmount,\\n uint256 deadline,\\n address beneficiary\\n ) external payable returns (uint256);\\n\\n /**\\n * @dev performs a trade by providing the input source amount, sends the proceeds to the optional beneficiary (or\\n * to the address of the caller, in case it's not supplied), and returns the trade target amount\\n *\\n * requirements:\\n *\\n * - the caller must have approved the network to transfer the source tokens on its behalf (except for in the\\n * native token case)\\n * - the caller must be the _bancorArbitrage contract\\n */\\n function tradeBySourceAmountArb(\\n Token sourceToken,\\n Token targetToken,\\n uint256 sourceAmount,\\n uint256 minReturnAmount,\\n uint256 deadline,\\n address beneficiary\\n ) external payable returns (uint256);\\n\\n /**\\n * @dev performs a trade by providing the output target amount, sends the proceeds to the optional beneficiary (or\\n * to the address of the caller, in case it's not supplied), and returns the trade source amount\\n *\\n * requirements:\\n *\\n * - the caller must have approved the network to transfer the source tokens on its behalf (except for in the\\n * native token case)\\n * - the caller must be the _bancorArbitrage contract\\n */\\n function tradeByTargetAmountArb(\\n Token sourceToken,\\n Token targetToken,\\n uint256 targetAmount,\\n uint256 maxSourceAmount,\\n uint256 deadline,\\n address beneficiary\\n ) external payable returns (uint256);\\n\\n /**\\n * @dev provides a flash-loan\\n *\\n * requirements:\\n *\\n * - the recipient's callback must return *at least* the borrowed amount and fee back to the specified return address\\n */\\n function flashLoan(\\n Token token,\\n uint256 amount,\\n IFlashLoanRecipient recipient,\\n bytes calldata data\\n ) external;\\n\\n /**\\n * @dev deposits liquidity during a migration\\n */\\n function migrateLiquidity(\\n Token token,\\n address provider,\\n uint256 amount,\\n uint256 availableAmount,\\n uint256 originalAmount\\n ) external payable;\\n\\n /**\\n * @dev withdraws pending network fees, and returns the amount of fees withdrawn\\n *\\n * requirements:\\n *\\n * - the caller must have the ROLE_NETWORK_FEE_MANAGER privilege\\n */\\n function withdrawNetworkFees(address recipient) external returns (uint256);\\n\\n /**\\n * @dev withdraws surplus tokens from a given pool to CarbonPOL contract,\\n * and disables trading on the given pool if it is not already disabled\\n */\\n function withdrawPOL(Token pool) external returns (uint256);\\n}\\n\",\"keccak256\":\"0x29edaf865558031ecb2148a193da0ddca7716e908568f138eae7a4c85c66e4b1\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/network/interfaces/INetworkSettings.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { IUpgradeable } from \\\"../../utility/interfaces/IUpgradeable.sol\\\";\\n\\nimport { Token } from \\\"../../token/Token.sol\\\";\\n\\nerror NotWhitelisted();\\nerror NotWhitelistedForPOL();\\n\\nstruct VortexRewards {\\n // the percentage of converted BNT to be sent to the initiator of the burning event (in units of PPM)\\n uint32 burnRewardPPM;\\n // the maximum burn reward to be sent to the initiator of the burning event\\n uint256 burnRewardMaxAmount;\\n}\\n\\n/**\\n * @dev Network Settings interface\\n */\\ninterface INetworkSettings is IUpgradeable {\\n /**\\n * @dev returns the protected tokens whitelist\\n */\\n function protectedTokenWhitelist() external view returns (Token[] memory);\\n\\n /**\\n * @dev checks whether a given token is whitelisted\\n */\\n function isTokenWhitelisted(Token pool) external view returns (bool);\\n\\n /**\\n * @dev returns the tokens whitelist for POL\\n */\\n function tokenWhitelistForPOL() external view returns (Token[] memory);\\n\\n /**\\n * @dev checks whether a given token is whitelist for POL\\n */\\n function isTokenWhitelistedForPOL(Token pool) external view returns (bool);\\n\\n /**\\n * @dev returns the BNT funding limit for a given pool\\n */\\n function poolFundingLimit(Token pool) external view returns (uint256);\\n\\n /**\\n * @dev returns the minimum BNT trading liquidity required before the system enables trading in the relevant pool\\n */\\n function minLiquidityForTrading() external view returns (uint256);\\n\\n /**\\n * @dev returns the withdrawal fee (in units of PPM)\\n */\\n function withdrawalFeePPM() external view returns (uint32);\\n\\n /**\\n * @dev returns the default flash-loan fee (in units of PPM)\\n */\\n function defaultFlashLoanFeePPM() external view returns (uint32);\\n\\n /**\\n * @dev returns the flash-loan fee (in units of PPM) of a pool\\n */\\n function flashLoanFeePPM(Token pool) external view returns (uint32);\\n\\n /**\\n * @dev returns the vortex settings\\n */\\n function vortexRewards() external view returns (VortexRewards memory);\\n}\\n\",\"keccak256\":\"0x98403457a628e5e568688184570be14d3c59a5fec5cdbf69236b4a787c802c45\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/network/interfaces/IPendingWithdrawals.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { IPoolToken } from \\\"../../pools/interfaces/IPoolToken.sol\\\";\\n\\nimport { Token } from \\\"../../token/Token.sol\\\";\\n\\nimport { IUpgradeable } from \\\"../../utility/interfaces/IUpgradeable.sol\\\";\\n\\n/**\\n * @dev the data struct representing a pending withdrawal request\\n */\\nstruct WithdrawalRequest {\\n address provider; // the liquidity provider\\n IPoolToken poolToken; // the locked pool token\\n Token reserveToken; // the reserve token to withdraw\\n uint32 createdAt; // the time when the request was created (Unix timestamp)\\n uint256 poolTokenAmount; // the locked pool token amount\\n uint256 reserveTokenAmount; // the expected reserve token amount to withdraw\\n}\\n\\n/**\\n * @dev the data struct representing a completed withdrawal request\\n */\\nstruct CompletedWithdrawal {\\n IPoolToken poolToken; // the withdraw pool token\\n uint256 poolTokenAmount; // the original pool token amount in the withdrawal request\\n uint256 reserveTokenAmount; // the original reserve token amount at the time of the withdrawal init request\\n}\\n\\n/**\\n * @dev Pending Withdrawals interface\\n */\\ninterface IPendingWithdrawals is IUpgradeable {\\n /**\\n * @dev returns the lock duration\\n */\\n function lockDuration() external view returns (uint32);\\n\\n /**\\n * @dev returns the pending withdrawal requests count for a specific provider\\n */\\n function withdrawalRequestCount(address provider) external view returns (uint256);\\n\\n /**\\n * @dev returns the pending withdrawal requests IDs for a specific provider\\n */\\n function withdrawalRequestIds(address provider) external view returns (uint256[] memory);\\n\\n /**\\n * @dev returns the pending withdrawal request with the specified ID\\n */\\n function withdrawalRequest(uint256 id) external view returns (WithdrawalRequest memory);\\n\\n /**\\n * @dev initiates liquidity withdrawal\\n *\\n * requirements:\\n *\\n * - the caller must be the network contract\\n */\\n function initWithdrawal(\\n address provider,\\n IPoolToken poolToken,\\n uint256 poolTokenAmount\\n ) external returns (uint256);\\n\\n /**\\n * @dev cancels a withdrawal request, and returns the number of pool tokens which were sent back to the provider\\n *\\n * requirements:\\n *\\n * - the caller must be the network contract\\n * - the provider must have already initiated a withdrawal and received the specified id\\n */\\n function cancelWithdrawal(address provider, uint256 id) external returns (uint256);\\n\\n /**\\n * @dev completes a withdrawal request, and returns the pool token and its transferred amount\\n *\\n * requirements:\\n *\\n * - the caller must be the network contract\\n * - the provider must have already initiated a withdrawal and received the specified id\\n * - the lock duration has ended\\n */\\n function completeWithdrawal(\\n bytes32 contextId,\\n address provider,\\n uint256 id\\n ) external returns (CompletedWithdrawal memory);\\n\\n /**\\n * @dev returns whether the given request is ready for withdrawal\\n */\\n function isReadyForWithdrawal(uint256 id) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x0eb8cdbc49ef5e1254e20f9835834208316124a00c9a8b4c16e54b25beb4be98\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/pools/interfaces/IBNTPool.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { IPoolToken } from \\\"./IPoolToken.sol\\\";\\n\\nimport { Token } from \\\"../../token/Token.sol\\\";\\n\\nimport { IVault } from \\\"../../vaults/interfaces/IVault.sol\\\";\\n\\n// the BNT pool token manager role is required to access the BNT pool tokens\\nbytes32 constant ROLE_BNT_POOL_TOKEN_MANAGER = keccak256(\\\"ROLE_BNT_POOL_TOKEN_MANAGER\\\");\\n\\n// the BNT manager role is required to request the BNT pool to mint BNT\\nbytes32 constant ROLE_BNT_MANAGER = keccak256(\\\"ROLE_BNT_MANAGER\\\");\\n\\n// the vault manager role is required to request the BNT pool to burn BNT from the master vault\\nbytes32 constant ROLE_VAULT_MANAGER = keccak256(\\\"ROLE_VAULT_MANAGER\\\");\\n\\n// the funding manager role is required to request or renounce funding from the BNT pool\\nbytes32 constant ROLE_FUNDING_MANAGER = keccak256(\\\"ROLE_FUNDING_MANAGER\\\");\\n\\n/**\\n * @dev BNT Pool interface\\n */\\ninterface IBNTPool is IVault {\\n /**\\n * @dev returns the BNT pool token contract\\n */\\n function poolToken() external view returns (IPoolToken);\\n\\n /**\\n * @dev returns the total staked BNT balance in the network\\n */\\n function stakedBalance() external view returns (uint256);\\n\\n /**\\n * @dev returns the current funding of given pool\\n */\\n function currentPoolFunding(Token pool) external view returns (uint256);\\n\\n /**\\n * @dev returns the available BNT funding for a given pool\\n */\\n function availableFunding(Token pool) external view returns (uint256);\\n\\n /**\\n * @dev converts the specified pool token amount to the underlying BNT amount\\n */\\n function poolTokenToUnderlying(uint256 poolTokenAmount) external view returns (uint256);\\n\\n /**\\n * @dev converts the specified underlying BNT amount to pool token amount\\n */\\n function underlyingToPoolToken(uint256 bntAmount) external view returns (uint256);\\n\\n /**\\n * @dev returns the number of pool token to burn in order to increase everyone's underlying value by the specified\\n * amount\\n */\\n function poolTokenAmountToBurn(uint256 bntAmountToDistribute) external view returns (uint256);\\n\\n /**\\n * @dev mints BNT to the recipient\\n *\\n * requirements:\\n *\\n * - the caller must have the ROLE_BNT_MANAGER role\\n */\\n function mint(address recipient, uint256 bntAmount) external;\\n\\n /**\\n * @dev burns BNT from the vault\\n *\\n * requirements:\\n *\\n * - the caller must have the ROLE_VAULT_MANAGER role\\n */\\n function burnFromVault(uint256 bntAmount) external;\\n\\n /**\\n * @dev deposits BNT liquidity on behalf of a specific provider and returns the respective pool token amount\\n *\\n * requirements:\\n *\\n * - the caller must be the network contract\\n * - BNT tokens must have been already deposited into the contract\\n */\\n function depositFor(\\n bytes32 contextId,\\n address provider,\\n uint256 bntAmount,\\n bool isMigrating,\\n uint256 originalVBNTAmount\\n ) external returns (uint256);\\n\\n /**\\n * @dev withdraws BNT liquidity on behalf of a specific provider and returns the withdrawn BNT amount\\n *\\n * requirements:\\n *\\n * - the caller must be the network contract\\n * - bnBNT token must have been already deposited into the contract\\n * - vBNT token must have been already deposited into the contract\\n */\\n function withdraw(\\n bytes32 contextId,\\n address provider,\\n uint256 poolTokenAmount,\\n uint256 bntAmount\\n ) external returns (uint256);\\n\\n /**\\n * @dev returns the withdrawn BNT amount\\n */\\n function withdrawalAmount(uint256 poolTokenAmount) external view returns (uint256);\\n\\n /**\\n * @dev requests BNT funding\\n *\\n * requirements:\\n *\\n * - the caller must have the ROLE_FUNDING_MANAGER role\\n * - the token must have been whitelisted\\n * - the request amount should be below the funding limit for a given pool\\n * - the average rate of the pool must not deviate too much from its spot rate\\n */\\n function requestFunding(\\n bytes32 contextId,\\n Token pool,\\n uint256 bntAmount\\n ) external;\\n\\n /**\\n * @dev renounces BNT funding\\n *\\n * requirements:\\n *\\n * - the caller must have the ROLE_FUNDING_MANAGER role\\n * - the token must have been whitelisted\\n * - the average rate of the pool must not deviate too much from its spot rate\\n */\\n function renounceFunding(\\n bytes32 contextId,\\n Token pool,\\n uint256 bntAmount\\n ) external;\\n\\n /**\\n * @dev notifies the pool of accrued fees\\n *\\n * requirements:\\n *\\n * - the caller must be the network contract\\n */\\n function onFeesCollected(\\n Token pool,\\n uint256 feeAmount,\\n bool isTradeFee\\n ) external;\\n}\\n\",\"keccak256\":\"0xed6a5abb972bdc42e1d32dd4157c0968b5d34d3a6560dcffeb1479ed994fd5a8\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/pools/interfaces/IPoolCollection.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { IVersioned } from \\\"../../utility/interfaces/IVersioned.sol\\\";\\nimport { Fraction112 } from \\\"../../utility/FractionLibrary.sol\\\";\\n\\nimport { Token } from \\\"../../token/Token.sol\\\";\\n\\nimport { IPoolToken } from \\\"./IPoolToken.sol\\\";\\n\\nstruct PoolLiquidity {\\n uint128 bntTradingLiquidity; // the BNT trading liquidity\\n uint128 baseTokenTradingLiquidity; // the base token trading liquidity\\n uint256 stakedBalance; // the staked balance\\n}\\n\\nstruct AverageRates {\\n uint32 blockNumber;\\n Fraction112 rate;\\n Fraction112 invRate;\\n}\\n\\nstruct Pool {\\n IPoolToken poolToken; // the pool token of the pool\\n uint32 tradingFeePPM; // the trading fee (in units of PPM)\\n bool tradingEnabled; // whether trading is enabled\\n bool depositingEnabled; // whether depositing is enabled\\n AverageRates averageRates; // the recent average rates\\n PoolLiquidity liquidity; // the overall liquidity in the pool\\n}\\n\\nstruct WithdrawalAmounts {\\n uint256 totalAmount;\\n uint256 baseTokenAmount;\\n uint256 bntAmount;\\n}\\n\\n// trading enabling/disabling reasons\\nuint8 constant TRADING_STATUS_UPDATE_DEFAULT = 0;\\nuint8 constant TRADING_STATUS_UPDATE_ADMIN = 1;\\nuint8 constant TRADING_STATUS_UPDATE_MIN_LIQUIDITY = 2;\\nuint8 constant TRADING_STATUS_UPDATE_INVALID_STATE = 3;\\nuint8 constant TRADING_STATUS_UPDATE_NETWORK_DISABLE = 4;\\n\\nstruct TradeAmountAndFee {\\n uint256 amount; // the source/target amount (depending on the context) resulting from the trade\\n uint256 tradingFeeAmount; // the trading fee amount\\n uint256 networkFeeAmount; // the network fee amount (always in units of BNT)\\n}\\n\\n/**\\n * @dev Pool Collection interface\\n */\\ninterface IPoolCollection is IVersioned {\\n /**\\n * @dev returns the type of the pool\\n */\\n function poolType() external view returns (uint16);\\n\\n /**\\n * @dev returns the default trading fee (in units of PPM)\\n */\\n function defaultTradingFeePPM() external view returns (uint32);\\n\\n /**\\n * @dev returns the network fee (in units of PPM)\\n */\\n function networkFeePPM() external view returns (uint32);\\n\\n /**\\n * @dev returns all the pools which are managed by this pool collection\\n */\\n function pools() external view returns (Token[] memory);\\n\\n /**\\n * @dev returns the number of all the pools which are managed by this pool collection\\n */\\n function poolCount() external view returns (uint256);\\n\\n /**\\n * @dev returns whether a pool is valid\\n */\\n function isPoolValid(Token pool) external view returns (bool);\\n\\n /**\\n * @dev returns the overall liquidity in the pool\\n */\\n function poolLiquidity(Token pool) external view returns (PoolLiquidity memory);\\n\\n /**\\n * @dev returns the pool token of the pool\\n */\\n function poolToken(Token pool) external view returns (IPoolToken);\\n\\n /**\\n * @dev returns the trading fee (in units of PPM)\\n */\\n function tradingFeePPM(Token pool) external view returns (uint32);\\n\\n /**\\n * @dev returns whether trading is enabled\\n */\\n function tradingEnabled(Token pool) external view returns (bool);\\n\\n /**\\n * @dev returns whether depositing is enabled\\n */\\n function depositingEnabled(Token pool) external view returns (bool);\\n\\n /**\\n * @dev returns whether the pool is stable\\n */\\n function isPoolStable(Token pool) external view returns (bool);\\n\\n /**\\n * @dev converts the specified pool token amount to the underlying base token amount\\n */\\n function poolTokenToUnderlying(Token pool, uint256 poolTokenAmount) external view returns (uint256);\\n\\n /**\\n * @dev converts the specified underlying base token amount to pool token amount\\n */\\n function underlyingToPoolToken(Token pool, uint256 baseTokenAmount) external view returns (uint256);\\n\\n /**\\n * @dev returns the number of pool token to burn in order to increase everyone's underlying value by the specified\\n * amount\\n */\\n function poolTokenAmountToBurn(\\n Token pool,\\n uint256 baseTokenAmountToDistribute,\\n uint256 protocolPoolTokenAmount\\n ) external view returns (uint256);\\n\\n /**\\n * @dev creates a new pool\\n *\\n * requirements:\\n *\\n * - the caller must be the network contract\\n * - the pool should have been whitelisted\\n * - the pool isn't already defined in the collection\\n */\\n function createPool(Token token) external;\\n\\n /**\\n * @dev deposits base token liquidity on behalf of a specific provider and returns the respective pool token amount\\n *\\n * requirements:\\n *\\n * - the caller must be the network contract\\n * - assumes that the base token has been already deposited in the vault\\n */\\n function depositFor(\\n bytes32 contextId,\\n address provider,\\n Token pool,\\n uint256 baseTokenAmount\\n ) external returns (uint256);\\n\\n /**\\n * @dev handles some of the withdrawal-related actions and returns the withdrawn base token amount\\n *\\n * requirements:\\n *\\n * - the caller must be the network contract\\n * - the caller must have approved the collection to transfer/burn the pool token amount on its behalf\\n */\\n function withdraw(\\n bytes32 contextId,\\n address provider,\\n Token pool,\\n uint256 poolTokenAmount,\\n uint256 baseTokenAmount\\n ) external returns (uint256);\\n\\n /**\\n * @dev returns the amounts that would be returned if the position is currently withdrawn,\\n * along with the breakdown of the base token and the BNT compensation\\n */\\n function withdrawalAmounts(Token pool, uint256 poolTokenAmount) external view returns (WithdrawalAmounts memory);\\n\\n /**\\n * @dev performs a trade by providing the source amount and returns the target amount and the associated fee\\n *\\n * requirements:\\n *\\n * - the caller must be the network contract\\n */\\n function tradeBySourceAmount(\\n bytes32 contextId,\\n Token sourceToken,\\n Token targetToken,\\n uint256 sourceAmount,\\n uint256 minReturnAmount,\\n bool ignoreFees\\n ) external returns (TradeAmountAndFee memory);\\n\\n /**\\n * @dev performs a trade by providing the target amount and returns the required source amount and the associated fee\\n *\\n * requirements:\\n *\\n * - the caller must be the network contract\\n */\\n function tradeByTargetAmount(\\n bytes32 contextId,\\n Token sourceToken,\\n Token targetToken,\\n uint256 targetAmount,\\n uint256 maxSourceAmount,\\n bool ignoreFees\\n ) external returns (TradeAmountAndFee memory);\\n\\n /**\\n * @dev returns the output amount and fee when trading by providing the source amount\\n */\\n function tradeOutputAndFeeBySourceAmount(\\n Token sourceToken,\\n Token targetToken,\\n uint256 sourceAmount\\n ) external view returns (TradeAmountAndFee memory);\\n\\n /**\\n * @dev returns the input amount and fee when trading by providing the target amount\\n */\\n function tradeInputAndFeeByTargetAmount(\\n Token sourceToken,\\n Token targetToken,\\n uint256 targetAmount\\n ) external view returns (TradeAmountAndFee memory);\\n\\n /**\\n * @dev notifies the pool of accrued fees\\n *\\n * requirements:\\n *\\n * - the caller must be the network contract\\n */\\n function onFeesCollected(Token pool, uint256 feeAmount) external;\\n\\n /**\\n * @dev migrates a pool to this pool collection\\n *\\n * requirements:\\n *\\n * - the caller must be the pool migrator contract\\n */\\n function migratePoolIn(Token pool, Pool calldata data) external;\\n\\n /**\\n * @dev migrates a pool from this pool collection\\n *\\n * requirements:\\n *\\n * - the caller must be the pool migrator contract\\n */\\n function migratePoolOut(Token pool, IPoolCollection targetPoolCollection) external;\\n\\n /**\\n * @dev disables trading on a pool\\n *\\n * requirements:\\n *\\n * - the caller must be the network contract\\n */\\n function disableTradingByNetwork(Token pool) external;\\n}\\n\",\"keccak256\":\"0xb9433cded2e24fd4b1926c1ba0fa2969a15b115328d1c9f83d49ab16f36dfbc1\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/pools/interfaces/IPoolMigrator.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { Token } from \\\"../../token/Token.sol\\\";\\n\\nimport { IVersioned } from \\\"../../utility/interfaces/IVersioned.sol\\\";\\n\\nimport { IPoolCollection } from \\\"./IPoolCollection.sol\\\";\\n\\n/**\\n * @dev Pool Migrator interface\\n */\\ninterface IPoolMigrator is IVersioned {\\n /**\\n * @dev migrates a pool and returns the new pool collection it exists in\\n *\\n * notes:\\n *\\n * - invalid or incompatible pools will be skipped gracefully\\n *\\n * requirements:\\n *\\n * - the caller must be the network contract\\n */\\n function migratePool(Token pool, IPoolCollection newPoolCollection) external;\\n}\\n\",\"keccak256\":\"0x3dde1a08987c3d1a79bf10746c772ea68d1daa69b165b638dfdfeb6bfb269102\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/pools/interfaces/IPoolToken.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport { IERC20Permit } from \\\"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\\\";\\n\\nimport { IERC20Burnable } from \\\"../../token/interfaces/IERC20Burnable.sol\\\";\\nimport { Token } from \\\"../../token/Token.sol\\\";\\n\\nimport { IVersioned } from \\\"../../utility/interfaces/IVersioned.sol\\\";\\nimport { IOwned } from \\\"../../utility/interfaces/IOwned.sol\\\";\\n\\n/**\\n * @dev Pool Token interface\\n */\\ninterface IPoolToken is IVersioned, IOwned, IERC20, IERC20Permit, IERC20Burnable {\\n /**\\n * @dev returns the address of the reserve token\\n */\\n function reserveToken() external view returns (Token);\\n\\n /**\\n * @dev increases the token supply and sends the new tokens to the given account\\n *\\n * requirements:\\n *\\n * - the caller must be the owner of the contract\\n */\\n function mint(address recipient, uint256 amount) external;\\n}\\n\",\"keccak256\":\"0x698423b0fc59424e60d5effe3b79b8aeb5d478b04e5569e3a4ba5fe6936fb2b7\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/token/SafeERC20Ex.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport { SafeERC20 } from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\n\\n/**\\n * @dev extends the SafeERC20 library with additional operations\\n */\\nlibrary SafeERC20Ex {\\n using SafeERC20 for IERC20;\\n\\n /**\\n * @dev ensures that the spender has sufficient allowance\\n */\\n function ensureApprove(IERC20 token, address spender, uint256 amount) internal {\\n if (amount == 0) {\\n return;\\n }\\n\\n uint256 allowance = token.allowance(address(this), spender);\\n if (allowance >= amount) {\\n return;\\n }\\n\\n if (allowance > 0) {\\n token.safeApprove(spender, 0);\\n }\\n token.safeApprove(spender, amount);\\n }\\n}\\n\",\"keccak256\":\"0x8976816df06d18659fd6c95611aa32aa48ca2d1d4f64e63235bf5c9802bf85bf\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/token/Token.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\n/**\\n * @dev the main purpose of the Token interfaces is to ensure artificially that we won't use ERC20's standard functions,\\n * but only their safe versions, which are provided by SafeERC20 and SafeERC20Ex via the TokenLibrary contract\\n */\\ninterface Token {\\n\\n}\\n\",\"keccak256\":\"0x49d0e5ac0dab272f4001a63e7f4117eb13b42c655ee788c42a333f56f19ac2e9\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/token/TokenLibrary.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport { ERC20 } from \\\"@openzeppelin/contracts/token/ERC20/ERC20.sol\\\";\\nimport { SafeERC20 } from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\n\\nimport { SafeERC20Ex } from \\\"./SafeERC20Ex.sol\\\";\\n\\nimport { Token } from \\\"./Token.sol\\\";\\n\\n/**\\n * @dev This library implements ERC20 and SafeERC20 utilities for both the native token and for ERC20 tokens\\n */\\nlibrary TokenLibrary {\\n using SafeERC20 for IERC20;\\n using SafeERC20Ex for IERC20;\\n\\n error PermitUnsupported();\\n\\n // the address that represents the native token reserve\\n address private constant NATIVE_TOKEN_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\\n\\n // the symbol that represents the native token\\n string private constant NATIVE_TOKEN_SYMBOL = \\\"ETH\\\";\\n\\n // the decimals for the native token\\n uint8 private constant NATIVE_TOKEN_DECIMALS = 18;\\n\\n // the token representing the native token\\n Token public constant NATIVE_TOKEN = Token(NATIVE_TOKEN_ADDRESS);\\n\\n /**\\n * @dev returns whether the provided token represents an ERC20 or the native token reserve\\n */\\n function isNative(Token token) internal pure returns (bool) {\\n return address(token) == NATIVE_TOKEN_ADDRESS;\\n }\\n\\n /**\\n * @dev returns the symbol of the native token/ERC20 token\\n */\\n function symbol(Token token) internal view returns (string memory) {\\n if (isNative(token)) {\\n return NATIVE_TOKEN_SYMBOL;\\n }\\n\\n return toERC20(token).symbol();\\n }\\n\\n /**\\n * @dev returns the decimals of the native token/ERC20 token\\n */\\n function decimals(Token token) internal view returns (uint8) {\\n if (isNative(token)) {\\n return NATIVE_TOKEN_DECIMALS;\\n }\\n\\n return toERC20(token).decimals();\\n }\\n\\n /**\\n * @dev returns the balance of the native token/ERC20 token\\n */\\n function balanceOf(Token token, address account) internal view returns (uint256) {\\n if (isNative(token)) {\\n return account.balance;\\n }\\n\\n return toIERC20(token).balanceOf(account);\\n }\\n\\n /**\\n * @dev transfers a specific amount of the native token/ERC20 token\\n */\\n function safeTransfer(Token token, address to, uint256 amount) internal {\\n if (amount == 0) {\\n return;\\n }\\n\\n if (isNative(token)) {\\n payable(to).transfer(amount);\\n } else {\\n toIERC20(token).safeTransfer(to, amount);\\n }\\n }\\n\\n /**\\n * @dev transfers a specific amount of the native token/ERC20 token from a specific holder using the allowance mechanism\\n *\\n * note that the function does not perform any action if the native token is provided\\n */\\n function safeTransferFrom(Token token, address from, address to, uint256 amount) internal {\\n if (amount == 0 || isNative(token)) {\\n return;\\n }\\n\\n toIERC20(token).safeTransferFrom(from, to, amount);\\n }\\n\\n /**\\n * @dev approves a specific amount of the native token/ERC20 token from a specific holder\\n *\\n * note that the function does not perform any action if the native token is provided\\n */\\n function safeApprove(Token token, address spender, uint256 amount) internal {\\n if (isNative(token)) {\\n return;\\n }\\n\\n toIERC20(token).safeApprove(spender, amount);\\n }\\n\\n /**\\n * @dev increases allowance of the native token/ERC20 token from a specific holder\\n *\\n * note that the function does not perform any action if the native token is provided\\n */\\n function safeIncreaseAllowance(Token token, address spender, uint256 amount) internal {\\n if (isNative(token)) {\\n return;\\n }\\n\\n toIERC20(token).safeIncreaseAllowance(spender, amount);\\n }\\n\\n /**\\n * @dev ensures that the spender has sufficient allowance\\n *\\n * note that the function does not perform any action if the native token is provided\\n */\\n function ensureApprove(Token token, address spender, uint256 amount) internal {\\n if (isNative(token)) {\\n return;\\n }\\n\\n toIERC20(token).ensureApprove(spender, amount);\\n }\\n\\n /**\\n * @dev compares between a token and another raw ERC20 token\\n */\\n function isEqual(Token token, IERC20 erc20Token) internal pure returns (bool) {\\n return toIERC20(token) == erc20Token;\\n }\\n\\n /**\\n * @dev utility function that converts a token to an IERC20\\n */\\n function toIERC20(Token token) internal pure returns (IERC20) {\\n return IERC20(address(token));\\n }\\n\\n /**\\n * @dev utility function that converts a token to an ERC20\\n */\\n function toERC20(Token token) internal pure returns (ERC20) {\\n return ERC20(address(token));\\n }\\n}\\n\",\"keccak256\":\"0x74eb4bbfb891affa1df59a729a6fe1c07fd875a0e8accbee345db3e6aab1fb3f\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/token/interfaces/IERC20Burnable.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\n/**\\n * @dev burnable ERC20 interface\\n */\\ninterface IERC20Burnable {\\n /**\\n * @dev Destroys tokens from the caller.\\n */\\n function burn(uint256 amount) external;\\n\\n /**\\n * @dev Destroys tokens from a recipient, deducting from the caller's allowance\\n *\\n * requirements:\\n *\\n * - the caller must have allowance for recipient's tokens of at least the specified amount\\n */\\n function burnFrom(address recipient, uint256 amount) external;\\n}\\n\",\"keccak256\":\"0x222a3ba8286edf54d3e75a70683ffcbe6eb3c5ba5f6b3c6a6d98a716e9bd5332\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/utility/Constants.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nuint32 constant PPM_RESOLUTION = 1_000_000;\\n\",\"keccak256\":\"0x5215535db0a4e580cd19380cc1cf3a2b7edcbb8ee039e416319fe9f8867724ad\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/utility/Fraction.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nstruct Fraction {\\n uint256 n;\\n uint256 d;\\n}\\n\\nstruct Fraction112 {\\n uint112 n;\\n uint112 d;\\n}\\n\\nerror InvalidFraction();\\n\",\"keccak256\":\"0xb965a448e314353c82bc9fb7c0552057427a90100ebda4450b21fc932356a4d1\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/utility/FractionLibrary.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { Fraction, Fraction112, InvalidFraction } from \\\"./Fraction.sol\\\";\\nimport { MathEx } from \\\"./MathEx.sol\\\";\\n\\n// solhint-disable-next-line func-visibility\\nfunction zeroFraction() pure returns (Fraction memory) {\\n return Fraction({ n: 0, d: 1 });\\n}\\n\\n// solhint-disable-next-line func-visibility\\nfunction zeroFraction112() pure returns (Fraction112 memory) {\\n return Fraction112({ n: 0, d: 1 });\\n}\\n\\n/**\\n * @dev this library provides a set of fraction operations\\n */\\nlibrary FractionLibrary {\\n /**\\n * @dev returns whether a standard fraction is valid\\n */\\n function isValid(Fraction memory fraction) internal pure returns (bool) {\\n return fraction.d != 0;\\n }\\n\\n /**\\n * @dev returns whether a 112-bit fraction is valid\\n */\\n function isValid(Fraction112 memory fraction) internal pure returns (bool) {\\n return fraction.d != 0;\\n }\\n\\n /**\\n * @dev returns whether a standard fraction is positive\\n */\\n function isPositive(Fraction memory fraction) internal pure returns (bool) {\\n return isValid(fraction) && fraction.n != 0;\\n }\\n\\n /**\\n * @dev returns whether a 112-bit fraction is positive\\n */\\n function isPositive(Fraction112 memory fraction) internal pure returns (bool) {\\n return isValid(fraction) && fraction.n != 0;\\n }\\n\\n /**\\n * @dev returns the inverse of a given fraction\\n */\\n function inverse(Fraction memory fraction) internal pure returns (Fraction memory) {\\n Fraction memory invFraction = Fraction({ n: fraction.d, d: fraction.n });\\n\\n if (!isValid(invFraction)) {\\n revert InvalidFraction();\\n }\\n\\n return invFraction;\\n }\\n\\n /**\\n * @dev returns the inverse of a given fraction\\n */\\n function inverse(Fraction112 memory fraction) internal pure returns (Fraction112 memory) {\\n Fraction112 memory invFraction = Fraction112({ n: fraction.d, d: fraction.n });\\n\\n if (!isValid(invFraction)) {\\n revert InvalidFraction();\\n }\\n\\n return invFraction;\\n }\\n\\n /**\\n * @dev reduces a standard fraction to a 112-bit fraction\\n */\\n function toFraction112(Fraction memory fraction) internal pure returns (Fraction112 memory) {\\n Fraction memory truncatedFraction = MathEx.truncatedFraction(fraction, type(uint112).max);\\n\\n return Fraction112({ n: uint112(truncatedFraction.n), d: uint112(truncatedFraction.d) });\\n }\\n\\n /**\\n * @dev expands a 112-bit fraction to a standard fraction\\n */\\n function fromFraction112(Fraction112 memory fraction) internal pure returns (Fraction memory) {\\n return Fraction({ n: fraction.n, d: fraction.d });\\n }\\n}\\n\",\"keccak256\":\"0x480325242afb487705c5e7fafb3a1268ec1ac118ca99c7a52da3577e16a53606\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/utility/MathEx.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { Math } from \\\"@openzeppelin/contracts/utils/math/Math.sol\\\";\\nimport { Fraction, InvalidFraction } from \\\"./Fraction.sol\\\";\\n\\nimport { PPM_RESOLUTION } from \\\"./Constants.sol\\\";\\n\\nuint256 constant ONE = 0x80000000000000000000000000000000;\\nuint256 constant LN2 = 0x58b90bfbe8e7bcd5e4f1d9cc01f97b57;\\n\\nstruct Uint512 {\\n uint256 hi; // 256 most significant bits\\n uint256 lo; // 256 least significant bits\\n}\\n\\nstruct Sint256 {\\n uint256 value;\\n bool isNeg;\\n}\\n\\n/**\\n * @dev this library provides a set of complex math operations\\n */\\nlibrary MathEx {\\n error Overflow();\\n\\n /**\\n * @dev returns `2 ^ f` by calculating `e ^ (f * ln(2))`, where `e` is Euler's number:\\n * - Rewrite the input as a sum of binary exponents and a single residual r, as small as possible\\n * - The exponentiation of each binary exponent is given (pre-calculated)\\n * - The exponentiation of r is calculated via Taylor series for e^x, where x = r\\n * - The exponentiation of the input is calculated by multiplying the intermediate results above\\n * - For example: e^5.521692859 = e^(4 + 1 + 0.5 + 0.021692859) = e^4 * e^1 * e^0.5 * e^0.021692859\\n */\\n function exp2(Fraction memory f) internal pure returns (Fraction memory) {\\n uint256 x = MathEx.mulDivF(LN2, f.n, f.d);\\n uint256 y;\\n uint256 z;\\n uint256 n;\\n\\n if (x >= (ONE << 4)) {\\n revert Overflow();\\n }\\n\\n unchecked {\\n z = y = x % (ONE >> 3); // get the input modulo 2^(-3)\\n z = (z * y) / ONE;\\n n += z * 0x10e1b3be415a0000; // add y^02 * (20! / 02!)\\n z = (z * y) / ONE;\\n n += z * 0x05a0913f6b1e0000; // add y^03 * (20! / 03!)\\n z = (z * y) / ONE;\\n n += z * 0x0168244fdac78000; // add y^04 * (20! / 04!)\\n z = (z * y) / ONE;\\n n += z * 0x004807432bc18000; // add y^05 * (20! / 05!)\\n z = (z * y) / ONE;\\n n += z * 0x000c0135dca04000; // add y^06 * (20! / 06!)\\n z = (z * y) / ONE;\\n n += z * 0x0001b707b1cdc000; // add y^07 * (20! / 07!)\\n z = (z * y) / ONE;\\n n += z * 0x000036e0f639b800; // add y^08 * (20! / 08!)\\n z = (z * y) / ONE;\\n n += z * 0x00000618fee9f800; // add y^09 * (20! / 09!)\\n z = (z * y) / ONE;\\n n += z * 0x0000009c197dcc00; // add y^10 * (20! / 10!)\\n z = (z * y) / ONE;\\n n += z * 0x0000000e30dce400; // add y^11 * (20! / 11!)\\n z = (z * y) / ONE;\\n n += z * 0x000000012ebd1300; // add y^12 * (20! / 12!)\\n z = (z * y) / ONE;\\n n += z * 0x0000000017499f00; // add y^13 * (20! / 13!)\\n z = (z * y) / ONE;\\n n += z * 0x0000000001a9d480; // add y^14 * (20! / 14!)\\n z = (z * y) / ONE;\\n n += z * 0x00000000001c6380; // add y^15 * (20! / 15!)\\n z = (z * y) / ONE;\\n n += z * 0x000000000001c638; // add y^16 * (20! / 16!)\\n z = (z * y) / ONE;\\n n += z * 0x0000000000001ab8; // add y^17 * (20! / 17!)\\n z = (z * y) / ONE;\\n n += z * 0x000000000000017c; // add y^18 * (20! / 18!)\\n z = (z * y) / ONE;\\n n += z * 0x0000000000000014; // add y^19 * (20! / 19!)\\n z = (z * y) / ONE;\\n n += z * 0x0000000000000001; // add y^20 * (20! / 20!)\\n n = n / 0x21c3677c82b40000 + y + ONE; // divide by 20! and then add y^1 / 1! + y^0 / 0!\\n\\n if ((x & (ONE >> 3)) != 0)\\n n = (n * 0x1c3d6a24ed82218787d624d3e5eba95f9) / 0x18ebef9eac820ae8682b9793ac6d1e776; // multiply by e^(2^-3)\\n if ((x & (ONE >> 2)) != 0)\\n n = (n * 0x18ebef9eac820ae8682b9793ac6d1e778) / 0x1368b2fc6f9609fe7aceb46aa619baed4; // multiply by e^(2^-2)\\n if ((x & (ONE >> 1)) != 0)\\n n = (n * 0x1368b2fc6f9609fe7aceb46aa619baed5) / 0x0bc5ab1b16779be3575bd8f0520a9f21f; // multiply by e^(2^-1)\\n if ((x & (ONE << 0)) != 0)\\n n = (n * 0x0bc5ab1b16779be3575bd8f0520a9f21e) / 0x0454aaa8efe072e7f6ddbab84b40a55c9; // multiply by e^(2^+0)\\n if ((x & (ONE << 1)) != 0)\\n n = (n * 0x0454aaa8efe072e7f6ddbab84b40a55c5) / 0x00960aadc109e7a3bf4578099615711ea; // multiply by e^(2^+1)\\n if ((x & (ONE << 2)) != 0)\\n n = (n * 0x00960aadc109e7a3bf4578099615711d7) / 0x0002bf84208204f5977f9a8cf01fdce3d; // multiply by e^(2^+2)\\n if ((x & (ONE << 3)) != 0)\\n n = (n * 0x0002bf84208204f5977f9a8cf01fdc307) / 0x0000003c6ab775dd0b95b4cbee7e65d11; // multiply by e^(2^+3)\\n }\\n\\n return Fraction({ n: n, d: ONE });\\n }\\n\\n /**\\n * @dev returns a fraction with truncated components\\n * note that since the input value is truncated, the use of the method incurs precision loss\\n */\\n function truncatedFraction(Fraction memory fraction, uint256 max) internal pure returns (Fraction memory) {\\n uint256 scale = Math.ceilDiv(Math.max(fraction.n, fraction.d), max);\\n Fraction memory truncated = Fraction({ n: fraction.n / scale, d: fraction.d / scale });\\n if (truncated.d == 0) {\\n revert InvalidFraction();\\n }\\n\\n return truncated;\\n }\\n\\n /**\\n * @dev returns the weighted average of two fractions\\n */\\n function weightedAverage(\\n Fraction memory fraction1,\\n Fraction memory fraction2,\\n uint256 weight1,\\n uint256 weight2\\n ) internal pure returns (Fraction memory) {\\n return\\n Fraction({\\n n: fraction1.n * fraction2.d * weight1 + fraction1.d * fraction2.n * weight2,\\n d: fraction1.d * fraction2.d * (weight1 + weight2)\\n });\\n }\\n\\n /**\\n * @dev returns whether or not the deviation of an offset sample from a base sample is within a permitted range\\n * for example, if the maximum permitted deviation is 5%, then evaluate `95% * base <= offset <= 105% * base`\\n */\\n function isInRange(\\n Fraction memory baseSample,\\n Fraction memory offsetSample,\\n uint32 maxDeviationPPM\\n ) internal pure returns (bool) {\\n Uint512 memory min = mul512(baseSample.n, offsetSample.d * (PPM_RESOLUTION - maxDeviationPPM));\\n Uint512 memory mid = mul512(baseSample.d, offsetSample.n * PPM_RESOLUTION);\\n Uint512 memory max = mul512(baseSample.n, offsetSample.d * (PPM_RESOLUTION + maxDeviationPPM));\\n return lte512(min, mid) && lte512(mid, max);\\n }\\n\\n /**\\n * @dev returns an `Sint256` positive representation of an unsigned integer\\n */\\n function toPos256(uint256 n) internal pure returns (Sint256 memory) {\\n return Sint256({ value: n, isNeg: false });\\n }\\n\\n /**\\n * @dev returns an `Sint256` negative representation of an unsigned integer\\n */\\n function toNeg256(uint256 n) internal pure returns (Sint256 memory) {\\n return Sint256({ value: n, isNeg: true });\\n }\\n\\n /**\\n * @dev returns the largest integer smaller than or equal to `x * y / z`\\n */\\n function mulDivF(uint256 x, uint256 y, uint256 z) internal pure returns (uint256) {\\n Uint512 memory xy = mul512(x, y);\\n\\n // if `x * y < 2 ^ 256`\\n if (xy.hi == 0) {\\n return xy.lo / z;\\n }\\n\\n // assert `x * y / z < 2 ^ 256`\\n if (xy.hi >= z) {\\n revert Overflow();\\n }\\n\\n uint256 m = _mulMod(x, y, z); // `m = x * y % z`\\n Uint512 memory n = _sub512(xy, m); // `n = x * y - m` hence `n / z = floor(x * y / z)`\\n\\n // if `n < 2 ^ 256`\\n if (n.hi == 0) {\\n return n.lo / z;\\n }\\n\\n uint256 p = _unsafeSub(0, z) & z; // `p` is the largest power of 2 which `z` is divisible by\\n uint256 q = _div512(n, p); // `n` is divisible by `p` because `n` is divisible by `z` and `z` is divisible by `p`\\n uint256 r = _inv256(z / p); // `z / p = 1 mod 2` hence `inverse(z / p) = 1 mod 2 ^ 256`\\n return _unsafeMul(q, r); // `q * r = (n / p) * inverse(z / p) = n / z`\\n }\\n\\n /**\\n * @dev returns the smallest integer larger than or equal to `x * y / z`\\n */\\n function mulDivC(uint256 x, uint256 y, uint256 z) internal pure returns (uint256) {\\n uint256 w = mulDivF(x, y, z);\\n if (_mulMod(x, y, z) > 0) {\\n if (w >= type(uint256).max) {\\n revert Overflow();\\n }\\n\\n return w + 1;\\n }\\n return w;\\n }\\n\\n /**\\n * @dev returns the maximum of `n1 - n2` and 0\\n */\\n function subMax0(uint256 n1, uint256 n2) internal pure returns (uint256) {\\n return n1 > n2 ? n1 - n2 : 0;\\n }\\n\\n /**\\n * @dev returns the value of `x > y`\\n */\\n function gt512(Uint512 memory x, Uint512 memory y) internal pure returns (bool) {\\n return x.hi > y.hi || (x.hi == y.hi && x.lo > y.lo);\\n }\\n\\n /**\\n * @dev returns the value of `x < y`\\n */\\n function lt512(Uint512 memory x, Uint512 memory y) internal pure returns (bool) {\\n return x.hi < y.hi || (x.hi == y.hi && x.lo < y.lo);\\n }\\n\\n /**\\n * @dev returns the value of `x >= y`\\n */\\n function gte512(Uint512 memory x, Uint512 memory y) internal pure returns (bool) {\\n return !lt512(x, y);\\n }\\n\\n /**\\n * @dev returns the value of `x <= y`\\n */\\n function lte512(Uint512 memory x, Uint512 memory y) internal pure returns (bool) {\\n return !gt512(x, y);\\n }\\n\\n /**\\n * @dev returns the value of `x * y`\\n */\\n function mul512(uint256 x, uint256 y) internal pure returns (Uint512 memory) {\\n uint256 p = _mulModMax(x, y);\\n uint256 q = _unsafeMul(x, y);\\n if (p >= q) {\\n return Uint512({ hi: p - q, lo: q });\\n }\\n return Uint512({ hi: _unsafeSub(p, q) - 1, lo: q });\\n }\\n\\n /**\\n * @dev returns the value of `x - y`, given that `x >= y`\\n */\\n function _sub512(Uint512 memory x, uint256 y) private pure returns (Uint512 memory) {\\n if (x.lo >= y) {\\n return Uint512({ hi: x.hi, lo: x.lo - y });\\n }\\n return Uint512({ hi: x.hi - 1, lo: _unsafeSub(x.lo, y) });\\n }\\n\\n /**\\n * @dev returns the value of `x / pow2n`, given that `x` is divisible by `pow2n`\\n */\\n function _div512(Uint512 memory x, uint256 pow2n) private pure returns (uint256) {\\n uint256 pow2nInv = _unsafeAdd(_unsafeSub(0, pow2n) / pow2n, 1); // `1 << (256 - n)`\\n return _unsafeMul(x.hi, pow2nInv) | (x.lo / pow2n); // `(x.hi << (256 - n)) | (x.lo >> n)`\\n }\\n\\n /**\\n * @dev returns the inverse of `d` modulo `2 ^ 256`, given that `d` is congruent to `1` modulo `2`\\n */\\n function _inv256(uint256 d) private pure returns (uint256) {\\n // approximate the root of `f(x) = 1 / x - d` using the newton\\u2013raphson convergence method\\n uint256 x = 1;\\n for (uint256 i = 0; i < 8; i++) {\\n x = _unsafeMul(x, _unsafeSub(2, _unsafeMul(x, d))); // `x = x * (2 - x * d) mod 2 ^ 256`\\n }\\n return x;\\n }\\n\\n /**\\n * @dev returns `(x + y) % 2 ^ 256`\\n */\\n function _unsafeAdd(uint256 x, uint256 y) private pure returns (uint256) {\\n unchecked {\\n return x + y;\\n }\\n }\\n\\n /**\\n * @dev returns `(x - y) % 2 ^ 256`\\n */\\n function _unsafeSub(uint256 x, uint256 y) private pure returns (uint256) {\\n unchecked {\\n return x - y;\\n }\\n }\\n\\n /**\\n * @dev returns `(x * y) % 2 ^ 256`\\n */\\n function _unsafeMul(uint256 x, uint256 y) private pure returns (uint256) {\\n unchecked {\\n return x * y;\\n }\\n }\\n\\n /**\\n * @dev returns `x * y % (2 ^ 256 - 1)`\\n */\\n function _mulModMax(uint256 x, uint256 y) private pure returns (uint256) {\\n return mulmod(x, y, type(uint256).max);\\n }\\n\\n /**\\n * @dev returns `x * y % z`\\n */\\n function _mulMod(uint256 x, uint256 y, uint256 z) private pure returns (uint256) {\\n return mulmod(x, y, z);\\n }\\n}\\n\",\"keccak256\":\"0xabe13aa0b2ffde5e2c234a00f97656216a4cc818c85a3f4adbb09a702d2c7fa5\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/utility/Time.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\n/**\\n * @dev this contract abstracts the block timestamp in order to allow for more flexible control in tests\\n */\\nabstract contract Time {\\n /**\\n * @dev returns the current time\\n */\\n function _time() internal view virtual returns (uint32) {\\n return uint32(block.timestamp);\\n }\\n}\\n\",\"keccak256\":\"0x9d1b2e564c5c980eeab286a14d39872b41b23b7adfba8df5d89f906d5a2e58ad\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/utility/Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { AccessControlEnumerableUpgradeable } from \\\"@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol\\\";\\n\\nimport { IUpgradeable } from \\\"./interfaces/IUpgradeable.sol\\\";\\n\\nimport { AccessDenied } from \\\"./Utils.sol\\\";\\n\\n/**\\n * @dev this contract provides common utilities for upgradeable contracts\\n *\\n * note that we're using the Transparent Upgradeable Proxy pattern and *not* the Universal Upgradeable Proxy Standard\\n * (UUPS) pattern, therefore initializing the implementation contracts is not necessary or required\\n */\\nabstract contract Upgradeable is IUpgradeable, AccessControlEnumerableUpgradeable {\\n error AlreadyInitialized();\\n\\n // the admin role is used to allow a non-proxy admin to perform additional initialization/setup during contract\\n // upgrades\\n bytes32 internal constant ROLE_ADMIN = keccak256(\\\"ROLE_ADMIN\\\");\\n\\n uint32 internal constant MAX_GAP = 50;\\n\\n uint16 internal _initializations;\\n\\n // upgrade forward-compatibility storage gap\\n uint256[MAX_GAP - 1] private __gap;\\n\\n // solhint-disable func-name-mixedcase\\n\\n /**\\n * @dev initializes the contract and its parents\\n */\\n function __Upgradeable_init() internal onlyInitializing {\\n __AccessControl_init();\\n\\n __Upgradeable_init_unchained();\\n }\\n\\n /**\\n * @dev performs contract-specific initialization\\n */\\n function __Upgradeable_init_unchained() internal onlyInitializing {\\n _initializations = 1;\\n\\n // set up administrative roles\\n _setRoleAdmin(ROLE_ADMIN, ROLE_ADMIN);\\n\\n // allow the deployer to initially be the admin of the contract\\n _setupRole(ROLE_ADMIN, msg.sender);\\n }\\n\\n // solhint-enable func-name-mixedcase\\n\\n modifier onlyAdmin() {\\n _hasRole(ROLE_ADMIN, msg.sender);\\n\\n _;\\n }\\n\\n modifier onlyRoleMember(bytes32 role) {\\n _hasRole(role, msg.sender);\\n\\n _;\\n }\\n\\n function version() public view virtual override returns (uint16);\\n\\n /**\\n * @dev returns the admin role\\n */\\n function roleAdmin() external pure returns (bytes32) {\\n return ROLE_ADMIN;\\n }\\n\\n /**\\n * @dev performs post-upgrade initialization\\n *\\n * requirements:\\n *\\n * - this must can be called only once per-upgrade\\n */\\n function postUpgrade(bytes calldata data) external {\\n uint16 initializations = _initializations + 1;\\n\\n if (initializations != version()) {\\n revert AlreadyInitialized();\\n }\\n\\n _initializations = initializations;\\n\\n _postUpgrade(data);\\n }\\n\\n /**\\n * @dev an optional post-upgrade callback that can be implemented by child contracts\\n */\\n function _postUpgrade(bytes calldata /* data */) internal virtual {}\\n\\n function _hasRole(bytes32 role, address account) internal view {\\n if (!hasRole(role, account)) {\\n revert AccessDenied();\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3a7fc26c8bcb7332218193111fc775e4aa19af2f5c81b5826f8075490bd3cf48\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/utility/Utils.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { PPM_RESOLUTION } from \\\"./Constants.sol\\\";\\n\\nerror AccessDenied();\\nerror AlreadyExists();\\nerror DoesNotExist();\\nerror InvalidAddress();\\nerror InvalidExternalAddress();\\nerror InvalidFee();\\nerror InvalidPool();\\nerror InvalidPoolCollection();\\nerror InvalidStakedBalance();\\nerror InvalidToken();\\nerror InvalidParam();\\nerror NotEmpty();\\nerror NotPayable();\\nerror ZeroValue();\\n\\n/**\\n * @dev common utilities\\n */\\nabstract contract Utils {\\n // allows execution by the caller only\\n modifier only(address caller) {\\n _only(caller);\\n\\n _;\\n }\\n\\n function _only(address caller) internal view {\\n if (msg.sender != caller) {\\n revert AccessDenied();\\n }\\n }\\n\\n // verifies that a value is greater than zero\\n modifier greaterThanZero(uint256 value) {\\n _greaterThanZero(value);\\n\\n _;\\n }\\n\\n // error message binary size optimization\\n function _greaterThanZero(uint256 value) internal pure {\\n if (value == 0) {\\n revert ZeroValue();\\n }\\n }\\n\\n // validates an address - currently only checks that it isn't null\\n modifier validAddress(address addr) {\\n _validAddress(addr);\\n\\n _;\\n }\\n\\n // error message binary size optimization\\n function _validAddress(address addr) internal pure {\\n if (addr == address(0)) {\\n revert InvalidAddress();\\n }\\n }\\n\\n // validates an external address - currently only checks that it isn't null or this\\n modifier validExternalAddress(address addr) {\\n _validExternalAddress(addr);\\n\\n _;\\n }\\n\\n // error message binary size optimization\\n function _validExternalAddress(address addr) internal view {\\n if (addr == address(0) || addr == address(this)) {\\n revert InvalidExternalAddress();\\n }\\n }\\n\\n // ensures that the fee is valid\\n modifier validFee(uint32 fee) {\\n _validFee(fee);\\n\\n _;\\n }\\n\\n // error message binary size optimization\\n function _validFee(uint32 fee) internal pure {\\n if (fee > PPM_RESOLUTION) {\\n revert InvalidFee();\\n }\\n }\\n}\\n\",\"keccak256\":\"0x62b8b81d3069467eb6402b8f61adcc24f5b2e310db1a2ee64d719229306ab823\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/utility/interfaces/IOwned.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\n/**\\n * @dev Owned interface\\n */\\ninterface IOwned {\\n /**\\n * @dev returns the address of the current owner\\n */\\n function owner() external view returns (address);\\n\\n /**\\n * @dev allows transferring the contract ownership\\n *\\n * requirements:\\n *\\n * - the caller must be the owner of the contract\\n * - the new owner still needs to accept the transfer\\n */\\n function transferOwnership(address ownerCandidate) external;\\n\\n /**\\n * @dev used by a new owner to accept an ownership transfer\\n */\\n function acceptOwnership() external;\\n}\\n\",\"keccak256\":\"0xe6141c9a7cb5853352f35dc83e9504e2c552feadac7c70dd1e029c1b4368b6bb\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/utility/interfaces/IUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { IVersioned } from \\\"./IVersioned.sol\\\";\\n\\nimport { IAccessControlEnumerableUpgradeable } from \\\"@openzeppelin/contracts-upgradeable/access/IAccessControlEnumerableUpgradeable.sol\\\";\\n\\n/**\\n * @dev this is the common interface for upgradeable contracts\\n */\\ninterface IUpgradeable is IAccessControlEnumerableUpgradeable, IVersioned {\\n\\n}\\n\",\"keccak256\":\"0x6019e5e9c706cc023b96313932f5aa7fc3734f446fd0936a2c6530d0d25330da\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/utility/interfaces/IVersioned.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\n/**\\n * @dev an interface for a versioned contract\\n */\\ninterface IVersioned {\\n function version() external view returns (uint16);\\n}\\n\",\"keccak256\":\"0x1969c895e9adc0bc8a85e975517d2f2b9357e0c9011f159d01b90f7d1a464d76\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/vaults/interfaces/IExternalProtectionVault.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { IVault } from \\\"./IVault.sol\\\";\\n\\ninterface IExternalProtectionVault is IVault {}\\n\",\"keccak256\":\"0x0ae5812ccd4166ba2df080b90df2ec128806a237d3ce9359ca6bb23025d63d85\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/vaults/interfaces/IMasterVault.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { IVault } from \\\"./IVault.sol\\\";\\n\\ninterface IMasterVault is IVault {}\\n\",\"keccak256\":\"0x875a0f6792439d100fade7ffb778a34d8eac7ededb43b65d0160281d3d5a83f0\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/vaults/interfaces/IVault.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { IUpgradeable } from \\\"../../utility/interfaces/IUpgradeable.sol\\\";\\n\\nimport { Token } from \\\"../../token/Token.sol\\\";\\n\\n// the asset manager role is required to access all the funds\\nbytes32 constant ROLE_ASSET_MANAGER = keccak256(\\\"ROLE_ASSET_MANAGER\\\");\\n\\ninterface IVault is IUpgradeable {\\n /**\\n * @dev triggered when tokens have been withdrawn from the vault\\n */\\n event FundsWithdrawn(Token indexed token, address indexed caller, address indexed target, uint256 amount);\\n\\n /**\\n * @dev triggered when tokens have been burned from the vault\\n */\\n event FundsBurned(Token indexed token, address indexed caller, uint256 amount);\\n\\n /**\\n * @dev tells whether the vault accepts native token deposits\\n */\\n function isPayable() external view returns (bool);\\n\\n /**\\n * @dev withdraws funds held by the contract and sends them to an account\\n */\\n function withdrawFunds(\\n Token token,\\n address payable target,\\n uint256 amount\\n ) external;\\n\\n /**\\n * @dev burns funds held by the contract\\n */\\n function burn(Token token, uint256 amount) external;\\n}\\n\",\"keccak256\":\"0x1ac16bcccd209b3a73c00144df2b5c53fbd328434277e72457063c26645872d5\",\"license\":\"SEE LICENSE IN LICENSE\"}},\"version\":1}", + "bytecode": "0x6101c0604052610169805460ff191660011790553480156200002057600080fd5b506040516200619038038062006190833981016040819052620000439162000222565b876200004f81620001e1565b876200005b81620001e1565b876200006781620001e1565b876200007381620001e1565b876200007f81620001e1565b876200008b81620001e1565b876200009781620001e1565b87620000a381620001e1565b8f6001600160a01b031660a0816001600160a01b0316815250508f6001600160a01b031663fc0c546a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015620000fc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001229190620002e3565b6001600160a01b039081166080528f1660e081905260408051637e062a3560e11b8152905163fc0c546a916004808201926020929091908290030181865afa15801562000173573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001999190620002e3565b6001600160a01b0390811660c0529d8e1661010052505050509789166101205250505092851661014052908416610160528316610180529091166101a052506200030a915050565b6001600160a01b038116620002095760405163e6c4247b60e01b815260040160405180910390fd5b50565b6001600160a01b03811681146200020957600080fd5b600080600080600080600080610100898b0312156200024057600080fd5b88516200024d816200020c565b60208a015190985062000260816200020c565b60408a015190975062000273816200020c565b60608a015190965062000286816200020c565b60808a015190955062000299816200020c565b60a08a0151909450620002ac816200020c565b60c08a0151909350620002bf816200020c565b60e08a0151909250620002d2816200020c565b809150509295985092959890939650565b600060208284031215620002f657600080fd5b815162000303816200020c565b9392505050565b60805160a05160c05160e05161010051610120516101405161016051610180516101a051615d456200044b600039600061169c015260008181611bad01528181612330015281816124d40152818161352d0152613ce9015260008181610b6a0152612f6b0152600081816128910152612b3e015260008181610e660152818161151f015281816116740152818161172a01528181611cac01528181611e0701528181611e410152818161280201528181612aaf0152818161418c01528181614206015261461401526000818161147901528181611b160152611c000152600050506000612c1601526000505060008181610e930152818161103401528181611ac101528181611e7001528181613220015281816133bc0152818161367f015281816143b90152818161448e01528181614b110152614b4e0152615d456000f3fe60806040526004361061026b5760003560e01c80637bf6a42511610144578063b3db428b116100b6578063d0d145811161007a578063d0d1458114610755578063d3a4acd314610768578063d547741f1461077b578063d6efd7c31461079b578063d895feee146107b0578063e6aac07e146107c357600080fd5b8063b3db428b146106af578063c0c53b8b146106c2578063c109ba13146106e2578063c844748714610702578063ca15c8731461073557600080fd5b806391d148541161010857806391d14854146105df57806393867fb5146105ff5780639bca0e7014610620578063a217fddf1461065a578063a8bf90461461066f578063adf51de11461068f57600080fd5b80637bf6a4251461053c5780638456cb59146105525780638cd2403d146105675780638ffcca07146105875780639010d07c146105a757600080fd5b80633cd11924116101dd57806345d6602c116101a157806345d6602c146104a857806347e7ef24146104bb57806353300772146104ce57806354fd4d50146104ee5780635c975abb1461050a57806371f43f9a1461052357600080fd5b80633cd11924146104145780633d1c24e7146104345780633efcfda41461044757806341f435b314610467578063426599641461048857600080fd5b806326e6b6971161022f57806326e6b697146103525780632e1a7d4d146103725780632f2ff15d14610392578063357a0333146103b257806336568abe146103d257806339fadf98146103f257600080fd5b806301ffc9a714610277578063046f7da2146102ac5780631329db29146102c3578063230df83a146102f4578063248a9ca31461031457600080fd5b3661027257005b600080fd5b34801561028357600080fd5b50610297610292366004615346565b6107f6565b60405190151581526020015b60405180910390f35b3480156102b857600080fd5b506102c1610821565b005b3480156102cf57600080fd5b5061016954610100900463ffffffff1660405163ffffffff90911681526020016102a3565b34801561030057600080fd5b506102c161030f366004615385565b610845565b34801561032057600080fd5b5061034461032f3660046153a2565b60009081526065602052604090206001015490565b6040519081526020016102a3565b34801561035e57600080fd5b506102c161036d3660046153c9565b6109f3565b34801561037e57600080fd5b5061034461038d3660046153a2565b610a30565b34801561039e57600080fd5b506102c16103ad3660046153e6565b610bd5565b3480156103be57600080fd5b506103446103cd366004615416565b610c00565b3480156103de57600080fd5b506102c16103ed3660046153e6565b610c7a565b3480156103fe57600080fd5b50610407610cf8565b6040516102a39190615442565b34801561042057600080fd5b5061034461042f366004615385565b610daa565b6102c161044236600461548f565b610f40565b34801561045357600080fd5b506103446104623660046153a2565b6110e2565b34801561047357600080fd5b50600080516020615cd9833981519152610344565b34801561049457600080fd5b506102c16104a33660046154e0565b6111b6565b6103446104b6366004615566565b611283565b6103446104c9366004615416565b6112f5565b3480156104da57600080fd5b506102c16104e93660046155df565b61136a565b3480156104fa57600080fd5b50604051600981526020016102a3565b34801561051657600080fd5b5061012d5460ff16610297565b34801561052f57600080fd5b506101695460ff16610297565b34801561054857600080fd5b5061016854610344565b34801561055e57600080fd5b506102c1611395565b34801561057357600080fd5b506102c1610582366004615645565b6113b6565b34801561059357600080fd5b506103446105a2366004615385565b611407565b3480156105b357600080fd5b506105c76105c2366004615687565b6117f5565b6040516001600160a01b0390911681526020016102a3565b3480156105eb57600080fd5b506102976105fa3660046153e6565b611814565b34801561060b57600080fd5b50600080516020615d19833981519152610344565b34801561062c57600080fd5b506105c761063b366004615385565b6001600160a01b03908116600090815261016760205260409020541690565b34801561066657600080fd5b50610344600081565b34801561067b57600080fd5b506102c161068a366004615385565b61183f565b34801561069b57600080fd5b506102c16106aa3660046156a9565b611a56565b6103446106bd36600461571c565b611fda565b3480156106ce57600080fd5b506102c16106dd36600461575d565b612059565b3480156106ee57600080fd5b506102c16106fd3660046154e0565b612141565b34801561070e57600080fd5b507f657d38169ed9612cb2d9de7040b7b6a1adebf7a8433a66ccb49c08554ac9b8a5610344565b34801561074157600080fd5b506103446107503660046153a2565b6122eb565b610344610763366004615566565b612302565b610344610776366004615566565b612373565b34801561078757600080fd5b506102c16107963660046153e6565b6123d5565b3480156107a757600080fd5b506104076123fb565b6103446107be366004615566565b6124a6565b3480156107cf57600080fd5b507fdf8c9529ea4b244b569bac557a549516f317e7b5cf82dc5e0d8b6d874930a3f5610344565b60006001600160e01b03198216635a05180f60e01b148061081b575061081b8261250b565b92915050565b600080516020615cd983398151915261083a8133612540565b610842612567565b50565b8061084f816125fc565b610867600080516020615d1983398151915233612540565b600260fb54036108925760405162461bcd60e51b81526004016108899061579d565b60405180910390fd5b600260fb81905550816001600160a01b031663f525cb686040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108fc91906157d4565b1561091a576040516332e7879360e01b815260040160405180910390fd5b61092661016283612623565b6109435760405163b0ce759160e01b815260040160405180910390fd5b61094e826000612638565b816001600160a01b0316826001600160a01b031663b1dd61b66040518163ffffffff1660e01b8152600401602060405180830381865afa158015610996573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ba91906157ed565b61ffff167fa0c1e3924f995e5ba38f53b4effb6d4b3eeb84176a2951c589115140f638ac0960405160405180910390a35050600160fb55565b610a0b600080516020615d1983398151915233612540565b6101695460ff1615158115151461084257610169805482151560ff1990911617905550565b6000610a3f61012d5460ff1690565b15610a5c5760405162461bcd60e51b815260040161088990615811565b600260fb5403610a7e5760405162461bcd60e51b81526004016108899061579d565b600260fb55336000610ae184836000814260405160609290921b6001600160601b031916602083015260e01b6001600160e01b03191660348201526038810184905260580160405160208183030381529060405280519060200120905092915050565b6101605460405163158591ab60e11b8152600481018390526001600160a01b0385811660248301526044820188905292935060009290911690632b0b2356906064016060604051808303816000875af1158015610b42573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b669190615888565b90507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031681600001516001600160a01b031603610bba57610bb0828483612b6f565b9350505050610bcb565b610bc5828483612d29565b93505050505b600160fb55919050565b600082815260656020526040902060010154610bf18133612ec0565b610bfb8383612f24565b505050565b600082610c0c816125fc565b82610c1681612f46565b61012d5460ff1615610c3a5760405162461bcd60e51b815260040161088990615811565b600260fb5403610c5c5760405162461bcd60e51b81526004016108899061579d565b600260fb55610c6c338686612f67565b600160fb5595945050505050565b6001600160a01b0381163314610cea5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610889565b610cf482826131a8565b5050565b60606000610d076101626131ca565b905060008167ffffffffffffffff811115610d2457610d2461583b565b604051908082528060200260200182016040528015610d4d578160200160208202803683370190505b50905060005b82811015610da357610d67610162826131d4565b828281518110610d7957610d796158cc565b6001600160a01b039092166020928302919091019091015280610d9b816158f8565b915050610d53565b5092915050565b6000610db961012d5460ff1690565b15610dd65760405162461bcd60e51b815260040161088990615811565b7f657d38169ed9612cb2d9de7040b7b6a1adebf7a8433a66ccb49c08554ac9b8a5610e018133612540565b82610e0b816125fc565b600260fb5403610e2d5760405162461bcd60e51b81526004016108899061579d565b600260fb55610168546000819003610e49576000935050610f34565b600061016855604051631c20fadd60e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690631c20fadd90610ebf907f00000000000000000000000000000000000000000000000000000000000000009089908690600401615911565b600060405180830381600087803b158015610ed957600080fd5b505af1158015610eed573d6000803e3d6000fd5b50506040518381526001600160a01b03881692503391507f328c9cc28e75030423307e732b07659ae452a620281f3e54e838000a7f4675389060200160405180910390a392505b5050600160fb55919050565b61012d5460ff1615610f645760405162461bcd60e51b815260040161088990615811565b7fdf8c9529ea4b244b569bac557a549516f317e7b5cf82dc5e0d8b6d874930a3f5610f8f8133612540565b600260fb5403610fb15760405162461bcd60e51b81526004016108899061579d565b600260fb55604080516001600160601b031933606090811b82166020808501919091526001600160e01b03194260e01b1660348501528a821b8316603885015289821b909216604c84015282018790526080820186905260a08083018690528351808403909101815260c090920190925280519101206001600160a01b038088167f000000000000000000000000000000000000000000000000000000000000000091909116036110715761106b818787336001886131e0565b50611081565b61107f818789883389613327565b505b60408051868152602081018690529081018490526001600160a01b03808816919089169083907f102bce4e43a6a8cf0306fde6154221c1f5460f64ba63b92b156bce998ef0db569060600160405180910390a45050600160fb555050505050565b60006110f161012d5460ff1690565b1561110e5760405162461bcd60e51b815260040161088990615811565b600260fb54036111305760405162461bcd60e51b81526004016108899061579d565b600260fb5561016054604051635f23b6c560e11b8152336004820152602481018490526001600160a01b039091169063be476d8a906044016020604051808303816000875af1158015611187573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111ab91906157d4565b600160fb5592915050565b806111c0816125fc565b6111d8600080516020615d1983398151915233612540565b600260fb54036111fa5760405162461bcd60e51b81526004016108899061579d565b600260fb5561120b61016283613387565b6112285760405163b0ce759160e01b815260040160405180910390fd5b8260005b8181101561127657611264868683818110611249576112496158cc565b905060200201602081019061125e9190615385565b856133a9565b8061126e816158f8565b91505061122c565b5050600160fb5550505050565b600061129261012d5460ff1690565b156112af5760405162461bcd60e51b815260040161088990615811565b600260fb54036112d15760405162461bcd60e51b81526004016108899061579d565b600260fb556112e58787878787873361351a565b600160fb55979650505050505050565b60006112ff6135f2565b82611309816125fc565b8261131381612f46565b61012d5460ff16156113375760405162461bcd60e51b815260040161088990615811565b600260fb54036113595760405162461bcd60e51b81526004016108899061579d565b600260fb55610c6c33868682613618565b611382600080516020615d1983398151915233612540565b8061138c816136d6565b610cf482613700565b600080516020615cd98339815191526113ae8133612540565b610842613780565b60c9546000906113cb9061ffff166001615935565b905061ffff81166009146113f15760405162dc149f60e41b815260040160405180910390fd5b60c9805461ffff191661ffff8316179055505050565b600061141661012d5460ff1690565b156114335760405162461bcd60e51b815260040161088990615811565b600260fb54036114555760405162461bcd60e51b81526004016108899061579d565b600260fb5560405163ce53e72960e01b81526001600160a01b0383811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063ce53e72990602401602060405180830381865afa1580156114c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114e4919061595b565b611501576040516307d7f4eb60e21b815260040160405180910390fd5b600061150c836137da565b905060006115436001600160a01b0385167f0000000000000000000000000000000000000000000000000000000000000000613816565b60405163a135ef1760e01b81526001600160a01b03868116600483015291925060009184169063a135ef1790602401606060405180830381865afa15801561158f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115b3919061599d565b60408101519091508281106115db576040516341e43e3960e01b815260040160405180910390fd5b6040516387a7db0f60e01b81526001600160a01b0387811660048301528516906387a7db0f90602401600060405180830381600087803b15801561161e57600080fd5b505af1158015611632573d6000803e3d6000fd5b505050506000818461164491906159e7565b61016954909150600090611668908390610100900463ffffffff16620f42406138a4565b90506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016631c20fadd897f00000000000000000000000000000000000000000000000000000000000000006116c585876159e7565b6040518463ffffffff1660e01b81526004016116e393929190615911565b600060405180830381600087803b1580156116fd57600080fd5b505af1158015611711573d6000803e3d6000fd5b5050604051631c20fadd60e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169250631c20fadd9150611765908b9033908690600401615911565b600060405180830381600087803b15801561177f57600080fd5b505af1158015611793573d6000803e3d6000fd5b5050506001600160a01b0389169050337f5ad7a2184454b6259cd118e4041a953dc9d6498302bbe528e4f967bed91971296117ce84866159e7565b60408051918252602082018690520160405180910390a350600160fb559695505050505050565b600082815260976020526040812061180d90836131d4565b9392505050565b60009182526065602090815260408084206001600160a01b0393909316845291905290205460ff1690565b80611849816125fc565b611861600080516020615d1983398151915233612540565b600260fb54036118835760405162461bcd60e51b81526004016108899061579d565b600260fb819055506000826001600160a01b031663b1dd61b66040518163ffffffff1660e01b8152600401602060405180830381865afa1580156118cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118ef91906157ed565b90506000836001600160a01b03166354fd4d506040518163ffffffff1660e01b8152600401602060405180830381865afa158015611931573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061195591906157ed565b905060006119638383613970565b90506001600160a01b038116151580611985575061198361016286613aa8565b155b156119a35760405163119b4fd360e11b815260040160405180910390fd5b6119ae856001612638565b846001600160a01b0316856001600160a01b031663b1dd61b66040518163ffffffff1660e01b8152600401602060405180830381865afa1580156119f6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a1a91906157ed565b61ffff167f5ae87719d73cb0fabb219f0e4b6e0a614ed7506f8a08bdb20bebf313573151b760405160405180910390a35050600160fb55505050565b84611a60816125fc565b84611a6a81612f46565b84611a74816125fc565b61012d5460ff1615611a985760405162461bcd60e51b815260040161088990615811565b600260fb5403611aba5760405162461bcd60e51b81526004016108899061579d565b600260fb557f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811690891614158015611b83575060405163b5af090f60e01b81526001600160a01b0389811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063b5af090f90602401602060405180830381865afa158015611b5d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b81919061595b565b155b15611ba157604051630b094f2760e31b815260040160405180910390fd5b60006001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163303611bdb57506000611c7d565b604051637c36afad60e01b81526001600160a01b038a81166004830152611c7a918a917f00000000000000000000000000000000000000000000000000000000000000001690637c36afad90602401602060405180830381865afa158015611c47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c6b91906159fe565b63ffffffff16620f42406138a4565b90505b6000611c926001600160a01b038b1630613816565b604051631c20fadd60e01b81529091506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690631c20fadd90611ce5908d908c908e90600401615911565b600060405180830381600087803b158015611cff57600080fd5b505af1158015611d13573d6000803e3d6000fd5b50505050876001600160a01b03166323e30c8b33611d378d6001600160a01b031690565b8c868c8c6040518763ffffffff1660e01b8152600401611d5c96959493929190615a1b565b600060405180830381600087803b158015611d7657600080fd5b505af1158015611d8a573d6000803e3d6000fd5b50505050600081611dad308d6001600160a01b031661381690919063ffffffff16565b611db791906159e7565b9050611dc3838b615a77565b811015611de35760405163b7ed78bf60e01b815260040160405180910390fd5b611df58b6001600160a01b0316613abd565b15611e3257611e2d6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001682613adf565b611e66565b611e666001600160a01b038c167f000000000000000000000000000000000000000000000000000000000000000083613bf8565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116908c1603611f0f5761015f54604051637c8f622d60e01b81526001600160a01b038d811660048301526024820186905260006044830152909116908190637c8f622d90606401600060405180830381600087803b158015611ef157600080fd5b505af1158015611f05573d6000803e3d6000fd5b5050505050611f82565b6000611f1a8c6137da565b604051631510748b60e01b81526001600160a01b038e811660048301526024820187905291925090821690631510748b90604401600060405180830381600087803b158015611f6857600080fd5b505af1158015611f7c573d6000803e3d6000fd5b50505050505b604080518b81526020810185905233916001600160a01b038e16917f0da3485ef1bb570df7bb888887eae5aa01d81b83cd8ccc80c0ea0922a677ecef910160405180910390a35050600160fb55505050505050505050565b6000611fe46135f2565b83611fee816125fc565b83611ff8816125fc565b8361200281612f46565b61012d5460ff16156120265760405162461bcd60e51b815260040161088990615811565b600260fb54036120485760405162461bcd60e51b81526004016108899061579d565b600260fb556112e587878733613618565b82612063816125fc565b8261206d816125fc565b82612077816125fc565b600054610100900460ff166120925760005460ff1615612096565b303b155b6120f95760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610889565b600054610100900460ff1615801561211b576000805461ffff19166101011790555b612126878787613c63565b8015612138576000805461ff00191690555b50505050505050565b600260fb54036121635760405162461bcd60e51b81526004016108899061579d565b600260fb5561217461016282613387565b6121915760405163b0ce759160e01b815260040160405180910390fd5b8160005b818110156122df5760008585838181106121b1576121b16158cc565b90506020020160208101906121c69190615385565b6101615460405163772b7e9760e01b81526001600160a01b038084166004830152878116602483015292935091169063772b7e9790604401600060405180830381600087803b15801561221857600080fd5b505af115801561222c573d6000803e3d6000fd5b5050506001600160a01b038083166000818152610167602052604080822080548a86166001600160a01b031982161790915590519316935083927f987eb3c2f78454541205f72f34839b434c306c9eaf4922efd7c0c3060fdb2e4c9190a3846001600160a01b0316826001600160a01b03167f95f865c2808f8b2a85eea2611db7843150ee7835ef1403f9755918a97d76933c60405160405180910390a3505080806122d7906158f8565b915050612195565b5050600160fb55505050565b600081815260976020526040812061081b906131ca565b600061231161012d5460ff1690565b1561232e5760405162461bcd60e51b815260040161088990615811565b7f000000000000000000000000000000000000000000000000000000000000000061235881613cad565b6123678888888888883361351a565b98975050505050505050565b600061238261012d5460ff1690565b1561239f5760405162461bcd60e51b815260040161088990615811565b600260fb54036123c15760405162461bcd60e51b81526004016108899061579d565b600260fb556112e587878787878733613cd6565b6000828152606560205260409020600101546123f18133612ec0565b610bfb83836131a8565b6060600061240a6101656131ca565b905060008167ffffffffffffffff8111156124275761242761583b565b604051908082528060200260200182016040528015612450578160200160208202803683370190505b50905060005b82811015610da35761246a610165826131d4565b82828151811061247c5761247c6158cc565b6001600160a01b03909216602092830291909101909101528061249e816158f8565b915050612456565b60006124b561012d5460ff1690565b156124d25760405162461bcd60e51b815260040161088990615811565b7f00000000000000000000000000000000000000000000000000000000000000006124fc81613cad565b61236788888888888833613cd6565b60006001600160e01b03198216637965db0b60e01b148061081b57506301ffc9a760e01b6001600160e01b031983161461081b565b61254a8282611814565b610cf457604051634ca8886760e01b815260040160405180910390fd5b61012d5460ff166125b15760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610889565b61012d805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6001600160a01b0381166108425760405163e6c4247b60e01b815260040160405180910390fd5b600061180d836001600160a01b038416613da1565b8181156128ec5761015f54604051632f2ff15d60e01b81527f4cbb5676e6e25e1a3b8a36de10472bcac96f97bd8dd87af6f330881b84739eb860048201526001600160a01b03838116602483015290911690632f2ff15d90604401600060405180830381600087803b1580156126ad57600080fd5b505af11580156126c1573d6000803e3d6000fd5b505061015f54604051632f2ff15d60e01b81527f0d0d17bf5382c809d9a3899d6a94e57386dfb2036f0401b94ef3cf6c1a9ab73f60048201526001600160a01b0385811660248301529091169250632f2ff15d9150604401600060405180830381600087803b15801561273357600080fd5b505af1158015612747573d6000803e3d6000fd5b505061015f54604051632f2ff15d60e01b81527fca51b9188e78415f30da725e0d94567b4d65bc6777d4e5d573191e9f55b88a3260048201526001600160a01b0385811660248301529091169250632f2ff15d9150604401600060405180830381600087803b1580156127b957600080fd5b505af11580156127cd573d6000803e3d6000fd5b5050604051632f2ff15d60e01b8152600080516020615cf983398151915260048201526001600160a01b0384811660248301527f0000000000000000000000000000000000000000000000000000000000000000169250632f2ff15d9150604401600060405180830381600087803b15801561284857600080fd5b505af115801561285c573d6000803e3d6000fd5b5050604051632f2ff15d60e01b8152600080516020615cf983398151915260048201526001600160a01b0384811660248301527f0000000000000000000000000000000000000000000000000000000000000000169250632f2ff15d91506044015b600060405180830381600087803b1580156128d857600080fd5b505af1158015612138573d6000803e3d6000fd5b61015f5460405163d547741f60e01b81527f4cbb5676e6e25e1a3b8a36de10472bcac96f97bd8dd87af6f330881b84739eb860048201526001600160a01b0383811660248301529091169063d547741f90604401600060405180830381600087803b15801561295a57600080fd5b505af115801561296e573d6000803e3d6000fd5b505061015f5460405163d547741f60e01b81527f0d0d17bf5382c809d9a3899d6a94e57386dfb2036f0401b94ef3cf6c1a9ab73f60048201526001600160a01b038581166024830152909116925063d547741f9150604401600060405180830381600087803b1580156129e057600080fd5b505af11580156129f4573d6000803e3d6000fd5b505061015f5460405163d547741f60e01b81527fca51b9188e78415f30da725e0d94567b4d65bc6777d4e5d573191e9f55b88a3260048201526001600160a01b038581166024830152909116925063d547741f9150604401600060405180830381600087803b158015612a6657600080fd5b505af1158015612a7a573d6000803e3d6000fd5b505060405163d547741f60e01b8152600080516020615cf983398151915260048201526001600160a01b0384811660248301527f000000000000000000000000000000000000000000000000000000000000000016925063d547741f9150604401600060405180830381600087803b158015612af557600080fd5b505af1158015612b09573d6000803e3d6000fd5b505060405163d547741f60e01b8152600080516020615cf983398151915260048201526001600160a01b0384811660248301527f000000000000000000000000000000000000000000000000000000000000000016925063d547741f91506044016128be565b61015f5481516101605460208401516040516323b872dd60e01b81526000946001600160a01b03908116948116936323b872dd93612bb69391909216918691600401615911565b6020604051808303816000875af1158015612bd5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bf9919061595b565b5060208301516040516323b872dd60e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016916323b872dd91612c4e918891869190600401615911565b6020604051808303816000875af1158015612c6d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c91919061595b565b50602083015160408085015190516372026c6760e11b8152600481018890526001600160a01b038781166024830152604482019390935260648101919091529082169063e404d8ce906084016020604051808303816000875af1158015612cfc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d2091906157d4565b95945050505050565b60008082600001516001600160a01b031663f4325d676040518163ffffffff1660e01b8152600401602060405180830381865afa158015612d6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d929190615a8f565b90506000612d9f826137da565b84516101605460208701516040516323b872dd60e01b81529394506001600160a01b03928316936323b872dd93612ddc9316918691600401615911565b6020604051808303816000875af1158015612dfb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e1f919061595b565b50602084015160408086015190516356aca36f60e01b8152600481018990526001600160a01b038881166024830152858116604483015260648201939093526084810191909152908216906356aca36f9060a4016020604051808303816000875af1158015612e92573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612eb691906157d4565b9695505050505050565b612eca8282611814565b610cf457612ee2816001600160a01b03166014613e94565b612eed836020613e94565b604051602001612efe929190615ad8565b60408051601f198184030181529082905262461bcd60e51b825261088991600401615b4d565b612f2e8282614030565b6000828152609760205260409020610bfb9082613aa8565b8060000361084257604051637c946ed760e01b815260040160405180910390fd5b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b0316146130af576000836001600160a01b031663f4325d676040518163ffffffff1660e01b8152600401602060405180830381865afa158015612fe2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130069190615a8f565b9050836001600160a01b031661301b826137da565b604051635768adcf60e01b81526001600160a01b0384811660048301529190911690635768adcf90602401602060405180830381865afa158015613063573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130879190615a8f565b6001600160a01b0316146130ad5760405162820f3560e61b815260040160405180910390fd5b505b610160546040516323b872dd60e01b81526001600160a01b03808616926323b872dd926130e492899216908790600401615911565b6020604051808303816000875af1158015613103573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613127919061595b565b50610160546040516313e7e7d160e11b81526001600160a01b03909116906327cfcfa29061315d90879087908790600401615911565b6020604051808303816000875af115801561317c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131a091906157d4565b949350505050565b6131b282826140b6565b6000828152609760205260409020610bfb9082612623565b600061081b825490565b600061180d838361411d565b60003415613201576040516342f7487960e11b815260040160405180910390fd5b61015f546040516323b872dd60e01b81526001600160a01b03918216917f000000000000000000000000000000000000000000000000000000000000000016906323b872dd9061325990889085908b90600401615911565b6020604051808303816000875af1158015613278573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061329c919061595b565b5060405163e06bf20d60e01b8152600481018990526001600160a01b0388811660248301526044820188905285151560648301526084820185905282169063e06bf20d9060a4015b6020604051808303816000875af1158015613303573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061236791906157d4565b6000613334858484614147565b600061333f866137da565b604051639f5c734b60e01b8152600481018a90526001600160a01b03898116602483015288811660448301526064820188905291925090821690639f5c734b906084016132e4565b6001600160a01b0381166000908152600183016020526040812054151561180d565b6133b2826125fc565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116908316036133fe5760405163c1ab6dc160e01b815260040160405180910390fd5b61340a61016583613aa8565b6134275760405163119b4fd360e11b815260040160405180910390fd5b604051634824fce960e11b81526001600160a01b038381166004830152821690639049f9d290602401600060405180830381600087803b15801561346a57600080fd5b505af115801561347e573d6000803e3d6000fd5b505050506001600160a01b038281166000818152610167602052604080822080546001600160a01b0319169486169485179055517f4f2ce4e40f623ca765fc0167a25cb7842ceaafb8d82d3dec26ca0d0e0d2d48969190a3806001600160a01b0316826001600160a01b03167f95f865c2808f8b2a85eea2611db7843150ee7835ef1403f9755918a97d76933c60405160405180910390a35050565b6000613529888888888861422b565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b031603613568575060015b6135e560405180604001604052808b6001600160a01b031681526020018a6001600160a01b031681525060405180608001604052808a81526020018981526020016000151581526020018415158152506040518060400160405280876001600160a01b03168152602001886001600160a01b0316815250886142af565b9998505050505050505050565b6101695460ff16613616576040516303a5be3f60e31b815260040160405180910390fd5b565b604080516001600160601b0319606084811b82166020808501919091526001600160e01b03194260e01b16603485015288821b8316603885015287821b909216604c84015280830186905283518084039091018152608090920190925280519101206000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03908116908616036136c8576136c0818786866000806131e0565b9150506131a0565b612eb6818787878789613327565b620f424063ffffffff82161115610842576040516358d620b360e01b815260040160405180910390fd5b6101695463ffffffff6101009091048116908216810361371e575050565b610169805464ffffffff00191661010063ffffffff8581169182029290921790925560408051918416825260208201929092527fa159b13d7eac36d9a65034b4fd6ace1d9cb070d063dc950c564a266f4d091802910160405180910390a15050565b61012d5460ff16156137a45760405162461bcd60e51b815260040161088990615811565b61012d805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586125df3390565b6001600160a01b03808216600090815261016760205260408120549091168061081b5760405163c1ab6dc160e01b815260040160405180910390fd5b600061382183613abd565b1561383757506001600160a01b0381163161081b565b826040516370a0823160e01b81526001600160a01b03848116600483015291909116906370a0823190602401602060405180830381865afa158015613880573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061180d91906157d4565b6000806138b185856146b3565b80519091506000036138d5578281602001516138cd9190615b96565b91505061180d565b805183116138f657604051631a93c68960e11b815260040160405180910390fd5b600061390386868661473a565b905060006139118383614755565b80519091506000036139375784816020015161392d9190615b96565b935050505061180d565b600085810386169061394983836147da565b9050600061395f61395a848a615b96565b614811565b919091029998505050505050505050565b60008061397e6101626131ca565b905060005b81811015613a9d576000613999610162836131d4565b90508561ffff16816001600160a01b031663b1dd61b66040518163ffffffff1660e01b8152600401602060405180830381865afa1580156139de573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a0291906157ed565b61ffff16148015613a7b57508461ffff16816001600160a01b03166354fd4d506040518163ffffffff1660e01b8152600401602060405180830381865afa158015613a51573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a7591906157ed565b61ffff16145b15613a8a57925061081b915050565b5080613a95816158f8565b915050613983565b506000949350505050565b600061180d836001600160a01b03841661483c565b6001600160a01b031673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1490565b80471015613b2f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610889565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114613b7c576040519150601f19603f3d011682016040523d82523d6000602084013e613b81565b606091505b5050905080610bfb5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610889565b80600003613c0557505050565b613c0e83613abd565b15613c4f576040516001600160a01b0383169082156108fc029083906000818181858888f19350505050158015613c49573d6000803e3d6000fd5b50505050565b610bfb6001600160a01b038416838361488b565b600054610100900460ff16613c8a5760405162461bcd60e51b815260040161088990615bb8565b613c926148ee565b613c9a614925565b613ca2614954565b610bfb838383614983565b336001600160a01b0382161461084257604051634ca8886760e01b815260040160405180910390fd5b6000613ce5888888888861422b565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b031603613d24575060015b6135e560405180604001604052808b6001600160a01b031681526020018a6001600160a01b031681525060405180608001604052808a81526020018981526020016001151581526020018415158152506040518060400160405280876001600160a01b03168152602001886001600160a01b0316815250886142af565b60008181526001830160205260408120548015613e8a576000613dc56001836159e7565b8554909150600090613dd9906001906159e7565b9050818114613e3e576000866000018281548110613df957613df96158cc565b9060005260206000200154905080876000018481548110613e1c57613e1c6158cc565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080613e4f57613e4f615c03565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061081b565b600091505061081b565b60606000613ea3836002615c19565b613eae906002615a77565b67ffffffffffffffff811115613ec657613ec661583b565b6040519080825280601f01601f191660200182016040528015613ef0576020820181803683370190505b509050600360fc1b81600081518110613f0b57613f0b6158cc565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110613f3a57613f3a6158cc565b60200101906001600160f81b031916908160001a9053506000613f5e846002615c19565b613f69906001615a77565b90505b6001811115613fe1576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110613f9d57613f9d6158cc565b1a60f81b828281518110613fb357613fb36158cc565b60200101906001600160f81b031916908160001a90535060049490941c93613fda81615c38565b9050613f6c565b50831561180d5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610889565b61403a8282611814565b610cf45760008281526065602090815260408083206001600160a01b03851684529091529020805460ff191660011790556140723390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6140c08282611814565b15610cf45760008281526065602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000826000018281548110614134576141346158cc565b9060005260206000200154905092915050565b614159836001600160a01b0316613abd565b156141d7578034101561417f576040516342f7487960e11b815260040160405180910390fd5b6141b26001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001682613adf565b80341115610bfb57610bfb6141c782346159e7565b6001600160a01b03841690613adf565b34156141f6576040516342f7487960e11b815260040160405180910390fd5b610bfb6001600160a01b038416837f000000000000000000000000000000000000000000000000000000000000000084614a99565b614234856125fc565b61423d846125fc565b836001600160a01b0316856001600160a01b03160361426f5760405163c1ab6dc160e01b815260040160405180910390fd5b61427883612f46565b61428182612f46565b4263ffffffff168110156142a857604051631ab7da6b60e01b815260040160405180910390fd5b5050505050565b60208201516000906001600160a01b03166142d55782516001600160a01b031660208401525b825185516020808801518751888301516040808b0151858b015182516001600160601b031960609a8b1b8116828a01526001600160e01b03194260e01b166034830152988a1b8916603882015295891b8816604c87015288860194909452608080860193909352151560f81b60a085015260a1840189905291861b90941660c1830152805160b581840301815260d5830180835281519185019190912061015584018352600080835260f5850181905261011585018190526101359094018490528251958601835283865293850183905290840182905293830152919087516000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691160361447f576143fb848a6020015160018b614ac3565b91508192508160600151905088602001516001600160a01b031689600001516001600160a01b0316857f5c02c2bb2d1d082317eb23916ca27b3e7c294398b60061a2ad54f1c3c018c318856000015186602001518760000151886040015160008f6000015160405161447296959493929190615c4f565b60405180910390a46145de565b60208901516001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116911603614541576144c7848a6000015160008b614ac3565b91508192508160600151905088602001516001600160a01b031689600001516001600160a01b0316857f5c02c2bb2d1d082317eb23916ca27b3e7c294398b60061a2ad54f1c3c018c318856000015186602001518760200151886040015189604001518f6000015160405161447296959493929190615c4f565b61454c848a8a614de5565b6060808201519083015192955090935061456591615a77565b905088602001516001600160a01b031689600001516001600160a01b0316857f5c02c2bb2d1d082317eb23916ca27b3e7c294398b60061a2ad54f1c3c018c31886600001518660200151886020015188604001518a604001518f600001516040516145d596959493929190615c4f565b60405180910390a45b8851875184516145ef929190614147565b6020808a01518882015191840151604051631c20fadd60e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001693631c20fadd93614649939092600401615911565b600060405180830381600087803b15801561466357600080fd5b505af1158015614677573d6000803e3d6000fd5b5050505080610168600082825461468e9190615a77565b909155505060408801516146a35782516135e5565b5060200151979650505050505050565b604080518082019091526000808252602082015260006146d38484614f88565b905083830280821061470857604051806040016040528082846146f691906159e7565b8152602001828152509250505061081b565b6040518060400160405280600161471f8585900390565b61472991906159e7565b815260200191909152949350505050565b6000818061474a5761474a615b80565b838509949350505050565b6040805180820190915260008082526020820152818360200151106147a25760405180604001604052808460000151815260200183856020015161479991906159e7565b9052905061081b565b6040518060400160405280600185600001516147be91906159e7565b81526020016147d1856020015185900390565b90529392505050565b6000806147f26147ec84808403615b96565b60010190565b90508284602001516148049190615b96565b8451820217949350505050565b60006001815b6008811015610da3578382026002038202915080614834816158f8565b915050614817565b60008181526001830160205260408120546148835750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561081b565b50600061081b565b6040516001600160a01b038316602482015260448101829052610bfb90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152614f97565b600054610100900460ff166149155760405162461bcd60e51b815260040161088990615bb8565b61491d615069565b613616615090565b600054610100900460ff1661494c5760405162461bcd60e51b815260040161088990615bb8565b6136166150f5565b600054610100900460ff1661497b5760405162461bcd60e51b815260040161088990615bb8565b613616615123565b600054610100900460ff166149aa5760405162461bcd60e51b815260040161088990615bb8565b61015f80546001600160a01b038086166001600160a01b0319928316179092556101608054858416908316179055610161805492841692909116919091179055614a227fdf8c9529ea4b244b569bac557a549516f317e7b5cf82dc5e0d8b6d874930a3f5600080516020615d19833981519152615157565b614a48600080516020615cd9833981519152600080516020615d19833981519152615157565b614a807f657d38169ed9612cb2d9de7040b7b6a1adebf7a8433a66ccb49c08554ac9b8a5600080516020615d19833981519152615157565b610169805460ff19166001179055610bfb6107d0613700565b801580614aaa5750614aaa84613abd565b613c4957613c496001600160a01b0385168484846151a2565b614aee6040518060800160405280600081526020016000815260200160008152602001600081525090565b600083614b41576040518060400160405280866001600160a01b031681526020017f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316815250614b89565b60405180604001604052807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602001866001600160a01b03168152505b905060008360400151614c4757614b9f866137da565b825160208085015187519188015160608901516040516337cb0ead60e21b8152600481018e90526001600160a01b03958616602482015292851660448401526064830193909352608482015290151560a482015291169063df2c3ab49060c4016060604051808303816000875af1158015614c1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614c429190615c80565b614cf3565b614c50866137da565b8251602080850151875191880151606089015160405163d1aebfc760e01b8152600481018e90526001600160a01b03958616602482015292851660448401526064830193909352608482015290151560a482015291169063d1aebfc79060c4016060604051808303816000875af1158015614ccf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614cf39190615c80565b905084614d8c5761015f54604082015160208301516001600160a01b0390921691637c8f622d918991614d2691906159e7565b6040516001600160e01b031960e085901b1681526001600160a01b039092166004830152602482015260016044820152606401600060405180830381600087803b158015614d7357600080fd5b505af1158015614d87573d6000803e3d6000fd5b505050505b60405180608001604052808560400151614da7578251614daa565b85515b81526020018560400151614dbf578551614dc2565b82515b815260200182602001518152602001826040015181525092505050949350505050565b614e106040518060800160405280600081526020016000815260200160008152602001600081525090565b614e3b6040518060800160405280600081526020016000815260200160008152602001600081525090565b826040015115614ee5576000836000015190506000846020015190506000614e9488886000015160006040518060800160405280888152602001600181526020016001151581526020018b606001511515815250614ac3565b90506000614ed689896020015160016040518060800160405280876020015181526020018881526020016001151581526020018c606001511515815250614ac3565b919550909350614f8092505050565b6000836000015190506000846020015190506000614f358888602001516001604051806080016040528088815260200160001981526020016000151581526020018b606001511515815250614ac3565b90506000614f7789896000015160006040518060800160405280876000015181526020018881526020016000151581526020018c606001511515815250614ac3565b95509093505050505b935093915050565b60006000198284099392505050565b6000614fec826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166151c39092919063ffffffff16565b805190915015610bfb578080602001905181019061500a919061595b565b610bfb5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610889565b600054610100900460ff166136165760405162461bcd60e51b815260040161088990615bb8565b600054610100900460ff166150b75760405162461bcd60e51b815260040161088990615bb8565b60c9805461ffff191660011790556150dd600080516020615d1983398151915280615157565b613616600080516020615d19833981519152336151d2565b600054610100900460ff1661511c5760405162461bcd60e51b815260040161088990615bb8565b600160fb55565b600054610100900460ff1661514a5760405162461bcd60e51b815260040161088990615bb8565b61012d805460ff19169055565b600082815260656020526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b613c49846323b872dd60e01b8585856040516024016148b793929190615911565b60606131a084846000856151dc565b610cf48282612f24565b60608247101561523d5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610889565b6001600160a01b0385163b6152945760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610889565b600080866001600160a01b031685876040516152b09190615cbc565b60006040518083038185875af1925050503d80600081146152ed576040519150601f19603f3d011682016040523d82523d6000602084013e6152f2565b606091505b509150915061530282828661530d565b979650505050505050565b6060831561531c57508161180d565b82511561532c5782518084602001fd5b8160405162461bcd60e51b81526004016108899190615b4d565b60006020828403121561535857600080fd5b81356001600160e01b03198116811461180d57600080fd5b6001600160a01b038116811461084257600080fd5b60006020828403121561539757600080fd5b813561180d81615370565b6000602082840312156153b457600080fd5b5035919050565b801515811461084257600080fd5b6000602082840312156153db57600080fd5b813561180d816153bb565b600080604083850312156153f957600080fd5b82359150602083013561540b81615370565b809150509250929050565b6000806040838503121561542957600080fd5b823561543481615370565b946020939093013593505050565b6020808252825182820181905260009190848201906040850190845b818110156154835783516001600160a01b03168352928401929184019160010161545e565b50909695505050505050565b600080600080600060a086880312156154a757600080fd5b85356154b281615370565b945060208601356154c281615370565b94979496505050506040830135926060810135926080909101359150565b6000806000604084860312156154f557600080fd5b833567ffffffffffffffff8082111561550d57600080fd5b818601915086601f83011261552157600080fd5b81358181111561553057600080fd5b8760208260051b850101111561554557600080fd5b6020928301955093505084013561555b81615370565b809150509250925092565b60008060008060008060c0878903121561557f57600080fd5b863561558a81615370565b9550602087013561559a81615370565b945060408701359350606087013592506080870135915060a08701356155bf81615370565b809150509295509295509295565b63ffffffff8116811461084257600080fd5b6000602082840312156155f157600080fd5b813561180d816155cd565b60008083601f84011261560e57600080fd5b50813567ffffffffffffffff81111561562657600080fd5b60208301915083602082850101111561563e57600080fd5b9250929050565b6000806020838503121561565857600080fd5b823567ffffffffffffffff81111561566f57600080fd5b61567b858286016155fc565b90969095509350505050565b6000806040838503121561569a57600080fd5b50508035926020909101359150565b6000806000806000608086880312156156c157600080fd5b85356156cc81615370565b94506020860135935060408601356156e381615370565b9250606086013567ffffffffffffffff8111156156ff57600080fd5b61570b888289016155fc565b969995985093965092949392505050565b60008060006060848603121561573157600080fd5b833561573c81615370565b9250602084013561574c81615370565b929592945050506040919091013590565b60008060006060848603121561577257600080fd5b833561577d81615370565b9250602084013561578d81615370565b9150604084013561555b81615370565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6000602082840312156157e657600080fd5b5051919050565b6000602082840312156157ff57600080fd5b815161ffff8116811461180d57600080fd5b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b634e487b7160e01b600052604160045260246000fd5b6040516060810167ffffffffffffffff8111828210171561588257634e487b7160e01b600052604160045260246000fd5b60405290565b60006060828403121561589a57600080fd5b6158a2615851565b82516158ad81615370565b8152602083810151908201526040928301519281019290925250919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161590a5761590a6158e2565b5060010190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b600061ffff808316818516808303821115615952576159526158e2565b01949350505050565b60006020828403121561596d57600080fd5b815161180d816153bb565b80516fffffffffffffffffffffffffffffffff8116811461599857600080fd5b919050565b6000606082840312156159af57600080fd5b6159b7615851565b6159c083615978565b81526159ce60208401615978565b6020820152604083015160408201528091505092915050565b6000828210156159f9576159f96158e2565b500390565b600060208284031215615a1057600080fd5b815161180d816155cd565b6001600160a01b03878116825286166020820152604081018590526060810184905260a06080820181905281018290526000828460c0840137600060c0848401015260c0601f19601f8501168301019050979650505050505050565b60008219821115615a8a57615a8a6158e2565b500190565b600060208284031215615aa157600080fd5b815161180d81615370565b60005b83811015615ac7578181015183820152602001615aaf565b83811115613c495750506000910152565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351615b10816017850160208801615aac565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351615b41816028840160208801615aac565b01602801949350505050565b6020815260008251806020840152615b6c816040850160208701615aac565b601f01601f19169190910160400192915050565b634e487b7160e01b600052601260045260246000fd5b600082615bb357634e487b7160e01b600052601260045260246000fd5b500490565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b634e487b7160e01b600052603160045260246000fd5b6000816000190483118215151615615c3357615c336158e2565b500290565b600081615c4757615c476158e2565b506000190190565b95865260208601949094526040850192909252606084015260808301526001600160a01b031660a082015260c00190565b600060608284031215615c9257600080fd5b615c9a615851565b8251815260208301516020820152604083015160408201528091505092915050565b60008251615cce818460208701615aac565b919091019291505056fef28f409b8cbe6b50c7ca45afe893f01f69626f8a4e33cb480bc1bc2d618c084589ce14d20697a788f57260f7690044299bde7ea88cfb7e43d120a0c031f1ffc12172861495e7b85edac73e3cd5fbb42dd675baadf627720e687bcfdaca025096a164736f6c634300080d000a", + "deployedBytecode": "0x60806040526004361061026b5760003560e01c80637bf6a42511610144578063b3db428b116100b6578063d0d145811161007a578063d0d1458114610755578063d3a4acd314610768578063d547741f1461077b578063d6efd7c31461079b578063d895feee146107b0578063e6aac07e146107c357600080fd5b8063b3db428b146106af578063c0c53b8b146106c2578063c109ba13146106e2578063c844748714610702578063ca15c8731461073557600080fd5b806391d148541161010857806391d14854146105df57806393867fb5146105ff5780639bca0e7014610620578063a217fddf1461065a578063a8bf90461461066f578063adf51de11461068f57600080fd5b80637bf6a4251461053c5780638456cb59146105525780638cd2403d146105675780638ffcca07146105875780639010d07c146105a757600080fd5b80633cd11924116101dd57806345d6602c116101a157806345d6602c146104a857806347e7ef24146104bb57806353300772146104ce57806354fd4d50146104ee5780635c975abb1461050a57806371f43f9a1461052357600080fd5b80633cd11924146104145780633d1c24e7146104345780633efcfda41461044757806341f435b314610467578063426599641461048857600080fd5b806326e6b6971161022f57806326e6b697146103525780632e1a7d4d146103725780632f2ff15d14610392578063357a0333146103b257806336568abe146103d257806339fadf98146103f257600080fd5b806301ffc9a714610277578063046f7da2146102ac5780631329db29146102c3578063230df83a146102f4578063248a9ca31461031457600080fd5b3661027257005b600080fd5b34801561028357600080fd5b50610297610292366004615346565b6107f6565b60405190151581526020015b60405180910390f35b3480156102b857600080fd5b506102c1610821565b005b3480156102cf57600080fd5b5061016954610100900463ffffffff1660405163ffffffff90911681526020016102a3565b34801561030057600080fd5b506102c161030f366004615385565b610845565b34801561032057600080fd5b5061034461032f3660046153a2565b60009081526065602052604090206001015490565b6040519081526020016102a3565b34801561035e57600080fd5b506102c161036d3660046153c9565b6109f3565b34801561037e57600080fd5b5061034461038d3660046153a2565b610a30565b34801561039e57600080fd5b506102c16103ad3660046153e6565b610bd5565b3480156103be57600080fd5b506103446103cd366004615416565b610c00565b3480156103de57600080fd5b506102c16103ed3660046153e6565b610c7a565b3480156103fe57600080fd5b50610407610cf8565b6040516102a39190615442565b34801561042057600080fd5b5061034461042f366004615385565b610daa565b6102c161044236600461548f565b610f40565b34801561045357600080fd5b506103446104623660046153a2565b6110e2565b34801561047357600080fd5b50600080516020615cd9833981519152610344565b34801561049457600080fd5b506102c16104a33660046154e0565b6111b6565b6103446104b6366004615566565b611283565b6103446104c9366004615416565b6112f5565b3480156104da57600080fd5b506102c16104e93660046155df565b61136a565b3480156104fa57600080fd5b50604051600981526020016102a3565b34801561051657600080fd5b5061012d5460ff16610297565b34801561052f57600080fd5b506101695460ff16610297565b34801561054857600080fd5b5061016854610344565b34801561055e57600080fd5b506102c1611395565b34801561057357600080fd5b506102c1610582366004615645565b6113b6565b34801561059357600080fd5b506103446105a2366004615385565b611407565b3480156105b357600080fd5b506105c76105c2366004615687565b6117f5565b6040516001600160a01b0390911681526020016102a3565b3480156105eb57600080fd5b506102976105fa3660046153e6565b611814565b34801561060b57600080fd5b50600080516020615d19833981519152610344565b34801561062c57600080fd5b506105c761063b366004615385565b6001600160a01b03908116600090815261016760205260409020541690565b34801561066657600080fd5b50610344600081565b34801561067b57600080fd5b506102c161068a366004615385565b61183f565b34801561069b57600080fd5b506102c16106aa3660046156a9565b611a56565b6103446106bd36600461571c565b611fda565b3480156106ce57600080fd5b506102c16106dd36600461575d565b612059565b3480156106ee57600080fd5b506102c16106fd3660046154e0565b612141565b34801561070e57600080fd5b507f657d38169ed9612cb2d9de7040b7b6a1adebf7a8433a66ccb49c08554ac9b8a5610344565b34801561074157600080fd5b506103446107503660046153a2565b6122eb565b610344610763366004615566565b612302565b610344610776366004615566565b612373565b34801561078757600080fd5b506102c16107963660046153e6565b6123d5565b3480156107a757600080fd5b506104076123fb565b6103446107be366004615566565b6124a6565b3480156107cf57600080fd5b507fdf8c9529ea4b244b569bac557a549516f317e7b5cf82dc5e0d8b6d874930a3f5610344565b60006001600160e01b03198216635a05180f60e01b148061081b575061081b8261250b565b92915050565b600080516020615cd983398151915261083a8133612540565b610842612567565b50565b8061084f816125fc565b610867600080516020615d1983398151915233612540565b600260fb54036108925760405162461bcd60e51b81526004016108899061579d565b60405180910390fd5b600260fb81905550816001600160a01b031663f525cb686040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108fc91906157d4565b1561091a576040516332e7879360e01b815260040160405180910390fd5b61092661016283612623565b6109435760405163b0ce759160e01b815260040160405180910390fd5b61094e826000612638565b816001600160a01b0316826001600160a01b031663b1dd61b66040518163ffffffff1660e01b8152600401602060405180830381865afa158015610996573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ba91906157ed565b61ffff167fa0c1e3924f995e5ba38f53b4effb6d4b3eeb84176a2951c589115140f638ac0960405160405180910390a35050600160fb55565b610a0b600080516020615d1983398151915233612540565b6101695460ff1615158115151461084257610169805482151560ff1990911617905550565b6000610a3f61012d5460ff1690565b15610a5c5760405162461bcd60e51b815260040161088990615811565b600260fb5403610a7e5760405162461bcd60e51b81526004016108899061579d565b600260fb55336000610ae184836000814260405160609290921b6001600160601b031916602083015260e01b6001600160e01b03191660348201526038810184905260580160405160208183030381529060405280519060200120905092915050565b6101605460405163158591ab60e11b8152600481018390526001600160a01b0385811660248301526044820188905292935060009290911690632b0b2356906064016060604051808303816000875af1158015610b42573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b669190615888565b90507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031681600001516001600160a01b031603610bba57610bb0828483612b6f565b9350505050610bcb565b610bc5828483612d29565b93505050505b600160fb55919050565b600082815260656020526040902060010154610bf18133612ec0565b610bfb8383612f24565b505050565b600082610c0c816125fc565b82610c1681612f46565b61012d5460ff1615610c3a5760405162461bcd60e51b815260040161088990615811565b600260fb5403610c5c5760405162461bcd60e51b81526004016108899061579d565b600260fb55610c6c338686612f67565b600160fb5595945050505050565b6001600160a01b0381163314610cea5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610889565b610cf482826131a8565b5050565b60606000610d076101626131ca565b905060008167ffffffffffffffff811115610d2457610d2461583b565b604051908082528060200260200182016040528015610d4d578160200160208202803683370190505b50905060005b82811015610da357610d67610162826131d4565b828281518110610d7957610d796158cc565b6001600160a01b039092166020928302919091019091015280610d9b816158f8565b915050610d53565b5092915050565b6000610db961012d5460ff1690565b15610dd65760405162461bcd60e51b815260040161088990615811565b7f657d38169ed9612cb2d9de7040b7b6a1adebf7a8433a66ccb49c08554ac9b8a5610e018133612540565b82610e0b816125fc565b600260fb5403610e2d5760405162461bcd60e51b81526004016108899061579d565b600260fb55610168546000819003610e49576000935050610f34565b600061016855604051631c20fadd60e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690631c20fadd90610ebf907f00000000000000000000000000000000000000000000000000000000000000009089908690600401615911565b600060405180830381600087803b158015610ed957600080fd5b505af1158015610eed573d6000803e3d6000fd5b50506040518381526001600160a01b03881692503391507f328c9cc28e75030423307e732b07659ae452a620281f3e54e838000a7f4675389060200160405180910390a392505b5050600160fb55919050565b61012d5460ff1615610f645760405162461bcd60e51b815260040161088990615811565b7fdf8c9529ea4b244b569bac557a549516f317e7b5cf82dc5e0d8b6d874930a3f5610f8f8133612540565b600260fb5403610fb15760405162461bcd60e51b81526004016108899061579d565b600260fb55604080516001600160601b031933606090811b82166020808501919091526001600160e01b03194260e01b1660348501528a821b8316603885015289821b909216604c84015282018790526080820186905260a08083018690528351808403909101815260c090920190925280519101206001600160a01b038088167f000000000000000000000000000000000000000000000000000000000000000091909116036110715761106b818787336001886131e0565b50611081565b61107f818789883389613327565b505b60408051868152602081018690529081018490526001600160a01b03808816919089169083907f102bce4e43a6a8cf0306fde6154221c1f5460f64ba63b92b156bce998ef0db569060600160405180910390a45050600160fb555050505050565b60006110f161012d5460ff1690565b1561110e5760405162461bcd60e51b815260040161088990615811565b600260fb54036111305760405162461bcd60e51b81526004016108899061579d565b600260fb5561016054604051635f23b6c560e11b8152336004820152602481018490526001600160a01b039091169063be476d8a906044016020604051808303816000875af1158015611187573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111ab91906157d4565b600160fb5592915050565b806111c0816125fc565b6111d8600080516020615d1983398151915233612540565b600260fb54036111fa5760405162461bcd60e51b81526004016108899061579d565b600260fb5561120b61016283613387565b6112285760405163b0ce759160e01b815260040160405180910390fd5b8260005b8181101561127657611264868683818110611249576112496158cc565b905060200201602081019061125e9190615385565b856133a9565b8061126e816158f8565b91505061122c565b5050600160fb5550505050565b600061129261012d5460ff1690565b156112af5760405162461bcd60e51b815260040161088990615811565b600260fb54036112d15760405162461bcd60e51b81526004016108899061579d565b600260fb556112e58787878787873361351a565b600160fb55979650505050505050565b60006112ff6135f2565b82611309816125fc565b8261131381612f46565b61012d5460ff16156113375760405162461bcd60e51b815260040161088990615811565b600260fb54036113595760405162461bcd60e51b81526004016108899061579d565b600260fb55610c6c33868682613618565b611382600080516020615d1983398151915233612540565b8061138c816136d6565b610cf482613700565b600080516020615cd98339815191526113ae8133612540565b610842613780565b60c9546000906113cb9061ffff166001615935565b905061ffff81166009146113f15760405162dc149f60e41b815260040160405180910390fd5b60c9805461ffff191661ffff8316179055505050565b600061141661012d5460ff1690565b156114335760405162461bcd60e51b815260040161088990615811565b600260fb54036114555760405162461bcd60e51b81526004016108899061579d565b600260fb5560405163ce53e72960e01b81526001600160a01b0383811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063ce53e72990602401602060405180830381865afa1580156114c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114e4919061595b565b611501576040516307d7f4eb60e21b815260040160405180910390fd5b600061150c836137da565b905060006115436001600160a01b0385167f0000000000000000000000000000000000000000000000000000000000000000613816565b60405163a135ef1760e01b81526001600160a01b03868116600483015291925060009184169063a135ef1790602401606060405180830381865afa15801561158f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115b3919061599d565b60408101519091508281106115db576040516341e43e3960e01b815260040160405180910390fd5b6040516387a7db0f60e01b81526001600160a01b0387811660048301528516906387a7db0f90602401600060405180830381600087803b15801561161e57600080fd5b505af1158015611632573d6000803e3d6000fd5b505050506000818461164491906159e7565b61016954909150600090611668908390610100900463ffffffff16620f42406138a4565b90506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016631c20fadd897f00000000000000000000000000000000000000000000000000000000000000006116c585876159e7565b6040518463ffffffff1660e01b81526004016116e393929190615911565b600060405180830381600087803b1580156116fd57600080fd5b505af1158015611711573d6000803e3d6000fd5b5050604051631c20fadd60e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169250631c20fadd9150611765908b9033908690600401615911565b600060405180830381600087803b15801561177f57600080fd5b505af1158015611793573d6000803e3d6000fd5b5050506001600160a01b0389169050337f5ad7a2184454b6259cd118e4041a953dc9d6498302bbe528e4f967bed91971296117ce84866159e7565b60408051918252602082018690520160405180910390a350600160fb559695505050505050565b600082815260976020526040812061180d90836131d4565b9392505050565b60009182526065602090815260408084206001600160a01b0393909316845291905290205460ff1690565b80611849816125fc565b611861600080516020615d1983398151915233612540565b600260fb54036118835760405162461bcd60e51b81526004016108899061579d565b600260fb819055506000826001600160a01b031663b1dd61b66040518163ffffffff1660e01b8152600401602060405180830381865afa1580156118cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118ef91906157ed565b90506000836001600160a01b03166354fd4d506040518163ffffffff1660e01b8152600401602060405180830381865afa158015611931573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061195591906157ed565b905060006119638383613970565b90506001600160a01b038116151580611985575061198361016286613aa8565b155b156119a35760405163119b4fd360e11b815260040160405180910390fd5b6119ae856001612638565b846001600160a01b0316856001600160a01b031663b1dd61b66040518163ffffffff1660e01b8152600401602060405180830381865afa1580156119f6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a1a91906157ed565b61ffff167f5ae87719d73cb0fabb219f0e4b6e0a614ed7506f8a08bdb20bebf313573151b760405160405180910390a35050600160fb55505050565b84611a60816125fc565b84611a6a81612f46565b84611a74816125fc565b61012d5460ff1615611a985760405162461bcd60e51b815260040161088990615811565b600260fb5403611aba5760405162461bcd60e51b81526004016108899061579d565b600260fb557f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811690891614158015611b83575060405163b5af090f60e01b81526001600160a01b0389811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063b5af090f90602401602060405180830381865afa158015611b5d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b81919061595b565b155b15611ba157604051630b094f2760e31b815260040160405180910390fd5b60006001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163303611bdb57506000611c7d565b604051637c36afad60e01b81526001600160a01b038a81166004830152611c7a918a917f00000000000000000000000000000000000000000000000000000000000000001690637c36afad90602401602060405180830381865afa158015611c47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c6b91906159fe565b63ffffffff16620f42406138a4565b90505b6000611c926001600160a01b038b1630613816565b604051631c20fadd60e01b81529091506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690631c20fadd90611ce5908d908c908e90600401615911565b600060405180830381600087803b158015611cff57600080fd5b505af1158015611d13573d6000803e3d6000fd5b50505050876001600160a01b03166323e30c8b33611d378d6001600160a01b031690565b8c868c8c6040518763ffffffff1660e01b8152600401611d5c96959493929190615a1b565b600060405180830381600087803b158015611d7657600080fd5b505af1158015611d8a573d6000803e3d6000fd5b50505050600081611dad308d6001600160a01b031661381690919063ffffffff16565b611db791906159e7565b9050611dc3838b615a77565b811015611de35760405163b7ed78bf60e01b815260040160405180910390fd5b611df58b6001600160a01b0316613abd565b15611e3257611e2d6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001682613adf565b611e66565b611e666001600160a01b038c167f000000000000000000000000000000000000000000000000000000000000000083613bf8565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116908c1603611f0f5761015f54604051637c8f622d60e01b81526001600160a01b038d811660048301526024820186905260006044830152909116908190637c8f622d90606401600060405180830381600087803b158015611ef157600080fd5b505af1158015611f05573d6000803e3d6000fd5b5050505050611f82565b6000611f1a8c6137da565b604051631510748b60e01b81526001600160a01b038e811660048301526024820187905291925090821690631510748b90604401600060405180830381600087803b158015611f6857600080fd5b505af1158015611f7c573d6000803e3d6000fd5b50505050505b604080518b81526020810185905233916001600160a01b038e16917f0da3485ef1bb570df7bb888887eae5aa01d81b83cd8ccc80c0ea0922a677ecef910160405180910390a35050600160fb55505050505050505050565b6000611fe46135f2565b83611fee816125fc565b83611ff8816125fc565b8361200281612f46565b61012d5460ff16156120265760405162461bcd60e51b815260040161088990615811565b600260fb54036120485760405162461bcd60e51b81526004016108899061579d565b600260fb556112e587878733613618565b82612063816125fc565b8261206d816125fc565b82612077816125fc565b600054610100900460ff166120925760005460ff1615612096565b303b155b6120f95760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610889565b600054610100900460ff1615801561211b576000805461ffff19166101011790555b612126878787613c63565b8015612138576000805461ff00191690555b50505050505050565b600260fb54036121635760405162461bcd60e51b81526004016108899061579d565b600260fb5561217461016282613387565b6121915760405163b0ce759160e01b815260040160405180910390fd5b8160005b818110156122df5760008585838181106121b1576121b16158cc565b90506020020160208101906121c69190615385565b6101615460405163772b7e9760e01b81526001600160a01b038084166004830152878116602483015292935091169063772b7e9790604401600060405180830381600087803b15801561221857600080fd5b505af115801561222c573d6000803e3d6000fd5b5050506001600160a01b038083166000818152610167602052604080822080548a86166001600160a01b031982161790915590519316935083927f987eb3c2f78454541205f72f34839b434c306c9eaf4922efd7c0c3060fdb2e4c9190a3846001600160a01b0316826001600160a01b03167f95f865c2808f8b2a85eea2611db7843150ee7835ef1403f9755918a97d76933c60405160405180910390a3505080806122d7906158f8565b915050612195565b5050600160fb55505050565b600081815260976020526040812061081b906131ca565b600061231161012d5460ff1690565b1561232e5760405162461bcd60e51b815260040161088990615811565b7f000000000000000000000000000000000000000000000000000000000000000061235881613cad565b6123678888888888883361351a565b98975050505050505050565b600061238261012d5460ff1690565b1561239f5760405162461bcd60e51b815260040161088990615811565b600260fb54036123c15760405162461bcd60e51b81526004016108899061579d565b600260fb556112e587878787878733613cd6565b6000828152606560205260409020600101546123f18133612ec0565b610bfb83836131a8565b6060600061240a6101656131ca565b905060008167ffffffffffffffff8111156124275761242761583b565b604051908082528060200260200182016040528015612450578160200160208202803683370190505b50905060005b82811015610da35761246a610165826131d4565b82828151811061247c5761247c6158cc565b6001600160a01b03909216602092830291909101909101528061249e816158f8565b915050612456565b60006124b561012d5460ff1690565b156124d25760405162461bcd60e51b815260040161088990615811565b7f00000000000000000000000000000000000000000000000000000000000000006124fc81613cad565b61236788888888888833613cd6565b60006001600160e01b03198216637965db0b60e01b148061081b57506301ffc9a760e01b6001600160e01b031983161461081b565b61254a8282611814565b610cf457604051634ca8886760e01b815260040160405180910390fd5b61012d5460ff166125b15760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610889565b61012d805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6001600160a01b0381166108425760405163e6c4247b60e01b815260040160405180910390fd5b600061180d836001600160a01b038416613da1565b8181156128ec5761015f54604051632f2ff15d60e01b81527f4cbb5676e6e25e1a3b8a36de10472bcac96f97bd8dd87af6f330881b84739eb860048201526001600160a01b03838116602483015290911690632f2ff15d90604401600060405180830381600087803b1580156126ad57600080fd5b505af11580156126c1573d6000803e3d6000fd5b505061015f54604051632f2ff15d60e01b81527f0d0d17bf5382c809d9a3899d6a94e57386dfb2036f0401b94ef3cf6c1a9ab73f60048201526001600160a01b0385811660248301529091169250632f2ff15d9150604401600060405180830381600087803b15801561273357600080fd5b505af1158015612747573d6000803e3d6000fd5b505061015f54604051632f2ff15d60e01b81527fca51b9188e78415f30da725e0d94567b4d65bc6777d4e5d573191e9f55b88a3260048201526001600160a01b0385811660248301529091169250632f2ff15d9150604401600060405180830381600087803b1580156127b957600080fd5b505af11580156127cd573d6000803e3d6000fd5b5050604051632f2ff15d60e01b8152600080516020615cf983398151915260048201526001600160a01b0384811660248301527f0000000000000000000000000000000000000000000000000000000000000000169250632f2ff15d9150604401600060405180830381600087803b15801561284857600080fd5b505af115801561285c573d6000803e3d6000fd5b5050604051632f2ff15d60e01b8152600080516020615cf983398151915260048201526001600160a01b0384811660248301527f0000000000000000000000000000000000000000000000000000000000000000169250632f2ff15d91506044015b600060405180830381600087803b1580156128d857600080fd5b505af1158015612138573d6000803e3d6000fd5b61015f5460405163d547741f60e01b81527f4cbb5676e6e25e1a3b8a36de10472bcac96f97bd8dd87af6f330881b84739eb860048201526001600160a01b0383811660248301529091169063d547741f90604401600060405180830381600087803b15801561295a57600080fd5b505af115801561296e573d6000803e3d6000fd5b505061015f5460405163d547741f60e01b81527f0d0d17bf5382c809d9a3899d6a94e57386dfb2036f0401b94ef3cf6c1a9ab73f60048201526001600160a01b038581166024830152909116925063d547741f9150604401600060405180830381600087803b1580156129e057600080fd5b505af11580156129f4573d6000803e3d6000fd5b505061015f5460405163d547741f60e01b81527fca51b9188e78415f30da725e0d94567b4d65bc6777d4e5d573191e9f55b88a3260048201526001600160a01b038581166024830152909116925063d547741f9150604401600060405180830381600087803b158015612a6657600080fd5b505af1158015612a7a573d6000803e3d6000fd5b505060405163d547741f60e01b8152600080516020615cf983398151915260048201526001600160a01b0384811660248301527f000000000000000000000000000000000000000000000000000000000000000016925063d547741f9150604401600060405180830381600087803b158015612af557600080fd5b505af1158015612b09573d6000803e3d6000fd5b505060405163d547741f60e01b8152600080516020615cf983398151915260048201526001600160a01b0384811660248301527f000000000000000000000000000000000000000000000000000000000000000016925063d547741f91506044016128be565b61015f5481516101605460208401516040516323b872dd60e01b81526000946001600160a01b03908116948116936323b872dd93612bb69391909216918691600401615911565b6020604051808303816000875af1158015612bd5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bf9919061595b565b5060208301516040516323b872dd60e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016916323b872dd91612c4e918891869190600401615911565b6020604051808303816000875af1158015612c6d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c91919061595b565b50602083015160408085015190516372026c6760e11b8152600481018890526001600160a01b038781166024830152604482019390935260648101919091529082169063e404d8ce906084016020604051808303816000875af1158015612cfc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d2091906157d4565b95945050505050565b60008082600001516001600160a01b031663f4325d676040518163ffffffff1660e01b8152600401602060405180830381865afa158015612d6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d929190615a8f565b90506000612d9f826137da565b84516101605460208701516040516323b872dd60e01b81529394506001600160a01b03928316936323b872dd93612ddc9316918691600401615911565b6020604051808303816000875af1158015612dfb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e1f919061595b565b50602084015160408086015190516356aca36f60e01b8152600481018990526001600160a01b038881166024830152858116604483015260648201939093526084810191909152908216906356aca36f9060a4016020604051808303816000875af1158015612e92573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612eb691906157d4565b9695505050505050565b612eca8282611814565b610cf457612ee2816001600160a01b03166014613e94565b612eed836020613e94565b604051602001612efe929190615ad8565b60408051601f198184030181529082905262461bcd60e51b825261088991600401615b4d565b612f2e8282614030565b6000828152609760205260409020610bfb9082613aa8565b8060000361084257604051637c946ed760e01b815260040160405180910390fd5b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b0316146130af576000836001600160a01b031663f4325d676040518163ffffffff1660e01b8152600401602060405180830381865afa158015612fe2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130069190615a8f565b9050836001600160a01b031661301b826137da565b604051635768adcf60e01b81526001600160a01b0384811660048301529190911690635768adcf90602401602060405180830381865afa158015613063573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130879190615a8f565b6001600160a01b0316146130ad5760405162820f3560e61b815260040160405180910390fd5b505b610160546040516323b872dd60e01b81526001600160a01b03808616926323b872dd926130e492899216908790600401615911565b6020604051808303816000875af1158015613103573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613127919061595b565b50610160546040516313e7e7d160e11b81526001600160a01b03909116906327cfcfa29061315d90879087908790600401615911565b6020604051808303816000875af115801561317c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131a091906157d4565b949350505050565b6131b282826140b6565b6000828152609760205260409020610bfb9082612623565b600061081b825490565b600061180d838361411d565b60003415613201576040516342f7487960e11b815260040160405180910390fd5b61015f546040516323b872dd60e01b81526001600160a01b03918216917f000000000000000000000000000000000000000000000000000000000000000016906323b872dd9061325990889085908b90600401615911565b6020604051808303816000875af1158015613278573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061329c919061595b565b5060405163e06bf20d60e01b8152600481018990526001600160a01b0388811660248301526044820188905285151560648301526084820185905282169063e06bf20d9060a4015b6020604051808303816000875af1158015613303573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061236791906157d4565b6000613334858484614147565b600061333f866137da565b604051639f5c734b60e01b8152600481018a90526001600160a01b03898116602483015288811660448301526064820188905291925090821690639f5c734b906084016132e4565b6001600160a01b0381166000908152600183016020526040812054151561180d565b6133b2826125fc565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116908316036133fe5760405163c1ab6dc160e01b815260040160405180910390fd5b61340a61016583613aa8565b6134275760405163119b4fd360e11b815260040160405180910390fd5b604051634824fce960e11b81526001600160a01b038381166004830152821690639049f9d290602401600060405180830381600087803b15801561346a57600080fd5b505af115801561347e573d6000803e3d6000fd5b505050506001600160a01b038281166000818152610167602052604080822080546001600160a01b0319169486169485179055517f4f2ce4e40f623ca765fc0167a25cb7842ceaafb8d82d3dec26ca0d0e0d2d48969190a3806001600160a01b0316826001600160a01b03167f95f865c2808f8b2a85eea2611db7843150ee7835ef1403f9755918a97d76933c60405160405180910390a35050565b6000613529888888888861422b565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b031603613568575060015b6135e560405180604001604052808b6001600160a01b031681526020018a6001600160a01b031681525060405180608001604052808a81526020018981526020016000151581526020018415158152506040518060400160405280876001600160a01b03168152602001886001600160a01b0316815250886142af565b9998505050505050505050565b6101695460ff16613616576040516303a5be3f60e31b815260040160405180910390fd5b565b604080516001600160601b0319606084811b82166020808501919091526001600160e01b03194260e01b16603485015288821b8316603885015287821b909216604c84015280830186905283518084039091018152608090920190925280519101206000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03908116908616036136c8576136c0818786866000806131e0565b9150506131a0565b612eb6818787878789613327565b620f424063ffffffff82161115610842576040516358d620b360e01b815260040160405180910390fd5b6101695463ffffffff6101009091048116908216810361371e575050565b610169805464ffffffff00191661010063ffffffff8581169182029290921790925560408051918416825260208201929092527fa159b13d7eac36d9a65034b4fd6ace1d9cb070d063dc950c564a266f4d091802910160405180910390a15050565b61012d5460ff16156137a45760405162461bcd60e51b815260040161088990615811565b61012d805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586125df3390565b6001600160a01b03808216600090815261016760205260408120549091168061081b5760405163c1ab6dc160e01b815260040160405180910390fd5b600061382183613abd565b1561383757506001600160a01b0381163161081b565b826040516370a0823160e01b81526001600160a01b03848116600483015291909116906370a0823190602401602060405180830381865afa158015613880573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061180d91906157d4565b6000806138b185856146b3565b80519091506000036138d5578281602001516138cd9190615b96565b91505061180d565b805183116138f657604051631a93c68960e11b815260040160405180910390fd5b600061390386868661473a565b905060006139118383614755565b80519091506000036139375784816020015161392d9190615b96565b935050505061180d565b600085810386169061394983836147da565b9050600061395f61395a848a615b96565b614811565b919091029998505050505050505050565b60008061397e6101626131ca565b905060005b81811015613a9d576000613999610162836131d4565b90508561ffff16816001600160a01b031663b1dd61b66040518163ffffffff1660e01b8152600401602060405180830381865afa1580156139de573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a0291906157ed565b61ffff16148015613a7b57508461ffff16816001600160a01b03166354fd4d506040518163ffffffff1660e01b8152600401602060405180830381865afa158015613a51573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a7591906157ed565b61ffff16145b15613a8a57925061081b915050565b5080613a95816158f8565b915050613983565b506000949350505050565b600061180d836001600160a01b03841661483c565b6001600160a01b031673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1490565b80471015613b2f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610889565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114613b7c576040519150601f19603f3d011682016040523d82523d6000602084013e613b81565b606091505b5050905080610bfb5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610889565b80600003613c0557505050565b613c0e83613abd565b15613c4f576040516001600160a01b0383169082156108fc029083906000818181858888f19350505050158015613c49573d6000803e3d6000fd5b50505050565b610bfb6001600160a01b038416838361488b565b600054610100900460ff16613c8a5760405162461bcd60e51b815260040161088990615bb8565b613c926148ee565b613c9a614925565b613ca2614954565b610bfb838383614983565b336001600160a01b0382161461084257604051634ca8886760e01b815260040160405180910390fd5b6000613ce5888888888861422b565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b031603613d24575060015b6135e560405180604001604052808b6001600160a01b031681526020018a6001600160a01b031681525060405180608001604052808a81526020018981526020016001151581526020018415158152506040518060400160405280876001600160a01b03168152602001886001600160a01b0316815250886142af565b60008181526001830160205260408120548015613e8a576000613dc56001836159e7565b8554909150600090613dd9906001906159e7565b9050818114613e3e576000866000018281548110613df957613df96158cc565b9060005260206000200154905080876000018481548110613e1c57613e1c6158cc565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080613e4f57613e4f615c03565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061081b565b600091505061081b565b60606000613ea3836002615c19565b613eae906002615a77565b67ffffffffffffffff811115613ec657613ec661583b565b6040519080825280601f01601f191660200182016040528015613ef0576020820181803683370190505b509050600360fc1b81600081518110613f0b57613f0b6158cc565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110613f3a57613f3a6158cc565b60200101906001600160f81b031916908160001a9053506000613f5e846002615c19565b613f69906001615a77565b90505b6001811115613fe1576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110613f9d57613f9d6158cc565b1a60f81b828281518110613fb357613fb36158cc565b60200101906001600160f81b031916908160001a90535060049490941c93613fda81615c38565b9050613f6c565b50831561180d5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610889565b61403a8282611814565b610cf45760008281526065602090815260408083206001600160a01b03851684529091529020805460ff191660011790556140723390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6140c08282611814565b15610cf45760008281526065602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000826000018281548110614134576141346158cc565b9060005260206000200154905092915050565b614159836001600160a01b0316613abd565b156141d7578034101561417f576040516342f7487960e11b815260040160405180910390fd5b6141b26001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001682613adf565b80341115610bfb57610bfb6141c782346159e7565b6001600160a01b03841690613adf565b34156141f6576040516342f7487960e11b815260040160405180910390fd5b610bfb6001600160a01b038416837f000000000000000000000000000000000000000000000000000000000000000084614a99565b614234856125fc565b61423d846125fc565b836001600160a01b0316856001600160a01b03160361426f5760405163c1ab6dc160e01b815260040160405180910390fd5b61427883612f46565b61428182612f46565b4263ffffffff168110156142a857604051631ab7da6b60e01b815260040160405180910390fd5b5050505050565b60208201516000906001600160a01b03166142d55782516001600160a01b031660208401525b825185516020808801518751888301516040808b0151858b015182516001600160601b031960609a8b1b8116828a01526001600160e01b03194260e01b166034830152988a1b8916603882015295891b8816604c87015288860194909452608080860193909352151560f81b60a085015260a1840189905291861b90941660c1830152805160b581840301815260d5830180835281519185019190912061015584018352600080835260f5850181905261011585018190526101359094018490528251958601835283865293850183905290840182905293830152919087516000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691160361447f576143fb848a6020015160018b614ac3565b91508192508160600151905088602001516001600160a01b031689600001516001600160a01b0316857f5c02c2bb2d1d082317eb23916ca27b3e7c294398b60061a2ad54f1c3c018c318856000015186602001518760000151886040015160008f6000015160405161447296959493929190615c4f565b60405180910390a46145de565b60208901516001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116911603614541576144c7848a6000015160008b614ac3565b91508192508160600151905088602001516001600160a01b031689600001516001600160a01b0316857f5c02c2bb2d1d082317eb23916ca27b3e7c294398b60061a2ad54f1c3c018c318856000015186602001518760200151886040015189604001518f6000015160405161447296959493929190615c4f565b61454c848a8a614de5565b6060808201519083015192955090935061456591615a77565b905088602001516001600160a01b031689600001516001600160a01b0316857f5c02c2bb2d1d082317eb23916ca27b3e7c294398b60061a2ad54f1c3c018c31886600001518660200151886020015188604001518a604001518f600001516040516145d596959493929190615c4f565b60405180910390a45b8851875184516145ef929190614147565b6020808a01518882015191840151604051631c20fadd60e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001693631c20fadd93614649939092600401615911565b600060405180830381600087803b15801561466357600080fd5b505af1158015614677573d6000803e3d6000fd5b5050505080610168600082825461468e9190615a77565b909155505060408801516146a35782516135e5565b5060200151979650505050505050565b604080518082019091526000808252602082015260006146d38484614f88565b905083830280821061470857604051806040016040528082846146f691906159e7565b8152602001828152509250505061081b565b6040518060400160405280600161471f8585900390565b61472991906159e7565b815260200191909152949350505050565b6000818061474a5761474a615b80565b838509949350505050565b6040805180820190915260008082526020820152818360200151106147a25760405180604001604052808460000151815260200183856020015161479991906159e7565b9052905061081b565b6040518060400160405280600185600001516147be91906159e7565b81526020016147d1856020015185900390565b90529392505050565b6000806147f26147ec84808403615b96565b60010190565b90508284602001516148049190615b96565b8451820217949350505050565b60006001815b6008811015610da3578382026002038202915080614834816158f8565b915050614817565b60008181526001830160205260408120546148835750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561081b565b50600061081b565b6040516001600160a01b038316602482015260448101829052610bfb90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152614f97565b600054610100900460ff166149155760405162461bcd60e51b815260040161088990615bb8565b61491d615069565b613616615090565b600054610100900460ff1661494c5760405162461bcd60e51b815260040161088990615bb8565b6136166150f5565b600054610100900460ff1661497b5760405162461bcd60e51b815260040161088990615bb8565b613616615123565b600054610100900460ff166149aa5760405162461bcd60e51b815260040161088990615bb8565b61015f80546001600160a01b038086166001600160a01b0319928316179092556101608054858416908316179055610161805492841692909116919091179055614a227fdf8c9529ea4b244b569bac557a549516f317e7b5cf82dc5e0d8b6d874930a3f5600080516020615d19833981519152615157565b614a48600080516020615cd9833981519152600080516020615d19833981519152615157565b614a807f657d38169ed9612cb2d9de7040b7b6a1adebf7a8433a66ccb49c08554ac9b8a5600080516020615d19833981519152615157565b610169805460ff19166001179055610bfb6107d0613700565b801580614aaa5750614aaa84613abd565b613c4957613c496001600160a01b0385168484846151a2565b614aee6040518060800160405280600081526020016000815260200160008152602001600081525090565b600083614b41576040518060400160405280866001600160a01b031681526020017f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316815250614b89565b60405180604001604052807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602001866001600160a01b03168152505b905060008360400151614c4757614b9f866137da565b825160208085015187519188015160608901516040516337cb0ead60e21b8152600481018e90526001600160a01b03958616602482015292851660448401526064830193909352608482015290151560a482015291169063df2c3ab49060c4016060604051808303816000875af1158015614c1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614c429190615c80565b614cf3565b614c50866137da565b8251602080850151875191880151606089015160405163d1aebfc760e01b8152600481018e90526001600160a01b03958616602482015292851660448401526064830193909352608482015290151560a482015291169063d1aebfc79060c4016060604051808303816000875af1158015614ccf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614cf39190615c80565b905084614d8c5761015f54604082015160208301516001600160a01b0390921691637c8f622d918991614d2691906159e7565b6040516001600160e01b031960e085901b1681526001600160a01b039092166004830152602482015260016044820152606401600060405180830381600087803b158015614d7357600080fd5b505af1158015614d87573d6000803e3d6000fd5b505050505b60405180608001604052808560400151614da7578251614daa565b85515b81526020018560400151614dbf578551614dc2565b82515b815260200182602001518152602001826040015181525092505050949350505050565b614e106040518060800160405280600081526020016000815260200160008152602001600081525090565b614e3b6040518060800160405280600081526020016000815260200160008152602001600081525090565b826040015115614ee5576000836000015190506000846020015190506000614e9488886000015160006040518060800160405280888152602001600181526020016001151581526020018b606001511515815250614ac3565b90506000614ed689896020015160016040518060800160405280876020015181526020018881526020016001151581526020018c606001511515815250614ac3565b919550909350614f8092505050565b6000836000015190506000846020015190506000614f358888602001516001604051806080016040528088815260200160001981526020016000151581526020018b606001511515815250614ac3565b90506000614f7789896000015160006040518060800160405280876000015181526020018881526020016000151581526020018c606001511515815250614ac3565b95509093505050505b935093915050565b60006000198284099392505050565b6000614fec826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166151c39092919063ffffffff16565b805190915015610bfb578080602001905181019061500a919061595b565b610bfb5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610889565b600054610100900460ff166136165760405162461bcd60e51b815260040161088990615bb8565b600054610100900460ff166150b75760405162461bcd60e51b815260040161088990615bb8565b60c9805461ffff191660011790556150dd600080516020615d1983398151915280615157565b613616600080516020615d19833981519152336151d2565b600054610100900460ff1661511c5760405162461bcd60e51b815260040161088990615bb8565b600160fb55565b600054610100900460ff1661514a5760405162461bcd60e51b815260040161088990615bb8565b61012d805460ff19169055565b600082815260656020526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b613c49846323b872dd60e01b8585856040516024016148b793929190615911565b60606131a084846000856151dc565b610cf48282612f24565b60608247101561523d5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610889565b6001600160a01b0385163b6152945760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610889565b600080866001600160a01b031685876040516152b09190615cbc565b60006040518083038185875af1925050503d80600081146152ed576040519150601f19603f3d011682016040523d82523d6000602084013e6152f2565b606091505b509150915061530282828661530d565b979650505050505050565b6060831561531c57508161180d565b82511561532c5782518084602001fd5b8160405162461bcd60e51b81526004016108899190615b4d565b60006020828403121561535857600080fd5b81356001600160e01b03198116811461180d57600080fd5b6001600160a01b038116811461084257600080fd5b60006020828403121561539757600080fd5b813561180d81615370565b6000602082840312156153b457600080fd5b5035919050565b801515811461084257600080fd5b6000602082840312156153db57600080fd5b813561180d816153bb565b600080604083850312156153f957600080fd5b82359150602083013561540b81615370565b809150509250929050565b6000806040838503121561542957600080fd5b823561543481615370565b946020939093013593505050565b6020808252825182820181905260009190848201906040850190845b818110156154835783516001600160a01b03168352928401929184019160010161545e565b50909695505050505050565b600080600080600060a086880312156154a757600080fd5b85356154b281615370565b945060208601356154c281615370565b94979496505050506040830135926060810135926080909101359150565b6000806000604084860312156154f557600080fd5b833567ffffffffffffffff8082111561550d57600080fd5b818601915086601f83011261552157600080fd5b81358181111561553057600080fd5b8760208260051b850101111561554557600080fd5b6020928301955093505084013561555b81615370565b809150509250925092565b60008060008060008060c0878903121561557f57600080fd5b863561558a81615370565b9550602087013561559a81615370565b945060408701359350606087013592506080870135915060a08701356155bf81615370565b809150509295509295509295565b63ffffffff8116811461084257600080fd5b6000602082840312156155f157600080fd5b813561180d816155cd565b60008083601f84011261560e57600080fd5b50813567ffffffffffffffff81111561562657600080fd5b60208301915083602082850101111561563e57600080fd5b9250929050565b6000806020838503121561565857600080fd5b823567ffffffffffffffff81111561566f57600080fd5b61567b858286016155fc565b90969095509350505050565b6000806040838503121561569a57600080fd5b50508035926020909101359150565b6000806000806000608086880312156156c157600080fd5b85356156cc81615370565b94506020860135935060408601356156e381615370565b9250606086013567ffffffffffffffff8111156156ff57600080fd5b61570b888289016155fc565b969995985093965092949392505050565b60008060006060848603121561573157600080fd5b833561573c81615370565b9250602084013561574c81615370565b929592945050506040919091013590565b60008060006060848603121561577257600080fd5b833561577d81615370565b9250602084013561578d81615370565b9150604084013561555b81615370565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6000602082840312156157e657600080fd5b5051919050565b6000602082840312156157ff57600080fd5b815161ffff8116811461180d57600080fd5b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b634e487b7160e01b600052604160045260246000fd5b6040516060810167ffffffffffffffff8111828210171561588257634e487b7160e01b600052604160045260246000fd5b60405290565b60006060828403121561589a57600080fd5b6158a2615851565b82516158ad81615370565b8152602083810151908201526040928301519281019290925250919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161590a5761590a6158e2565b5060010190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b600061ffff808316818516808303821115615952576159526158e2565b01949350505050565b60006020828403121561596d57600080fd5b815161180d816153bb565b80516fffffffffffffffffffffffffffffffff8116811461599857600080fd5b919050565b6000606082840312156159af57600080fd5b6159b7615851565b6159c083615978565b81526159ce60208401615978565b6020820152604083015160408201528091505092915050565b6000828210156159f9576159f96158e2565b500390565b600060208284031215615a1057600080fd5b815161180d816155cd565b6001600160a01b03878116825286166020820152604081018590526060810184905260a06080820181905281018290526000828460c0840137600060c0848401015260c0601f19601f8501168301019050979650505050505050565b60008219821115615a8a57615a8a6158e2565b500190565b600060208284031215615aa157600080fd5b815161180d81615370565b60005b83811015615ac7578181015183820152602001615aaf565b83811115613c495750506000910152565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351615b10816017850160208801615aac565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351615b41816028840160208801615aac565b01602801949350505050565b6020815260008251806020840152615b6c816040850160208701615aac565b601f01601f19169190910160400192915050565b634e487b7160e01b600052601260045260246000fd5b600082615bb357634e487b7160e01b600052601260045260246000fd5b500490565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b634e487b7160e01b600052603160045260246000fd5b6000816000190483118215151615615c3357615c336158e2565b500290565b600081615c4757615c476158e2565b506000190190565b95865260208601949094526040850192909252606084015260808301526001600160a01b031660a082015260c00190565b600060608284031215615c9257600080fd5b615c9a615851565b8251815260208301516020820152604083015160408201528091505092915050565b60008251615cce818460208701615aac565b919091019291505056fef28f409b8cbe6b50c7ca45afe893f01f69626f8a4e33cb480bc1bc2d618c084589ce14d20697a788f57260f7690044299bde7ea88cfb7e43d120a0c031f1ffc12172861495e7b85edac73e3cd5fbb42dd675baadf627720e687bcfdaca025096a164736f6c634300080d000a", "devdoc": { "details": "Bancor Network contract", "events": { @@ -1337,6 +1453,12 @@ "NetworkFeesWithdrawn(address,address,uint256)": { "details": "triggered when network fees are withdrawn" }, + "POLRewardsPPMUpdated(uint32,uint32)": { + "details": "triggered when POL rewards ppm is updated" + }, + "POLWithdrawn(address,address,uint256,uint256)": { + "details": "triggered when pool surplus tokens are withdrawn" + }, "PoolAdded(address,address)": { "details": "triggered when a new pool is added to a pool collection" }, @@ -1424,6 +1546,9 @@ "pendingNetworkFeeAmount()": { "details": "returns the pending network fee amount to be burned by the vortex" }, + "polRewardsPPM()": { + "details": "returns the POL rewards ppm" + }, "poolCollections()": { "details": "returns the set of all valid pool collections" }, @@ -1454,6 +1579,9 @@ "roleNetworkFeeManager()": { "details": "returns the network fee manager role" }, + "setPOLRewardsPPM(uint32)": { + "details": "set the POL rewards ppm" + }, "supportsInterface(bytes4)": { "details": "See {IERC165-supportsInterface}." }, @@ -1477,6 +1605,9 @@ }, "withdrawNetworkFees(address)": { "details": "withdraws pending network fees, and returns the amount of fees withdrawn requirements: - the caller must have the ROLE_NETWORK_FEE_MANAGER privilege" + }, + "withdrawPOL(address)": { + "details": "withdraws surplus tokens from a given pool to CarbonPOL contract, and disables trading on the given pool if it is not already disabled" } }, "version": 1 @@ -1553,7 +1684,7 @@ "type": "t_array(t_uint256)49_storage" }, { - "astId": 33873, + "astId": 33003, "contract": "contracts/network/BancorNetwork.sol:BancorNetwork", "label": "_initializations", "offset": 0, @@ -1561,7 +1692,7 @@ "type": "t_uint16" }, { - "astId": 33879, + "astId": 33009, "contract": "contracts/network/BancorNetwork.sol:BancorNetwork", "label": "__gap", "offset": 0, @@ -1601,31 +1732,31 @@ "type": "t_array(t_uint256)49_storage" }, { - "astId": 12692, + "astId": 11402, "contract": "contracts/network/BancorNetwork.sol:BancorNetwork", "label": "_bntPool", "offset": 0, "slot": "351", - "type": "t_contract(IBNTPool)26265" + "type": "t_contract(IBNTPool)25387" }, { - "astId": 12695, + "astId": 11405, "contract": "contracts/network/BancorNetwork.sol:BancorNetwork", "label": "_pendingWithdrawals", "offset": 0, "slot": "352", - "type": "t_contract(IPendingWithdrawals)19208" + "type": "t_contract(IPendingWithdrawals)18361" }, { - "astId": 12698, + "astId": 11408, "contract": "contracts/network/BancorNetwork.sol:BancorNetwork", "label": "_poolMigrator", "offset": 0, "slot": "353", - "type": "t_contract(IPoolMigrator)26643" + "type": "t_contract(IPoolMigrator)25775" }, { - "astId": 12701, + "astId": 11411, "contract": "contracts/network/BancorNetwork.sol:BancorNetwork", "label": "_poolCollections", "offset": 0, @@ -1633,7 +1764,7 @@ "type": "t_struct(AddressSet)1737_storage" }, { - "astId": 12703, + "astId": 11413, "contract": "contracts/network/BancorNetwork.sol:BancorNetwork", "label": "_deprecated0", "offset": 0, @@ -1641,7 +1772,7 @@ "type": "t_uint256" }, { - "astId": 12706, + "astId": 11416, "contract": "contracts/network/BancorNetwork.sol:BancorNetwork", "label": "_liquidityPools", "offset": 0, @@ -1649,15 +1780,15 @@ "type": "t_struct(AddressSet)1737_storage" }, { - "astId": 12712, + "astId": 11422, "contract": "contracts/network/BancorNetwork.sol:BancorNetwork", "label": "_collectionByPool", "offset": 0, "slot": "359", - "type": "t_mapping(t_contract(Token)31719,t_contract(IPoolCollection)26621)" + "type": "t_mapping(t_contract(Token)30851,t_contract(IPoolCollection)25753)" }, { - "astId": 12714, + "astId": 11424, "contract": "contracts/network/BancorNetwork.sol:BancorNetwork", "label": "_pendingNetworkFeeAmount", "offset": 0, @@ -1665,7 +1796,7 @@ "type": "t_uint256" }, { - "astId": 12717, + "astId": 11427, "contract": "contracts/network/BancorNetwork.sol:BancorNetwork", "label": "_depositingEnabled", "offset": 0, @@ -1673,7 +1804,15 @@ "type": "t_bool" }, { - "astId": 12723, + "astId": 11429, + "contract": "contracts/network/BancorNetwork.sol:BancorNetwork", + "label": "_polRewardsPPM", + "offset": 1, + "slot": "361", + "type": "t_uint32" + }, + { + "astId": 11435, "contract": "contracts/network/BancorNetwork.sol:BancorNetwork", "label": "__gap", "offset": 0, @@ -1721,27 +1860,27 @@ "label": "bytes32", "numberOfBytes": "32" }, - "t_contract(IBNTPool)26265": { + "t_contract(IBNTPool)25387": { "encoding": "inplace", "label": "contract IBNTPool", "numberOfBytes": "20" }, - "t_contract(IPendingWithdrawals)19208": { + "t_contract(IPendingWithdrawals)18361": { "encoding": "inplace", "label": "contract IPendingWithdrawals", "numberOfBytes": "20" }, - "t_contract(IPoolCollection)26621": { + "t_contract(IPoolCollection)25753": { "encoding": "inplace", "label": "contract IPoolCollection", "numberOfBytes": "20" }, - "t_contract(IPoolMigrator)26643": { + "t_contract(IPoolMigrator)25775": { "encoding": "inplace", "label": "contract IPoolMigrator", "numberOfBytes": "20" }, - "t_contract(Token)31719": { + "t_contract(Token)30851": { "encoding": "inplace", "label": "contract Token", "numberOfBytes": "20" @@ -1774,12 +1913,12 @@ "numberOfBytes": "32", "value": "t_uint256" }, - "t_mapping(t_contract(Token)31719,t_contract(IPoolCollection)26621)": { + "t_mapping(t_contract(Token)30851,t_contract(IPoolCollection)25753)": { "encoding": "mapping", - "key": "t_contract(Token)31719", + "key": "t_contract(Token)30851", "label": "mapping(contract Token => contract IPoolCollection)", "numberOfBytes": "32", - "value": "t_contract(IPoolCollection)26621" + "value": "t_contract(IPoolCollection)25753" }, "t_struct(AddressSet)1737_storage": { "encoding": "inplace", @@ -1851,6 +1990,11 @@ "encoding": "inplace", "label": "uint256", "numberOfBytes": "32" + }, + "t_uint32": { + "encoding": "inplace", + "label": "uint32", + "numberOfBytes": "4" } } } diff --git a/deployments/mainnet/NetworkSettings.json b/deployments/mainnet/NetworkSettings.json index 248f1647d..1b44f8750 100644 --- a/deployments/mainnet/NetworkSettings.json +++ b/deployments/mainnet/NetworkSettings.json @@ -337,6 +337,19 @@ "name": "TokenAddedToWhitelist", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract Token", + "name": "token", + "type": "address" + } + ], + "name": "TokenAddedToWhitelistForPOL", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -350,6 +363,19 @@ "name": "TokenRemovedFromWhitelist", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract Token", + "name": "token", + "type": "address" + } + ], + "name": "TokenRemovedFromWhitelistForPOL", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -426,6 +452,19 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "contract Token", + "name": "token", + "type": "address" + } + ], + "name": "addTokenToWhitelistForPOL", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -457,6 +496,19 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "contract Token[]", + "name": "tokens", + "type": "address[]" + } + ], + "name": "addTokensToWhitelistForPOL", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [], "name": "defaultFlashLoanFeePPM", @@ -619,6 +671,25 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "contract Token", + "name": "token", + "type": "address" + } + ], + "name": "isTokenWhitelistedForPOL", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "minLiquidityForTrading", @@ -690,6 +761,19 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "contract Token", + "name": "token", + "type": "address" + } + ], + "name": "removeTokenFromWhitelistForPOL", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -876,6 +960,19 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "tokenWhitelistForPOL", + "outputs": [ + { + "internalType": "contract Token[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "version", @@ -1026,8 +1123,8 @@ "0x12388c005c3e3a88b6D30c55F21e49b747d118cb", "0x8129fc1c" ], - "numDeployments": 3, - "solcInputHash": "a927a6888186dffd8bd5cdda91c49d63", + "numDeployments": 4, + "solcInputHash": "4a12fa84003cd14a8d58a795b8fd43b8", "metadata": "{\"compiler\":{\"version\":\"0.8.13+commit.abaa5c0e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"initAdmin\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AccessDenied\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidAddress\",\"type\":\"error\"},{\"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\":\"\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"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 is a slightly optimized version of the original TransparentUpgradeableProxy solely designed to work with the ProxyAdmin contract: - the address of the admin is stored as an immutable state variables and as the result: - the address of the admin can't be change, so the changeAdmin() function was subsequently removed note that we're using the Transparent Upgradeable Proxy pattern and *not* the Universal Upgradeable Proxy Standard (UUPS) pattern, therefore initializing the implementation contracts is not necessary or required\",\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"returns the current admin requirements: - the caller must be the admin of the contract\"},\"constructor\":{\"details\":\"initializes an upgradeable proxy managed by `initAdmin`, backed by the implementation at `logic`, and optionally initialized with `data` as explained in {ERC1967Proxy-constructor}\"},\"implementation()\":{\"details\":\"returns the current implementation. requirements: - the caller must be the admin of the contract\"},\"upgradeTo(address)\":{\"details\":\"upgrades the implementation of the proxy requirements: - the caller must be the admin of the contract\"},\"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 requirements: - the caller must be the admin of the contract\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/utility/TransparentUpgradeableProxyImmutable.sol\":\"TransparentUpgradeableProxyImmutable\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"none\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/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\"},\"@openzeppelin/contracts/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\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.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\":\"0x0edeb16b9821ae2b16e9d69c383b38d3ad2fbb3e0c06cf809a0786d96e602551\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.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\"},\"@openzeppelin/contracts/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/utility/Constants.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nuint32 constant PPM_RESOLUTION = 1_000_000;\\n\",\"keccak256\":\"0x5215535db0a4e580cd19380cc1cf3a2b7edcbb8ee039e416319fe9f8867724ad\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/utility/TransparentUpgradeableProxyImmutable.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { ERC1967Proxy } from \\\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\\\";\\n\\nimport { AccessDenied, Utils } from \\\"./Utils.sol\\\";\\n\\n/**\\n * @dev this contract is a slightly optimized version of the original TransparentUpgradeableProxy solely designed to\\n * work with the ProxyAdmin contract:\\n *\\n * - the address of the admin is stored as an immutable state variables and as the result:\\n * - the address of the admin can't be change, so the changeAdmin() function was subsequently removed\\n *\\n * note that we're using the Transparent Upgradeable Proxy pattern and *not* the Universal Upgradeable Proxy Standard\\n * (UUPS) pattern, therefore initializing the implementation contracts is not necessary or required\\n */\\ncontract TransparentUpgradeableProxyImmutable is ERC1967Proxy, Utils {\\n address internal immutable _admin;\\n\\n /**\\n * @dev initializes an upgradeable proxy managed by `initAdmin`, 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 initAdmin,\\n bytes memory data\\n ) payable ERC1967Proxy(logic, data) validAddress(initAdmin) {\\n _admin = initAdmin;\\n\\n // still store it to work with EIP-1967\\n _changeAdmin(initAdmin);\\n }\\n\\n modifier ifAdmin() {\\n if (msg.sender == _admin) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev returns the current admin\\n *\\n * requirements:\\n *\\n * - the caller must be the admin of the contract\\n */\\n function admin() external ifAdmin returns (address) {\\n return _admin;\\n }\\n\\n /**\\n * @dev returns the current implementation.\\n *\\n * requirements:\\n *\\n * - the caller must be the admin of the contract\\n */\\n function implementation() external ifAdmin returns (address) {\\n return _implementation();\\n }\\n\\n /**\\n * @dev upgrades the implementation of the proxy\\n *\\n * requirements:\\n *\\n * - the caller must be the admin of the contract\\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 * requirements:\\n *\\n * - the caller must be the admin of the contract\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev makes sure the admin cannot access the fallback function\\n */\\n function _beforeFallback() internal virtual override {\\n if (msg.sender == _admin) {\\n revert AccessDenied();\\n }\\n\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0xd5b7343190a9781de9ab9abecc267fd8d38d95e35a58481858e8313180b8f8a9\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/utility/Utils.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { PPM_RESOLUTION } from \\\"./Constants.sol\\\";\\n\\nerror AccessDenied();\\nerror AlreadyExists();\\nerror DoesNotExist();\\nerror InvalidAddress();\\nerror InvalidExternalAddress();\\nerror InvalidFee();\\nerror InvalidPool();\\nerror InvalidPoolCollection();\\nerror InvalidStakedBalance();\\nerror InvalidToken();\\nerror InvalidParam();\\nerror NotEmpty();\\nerror NotPayable();\\nerror ZeroValue();\\n\\n/**\\n * @dev common utilities\\n */\\nabstract contract Utils {\\n // allows execution by the caller only\\n modifier only(address caller) {\\n _only(caller);\\n\\n _;\\n }\\n\\n function _only(address caller) internal view {\\n if (msg.sender != caller) {\\n revert AccessDenied();\\n }\\n }\\n\\n // verifies that a value is greater than zero\\n modifier greaterThanZero(uint256 value) {\\n _greaterThanZero(value);\\n\\n _;\\n }\\n\\n // error message binary size optimization\\n function _greaterThanZero(uint256 value) internal pure {\\n if (value == 0) {\\n revert ZeroValue();\\n }\\n }\\n\\n // validates an address - currently only checks that it isn't null\\n modifier validAddress(address addr) {\\n _validAddress(addr);\\n\\n _;\\n }\\n\\n // error message binary size optimization\\n function _validAddress(address addr) internal pure {\\n if (addr == address(0)) {\\n revert InvalidAddress();\\n }\\n }\\n\\n // validates an external address - currently only checks that it isn't null or this\\n modifier validExternalAddress(address addr) {\\n _validExternalAddress(addr);\\n\\n _;\\n }\\n\\n // error message binary size optimization\\n function _validExternalAddress(address addr) internal view {\\n if (addr == address(0) || addr == address(this)) {\\n revert InvalidExternalAddress();\\n }\\n }\\n\\n // ensures that the fee is valid\\n modifier validFee(uint32 fee) {\\n _validFee(fee);\\n\\n _;\\n }\\n\\n // error message binary size optimization\\n function _validFee(uint32 fee) internal pure {\\n if (fee > PPM_RESOLUTION) {\\n revert InvalidFee();\\n }\\n }\\n}\\n\",\"keccak256\":\"0x62b8b81d3069467eb6402b8f61adcc24f5b2e310db1a2ee64d719229306ab823\",\"license\":\"SEE LICENSE IN LICENSE\"}},\"version\":1}", "bytecode": "0x60a060405260405162000dfe38038062000dfe83398101604081905262000026916200050e565b82816200005560017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd620005ee565b60008051602062000db78339815191521462000075576200007562000614565b6200008382826000620000b4565b508290506200009281620000f1565b6001600160a01b038316608052620000aa836200011c565b505050506200067d565b620000bf8362000174565b600082511180620000cd5750805b15620000ec57620000ea8383620001b660201b620002641760201c565b505b505050565b6001600160a01b038116620001195760405163e6c4247b60e01b815260040160405180910390fd5b50565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f62000147620001e5565b604080516001600160a01b03928316815291841660208301520160405180910390a162000119816200021e565b6200017f81620002d3565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060620001de838360405180606001604052806027815260200162000dd76027913962000376565b9392505050565b60006200020f60008051602062000d9783398151915260001b6200045c60201b6200020a1760201c565b546001600160a01b0316919050565b6001600160a01b038116620002895760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b80620002b260008051602062000d9783398151915260001b6200045c60201b6200020a1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002e9816200045f60201b620002901760201c565b6200034d5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b606482015260840162000280565b80620002b260008051602062000db783398151915260001b6200045c60201b6200020a1760201c565b60606001600160a01b0384163b620003e05760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b606482015260840162000280565b600080856001600160a01b031685604051620003fd91906200062a565b600060405180830381855af49150503d80600081146200043a576040519150601f19603f3d011682016040523d82523d6000602084013e6200043f565b606091505b509092509050620004528282866200046e565b9695505050505050565b90565b6001600160a01b03163b151590565b606083156200047f575081620001de565b825115620004905782518084602001fd5b8160405162461bcd60e51b815260040162000280919062000648565b80516001600160a01b0381168114620004c457600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620004fc578181015183820152602001620004e2565b83811115620000ea5750506000910152565b6000806000606084860312156200052457600080fd5b6200052f84620004ac565b92506200053f60208501620004ac565b60408501519092506001600160401b03808211156200055d57600080fd5b818601915086601f8301126200057257600080fd5b815181811115620005875762000587620004c9565b604051601f8201601f19908116603f01168101908382118183101715620005b257620005b2620004c9565b81604052828152896020848701011115620005cc57600080fd5b620005df836020830160208801620004df565b80955050505050509250925092565b6000828210156200060f57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b600082516200063e818460208701620004df565b9190910192915050565b602081526000825180602084015262000669816040850160208701620004df565b601f01601f19169190910160400192915050565b6080516106dc620006bb6000396000818160f70152818161014d015281816101cf015281816102190152818161024201526102a901526106dc6000f3fe6080604052600436106100435760003560e01c80633659cfe61461005a5780634f1ef2861461007a5780635c60da1b1461008d578063f851a440146100be57610052565b36610052576100506100d3565b005b6100506100d3565b34801561006657600080fd5b5061005061007536600461058f565b6100ed565b6100506100883660046105aa565b610143565b34801561009957600080fd5b506100a26101c3565b6040516001600160a01b03909116815260200160405180910390f35b3480156100ca57600080fd5b506100a261020d565b6100db61029f565b6100eb6100e66102e8565b61031b565b565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016330361013b576101388160405180602001604052806000815250600061033f565b50565b6101386100d3565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633036101bb576101b68383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061033f915050565b505050565b6101b66100d3565b60006001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163303610202576101fd6102e8565b905090565b61020a6100d3565b90565b60006001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016330361020257507f000000000000000000000000000000000000000000000000000000000000000090565b606061028983836040518060600160405280602781526020016106a96027913961036a565b9392505050565b6001600160a01b03163b151590565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633036100eb57604051634ca8886760e01b815260040160405180910390fd5b60006101fd7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b3660008037600080366000845af43d6000803e80801561033a573d6000f35b3d6000fd5b6103488361044c565b6000825111806103555750805b156101b6576103648383610264565b50505050565b60606001600160a01b0384163b6103d75760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084015b60405180910390fd5b600080856001600160a01b0316856040516103f29190610659565b600060405180830381855af49150503d806000811461042d576040519150601f19603f3d011682016040523d82523d6000602084013e610432565b606091505b509150915061044282828661048c565b9695505050505050565b610455816104c5565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060831561049b575081610289565b8251156104ab5782518084602001fd5b8160405162461bcd60e51b81526004016103ce9190610675565b6001600160a01b0381163b6105325760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016103ce565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b80356001600160a01b038116811461058a57600080fd5b919050565b6000602082840312156105a157600080fd5b61028982610573565b6000806000604084860312156105bf57600080fd5b6105c884610573565b9250602084013567ffffffffffffffff808211156105e557600080fd5b818601915086601f8301126105f957600080fd5b81358181111561060857600080fd5b87602082850101111561061a57600080fd5b6020830194508093505050509250925092565b60005b83811015610648578181015183820152602001610630565b838111156103645750506000910152565b6000825161066b81846020870161062d565b9190910192915050565b602081526000825180602084015261069481604085016020870161062d565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a164736f6c634300080d000ab53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", "deployedBytecode": "0x6080604052600436106100435760003560e01c80633659cfe61461005a5780634f1ef2861461007a5780635c60da1b1461008d578063f851a440146100be57610052565b36610052576100506100d3565b005b6100506100d3565b34801561006657600080fd5b5061005061007536600461058f565b6100ed565b6100506100883660046105aa565b610143565b34801561009957600080fd5b506100a26101c3565b6040516001600160a01b03909116815260200160405180910390f35b3480156100ca57600080fd5b506100a261020d565b6100db61029f565b6100eb6100e66102e8565b61031b565b565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016330361013b576101388160405180602001604052806000815250600061033f565b50565b6101386100d3565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633036101bb576101b68383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061033f915050565b505050565b6101b66100d3565b60006001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163303610202576101fd6102e8565b905090565b61020a6100d3565b90565b60006001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016330361020257507f000000000000000000000000000000000000000000000000000000000000000090565b606061028983836040518060600160405280602781526020016106a96027913961036a565b9392505050565b6001600160a01b03163b151590565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633036100eb57604051634ca8886760e01b815260040160405180910390fd5b60006101fd7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b3660008037600080366000845af43d6000803e80801561033a573d6000f35b3d6000fd5b6103488361044c565b6000825111806103555750805b156101b6576103648383610264565b50505050565b60606001600160a01b0384163b6103d75760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084015b60405180910390fd5b600080856001600160a01b0316856040516103f29190610659565b600060405180830381855af49150503d806000811461042d576040519150601f19603f3d011682016040523d82523d6000602084013e610432565b606091505b509150915061044282828661048c565b9695505050505050565b610455816104c5565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060831561049b575081610289565b8251156104ab5782518084602001fd5b8160405162461bcd60e51b81526004016103ce9190610675565b6001600160a01b0381163b6105325760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016103ce565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b80356001600160a01b038116811461058a57600080fd5b919050565b6000602082840312156105a157600080fd5b61028982610573565b6000806000604084860312156105bf57600080fd5b6105c884610573565b9250602084013567ffffffffffffffff808211156105e557600080fd5b818601915086601f8301126105f957600080fd5b81358181111561060857600080fd5b87602082850101111561061a57600080fd5b6020830194508093505050509250925092565b60005b83811015610648578181015183820152602001610630565b838111156103645750506000910152565b6000825161066b81846020870161062d565b9190910192915050565b602081526000825180602084015261069481604085016020870161062d565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a164736f6c634300080d000a", @@ -1037,7 +1134,7 @@ "0x" ] }, - "implementation": "0x68e4F8421dC6c3B49de130b792D711027A4ecD96", + "implementation": "0x51a6D03B156af044bda570CF35a919DB851Cebd1", "devdoc": { "details": "this contract is a slightly optimized version of the original TransparentUpgradeableProxy solely designed to work with the ProxyAdmin contract: - the address of the admin is stored as an immutable state variables and as the result: - the address of the admin can't be change, so the changeAdmin() function was subsequently removed note that we're using the Transparent Upgradeable Proxy pattern and *not* the Universal Upgradeable Proxy Standard (UUPS) pattern, therefore initializing the implementation contracts is not necessary or required", "kind": "dev", diff --git a/deployments/mainnet/NetworkSettings_Implementation.json b/deployments/mainnet/NetworkSettings_Implementation.json index 5dd047dfb..a3f1f63cf 100644 --- a/deployments/mainnet/NetworkSettings_Implementation.json +++ b/deployments/mainnet/NetworkSettings_Implementation.json @@ -1,5 +1,5 @@ { - "address": "0x68e4F8421dC6c3B49de130b792D711027A4ecD96", + "address": "0x51a6D03B156af044bda570CF35a919DB851Cebd1", "abi": [ { "inputs": [ @@ -238,6 +238,19 @@ "name": "TokenAddedToWhitelist", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract Token", + "name": "token", + "type": "address" + } + ], + "name": "TokenAddedToWhitelistForPOL", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -251,6 +264,19 @@ "name": "TokenRemovedFromWhitelist", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract Token", + "name": "token", + "type": "address" + } + ], + "name": "TokenRemovedFromWhitelistForPOL", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -327,6 +353,19 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "contract Token", + "name": "token", + "type": "address" + } + ], + "name": "addTokenToWhitelistForPOL", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -358,6 +397,19 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "contract Token[]", + "name": "tokens", + "type": "address[]" + } + ], + "name": "addTokensToWhitelistForPOL", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [], "name": "defaultFlashLoanFeePPM", @@ -520,6 +572,25 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "contract Token", + "name": "token", + "type": "address" + } + ], + "name": "isTokenWhitelistedForPOL", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "minLiquidityForTrading", @@ -591,6 +662,19 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "contract Token", + "name": "token", + "type": "address" + } + ], + "name": "removeTokenFromWhitelistForPOL", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -777,6 +861,19 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "tokenWhitelistForPOL", + "outputs": [ + { + "internalType": "contract Token[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "version", @@ -829,30 +926,30 @@ "type": "function" } ], - "transactionHash": "0x713eeacfcc5fb8b513c5b1f63bb8faf789c231f2c7e6db0ed64216ba8672e282", + "transactionHash": "0x26f16747c99560ca92888049a7f4681343ddc8dcd76b9c962e885476770cd039", "receipt": { "to": null, "from": "0x5bEBA4D3533a963Dedb270a95ae5f7752fA0Fe22", - "contractAddress": "0x68e4F8421dC6c3B49de130b792D711027A4ecD96", - "transactionIndex": 61, - "gasUsed": "1640525", + "contractAddress": "0x51a6D03B156af044bda570CF35a919DB851Cebd1", + "transactionIndex": 30, + "gasUsed": "1790932", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xf0d16aa10602562a04a7bd73a9b2f8e388115ce70c2185db333cab6353be81f0", - "transactionHash": "0x713eeacfcc5fb8b513c5b1f63bb8faf789c231f2c7e6db0ed64216ba8672e282", + "blockHash": "0x5a91bfb53ffdd00cdccb7acc339764b23abe3dafb7892a7bbce53a3d517b80c3", + "transactionHash": "0x26f16747c99560ca92888049a7f4681343ddc8dcd76b9c962e885476770cd039", "logs": [], - "blockNumber": 14992751, - "cumulativeGasUsed": "6796358", + "blockNumber": 18127250, + "cumulativeGasUsed": "16048978", "status": 1, "byzantium": true }, "args": [ "0x1F573D6Fb3F13d689FF844B4cE37794d79a7FF1C" ], - "numDeployments": 3, - "solcInputHash": "a927a6888186dffd8bd5cdda91c49d63", - "metadata": "{\"compiler\":{\"version\":\"0.8.13+commit.abaa5c0e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"initBnt\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AccessDenied\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AlreadyExists\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AlreadyInitialized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DoesNotExist\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidExternalAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidFee\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidParam\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotWhitelisted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroValue\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"prevFeePPM\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"newFeePPM\",\"type\":\"uint32\"}],\"name\":\"DefaultFlashLoanFeePPMUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract Token\",\"name\":\"pool\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"prevFeePPM\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"newFeePPM\",\"type\":\"uint32\"}],\"name\":\"FlashLoanFeePPMUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract Token\",\"name\":\"pool\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"prevLimit\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newLimit\",\"type\":\"uint256\"}],\"name\":\"FundingLimitUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"prevLiquidity\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newLiquidity\",\"type\":\"uint256\"}],\"name\":\"MinLiquidityForTradingUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"previousAdminRole\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"newAdminRole\",\"type\":\"bytes32\"}],\"name\":\"RoleAdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleGranted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract Token\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"TokenAddedToWhitelist\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract Token\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"TokenRemovedFromWhitelist\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"prevBurnRewardPPM\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"newBurnRewardPPM\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"prevBurnRewardMaxAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newBurnRewardMaxAmount\",\"type\":\"uint256\"}],\"name\":\"VortexBurnRewardUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"prevFeePPM\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"newFeePPM\",\"type\":\"uint32\"}],\"name\":\"WithdrawalFeePPMUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DEFAULT_ADMIN_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"addTokenToWhitelist\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"addTokenToWhitelistWithLimit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token[]\",\"name\":\"tokens\",\"type\":\"address[]\"}],\"name\":\"addTokensToWhitelist\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"defaultFlashLoanFeePPM\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"flashLoanFeePPM\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleAdmin\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"getRoleMember\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleMemberCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"grantRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"hasRole\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"isTokenWhitelisted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"minLiquidityForTrading\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"poolFundingLimit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"postUpgrade\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"protectedTokenWhitelist\",\"outputs\":[{\"internalType\":\"contract Token[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"removeTokenFromWhitelist\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"renounceRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"revokeRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"roleAdmin\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"newDefaultFlashLoanFeePPM\",\"type\":\"uint32\"}],\"name\":\"setDefaultFlashLoanFeePPM\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"pool\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"newFlashLoanFeePPM\",\"type\":\"uint32\"}],\"name\":\"setFlashLoanFeePPM\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"pool\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"setFundingLimit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token[]\",\"name\":\"pools\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"}],\"name\":\"setFundingLimits\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"setMinLiquidityForTrading\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"burnRewardPPM\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"burnRewardMaxAmount\",\"type\":\"uint256\"}],\"internalType\":\"struct VortexRewards\",\"name\":\"rewards\",\"type\":\"tuple\"}],\"name\":\"setVortexRewards\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"newWithdrawalFeePPM\",\"type\":\"uint32\"}],\"name\":\"setWithdrawalFeePPM\",\"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\":\"version\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vortexRewards\",\"outputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"burnRewardPPM\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"burnRewardMaxAmount\",\"type\":\"uint256\"}],\"internalType\":\"struct VortexRewards\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"withdrawalFeePPM\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"Network Settings contract\",\"events\":{\"DefaultFlashLoanFeePPMUpdated(uint32,uint32)\":{\"details\":\"triggered when the default flash-loan fee is updated\"},\"FlashLoanFeePPMUpdated(address,uint32,uint32)\":{\"details\":\"triggered when a specific pool's flash-loan fee is updated\"},\"FundingLimitUpdated(address,uint256,uint256)\":{\"details\":\"triggered when a per-pool funding limit is updated\"},\"MinLiquidityForTradingUpdated(uint256,uint256)\":{\"details\":\"triggered when the minimum liquidity for trading is updated\"},\"TokenAddedToWhitelist(address)\":{\"details\":\"triggered when a token is added to the protection whitelist\"},\"TokenRemovedFromWhitelist(address)\":{\"details\":\"triggered when a token is removed from the protection whitelist\"},\"VortexBurnRewardUpdated(uint32,uint32,uint256,uint256)\":{\"details\":\"triggered when the settings of the Vortex are updated\"},\"WithdrawalFeePPMUpdated(uint32,uint32)\":{\"details\":\"triggered when the withdrawal fee is updated\"}},\"kind\":\"dev\",\"methods\":{\"addTokenToWhitelist(address)\":{\"details\":\"adds a token to the protected tokens whitelist requirements: - the caller must be the admin of the contract\"},\"addTokenToWhitelistWithLimit(address,uint256)\":{\"details\":\"adds a token to the protected tokens whitelist, and sets the amount of BNT that the protocol can provide as funding for this pool requirements: - the caller must be the admin of the contract\"},\"addTokensToWhitelist(address[])\":{\"details\":\"adds tokens to the protected tokens whitelist requirements: - the caller must be the admin of the contract\"},\"defaultFlashLoanFeePPM()\":{\"details\":\"returns the default flash-loan fee (in units of PPM)\"},\"flashLoanFeePPM(address)\":{\"details\":\"returns the flash-loan fee (in units of PPM) of a pool\"},\"getRoleAdmin(bytes32)\":{\"details\":\"Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.\"},\"getRoleMember(bytes32,uint256)\":{\"details\":\"Returns one of the accounts that have `role`. `index` must be a value between 0 and {getRoleMemberCount}, non-inclusive. Role bearers are not sorted in any particular way, and their ordering may change at any point. WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure you perform all queries on the same block. See the following https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] for more information.\"},\"getRoleMemberCount(bytes32)\":{\"details\":\"Returns the number of accounts that have `role`. Can be used together with {getRoleMember} to enumerate all bearers of a role.\"},\"grantRole(bytes32,address)\":{\"details\":\"Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role.\"},\"hasRole(bytes32,address)\":{\"details\":\"Returns `true` if `account` has been granted `role`.\"},\"initialize()\":{\"details\":\"fully initializes the contract and its parents\"},\"isTokenWhitelisted(address)\":{\"details\":\"checks whether a given token is whitelisted\"},\"minLiquidityForTrading()\":{\"details\":\"returns the minimum BNT trading liquidity required before the system enables trading in the relevant pool\"},\"poolFundingLimit(address)\":{\"details\":\"returns the BNT funding limit for a given pool\"},\"postUpgrade(bytes)\":{\"details\":\"performs post-upgrade initialization requirements: - this must can be called only once per-upgrade\"},\"protectedTokenWhitelist()\":{\"details\":\"returns the protected tokens whitelist\"},\"removeTokenFromWhitelist(address)\":{\"details\":\"removes a token from the protected tokens whitelist requirements: - the caller must be the admin of the contract\"},\"renounceRole(bytes32,address)\":{\"details\":\"Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `account`.\"},\"revokeRole(bytes32,address)\":{\"details\":\"Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role.\"},\"roleAdmin()\":{\"details\":\"returns the admin role\"},\"setDefaultFlashLoanFeePPM(uint32)\":{\"details\":\"sets the default flash-loan fee (in units of PPM) requirements: - the caller must be the admin of the contract\"},\"setFlashLoanFeePPM(address,uint32)\":{\"details\":\"sets the flash-loan fee of a given pool requirements: - the caller must be the admin of the contract - the token must have been whitelisted\"},\"setFundingLimit(address,uint256)\":{\"details\":\"updates the amount of BNT that the protocol can provide as funding for a specific pool requirements: - the caller must be the admin of the contract - the token must have been whitelisted\"},\"setFundingLimits(address[],uint256[])\":{\"details\":\"updates the amounts of BNT that the protocol can provide as funding for specific pools requirements: - the caller must be the admin of the contract - each one of the tokens must have been whitelisted\"},\"setMinLiquidityForTrading(uint256)\":{\"details\":\"updates the minimum liquidity for trading amount requirements: - the caller must be the admin of the contract\"},\"setVortexRewards((uint32,uint256))\":{\"details\":\"sets the settings of the Vortex requirements: s - the caller must be the admin of the contract\"},\"setWithdrawalFeePPM(uint32)\":{\"details\":\"sets the withdrawal fee (in units of PPM) requirements: - the caller must be the admin of the contract\"},\"supportsInterface(bytes4)\":{\"details\":\"See {IERC165-supportsInterface}.\"},\"vortexRewards()\":{\"details\":\"returns the vortex settings\"},\"withdrawalFeePPM()\":{\"details\":\"returns the withdrawal fee (in units of PPM)\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/network/NetworkSettings.sol\":\"NetworkSettings\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"none\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControlEnumerable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IAccessControlEnumerableUpgradeable.sol\\\";\\nimport \\\"./AccessControlUpgradeable.sol\\\";\\nimport \\\"../utils/structs/EnumerableSetUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Extension of {AccessControl} that allows enumerating the members of each role.\\n */\\nabstract contract AccessControlEnumerableUpgradeable is Initializable, IAccessControlEnumerableUpgradeable, AccessControlUpgradeable {\\n function __AccessControlEnumerable_init() internal onlyInitializing {\\n }\\n\\n function __AccessControlEnumerable_init_unchained() internal onlyInitializing {\\n }\\n using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet;\\n\\n mapping(bytes32 => EnumerableSetUpgradeable.AddressSet) private _roleMembers;\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IAccessControlEnumerableUpgradeable).interfaceId || super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev Returns one of the accounts that have `role`. `index` must be a\\n * value between 0 and {getRoleMemberCount}, non-inclusive.\\n *\\n * Role bearers are not sorted in any particular way, and their ordering may\\n * change at any point.\\n *\\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\\n * you perform all queries on the same block. See the following\\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\\n * for more information.\\n */\\n function getRoleMember(bytes32 role, uint256 index) public view virtual override returns (address) {\\n return _roleMembers[role].at(index);\\n }\\n\\n /**\\n * @dev Returns the number of accounts that have `role`. Can be used\\n * together with {getRoleMember} to enumerate all bearers of a role.\\n */\\n function getRoleMemberCount(bytes32 role) public view virtual override returns (uint256) {\\n return _roleMembers[role].length();\\n }\\n\\n /**\\n * @dev Overload {_grantRole} to track enumerable memberships\\n */\\n function _grantRole(bytes32 role, address account) internal virtual override {\\n super._grantRole(role, account);\\n _roleMembers[role].add(account);\\n }\\n\\n /**\\n * @dev Overload {_revokeRole} to track enumerable memberships\\n */\\n function _revokeRole(bytes32 role, address account) internal virtual override {\\n super._revokeRole(role, account);\\n _roleMembers[role].remove(account);\\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\":\"0xc2dfd6ba9449f61b6b03b262182faf302f093a8c05dd10792aeecb4ed1663c0c\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IAccessControlUpgradeable.sol\\\";\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../utils/StringsUpgradeable.sol\\\";\\nimport \\\"../utils/introspection/ERC165Upgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module that allows children to implement role-based access\\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\\n * members except through off-chain means by accessing the contract event logs. Some\\n * applications may benefit from on-chain enumerability, for those cases see\\n * {AccessControlEnumerable}.\\n *\\n * Roles are referred to by their `bytes32` identifier. These should be exposed\\n * in the external API and be unique. The best way to achieve this is by\\n * using `public constant` hash digests:\\n *\\n * ```\\n * bytes32 public constant MY_ROLE = keccak256(\\\"MY_ROLE\\\");\\n * ```\\n *\\n * Roles can be used to represent a set of permissions. To restrict access to a\\n * function call, use {hasRole}:\\n *\\n * ```\\n * function foo() public {\\n * require(hasRole(MY_ROLE, msg.sender));\\n * ...\\n * }\\n * ```\\n *\\n * Roles can be granted and revoked dynamically via the {grantRole} and\\n * {revokeRole} functions. Each role has an associated admin role, and only\\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\\n *\\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\\n * that only accounts with this role will be able to grant or revoke other\\n * roles. More complex role relationships can be created by using\\n * {_setRoleAdmin}.\\n *\\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\\n * grant and revoke this role. Extra precautions should be taken to secure\\n * accounts that have been granted it.\\n */\\nabstract contract AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControlUpgradeable, ERC165Upgradeable {\\n function __AccessControl_init() internal onlyInitializing {\\n }\\n\\n function __AccessControl_init_unchained() internal onlyInitializing {\\n }\\n struct RoleData {\\n mapping(address => bool) members;\\n bytes32 adminRole;\\n }\\n\\n mapping(bytes32 => RoleData) private _roles;\\n\\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\\n\\n /**\\n * @dev Modifier that checks that an account has a specific role. Reverts\\n * with a standardized message including the required role.\\n *\\n * The format of the revert reason is given by the following regular expression:\\n *\\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\\n *\\n * _Available since v4.1._\\n */\\n modifier onlyRole(bytes32 role) {\\n _checkRole(role, _msgSender());\\n _;\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IAccessControlUpgradeable).interfaceId || super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) public view virtual override returns (bool) {\\n return _roles[role].members[account];\\n }\\n\\n /**\\n * @dev Revert with a standard message if `account` is missing `role`.\\n *\\n * The format of the revert reason is given by the following regular expression:\\n *\\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\\n */\\n function _checkRole(bytes32 role, address account) internal view virtual {\\n if (!hasRole(role, account)) {\\n revert(\\n string(\\n abi.encodePacked(\\n \\\"AccessControl: account \\\",\\n StringsUpgradeable.toHexString(uint160(account), 20),\\n \\\" is missing role \\\",\\n StringsUpgradeable.toHexString(uint256(role), 32)\\n )\\n )\\n );\\n }\\n }\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {\\n return _roles[role].adminRole;\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\\n _grantRole(role, account);\\n }\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\\n _revokeRole(role, account);\\n }\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n */\\n function renounceRole(bytes32 role, address account) public virtual override {\\n require(account == _msgSender(), \\\"AccessControl: can only renounce roles for self\\\");\\n\\n _revokeRole(role, account);\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event. Note that unlike {grantRole}, this function doesn't perform any\\n * checks on the calling account.\\n *\\n * [WARNING]\\n * ====\\n * This function should only be called from the constructor when setting\\n * up the initial roles for the system.\\n *\\n * Using this function in any other way is effectively circumventing the admin\\n * system imposed by {AccessControl}.\\n * ====\\n *\\n * NOTE: This function is deprecated in favor of {_grantRole}.\\n */\\n function _setupRole(bytes32 role, address account) internal virtual {\\n _grantRole(role, account);\\n }\\n\\n /**\\n * @dev Sets `adminRole` as ``role``'s admin role.\\n *\\n * Emits a {RoleAdminChanged} event.\\n */\\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\\n bytes32 previousAdminRole = getRoleAdmin(role);\\n _roles[role].adminRole = adminRole;\\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * Internal function without access restriction.\\n */\\n function _grantRole(bytes32 role, address account) internal virtual {\\n if (!hasRole(role, account)) {\\n _roles[role].members[account] = true;\\n emit RoleGranted(role, account, _msgSender());\\n }\\n }\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * Internal function without access restriction.\\n */\\n function _revokeRole(bytes32 role, address account) internal virtual {\\n if (hasRole(role, account)) {\\n _roles[role].members[account] = false;\\n emit RoleRevoked(role, account, _msgSender());\\n }\\n }\\n\\n /**\\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\":\"0x2ffe9655abbb3741fcb84ad10e2f628d5dbec46b3f84a69ceec4752e807e2757\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/access/IAccessControlEnumerableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IAccessControlUpgradeable.sol\\\";\\n\\n/**\\n * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.\\n */\\ninterface IAccessControlEnumerableUpgradeable is IAccessControlUpgradeable {\\n /**\\n * @dev Returns one of the accounts that have `role`. `index` must be a\\n * value between 0 and {getRoleMemberCount}, non-inclusive.\\n *\\n * Role bearers are not sorted in any particular way, and their ordering may\\n * change at any point.\\n *\\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\\n * you perform all queries on the same block. See the following\\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\\n * for more information.\\n */\\n function getRoleMember(bytes32 role, uint256 index) external view returns (address);\\n\\n /**\\n * @dev Returns the number of accounts that have `role`. Can be used\\n * together with {getRoleMember} to enumerate all bearers of a role.\\n */\\n function getRoleMemberCount(bytes32 role) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x7acbc538aad6eb4614e26612a8c5c0149bb8808db95e2638d245a8365f63e572\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/access/IAccessControlUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev External interface of AccessControl declared to support ERC165 detection.\\n */\\ninterface IAccessControlUpgradeable {\\n /**\\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\\n *\\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\\n * {RoleAdminChanged} not being emitted signaling this.\\n *\\n * _Available since v3.1._\\n */\\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\\n\\n /**\\n * @dev Emitted when `account` is granted `role`.\\n *\\n * `sender` is the account that originated the contract call, an admin role\\n * bearer except when using {AccessControl-_setupRole}.\\n */\\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Emitted when `account` is revoked `role`.\\n *\\n * `sender` is the account that originated the contract call:\\n * - if using `revokeRole`, it is the admin role bearer\\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\\n */\\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) external view returns (bool);\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function grantRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function revokeRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been granted `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n */\\n function renounceRole(bytes32 role, address account) external;\\n}\\n\",\"keccak256\":\"0xb8f5302f12138c5561362e88a78d061573e6298b7a1a5afe84a1e2c8d4d5aeaa\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.0;\\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 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the\\n * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() initializer {}\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n */\\n bool private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Modifier to protect an initializer function from being invoked twice.\\n */\\n modifier initializer() {\\n // If the contract is initializing we ignore whether _initialized is set in order to support multiple\\n // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the\\n // contract may have been reentered.\\n require(_initializing ? _isConstructor() : !_initialized, \\\"Initializable: contract is already initialized\\\");\\n\\n bool isTopLevelCall = !_initializing;\\n if (isTopLevelCall) {\\n _initializing = true;\\n _initialized = true;\\n }\\n\\n _;\\n\\n if (isTopLevelCall) {\\n _initializing = false;\\n }\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} modifier, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n function _isConstructor() private view returns (bool) {\\n return !AddressUpgradeable.isContract(address(this));\\n }\\n}\\n\",\"keccak256\":\"0x372b0bc04e3b4c074559bbbfb1317afddb56de5504158ca25a7f9cd403980445\",\"license\":\"MIT\"},\"@openzeppelin/contracts-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\"},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract ContextUpgradeable is Initializable {\\n function __Context_init() internal onlyInitializing {\\n }\\n\\n function __Context_init_unchained() internal onlyInitializing {\\n }\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary StringsUpgradeable {\\n bytes16 private constant _HEX_SYMBOLS = \\\"0123456789abcdef\\\";\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n // Inspired by OraclizeAPI's implementation - MIT licence\\n // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol\\n\\n if (value == 0) {\\n return \\\"0\\\";\\n }\\n uint256 temp = value;\\n uint256 digits;\\n while (temp != 0) {\\n digits++;\\n temp /= 10;\\n }\\n bytes memory buffer = new bytes(digits);\\n while (value != 0) {\\n digits -= 1;\\n buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));\\n value /= 10;\\n }\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n if (value == 0) {\\n return \\\"0x00\\\";\\n }\\n uint256 temp = value;\\n uint256 length = 0;\\n while (temp != 0) {\\n length++;\\n temp >>= 8;\\n }\\n return toHexString(value, length);\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _HEX_SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n}\\n\",\"keccak256\":\"0x398d3323c1932a5986bf36be7c57593e121e69d5db5b6574b4ee0d031443de37\",\"license\":\"MIT\"},\"@openzeppelin/contracts-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\"},\"@openzeppelin/contracts-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\"},\"@openzeppelin/contracts-upgradeable/utils/structs/EnumerableSetUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (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 EnumerableSetUpgradeable {\\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\":\"0x0004699ba89fa356eb0d58d815b42dcf52eccd2765e95256631b838bce2556bc\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/ERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.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.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How\\n * to implement supply mechanisms].\\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 * The default value of {decimals} is 18. To select a different value for\\n * {decimals} you should overload it.\\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 value {ERC20} uses, unless this function is\\n * 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(\\n address from,\\n address to,\\n uint256 amount\\n ) 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, _allowances[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 = _allowances[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 `sender` to `recipient`.\\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(\\n address from,\\n address to,\\n uint256 amount\\n ) 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 }\\n _balances[to] += amount;\\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 _balances[account] += amount;\\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 }\\n _totalSupply -= amount;\\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(\\n address owner,\\n address spender,\\n uint256 amount\\n ) 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 Spend `amount` form the allowance of `owner` toward `spender`.\\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(\\n address owner,\\n address spender,\\n uint256 amount\\n ) 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(\\n address from,\\n address to,\\n uint256 amount\\n ) 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(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual {}\\n}\\n\",\"keccak256\":\"0xdadd41acb749920eccf40aeaa8d291adf9751399a7343561bad13e7a8d99be0b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n\\n /**\\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\":\"0xbbc8ac883ac3c0078ce5ad3e288fbb3ffcc8a30c3a98c0fda0114d64fc44fca2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x8de418a5503946cabe331f35fe242d3201a73f67f77aaeb7110acb1f30423aca\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\\n *\\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\\n * need to send a transaction, and thus is not required to hold Ether at all.\\n */\\ninterface IERC20Permit {\\n /**\\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\\n * given ``owner``'s signed approval.\\n *\\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\\n * ordering also apply here.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `deadline` must be a timestamp in the future.\\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\\n * over the EIP712-formatted function arguments.\\n * - the signature must use ``owner``'s current nonce (see {nonces}).\\n *\\n * For more information on the signature format, see the\\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\\n * section].\\n */\\n function permit(\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external;\\n\\n /**\\n * @dev Returns the current nonce for `owner`. This value must be\\n * included whenever a signature is generated for {permit}.\\n *\\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\\n * prevents a signature from being used multiple times.\\n */\\n function nonces(address owner) external view returns (uint256);\\n\\n /**\\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0xf41ca991f30855bf80ffd11e9347856a517b977f0a6c2d52e6421a99b7840329\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)\\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\":\"0xc3d946432c0ddbb1f846a0d3985be71299df331b91d06732152117f62f0be2b5\",\"license\":\"MIT\"},\"@openzeppelin/contracts/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\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"contracts/network/NetworkSettings.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport { EnumerableSetUpgradeable } from \\\"@openzeppelin/contracts-upgradeable/utils/structs/EnumerableSetUpgradeable.sol\\\";\\n\\nimport { IVersioned } from \\\"../utility/interfaces/IVersioned.sol\\\";\\nimport { Upgradeable } from \\\"../utility/Upgradeable.sol\\\";\\nimport { Utils, AlreadyExists, DoesNotExist, InvalidParam } from \\\"../utility/Utils.sol\\\";\\n\\nimport { Token } from \\\"../token/Token.sol\\\";\\nimport { TokenLibrary } from \\\"../token/TokenLibrary.sol\\\";\\n\\nimport { INetworkSettings, VortexRewards, NotWhitelisted } from \\\"./interfaces/INetworkSettings.sol\\\";\\n\\n/**\\n * @dev Network Settings contract\\n */\\ncontract NetworkSettings is INetworkSettings, Upgradeable, Utils {\\n using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet;\\n using TokenLibrary for Token;\\n\\n uint32 private constant DEFAULT_FLASH_LOAN_FEE_PPM = 0; // 0%\\n\\n struct FlashLoanFee {\\n bool initialized;\\n uint32 feePPM;\\n }\\n\\n // the address of the BNT token\\n IERC20 private immutable _bnt;\\n\\n // a set of tokens which are eligible for protection\\n EnumerableSetUpgradeable.AddressSet private _protectedTokenWhitelist;\\n\\n // a mapping of BNT funding limits per pool\\n mapping(Token => uint256) private _poolFundingLimits;\\n\\n // below that amount, trading is disabled and co-investments use the initial rate\\n uint256 private _minLiquidityForTrading;\\n\\n // DEPRECATED (uint32 private _networkFeePPM)\\n uint32 private _deprecated0;\\n\\n // the withdrawal fee (in units of PPM)\\n uint32 private _withdrawalFeePPM;\\n\\n // the default flash-loan fee (in units of PPM)\\n uint32 private _defaultFlashLoanFeePPM;\\n\\n // the settings of the Vortex\\n VortexRewards private _vortexRewards;\\n\\n // a mapping between pools and their flash-loan fees\\n mapping(Token => FlashLoanFee) private _flashLoanFees;\\n\\n // upgrade forward-compatibility storage gap\\n uint256[MAX_GAP - 8] private __gap;\\n\\n /**\\n * @dev triggered when a token is added to the protection whitelist\\n */\\n event TokenAddedToWhitelist(Token indexed token);\\n\\n /**\\n * @dev triggered when a token is removed from the protection whitelist\\n */\\n event TokenRemovedFromWhitelist(Token indexed token);\\n\\n /**\\n * @dev triggered when a per-pool funding limit is updated\\n */\\n event FundingLimitUpdated(Token indexed pool, uint256 prevLimit, uint256 newLimit);\\n\\n /**\\n * @dev triggered when the minimum liquidity for trading is updated\\n */\\n event MinLiquidityForTradingUpdated(uint256 prevLiquidity, uint256 newLiquidity);\\n\\n /**\\n * @dev triggered when the withdrawal fee is updated\\n */\\n event WithdrawalFeePPMUpdated(uint32 prevFeePPM, uint32 newFeePPM);\\n\\n /**\\n * @dev triggered when the settings of the Vortex are updated\\n */\\n event VortexBurnRewardUpdated(\\n uint32 prevBurnRewardPPM,\\n uint32 newBurnRewardPPM,\\n uint256 prevBurnRewardMaxAmount,\\n uint256 newBurnRewardMaxAmount\\n );\\n\\n /**\\n * @dev triggered when the default flash-loan fee is updated\\n */\\n event DefaultFlashLoanFeePPMUpdated(uint32 prevFeePPM, uint32 newFeePPM);\\n\\n /**\\n * @dev triggered when a specific pool's flash-loan fee is updated\\n */\\n event FlashLoanFeePPMUpdated(Token indexed pool, uint32 prevFeePPM, uint32 newFeePPM);\\n\\n constructor(IERC20 initBnt) validAddress(address(initBnt)) {\\n _bnt = initBnt;\\n }\\n\\n /**\\n * @dev fully initializes the contract and its parents\\n */\\n function initialize() external initializer {\\n __NetworkSettings_init();\\n }\\n\\n // solhint-disable func-name-mixedcase\\n\\n /**\\n * @dev initializes the contract and its parents\\n */\\n function __NetworkSettings_init() internal onlyInitializing {\\n __Upgradeable_init();\\n\\n __NetworkSettings_init_unchained();\\n }\\n\\n /**\\n * @dev performs contract-specific initialization\\n */\\n function __NetworkSettings_init_unchained() internal onlyInitializing {\\n _setDefaultFlashLoanFeePPM(DEFAULT_FLASH_LOAN_FEE_PPM);\\n }\\n\\n // solhint-enable func-name-mixedcase\\n\\n /**\\n * @inheritdoc Upgradeable\\n */\\n function version() public pure override(IVersioned, Upgradeable) returns (uint16) {\\n return 3;\\n }\\n\\n /**\\n * @inheritdoc INetworkSettings\\n */\\n function protectedTokenWhitelist() external view returns (Token[] memory) {\\n uint256 length = _protectedTokenWhitelist.length();\\n Token[] memory list = new Token[](length);\\n for (uint256 i = 0; i < length; i++) {\\n list[i] = Token(_protectedTokenWhitelist.at(i));\\n }\\n return list;\\n }\\n\\n /**\\n * @dev adds a token to the protected tokens whitelist\\n *\\n * requirements:\\n *\\n * - the caller must be the admin of the contract\\n */\\n function addTokenToWhitelist(Token token) external onlyAdmin {\\n _addTokenToWhitelist(token);\\n }\\n\\n /**\\n * @dev adds tokens to the protected tokens whitelist\\n *\\n * requirements:\\n *\\n * - the caller must be the admin of the contract\\n */\\n function addTokensToWhitelist(Token[] calldata tokens) external onlyAdmin {\\n uint256 length = tokens.length;\\n\\n for (uint256 i = 0; i < length; i++) {\\n _addTokenToWhitelist(tokens[i]);\\n }\\n }\\n\\n /**\\n * @dev adds a token to the protected tokens whitelist\\n */\\n function _addTokenToWhitelist(Token token) private validExternalAddress(address(token)) {\\n if (!_protectedTokenWhitelist.add(address(token))) {\\n revert AlreadyExists();\\n }\\n\\n emit TokenAddedToWhitelist({ token: token });\\n }\\n\\n /**\\n * @dev removes a token from the protected tokens whitelist\\n *\\n * requirements:\\n *\\n * - the caller must be the admin of the contract\\n */\\n function removeTokenFromWhitelist(Token token) external onlyAdmin {\\n if (!_protectedTokenWhitelist.remove(address(token))) {\\n revert DoesNotExist();\\n }\\n\\n emit TokenRemovedFromWhitelist({ token: token });\\n }\\n\\n /**\\n * @inheritdoc INetworkSettings\\n */\\n function isTokenWhitelisted(Token token) external view returns (bool) {\\n return _isTokenWhitelisted(token);\\n }\\n\\n /**\\n * @inheritdoc INetworkSettings\\n */\\n function poolFundingLimit(Token pool) external view returns (uint256) {\\n return _poolFundingLimits[pool];\\n }\\n\\n /**\\n * @dev updates the amount of BNT that the protocol can provide as funding for a specific pool\\n *\\n * requirements:\\n *\\n * - the caller must be the admin of the contract\\n * - the token must have been whitelisted\\n */\\n function setFundingLimit(Token pool, uint256 amount) external onlyAdmin {\\n _setFundingLimit(pool, amount);\\n }\\n\\n /**\\n * @dev updates the amounts of BNT that the protocol can provide as funding for specific pools\\n *\\n * requirements:\\n *\\n * - the caller must be the admin of the contract\\n * - each one of the tokens must have been whitelisted\\n */\\n function setFundingLimits(Token[] calldata pools, uint256[] calldata amounts) external onlyAdmin {\\n uint256 length = pools.length;\\n if (length != amounts.length) {\\n revert InvalidParam();\\n }\\n\\n for (uint256 i = 0; i < length; i++) {\\n _setFundingLimit(pools[i], amounts[i]);\\n }\\n }\\n\\n /**\\n * @dev updates the amount of BNT that the protocol can provide as funding for a specific pool\\n */\\n function _setFundingLimit(Token pool, uint256 amount) private validAddress(address(pool)) {\\n if (!_isTokenWhitelisted(pool)) {\\n revert NotWhitelisted();\\n }\\n\\n uint256 prevPoolFundingLimit = _poolFundingLimits[pool];\\n if (prevPoolFundingLimit == amount) {\\n return;\\n }\\n\\n _poolFundingLimits[pool] = amount;\\n\\n emit FundingLimitUpdated({ pool: pool, prevLimit: prevPoolFundingLimit, newLimit: amount });\\n }\\n\\n /**\\n * @dev adds a token to the protected tokens whitelist,\\n * and sets the amount of BNT that the protocol can provide as funding for this pool\\n *\\n * requirements:\\n *\\n * - the caller must be the admin of the contract\\n */\\n function addTokenToWhitelistWithLimit(Token token, uint256 amount) external onlyAdmin {\\n _addTokenToWhitelist(token);\\n _setFundingLimit(token, amount);\\n }\\n\\n /**\\n * @inheritdoc INetworkSettings\\n */\\n function minLiquidityForTrading() external view returns (uint256) {\\n return _minLiquidityForTrading;\\n }\\n\\n /**\\n * @dev updates the minimum liquidity for trading amount\\n *\\n * requirements:\\n *\\n * - the caller must be the admin of the contract\\n */\\n function setMinLiquidityForTrading(uint256 amount) external onlyAdmin {\\n uint256 prevMinLiquidityForTrading = _minLiquidityForTrading;\\n if (_minLiquidityForTrading == amount) {\\n return;\\n }\\n\\n _minLiquidityForTrading = amount;\\n\\n emit MinLiquidityForTradingUpdated({ prevLiquidity: prevMinLiquidityForTrading, newLiquidity: amount });\\n }\\n\\n /**\\n * @inheritdoc INetworkSettings\\n */\\n function withdrawalFeePPM() external view returns (uint32) {\\n return _withdrawalFeePPM;\\n }\\n\\n /**\\n * @dev sets the withdrawal fee (in units of PPM)\\n *\\n * requirements:\\n *\\n * - the caller must be the admin of the contract\\n */\\n function setWithdrawalFeePPM(uint32 newWithdrawalFeePPM) external onlyAdmin validFee(newWithdrawalFeePPM) {\\n uint32 prevWithdrawalFeePPM = _withdrawalFeePPM;\\n if (prevWithdrawalFeePPM == newWithdrawalFeePPM) {\\n return;\\n }\\n\\n _withdrawalFeePPM = newWithdrawalFeePPM;\\n\\n emit WithdrawalFeePPMUpdated({ prevFeePPM: prevWithdrawalFeePPM, newFeePPM: newWithdrawalFeePPM });\\n }\\n\\n /**\\n * @inheritdoc INetworkSettings\\n */\\n function defaultFlashLoanFeePPM() external view returns (uint32) {\\n return _defaultFlashLoanFeePPM;\\n }\\n\\n /**\\n * @dev sets the default flash-loan fee (in units of PPM)\\n *\\n * requirements:\\n *\\n * - the caller must be the admin of the contract\\n */\\n function setDefaultFlashLoanFeePPM(uint32 newDefaultFlashLoanFeePPM)\\n external\\n onlyAdmin\\n validFee(newDefaultFlashLoanFeePPM)\\n {\\n _setDefaultFlashLoanFeePPM(newDefaultFlashLoanFeePPM);\\n }\\n\\n /**\\n * @inheritdoc INetworkSettings\\n */\\n function flashLoanFeePPM(Token pool) external view returns (uint32) {\\n FlashLoanFee memory flashLoanFee = _flashLoanFees[pool];\\n\\n return flashLoanFee.initialized ? flashLoanFee.feePPM : _defaultFlashLoanFeePPM;\\n }\\n\\n /**\\n * @dev sets the flash-loan fee of a given pool\\n *\\n * requirements:\\n *\\n * - the caller must be the admin of the contract\\n * - the token must have been whitelisted\\n */\\n function setFlashLoanFeePPM(Token pool, uint32 newFlashLoanFeePPM) external onlyAdmin validFee(newFlashLoanFeePPM) {\\n if (!pool.isEqual(_bnt) && !_isTokenWhitelisted(pool)) {\\n revert NotWhitelisted();\\n }\\n\\n uint32 prevFlashLoanFeePPM = _flashLoanFees[pool].feePPM;\\n if (prevFlashLoanFeePPM == newFlashLoanFeePPM) {\\n return;\\n }\\n\\n _flashLoanFees[pool] = FlashLoanFee({ initialized: true, feePPM: newFlashLoanFeePPM });\\n\\n emit FlashLoanFeePPMUpdated({ pool: pool, prevFeePPM: prevFlashLoanFeePPM, newFeePPM: newFlashLoanFeePPM });\\n }\\n\\n /**\\n * @inheritdoc INetworkSettings\\n */\\n function vortexRewards() external view returns (VortexRewards memory) {\\n return _vortexRewards;\\n }\\n\\n /**\\n * @dev sets the settings of the Vortex\\n *\\n * requirements:\\n *s\\n * - the caller must be the admin of the contract\\n */\\n function setVortexRewards(VortexRewards calldata rewards)\\n external\\n onlyAdmin\\n validFee(rewards.burnRewardPPM)\\n greaterThanZero(rewards.burnRewardMaxAmount)\\n {\\n uint32 prevVortexBurnRewardPPM = _vortexRewards.burnRewardPPM;\\n uint256 prevVortexBurnRewardMaxAmount = _vortexRewards.burnRewardMaxAmount;\\n\\n if (\\n prevVortexBurnRewardPPM == rewards.burnRewardPPM &&\\n prevVortexBurnRewardMaxAmount == rewards.burnRewardMaxAmount\\n ) {\\n return;\\n }\\n\\n _vortexRewards = rewards;\\n\\n emit VortexBurnRewardUpdated({\\n prevBurnRewardPPM: prevVortexBurnRewardPPM,\\n newBurnRewardPPM: rewards.burnRewardPPM,\\n prevBurnRewardMaxAmount: prevVortexBurnRewardMaxAmount,\\n newBurnRewardMaxAmount: rewards.burnRewardMaxAmount\\n });\\n }\\n\\n /**\\n * @dev checks whether a given token is whitelisted\\n */\\n function _isTokenWhitelisted(Token token) private view returns (bool) {\\n return _protectedTokenWhitelist.contains(address(token));\\n }\\n\\n /**\\n * @dev sets the default flash-loan fee (in units of PPM)\\n */\\n function _setDefaultFlashLoanFeePPM(uint32 newDefaultFlashLoanFeePPM) private {\\n uint32 prevDefaultFlashLoanFeePPM = _defaultFlashLoanFeePPM;\\n if (prevDefaultFlashLoanFeePPM == newDefaultFlashLoanFeePPM) {\\n return;\\n }\\n\\n _defaultFlashLoanFeePPM = newDefaultFlashLoanFeePPM;\\n\\n emit DefaultFlashLoanFeePPMUpdated({\\n prevFeePPM: prevDefaultFlashLoanFeePPM,\\n newFeePPM: newDefaultFlashLoanFeePPM\\n });\\n }\\n}\\n\",\"keccak256\":\"0x4cb227342f600b7f2c8cde7f32dde070f0a7013b19199e92f851e076fe7a57ca\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/network/interfaces/INetworkSettings.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { IUpgradeable } from \\\"../../utility/interfaces/IUpgradeable.sol\\\";\\n\\nimport { Token } from \\\"../../token/Token.sol\\\";\\n\\nerror NotWhitelisted();\\n\\nstruct VortexRewards {\\n // the percentage of converted BNT to be sent to the initiator of the burning event (in units of PPM)\\n uint32 burnRewardPPM;\\n // the maximum burn reward to be sent to the initiator of the burning event\\n uint256 burnRewardMaxAmount;\\n}\\n\\n/**\\n * @dev Network Settings interface\\n */\\ninterface INetworkSettings is IUpgradeable {\\n /**\\n * @dev returns the protected tokens whitelist\\n */\\n function protectedTokenWhitelist() external view returns (Token[] memory);\\n\\n /**\\n * @dev checks whether a given token is whitelisted\\n */\\n function isTokenWhitelisted(Token pool) external view returns (bool);\\n\\n /**\\n * @dev returns the BNT funding limit for a given pool\\n */\\n function poolFundingLimit(Token pool) external view returns (uint256);\\n\\n /**\\n * @dev returns the minimum BNT trading liquidity required before the system enables trading in the relevant pool\\n */\\n function minLiquidityForTrading() external view returns (uint256);\\n\\n /**\\n * @dev returns the withdrawal fee (in units of PPM)\\n */\\n function withdrawalFeePPM() external view returns (uint32);\\n\\n /**\\n * @dev returns the default flash-loan fee (in units of PPM)\\n */\\n function defaultFlashLoanFeePPM() external view returns (uint32);\\n\\n /**\\n * @dev returns the flash-loan fee (in units of PPM) of a pool\\n */\\n function flashLoanFeePPM(Token pool) external view returns (uint32);\\n\\n /**\\n * @dev returns the vortex settings\\n */\\n function vortexRewards() external view returns (VortexRewards memory);\\n}\\n\",\"keccak256\":\"0x92ef678ce3b9dbb2ff12c2bfb59277456ed3e385260f860a81b920439c5252fe\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/token/SafeERC20Ex.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport { SafeERC20 } from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\n\\n/**\\n * @dev extends the SafeERC20 library with additional operations\\n */\\nlibrary SafeERC20Ex {\\n using SafeERC20 for IERC20;\\n\\n /**\\n * @dev ensures that the spender has sufficient allowance\\n */\\n function ensureApprove(\\n IERC20 token,\\n address spender,\\n uint256 amount\\n ) internal {\\n if (amount == 0) {\\n return;\\n }\\n\\n uint256 allowance = token.allowance(address(this), spender);\\n if (allowance >= amount) {\\n return;\\n }\\n\\n if (allowance > 0) {\\n token.safeApprove(spender, 0);\\n }\\n token.safeApprove(spender, amount);\\n }\\n}\\n\",\"keccak256\":\"0x95b96153e9cb88df354da4731b3b856158cf6794abdfaf635455e853044f7f98\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/token/Token.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\n/**\\n * @dev the main purpose of the Token interfaces is to ensure artificially that we won't use ERC20's standard functions,\\n * but only their safe versions, which are provided by SafeERC20 and SafeERC20Ex via the TokenLibrary contract\\n */\\ninterface Token {\\n\\n}\\n\",\"keccak256\":\"0x49d0e5ac0dab272f4001a63e7f4117eb13b42c655ee788c42a333f56f19ac2e9\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/token/TokenLibrary.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport { ERC20 } from \\\"@openzeppelin/contracts/token/ERC20/ERC20.sol\\\";\\nimport { SafeERC20 } from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\nimport { IERC20Permit } from \\\"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\\\";\\n\\nimport { SafeERC20Ex } from \\\"./SafeERC20Ex.sol\\\";\\n\\nimport { Token } from \\\"./Token.sol\\\";\\n\\n/**\\n * @dev This library implements ERC20 and SafeERC20 utilities for both the native token and for ERC20 tokens\\n */\\nlibrary TokenLibrary {\\n using SafeERC20 for IERC20;\\n using SafeERC20Ex for IERC20;\\n\\n error PermitUnsupported();\\n\\n // the address that represents the native token reserve\\n address private constant NATIVE_TOKEN_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\\n\\n // the symbol that represents the native token\\n string private constant NATIVE_TOKEN_SYMBOL = \\\"ETH\\\";\\n\\n // the decimals for the native token\\n uint8 private constant NATIVE_TOKEN_DECIMALS = 18;\\n\\n // the token representing the native token\\n Token public constant NATIVE_TOKEN = Token(NATIVE_TOKEN_ADDRESS);\\n\\n /**\\n * @dev returns whether the provided token represents an ERC20 or the native token reserve\\n */\\n function isNative(Token token) internal pure returns (bool) {\\n return address(token) == NATIVE_TOKEN_ADDRESS;\\n }\\n\\n /**\\n * @dev returns the symbol of the native token/ERC20 token\\n */\\n function symbol(Token token) internal view returns (string memory) {\\n if (isNative(token)) {\\n return NATIVE_TOKEN_SYMBOL;\\n }\\n\\n return toERC20(token).symbol();\\n }\\n\\n /**\\n * @dev returns the decimals of the native token/ERC20 token\\n */\\n function decimals(Token token) internal view returns (uint8) {\\n if (isNative(token)) {\\n return NATIVE_TOKEN_DECIMALS;\\n }\\n\\n return toERC20(token).decimals();\\n }\\n\\n /**\\n * @dev returns the balance of the native token/ERC20 token\\n */\\n function balanceOf(Token token, address account) internal view returns (uint256) {\\n if (isNative(token)) {\\n return account.balance;\\n }\\n\\n return toIERC20(token).balanceOf(account);\\n }\\n\\n /**\\n * @dev transfers a specific amount of the native token/ERC20 token\\n */\\n function safeTransfer(\\n Token token,\\n address to,\\n uint256 amount\\n ) internal {\\n if (amount == 0) {\\n return;\\n }\\n\\n if (isNative(token)) {\\n payable(to).transfer(amount);\\n } else {\\n toIERC20(token).safeTransfer(to, amount);\\n }\\n }\\n\\n /**\\n * @dev transfers a specific amount of the native token/ERC20 token from a specific holder using the allowance mechanism\\n *\\n * note that the function does not perform any action if the native token is provided\\n */\\n function safeTransferFrom(\\n Token token,\\n address from,\\n address to,\\n uint256 amount\\n ) internal {\\n if (amount == 0 || isNative(token)) {\\n return;\\n }\\n\\n toIERC20(token).safeTransferFrom(from, to, amount);\\n }\\n\\n /**\\n * @dev approves a specific amount of the native token/ERC20 token from a specific holder\\n *\\n * note that the function does not perform any action if the native token is provided\\n */\\n function safeApprove(\\n Token token,\\n address spender,\\n uint256 amount\\n ) internal {\\n if (isNative(token)) {\\n return;\\n }\\n\\n toIERC20(token).safeApprove(spender, amount);\\n }\\n\\n /**\\n * @dev ensures that the spender has sufficient allowance\\n *\\n * note that the function does not perform any action if the native token is provided\\n */\\n function ensureApprove(\\n Token token,\\n address spender,\\n uint256 amount\\n ) internal {\\n if (isNative(token)) {\\n return;\\n }\\n\\n toIERC20(token).ensureApprove(spender, amount);\\n }\\n\\n /**\\n * @dev compares between a token and another raw ERC20 token\\n */\\n function isEqual(Token token, IERC20 erc20Token) internal pure returns (bool) {\\n return toIERC20(token) == erc20Token;\\n }\\n\\n /**\\n * @dev utility function that converts a token to an IERC20\\n */\\n function toIERC20(Token token) internal pure returns (IERC20) {\\n return IERC20(address(token));\\n }\\n\\n /**\\n * @dev utility function that converts a token to an ERC20\\n */\\n function toERC20(Token token) internal pure returns (ERC20) {\\n return ERC20(address(token));\\n }\\n}\\n\",\"keccak256\":\"0x448f8af78045f8ad40977aa58c1bbdd0b89039931e4375702d12b054098b2a30\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/utility/Constants.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nuint32 constant PPM_RESOLUTION = 1_000_000;\\n\",\"keccak256\":\"0x5215535db0a4e580cd19380cc1cf3a2b7edcbb8ee039e416319fe9f8867724ad\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/utility/Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { AccessControlEnumerableUpgradeable } from \\\"@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol\\\";\\n\\nimport { IUpgradeable } from \\\"./interfaces/IUpgradeable.sol\\\";\\n\\nimport { AccessDenied } from \\\"./Utils.sol\\\";\\n\\n/**\\n * @dev this contract provides common utilities for upgradeable contracts\\n *\\n * note that we're using the Transparent Upgradeable Proxy pattern and *not* the Universal Upgradeable Proxy Standard\\n * (UUPS) pattern, therefore initializing the implementation contracts is not necessary or required\\n */\\nabstract contract Upgradeable is IUpgradeable, AccessControlEnumerableUpgradeable {\\n error AlreadyInitialized();\\n\\n // the admin role is used to allow a non-proxy admin to perform additional initialization/setup during contract\\n // upgrades\\n bytes32 internal constant ROLE_ADMIN = keccak256(\\\"ROLE_ADMIN\\\");\\n\\n uint32 internal constant MAX_GAP = 50;\\n\\n uint16 internal _initializations;\\n\\n // upgrade forward-compatibility storage gap\\n uint256[MAX_GAP - 1] private __gap;\\n\\n // solhint-disable func-name-mixedcase\\n\\n /**\\n * @dev initializes the contract and its parents\\n */\\n function __Upgradeable_init() internal onlyInitializing {\\n __AccessControl_init();\\n\\n __Upgradeable_init_unchained();\\n }\\n\\n /**\\n * @dev performs contract-specific initialization\\n */\\n function __Upgradeable_init_unchained() internal onlyInitializing {\\n _initializations = 1;\\n\\n // set up administrative roles\\n _setRoleAdmin(ROLE_ADMIN, ROLE_ADMIN);\\n\\n // allow the deployer to initially be the admin of the contract\\n _setupRole(ROLE_ADMIN, msg.sender);\\n }\\n\\n // solhint-enable func-name-mixedcase\\n\\n modifier onlyAdmin() {\\n _hasRole(ROLE_ADMIN, msg.sender);\\n\\n _;\\n }\\n\\n modifier onlyRoleMember(bytes32 role) {\\n _hasRole(role, msg.sender);\\n\\n _;\\n }\\n\\n function version() public view virtual override returns (uint16);\\n\\n /**\\n * @dev returns the admin role\\n */\\n function roleAdmin() external pure returns (bytes32) {\\n return ROLE_ADMIN;\\n }\\n\\n /**\\n * @dev performs post-upgrade initialization\\n *\\n * requirements:\\n *\\n * - this must can be called only once per-upgrade\\n */\\n function postUpgrade(bytes calldata data) external {\\n uint16 initializations = _initializations + 1;\\n\\n if (initializations != version()) {\\n revert AlreadyInitialized();\\n }\\n\\n _initializations = initializations;\\n\\n _postUpgrade(data);\\n }\\n\\n /**\\n * @dev an optional post-upgrade callback that can be implemented by child contracts\\n */\\n function _postUpgrade(\\n bytes calldata /* data */\\n ) internal virtual {}\\n\\n function _hasRole(bytes32 role, address account) internal view {\\n if (!hasRole(role, account)) {\\n revert AccessDenied();\\n }\\n }\\n}\\n\",\"keccak256\":\"0x833d60d73beb19731946979be28aa8a7dd3d9cb845106fcfb113efc089235272\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/utility/Utils.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { PPM_RESOLUTION } from \\\"./Constants.sol\\\";\\n\\nerror AccessDenied();\\nerror AlreadyExists();\\nerror DoesNotExist();\\nerror InvalidAddress();\\nerror InvalidExternalAddress();\\nerror InvalidFee();\\nerror InvalidPool();\\nerror InvalidPoolCollection();\\nerror InvalidStakedBalance();\\nerror InvalidToken();\\nerror InvalidParam();\\nerror NotEmpty();\\nerror NotPayable();\\nerror ZeroValue();\\n\\n/**\\n * @dev common utilities\\n */\\nabstract contract Utils {\\n // allows execution by the caller only\\n modifier only(address caller) {\\n _only(caller);\\n\\n _;\\n }\\n\\n function _only(address caller) internal view {\\n if (msg.sender != caller) {\\n revert AccessDenied();\\n }\\n }\\n\\n // verifies that a value is greater than zero\\n modifier greaterThanZero(uint256 value) {\\n _greaterThanZero(value);\\n\\n _;\\n }\\n\\n // error message binary size optimization\\n function _greaterThanZero(uint256 value) internal pure {\\n if (value == 0) {\\n revert ZeroValue();\\n }\\n }\\n\\n // validates an address - currently only checks that it isn't null\\n modifier validAddress(address addr) {\\n _validAddress(addr);\\n\\n _;\\n }\\n\\n // error message binary size optimization\\n function _validAddress(address addr) internal pure {\\n if (addr == address(0)) {\\n revert InvalidAddress();\\n }\\n }\\n\\n // validates an external address - currently only checks that it isn't null or this\\n modifier validExternalAddress(address addr) {\\n _validExternalAddress(addr);\\n\\n _;\\n }\\n\\n // error message binary size optimization\\n function _validExternalAddress(address addr) internal view {\\n if (addr == address(0) || addr == address(this)) {\\n revert InvalidExternalAddress();\\n }\\n }\\n\\n // ensures that the fee is valid\\n modifier validFee(uint32 fee) {\\n _validFee(fee);\\n\\n _;\\n }\\n\\n // error message binary size optimization\\n function _validFee(uint32 fee) internal pure {\\n if (fee > PPM_RESOLUTION) {\\n revert InvalidFee();\\n }\\n }\\n}\\n\",\"keccak256\":\"0x62b8b81d3069467eb6402b8f61adcc24f5b2e310db1a2ee64d719229306ab823\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/utility/interfaces/IUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { IVersioned } from \\\"./IVersioned.sol\\\";\\n\\nimport { IAccessControlEnumerableUpgradeable } from \\\"@openzeppelin/contracts-upgradeable/access/IAccessControlEnumerableUpgradeable.sol\\\";\\n\\n/**\\n * @dev this is the common interface for upgradeable contracts\\n */\\ninterface IUpgradeable is IAccessControlEnumerableUpgradeable, IVersioned {\\n\\n}\\n\",\"keccak256\":\"0x6019e5e9c706cc023b96313932f5aa7fc3734f446fd0936a2c6530d0d25330da\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/utility/interfaces/IVersioned.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\n/**\\n * @dev an interface for a versioned contract\\n */\\ninterface IVersioned {\\n function version() external view returns (uint16);\\n}\\n\",\"keccak256\":\"0x1969c895e9adc0bc8a85e975517d2f2b9357e0c9011f159d01b90f7d1a464d76\",\"license\":\"SEE LICENSE IN LICENSE\"}},\"version\":1}", - "bytecode": "0x60a06040523480156200001157600080fd5b5060405162001d7838038062001d7883398101604081905262000034916200007e565b80620000408162000053565b506001600160a01b0316608052620000b0565b6001600160a01b0381166200007b5760405163e6c4247b60e01b815260040160405180910390fd5b50565b6000602082840312156200009157600080fd5b81516001600160a01b0381168114620000a957600080fd5b9392505050565b608051611cac620000cc600039600061055d0152611cac6000f3fe608060405234801561001057600080fd5b50600436106101f05760003560e01c80637c36afad1161010f578063a217fddf116100a2578063cd9d26a511610071578063cd9d26a514610491578063d547741f146104a6578063d84c1b38146104b9578063fa617bf3146104cc57600080fd5b8063a217fddf14610450578063a83e3f0c14610458578063b5af090f1461046b578063ca15c8731461047e57600080fd5b80638cd2403d116100de5780638cd2403d146103eb5780639010d07c146103fe57806391d148541461042957806393867fb51461043c57600080fd5b80637c36afad146103b557806380cfdfc2146103c85780638129fc1c146103db57806387ba006a146103e357600080fd5b8063325bae6a11610187578063467e55df11610156578063467e55df146103575780634f712cff1461038057806354fd4d50146103935780635d46faa4146103a257600080fd5b8063325bae6a1461030957806336568abe1461031e5780633a1ec78d1461033157806343101a451461034457600080fd5b8063248a9ca3116101c3578063248a9ca31461028b5780632aac012c146102bc5780632f2ff15d146102e3578063306275be146102f657600080fd5b806301ffc9a7146101f557806305a4c0f71461021d5780630f1913631461026357806314da1add14610278575b600080fd5b610208610203366004611716565b6104df565b60405190151581526020015b60405180910390f35b6040805180820182526000808252602091820152815180830183526101005463ffffffff1680825261010154918301918252835190815290519181019190915201610214565b610276610271366004611752565b61050a565b005b610276610286366004611784565b610539565b6102ae6102993660046117bd565b60009081526065602052604090206001015490565b604051908152602001610214565b60ff54640100000000900463ffffffff165b60405163ffffffff9091168152602001610214565b6102766102f13660046117d6565b610692565b6102766103043660046117fb565b6106b8565b60ff54600160401b900463ffffffff166102ce565b61027661032c3660046117d6565b61072f565b61027661033f366004611818565b6107ae565b610276610352366004611830565b6108ac565b6102ae6103653660046117fb565b6001600160a01b0316600090815260fd602052604090205490565b61027661038e366004611752565b6108d7565b60405160038152602001610214565b6102766103b03660046118a8565b610982565b6102ce6103c33660046117fb565b610a28565b6102766103d6366004611914565b610a90565b610276610afb565b60fe546102ae565b6102766103f9366004611956565b610bbc565b61041161040c3660046119c8565b610c0d565b6040516001600160a01b039091168152602001610214565b6102086104373660046117d6565b610c25565b600080516020611c808339815191526102ae565b6102ae600081565b610276610466366004611830565b610c50565b6102086104793660046117fb565b610c68565b6102ae61048c3660046117bd565b610c73565b610499610c8a565b60405161021491906119ea565b6102766104b43660046117d6565b610d3a565b6102766104c73660046117fb565b610d60565b6102766104da3660046117bd565b610d81565b60006001600160e01b03198216635a05180f60e01b1480610504575061050482610dea565b92915050565b610522600080516020611c8083398151915233610e1f565b8061052c81610e46565b61053582610e70565b5050565b610551600080516020611c8083398151915233610e1f565b8061055b81610e46565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b039081169084161415801561059e575061059c83610ef2565b155b156105bc57604051630b094f2760e31b815260040160405180910390fd5b6001600160a01b0383166000908152610102602052604090205463ffffffff610100909104811690831681036105f25750505050565b6040805180820182526001815263ffffffff85811660208084018281526001600160a01b038a166000818152610102845287902095518654925164ffffffffff1990931690151564ffffffff0019161761010092861692909202919091179094558451928616835282015290917fe9b262e9376e7127d0246f98c1ab2e98fb430e73dcd665322ea46df0ce094af391015b60405180910390a2505b505050565b6000828152606560205260409020600101546106ae8133610eff565b61068d8383610f63565b6106d0600080516020611c8083398151915233610e1f565b6106db60fb82610f85565b6106f85760405163b0ce759160e01b815260040160405180910390fd5b6040516001600160a01b038216907fdd2e6d9f52cbe8f695939d018b7d4a216dc613a669876163ac548b916489d91790600090a250565b6001600160a01b03811633146107a45760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b6105358282610f9a565b6107c6600080516020611c8083398151915233610e1f565b6107d36020820182611752565b6107dc81610e46565b81602001356107ea81610fbc565b610100546101015463ffffffff909116906108086020860186611752565b63ffffffff168263ffffffff161480156108255750846020013581145b15610831575050505050565b8461010061083f8282611a37565b507fc0c001b93aede4379dd063acffffdf190292a31ccf86bbbf5399ab3480f3ebb19050826108716020880188611752565b6040805163ffffffff938416815292909116602083810191909152908201849052870135606082015260800160405180910390a15050505050565b6108c4600080516020611c8083398151915233610e1f565b6108cd82610fdd565b6105358282611047565b6108ef600080516020611c8083398151915233610e1f565b806108f981610e46565b60ff5463ffffffff6401000000009091048116908316810361091a57505050565b60ff805467ffffffff00000000191664010000000063ffffffff8681169182029290921790925560408051918416825260208201929092527f5694fc3b551ce2e4a457649f95500c545f27fce9ef7c3818cfb3c52134223dcb910160405180910390a1505050565b61099a600080516020611c8083398151915233610e1f565b828181146109bb57604051633494a40d60e21b815260040160405180910390fd5b60005b81811015610a2057610a0e8686838181106109db576109db611a64565b90506020020160208101906109f091906117fb565b858584818110610a0257610a02611a64565b90506020020135611047565b80610a1881611a90565b9150506109be565b505050505050565b6001600160a01b03811660009081526101026020908152604080832081518083019092525460ff8116151580835261010090910463ffffffff169282019290925290610a835760ff54600160401b900463ffffffff16610a89565b80602001515b9392505050565b610aa8600080516020611c8083398151915233610e1f565b8060005b81811015610af557610ae3848483818110610ac957610ac9611a64565b9050602002016020810190610ade91906117fb565b610fdd565b80610aed81611a90565b915050610aac565b50505050565b600054610100900460ff16610b165760005460ff1615610b1a565b303b155b610b7d5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161079b565b600054610100900460ff16158015610b9f576000805461ffff19166101011790555b610ba76110ef565b8015610bb9576000805461ff00191690555b50565b60c954600090610bd19061ffff166001611aa9565b905061ffff8116600314610bf75760405162dc149f60e41b815260040160405180910390fd5b60c9805461ffff191661ffff8316179055505050565b6000828152609760205260408120610a899083611128565b60009182526065602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6108cd600080516020611c8083398151915233610e1f565b600061050482610ef2565b600081815260976020526040812061050490611134565b60606000610c9860fb611134565b905060008167ffffffffffffffff811115610cb557610cb5611acf565b604051908082528060200260200182016040528015610cde578160200160208202803683370190505b50905060005b82811015610d3357610cf760fb82611128565b828281518110610d0957610d09611a64565b6001600160a01b039092166020928302919091019091015280610d2b81611a90565b915050610ce4565b5092915050565b600082815260656020526040902060010154610d568133610eff565b61068d8383610f9a565b610d78600080516020611c8083398151915233610e1f565b610bb981610fdd565b610d99600080516020611c8083398151915233610e1f565b60fe54818103610da7575050565b60fe82905560408051828152602081018490527fa331479cec90af3eef92e0ee6f6cd19f7912d7bb73f8d9885083d6ffa98b077291015b60405180910390a15050565b60006001600160e01b03198216637965db0b60e01b148061050457506301ffc9a760e01b6001600160e01b0319831614610504565b610e298282610c25565b61053557604051634ca8886760e01b815260040160405180910390fd5b620f424063ffffffff82161115610bb9576040516358d620b360e01b815260040160405180910390fd5b60ff5463ffffffff600160401b90910481169082168103610e8f575050565b60ff80546bffffffff00000000000000001916600160401b63ffffffff8581169182029290921790925560408051918416825260208201929092527f3150357e7ae28a36ec737b6b68396e3d6e6045739a37622ef936636add1831069101610dde565b600061050460fb8361113e565b610f098282610c25565b61053557610f21816001600160a01b03166014611160565b610f2c836020611160565b604051602001610f3d929190611b11565b60408051601f198184030181529082905262461bcd60e51b825261079b91600401611b86565b610f6d82826112fc565b600082815260976020526040902061068d9082611382565b6000610a89836001600160a01b038416611397565b610fa4828261148a565b600082815260976020526040902061068d9082610f85565b80600003610bb957604051637c946ed760e01b815260040160405180910390fd5b80610fe7816114f1565b610ff260fb83611382565b61100f5760405163119b4fd360e11b815260040160405180910390fd5b6040516001600160a01b038316907fa718ddb71589521cab00fa313e3bd14e75ca7204d57a12ff3a5aa40796f3427690600090a25050565b816110518161152d565b61105a83610ef2565b61107757604051630b094f2760e31b815260040160405180910390fd5b6001600160a01b038316600090815260fd602052604090205482810361109d5750505050565b6001600160a01b038416600081815260fd602090815260409182902086905581518481529081018690527f1a06df86f888ab7df8687a48f67c1ae98d193e315d76c842736d851adac8dda59101610683565b600054610100900460ff166111165760405162461bcd60e51b815260040161079b90611bb9565b61111e611554565b61112661158b565b565b6000610a8983836115bc565b6000610504825490565b6001600160a01b03811660009081526001830160205260408120541515610a89565b6060600061116f836002611c04565b61117a906002611c23565b67ffffffffffffffff81111561119257611192611acf565b6040519080825280601f01601f1916602001820160405280156111bc576020820181803683370190505b509050600360fc1b816000815181106111d7576111d7611a64565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061120657611206611a64565b60200101906001600160f81b031916908160001a905350600061122a846002611c04565b611235906001611c23565b90505b60018111156112ad576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061126957611269611a64565b1a60f81b82828151811061127f5761127f611a64565b60200101906001600160f81b031916908160001a90535060049490941c936112a681611c3b565b9050611238565b508315610a895760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161079b565b6113068282610c25565b6105355760008281526065602090815260408083206001600160a01b03851684529091529020805460ff1916600117905561133e3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000610a89836001600160a01b0384166115e6565b600081815260018301602052604081205480156114805760006113bb600183611c52565b85549091506000906113cf90600190611c52565b90508181146114345760008660000182815481106113ef576113ef611a64565b906000526020600020015490508087600001848154811061141257611412611a64565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061144557611445611c69565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610504565b6000915050610504565b6114948282610c25565b156105355760008281526065602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6001600160a01b038116158061150f57506001600160a01b03811630145b15610bb957604051638e052b6760e01b815260040160405180910390fd5b6001600160a01b038116610bb95760405163e6c4247b60e01b815260040160405180910390fd5b600054610100900460ff1661157b5760405162461bcd60e51b815260040161079b90611bb9565b611583611635565b61112661165c565b600054610100900460ff166115b25760405162461bcd60e51b815260040161079b90611bb9565b6111266000610e70565b60008260000182815481106115d3576115d3611a64565b9060005260206000200154905092915050565b600081815260018301602052604081205461162d57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610504565b506000610504565b600054610100900460ff166111265760405162461bcd60e51b815260040161079b90611bb9565b600054610100900460ff166116835760405162461bcd60e51b815260040161079b90611bb9565b60c9805461ffff191660011790556116a9600080516020611c80833981519152806116c1565b611126600080516020611c808339815191523361170c565b600082815260656020526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6105358282610f63565b60006020828403121561172857600080fd5b81356001600160e01b031981168114610a8957600080fd5b63ffffffff81168114610bb957600080fd5b60006020828403121561176457600080fd5b8135610a8981611740565b6001600160a01b0381168114610bb957600080fd5b6000806040838503121561179757600080fd5b82356117a28161176f565b915060208301356117b281611740565b809150509250929050565b6000602082840312156117cf57600080fd5b5035919050565b600080604083850312156117e957600080fd5b8235915060208301356117b28161176f565b60006020828403121561180d57600080fd5b8135610a898161176f565b60006040828403121561182a57600080fd5b50919050565b6000806040838503121561184357600080fd5b823561184e8161176f565b946020939093013593505050565b60008083601f84011261186e57600080fd5b50813567ffffffffffffffff81111561188657600080fd5b6020830191508360208260051b85010111156118a157600080fd5b9250929050565b600080600080604085870312156118be57600080fd5b843567ffffffffffffffff808211156118d657600080fd5b6118e28883890161185c565b909650945060208701359150808211156118fb57600080fd5b506119088782880161185c565b95989497509550505050565b6000806020838503121561192757600080fd5b823567ffffffffffffffff81111561193e57600080fd5b61194a8582860161185c565b90969095509350505050565b6000806020838503121561196957600080fd5b823567ffffffffffffffff8082111561198157600080fd5b818501915085601f83011261199557600080fd5b8135818111156119a457600080fd5b8660208285010111156119b657600080fd5b60209290920196919550909350505050565b600080604083850312156119db57600080fd5b50508035926020909101359150565b6020808252825182820181905260009190848201906040850190845b81811015611a2b5783516001600160a01b031683529284019291840191600101611a06565b50909695505050505050565b8135611a4281611740565b63ffffffff811663ffffffff1983541617825550602082013560018201555050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611aa257611aa2611a7a565b5060010190565b600061ffff808316818516808303821115611ac657611ac6611a7a565b01949350505050565b634e487b7160e01b600052604160045260246000fd5b60005b83811015611b00578181015183820152602001611ae8565b83811115610af55750506000910152565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611b49816017850160208801611ae5565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351611b7a816028840160208801611ae5565b01602801949350505050565b6020815260008251806020840152611ba5816040850160208701611ae5565b601f01601f19169190910160400192915050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6000816000190483118215151615611c1e57611c1e611a7a565b500290565b60008219821115611c3657611c36611a7a565b500190565b600081611c4a57611c4a611a7a565b506000190190565b600082821015611c6457611c64611a7a565b500390565b634e487b7160e01b600052603160045260246000fdfe2172861495e7b85edac73e3cd5fbb42dd675baadf627720e687bcfdaca025096a164736f6c634300080d000a", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101f05760003560e01c80637c36afad1161010f578063a217fddf116100a2578063cd9d26a511610071578063cd9d26a514610491578063d547741f146104a6578063d84c1b38146104b9578063fa617bf3146104cc57600080fd5b8063a217fddf14610450578063a83e3f0c14610458578063b5af090f1461046b578063ca15c8731461047e57600080fd5b80638cd2403d116100de5780638cd2403d146103eb5780639010d07c146103fe57806391d148541461042957806393867fb51461043c57600080fd5b80637c36afad146103b557806380cfdfc2146103c85780638129fc1c146103db57806387ba006a146103e357600080fd5b8063325bae6a11610187578063467e55df11610156578063467e55df146103575780634f712cff1461038057806354fd4d50146103935780635d46faa4146103a257600080fd5b8063325bae6a1461030957806336568abe1461031e5780633a1ec78d1461033157806343101a451461034457600080fd5b8063248a9ca3116101c3578063248a9ca31461028b5780632aac012c146102bc5780632f2ff15d146102e3578063306275be146102f657600080fd5b806301ffc9a7146101f557806305a4c0f71461021d5780630f1913631461026357806314da1add14610278575b600080fd5b610208610203366004611716565b6104df565b60405190151581526020015b60405180910390f35b6040805180820182526000808252602091820152815180830183526101005463ffffffff1680825261010154918301918252835190815290519181019190915201610214565b610276610271366004611752565b61050a565b005b610276610286366004611784565b610539565b6102ae6102993660046117bd565b60009081526065602052604090206001015490565b604051908152602001610214565b60ff54640100000000900463ffffffff165b60405163ffffffff9091168152602001610214565b6102766102f13660046117d6565b610692565b6102766103043660046117fb565b6106b8565b60ff54600160401b900463ffffffff166102ce565b61027661032c3660046117d6565b61072f565b61027661033f366004611818565b6107ae565b610276610352366004611830565b6108ac565b6102ae6103653660046117fb565b6001600160a01b0316600090815260fd602052604090205490565b61027661038e366004611752565b6108d7565b60405160038152602001610214565b6102766103b03660046118a8565b610982565b6102ce6103c33660046117fb565b610a28565b6102766103d6366004611914565b610a90565b610276610afb565b60fe546102ae565b6102766103f9366004611956565b610bbc565b61041161040c3660046119c8565b610c0d565b6040516001600160a01b039091168152602001610214565b6102086104373660046117d6565b610c25565b600080516020611c808339815191526102ae565b6102ae600081565b610276610466366004611830565b610c50565b6102086104793660046117fb565b610c68565b6102ae61048c3660046117bd565b610c73565b610499610c8a565b60405161021491906119ea565b6102766104b43660046117d6565b610d3a565b6102766104c73660046117fb565b610d60565b6102766104da3660046117bd565b610d81565b60006001600160e01b03198216635a05180f60e01b1480610504575061050482610dea565b92915050565b610522600080516020611c8083398151915233610e1f565b8061052c81610e46565b61053582610e70565b5050565b610551600080516020611c8083398151915233610e1f565b8061055b81610e46565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b039081169084161415801561059e575061059c83610ef2565b155b156105bc57604051630b094f2760e31b815260040160405180910390fd5b6001600160a01b0383166000908152610102602052604090205463ffffffff610100909104811690831681036105f25750505050565b6040805180820182526001815263ffffffff85811660208084018281526001600160a01b038a166000818152610102845287902095518654925164ffffffffff1990931690151564ffffffff0019161761010092861692909202919091179094558451928616835282015290917fe9b262e9376e7127d0246f98c1ab2e98fb430e73dcd665322ea46df0ce094af391015b60405180910390a2505b505050565b6000828152606560205260409020600101546106ae8133610eff565b61068d8383610f63565b6106d0600080516020611c8083398151915233610e1f565b6106db60fb82610f85565b6106f85760405163b0ce759160e01b815260040160405180910390fd5b6040516001600160a01b038216907fdd2e6d9f52cbe8f695939d018b7d4a216dc613a669876163ac548b916489d91790600090a250565b6001600160a01b03811633146107a45760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b6105358282610f9a565b6107c6600080516020611c8083398151915233610e1f565b6107d36020820182611752565b6107dc81610e46565b81602001356107ea81610fbc565b610100546101015463ffffffff909116906108086020860186611752565b63ffffffff168263ffffffff161480156108255750846020013581145b15610831575050505050565b8461010061083f8282611a37565b507fc0c001b93aede4379dd063acffffdf190292a31ccf86bbbf5399ab3480f3ebb19050826108716020880188611752565b6040805163ffffffff938416815292909116602083810191909152908201849052870135606082015260800160405180910390a15050505050565b6108c4600080516020611c8083398151915233610e1f565b6108cd82610fdd565b6105358282611047565b6108ef600080516020611c8083398151915233610e1f565b806108f981610e46565b60ff5463ffffffff6401000000009091048116908316810361091a57505050565b60ff805467ffffffff00000000191664010000000063ffffffff8681169182029290921790925560408051918416825260208201929092527f5694fc3b551ce2e4a457649f95500c545f27fce9ef7c3818cfb3c52134223dcb910160405180910390a1505050565b61099a600080516020611c8083398151915233610e1f565b828181146109bb57604051633494a40d60e21b815260040160405180910390fd5b60005b81811015610a2057610a0e8686838181106109db576109db611a64565b90506020020160208101906109f091906117fb565b858584818110610a0257610a02611a64565b90506020020135611047565b80610a1881611a90565b9150506109be565b505050505050565b6001600160a01b03811660009081526101026020908152604080832081518083019092525460ff8116151580835261010090910463ffffffff169282019290925290610a835760ff54600160401b900463ffffffff16610a89565b80602001515b9392505050565b610aa8600080516020611c8083398151915233610e1f565b8060005b81811015610af557610ae3848483818110610ac957610ac9611a64565b9050602002016020810190610ade91906117fb565b610fdd565b80610aed81611a90565b915050610aac565b50505050565b600054610100900460ff16610b165760005460ff1615610b1a565b303b155b610b7d5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161079b565b600054610100900460ff16158015610b9f576000805461ffff19166101011790555b610ba76110ef565b8015610bb9576000805461ff00191690555b50565b60c954600090610bd19061ffff166001611aa9565b905061ffff8116600314610bf75760405162dc149f60e41b815260040160405180910390fd5b60c9805461ffff191661ffff8316179055505050565b6000828152609760205260408120610a899083611128565b60009182526065602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6108cd600080516020611c8083398151915233610e1f565b600061050482610ef2565b600081815260976020526040812061050490611134565b60606000610c9860fb611134565b905060008167ffffffffffffffff811115610cb557610cb5611acf565b604051908082528060200260200182016040528015610cde578160200160208202803683370190505b50905060005b82811015610d3357610cf760fb82611128565b828281518110610d0957610d09611a64565b6001600160a01b039092166020928302919091019091015280610d2b81611a90565b915050610ce4565b5092915050565b600082815260656020526040902060010154610d568133610eff565b61068d8383610f9a565b610d78600080516020611c8083398151915233610e1f565b610bb981610fdd565b610d99600080516020611c8083398151915233610e1f565b60fe54818103610da7575050565b60fe82905560408051828152602081018490527fa331479cec90af3eef92e0ee6f6cd19f7912d7bb73f8d9885083d6ffa98b077291015b60405180910390a15050565b60006001600160e01b03198216637965db0b60e01b148061050457506301ffc9a760e01b6001600160e01b0319831614610504565b610e298282610c25565b61053557604051634ca8886760e01b815260040160405180910390fd5b620f424063ffffffff82161115610bb9576040516358d620b360e01b815260040160405180910390fd5b60ff5463ffffffff600160401b90910481169082168103610e8f575050565b60ff80546bffffffff00000000000000001916600160401b63ffffffff8581169182029290921790925560408051918416825260208201929092527f3150357e7ae28a36ec737b6b68396e3d6e6045739a37622ef936636add1831069101610dde565b600061050460fb8361113e565b610f098282610c25565b61053557610f21816001600160a01b03166014611160565b610f2c836020611160565b604051602001610f3d929190611b11565b60408051601f198184030181529082905262461bcd60e51b825261079b91600401611b86565b610f6d82826112fc565b600082815260976020526040902061068d9082611382565b6000610a89836001600160a01b038416611397565b610fa4828261148a565b600082815260976020526040902061068d9082610f85565b80600003610bb957604051637c946ed760e01b815260040160405180910390fd5b80610fe7816114f1565b610ff260fb83611382565b61100f5760405163119b4fd360e11b815260040160405180910390fd5b6040516001600160a01b038316907fa718ddb71589521cab00fa313e3bd14e75ca7204d57a12ff3a5aa40796f3427690600090a25050565b816110518161152d565b61105a83610ef2565b61107757604051630b094f2760e31b815260040160405180910390fd5b6001600160a01b038316600090815260fd602052604090205482810361109d5750505050565b6001600160a01b038416600081815260fd602090815260409182902086905581518481529081018690527f1a06df86f888ab7df8687a48f67c1ae98d193e315d76c842736d851adac8dda59101610683565b600054610100900460ff166111165760405162461bcd60e51b815260040161079b90611bb9565b61111e611554565b61112661158b565b565b6000610a8983836115bc565b6000610504825490565b6001600160a01b03811660009081526001830160205260408120541515610a89565b6060600061116f836002611c04565b61117a906002611c23565b67ffffffffffffffff81111561119257611192611acf565b6040519080825280601f01601f1916602001820160405280156111bc576020820181803683370190505b509050600360fc1b816000815181106111d7576111d7611a64565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061120657611206611a64565b60200101906001600160f81b031916908160001a905350600061122a846002611c04565b611235906001611c23565b90505b60018111156112ad576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061126957611269611a64565b1a60f81b82828151811061127f5761127f611a64565b60200101906001600160f81b031916908160001a90535060049490941c936112a681611c3b565b9050611238565b508315610a895760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161079b565b6113068282610c25565b6105355760008281526065602090815260408083206001600160a01b03851684529091529020805460ff1916600117905561133e3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000610a89836001600160a01b0384166115e6565b600081815260018301602052604081205480156114805760006113bb600183611c52565b85549091506000906113cf90600190611c52565b90508181146114345760008660000182815481106113ef576113ef611a64565b906000526020600020015490508087600001848154811061141257611412611a64565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061144557611445611c69565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610504565b6000915050610504565b6114948282610c25565b156105355760008281526065602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6001600160a01b038116158061150f57506001600160a01b03811630145b15610bb957604051638e052b6760e01b815260040160405180910390fd5b6001600160a01b038116610bb95760405163e6c4247b60e01b815260040160405180910390fd5b600054610100900460ff1661157b5760405162461bcd60e51b815260040161079b90611bb9565b611583611635565b61112661165c565b600054610100900460ff166115b25760405162461bcd60e51b815260040161079b90611bb9565b6111266000610e70565b60008260000182815481106115d3576115d3611a64565b9060005260206000200154905092915050565b600081815260018301602052604081205461162d57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610504565b506000610504565b600054610100900460ff166111265760405162461bcd60e51b815260040161079b90611bb9565b600054610100900460ff166116835760405162461bcd60e51b815260040161079b90611bb9565b60c9805461ffff191660011790556116a9600080516020611c80833981519152806116c1565b611126600080516020611c808339815191523361170c565b600082815260656020526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6105358282610f63565b60006020828403121561172857600080fd5b81356001600160e01b031981168114610a8957600080fd5b63ffffffff81168114610bb957600080fd5b60006020828403121561176457600080fd5b8135610a8981611740565b6001600160a01b0381168114610bb957600080fd5b6000806040838503121561179757600080fd5b82356117a28161176f565b915060208301356117b281611740565b809150509250929050565b6000602082840312156117cf57600080fd5b5035919050565b600080604083850312156117e957600080fd5b8235915060208301356117b28161176f565b60006020828403121561180d57600080fd5b8135610a898161176f565b60006040828403121561182a57600080fd5b50919050565b6000806040838503121561184357600080fd5b823561184e8161176f565b946020939093013593505050565b60008083601f84011261186e57600080fd5b50813567ffffffffffffffff81111561188657600080fd5b6020830191508360208260051b85010111156118a157600080fd5b9250929050565b600080600080604085870312156118be57600080fd5b843567ffffffffffffffff808211156118d657600080fd5b6118e28883890161185c565b909650945060208701359150808211156118fb57600080fd5b506119088782880161185c565b95989497509550505050565b6000806020838503121561192757600080fd5b823567ffffffffffffffff81111561193e57600080fd5b61194a8582860161185c565b90969095509350505050565b6000806020838503121561196957600080fd5b823567ffffffffffffffff8082111561198157600080fd5b818501915085601f83011261199557600080fd5b8135818111156119a457600080fd5b8660208285010111156119b657600080fd5b60209290920196919550909350505050565b600080604083850312156119db57600080fd5b50508035926020909101359150565b6020808252825182820181905260009190848201906040850190845b81811015611a2b5783516001600160a01b031683529284019291840191600101611a06565b50909695505050505050565b8135611a4281611740565b63ffffffff811663ffffffff1983541617825550602082013560018201555050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611aa257611aa2611a7a565b5060010190565b600061ffff808316818516808303821115611ac657611ac6611a7a565b01949350505050565b634e487b7160e01b600052604160045260246000fd5b60005b83811015611b00578181015183820152602001611ae8565b83811115610af55750506000910152565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611b49816017850160208801611ae5565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351611b7a816028840160208801611ae5565b01602801949350505050565b6020815260008251806020840152611ba5816040850160208701611ae5565b601f01601f19169190910160400192915050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6000816000190483118215151615611c1e57611c1e611a7a565b500290565b60008219821115611c3657611c36611a7a565b500190565b600081611c4a57611c4a611a7a565b506000190190565b600082821015611c6457611c64611a7a565b500390565b634e487b7160e01b600052603160045260246000fdfe2172861495e7b85edac73e3cd5fbb42dd675baadf627720e687bcfdaca025096a164736f6c634300080d000a", + "numDeployments": 4, + "solcInputHash": "4a12fa84003cd14a8d58a795b8fd43b8", + "metadata": "{\"compiler\":{\"version\":\"0.8.13+commit.abaa5c0e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"initBnt\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AccessDenied\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AlreadyExists\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AlreadyInitialized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DoesNotExist\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidExternalAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidFee\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidParam\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotWhitelisted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroValue\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"prevFeePPM\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"newFeePPM\",\"type\":\"uint32\"}],\"name\":\"DefaultFlashLoanFeePPMUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract Token\",\"name\":\"pool\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"prevFeePPM\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"newFeePPM\",\"type\":\"uint32\"}],\"name\":\"FlashLoanFeePPMUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract Token\",\"name\":\"pool\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"prevLimit\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newLimit\",\"type\":\"uint256\"}],\"name\":\"FundingLimitUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"prevLiquidity\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newLiquidity\",\"type\":\"uint256\"}],\"name\":\"MinLiquidityForTradingUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"previousAdminRole\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"newAdminRole\",\"type\":\"bytes32\"}],\"name\":\"RoleAdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleGranted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract Token\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"TokenAddedToWhitelist\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract Token\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"TokenAddedToWhitelistForPOL\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract Token\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"TokenRemovedFromWhitelist\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract Token\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"TokenRemovedFromWhitelistForPOL\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"prevBurnRewardPPM\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"newBurnRewardPPM\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"prevBurnRewardMaxAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newBurnRewardMaxAmount\",\"type\":\"uint256\"}],\"name\":\"VortexBurnRewardUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"prevFeePPM\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"newFeePPM\",\"type\":\"uint32\"}],\"name\":\"WithdrawalFeePPMUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DEFAULT_ADMIN_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"addTokenToWhitelist\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"addTokenToWhitelistForPOL\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"addTokenToWhitelistWithLimit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token[]\",\"name\":\"tokens\",\"type\":\"address[]\"}],\"name\":\"addTokensToWhitelist\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token[]\",\"name\":\"tokens\",\"type\":\"address[]\"}],\"name\":\"addTokensToWhitelistForPOL\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"defaultFlashLoanFeePPM\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"flashLoanFeePPM\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleAdmin\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"getRoleMember\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleMemberCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"grantRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"hasRole\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"isTokenWhitelisted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"isTokenWhitelistedForPOL\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"minLiquidityForTrading\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"poolFundingLimit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"postUpgrade\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"protectedTokenWhitelist\",\"outputs\":[{\"internalType\":\"contract Token[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"removeTokenFromWhitelist\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"removeTokenFromWhitelistForPOL\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"renounceRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"revokeRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"roleAdmin\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"newDefaultFlashLoanFeePPM\",\"type\":\"uint32\"}],\"name\":\"setDefaultFlashLoanFeePPM\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"pool\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"newFlashLoanFeePPM\",\"type\":\"uint32\"}],\"name\":\"setFlashLoanFeePPM\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"pool\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"setFundingLimit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token[]\",\"name\":\"pools\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"}],\"name\":\"setFundingLimits\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"setMinLiquidityForTrading\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"burnRewardPPM\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"burnRewardMaxAmount\",\"type\":\"uint256\"}],\"internalType\":\"struct VortexRewards\",\"name\":\"rewards\",\"type\":\"tuple\"}],\"name\":\"setVortexRewards\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"newWithdrawalFeePPM\",\"type\":\"uint32\"}],\"name\":\"setWithdrawalFeePPM\",\"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\":\"tokenWhitelistForPOL\",\"outputs\":[{\"internalType\":\"contract Token[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vortexRewards\",\"outputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"burnRewardPPM\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"burnRewardMaxAmount\",\"type\":\"uint256\"}],\"internalType\":\"struct VortexRewards\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"withdrawalFeePPM\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"Network Settings contract\",\"events\":{\"DefaultFlashLoanFeePPMUpdated(uint32,uint32)\":{\"details\":\"triggered when the default flash-loan fee is updated\"},\"FlashLoanFeePPMUpdated(address,uint32,uint32)\":{\"details\":\"triggered when a specific pool's flash-loan fee is updated\"},\"FundingLimitUpdated(address,uint256,uint256)\":{\"details\":\"triggered when a per-pool funding limit is updated\"},\"MinLiquidityForTradingUpdated(uint256,uint256)\":{\"details\":\"triggered when the minimum liquidity for trading is updated\"},\"TokenAddedToWhitelist(address)\":{\"details\":\"triggered when a token is added to the protection whitelist\"},\"TokenAddedToWhitelistForPOL(address)\":{\"details\":\"triggered when a token is added to the whitelist for POL\"},\"TokenRemovedFromWhitelist(address)\":{\"details\":\"triggered when a token is removed from the protection whitelist\"},\"TokenRemovedFromWhitelistForPOL(address)\":{\"details\":\"triggered when a token is removed from the whitelist for POL\"},\"VortexBurnRewardUpdated(uint32,uint32,uint256,uint256)\":{\"details\":\"triggered when the settings of the Vortex are updated\"},\"WithdrawalFeePPMUpdated(uint32,uint32)\":{\"details\":\"triggered when the withdrawal fee is updated\"}},\"kind\":\"dev\",\"methods\":{\"addTokenToWhitelist(address)\":{\"details\":\"adds a token to the protected tokens whitelist requirements: - the caller must be the admin of the contract\"},\"addTokenToWhitelistForPOL(address)\":{\"details\":\"adds a token to the tokens whitelist for POL requirements: - the caller must be the admin of the contract\"},\"addTokenToWhitelistWithLimit(address,uint256)\":{\"details\":\"adds a token to the protected tokens whitelist, and sets the amount of BNT that the protocol can provide as funding for this pool requirements: - the caller must be the admin of the contract\"},\"addTokensToWhitelist(address[])\":{\"details\":\"adds tokens to the protected tokens whitelist requirements: - the caller must be the admin of the contract\"},\"addTokensToWhitelistForPOL(address[])\":{\"details\":\"adds tokens to the tokens whitelist for POL requirements: - the caller must be the admin of the contract\"},\"defaultFlashLoanFeePPM()\":{\"details\":\"returns the default flash-loan fee (in units of PPM)\"},\"flashLoanFeePPM(address)\":{\"details\":\"returns the flash-loan fee (in units of PPM) of a pool\"},\"getRoleAdmin(bytes32)\":{\"details\":\"Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.\"},\"getRoleMember(bytes32,uint256)\":{\"details\":\"Returns one of the accounts that have `role`. `index` must be a value between 0 and {getRoleMemberCount}, non-inclusive. Role bearers are not sorted in any particular way, and their ordering may change at any point. WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure you perform all queries on the same block. See the following https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] for more information.\"},\"getRoleMemberCount(bytes32)\":{\"details\":\"Returns the number of accounts that have `role`. Can be used together with {getRoleMember} to enumerate all bearers of a role.\"},\"grantRole(bytes32,address)\":{\"details\":\"Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role.\"},\"hasRole(bytes32,address)\":{\"details\":\"Returns `true` if `account` has been granted `role`.\"},\"initialize()\":{\"details\":\"fully initializes the contract and its parents\"},\"isTokenWhitelisted(address)\":{\"details\":\"checks whether a given token is whitelisted\"},\"isTokenWhitelistedForPOL(address)\":{\"details\":\"checks whether a given token is whitelist for POL\"},\"minLiquidityForTrading()\":{\"details\":\"returns the minimum BNT trading liquidity required before the system enables trading in the relevant pool\"},\"poolFundingLimit(address)\":{\"details\":\"returns the BNT funding limit for a given pool\"},\"postUpgrade(bytes)\":{\"details\":\"performs post-upgrade initialization requirements: - this must can be called only once per-upgrade\"},\"protectedTokenWhitelist()\":{\"details\":\"returns the protected tokens whitelist\"},\"removeTokenFromWhitelist(address)\":{\"details\":\"removes a token from the protected tokens whitelist requirements: - the caller must be the admin of the contract\"},\"removeTokenFromWhitelistForPOL(address)\":{\"details\":\"removes a token from the tokens whitelist for POL requirements: - the caller must be the admin of the contract\"},\"renounceRole(bytes32,address)\":{\"details\":\"Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `account`.\"},\"revokeRole(bytes32,address)\":{\"details\":\"Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role.\"},\"roleAdmin()\":{\"details\":\"returns the admin role\"},\"setDefaultFlashLoanFeePPM(uint32)\":{\"details\":\"sets the default flash-loan fee (in units of PPM) requirements: - the caller must be the admin of the contract\"},\"setFlashLoanFeePPM(address,uint32)\":{\"details\":\"sets the flash-loan fee of a given pool requirements: - the caller must be the admin of the contract - the token must have been whitelisted\"},\"setFundingLimit(address,uint256)\":{\"details\":\"updates the amount of BNT that the protocol can provide as funding for a specific pool requirements: - the caller must be the admin of the contract - the token must have been whitelisted\"},\"setFundingLimits(address[],uint256[])\":{\"details\":\"updates the amounts of BNT that the protocol can provide as funding for specific pools requirements: - the caller must be the admin of the contract - each one of the tokens must have been whitelisted\"},\"setMinLiquidityForTrading(uint256)\":{\"details\":\"updates the minimum liquidity for trading amount requirements: - the caller must be the admin of the contract\"},\"setVortexRewards((uint32,uint256))\":{\"details\":\"sets the settings of the Vortex requirements: s - the caller must be the admin of the contract\"},\"setWithdrawalFeePPM(uint32)\":{\"details\":\"sets the withdrawal fee (in units of PPM) requirements: - the caller must be the admin of the contract\"},\"supportsInterface(bytes4)\":{\"details\":\"See {IERC165-supportsInterface}.\"},\"tokenWhitelistForPOL()\":{\"details\":\"returns the tokens whitelist for POL\"},\"vortexRewards()\":{\"details\":\"returns the vortex settings\"},\"withdrawalFeePPM()\":{\"details\":\"returns the withdrawal fee (in units of PPM)\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/network/NetworkSettings.sol\":\"NetworkSettings\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"none\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControlEnumerable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IAccessControlEnumerableUpgradeable.sol\\\";\\nimport \\\"./AccessControlUpgradeable.sol\\\";\\nimport \\\"../utils/structs/EnumerableSetUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Extension of {AccessControl} that allows enumerating the members of each role.\\n */\\nabstract contract AccessControlEnumerableUpgradeable is Initializable, IAccessControlEnumerableUpgradeable, AccessControlUpgradeable {\\n function __AccessControlEnumerable_init() internal onlyInitializing {\\n }\\n\\n function __AccessControlEnumerable_init_unchained() internal onlyInitializing {\\n }\\n using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet;\\n\\n mapping(bytes32 => EnumerableSetUpgradeable.AddressSet) private _roleMembers;\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IAccessControlEnumerableUpgradeable).interfaceId || super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev Returns one of the accounts that have `role`. `index` must be a\\n * value between 0 and {getRoleMemberCount}, non-inclusive.\\n *\\n * Role bearers are not sorted in any particular way, and their ordering may\\n * change at any point.\\n *\\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\\n * you perform all queries on the same block. See the following\\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\\n * for more information.\\n */\\n function getRoleMember(bytes32 role, uint256 index) public view virtual override returns (address) {\\n return _roleMembers[role].at(index);\\n }\\n\\n /**\\n * @dev Returns the number of accounts that have `role`. Can be used\\n * together with {getRoleMember} to enumerate all bearers of a role.\\n */\\n function getRoleMemberCount(bytes32 role) public view virtual override returns (uint256) {\\n return _roleMembers[role].length();\\n }\\n\\n /**\\n * @dev Overload {_grantRole} to track enumerable memberships\\n */\\n function _grantRole(bytes32 role, address account) internal virtual override {\\n super._grantRole(role, account);\\n _roleMembers[role].add(account);\\n }\\n\\n /**\\n * @dev Overload {_revokeRole} to track enumerable memberships\\n */\\n function _revokeRole(bytes32 role, address account) internal virtual override {\\n super._revokeRole(role, account);\\n _roleMembers[role].remove(account);\\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\":\"0xc2dfd6ba9449f61b6b03b262182faf302f093a8c05dd10792aeecb4ed1663c0c\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IAccessControlUpgradeable.sol\\\";\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../utils/StringsUpgradeable.sol\\\";\\nimport \\\"../utils/introspection/ERC165Upgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module that allows children to implement role-based access\\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\\n * members except through off-chain means by accessing the contract event logs. Some\\n * applications may benefit from on-chain enumerability, for those cases see\\n * {AccessControlEnumerable}.\\n *\\n * Roles are referred to by their `bytes32` identifier. These should be exposed\\n * in the external API and be unique. The best way to achieve this is by\\n * using `public constant` hash digests:\\n *\\n * ```\\n * bytes32 public constant MY_ROLE = keccak256(\\\"MY_ROLE\\\");\\n * ```\\n *\\n * Roles can be used to represent a set of permissions. To restrict access to a\\n * function call, use {hasRole}:\\n *\\n * ```\\n * function foo() public {\\n * require(hasRole(MY_ROLE, msg.sender));\\n * ...\\n * }\\n * ```\\n *\\n * Roles can be granted and revoked dynamically via the {grantRole} and\\n * {revokeRole} functions. Each role has an associated admin role, and only\\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\\n *\\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\\n * that only accounts with this role will be able to grant or revoke other\\n * roles. More complex role relationships can be created by using\\n * {_setRoleAdmin}.\\n *\\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\\n * grant and revoke this role. Extra precautions should be taken to secure\\n * accounts that have been granted it.\\n */\\nabstract contract AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControlUpgradeable, ERC165Upgradeable {\\n function __AccessControl_init() internal onlyInitializing {\\n }\\n\\n function __AccessControl_init_unchained() internal onlyInitializing {\\n }\\n struct RoleData {\\n mapping(address => bool) members;\\n bytes32 adminRole;\\n }\\n\\n mapping(bytes32 => RoleData) private _roles;\\n\\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\\n\\n /**\\n * @dev Modifier that checks that an account has a specific role. Reverts\\n * with a standardized message including the required role.\\n *\\n * The format of the revert reason is given by the following regular expression:\\n *\\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\\n *\\n * _Available since v4.1._\\n */\\n modifier onlyRole(bytes32 role) {\\n _checkRole(role, _msgSender());\\n _;\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IAccessControlUpgradeable).interfaceId || super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) public view virtual override returns (bool) {\\n return _roles[role].members[account];\\n }\\n\\n /**\\n * @dev Revert with a standard message if `account` is missing `role`.\\n *\\n * The format of the revert reason is given by the following regular expression:\\n *\\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\\n */\\n function _checkRole(bytes32 role, address account) internal view virtual {\\n if (!hasRole(role, account)) {\\n revert(\\n string(\\n abi.encodePacked(\\n \\\"AccessControl: account \\\",\\n StringsUpgradeable.toHexString(uint160(account), 20),\\n \\\" is missing role \\\",\\n StringsUpgradeable.toHexString(uint256(role), 32)\\n )\\n )\\n );\\n }\\n }\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {\\n return _roles[role].adminRole;\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\\n _grantRole(role, account);\\n }\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\\n _revokeRole(role, account);\\n }\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n */\\n function renounceRole(bytes32 role, address account) public virtual override {\\n require(account == _msgSender(), \\\"AccessControl: can only renounce roles for self\\\");\\n\\n _revokeRole(role, account);\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event. Note that unlike {grantRole}, this function doesn't perform any\\n * checks on the calling account.\\n *\\n * [WARNING]\\n * ====\\n * This function should only be called from the constructor when setting\\n * up the initial roles for the system.\\n *\\n * Using this function in any other way is effectively circumventing the admin\\n * system imposed by {AccessControl}.\\n * ====\\n *\\n * NOTE: This function is deprecated in favor of {_grantRole}.\\n */\\n function _setupRole(bytes32 role, address account) internal virtual {\\n _grantRole(role, account);\\n }\\n\\n /**\\n * @dev Sets `adminRole` as ``role``'s admin role.\\n *\\n * Emits a {RoleAdminChanged} event.\\n */\\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\\n bytes32 previousAdminRole = getRoleAdmin(role);\\n _roles[role].adminRole = adminRole;\\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * Internal function without access restriction.\\n */\\n function _grantRole(bytes32 role, address account) internal virtual {\\n if (!hasRole(role, account)) {\\n _roles[role].members[account] = true;\\n emit RoleGranted(role, account, _msgSender());\\n }\\n }\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * Internal function without access restriction.\\n */\\n function _revokeRole(bytes32 role, address account) internal virtual {\\n if (hasRole(role, account)) {\\n _roles[role].members[account] = false;\\n emit RoleRevoked(role, account, _msgSender());\\n }\\n }\\n\\n /**\\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\":\"0x2ffe9655abbb3741fcb84ad10e2f628d5dbec46b3f84a69ceec4752e807e2757\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/access/IAccessControlEnumerableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IAccessControlUpgradeable.sol\\\";\\n\\n/**\\n * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.\\n */\\ninterface IAccessControlEnumerableUpgradeable is IAccessControlUpgradeable {\\n /**\\n * @dev Returns one of the accounts that have `role`. `index` must be a\\n * value between 0 and {getRoleMemberCount}, non-inclusive.\\n *\\n * Role bearers are not sorted in any particular way, and their ordering may\\n * change at any point.\\n *\\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\\n * you perform all queries on the same block. See the following\\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\\n * for more information.\\n */\\n function getRoleMember(bytes32 role, uint256 index) external view returns (address);\\n\\n /**\\n * @dev Returns the number of accounts that have `role`. Can be used\\n * together with {getRoleMember} to enumerate all bearers of a role.\\n */\\n function getRoleMemberCount(bytes32 role) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x7acbc538aad6eb4614e26612a8c5c0149bb8808db95e2638d245a8365f63e572\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/access/IAccessControlUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev External interface of AccessControl declared to support ERC165 detection.\\n */\\ninterface IAccessControlUpgradeable {\\n /**\\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\\n *\\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\\n * {RoleAdminChanged} not being emitted signaling this.\\n *\\n * _Available since v3.1._\\n */\\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\\n\\n /**\\n * @dev Emitted when `account` is granted `role`.\\n *\\n * `sender` is the account that originated the contract call, an admin role\\n * bearer except when using {AccessControl-_setupRole}.\\n */\\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Emitted when `account` is revoked `role`.\\n *\\n * `sender` is the account that originated the contract call:\\n * - if using `revokeRole`, it is the admin role bearer\\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\\n */\\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) external view returns (bool);\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function grantRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function revokeRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been granted `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n */\\n function renounceRole(bytes32 role, address account) external;\\n}\\n\",\"keccak256\":\"0xb8f5302f12138c5561362e88a78d061573e6298b7a1a5afe84a1e2c8d4d5aeaa\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.0;\\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 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the\\n * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() initializer {}\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n */\\n bool private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Modifier to protect an initializer function from being invoked twice.\\n */\\n modifier initializer() {\\n // If the contract is initializing we ignore whether _initialized is set in order to support multiple\\n // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the\\n // contract may have been reentered.\\n require(_initializing ? _isConstructor() : !_initialized, \\\"Initializable: contract is already initialized\\\");\\n\\n bool isTopLevelCall = !_initializing;\\n if (isTopLevelCall) {\\n _initializing = true;\\n _initialized = true;\\n }\\n\\n _;\\n\\n if (isTopLevelCall) {\\n _initializing = false;\\n }\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} modifier, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n function _isConstructor() private view returns (bool) {\\n return !AddressUpgradeable.isContract(address(this));\\n }\\n}\\n\",\"keccak256\":\"0x372b0bc04e3b4c074559bbbfb1317afddb56de5504158ca25a7f9cd403980445\",\"license\":\"MIT\"},\"@openzeppelin/contracts-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\"},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract ContextUpgradeable is Initializable {\\n function __Context_init() internal onlyInitializing {\\n }\\n\\n function __Context_init_unchained() internal onlyInitializing {\\n }\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary StringsUpgradeable {\\n bytes16 private constant _HEX_SYMBOLS = \\\"0123456789abcdef\\\";\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n // Inspired by OraclizeAPI's implementation - MIT licence\\n // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol\\n\\n if (value == 0) {\\n return \\\"0\\\";\\n }\\n uint256 temp = value;\\n uint256 digits;\\n while (temp != 0) {\\n digits++;\\n temp /= 10;\\n }\\n bytes memory buffer = new bytes(digits);\\n while (value != 0) {\\n digits -= 1;\\n buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));\\n value /= 10;\\n }\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n if (value == 0) {\\n return \\\"0x00\\\";\\n }\\n uint256 temp = value;\\n uint256 length = 0;\\n while (temp != 0) {\\n length++;\\n temp >>= 8;\\n }\\n return toHexString(value, length);\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _HEX_SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n}\\n\",\"keccak256\":\"0x398d3323c1932a5986bf36be7c57593e121e69d5db5b6574b4ee0d031443de37\",\"license\":\"MIT\"},\"@openzeppelin/contracts-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\"},\"@openzeppelin/contracts-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\"},\"@openzeppelin/contracts-upgradeable/utils/structs/EnumerableSetUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (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 EnumerableSetUpgradeable {\\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\":\"0x0004699ba89fa356eb0d58d815b42dcf52eccd2765e95256631b838bce2556bc\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/ERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.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.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How\\n * to implement supply mechanisms].\\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 * The default value of {decimals} is 18. To select a different value for\\n * {decimals} you should overload it.\\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 value {ERC20} uses, unless this function is\\n * 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(\\n address from,\\n address to,\\n uint256 amount\\n ) 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, _allowances[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 = _allowances[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 `sender` to `recipient`.\\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(\\n address from,\\n address to,\\n uint256 amount\\n ) 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 }\\n _balances[to] += amount;\\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 _balances[account] += amount;\\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 }\\n _totalSupply -= amount;\\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(\\n address owner,\\n address spender,\\n uint256 amount\\n ) 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 Spend `amount` form the allowance of `owner` toward `spender`.\\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(\\n address owner,\\n address spender,\\n uint256 amount\\n ) 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(\\n address from,\\n address to,\\n uint256 amount\\n ) 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(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual {}\\n}\\n\",\"keccak256\":\"0xdadd41acb749920eccf40aeaa8d291adf9751399a7343561bad13e7a8d99be0b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n\\n /**\\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\":\"0xbbc8ac883ac3c0078ce5ad3e288fbb3ffcc8a30c3a98c0fda0114d64fc44fca2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x8de418a5503946cabe331f35fe242d3201a73f67f77aaeb7110acb1f30423aca\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)\\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\":\"0xc3d946432c0ddbb1f846a0d3985be71299df331b91d06732152117f62f0be2b5\",\"license\":\"MIT\"},\"@openzeppelin/contracts/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\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"contracts/network/NetworkSettings.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport { EnumerableSetUpgradeable } from \\\"@openzeppelin/contracts-upgradeable/utils/structs/EnumerableSetUpgradeable.sol\\\";\\n\\nimport { IVersioned } from \\\"../utility/interfaces/IVersioned.sol\\\";\\nimport { Upgradeable } from \\\"../utility/Upgradeable.sol\\\";\\nimport { Utils, AlreadyExists, DoesNotExist, InvalidParam } from \\\"../utility/Utils.sol\\\";\\n\\nimport { Token } from \\\"../token/Token.sol\\\";\\nimport { TokenLibrary } from \\\"../token/TokenLibrary.sol\\\";\\n\\nimport { INetworkSettings, VortexRewards, NotWhitelisted } from \\\"./interfaces/INetworkSettings.sol\\\";\\n\\n/**\\n * @dev Network Settings contract\\n */\\ncontract NetworkSettings is INetworkSettings, Upgradeable, Utils {\\n using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet;\\n using TokenLibrary for Token;\\n\\n uint32 private constant DEFAULT_FLASH_LOAN_FEE_PPM = 0; // 0%\\n\\n struct FlashLoanFee {\\n bool initialized;\\n uint32 feePPM;\\n }\\n\\n // the address of the BNT token\\n IERC20 private immutable _bnt;\\n\\n // a set of tokens which are eligible for protection\\n EnumerableSetUpgradeable.AddressSet private _protectedTokenWhitelist;\\n\\n // a mapping of BNT funding limits per pool\\n mapping(Token => uint256) private _poolFundingLimits;\\n\\n // below that amount, trading is disabled and co-investments use the initial rate\\n uint256 private _minLiquidityForTrading;\\n\\n // DEPRECATED (uint32 private _networkFeePPM)\\n uint32 private _deprecated0;\\n\\n // the withdrawal fee (in units of PPM)\\n uint32 private _withdrawalFeePPM;\\n\\n // the default flash-loan fee (in units of PPM)\\n uint32 private _defaultFlashLoanFeePPM;\\n\\n // the settings of the Vortex\\n VortexRewards private _vortexRewards;\\n\\n // a mapping between pools and their flash-loan fees\\n mapping(Token => FlashLoanFee) private _flashLoanFees;\\n\\n // a set of tokens which are eligible for POL\\n EnumerableSetUpgradeable.AddressSet private _tokenWhitelistForPOL;\\n\\n // upgrade forward-compatibility storage gap\\n uint256[MAX_GAP - 10] private __gap;\\n\\n /**\\n * @dev triggered when a token is added to the protection whitelist\\n */\\n event TokenAddedToWhitelist(Token indexed token);\\n\\n /**\\n * @dev triggered when a token is removed from the protection whitelist\\n */\\n event TokenRemovedFromWhitelist(Token indexed token);\\n\\n /**\\n * @dev triggered when a token is added to the whitelist for POL\\n */\\n event TokenAddedToWhitelistForPOL(Token indexed token);\\n\\n /**\\n * @dev triggered when a token is removed from the whitelist for POL\\n */\\n event TokenRemovedFromWhitelistForPOL(Token indexed token);\\n\\n /**\\n * @dev triggered when a per-pool funding limit is updated\\n */\\n event FundingLimitUpdated(Token indexed pool, uint256 prevLimit, uint256 newLimit);\\n\\n /**\\n * @dev triggered when the minimum liquidity for trading is updated\\n */\\n event MinLiquidityForTradingUpdated(uint256 prevLiquidity, uint256 newLiquidity);\\n\\n /**\\n * @dev triggered when the withdrawal fee is updated\\n */\\n event WithdrawalFeePPMUpdated(uint32 prevFeePPM, uint32 newFeePPM);\\n\\n /**\\n * @dev triggered when the settings of the Vortex are updated\\n */\\n event VortexBurnRewardUpdated(\\n uint32 prevBurnRewardPPM,\\n uint32 newBurnRewardPPM,\\n uint256 prevBurnRewardMaxAmount,\\n uint256 newBurnRewardMaxAmount\\n );\\n\\n /**\\n * @dev triggered when the default flash-loan fee is updated\\n */\\n event DefaultFlashLoanFeePPMUpdated(uint32 prevFeePPM, uint32 newFeePPM);\\n\\n /**\\n * @dev triggered when a specific pool's flash-loan fee is updated\\n */\\n event FlashLoanFeePPMUpdated(Token indexed pool, uint32 prevFeePPM, uint32 newFeePPM);\\n\\n constructor(IERC20 initBnt) validAddress(address(initBnt)) {\\n _bnt = initBnt;\\n }\\n\\n /**\\n * @dev fully initializes the contract and its parents\\n */\\n function initialize() external initializer {\\n __NetworkSettings_init();\\n }\\n\\n // solhint-disable func-name-mixedcase\\n\\n /**\\n * @dev initializes the contract and its parents\\n */\\n function __NetworkSettings_init() internal onlyInitializing {\\n __Upgradeable_init();\\n\\n __NetworkSettings_init_unchained();\\n }\\n\\n /**\\n * @dev performs contract-specific initialization\\n */\\n function __NetworkSettings_init_unchained() internal onlyInitializing {\\n _setDefaultFlashLoanFeePPM(DEFAULT_FLASH_LOAN_FEE_PPM);\\n }\\n\\n // solhint-enable func-name-mixedcase\\n\\n /**\\n * @inheritdoc Upgradeable\\n */\\n function version() public pure override(IVersioned, Upgradeable) returns (uint16) {\\n return 4;\\n }\\n\\n /**\\n * @inheritdoc INetworkSettings\\n */\\n function protectedTokenWhitelist() external view returns (Token[] memory) {\\n uint256 length = _protectedTokenWhitelist.length();\\n Token[] memory list = new Token[](length);\\n for (uint256 i = 0; i < length; i++) {\\n list[i] = Token(_protectedTokenWhitelist.at(i));\\n }\\n return list;\\n }\\n\\n /**\\n * @dev adds a token to the protected tokens whitelist\\n *\\n * requirements:\\n *\\n * - the caller must be the admin of the contract\\n */\\n function addTokenToWhitelist(Token token) external onlyAdmin {\\n _addTokenToWhitelist(token);\\n }\\n\\n /**\\n * @dev adds tokens to the protected tokens whitelist\\n *\\n * requirements:\\n *\\n * - the caller must be the admin of the contract\\n */\\n function addTokensToWhitelist(Token[] calldata tokens) external onlyAdmin {\\n uint256 length = tokens.length;\\n\\n for (uint256 i = 0; i < length; i++) {\\n _addTokenToWhitelist(tokens[i]);\\n }\\n }\\n\\n /**\\n * @dev adds a token to the protected tokens whitelist\\n */\\n function _addTokenToWhitelist(Token token) private validExternalAddress(address(token)) {\\n if (!_protectedTokenWhitelist.add(address(token))) {\\n revert AlreadyExists();\\n }\\n\\n emit TokenAddedToWhitelist({ token: token });\\n }\\n\\n /**\\n * @dev removes a token from the protected tokens whitelist\\n *\\n * requirements:\\n *\\n * - the caller must be the admin of the contract\\n */\\n function removeTokenFromWhitelist(Token token) external onlyAdmin {\\n if (!_protectedTokenWhitelist.remove(address(token))) {\\n revert DoesNotExist();\\n }\\n\\n emit TokenRemovedFromWhitelist({ token: token });\\n }\\n\\n /**\\n * @inheritdoc INetworkSettings\\n */\\n function isTokenWhitelisted(Token token) external view returns (bool) {\\n return _isTokenWhitelisted(token);\\n }\\n\\n /**\\n * @inheritdoc INetworkSettings\\n */\\n function tokenWhitelistForPOL() external view returns (Token[] memory) {\\n uint256 length = _tokenWhitelistForPOL.length();\\n Token[] memory list = new Token[](length);\\n for (uint256 i = 0; i < length; i++) {\\n list[i] = Token(_tokenWhitelistForPOL.at(i));\\n }\\n return list;\\n }\\n\\n /**\\n * @dev adds a token to the tokens whitelist for POL\\n *\\n * requirements:\\n *\\n * - the caller must be the admin of the contract\\n */\\n function addTokenToWhitelistForPOL(Token token) external onlyAdmin {\\n _addTokenToWhitelistForPOL(token);\\n }\\n\\n /**\\n * @dev adds tokens to the tokens whitelist for POL\\n *\\n * requirements:\\n *\\n * - the caller must be the admin of the contract\\n */\\n function addTokensToWhitelistForPOL(Token[] calldata tokens) external onlyAdmin {\\n uint256 length = tokens.length;\\n\\n for (uint256 i = 0; i < length; i++) {\\n _addTokenToWhitelistForPOL(tokens[i]);\\n }\\n }\\n\\n /**\\n * @dev adds a token to the tokens whitelist for POL\\n */\\n function _addTokenToWhitelistForPOL(Token token) private validExternalAddress(address(token)) {\\n if (!_tokenWhitelistForPOL.add(address(token))) {\\n revert AlreadyExists();\\n }\\n\\n emit TokenAddedToWhitelistForPOL({ token: token });\\n }\\n\\n /**\\n * @dev removes a token from the tokens whitelist for POL\\n *\\n * requirements:\\n *\\n * - the caller must be the admin of the contract\\n */\\n function removeTokenFromWhitelistForPOL(Token token) external onlyAdmin {\\n if (!_tokenWhitelistForPOL.remove(address(token))) {\\n revert DoesNotExist();\\n }\\n\\n emit TokenRemovedFromWhitelistForPOL({ token: token });\\n }\\n\\n /**\\n * @inheritdoc INetworkSettings\\n */\\n function isTokenWhitelistedForPOL(Token token) external view returns (bool) {\\n return _isTokenWhitelistedForPOL(token);\\n }\\n\\n /**\\n * @inheritdoc INetworkSettings\\n */\\n function poolFundingLimit(Token pool) external view returns (uint256) {\\n return _poolFundingLimits[pool];\\n }\\n\\n /**\\n * @dev updates the amount of BNT that the protocol can provide as funding for a specific pool\\n *\\n * requirements:\\n *\\n * - the caller must be the admin of the contract\\n * - the token must have been whitelisted\\n */\\n function setFundingLimit(Token pool, uint256 amount) external onlyAdmin {\\n _setFundingLimit(pool, amount);\\n }\\n\\n /**\\n * @dev updates the amounts of BNT that the protocol can provide as funding for specific pools\\n *\\n * requirements:\\n *\\n * - the caller must be the admin of the contract\\n * - each one of the tokens must have been whitelisted\\n */\\n function setFundingLimits(Token[] calldata pools, uint256[] calldata amounts) external onlyAdmin {\\n uint256 length = pools.length;\\n if (length != amounts.length) {\\n revert InvalidParam();\\n }\\n\\n for (uint256 i = 0; i < length; i++) {\\n _setFundingLimit(pools[i], amounts[i]);\\n }\\n }\\n\\n /**\\n * @dev updates the amount of BNT that the protocol can provide as funding for a specific pool\\n */\\n function _setFundingLimit(Token pool, uint256 amount) private validAddress(address(pool)) {\\n if (!_isTokenWhitelisted(pool)) {\\n revert NotWhitelisted();\\n }\\n\\n uint256 prevPoolFundingLimit = _poolFundingLimits[pool];\\n if (prevPoolFundingLimit == amount) {\\n return;\\n }\\n\\n _poolFundingLimits[pool] = amount;\\n\\n emit FundingLimitUpdated({ pool: pool, prevLimit: prevPoolFundingLimit, newLimit: amount });\\n }\\n\\n /**\\n * @dev adds a token to the protected tokens whitelist,\\n * and sets the amount of BNT that the protocol can provide as funding for this pool\\n *\\n * requirements:\\n *\\n * - the caller must be the admin of the contract\\n */\\n function addTokenToWhitelistWithLimit(Token token, uint256 amount) external onlyAdmin {\\n _addTokenToWhitelist(token);\\n _setFundingLimit(token, amount);\\n }\\n\\n /**\\n * @inheritdoc INetworkSettings\\n */\\n function minLiquidityForTrading() external view returns (uint256) {\\n return _minLiquidityForTrading;\\n }\\n\\n /**\\n * @dev updates the minimum liquidity for trading amount\\n *\\n * requirements:\\n *\\n * - the caller must be the admin of the contract\\n */\\n function setMinLiquidityForTrading(uint256 amount) external onlyAdmin {\\n uint256 prevMinLiquidityForTrading = _minLiquidityForTrading;\\n if (_minLiquidityForTrading == amount) {\\n return;\\n }\\n\\n _minLiquidityForTrading = amount;\\n\\n emit MinLiquidityForTradingUpdated({ prevLiquidity: prevMinLiquidityForTrading, newLiquidity: amount });\\n }\\n\\n /**\\n * @inheritdoc INetworkSettings\\n */\\n function withdrawalFeePPM() external view returns (uint32) {\\n return _withdrawalFeePPM;\\n }\\n\\n /**\\n * @dev sets the withdrawal fee (in units of PPM)\\n *\\n * requirements:\\n *\\n * - the caller must be the admin of the contract\\n */\\n function setWithdrawalFeePPM(uint32 newWithdrawalFeePPM) external onlyAdmin validFee(newWithdrawalFeePPM) {\\n uint32 prevWithdrawalFeePPM = _withdrawalFeePPM;\\n if (prevWithdrawalFeePPM == newWithdrawalFeePPM) {\\n return;\\n }\\n\\n _withdrawalFeePPM = newWithdrawalFeePPM;\\n\\n emit WithdrawalFeePPMUpdated({ prevFeePPM: prevWithdrawalFeePPM, newFeePPM: newWithdrawalFeePPM });\\n }\\n\\n /**\\n * @inheritdoc INetworkSettings\\n */\\n function defaultFlashLoanFeePPM() external view returns (uint32) {\\n return _defaultFlashLoanFeePPM;\\n }\\n\\n /**\\n * @dev sets the default flash-loan fee (in units of PPM)\\n *\\n * requirements:\\n *\\n * - the caller must be the admin of the contract\\n */\\n function setDefaultFlashLoanFeePPM(\\n uint32 newDefaultFlashLoanFeePPM\\n ) external onlyAdmin validFee(newDefaultFlashLoanFeePPM) {\\n _setDefaultFlashLoanFeePPM(newDefaultFlashLoanFeePPM);\\n }\\n\\n /**\\n * @inheritdoc INetworkSettings\\n */\\n function flashLoanFeePPM(Token pool) external view returns (uint32) {\\n FlashLoanFee memory flashLoanFee = _flashLoanFees[pool];\\n\\n return flashLoanFee.initialized ? flashLoanFee.feePPM : _defaultFlashLoanFeePPM;\\n }\\n\\n /**\\n * @dev sets the flash-loan fee of a given pool\\n *\\n * requirements:\\n *\\n * - the caller must be the admin of the contract\\n * - the token must have been whitelisted\\n */\\n function setFlashLoanFeePPM(Token pool, uint32 newFlashLoanFeePPM) external onlyAdmin validFee(newFlashLoanFeePPM) {\\n if (!pool.isEqual(_bnt) && !_isTokenWhitelisted(pool)) {\\n revert NotWhitelisted();\\n }\\n\\n uint32 prevFlashLoanFeePPM = _flashLoanFees[pool].feePPM;\\n if (prevFlashLoanFeePPM == newFlashLoanFeePPM) {\\n return;\\n }\\n\\n _flashLoanFees[pool] = FlashLoanFee({ initialized: true, feePPM: newFlashLoanFeePPM });\\n\\n emit FlashLoanFeePPMUpdated({ pool: pool, prevFeePPM: prevFlashLoanFeePPM, newFeePPM: newFlashLoanFeePPM });\\n }\\n\\n /**\\n * @inheritdoc INetworkSettings\\n */\\n function vortexRewards() external view returns (VortexRewards memory) {\\n return _vortexRewards;\\n }\\n\\n /**\\n * @dev sets the settings of the Vortex\\n *\\n * requirements:\\n *s\\n * - the caller must be the admin of the contract\\n */\\n function setVortexRewards(\\n VortexRewards calldata rewards\\n ) external onlyAdmin validFee(rewards.burnRewardPPM) greaterThanZero(rewards.burnRewardMaxAmount) {\\n uint32 prevVortexBurnRewardPPM = _vortexRewards.burnRewardPPM;\\n uint256 prevVortexBurnRewardMaxAmount = _vortexRewards.burnRewardMaxAmount;\\n\\n if (\\n prevVortexBurnRewardPPM == rewards.burnRewardPPM &&\\n prevVortexBurnRewardMaxAmount == rewards.burnRewardMaxAmount\\n ) {\\n return;\\n }\\n\\n _vortexRewards = rewards;\\n\\n emit VortexBurnRewardUpdated({\\n prevBurnRewardPPM: prevVortexBurnRewardPPM,\\n newBurnRewardPPM: rewards.burnRewardPPM,\\n prevBurnRewardMaxAmount: prevVortexBurnRewardMaxAmount,\\n newBurnRewardMaxAmount: rewards.burnRewardMaxAmount\\n });\\n }\\n\\n /**\\n * @dev checks whether a given token is whitelisted\\n */\\n function _isTokenWhitelisted(Token token) private view returns (bool) {\\n return _protectedTokenWhitelist.contains(address(token));\\n }\\n\\n /**\\n * @dev checks whether a given token is whitelisted for POL\\n */\\n function _isTokenWhitelistedForPOL(Token token) private view returns (bool) {\\n return _tokenWhitelistForPOL.contains(address(token));\\n }\\n\\n /**\\n * @dev sets the default flash-loan fee (in units of PPM)\\n */\\n function _setDefaultFlashLoanFeePPM(uint32 newDefaultFlashLoanFeePPM) private {\\n uint32 prevDefaultFlashLoanFeePPM = _defaultFlashLoanFeePPM;\\n if (prevDefaultFlashLoanFeePPM == newDefaultFlashLoanFeePPM) {\\n return;\\n }\\n\\n _defaultFlashLoanFeePPM = newDefaultFlashLoanFeePPM;\\n\\n emit DefaultFlashLoanFeePPMUpdated({\\n prevFeePPM: prevDefaultFlashLoanFeePPM,\\n newFeePPM: newDefaultFlashLoanFeePPM\\n });\\n }\\n}\\n\",\"keccak256\":\"0x045a23ed90e86aa86a98a1ed024f423b839b32c5f1be2fb719a64dde2881a0bb\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/network/interfaces/INetworkSettings.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { IUpgradeable } from \\\"../../utility/interfaces/IUpgradeable.sol\\\";\\n\\nimport { Token } from \\\"../../token/Token.sol\\\";\\n\\nerror NotWhitelisted();\\nerror NotWhitelistedForPOL();\\n\\nstruct VortexRewards {\\n // the percentage of converted BNT to be sent to the initiator of the burning event (in units of PPM)\\n uint32 burnRewardPPM;\\n // the maximum burn reward to be sent to the initiator of the burning event\\n uint256 burnRewardMaxAmount;\\n}\\n\\n/**\\n * @dev Network Settings interface\\n */\\ninterface INetworkSettings is IUpgradeable {\\n /**\\n * @dev returns the protected tokens whitelist\\n */\\n function protectedTokenWhitelist() external view returns (Token[] memory);\\n\\n /**\\n * @dev checks whether a given token is whitelisted\\n */\\n function isTokenWhitelisted(Token pool) external view returns (bool);\\n\\n /**\\n * @dev returns the tokens whitelist for POL\\n */\\n function tokenWhitelistForPOL() external view returns (Token[] memory);\\n\\n /**\\n * @dev checks whether a given token is whitelist for POL\\n */\\n function isTokenWhitelistedForPOL(Token pool) external view returns (bool);\\n\\n /**\\n * @dev returns the BNT funding limit for a given pool\\n */\\n function poolFundingLimit(Token pool) external view returns (uint256);\\n\\n /**\\n * @dev returns the minimum BNT trading liquidity required before the system enables trading in the relevant pool\\n */\\n function minLiquidityForTrading() external view returns (uint256);\\n\\n /**\\n * @dev returns the withdrawal fee (in units of PPM)\\n */\\n function withdrawalFeePPM() external view returns (uint32);\\n\\n /**\\n * @dev returns the default flash-loan fee (in units of PPM)\\n */\\n function defaultFlashLoanFeePPM() external view returns (uint32);\\n\\n /**\\n * @dev returns the flash-loan fee (in units of PPM) of a pool\\n */\\n function flashLoanFeePPM(Token pool) external view returns (uint32);\\n\\n /**\\n * @dev returns the vortex settings\\n */\\n function vortexRewards() external view returns (VortexRewards memory);\\n}\\n\",\"keccak256\":\"0x98403457a628e5e568688184570be14d3c59a5fec5cdbf69236b4a787c802c45\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/token/SafeERC20Ex.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport { SafeERC20 } from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\n\\n/**\\n * @dev extends the SafeERC20 library with additional operations\\n */\\nlibrary SafeERC20Ex {\\n using SafeERC20 for IERC20;\\n\\n /**\\n * @dev ensures that the spender has sufficient allowance\\n */\\n function ensureApprove(IERC20 token, address spender, uint256 amount) internal {\\n if (amount == 0) {\\n return;\\n }\\n\\n uint256 allowance = token.allowance(address(this), spender);\\n if (allowance >= amount) {\\n return;\\n }\\n\\n if (allowance > 0) {\\n token.safeApprove(spender, 0);\\n }\\n token.safeApprove(spender, amount);\\n }\\n}\\n\",\"keccak256\":\"0x8976816df06d18659fd6c95611aa32aa48ca2d1d4f64e63235bf5c9802bf85bf\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/token/Token.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\n/**\\n * @dev the main purpose of the Token interfaces is to ensure artificially that we won't use ERC20's standard functions,\\n * but only their safe versions, which are provided by SafeERC20 and SafeERC20Ex via the TokenLibrary contract\\n */\\ninterface Token {\\n\\n}\\n\",\"keccak256\":\"0x49d0e5ac0dab272f4001a63e7f4117eb13b42c655ee788c42a333f56f19ac2e9\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/token/TokenLibrary.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport { ERC20 } from \\\"@openzeppelin/contracts/token/ERC20/ERC20.sol\\\";\\nimport { SafeERC20 } from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\n\\nimport { SafeERC20Ex } from \\\"./SafeERC20Ex.sol\\\";\\n\\nimport { Token } from \\\"./Token.sol\\\";\\n\\n/**\\n * @dev This library implements ERC20 and SafeERC20 utilities for both the native token and for ERC20 tokens\\n */\\nlibrary TokenLibrary {\\n using SafeERC20 for IERC20;\\n using SafeERC20Ex for IERC20;\\n\\n error PermitUnsupported();\\n\\n // the address that represents the native token reserve\\n address private constant NATIVE_TOKEN_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\\n\\n // the symbol that represents the native token\\n string private constant NATIVE_TOKEN_SYMBOL = \\\"ETH\\\";\\n\\n // the decimals for the native token\\n uint8 private constant NATIVE_TOKEN_DECIMALS = 18;\\n\\n // the token representing the native token\\n Token public constant NATIVE_TOKEN = Token(NATIVE_TOKEN_ADDRESS);\\n\\n /**\\n * @dev returns whether the provided token represents an ERC20 or the native token reserve\\n */\\n function isNative(Token token) internal pure returns (bool) {\\n return address(token) == NATIVE_TOKEN_ADDRESS;\\n }\\n\\n /**\\n * @dev returns the symbol of the native token/ERC20 token\\n */\\n function symbol(Token token) internal view returns (string memory) {\\n if (isNative(token)) {\\n return NATIVE_TOKEN_SYMBOL;\\n }\\n\\n return toERC20(token).symbol();\\n }\\n\\n /**\\n * @dev returns the decimals of the native token/ERC20 token\\n */\\n function decimals(Token token) internal view returns (uint8) {\\n if (isNative(token)) {\\n return NATIVE_TOKEN_DECIMALS;\\n }\\n\\n return toERC20(token).decimals();\\n }\\n\\n /**\\n * @dev returns the balance of the native token/ERC20 token\\n */\\n function balanceOf(Token token, address account) internal view returns (uint256) {\\n if (isNative(token)) {\\n return account.balance;\\n }\\n\\n return toIERC20(token).balanceOf(account);\\n }\\n\\n /**\\n * @dev transfers a specific amount of the native token/ERC20 token\\n */\\n function safeTransfer(Token token, address to, uint256 amount) internal {\\n if (amount == 0) {\\n return;\\n }\\n\\n if (isNative(token)) {\\n payable(to).transfer(amount);\\n } else {\\n toIERC20(token).safeTransfer(to, amount);\\n }\\n }\\n\\n /**\\n * @dev transfers a specific amount of the native token/ERC20 token from a specific holder using the allowance mechanism\\n *\\n * note that the function does not perform any action if the native token is provided\\n */\\n function safeTransferFrom(Token token, address from, address to, uint256 amount) internal {\\n if (amount == 0 || isNative(token)) {\\n return;\\n }\\n\\n toIERC20(token).safeTransferFrom(from, to, amount);\\n }\\n\\n /**\\n * @dev approves a specific amount of the native token/ERC20 token from a specific holder\\n *\\n * note that the function does not perform any action if the native token is provided\\n */\\n function safeApprove(Token token, address spender, uint256 amount) internal {\\n if (isNative(token)) {\\n return;\\n }\\n\\n toIERC20(token).safeApprove(spender, amount);\\n }\\n\\n /**\\n * @dev increases allowance of the native token/ERC20 token from a specific holder\\n *\\n * note that the function does not perform any action if the native token is provided\\n */\\n function safeIncreaseAllowance(Token token, address spender, uint256 amount) internal {\\n if (isNative(token)) {\\n return;\\n }\\n\\n toIERC20(token).safeIncreaseAllowance(spender, amount);\\n }\\n\\n /**\\n * @dev ensures that the spender has sufficient allowance\\n *\\n * note that the function does not perform any action if the native token is provided\\n */\\n function ensureApprove(Token token, address spender, uint256 amount) internal {\\n if (isNative(token)) {\\n return;\\n }\\n\\n toIERC20(token).ensureApprove(spender, amount);\\n }\\n\\n /**\\n * @dev compares between a token and another raw ERC20 token\\n */\\n function isEqual(Token token, IERC20 erc20Token) internal pure returns (bool) {\\n return toIERC20(token) == erc20Token;\\n }\\n\\n /**\\n * @dev utility function that converts a token to an IERC20\\n */\\n function toIERC20(Token token) internal pure returns (IERC20) {\\n return IERC20(address(token));\\n }\\n\\n /**\\n * @dev utility function that converts a token to an ERC20\\n */\\n function toERC20(Token token) internal pure returns (ERC20) {\\n return ERC20(address(token));\\n }\\n}\\n\",\"keccak256\":\"0x74eb4bbfb891affa1df59a729a6fe1c07fd875a0e8accbee345db3e6aab1fb3f\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/utility/Constants.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nuint32 constant PPM_RESOLUTION = 1_000_000;\\n\",\"keccak256\":\"0x5215535db0a4e580cd19380cc1cf3a2b7edcbb8ee039e416319fe9f8867724ad\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/utility/Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { AccessControlEnumerableUpgradeable } from \\\"@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol\\\";\\n\\nimport { IUpgradeable } from \\\"./interfaces/IUpgradeable.sol\\\";\\n\\nimport { AccessDenied } from \\\"./Utils.sol\\\";\\n\\n/**\\n * @dev this contract provides common utilities for upgradeable contracts\\n *\\n * note that we're using the Transparent Upgradeable Proxy pattern and *not* the Universal Upgradeable Proxy Standard\\n * (UUPS) pattern, therefore initializing the implementation contracts is not necessary or required\\n */\\nabstract contract Upgradeable is IUpgradeable, AccessControlEnumerableUpgradeable {\\n error AlreadyInitialized();\\n\\n // the admin role is used to allow a non-proxy admin to perform additional initialization/setup during contract\\n // upgrades\\n bytes32 internal constant ROLE_ADMIN = keccak256(\\\"ROLE_ADMIN\\\");\\n\\n uint32 internal constant MAX_GAP = 50;\\n\\n uint16 internal _initializations;\\n\\n // upgrade forward-compatibility storage gap\\n uint256[MAX_GAP - 1] private __gap;\\n\\n // solhint-disable func-name-mixedcase\\n\\n /**\\n * @dev initializes the contract and its parents\\n */\\n function __Upgradeable_init() internal onlyInitializing {\\n __AccessControl_init();\\n\\n __Upgradeable_init_unchained();\\n }\\n\\n /**\\n * @dev performs contract-specific initialization\\n */\\n function __Upgradeable_init_unchained() internal onlyInitializing {\\n _initializations = 1;\\n\\n // set up administrative roles\\n _setRoleAdmin(ROLE_ADMIN, ROLE_ADMIN);\\n\\n // allow the deployer to initially be the admin of the contract\\n _setupRole(ROLE_ADMIN, msg.sender);\\n }\\n\\n // solhint-enable func-name-mixedcase\\n\\n modifier onlyAdmin() {\\n _hasRole(ROLE_ADMIN, msg.sender);\\n\\n _;\\n }\\n\\n modifier onlyRoleMember(bytes32 role) {\\n _hasRole(role, msg.sender);\\n\\n _;\\n }\\n\\n function version() public view virtual override returns (uint16);\\n\\n /**\\n * @dev returns the admin role\\n */\\n function roleAdmin() external pure returns (bytes32) {\\n return ROLE_ADMIN;\\n }\\n\\n /**\\n * @dev performs post-upgrade initialization\\n *\\n * requirements:\\n *\\n * - this must can be called only once per-upgrade\\n */\\n function postUpgrade(bytes calldata data) external {\\n uint16 initializations = _initializations + 1;\\n\\n if (initializations != version()) {\\n revert AlreadyInitialized();\\n }\\n\\n _initializations = initializations;\\n\\n _postUpgrade(data);\\n }\\n\\n /**\\n * @dev an optional post-upgrade callback that can be implemented by child contracts\\n */\\n function _postUpgrade(bytes calldata /* data */) internal virtual {}\\n\\n function _hasRole(bytes32 role, address account) internal view {\\n if (!hasRole(role, account)) {\\n revert AccessDenied();\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3a7fc26c8bcb7332218193111fc775e4aa19af2f5c81b5826f8075490bd3cf48\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/utility/Utils.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { PPM_RESOLUTION } from \\\"./Constants.sol\\\";\\n\\nerror AccessDenied();\\nerror AlreadyExists();\\nerror DoesNotExist();\\nerror InvalidAddress();\\nerror InvalidExternalAddress();\\nerror InvalidFee();\\nerror InvalidPool();\\nerror InvalidPoolCollection();\\nerror InvalidStakedBalance();\\nerror InvalidToken();\\nerror InvalidParam();\\nerror NotEmpty();\\nerror NotPayable();\\nerror ZeroValue();\\n\\n/**\\n * @dev common utilities\\n */\\nabstract contract Utils {\\n // allows execution by the caller only\\n modifier only(address caller) {\\n _only(caller);\\n\\n _;\\n }\\n\\n function _only(address caller) internal view {\\n if (msg.sender != caller) {\\n revert AccessDenied();\\n }\\n }\\n\\n // verifies that a value is greater than zero\\n modifier greaterThanZero(uint256 value) {\\n _greaterThanZero(value);\\n\\n _;\\n }\\n\\n // error message binary size optimization\\n function _greaterThanZero(uint256 value) internal pure {\\n if (value == 0) {\\n revert ZeroValue();\\n }\\n }\\n\\n // validates an address - currently only checks that it isn't null\\n modifier validAddress(address addr) {\\n _validAddress(addr);\\n\\n _;\\n }\\n\\n // error message binary size optimization\\n function _validAddress(address addr) internal pure {\\n if (addr == address(0)) {\\n revert InvalidAddress();\\n }\\n }\\n\\n // validates an external address - currently only checks that it isn't null or this\\n modifier validExternalAddress(address addr) {\\n _validExternalAddress(addr);\\n\\n _;\\n }\\n\\n // error message binary size optimization\\n function _validExternalAddress(address addr) internal view {\\n if (addr == address(0) || addr == address(this)) {\\n revert InvalidExternalAddress();\\n }\\n }\\n\\n // ensures that the fee is valid\\n modifier validFee(uint32 fee) {\\n _validFee(fee);\\n\\n _;\\n }\\n\\n // error message binary size optimization\\n function _validFee(uint32 fee) internal pure {\\n if (fee > PPM_RESOLUTION) {\\n revert InvalidFee();\\n }\\n }\\n}\\n\",\"keccak256\":\"0x62b8b81d3069467eb6402b8f61adcc24f5b2e310db1a2ee64d719229306ab823\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/utility/interfaces/IUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { IVersioned } from \\\"./IVersioned.sol\\\";\\n\\nimport { IAccessControlEnumerableUpgradeable } from \\\"@openzeppelin/contracts-upgradeable/access/IAccessControlEnumerableUpgradeable.sol\\\";\\n\\n/**\\n * @dev this is the common interface for upgradeable contracts\\n */\\ninterface IUpgradeable is IAccessControlEnumerableUpgradeable, IVersioned {\\n\\n}\\n\",\"keccak256\":\"0x6019e5e9c706cc023b96313932f5aa7fc3734f446fd0936a2c6530d0d25330da\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/utility/interfaces/IVersioned.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\n/**\\n * @dev an interface for a versioned contract\\n */\\ninterface IVersioned {\\n function version() external view returns (uint16);\\n}\\n\",\"keccak256\":\"0x1969c895e9adc0bc8a85e975517d2f2b9357e0c9011f159d01b90f7d1a464d76\",\"license\":\"SEE LICENSE IN LICENSE\"}},\"version\":1}", + "bytecode": "0x60a06040523480156200001157600080fd5b506040516200202e3803806200202e83398101604081905262000034916200007e565b80620000408162000053565b506001600160a01b0316608052620000b0565b6001600160a01b0381166200007b5760405163e6c4247b60e01b815260040160405180910390fd5b50565b6000602082840312156200009157600080fd5b81516001600160a01b0381168114620000a957600080fd5b9392505050565b608051611f62620000cc60003960006105e80152611f626000f3fe608060405234801561001057600080fd5b50600436106102275760003560e01c8063649242b511610130578063a217fddf116100b8578063cd9d26a51161007c578063cd9d26a514610516578063ce53e7291461051e578063d547741f14610531578063d84c1b3814610544578063fa617bf31461055757600080fd5b8063a217fddf146104c2578063a2295927146104ca578063a83e3f0c146104dd578063b5af090f146104f0578063ca15c8731461050357600080fd5b806387ba006a116100ff57806387ba006a146104555780638cd2403d1461045d5780639010d07c1461047057806391d148541461049b57806393867fb5146104ae57600080fd5b8063649242b5146104125780637c36afad1461042757806380cfdfc21461043a5780638129fc1c1461044d57600080fd5b8063325bae6a116101b3578063467e55df11610182578063467e55df146103a15780634de42c97146103ca5780634f712cff146103dd57806354fd4d50146103f05780635d46faa4146103ff57600080fd5b8063325bae6a1461035357806336568abe146103685780633a1ec78d1461037b57806343101a451461038e57600080fd5b8063248a9ca3116101fa578063248a9ca3146102c25780632aac012c146102f35780632f2ff15d1461031a578063306275be1461032d5780633184f4d41461034057600080fd5b806301ffc9a71461022c57806305a4c0f7146102545780630f1913631461029a57806314da1add146102af575b600080fd5b61023f61023a3660046119cc565b61056a565b60405190151581526020015b60405180910390f35b6040805180820182526000808252602091820152815180830183526101005463ffffffff168082526101015491830191825283519081529051918101919091520161024b565b6102ad6102a8366004611a08565b610595565b005b6102ad6102bd366004611a3a565b6105c4565b6102e56102d0366004611a73565b60009081526065602052604090206001015490565b60405190815260200161024b565b60ff54640100000000900463ffffffff165b60405163ffffffff909116815260200161024b565b6102ad610328366004611a8c565b61071d565b6102ad61033b366004611ab1565b610743565b6102ad61034e366004611b1a565b6107ba565b60ff54600160401b900463ffffffff16610305565b6102ad610376366004611a8c565b610825565b6102ad610389366004611b5c565b6108a4565b6102ad61039c366004611b74565b6109a2565b6102e56103af366004611ab1565b6001600160a01b0316600090815260fd602052604090205490565b6102ad6103d8366004611ab1565b6109cd565b6102ad6103eb366004611a08565b6109f1565b6040516004815260200161024b565b6102ad61040d366004611ba0565b610a9c565b61041a610b42565b60405161024b9190611c0c565b610305610435366004611ab1565b610bf4565b6102ad610448366004611b1a565b610c5c565b6102ad610cc1565b60fe546102e5565b6102ad61046b366004611c59565b610d81565b61048361047e366004611ccb565b610dd2565b6040516001600160a01b03909116815260200161024b565b61023f6104a9366004611a8c565b610dea565b600080516020611f368339815191526102e5565b6102e5600081565b6102ad6104d8366004611ab1565b610e15565b6102ad6104eb366004611b74565b610e8d565b61023f6104fe366004611ab1565b610ea5565b6102e5610511366004611a73565b610eb0565b61041a610ec7565b61023f61052c366004611ab1565b610f70565b6102ad61053f366004611a8c565b610f7b565b6102ad610552366004611ab1565b610fa1565b6102ad610565366004611a73565b610fc2565b60006001600160e01b03198216635a05180f60e01b148061058f575061058f8261102b565b92915050565b6105ad600080516020611f3683398151915233611060565b806105b781611087565b6105c0826110b1565b5050565b6105dc600080516020611f3683398151915233611060565b806105e681611087565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811690841614158015610629575061062783611133565b155b1561064757604051630b094f2760e31b815260040160405180910390fd5b6001600160a01b0383166000908152610102602052604090205463ffffffff6101009091048116908316810361067d5750505050565b6040805180820182526001815263ffffffff85811660208084018281526001600160a01b038a166000818152610102845287902095518654925164ffffffffff1990931690151564ffffffff0019161761010092861692909202919091179094558451928616835282015290917fe9b262e9376e7127d0246f98c1ab2e98fb430e73dcd665322ea46df0ce094af391015b60405180910390a2505b505050565b6000828152606560205260409020600101546107398133611140565b61071883836111a4565b61075b600080516020611f3683398151915233611060565b61076660fb826111c6565b6107835760405163b0ce759160e01b815260040160405180910390fd5b6040516001600160a01b038216907fdd2e6d9f52cbe8f695939d018b7d4a216dc613a669876163ac548b916489d91790600090a250565b6107d2600080516020611f3683398151915233611060565b8060005b8181101561081f5761080d8484838181106107f3576107f3611ced565b90506020020160208101906108089190611ab1565b6111db565b8061081781611d19565b9150506107d6565b50505050565b6001600160a01b038116331461089a5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b6105c08282611246565b6108bc600080516020611f3683398151915233611060565b6108c96020820182611a08565b6108d281611087565b81602001356108e081611268565b610100546101015463ffffffff909116906108fe6020860186611a08565b63ffffffff168263ffffffff1614801561091b5750846020013581145b15610927575050505050565b846101006109358282611d32565b507fc0c001b93aede4379dd063acffffdf190292a31ccf86bbbf5399ab3480f3ebb19050826109676020880188611a08565b6040805163ffffffff938416815292909116602083810191909152908201849052870135606082015260800160405180910390a15050505050565b6109ba600080516020611f3683398151915233611060565b6109c382611289565b6105c082826112f3565b6109e5600080516020611f3683398151915233611060565b6109ee816111db565b50565b610a09600080516020611f3683398151915233611060565b80610a1381611087565b60ff5463ffffffff64010000000090910481169083168103610a3457505050565b60ff805467ffffffff00000000191664010000000063ffffffff8681169182029290921790925560408051918416825260208201929092527f5694fc3b551ce2e4a457649f95500c545f27fce9ef7c3818cfb3c52134223dcb910160405180910390a1505050565b610ab4600080516020611f3683398151915233611060565b82818114610ad557604051633494a40d60e21b815260040160405180910390fd5b60005b81811015610b3a57610b28868683818110610af557610af5611ced565b9050602002016020810190610b0a9190611ab1565b858584818110610b1c57610b1c611ced565b905060200201356112f3565b80610b3281611d19565b915050610ad8565b505050505050565b60606000610b5161010361139b565b905060008167ffffffffffffffff811115610b6e57610b6e611d5f565b604051908082528060200260200182016040528015610b97578160200160208202803683370190505b50905060005b82811015610bed57610bb1610103826113a5565b828281518110610bc357610bc3611ced565b6001600160a01b039092166020928302919091019091015280610be581611d19565b915050610b9d565b5092915050565b6001600160a01b03811660009081526101026020908152604080832081518083019092525460ff8116151580835261010090910463ffffffff169282019290925290610c4f5760ff54600160401b900463ffffffff16610c55565b80602001515b9392505050565b610c74600080516020611f3683398151915233611060565b8060005b8181101561081f57610caf848483818110610c9557610c95611ced565b9050602002016020810190610caa9190611ab1565b611289565b80610cb981611d19565b915050610c78565b600054610100900460ff16610cdc5760005460ff1615610ce0565b303b155b610d435760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610891565b600054610100900460ff16158015610d65576000805461ffff19166101011790555b610d6d6113b1565b80156109ee576000805461ff001916905550565b60c954600090610d969061ffff166001611d75565b905061ffff8116600414610dbc5760405162dc149f60e41b815260040160405180910390fd5b60c9805461ffff191661ffff8316179055505050565b6000828152609760205260408120610c5590836113a5565b60009182526065602090815260408084206001600160a01b0393909316845291905290205460ff1690565b610e2d600080516020611f3683398151915233611060565b610e39610103826111c6565b610e565760405163b0ce759160e01b815260040160405180910390fd5b6040516001600160a01b038216907fbbc467e0c6d3ec4ae1b648a408fc4ce0397f4b0d10581a5453c06176e688efb990600090a250565b6109c3600080516020611f3683398151915233611060565b600061058f82611133565b600081815260976020526040812061058f9061139b565b60606000610ed560fb61139b565b905060008167ffffffffffffffff811115610ef257610ef2611d5f565b604051908082528060200260200182016040528015610f1b578160200160208202803683370190505b50905060005b82811015610bed57610f3460fb826113a5565b828281518110610f4657610f46611ced565b6001600160a01b039092166020928302919091019091015280610f6881611d19565b915050610f21565b600061058f826113ea565b600082815260656020526040902060010154610f978133611140565b6107188383611246565b610fb9600080516020611f3683398151915233611060565b6109ee81611289565b610fda600080516020611f3683398151915233611060565b60fe54818103610fe8575050565b60fe82905560408051828152602081018490527fa331479cec90af3eef92e0ee6f6cd19f7912d7bb73f8d9885083d6ffa98b077291015b60405180910390a15050565b60006001600160e01b03198216637965db0b60e01b148061058f57506301ffc9a760e01b6001600160e01b031983161461058f565b61106a8282610dea565b6105c057604051634ca8886760e01b815260040160405180910390fd5b620f424063ffffffff821611156109ee576040516358d620b360e01b815260040160405180910390fd5b60ff5463ffffffff600160401b909104811690821681036110d0575050565b60ff80546bffffffff00000000000000001916600160401b63ffffffff8581169182029290921790925560408051918416825260208201929092527f3150357e7ae28a36ec737b6b68396e3d6e6045739a37622ef936636add183106910161101f565b600061058f60fb836113f4565b61114a8282610dea565b6105c057611162816001600160a01b03166014611416565b61116d836020611416565b60405160200161117e929190611dc7565b60408051601f198184030181529082905262461bcd60e51b825261089191600401611e3c565b6111ae82826115b2565b60008281526097602052604090206107189082611638565b6000610c55836001600160a01b03841661164d565b806111e581611740565b6111f161010383611638565b61120e5760405163119b4fd360e11b815260040160405180910390fd5b6040516001600160a01b038316907fed70cb132cde4fb29993b167b06db345dd5a55371302ffcf02bcae5c8697ca8990600090a25050565b611250828261177c565b600082815260976020526040902061071890826111c6565b806000036109ee57604051637c946ed760e01b815260040160405180910390fd5b8061129381611740565b61129e60fb83611638565b6112bb5760405163119b4fd360e11b815260040160405180910390fd5b6040516001600160a01b038316907fa718ddb71589521cab00fa313e3bd14e75ca7204d57a12ff3a5aa40796f3427690600090a25050565b816112fd816117e3565b61130683611133565b61132357604051630b094f2760e31b815260040160405180910390fd5b6001600160a01b038316600090815260fd60205260409020548281036113495750505050565b6001600160a01b038416600081815260fd602090815260409182902086905581518481529081018690527f1a06df86f888ab7df8687a48f67c1ae98d193e315d76c842736d851adac8dda5910161070e565b600061058f825490565b6000610c55838361180a565b600054610100900460ff166113d85760405162461bcd60e51b815260040161089190611e6f565b6113e0611834565b6113e861186b565b565b600061058f610103835b6001600160a01b03811660009081526001830160205260408120541515610c55565b60606000611425836002611eba565b611430906002611ed9565b67ffffffffffffffff81111561144857611448611d5f565b6040519080825280601f01601f191660200182016040528015611472576020820181803683370190505b509050600360fc1b8160008151811061148d5761148d611ced565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106114bc576114bc611ced565b60200101906001600160f81b031916908160001a90535060006114e0846002611eba565b6114eb906001611ed9565b90505b6001811115611563576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061151f5761151f611ced565b1a60f81b82828151811061153557611535611ced565b60200101906001600160f81b031916908160001a90535060049490941c9361155c81611ef1565b90506114ee565b508315610c555760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610891565b6115bc8282610dea565b6105c05760008281526065602090815260408083206001600160a01b03851684529091529020805460ff191660011790556115f43390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000610c55836001600160a01b03841661189c565b60008181526001830160205260408120548015611736576000611671600183611f08565b855490915060009061168590600190611f08565b90508181146116ea5760008660000182815481106116a5576116a5611ced565b90600052602060002001549050808760000184815481106116c8576116c8611ced565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806116fb576116fb611f1f565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061058f565b600091505061058f565b6001600160a01b038116158061175e57506001600160a01b03811630145b156109ee57604051638e052b6760e01b815260040160405180910390fd5b6117868282610dea565b156105c05760008281526065602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6001600160a01b0381166109ee5760405163e6c4247b60e01b815260040160405180910390fd5b600082600001828154811061182157611821611ced565b9060005260206000200154905092915050565b600054610100900460ff1661185b5760405162461bcd60e51b815260040161089190611e6f565b6118636118eb565b6113e8611912565b600054610100900460ff166118925760405162461bcd60e51b815260040161089190611e6f565b6113e860006110b1565b60008181526001830160205260408120546118e35750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561058f565b50600061058f565b600054610100900460ff166113e85760405162461bcd60e51b815260040161089190611e6f565b600054610100900460ff166119395760405162461bcd60e51b815260040161089190611e6f565b60c9805461ffff1916600117905561195f600080516020611f3683398151915280611977565b6113e8600080516020611f36833981519152336119c2565b600082815260656020526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6105c082826111a4565b6000602082840312156119de57600080fd5b81356001600160e01b031981168114610c5557600080fd5b63ffffffff811681146109ee57600080fd5b600060208284031215611a1a57600080fd5b8135610c55816119f6565b6001600160a01b03811681146109ee57600080fd5b60008060408385031215611a4d57600080fd5b8235611a5881611a25565b91506020830135611a68816119f6565b809150509250929050565b600060208284031215611a8557600080fd5b5035919050565b60008060408385031215611a9f57600080fd5b823591506020830135611a6881611a25565b600060208284031215611ac357600080fd5b8135610c5581611a25565b60008083601f840112611ae057600080fd5b50813567ffffffffffffffff811115611af857600080fd5b6020830191508360208260051b8501011115611b1357600080fd5b9250929050565b60008060208385031215611b2d57600080fd5b823567ffffffffffffffff811115611b4457600080fd5b611b5085828601611ace565b90969095509350505050565b600060408284031215611b6e57600080fd5b50919050565b60008060408385031215611b8757600080fd5b8235611b9281611a25565b946020939093013593505050565b60008060008060408587031215611bb657600080fd5b843567ffffffffffffffff80821115611bce57600080fd5b611bda88838901611ace565b90965094506020870135915080821115611bf357600080fd5b50611c0087828801611ace565b95989497509550505050565b6020808252825182820181905260009190848201906040850190845b81811015611c4d5783516001600160a01b031683529284019291840191600101611c28565b50909695505050505050565b60008060208385031215611c6c57600080fd5b823567ffffffffffffffff80821115611c8457600080fd5b818501915085601f830112611c9857600080fd5b813581811115611ca757600080fd5b866020828501011115611cb957600080fd5b60209290920196919550909350505050565b60008060408385031215611cde57600080fd5b50508035926020909101359150565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611d2b57611d2b611d03565b5060010190565b8135611d3d816119f6565b63ffffffff811663ffffffff1983541617825550602082013560018201555050565b634e487b7160e01b600052604160045260246000fd5b600061ffff808316818516808303821115611d9257611d92611d03565b01949350505050565b60005b83811015611db6578181015183820152602001611d9e565b8381111561081f5750506000910152565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611dff816017850160208801611d9b565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351611e30816028840160208801611d9b565b01602801949350505050565b6020815260008251806020840152611e5b816040850160208701611d9b565b601f01601f19169190910160400192915050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6000816000190483118215151615611ed457611ed4611d03565b500290565b60008219821115611eec57611eec611d03565b500190565b600081611f0057611f00611d03565b506000190190565b600082821015611f1a57611f1a611d03565b500390565b634e487b7160e01b600052603160045260246000fdfe2172861495e7b85edac73e3cd5fbb42dd675baadf627720e687bcfdaca025096a164736f6c634300080d000a", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106102275760003560e01c8063649242b511610130578063a217fddf116100b8578063cd9d26a51161007c578063cd9d26a514610516578063ce53e7291461051e578063d547741f14610531578063d84c1b3814610544578063fa617bf31461055757600080fd5b8063a217fddf146104c2578063a2295927146104ca578063a83e3f0c146104dd578063b5af090f146104f0578063ca15c8731461050357600080fd5b806387ba006a116100ff57806387ba006a146104555780638cd2403d1461045d5780639010d07c1461047057806391d148541461049b57806393867fb5146104ae57600080fd5b8063649242b5146104125780637c36afad1461042757806380cfdfc21461043a5780638129fc1c1461044d57600080fd5b8063325bae6a116101b3578063467e55df11610182578063467e55df146103a15780634de42c97146103ca5780634f712cff146103dd57806354fd4d50146103f05780635d46faa4146103ff57600080fd5b8063325bae6a1461035357806336568abe146103685780633a1ec78d1461037b57806343101a451461038e57600080fd5b8063248a9ca3116101fa578063248a9ca3146102c25780632aac012c146102f35780632f2ff15d1461031a578063306275be1461032d5780633184f4d41461034057600080fd5b806301ffc9a71461022c57806305a4c0f7146102545780630f1913631461029a57806314da1add146102af575b600080fd5b61023f61023a3660046119cc565b61056a565b60405190151581526020015b60405180910390f35b6040805180820182526000808252602091820152815180830183526101005463ffffffff168082526101015491830191825283519081529051918101919091520161024b565b6102ad6102a8366004611a08565b610595565b005b6102ad6102bd366004611a3a565b6105c4565b6102e56102d0366004611a73565b60009081526065602052604090206001015490565b60405190815260200161024b565b60ff54640100000000900463ffffffff165b60405163ffffffff909116815260200161024b565b6102ad610328366004611a8c565b61071d565b6102ad61033b366004611ab1565b610743565b6102ad61034e366004611b1a565b6107ba565b60ff54600160401b900463ffffffff16610305565b6102ad610376366004611a8c565b610825565b6102ad610389366004611b5c565b6108a4565b6102ad61039c366004611b74565b6109a2565b6102e56103af366004611ab1565b6001600160a01b0316600090815260fd602052604090205490565b6102ad6103d8366004611ab1565b6109cd565b6102ad6103eb366004611a08565b6109f1565b6040516004815260200161024b565b6102ad61040d366004611ba0565b610a9c565b61041a610b42565b60405161024b9190611c0c565b610305610435366004611ab1565b610bf4565b6102ad610448366004611b1a565b610c5c565b6102ad610cc1565b60fe546102e5565b6102ad61046b366004611c59565b610d81565b61048361047e366004611ccb565b610dd2565b6040516001600160a01b03909116815260200161024b565b61023f6104a9366004611a8c565b610dea565b600080516020611f368339815191526102e5565b6102e5600081565b6102ad6104d8366004611ab1565b610e15565b6102ad6104eb366004611b74565b610e8d565b61023f6104fe366004611ab1565b610ea5565b6102e5610511366004611a73565b610eb0565b61041a610ec7565b61023f61052c366004611ab1565b610f70565b6102ad61053f366004611a8c565b610f7b565b6102ad610552366004611ab1565b610fa1565b6102ad610565366004611a73565b610fc2565b60006001600160e01b03198216635a05180f60e01b148061058f575061058f8261102b565b92915050565b6105ad600080516020611f3683398151915233611060565b806105b781611087565b6105c0826110b1565b5050565b6105dc600080516020611f3683398151915233611060565b806105e681611087565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811690841614158015610629575061062783611133565b155b1561064757604051630b094f2760e31b815260040160405180910390fd5b6001600160a01b0383166000908152610102602052604090205463ffffffff6101009091048116908316810361067d5750505050565b6040805180820182526001815263ffffffff85811660208084018281526001600160a01b038a166000818152610102845287902095518654925164ffffffffff1990931690151564ffffffff0019161761010092861692909202919091179094558451928616835282015290917fe9b262e9376e7127d0246f98c1ab2e98fb430e73dcd665322ea46df0ce094af391015b60405180910390a2505b505050565b6000828152606560205260409020600101546107398133611140565b61071883836111a4565b61075b600080516020611f3683398151915233611060565b61076660fb826111c6565b6107835760405163b0ce759160e01b815260040160405180910390fd5b6040516001600160a01b038216907fdd2e6d9f52cbe8f695939d018b7d4a216dc613a669876163ac548b916489d91790600090a250565b6107d2600080516020611f3683398151915233611060565b8060005b8181101561081f5761080d8484838181106107f3576107f3611ced565b90506020020160208101906108089190611ab1565b6111db565b8061081781611d19565b9150506107d6565b50505050565b6001600160a01b038116331461089a5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b6105c08282611246565b6108bc600080516020611f3683398151915233611060565b6108c96020820182611a08565b6108d281611087565b81602001356108e081611268565b610100546101015463ffffffff909116906108fe6020860186611a08565b63ffffffff168263ffffffff1614801561091b5750846020013581145b15610927575050505050565b846101006109358282611d32565b507fc0c001b93aede4379dd063acffffdf190292a31ccf86bbbf5399ab3480f3ebb19050826109676020880188611a08565b6040805163ffffffff938416815292909116602083810191909152908201849052870135606082015260800160405180910390a15050505050565b6109ba600080516020611f3683398151915233611060565b6109c382611289565b6105c082826112f3565b6109e5600080516020611f3683398151915233611060565b6109ee816111db565b50565b610a09600080516020611f3683398151915233611060565b80610a1381611087565b60ff5463ffffffff64010000000090910481169083168103610a3457505050565b60ff805467ffffffff00000000191664010000000063ffffffff8681169182029290921790925560408051918416825260208201929092527f5694fc3b551ce2e4a457649f95500c545f27fce9ef7c3818cfb3c52134223dcb910160405180910390a1505050565b610ab4600080516020611f3683398151915233611060565b82818114610ad557604051633494a40d60e21b815260040160405180910390fd5b60005b81811015610b3a57610b28868683818110610af557610af5611ced565b9050602002016020810190610b0a9190611ab1565b858584818110610b1c57610b1c611ced565b905060200201356112f3565b80610b3281611d19565b915050610ad8565b505050505050565b60606000610b5161010361139b565b905060008167ffffffffffffffff811115610b6e57610b6e611d5f565b604051908082528060200260200182016040528015610b97578160200160208202803683370190505b50905060005b82811015610bed57610bb1610103826113a5565b828281518110610bc357610bc3611ced565b6001600160a01b039092166020928302919091019091015280610be581611d19565b915050610b9d565b5092915050565b6001600160a01b03811660009081526101026020908152604080832081518083019092525460ff8116151580835261010090910463ffffffff169282019290925290610c4f5760ff54600160401b900463ffffffff16610c55565b80602001515b9392505050565b610c74600080516020611f3683398151915233611060565b8060005b8181101561081f57610caf848483818110610c9557610c95611ced565b9050602002016020810190610caa9190611ab1565b611289565b80610cb981611d19565b915050610c78565b600054610100900460ff16610cdc5760005460ff1615610ce0565b303b155b610d435760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610891565b600054610100900460ff16158015610d65576000805461ffff19166101011790555b610d6d6113b1565b80156109ee576000805461ff001916905550565b60c954600090610d969061ffff166001611d75565b905061ffff8116600414610dbc5760405162dc149f60e41b815260040160405180910390fd5b60c9805461ffff191661ffff8316179055505050565b6000828152609760205260408120610c5590836113a5565b60009182526065602090815260408084206001600160a01b0393909316845291905290205460ff1690565b610e2d600080516020611f3683398151915233611060565b610e39610103826111c6565b610e565760405163b0ce759160e01b815260040160405180910390fd5b6040516001600160a01b038216907fbbc467e0c6d3ec4ae1b648a408fc4ce0397f4b0d10581a5453c06176e688efb990600090a250565b6109c3600080516020611f3683398151915233611060565b600061058f82611133565b600081815260976020526040812061058f9061139b565b60606000610ed560fb61139b565b905060008167ffffffffffffffff811115610ef257610ef2611d5f565b604051908082528060200260200182016040528015610f1b578160200160208202803683370190505b50905060005b82811015610bed57610f3460fb826113a5565b828281518110610f4657610f46611ced565b6001600160a01b039092166020928302919091019091015280610f6881611d19565b915050610f21565b600061058f826113ea565b600082815260656020526040902060010154610f978133611140565b6107188383611246565b610fb9600080516020611f3683398151915233611060565b6109ee81611289565b610fda600080516020611f3683398151915233611060565b60fe54818103610fe8575050565b60fe82905560408051828152602081018490527fa331479cec90af3eef92e0ee6f6cd19f7912d7bb73f8d9885083d6ffa98b077291015b60405180910390a15050565b60006001600160e01b03198216637965db0b60e01b148061058f57506301ffc9a760e01b6001600160e01b031983161461058f565b61106a8282610dea565b6105c057604051634ca8886760e01b815260040160405180910390fd5b620f424063ffffffff821611156109ee576040516358d620b360e01b815260040160405180910390fd5b60ff5463ffffffff600160401b909104811690821681036110d0575050565b60ff80546bffffffff00000000000000001916600160401b63ffffffff8581169182029290921790925560408051918416825260208201929092527f3150357e7ae28a36ec737b6b68396e3d6e6045739a37622ef936636add183106910161101f565b600061058f60fb836113f4565b61114a8282610dea565b6105c057611162816001600160a01b03166014611416565b61116d836020611416565b60405160200161117e929190611dc7565b60408051601f198184030181529082905262461bcd60e51b825261089191600401611e3c565b6111ae82826115b2565b60008281526097602052604090206107189082611638565b6000610c55836001600160a01b03841661164d565b806111e581611740565b6111f161010383611638565b61120e5760405163119b4fd360e11b815260040160405180910390fd5b6040516001600160a01b038316907fed70cb132cde4fb29993b167b06db345dd5a55371302ffcf02bcae5c8697ca8990600090a25050565b611250828261177c565b600082815260976020526040902061071890826111c6565b806000036109ee57604051637c946ed760e01b815260040160405180910390fd5b8061129381611740565b61129e60fb83611638565b6112bb5760405163119b4fd360e11b815260040160405180910390fd5b6040516001600160a01b038316907fa718ddb71589521cab00fa313e3bd14e75ca7204d57a12ff3a5aa40796f3427690600090a25050565b816112fd816117e3565b61130683611133565b61132357604051630b094f2760e31b815260040160405180910390fd5b6001600160a01b038316600090815260fd60205260409020548281036113495750505050565b6001600160a01b038416600081815260fd602090815260409182902086905581518481529081018690527f1a06df86f888ab7df8687a48f67c1ae98d193e315d76c842736d851adac8dda5910161070e565b600061058f825490565b6000610c55838361180a565b600054610100900460ff166113d85760405162461bcd60e51b815260040161089190611e6f565b6113e0611834565b6113e861186b565b565b600061058f610103835b6001600160a01b03811660009081526001830160205260408120541515610c55565b60606000611425836002611eba565b611430906002611ed9565b67ffffffffffffffff81111561144857611448611d5f565b6040519080825280601f01601f191660200182016040528015611472576020820181803683370190505b509050600360fc1b8160008151811061148d5761148d611ced565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106114bc576114bc611ced565b60200101906001600160f81b031916908160001a90535060006114e0846002611eba565b6114eb906001611ed9565b90505b6001811115611563576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061151f5761151f611ced565b1a60f81b82828151811061153557611535611ced565b60200101906001600160f81b031916908160001a90535060049490941c9361155c81611ef1565b90506114ee565b508315610c555760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610891565b6115bc8282610dea565b6105c05760008281526065602090815260408083206001600160a01b03851684529091529020805460ff191660011790556115f43390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000610c55836001600160a01b03841661189c565b60008181526001830160205260408120548015611736576000611671600183611f08565b855490915060009061168590600190611f08565b90508181146116ea5760008660000182815481106116a5576116a5611ced565b90600052602060002001549050808760000184815481106116c8576116c8611ced565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806116fb576116fb611f1f565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061058f565b600091505061058f565b6001600160a01b038116158061175e57506001600160a01b03811630145b156109ee57604051638e052b6760e01b815260040160405180910390fd5b6117868282610dea565b156105c05760008281526065602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6001600160a01b0381166109ee5760405163e6c4247b60e01b815260040160405180910390fd5b600082600001828154811061182157611821611ced565b9060005260206000200154905092915050565b600054610100900460ff1661185b5760405162461bcd60e51b815260040161089190611e6f565b6118636118eb565b6113e8611912565b600054610100900460ff166118925760405162461bcd60e51b815260040161089190611e6f565b6113e860006110b1565b60008181526001830160205260408120546118e35750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561058f565b50600061058f565b600054610100900460ff166113e85760405162461bcd60e51b815260040161089190611e6f565b600054610100900460ff166119395760405162461bcd60e51b815260040161089190611e6f565b60c9805461ffff1916600117905561195f600080516020611f3683398151915280611977565b6113e8600080516020611f36833981519152336119c2565b600082815260656020526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6105c082826111a4565b6000602082840312156119de57600080fd5b81356001600160e01b031981168114610c5557600080fd5b63ffffffff811681146109ee57600080fd5b600060208284031215611a1a57600080fd5b8135610c55816119f6565b6001600160a01b03811681146109ee57600080fd5b60008060408385031215611a4d57600080fd5b8235611a5881611a25565b91506020830135611a68816119f6565b809150509250929050565b600060208284031215611a8557600080fd5b5035919050565b60008060408385031215611a9f57600080fd5b823591506020830135611a6881611a25565b600060208284031215611ac357600080fd5b8135610c5581611a25565b60008083601f840112611ae057600080fd5b50813567ffffffffffffffff811115611af857600080fd5b6020830191508360208260051b8501011115611b1357600080fd5b9250929050565b60008060208385031215611b2d57600080fd5b823567ffffffffffffffff811115611b4457600080fd5b611b5085828601611ace565b90969095509350505050565b600060408284031215611b6e57600080fd5b50919050565b60008060408385031215611b8757600080fd5b8235611b9281611a25565b946020939093013593505050565b60008060008060408587031215611bb657600080fd5b843567ffffffffffffffff80821115611bce57600080fd5b611bda88838901611ace565b90965094506020870135915080821115611bf357600080fd5b50611c0087828801611ace565b95989497509550505050565b6020808252825182820181905260009190848201906040850190845b81811015611c4d5783516001600160a01b031683529284019291840191600101611c28565b50909695505050505050565b60008060208385031215611c6c57600080fd5b823567ffffffffffffffff80821115611c8457600080fd5b818501915085601f830112611c9857600080fd5b813581811115611ca757600080fd5b866020828501011115611cb957600080fd5b60209290920196919550909350505050565b60008060408385031215611cde57600080fd5b50508035926020909101359150565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611d2b57611d2b611d03565b5060010190565b8135611d3d816119f6565b63ffffffff811663ffffffff1983541617825550602082013560018201555050565b634e487b7160e01b600052604160045260246000fd5b600061ffff808316818516808303821115611d9257611d92611d03565b01949350505050565b60005b83811015611db6578181015183820152602001611d9e565b8381111561081f5750506000910152565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611dff816017850160208801611d9b565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351611e30816028840160208801611d9b565b01602801949350505050565b6020815260008251806020840152611e5b816040850160208701611d9b565b601f01601f19169190910160400192915050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6000816000190483118215151615611ed457611ed4611d03565b500290565b60008219821115611eec57611eec611d03565b500190565b600081611f0057611f00611d03565b506000190190565b600082821015611f1a57611f1a611d03565b500390565b634e487b7160e01b600052603160045260246000fdfe2172861495e7b85edac73e3cd5fbb42dd675baadf627720e687bcfdaca025096a164736f6c634300080d000a", "devdoc": { "details": "Network Settings contract", "events": { @@ -871,9 +968,15 @@ "TokenAddedToWhitelist(address)": { "details": "triggered when a token is added to the protection whitelist" }, + "TokenAddedToWhitelistForPOL(address)": { + "details": "triggered when a token is added to the whitelist for POL" + }, "TokenRemovedFromWhitelist(address)": { "details": "triggered when a token is removed from the protection whitelist" }, + "TokenRemovedFromWhitelistForPOL(address)": { + "details": "triggered when a token is removed from the whitelist for POL" + }, "VortexBurnRewardUpdated(uint32,uint32,uint256,uint256)": { "details": "triggered when the settings of the Vortex are updated" }, @@ -886,12 +989,18 @@ "addTokenToWhitelist(address)": { "details": "adds a token to the protected tokens whitelist requirements: - the caller must be the admin of the contract" }, + "addTokenToWhitelistForPOL(address)": { + "details": "adds a token to the tokens whitelist for POL requirements: - the caller must be the admin of the contract" + }, "addTokenToWhitelistWithLimit(address,uint256)": { "details": "adds a token to the protected tokens whitelist, and sets the amount of BNT that the protocol can provide as funding for this pool requirements: - the caller must be the admin of the contract" }, "addTokensToWhitelist(address[])": { "details": "adds tokens to the protected tokens whitelist requirements: - the caller must be the admin of the contract" }, + "addTokensToWhitelistForPOL(address[])": { + "details": "adds tokens to the tokens whitelist for POL requirements: - the caller must be the admin of the contract" + }, "defaultFlashLoanFeePPM()": { "details": "returns the default flash-loan fee (in units of PPM)" }, @@ -919,6 +1028,9 @@ "isTokenWhitelisted(address)": { "details": "checks whether a given token is whitelisted" }, + "isTokenWhitelistedForPOL(address)": { + "details": "checks whether a given token is whitelist for POL" + }, "minLiquidityForTrading()": { "details": "returns the minimum BNT trading liquidity required before the system enables trading in the relevant pool" }, @@ -934,6 +1046,9 @@ "removeTokenFromWhitelist(address)": { "details": "removes a token from the protected tokens whitelist requirements: - the caller must be the admin of the contract" }, + "removeTokenFromWhitelistForPOL(address)": { + "details": "removes a token from the tokens whitelist for POL requirements: - the caller must be the admin of the contract" + }, "renounceRole(bytes32,address)": { "details": "Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `account`." }, @@ -967,6 +1082,9 @@ "supportsInterface(bytes4)": { "details": "See {IERC165-supportsInterface}." }, + "tokenWhitelistForPOL()": { + "details": "returns the tokens whitelist for POL" + }, "vortexRewards()": { "details": "returns the vortex settings" }, @@ -1048,7 +1166,7 @@ "type": "t_array(t_uint256)49_storage" }, { - "astId": 31429, + "astId": 33003, "contract": "contracts/network/NetworkSettings.sol:NetworkSettings", "label": "_initializations", "offset": 0, @@ -1056,7 +1174,7 @@ "type": "t_uint16" }, { - "astId": 31435, + "astId": 33009, "contract": "contracts/network/NetworkSettings.sol:NetworkSettings", "label": "__gap", "offset": 0, @@ -1064,7 +1182,7 @@ "type": "t_array(t_uint256)49_storage" }, { - "astId": 14919, + "astId": 15943, "contract": "contracts/network/NetworkSettings.sol:NetworkSettings", "label": "_protectedTokenWhitelist", "offset": 0, @@ -1072,15 +1190,15 @@ "type": "t_struct(AddressSet)1737_storage" }, { - "astId": 14924, + "astId": 15948, "contract": "contracts/network/NetworkSettings.sol:NetworkSettings", "label": "_poolFundingLimits", "offset": 0, "slot": "253", - "type": "t_mapping(t_contract(Token)29301,t_uint256)" + "type": "t_mapping(t_contract(Token)30851,t_uint256)" }, { - "astId": 14926, + "astId": 15950, "contract": "contracts/network/NetworkSettings.sol:NetworkSettings", "label": "_minLiquidityForTrading", "offset": 0, @@ -1088,7 +1206,7 @@ "type": "t_uint256" }, { - "astId": 14928, + "astId": 15952, "contract": "contracts/network/NetworkSettings.sol:NetworkSettings", "label": "_deprecated0", "offset": 0, @@ -1096,7 +1214,7 @@ "type": "t_uint32" }, { - "astId": 14930, + "astId": 15954, "contract": "contracts/network/NetworkSettings.sol:NetworkSettings", "label": "_withdrawalFeePPM", "offset": 4, @@ -1104,7 +1222,7 @@ "type": "t_uint32" }, { - "astId": 14932, + "astId": 15956, "contract": "contracts/network/NetworkSettings.sol:NetworkSettings", "label": "_defaultFlashLoanFeePPM", "offset": 8, @@ -1112,28 +1230,36 @@ "type": "t_uint32" }, { - "astId": 14935, + "astId": 15959, "contract": "contracts/network/NetworkSettings.sol:NetworkSettings", "label": "_vortexRewards", "offset": 0, "slot": "256", - "type": "t_struct(VortexRewards)16889_storage" + "type": "t_struct(VortexRewards)18169_storage" }, { - "astId": 14941, + "astId": 15965, "contract": "contracts/network/NetworkSettings.sol:NetworkSettings", "label": "_flashLoanFees", "offset": 0, "slot": "258", - "type": "t_mapping(t_contract(Token)29301,t_struct(FlashLoanFee)14913_storage)" + "type": "t_mapping(t_contract(Token)30851,t_struct(FlashLoanFee)15937_storage)" }, { - "astId": 14947, + "astId": 15968, "contract": "contracts/network/NetworkSettings.sol:NetworkSettings", - "label": "__gap", + "label": "_tokenWhitelistForPOL", "offset": 0, "slot": "259", - "type": "t_array(t_uint256)42_storage" + "type": "t_struct(AddressSet)1737_storage" + }, + { + "astId": 15974, + "contract": "contracts/network/NetworkSettings.sol:NetworkSettings", + "label": "__gap", + "offset": 0, + "slot": "261", + "type": "t_array(t_uint256)40_storage" } ], "types": { @@ -1148,11 +1274,11 @@ "label": "bytes32[]", "numberOfBytes": "32" }, - "t_array(t_uint256)42_storage": { + "t_array(t_uint256)40_storage": { "base": "t_uint256", "encoding": "inplace", - "label": "uint256[42]", - "numberOfBytes": "1344" + "label": "uint256[40]", + "numberOfBytes": "1280" }, "t_array(t_uint256)49_storage": { "base": "t_uint256", @@ -1176,7 +1302,7 @@ "label": "bytes32", "numberOfBytes": "32" }, - "t_contract(Token)29301": { + "t_contract(Token)30851": { "encoding": "inplace", "label": "contract Token", "numberOfBytes": "20" @@ -1209,16 +1335,16 @@ "numberOfBytes": "32", "value": "t_uint256" }, - "t_mapping(t_contract(Token)29301,t_struct(FlashLoanFee)14913_storage)": { + "t_mapping(t_contract(Token)30851,t_struct(FlashLoanFee)15937_storage)": { "encoding": "mapping", - "key": "t_contract(Token)29301", + "key": "t_contract(Token)30851", "label": "mapping(contract Token => struct NetworkSettings.FlashLoanFee)", "numberOfBytes": "32", - "value": "t_struct(FlashLoanFee)14913_storage" + "value": "t_struct(FlashLoanFee)15937_storage" }, - "t_mapping(t_contract(Token)29301,t_uint256)": { + "t_mapping(t_contract(Token)30851,t_uint256)": { "encoding": "mapping", - "key": "t_contract(Token)29301", + "key": "t_contract(Token)30851", "label": "mapping(contract Token => uint256)", "numberOfBytes": "32", "value": "t_uint256" @@ -1238,12 +1364,12 @@ ], "numberOfBytes": "64" }, - "t_struct(FlashLoanFee)14913_storage": { + "t_struct(FlashLoanFee)15937_storage": { "encoding": "inplace", "label": "struct NetworkSettings.FlashLoanFee", "members": [ { - "astId": 14910, + "astId": 15934, "contract": "contracts/network/NetworkSettings.sol:NetworkSettings", "label": "initialized", "offset": 0, @@ -1251,7 +1377,7 @@ "type": "t_bool" }, { - "astId": 14912, + "astId": 15936, "contract": "contracts/network/NetworkSettings.sol:NetworkSettings", "label": "feePPM", "offset": 1, @@ -1307,12 +1433,12 @@ ], "numberOfBytes": "64" }, - "t_struct(VortexRewards)16889_storage": { + "t_struct(VortexRewards)18169_storage": { "encoding": "inplace", "label": "struct VortexRewards", "members": [ { - "astId": 16886, + "astId": 18166, "contract": "contracts/network/NetworkSettings.sol:NetworkSettings", "label": "burnRewardPPM", "offset": 0, @@ -1320,7 +1446,7 @@ "type": "t_uint32" }, { - "astId": 16888, + "astId": 18168, "contract": "contracts/network/NetworkSettings.sol:NetworkSettings", "label": "burnRewardMaxAmount", "offset": 0, diff --git a/deployments/mainnet/PoolCollectionType1V12.json b/deployments/mainnet/PoolCollectionType1V12.json new file mode 100644 index 000000000..2c6438239 --- /dev/null +++ b/deployments/mainnet/PoolCollectionType1V12.json @@ -0,0 +1,2050 @@ +{ + "address": "0xde1B3CcfC45e3F5bff7f43516F2Cd43364D883E4", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IBancorNetwork", + "name": "initNetwork", + "type": "address" + }, + { + "internalType": "contract IERC20", + "name": "initBNT", + "type": "address" + }, + { + "internalType": "contract INetworkSettings", + "name": "initNetworkSettings", + "type": "address" + }, + { + "internalType": "contract IMasterVault", + "name": "initMasterVault", + "type": "address" + }, + { + "internalType": "contract IBNTPool", + "name": "initBNTPool", + "type": "address" + }, + { + "internalType": "contract IExternalProtectionVault", + "name": "initExternalProtectionVault", + "type": "address" + }, + { + "internalType": "contract IPoolTokenFactory", + "name": "initPoolTokenFactory", + "type": "address" + }, + { + "internalType": "contract IPoolMigrator", + "name": "initPoolMigrator", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "AccessDenied", + "type": "error" + }, + { + "inputs": [], + "name": "AlreadyEnabled", + "type": "error" + }, + { + "inputs": [], + "name": "AlreadyExists", + "type": "error" + }, + { + "inputs": [], + "name": "DepositingDisabled", + "type": "error" + }, + { + "inputs": [], + "name": "DoesNotExist", + "type": "error" + }, + { + "inputs": [], + "name": "FundingLimitTooHigh", + "type": "error" + }, + { + "inputs": [], + "name": "InsufficientLiquidity", + "type": "error" + }, + { + "inputs": [], + "name": "InsufficientSourceAmount", + "type": "error" + }, + { + "inputs": [], + "name": "InsufficientTargetAmount", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidAddress", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidFee", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidFraction", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidParam", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidRate", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidStakedBalance", + "type": "error" + }, + { + "inputs": [], + "name": "NotWhitelisted", + "type": "error" + }, + { + "inputs": [], + "name": "Overflow", + "type": "error" + }, + { + "inputs": [], + "name": "PoolCollectionWithdrawalInputInvalid", + "type": "error" + }, + { + "inputs": [], + "name": "RateUnstable", + "type": "error" + }, + { + "inputs": [], + "name": "SameOwner", + "type": "error" + }, + { + "inputs": [], + "name": "TradingDisabled", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroValue", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "prevFeePPM", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "newFeePPM", + "type": "uint32" + } + ], + "name": "DefaultTradingFeePPMUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract Token", + "name": "pool", + "type": "address" + }, + { + "indexed": true, + "internalType": "bool", + "name": "newStatus", + "type": "bool" + } + ], + "name": "DepositingEnabled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "prevFeePPM", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "newFeePPM", + "type": "uint32" + } + ], + "name": "NetworkFeePPMUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "prevOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnerUpdate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "contextId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "provider", + "type": "address" + }, + { + "indexed": true, + "internalType": "contract Token", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "baseTokenAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "poolTokenAmount", + "type": "uint256" + } + ], + "name": "TokensDeposited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "contextId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "provider", + "type": "address" + }, + { + "indexed": true, + "internalType": "contract Token", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "baseTokenAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "poolTokenAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "externalProtectionBaseTokenAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "bntAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "withdrawalFeeAmount", + "type": "uint256" + } + ], + "name": "TokensWithdrawn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "contextId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "contract Token", + "name": "pool", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "liquidity", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "stakedBalance", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "poolTokenSupply", + "type": "uint256" + } + ], + "name": "TotalLiquidityUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract Token", + "name": "pool", + "type": "address" + }, + { + "indexed": true, + "internalType": "bool", + "name": "newStatus", + "type": "bool" + }, + { + "indexed": true, + "internalType": "uint8", + "name": "reason", + "type": "uint8" + } + ], + "name": "TradingEnabled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract Token", + "name": "pool", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "prevFeePPM", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "newFeePPM", + "type": "uint32" + } + ], + "name": "TradingFeePPMUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "contextId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "contract Token", + "name": "pool", + "type": "address" + }, + { + "indexed": true, + "internalType": "contract Token", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "prevLiquidity", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newLiquidity", + "type": "uint256" + } + ], + "name": "TradingLiquidityUpdated", + "type": "event" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract Token", + "name": "token", + "type": "address" + } + ], + "name": "createPool", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "defaultTradingFeePPM", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "contextId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "provider", + "type": "address" + }, + { + "internalType": "contract Token", + "name": "pool", + "type": "address" + }, + { + "internalType": "uint256", + "name": "baseTokenAmount", + "type": "uint256" + } + ], + "name": "depositFor", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract Token", + "name": "pool", + "type": "address" + } + ], + "name": "depositingEnabled", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract Token", + "name": "pool", + "type": "address" + } + ], + "name": "disableTrading", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract Token", + "name": "pool", + "type": "address" + } + ], + "name": "disableTradingByNetwork", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract Token", + "name": "pool", + "type": "address" + }, + { + "internalType": "bool", + "name": "status", + "type": "bool" + } + ], + "name": "enableDepositing", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract Token", + "name": "pool", + "type": "address" + }, + { + "internalType": "uint256", + "name": "bntVirtualBalance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "baseTokenVirtualBalance", + "type": "uint256" + } + ], + "name": "enableTrading", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract Token", + "name": "pool", + "type": "address" + } + ], + "name": "isPoolStable", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract Token", + "name": "pool", + "type": "address" + } + ], + "name": "isPoolValid", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract Token", + "name": "pool", + "type": "address" + }, + { + "components": [ + { + "internalType": "contract IPoolToken", + "name": "poolToken", + "type": "address" + }, + { + "internalType": "uint32", + "name": "tradingFeePPM", + "type": "uint32" + }, + { + "internalType": "bool", + "name": "tradingEnabled", + "type": "bool" + }, + { + "internalType": "bool", + "name": "depositingEnabled", + "type": "bool" + }, + { + "components": [ + { + "internalType": "uint32", + "name": "blockNumber", + "type": "uint32" + }, + { + "components": [ + { + "internalType": "uint112", + "name": "n", + "type": "uint112" + }, + { + "internalType": "uint112", + "name": "d", + "type": "uint112" + } + ], + "internalType": "struct Fraction112", + "name": "rate", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint112", + "name": "n", + "type": "uint112" + }, + { + "internalType": "uint112", + "name": "d", + "type": "uint112" + } + ], + "internalType": "struct Fraction112", + "name": "invRate", + "type": "tuple" + } + ], + "internalType": "struct AverageRates", + "name": "averageRates", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint128", + "name": "bntTradingLiquidity", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "baseTokenTradingLiquidity", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "stakedBalance", + "type": "uint256" + } + ], + "internalType": "struct PoolLiquidity", + "name": "liquidity", + "type": "tuple" + } + ], + "internalType": "struct Pool", + "name": "data", + "type": "tuple" + } + ], + "name": "migratePoolIn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract Token", + "name": "pool", + "type": "address" + }, + { + "internalType": "contract IPoolCollection", + "name": "targetPoolCollection", + "type": "address" + } + ], + "name": "migratePoolOut", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "networkFeePPM", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "newOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract Token", + "name": "pool", + "type": "address" + }, + { + "internalType": "uint256", + "name": "feeAmount", + "type": "uint256" + } + ], + "name": "onFeesCollected", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "poolCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract Token", + "name": "pool", + "type": "address" + } + ], + "name": "poolData", + "outputs": [ + { + "components": [ + { + "internalType": "contract IPoolToken", + "name": "poolToken", + "type": "address" + }, + { + "internalType": "uint32", + "name": "tradingFeePPM", + "type": "uint32" + }, + { + "internalType": "bool", + "name": "tradingEnabled", + "type": "bool" + }, + { + "internalType": "bool", + "name": "depositingEnabled", + "type": "bool" + }, + { + "components": [ + { + "internalType": "uint32", + "name": "blockNumber", + "type": "uint32" + }, + { + "components": [ + { + "internalType": "uint112", + "name": "n", + "type": "uint112" + }, + { + "internalType": "uint112", + "name": "d", + "type": "uint112" + } + ], + "internalType": "struct Fraction112", + "name": "rate", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint112", + "name": "n", + "type": "uint112" + }, + { + "internalType": "uint112", + "name": "d", + "type": "uint112" + } + ], + "internalType": "struct Fraction112", + "name": "invRate", + "type": "tuple" + } + ], + "internalType": "struct AverageRates", + "name": "averageRates", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint128", + "name": "bntTradingLiquidity", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "baseTokenTradingLiquidity", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "stakedBalance", + "type": "uint256" + } + ], + "internalType": "struct PoolLiquidity", + "name": "liquidity", + "type": "tuple" + } + ], + "internalType": "struct Pool", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract Token", + "name": "pool", + "type": "address" + } + ], + "name": "poolLiquidity", + "outputs": [ + { + "components": [ + { + "internalType": "uint128", + "name": "bntTradingLiquidity", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "baseTokenTradingLiquidity", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "stakedBalance", + "type": "uint256" + } + ], + "internalType": "struct PoolLiquidity", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract Token", + "name": "pool", + "type": "address" + } + ], + "name": "poolToken", + "outputs": [ + { + "internalType": "contract IPoolToken", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract Token", + "name": "pool", + "type": "address" + }, + { + "internalType": "uint256", + "name": "baseTokenAmountToDistribute", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "protocolPoolTokenAmount", + "type": "uint256" + } + ], + "name": "poolTokenAmountToBurn", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract Token", + "name": "pool", + "type": "address" + }, + { + "internalType": "uint256", + "name": "poolTokenAmount", + "type": "uint256" + } + ], + "name": "poolTokenToUnderlying", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "poolType", + "outputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pools", + "outputs": [ + { + "internalType": "contract Token[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "newDefaultTradingFeePPM", + "type": "uint32" + } + ], + "name": "setDefaultTradingFeePPM", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "newNetworkFeePPM", + "type": "uint32" + } + ], + "name": "setNetworkFeePPM", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract Token", + "name": "pool", + "type": "address" + }, + { + "internalType": "uint32", + "name": "newTradingFeePPM", + "type": "uint32" + } + ], + "name": "setTradingFeePPM", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "contextId", + "type": "bytes32" + }, + { + "internalType": "contract Token", + "name": "sourceToken", + "type": "address" + }, + { + "internalType": "contract Token", + "name": "targetToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "sourceAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minReturnAmount", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "ignoreFees", + "type": "bool" + } + ], + "name": "tradeBySourceAmount", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tradingFeeAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "networkFeeAmount", + "type": "uint256" + } + ], + "internalType": "struct TradeAmountAndFee", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "contextId", + "type": "bytes32" + }, + { + "internalType": "contract Token", + "name": "sourceToken", + "type": "address" + }, + { + "internalType": "contract Token", + "name": "targetToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "targetAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxSourceAmount", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "ignoreFees", + "type": "bool" + } + ], + "name": "tradeByTargetAmount", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tradingFeeAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "networkFeeAmount", + "type": "uint256" + } + ], + "internalType": "struct TradeAmountAndFee", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract Token", + "name": "sourceToken", + "type": "address" + }, + { + "internalType": "contract Token", + "name": "targetToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "targetAmount", + "type": "uint256" + } + ], + "name": "tradeInputAndFeeByTargetAmount", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tradingFeeAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "networkFeeAmount", + "type": "uint256" + } + ], + "internalType": "struct TradeAmountAndFee", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract Token", + "name": "sourceToken", + "type": "address" + }, + { + "internalType": "contract Token", + "name": "targetToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "sourceAmount", + "type": "uint256" + } + ], + "name": "tradeOutputAndFeeBySourceAmount", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tradingFeeAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "networkFeeAmount", + "type": "uint256" + } + ], + "internalType": "struct TradeAmountAndFee", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract Token", + "name": "pool", + "type": "address" + } + ], + "name": "tradingEnabled", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract Token", + "name": "pool", + "type": "address" + } + ], + "name": "tradingFeePPM", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "ownerCandidate", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract Token", + "name": "pool", + "type": "address" + }, + { + "internalType": "uint256", + "name": "baseTokenAmount", + "type": "uint256" + } + ], + "name": "underlyingToPoolToken", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract Token", + "name": "pool", + "type": "address" + } + ], + "name": "updateTradingLiquidity", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "version", + "outputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "contextId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "provider", + "type": "address" + }, + { + "internalType": "contract Token", + "name": "pool", + "type": "address" + }, + { + "internalType": "uint256", + "name": "poolTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "baseTokenAmount", + "type": "uint256" + } + ], + "name": "withdraw", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract Token", + "name": "pool", + "type": "address" + }, + { + "internalType": "uint256", + "name": "poolTokenAmount", + "type": "uint256" + } + ], + "name": "withdrawalAmounts", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "totalAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "baseTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "bntAmount", + "type": "uint256" + } + ], + "internalType": "struct WithdrawalAmounts", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0x8770c5ab2127f2e301dc8f90eb0fa8880152701d334f361b8b8ea78f8805f76a", + "receipt": { + "to": null, + "from": "0x5bEBA4D3533a963Dedb270a95ae5f7752fA0Fe22", + "contractAddress": "0xde1B3CcfC45e3F5bff7f43516F2Cd43364D883E4", + "transactionIndex": 617, + "gasUsed": "5350159", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000002000008000000000000000000020000000000000000000800000000400000000000000000000000000000000000000000000000000000000000000000000001000000000000000008000000000000000000000020000000000000000000000000000000000000000000000800000000100000000000000000000000000000200200000000000020000000000800000000000000020000000000000000080000000000000000000000", + "blockHash": "0x92e1994bc56381b38559a0d6afceb9afc86f3be2c11510167ace564dc7602879", + "transactionHash": "0x8770c5ab2127f2e301dc8f90eb0fa8880152701d334f361b8b8ea78f8805f76a", + "logs": [ + { + "transactionIndex": 617, + "blockNumber": 18127255, + "transactionHash": "0x8770c5ab2127f2e301dc8f90eb0fa8880152701d334f361b8b8ea78f8805f76a", + "address": "0xde1B3CcfC45e3F5bff7f43516F2Cd43364D883E4", + "topics": [ + "0x343765429aea5a34b3ff6a3785a98a5abb2597aca87bfbb58632c173d585373a", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000005beba4d3533a963dedb270a95ae5f7752fa0fe22" + ], + "data": "0x", + "logIndex": 225, + "blockHash": "0x92e1994bc56381b38559a0d6afceb9afc86f3be2c11510167ace564dc7602879" + }, + { + "transactionIndex": 617, + "blockNumber": 18127255, + "transactionHash": "0x8770c5ab2127f2e301dc8f90eb0fa8880152701d334f361b8b8ea78f8805f76a", + "address": "0xde1B3CcfC45e3F5bff7f43516F2Cd43364D883E4", + "topics": [ + "0xb804b0ec3f0ea43004870df377170ce44cb789adca16d23286e337605558117f" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007d0", + "logIndex": 226, + "blockHash": "0x92e1994bc56381b38559a0d6afceb9afc86f3be2c11510167ace564dc7602879" + }, + { + "transactionIndex": 617, + "blockNumber": 18127255, + "transactionHash": "0x8770c5ab2127f2e301dc8f90eb0fa8880152701d334f361b8b8ea78f8805f76a", + "address": "0xde1B3CcfC45e3F5bff7f43516F2Cd43364D883E4", + "topics": [ + "0x1f1f36475e04b1709caf649fc7f00350aa38c7f7f110f653e81f79011db0867c" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030d40", + "logIndex": 227, + "blockHash": "0x92e1994bc56381b38559a0d6afceb9afc86f3be2c11510167ace564dc7602879" + } + ], + "blockNumber": 18127255, + "cumulativeGasUsed": "26898333", + "status": 1, + "byzantium": true + }, + "args": [ + "0xeEF417e1D5CC832e619ae18D2F140De2999dD4fB", + "0x1F573D6Fb3F13d689FF844B4cE37794d79a7FF1C", + "0x83E1814ba31F7ea95D216204BB45FE75Ce09b14F", + "0x649765821D9f64198c905eC0B2B037a4a52Bc373", + "0x02651E355D26f3506C1E644bA393FDD9Ac95EaCa", + "0xFd31662b3d54eddE9B6Bdd32c9c27C8E292cAD57", + "0x9E912953DB31fE933BDa43374208E967058D9d5F", + "0x97CeC0F2D355BF073619A5093F989709caE4a191" + ], + "numDeployments": 1, + "solcInputHash": "4a12fa84003cd14a8d58a795b8fd43b8", + "metadata": "{\"compiler\":{\"version\":\"0.8.13+commit.abaa5c0e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IBancorNetwork\",\"name\":\"initNetwork\",\"type\":\"address\"},{\"internalType\":\"contract IERC20\",\"name\":\"initBNT\",\"type\":\"address\"},{\"internalType\":\"contract INetworkSettings\",\"name\":\"initNetworkSettings\",\"type\":\"address\"},{\"internalType\":\"contract IMasterVault\",\"name\":\"initMasterVault\",\"type\":\"address\"},{\"internalType\":\"contract IBNTPool\",\"name\":\"initBNTPool\",\"type\":\"address\"},{\"internalType\":\"contract IExternalProtectionVault\",\"name\":\"initExternalProtectionVault\",\"type\":\"address\"},{\"internalType\":\"contract IPoolTokenFactory\",\"name\":\"initPoolTokenFactory\",\"type\":\"address\"},{\"internalType\":\"contract IPoolMigrator\",\"name\":\"initPoolMigrator\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AccessDenied\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AlreadyEnabled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AlreadyExists\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DepositingDisabled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DoesNotExist\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FundingLimitTooHigh\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientLiquidity\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientSourceAmount\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientTargetAmount\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidFee\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidFraction\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidParam\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidRate\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidStakedBalance\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotWhitelisted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Overflow\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PoolCollectionWithdrawalInputInvalid\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RateUnstable\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SameOwner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TradingDisabled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroValue\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"prevFeePPM\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"newFeePPM\",\"type\":\"uint32\"}],\"name\":\"DefaultTradingFeePPMUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract Token\",\"name\":\"pool\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bool\",\"name\":\"newStatus\",\"type\":\"bool\"}],\"name\":\"DepositingEnabled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"prevFeePPM\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"newFeePPM\",\"type\":\"uint32\"}],\"name\":\"NetworkFeePPMUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"prevOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnerUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"contextId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"provider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"contract Token\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"baseTokenAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"poolTokenAmount\",\"type\":\"uint256\"}],\"name\":\"TokensDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"contextId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"provider\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"contract Token\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"baseTokenAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"poolTokenAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"externalProtectionBaseTokenAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"bntAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"withdrawalFeeAmount\",\"type\":\"uint256\"}],\"name\":\"TokensWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"contextId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"contract Token\",\"name\":\"pool\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"liquidity\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"stakedBalance\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"poolTokenSupply\",\"type\":\"uint256\"}],\"name\":\"TotalLiquidityUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract Token\",\"name\":\"pool\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bool\",\"name\":\"newStatus\",\"type\":\"bool\"},{\"indexed\":true,\"internalType\":\"uint8\",\"name\":\"reason\",\"type\":\"uint8\"}],\"name\":\"TradingEnabled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract Token\",\"name\":\"pool\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"prevFeePPM\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"newFeePPM\",\"type\":\"uint32\"}],\"name\":\"TradingFeePPMUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"contextId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"contract Token\",\"name\":\"pool\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"contract Token\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"prevLiquidity\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newLiquidity\",\"type\":\"uint256\"}],\"name\":\"TradingLiquidityUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"createPool\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"defaultTradingFeePPM\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"contextId\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"provider\",\"type\":\"address\"},{\"internalType\":\"contract Token\",\"name\":\"pool\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"baseTokenAmount\",\"type\":\"uint256\"}],\"name\":\"depositFor\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"depositingEnabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"disableTrading\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"disableTradingByNetwork\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"pool\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"status\",\"type\":\"bool\"}],\"name\":\"enableDepositing\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"pool\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"bntVirtualBalance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"baseTokenVirtualBalance\",\"type\":\"uint256\"}],\"name\":\"enableTrading\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"isPoolStable\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"isPoolValid\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"pool\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"contract IPoolToken\",\"name\":\"poolToken\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"tradingFeePPM\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"tradingEnabled\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"depositingEnabled\",\"type\":\"bool\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"blockNumber\",\"type\":\"uint32\"},{\"components\":[{\"internalType\":\"uint112\",\"name\":\"n\",\"type\":\"uint112\"},{\"internalType\":\"uint112\",\"name\":\"d\",\"type\":\"uint112\"}],\"internalType\":\"struct Fraction112\",\"name\":\"rate\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint112\",\"name\":\"n\",\"type\":\"uint112\"},{\"internalType\":\"uint112\",\"name\":\"d\",\"type\":\"uint112\"}],\"internalType\":\"struct Fraction112\",\"name\":\"invRate\",\"type\":\"tuple\"}],\"internalType\":\"struct AverageRates\",\"name\":\"averageRates\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint128\",\"name\":\"bntTradingLiquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"baseTokenTradingLiquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint256\",\"name\":\"stakedBalance\",\"type\":\"uint256\"}],\"internalType\":\"struct PoolLiquidity\",\"name\":\"liquidity\",\"type\":\"tuple\"}],\"internalType\":\"struct Pool\",\"name\":\"data\",\"type\":\"tuple\"}],\"name\":\"migratePoolIn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"pool\",\"type\":\"address\"},{\"internalType\":\"contract IPoolCollection\",\"name\":\"targetPoolCollection\",\"type\":\"address\"}],\"name\":\"migratePoolOut\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"networkFeePPM\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"newOwner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"pool\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"feeAmount\",\"type\":\"uint256\"}],\"name\":\"onFeesCollected\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"poolCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"poolData\",\"outputs\":[{\"components\":[{\"internalType\":\"contract IPoolToken\",\"name\":\"poolToken\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"tradingFeePPM\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"tradingEnabled\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"depositingEnabled\",\"type\":\"bool\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"blockNumber\",\"type\":\"uint32\"},{\"components\":[{\"internalType\":\"uint112\",\"name\":\"n\",\"type\":\"uint112\"},{\"internalType\":\"uint112\",\"name\":\"d\",\"type\":\"uint112\"}],\"internalType\":\"struct Fraction112\",\"name\":\"rate\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint112\",\"name\":\"n\",\"type\":\"uint112\"},{\"internalType\":\"uint112\",\"name\":\"d\",\"type\":\"uint112\"}],\"internalType\":\"struct Fraction112\",\"name\":\"invRate\",\"type\":\"tuple\"}],\"internalType\":\"struct AverageRates\",\"name\":\"averageRates\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint128\",\"name\":\"bntTradingLiquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"baseTokenTradingLiquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint256\",\"name\":\"stakedBalance\",\"type\":\"uint256\"}],\"internalType\":\"struct PoolLiquidity\",\"name\":\"liquidity\",\"type\":\"tuple\"}],\"internalType\":\"struct Pool\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"poolLiquidity\",\"outputs\":[{\"components\":[{\"internalType\":\"uint128\",\"name\":\"bntTradingLiquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"baseTokenTradingLiquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint256\",\"name\":\"stakedBalance\",\"type\":\"uint256\"}],\"internalType\":\"struct PoolLiquidity\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"poolToken\",\"outputs\":[{\"internalType\":\"contract IPoolToken\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"pool\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"baseTokenAmountToDistribute\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"protocolPoolTokenAmount\",\"type\":\"uint256\"}],\"name\":\"poolTokenAmountToBurn\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"pool\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"poolTokenAmount\",\"type\":\"uint256\"}],\"name\":\"poolTokenToUnderlying\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"poolType\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pools\",\"outputs\":[{\"internalType\":\"contract Token[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"newDefaultTradingFeePPM\",\"type\":\"uint32\"}],\"name\":\"setDefaultTradingFeePPM\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"newNetworkFeePPM\",\"type\":\"uint32\"}],\"name\":\"setNetworkFeePPM\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"pool\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"newTradingFeePPM\",\"type\":\"uint32\"}],\"name\":\"setTradingFeePPM\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"contextId\",\"type\":\"bytes32\"},{\"internalType\":\"contract Token\",\"name\":\"sourceToken\",\"type\":\"address\"},{\"internalType\":\"contract Token\",\"name\":\"targetToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"sourceAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minReturnAmount\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"ignoreFees\",\"type\":\"bool\"}],\"name\":\"tradeBySourceAmount\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"tradingFeeAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"networkFeeAmount\",\"type\":\"uint256\"}],\"internalType\":\"struct TradeAmountAndFee\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"contextId\",\"type\":\"bytes32\"},{\"internalType\":\"contract Token\",\"name\":\"sourceToken\",\"type\":\"address\"},{\"internalType\":\"contract Token\",\"name\":\"targetToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"targetAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxSourceAmount\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"ignoreFees\",\"type\":\"bool\"}],\"name\":\"tradeByTargetAmount\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"tradingFeeAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"networkFeeAmount\",\"type\":\"uint256\"}],\"internalType\":\"struct TradeAmountAndFee\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"sourceToken\",\"type\":\"address\"},{\"internalType\":\"contract Token\",\"name\":\"targetToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"targetAmount\",\"type\":\"uint256\"}],\"name\":\"tradeInputAndFeeByTargetAmount\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"tradingFeeAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"networkFeeAmount\",\"type\":\"uint256\"}],\"internalType\":\"struct TradeAmountAndFee\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"sourceToken\",\"type\":\"address\"},{\"internalType\":\"contract Token\",\"name\":\"targetToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"sourceAmount\",\"type\":\"uint256\"}],\"name\":\"tradeOutputAndFeeBySourceAmount\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"tradingFeeAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"networkFeeAmount\",\"type\":\"uint256\"}],\"internalType\":\"struct TradeAmountAndFee\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"tradingEnabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"tradingFeePPM\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"ownerCandidate\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"pool\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"baseTokenAmount\",\"type\":\"uint256\"}],\"name\":\"underlyingToPoolToken\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"updateTradingLiquidity\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"contextId\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"provider\",\"type\":\"address\"},{\"internalType\":\"contract Token\",\"name\":\"pool\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"poolTokenAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"baseTokenAmount\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract Token\",\"name\":\"pool\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"poolTokenAmount\",\"type\":\"uint256\"}],\"name\":\"withdrawalAmounts\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"totalAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"baseTokenAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"bntAmount\",\"type\":\"uint256\"}],\"internalType\":\"struct WithdrawalAmounts\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"Pool Collection contract notes: - the address of reserve token serves as the pool unique ID in both contract functions and events\",\"events\":{\"DefaultTradingFeePPMUpdated(uint32,uint32)\":{\"details\":\"triggered when the default trading fee is updated\"},\"DepositingEnabled(address,bool)\":{\"details\":\"triggered when depositing into a specific pool is enabled/disabled\"},\"NetworkFeePPMUpdated(uint32,uint32)\":{\"details\":\"triggered when the network fee is updated\"},\"TokensDeposited(bytes32,address,address,uint256,uint256)\":{\"details\":\"triggered when new liquidity is deposited into a pool\"},\"TokensWithdrawn(bytes32,address,address,uint256,uint256,uint256,uint256,uint256)\":{\"details\":\"triggered when existing liquidity is withdrawn from a pool\"},\"TotalLiquidityUpdated(bytes32,address,uint256,uint256,uint256)\":{\"details\":\"triggered when the total liquidity in a pool is updated\"},\"TradingEnabled(address,bool,uint8)\":{\"details\":\"triggered when trading in a specific pool is enabled/disabled\"},\"TradingFeePPMUpdated(address,uint32,uint32)\":{\"details\":\"triggered when a specific pool's trading fee is updated\"},\"TradingLiquidityUpdated(bytes32,address,address,uint256,uint256)\":{\"details\":\"triggered when the trading liquidity in a pool is updated\"}},\"kind\":\"dev\",\"methods\":{\"acceptOwnership()\":{\"details\":\"used by a new owner to accept an ownership transfer\"},\"constructor\":{\"details\":\"initializes a new PoolCollection contract\"},\"createPool(address)\":{\"details\":\"creates a new pool requirements: - the caller must be the network contract - the pool should have been whitelisted - the pool isn't already defined in the collection\"},\"defaultTradingFeePPM()\":{\"details\":\"returns the default trading fee (in units of PPM)\"},\"depositFor(bytes32,address,address,uint256)\":{\"details\":\"deposits base token liquidity on behalf of a specific provider and returns the respective pool token amount requirements: - the caller must be the network contract - assumes that the base token has been already deposited in the vault\"},\"depositingEnabled(address)\":{\"details\":\"returns whether depositing is enabled\"},\"disableTrading(address)\":{\"details\":\"disables trading in a given pool requirements: - the caller must be the owner of the contract\"},\"disableTradingByNetwork(address)\":{\"details\":\"disables trading on a pool requirements: - the caller must be the network contract\"},\"enableDepositing(address,bool)\":{\"details\":\"enables/disables depositing into a given pool requirements: - the caller must be the owner of the contract\"},\"enableTrading(address,uint256,uint256)\":{\"details\":\"enables trading in a given pool, by providing the funding rate as two virtual balances, and updates its trading liquidity note that the virtual balances should be derived from token prices, normalized to the smallest unit of tokens. In other words, the ratio between BNT and TKN virtual balances should be the ratio between the $ value of 1 wei of TKN and 1 wei of BNT, taking both of their decimals into account. For example: - if the price of one (10**18 wei) BNT is $X and the price of one (10**18 wei) TKN is $Y, then the virtual balances should represent a ratio of X to Y - if the price of one (10**18 wei) BNT is $X and the price of one (10**6 wei) USDC is $Y, then the virtual balances should represent a ratio of X to Y*10**12 requirements: - the caller must be the owner of the contract\"},\"isPoolStable(address)\":{\"details\":\"returns whether the pool is stable\"},\"isPoolValid(address)\":{\"details\":\"returns whether a pool is valid\"},\"migratePoolIn(address,(address,uint32,bool,bool,(uint32,(uint112,uint112),(uint112,uint112)),(uint128,uint128,uint256)))\":{\"details\":\"migrates a pool to this pool collection requirements: - the caller must be the pool migrator contract\"},\"migratePoolOut(address,address)\":{\"details\":\"migrates a pool from this pool collection requirements: - the caller must be the pool migrator contract\"},\"networkFeePPM()\":{\"details\":\"returns the network fee (in units of PPM)\"},\"newOwner()\":{\"details\":\"returns the address of the new owner candidate\"},\"onFeesCollected(address,uint256)\":{\"details\":\"notifies the pool of accrued fees requirements: - the caller must be the network contract\"},\"owner()\":{\"details\":\"returns the address of the current owner\"},\"poolCount()\":{\"details\":\"returns the number of all the pools which are managed by this pool collection\"},\"poolData(address)\":{\"details\":\"returns specific pool's data notes: - there is no guarantee that this function will remain forward compatible, so relying on it should be avoided and instead, rely on specific getters from the IPoolCollection interface\"},\"poolLiquidity(address)\":{\"details\":\"returns the overall liquidity in the pool\"},\"poolToken(address)\":{\"details\":\"returns the pool token of the pool\"},\"poolTokenAmountToBurn(address,uint256,uint256)\":{\"details\":\"returns the number of pool token to burn in order to increase everyone's underlying value by the specified amount\"},\"poolTokenToUnderlying(address,uint256)\":{\"details\":\"converts the specified pool token amount to the underlying base token amount\"},\"poolType()\":{\"details\":\"returns the type of the pool\"},\"pools()\":{\"details\":\"returns all the pools which are managed by this pool collection\"},\"setDefaultTradingFeePPM(uint32)\":{\"details\":\"sets the default trading fee (in units of PPM) requirements: - the caller must be the owner of the contract\"},\"setNetworkFeePPM(uint32)\":{\"details\":\"sets the network fee (in units of PPM) requirements: - the caller must be the owner of the contract\"},\"setTradingFeePPM(address,uint32)\":{\"details\":\"sets the trading fee of a given pool requirements: - the caller must be the owner of the contract\"},\"tradeBySourceAmount(bytes32,address,address,uint256,uint256,bool)\":{\"details\":\"performs a trade by providing the source amount and returns the target amount and the associated fee requirements: - the caller must be the network contract\"},\"tradeByTargetAmount(bytes32,address,address,uint256,uint256,bool)\":{\"details\":\"performs a trade by providing the target amount and returns the required source amount and the associated fee requirements: - the caller must be the network contract\"},\"tradeInputAndFeeByTargetAmount(address,address,uint256)\":{\"details\":\"returns the input amount and fee when trading by providing the target amount\"},\"tradeOutputAndFeeBySourceAmount(address,address,uint256)\":{\"details\":\"returns the output amount and fee when trading by providing the source amount\"},\"tradingEnabled(address)\":{\"details\":\"returns whether trading is enabled\"},\"tradingFeePPM(address)\":{\"details\":\"returns the trading fee (in units of PPM)\"},\"transferOwnership(address)\":{\"details\":\"allows transferring the contract ownership requirements: - the caller must be the owner of the contract - the new owner still needs to accept the transfer\"},\"underlyingToPoolToken(address,uint256)\":{\"details\":\"converts the specified underlying base token amount to pool token amount\"},\"updateTradingLiquidity(address)\":{\"details\":\"adjusts the trading liquidity in the given pool based on the base token vault balance/funding limit requirements: - the caller must be the owner of the contract\"},\"withdraw(bytes32,address,address,uint256,uint256)\":{\"details\":\"handles some of the withdrawal-related actions and returns the withdrawn base token amount requirements: - the caller must be the network contract - the caller must have approved the collection to transfer/burn the pool token amount on its behalf\"},\"withdrawalAmounts(address,uint256)\":{\"details\":\"returns the amounts that would be returned if the position is currently withdrawn, along with the breakdown of the base token and the BNT compensation\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/pools/PoolCollection.sol\":\"PoolCollection\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"none\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/access/IAccessControlEnumerableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IAccessControlUpgradeable.sol\\\";\\n\\n/**\\n * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.\\n */\\ninterface IAccessControlEnumerableUpgradeable is IAccessControlUpgradeable {\\n /**\\n * @dev Returns one of the accounts that have `role`. `index` must be a\\n * value between 0 and {getRoleMemberCount}, non-inclusive.\\n *\\n * Role bearers are not sorted in any particular way, and their ordering may\\n * change at any point.\\n *\\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\\n * you perform all queries on the same block. See the following\\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\\n * for more information.\\n */\\n function getRoleMember(bytes32 role, uint256 index) external view returns (address);\\n\\n /**\\n * @dev Returns the number of accounts that have `role`. Can be used\\n * together with {getRoleMember} to enumerate all bearers of a role.\\n */\\n function getRoleMemberCount(bytes32 role) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x7acbc538aad6eb4614e26612a8c5c0149bb8808db95e2638d245a8365f63e572\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/access/IAccessControlUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev External interface of AccessControl declared to support ERC165 detection.\\n */\\ninterface IAccessControlUpgradeable {\\n /**\\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\\n *\\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\\n * {RoleAdminChanged} not being emitted signaling this.\\n *\\n * _Available since v3.1._\\n */\\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\\n\\n /**\\n * @dev Emitted when `account` is granted `role`.\\n *\\n * `sender` is the account that originated the contract call, an admin role\\n * bearer except when using {AccessControl-_setupRole}.\\n */\\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Emitted when `account` is revoked `role`.\\n *\\n * `sender` is the account that originated the contract call:\\n * - if using `revokeRole`, it is the admin role bearer\\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\\n */\\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) external view returns (bool);\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function grantRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function revokeRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been granted `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n */\\n function renounceRole(bytes32 role, address account) external;\\n}\\n\",\"keccak256\":\"0xb8f5302f12138c5561362e88a78d061573e6298b7a1a5afe84a1e2c8d4d5aeaa\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/ERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.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.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How\\n * to implement supply mechanisms].\\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 * The default value of {decimals} is 18. To select a different value for\\n * {decimals} you should overload it.\\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 value {ERC20} uses, unless this function is\\n * 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(\\n address from,\\n address to,\\n uint256 amount\\n ) 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, _allowances[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 = _allowances[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 `sender` to `recipient`.\\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(\\n address from,\\n address to,\\n uint256 amount\\n ) 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 }\\n _balances[to] += amount;\\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 _balances[account] += amount;\\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 }\\n _totalSupply -= amount;\\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(\\n address owner,\\n address spender,\\n uint256 amount\\n ) 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 Spend `amount` form the allowance of `owner` toward `spender`.\\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(\\n address owner,\\n address spender,\\n uint256 amount\\n ) 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(\\n address from,\\n address to,\\n uint256 amount\\n ) 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(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual {}\\n}\\n\",\"keccak256\":\"0xdadd41acb749920eccf40aeaa8d291adf9751399a7343561bad13e7a8d99be0b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n\\n /**\\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\":\"0xbbc8ac883ac3c0078ce5ad3e288fbb3ffcc8a30c3a98c0fda0114d64fc44fca2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x8de418a5503946cabe331f35fe242d3201a73f67f77aaeb7110acb1f30423aca\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\\n *\\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\\n * need to send a transaction, and thus is not required to hold Ether at all.\\n */\\ninterface IERC20Permit {\\n /**\\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\\n * given ``owner``'s signed approval.\\n *\\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\\n * ordering also apply here.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `deadline` must be a timestamp in the future.\\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\\n * over the EIP712-formatted function arguments.\\n * - the signature must use ``owner``'s current nonce (see {nonces}).\\n *\\n * For more information on the signature format, see the\\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\\n * section].\\n */\\n function permit(\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external;\\n\\n /**\\n * @dev Returns the current nonce for `owner`. This value must be\\n * included whenever a signature is generated for {permit}.\\n *\\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\\n * prevents a signature from being used multiple times.\\n */\\n function nonces(address owner) external view returns (uint256);\\n\\n /**\\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0xf41ca991f30855bf80ffd11e9347856a517b977f0a6c2d52e6421a99b7840329\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)\\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\":\"0xc3d946432c0ddbb1f846a0d3985be71299df331b91d06732152117f62f0be2b5\",\"license\":\"MIT\"},\"@openzeppelin/contracts/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\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/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\"},\"@openzeppelin/contracts/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\",\"keccak256\":\"0x5c6caab697d302ad7eb59c234a4d2dbc965c1bae87709bd2850060b7695b28c7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (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\":\"0x9772845c886f87a3aab315f8d6b68aa599027c20f441b131cd4afaf65b588900\",\"license\":\"MIT\"},\"contracts/network/interfaces/IBancorNetwork.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nimport { IUpgradeable } from \\\"../../utility/interfaces/IUpgradeable.sol\\\";\\n\\nimport { Token } from \\\"../../token/Token.sol\\\";\\n\\nimport { IPoolCollection } from \\\"../../pools/interfaces/IPoolCollection.sol\\\";\\nimport { IPoolToken } from \\\"../../pools/interfaces/IPoolToken.sol\\\";\\n\\n/**\\n * @dev Flash-loan recipient interface\\n */\\ninterface IFlashLoanRecipient {\\n /**\\n * @dev a flash-loan recipient callback after each the caller must return the borrowed amount and an additional fee\\n */\\n function onFlashLoan(\\n address caller,\\n IERC20 erc20Token,\\n uint256 amount,\\n uint256 feeAmount,\\n bytes memory data\\n ) external;\\n}\\n\\n/**\\n * @dev Bancor Network interface\\n */\\ninterface IBancorNetwork is IUpgradeable {\\n /**\\n * @dev returns the set of all valid pool collections\\n */\\n function poolCollections() external view returns (IPoolCollection[] memory);\\n\\n /**\\n * @dev returns the set of all liquidity pools\\n */\\n function liquidityPools() external view returns (Token[] memory);\\n\\n /**\\n * @dev returns the respective pool collection for the provided pool\\n */\\n function collectionByPool(Token pool) external view returns (IPoolCollection);\\n\\n /**\\n * @dev creates new pools\\n *\\n * requirements:\\n *\\n * - none of the pools already exists\\n */\\n function createPools(Token[] calldata tokens, IPoolCollection poolCollection) external;\\n\\n /**\\n * @dev migrates a list of pools between pool collections\\n *\\n * notes:\\n *\\n * - invalid or incompatible pools will be skipped gracefully\\n */\\n function migratePools(Token[] calldata pools, IPoolCollection newPoolCollection) external;\\n\\n /**\\n * @dev deposits liquidity for the specified provider and returns the respective pool token amount\\n *\\n * requirements:\\n *\\n * - the caller must have approved the network to transfer the tokens on its behalf (except for in the\\n * native token case)\\n */\\n function depositFor(\\n address provider,\\n Token pool,\\n uint256 tokenAmount\\n ) external payable returns (uint256);\\n\\n /**\\n * @dev deposits liquidity for the current provider and returns the respective pool token amount\\n *\\n * requirements:\\n *\\n * - the caller must have approved the network to transfer the tokens on its behalf (except for in the\\n * native token case)\\n */\\n function deposit(Token pool, uint256 tokenAmount) external payable returns (uint256);\\n\\n /**\\n * @dev initiates liquidity withdrawal\\n *\\n * requirements:\\n *\\n * - the caller must have approved the contract to transfer the pool token amount on its behalf\\n */\\n function initWithdrawal(IPoolToken poolToken, uint256 poolTokenAmount) external returns (uint256);\\n\\n /**\\n * @dev cancels a withdrawal request, and returns the number of pool token amount associated with the withdrawal\\n * request\\n *\\n * requirements:\\n *\\n * - the caller must have already initiated a withdrawal and received the specified id\\n */\\n function cancelWithdrawal(uint256 id) external returns (uint256);\\n\\n /**\\n * @dev withdraws liquidity and returns the withdrawn amount\\n *\\n * requirements:\\n *\\n * - the provider must have already initiated a withdrawal and received the specified id\\n * - the specified withdrawal request is eligible for completion\\n * - the provider must have approved the network to transfer vBNT amount on its behalf, when withdrawing BNT\\n * liquidity\\n */\\n function withdraw(uint256 id) external returns (uint256);\\n\\n /**\\n * @dev performs a trade by providing the input source amount, sends the proceeds to the optional beneficiary (or\\n * to the address of the caller, in case it's not supplied), and returns the trade target amount\\n *\\n * requirements:\\n *\\n * - the caller must have approved the network to transfer the source tokens on its behalf (except for in the\\n * native token case)\\n */\\n function tradeBySourceAmount(\\n Token sourceToken,\\n Token targetToken,\\n uint256 sourceAmount,\\n uint256 minReturnAmount,\\n uint256 deadline,\\n address beneficiary\\n ) external payable returns (uint256);\\n\\n /**\\n * @dev performs a trade by providing the output target amount, sends the proceeds to the optional beneficiary (or\\n * to the address of the caller, in case it's not supplied), and returns the trade source amount\\n *\\n * requirements:\\n *\\n * - the caller must have approved the network to transfer the source tokens on its behalf (except for in the\\n * native token case)\\n */\\n function tradeByTargetAmount(\\n Token sourceToken,\\n Token targetToken,\\n uint256 targetAmount,\\n uint256 maxSourceAmount,\\n uint256 deadline,\\n address beneficiary\\n ) external payable returns (uint256);\\n\\n /**\\n * @dev performs a trade by providing the input source amount, sends the proceeds to the optional beneficiary (or\\n * to the address of the caller, in case it's not supplied), and returns the trade target amount\\n *\\n * requirements:\\n *\\n * - the caller must have approved the network to transfer the source tokens on its behalf (except for in the\\n * native token case)\\n * - the caller must be the _bancorArbitrage contract\\n */\\n function tradeBySourceAmountArb(\\n Token sourceToken,\\n Token targetToken,\\n uint256 sourceAmount,\\n uint256 minReturnAmount,\\n uint256 deadline,\\n address beneficiary\\n ) external payable returns (uint256);\\n\\n /**\\n * @dev performs a trade by providing the output target amount, sends the proceeds to the optional beneficiary (or\\n * to the address of the caller, in case it's not supplied), and returns the trade source amount\\n *\\n * requirements:\\n *\\n * - the caller must have approved the network to transfer the source tokens on its behalf (except for in the\\n * native token case)\\n * - the caller must be the _bancorArbitrage contract\\n */\\n function tradeByTargetAmountArb(\\n Token sourceToken,\\n Token targetToken,\\n uint256 targetAmount,\\n uint256 maxSourceAmount,\\n uint256 deadline,\\n address beneficiary\\n ) external payable returns (uint256);\\n\\n /**\\n * @dev provides a flash-loan\\n *\\n * requirements:\\n *\\n * - the recipient's callback must return *at least* the borrowed amount and fee back to the specified return address\\n */\\n function flashLoan(\\n Token token,\\n uint256 amount,\\n IFlashLoanRecipient recipient,\\n bytes calldata data\\n ) external;\\n\\n /**\\n * @dev deposits liquidity during a migration\\n */\\n function migrateLiquidity(\\n Token token,\\n address provider,\\n uint256 amount,\\n uint256 availableAmount,\\n uint256 originalAmount\\n ) external payable;\\n\\n /**\\n * @dev withdraws pending network fees, and returns the amount of fees withdrawn\\n *\\n * requirements:\\n *\\n * - the caller must have the ROLE_NETWORK_FEE_MANAGER privilege\\n */\\n function withdrawNetworkFees(address recipient) external returns (uint256);\\n\\n /**\\n * @dev withdraws surplus tokens from a given pool to CarbonPOL contract,\\n * and disables trading on the given pool if it is not already disabled\\n */\\n function withdrawPOL(Token pool) external returns (uint256);\\n}\\n\",\"keccak256\":\"0x29edaf865558031ecb2148a193da0ddca7716e908568f138eae7a4c85c66e4b1\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/network/interfaces/INetworkSettings.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { IUpgradeable } from \\\"../../utility/interfaces/IUpgradeable.sol\\\";\\n\\nimport { Token } from \\\"../../token/Token.sol\\\";\\n\\nerror NotWhitelisted();\\nerror NotWhitelistedForPOL();\\n\\nstruct VortexRewards {\\n // the percentage of converted BNT to be sent to the initiator of the burning event (in units of PPM)\\n uint32 burnRewardPPM;\\n // the maximum burn reward to be sent to the initiator of the burning event\\n uint256 burnRewardMaxAmount;\\n}\\n\\n/**\\n * @dev Network Settings interface\\n */\\ninterface INetworkSettings is IUpgradeable {\\n /**\\n * @dev returns the protected tokens whitelist\\n */\\n function protectedTokenWhitelist() external view returns (Token[] memory);\\n\\n /**\\n * @dev checks whether a given token is whitelisted\\n */\\n function isTokenWhitelisted(Token pool) external view returns (bool);\\n\\n /**\\n * @dev returns the tokens whitelist for POL\\n */\\n function tokenWhitelistForPOL() external view returns (Token[] memory);\\n\\n /**\\n * @dev checks whether a given token is whitelist for POL\\n */\\n function isTokenWhitelistedForPOL(Token pool) external view returns (bool);\\n\\n /**\\n * @dev returns the BNT funding limit for a given pool\\n */\\n function poolFundingLimit(Token pool) external view returns (uint256);\\n\\n /**\\n * @dev returns the minimum BNT trading liquidity required before the system enables trading in the relevant pool\\n */\\n function minLiquidityForTrading() external view returns (uint256);\\n\\n /**\\n * @dev returns the withdrawal fee (in units of PPM)\\n */\\n function withdrawalFeePPM() external view returns (uint32);\\n\\n /**\\n * @dev returns the default flash-loan fee (in units of PPM)\\n */\\n function defaultFlashLoanFeePPM() external view returns (uint32);\\n\\n /**\\n * @dev returns the flash-loan fee (in units of PPM) of a pool\\n */\\n function flashLoanFeePPM(Token pool) external view returns (uint32);\\n\\n /**\\n * @dev returns the vortex settings\\n */\\n function vortexRewards() external view returns (VortexRewards memory);\\n}\\n\",\"keccak256\":\"0x98403457a628e5e568688184570be14d3c59a5fec5cdbf69236b4a787c802c45\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/pools/PoolCollection.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\nimport { EnumerableSet } from \\\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\\\";\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport { Math } from \\\"@openzeppelin/contracts/utils/math/Math.sol\\\";\\nimport { SafeCast } from \\\"@openzeppelin/contracts/utils/math/SafeCast.sol\\\";\\n\\nimport { Token } from \\\"../token/Token.sol\\\";\\nimport { TokenLibrary } from \\\"../token/TokenLibrary.sol\\\";\\n\\nimport { IMasterVault } from \\\"../vaults/interfaces/IMasterVault.sol\\\";\\nimport { IExternalProtectionVault } from \\\"../vaults/interfaces/IExternalProtectionVault.sol\\\";\\n\\nimport { IVersioned } from \\\"../utility/interfaces/IVersioned.sol\\\";\\n\\nimport { PPM_RESOLUTION } from \\\"../utility/Constants.sol\\\";\\nimport { Owned } from \\\"../utility/Owned.sol\\\";\\nimport { BlockNumber } from \\\"../utility/BlockNumber.sol\\\";\\nimport { Fraction, Fraction112, FractionLibrary, zeroFraction112 } from \\\"../utility/FractionLibrary.sol\\\";\\nimport { Sint256, MathEx } from \\\"../utility/MathEx.sol\\\";\\n\\n// prettier-ignore\\nimport {\\n Utils,\\n AlreadyExists,\\n DoesNotExist,\\n InvalidParam,\\n InvalidStakedBalance\\n} from \\\"../utility/Utils.sol\\\";\\n\\nimport { INetworkSettings, NotWhitelisted } from \\\"../network/interfaces/INetworkSettings.sol\\\";\\nimport { IBancorNetwork } from \\\"../network/interfaces/IBancorNetwork.sol\\\";\\n\\nimport { IPoolToken } from \\\"./interfaces/IPoolToken.sol\\\";\\nimport { IPoolTokenFactory } from \\\"./interfaces/IPoolTokenFactory.sol\\\";\\nimport { IPoolMigrator } from \\\"./interfaces/IPoolMigrator.sol\\\";\\n\\n// prettier-ignore\\nimport {\\n AverageRates,\\n IPoolCollection,\\n PoolLiquidity,\\n Pool,\\n TRADING_STATUS_UPDATE_DEFAULT,\\n TRADING_STATUS_UPDATE_ADMIN,\\n TRADING_STATUS_UPDATE_MIN_LIQUIDITY,\\n TRADING_STATUS_UPDATE_INVALID_STATE,\\n TRADING_STATUS_UPDATE_NETWORK_DISABLE,\\n TradeAmountAndFee,\\n WithdrawalAmounts\\n} from \\\"./interfaces/IPoolCollection.sol\\\";\\n\\nimport { IBNTPool } from \\\"./interfaces/IBNTPool.sol\\\";\\n\\nimport { PoolCollectionWithdrawal } from \\\"./PoolCollectionWithdrawal.sol\\\";\\n\\n// base token withdrawal output amounts\\nstruct InternalWithdrawalAmounts {\\n uint256 baseTokensToTransferFromMasterVault; // base token amount to transfer from the master vault to the provider\\n uint256 bntToMintForProvider; // BNT amount to mint directly for the provider\\n uint256 baseTokensToTransferFromEPV; // base token amount to transfer from the external protection vault to the provider\\n Sint256 baseTokensTradingLiquidityDelta; // base token amount to add to the trading liquidity\\n Sint256 bntTradingLiquidityDelta; // BNT amount to add to the trading liquidity and to the master vault\\n Sint256 bntProtocolHoldingsDelta; // BNT amount add to the protocol equity\\n uint256 baseTokensWithdrawalFee; // base token amount to keep in the pool as a withdrawal fee\\n uint256 baseTokensWithdrawalAmount; // base token amount equivalent to the base pool token's withdrawal amount\\n uint256 poolTokenAmount; // base pool token\\n uint256 poolTokenTotalSupply; // base pool token's total supply\\n uint256 newBaseTokenTradingLiquidity; // new base token trading liquidity\\n uint256 newBNTTradingLiquidity; // new BNT trading liquidity\\n}\\n\\nstruct TargetTradingLiquidity {\\n bool update;\\n uint256 bnt;\\n uint256 baseToken;\\n}\\n\\nenum PoolRateState {\\n Uninitialized,\\n Unstable,\\n Stable\\n}\\n\\n/**\\n * @dev Pool Collection contract\\n *\\n * notes:\\n *\\n * - the address of reserve token serves as the pool unique ID in both contract functions and events\\n */\\ncontract PoolCollection is IPoolCollection, Owned, BlockNumber, Utils {\\n using TokenLibrary for Token;\\n using FractionLibrary for Fraction;\\n using FractionLibrary for Fraction112;\\n using EnumerableSet for EnumerableSet.AddressSet;\\n using SafeCast for uint256;\\n\\n error AlreadyEnabled();\\n error DepositingDisabled();\\n error InsufficientLiquidity();\\n error InsufficientSourceAmount();\\n error InsufficientTargetAmount();\\n error InvalidRate();\\n error RateUnstable();\\n error TradingDisabled();\\n error FundingLimitTooHigh();\\n\\n uint16 private constant POOL_TYPE = 1;\\n uint256 private constant LIQUIDITY_GROWTH_FACTOR = 2;\\n uint256 private constant BOOTSTRAPPING_LIQUIDITY_BUFFER_FACTOR = 2;\\n uint32 private constant DEFAULT_TRADING_FEE_PPM = 2_000; // 0.2%\\n uint32 private constant DEFAULT_NETWORK_FEE_PPM = 200_000; // 20%\\n uint32 private constant RATE_MAX_DEVIATION_PPM = 10_000; // %1\\n uint32 private constant RATE_RESET_BLOCK_THRESHOLD = 100;\\n\\n // the average rate is recalculated based on the ratio between the weights of the rates the smaller the weights are,\\n // the larger the supported range of each one of the rates is\\n uint256 private constant EMA_AVERAGE_RATE_WEIGHT = 4;\\n uint256 private constant EMA_SPOT_RATE_WEIGHT = 1;\\n\\n struct TradeIntermediateResult {\\n uint256 sourceAmount;\\n uint256 targetAmount;\\n uint256 limit;\\n uint256 tradingFeeAmount;\\n uint256 networkFeeAmount;\\n uint256 sourceBalance;\\n uint256 targetBalance;\\n uint256 stakedBalance;\\n Token pool;\\n bool isSourceBNT;\\n bool bySourceAmount;\\n uint32 tradingFeePPM;\\n bytes32 contextId;\\n }\\n\\n struct TradeAmountAndTradingFee {\\n uint256 amount;\\n uint256 tradingFeeAmount;\\n }\\n\\n // the network contract\\n IBancorNetwork private immutable _network;\\n\\n // the address of the BNT token\\n IERC20 private immutable _bnt;\\n\\n // the network settings contract\\n INetworkSettings private immutable _networkSettings;\\n\\n // the master vault contract\\n IMasterVault private immutable _masterVault;\\n\\n // the BNT pool contract\\n IBNTPool internal immutable _bntPool;\\n\\n // the address of the external protection vault\\n IExternalProtectionVault private immutable _externalProtectionVault;\\n\\n // the pool token factory contract\\n IPoolTokenFactory private immutable _poolTokenFactory;\\n\\n // the pool migrator contract\\n IPoolMigrator private immutable _poolMigrator;\\n\\n // a mapping between tokens and their pools\\n mapping(Token => Pool) internal _poolData;\\n\\n // the set of all pools which are managed by this pool collection\\n EnumerableSet.AddressSet private _pools;\\n\\n // the default trading fee (in units of PPM)\\n uint32 private _defaultTradingFeePPM;\\n\\n // the global network fee (in units of PPM)\\n uint32 private _networkFeePPM;\\n\\n /**\\n * @dev triggered when the default trading fee is updated\\n */\\n event DefaultTradingFeePPMUpdated(uint32 prevFeePPM, uint32 newFeePPM);\\n\\n /**\\n * @dev triggered when the network fee is updated\\n */\\n event NetworkFeePPMUpdated(uint32 prevFeePPM, uint32 newFeePPM);\\n\\n /**\\n * @dev triggered when a specific pool's trading fee is updated\\n */\\n event TradingFeePPMUpdated(Token indexed pool, uint32 prevFeePPM, uint32 newFeePPM);\\n\\n /**\\n * @dev triggered when trading in a specific pool is enabled/disabled\\n */\\n event TradingEnabled(Token indexed pool, bool indexed newStatus, uint8 indexed reason);\\n\\n /**\\n * @dev triggered when depositing into a specific pool is enabled/disabled\\n */\\n event DepositingEnabled(Token indexed pool, bool indexed newStatus);\\n\\n /**\\n * @dev triggered when new liquidity is deposited into a pool\\n */\\n event TokensDeposited(\\n bytes32 indexed contextId,\\n address indexed provider,\\n Token indexed token,\\n uint256 baseTokenAmount,\\n uint256 poolTokenAmount\\n );\\n\\n /**\\n * @dev triggered when existing liquidity is withdrawn from a pool\\n */\\n event TokensWithdrawn(\\n bytes32 indexed contextId,\\n address indexed provider,\\n Token indexed token,\\n uint256 baseTokenAmount,\\n uint256 poolTokenAmount,\\n uint256 externalProtectionBaseTokenAmount,\\n uint256 bntAmount,\\n uint256 withdrawalFeeAmount\\n );\\n\\n /**\\n * @dev triggered when the trading liquidity in a pool is updated\\n */\\n event TradingLiquidityUpdated(\\n bytes32 indexed contextId,\\n Token indexed pool,\\n Token indexed token,\\n uint256 prevLiquidity,\\n uint256 newLiquidity\\n );\\n\\n /**\\n * @dev triggered when the total liquidity in a pool is updated\\n */\\n event TotalLiquidityUpdated(\\n bytes32 indexed contextId,\\n Token indexed pool,\\n uint256 liquidity,\\n uint256 stakedBalance,\\n uint256 poolTokenSupply\\n );\\n\\n /**\\n * @dev initializes a new PoolCollection contract\\n */\\n constructor(\\n IBancorNetwork initNetwork,\\n IERC20 initBNT,\\n INetworkSettings initNetworkSettings,\\n IMasterVault initMasterVault,\\n IBNTPool initBNTPool,\\n IExternalProtectionVault initExternalProtectionVault,\\n IPoolTokenFactory initPoolTokenFactory,\\n IPoolMigrator initPoolMigrator\\n ) {\\n _validAddress(address(initNetwork));\\n _validAddress(address(initBNT));\\n _validAddress(address(initNetworkSettings));\\n _validAddress(address(initMasterVault));\\n _validAddress(address(initBNTPool));\\n _validAddress(address(initExternalProtectionVault));\\n _validAddress(address(initPoolTokenFactory));\\n _validAddress(address(initPoolMigrator));\\n\\n _network = initNetwork;\\n _bnt = initBNT;\\n _networkSettings = initNetworkSettings;\\n _masterVault = initMasterVault;\\n _bntPool = initBNTPool;\\n _externalProtectionVault = initExternalProtectionVault;\\n _poolTokenFactory = initPoolTokenFactory;\\n _poolMigrator = initPoolMigrator;\\n\\n _setDefaultTradingFeePPM(DEFAULT_TRADING_FEE_PPM);\\n _setNetworkFeePPM(DEFAULT_NETWORK_FEE_PPM);\\n }\\n\\n /**\\n * @inheritdoc IVersioned\\n */\\n function version() external view virtual returns (uint16) {\\n return 12;\\n }\\n\\n /**\\n * @inheritdoc IPoolCollection\\n */\\n function poolType() external view virtual returns (uint16) {\\n return POOL_TYPE;\\n }\\n\\n /**\\n * @inheritdoc IPoolCollection\\n */\\n function defaultTradingFeePPM() external view returns (uint32) {\\n return _defaultTradingFeePPM;\\n }\\n\\n /**\\n * @inheritdoc IPoolCollection\\n */\\n function networkFeePPM() external view returns (uint32) {\\n return _networkFeePPM;\\n }\\n\\n /**\\n * @inheritdoc IPoolCollection\\n */\\n function pools() external view returns (Token[] memory) {\\n uint256 length = _pools.length();\\n Token[] memory list = new Token[](length);\\n for (uint256 i = 0; i < length; i++) {\\n list[i] = Token(_pools.at(i));\\n }\\n return list;\\n }\\n\\n /**\\n * @inheritdoc IPoolCollection\\n */\\n function poolCount() external view returns (uint256) {\\n return _pools.length();\\n }\\n\\n /**\\n * @dev sets the default trading fee (in units of PPM)\\n *\\n * requirements:\\n *\\n * - the caller must be the owner of the contract\\n */\\n function setDefaultTradingFeePPM(\\n uint32 newDefaultTradingFeePPM\\n ) external onlyOwner validFee(newDefaultTradingFeePPM) {\\n _setDefaultTradingFeePPM(newDefaultTradingFeePPM);\\n }\\n\\n /**\\n * @dev sets the network fee (in units of PPM)\\n *\\n * requirements:\\n *\\n * - the caller must be the owner of the contract\\n */\\n function setNetworkFeePPM(uint32 newNetworkFeePPM) external onlyOwner validFee(newNetworkFeePPM) {\\n _setNetworkFeePPM(newNetworkFeePPM);\\n }\\n\\n /**\\n * @inheritdoc IPoolCollection\\n */\\n function createPool(Token token) external only(address(_network)) {\\n if (!_networkSettings.isTokenWhitelisted(token)) {\\n revert NotWhitelisted();\\n }\\n\\n IPoolToken newPoolToken = IPoolToken(_poolTokenFactory.createPoolToken(token));\\n\\n newPoolToken.acceptOwnership();\\n\\n Pool memory newPool = Pool({\\n poolToken: newPoolToken,\\n tradingFeePPM: _defaultTradingFeePPM,\\n tradingEnabled: false,\\n depositingEnabled: true,\\n averageRates: AverageRates({ blockNumber: 0, rate: zeroFraction112(), invRate: zeroFraction112() }),\\n liquidity: PoolLiquidity({ bntTradingLiquidity: 0, baseTokenTradingLiquidity: 0, stakedBalance: 0 })\\n });\\n\\n _addPool(token, newPool);\\n\\n emit TradingEnabled({ pool: token, newStatus: newPool.tradingEnabled, reason: TRADING_STATUS_UPDATE_DEFAULT });\\n emit TradingFeePPMUpdated({ pool: token, prevFeePPM: 0, newFeePPM: newPool.tradingFeePPM });\\n emit DepositingEnabled({ pool: token, newStatus: newPool.depositingEnabled });\\n }\\n\\n /**\\n * @inheritdoc IPoolCollection\\n */\\n function isPoolValid(Token pool) external view returns (bool) {\\n return address(_poolData[pool].poolToken) != address(0);\\n }\\n\\n /**\\n * @dev returns specific pool's data\\n *\\n * notes:\\n *\\n * - there is no guarantee that this function will remain forward compatible,\\n * so relying on it should be avoided and instead, rely on specific getters\\n * from the IPoolCollection interface\\n */\\n function poolData(Token pool) external view returns (Pool memory) {\\n return _poolData[pool];\\n }\\n\\n /**\\n * @inheritdoc IPoolCollection\\n */\\n function poolLiquidity(Token pool) external view returns (PoolLiquidity memory) {\\n return _poolData[pool].liquidity;\\n }\\n\\n /**\\n * @inheritdoc IPoolCollection\\n */\\n function poolToken(Token pool) external view returns (IPoolToken) {\\n return _poolData[pool].poolToken;\\n }\\n\\n /**\\n * @inheritdoc IPoolCollection\\n */\\n function tradingFeePPM(Token pool) external view returns (uint32) {\\n return _poolData[pool].tradingFeePPM;\\n }\\n\\n /**\\n * @inheritdoc IPoolCollection\\n */\\n function tradingEnabled(Token pool) external view returns (bool) {\\n return _poolData[pool].tradingEnabled;\\n }\\n\\n /**\\n * @inheritdoc IPoolCollection\\n */\\n function depositingEnabled(Token pool) external view returns (bool) {\\n return _poolData[pool].depositingEnabled;\\n }\\n\\n /**\\n * @inheritdoc IPoolCollection\\n */\\n function poolTokenToUnderlying(Token pool, uint256 poolTokenAmount) external view returns (uint256) {\\n Pool storage data = _poolData[pool];\\n\\n return _poolTokenToUnderlying(poolTokenAmount, data.poolToken.totalSupply(), data.liquidity.stakedBalance);\\n }\\n\\n /**\\n * @inheritdoc IPoolCollection\\n */\\n function underlyingToPoolToken(Token pool, uint256 baseTokenAmount) external view returns (uint256) {\\n Pool storage data = _poolData[pool];\\n\\n return _underlyingToPoolToken(baseTokenAmount, data.poolToken.totalSupply(), data.liquidity.stakedBalance);\\n }\\n\\n /**\\n * @inheritdoc IPoolCollection\\n */\\n function poolTokenAmountToBurn(\\n Token pool,\\n uint256 baseTokenAmountToDistribute,\\n uint256 protocolPoolTokenAmount\\n ) external view returns (uint256) {\\n if (baseTokenAmountToDistribute == 0) {\\n return 0;\\n }\\n\\n Pool storage data = _poolData[pool];\\n\\n uint256 poolTokenSupply = data.poolToken.totalSupply();\\n uint256 val = baseTokenAmountToDistribute * poolTokenSupply;\\n\\n return\\n MathEx.mulDivF(\\n val,\\n poolTokenSupply,\\n val + data.liquidity.stakedBalance * (poolTokenSupply - protocolPoolTokenAmount)\\n );\\n }\\n\\n /**\\n * @inheritdoc IPoolCollection\\n */\\n function isPoolStable(Token pool) external view returns (bool) {\\n Pool storage data = _poolData[pool];\\n\\n return _poolRateState(data) == PoolRateState.Stable;\\n }\\n\\n /**\\n * @dev sets the trading fee of a given pool\\n *\\n * requirements:\\n *\\n * - the caller must be the owner of the contract\\n */\\n function setTradingFeePPM(Token pool, uint32 newTradingFeePPM) external onlyOwner validFee(newTradingFeePPM) {\\n Pool storage data = _poolStorage(pool);\\n\\n uint32 prevTradingFeePPM = data.tradingFeePPM;\\n if (prevTradingFeePPM == newTradingFeePPM) {\\n return;\\n }\\n\\n data.tradingFeePPM = newTradingFeePPM;\\n\\n emit TradingFeePPMUpdated({ pool: pool, prevFeePPM: prevTradingFeePPM, newFeePPM: newTradingFeePPM });\\n }\\n\\n /**\\n * @dev enables trading in a given pool, by providing the funding rate as two virtual balances, and updates its\\n * trading liquidity\\n *\\n * note that the virtual balances should be derived from token prices, normalized to the smallest unit of\\n * tokens. In other words, the ratio between BNT and TKN virtual balances should be the ratio between the $ value\\n * of 1 wei of TKN and 1 wei of BNT, taking both of their decimals into account. For example:\\n *\\n * - if the price of one (10**18 wei) BNT is $X and the price of one (10**18 wei) TKN is $Y, then the virtual balances\\n * should represent a ratio of X to Y\\n * - if the price of one (10**18 wei) BNT is $X and the price of one (10**6 wei) USDC is $Y, then the virtual balances\\n * should represent a ratio of X to Y*10**12\\n *\\n * requirements:\\n *\\n * - the caller must be the owner of the contract\\n */\\n function enableTrading(Token pool, uint256 bntVirtualBalance, uint256 baseTokenVirtualBalance) external onlyOwner {\\n Fraction memory fundingRate = Fraction({ n: bntVirtualBalance, d: baseTokenVirtualBalance });\\n _validRate(fundingRate);\\n\\n Pool storage data = _poolStorage(pool);\\n\\n if (data.tradingEnabled) {\\n revert AlreadyEnabled();\\n }\\n\\n // adjust the trading liquidity based on the base token vault balance and funding limits\\n bytes32 contextId = keccak256(abi.encodePacked(msg.sender, pool, bntVirtualBalance, baseTokenVirtualBalance));\\n uint256 minLiquidityForTrading = _networkSettings.minLiquidityForTrading();\\n _updateTradingLiquidity(contextId, pool, data, fundingRate, minLiquidityForTrading);\\n\\n // verify that the BNT trading liquidity is equal or greater than the minimum liquidity for trading\\n if (data.liquidity.bntTradingLiquidity < minLiquidityForTrading) {\\n revert InsufficientLiquidity();\\n }\\n\\n Fraction112 memory fundingRate112 = fundingRate.toFraction112();\\n data.averageRates = AverageRates({\\n blockNumber: _blockNumber(),\\n rate: fundingRate112,\\n invRate: fundingRate112.inverse()\\n });\\n\\n data.tradingEnabled = true;\\n\\n emit TradingEnabled({ pool: pool, newStatus: true, reason: TRADING_STATUS_UPDATE_ADMIN });\\n }\\n\\n /**\\n * @dev disables trading in a given pool\\n *\\n * requirements:\\n *\\n * - the caller must be the owner of the contract\\n */\\n function disableTrading(Token pool) external onlyOwner {\\n Pool storage data = _poolStorage(pool);\\n _resetTradingLiquidity(bytes32(0), pool, data, data.liquidity, TRADING_STATUS_UPDATE_ADMIN);\\n }\\n\\n /**\\n * @inheritdoc IPoolCollection\\n */\\n function disableTradingByNetwork(Token pool) external only(address(_network)) {\\n Pool storage data = _poolStorage(pool);\\n _resetTradingLiquidity(bytes32(0), pool, data, data.liquidity, TRADING_STATUS_UPDATE_NETWORK_DISABLE);\\n }\\n\\n /**\\n * @dev adjusts the trading liquidity in the given pool based on the base token\\n * vault balance/funding limit\\n *\\n * requirements:\\n *\\n * - the caller must be the owner of the contract\\n */\\n function updateTradingLiquidity(Token pool) external onlyOwner {\\n Pool storage data = _poolStorage(pool);\\n PoolLiquidity memory liquidity = data.liquidity;\\n\\n bytes32 contextId = keccak256(\\n abi.encodePacked(msg.sender, pool, liquidity.bntTradingLiquidity, liquidity.baseTokenTradingLiquidity)\\n );\\n\\n AverageRates memory effectiveAverageRates = _effectiveAverageRates(\\n data.averageRates,\\n Fraction({ n: liquidity.bntTradingLiquidity, d: liquidity.baseTokenTradingLiquidity })\\n );\\n uint256 minLiquidityForTrading = _networkSettings.minLiquidityForTrading();\\n _updateTradingLiquidity(\\n contextId,\\n pool,\\n data,\\n effectiveAverageRates.rate.fromFraction112(),\\n minLiquidityForTrading\\n );\\n }\\n\\n /**\\n * @dev enables/disables depositing into a given pool\\n *\\n * requirements:\\n *\\n * - the caller must be the owner of the contract\\n */\\n function enableDepositing(Token pool, bool status) external onlyOwner {\\n Pool storage data = _poolStorage(pool);\\n\\n if (data.depositingEnabled == status) {\\n return;\\n }\\n\\n data.depositingEnabled = status;\\n\\n emit DepositingEnabled({ pool: pool, newStatus: status });\\n }\\n\\n /**\\n * @inheritdoc IPoolCollection\\n */\\n function depositFor(\\n bytes32 contextId,\\n address provider,\\n Token pool,\\n uint256 baseTokenAmount\\n ) external only(address(_network)) validAddress(provider) greaterThanZero(baseTokenAmount) returns (uint256) {\\n Pool storage data = _poolStorage(pool);\\n\\n if (!data.depositingEnabled) {\\n revert DepositingDisabled();\\n }\\n\\n // if there are no pool tokens available to support the staked balance - reset the\\n // trading liquidity and the staked balance\\n // in addition, get the effective average rates\\n uint256 prevPoolTokenTotalSupply = data.poolToken.totalSupply();\\n uint256 currentStakedBalance = data.liquidity.stakedBalance;\\n AverageRates memory effectiveAverageRates;\\n if (prevPoolTokenTotalSupply == 0 && currentStakedBalance != 0) {\\n currentStakedBalance = 0;\\n\\n PoolLiquidity memory prevLiquidity = data.liquidity;\\n _resetTradingLiquidity(contextId, pool, data, prevLiquidity, TRADING_STATUS_UPDATE_INVALID_STATE);\\n effectiveAverageRates = AverageRates({\\n blockNumber: 0,\\n rate: zeroFraction112(),\\n invRate: zeroFraction112()\\n });\\n } else {\\n PoolLiquidity memory prevLiquidity = data.liquidity;\\n effectiveAverageRates = _effectiveAverageRates(\\n data.averageRates,\\n Fraction({ n: prevLiquidity.bntTradingLiquidity, d: prevLiquidity.baseTokenTradingLiquidity })\\n );\\n }\\n\\n // calculate the pool token amount to mint\\n uint256 poolTokenAmount = _underlyingToPoolToken(\\n baseTokenAmount,\\n prevPoolTokenTotalSupply,\\n currentStakedBalance\\n );\\n\\n // update the staked balance with the full base token amount\\n data.liquidity.stakedBalance = currentStakedBalance + baseTokenAmount;\\n\\n // mint pool tokens to the provider\\n data.poolToken.mint(provider, poolTokenAmount);\\n\\n // should be triggered before the trading liquidity is updated\\n emit TokensDeposited({\\n contextId: contextId,\\n provider: provider,\\n token: pool,\\n baseTokenAmount: baseTokenAmount,\\n poolTokenAmount: poolTokenAmount\\n });\\n\\n emit TotalLiquidityUpdated({\\n contextId: contextId,\\n pool: pool,\\n liquidity: pool.balanceOf(address(_masterVault)),\\n stakedBalance: data.liquidity.stakedBalance,\\n poolTokenSupply: prevPoolTokenTotalSupply + poolTokenAmount\\n });\\n\\n // adjust the trading liquidity based on the base token vault balance and funding limits\\n _updateTradingLiquidity(\\n contextId,\\n pool,\\n data,\\n effectiveAverageRates.rate.fromFraction112(),\\n _networkSettings.minLiquidityForTrading()\\n );\\n\\n // if trading is enabled, then update the recent average rates\\n if (data.tradingEnabled) {\\n PoolLiquidity memory liquidity = data.liquidity;\\n _updateAverageRates(\\n data,\\n Fraction({ n: liquidity.bntTradingLiquidity, d: liquidity.baseTokenTradingLiquidity })\\n );\\n }\\n\\n return poolTokenAmount;\\n }\\n\\n /**\\n * @inheritdoc IPoolCollection\\n */\\n function withdraw(\\n bytes32 contextId,\\n address provider,\\n Token pool,\\n uint256 poolTokenAmount,\\n uint256 baseTokenAmount\\n )\\n external\\n only(address(_network))\\n validAddress(provider)\\n greaterThanZero(poolTokenAmount)\\n greaterThanZero(baseTokenAmount)\\n returns (uint256)\\n {\\n Pool storage data = _poolStorage(pool);\\n PoolLiquidity memory liquidity = data.liquidity;\\n\\n uint256 poolTokenTotalSupply = data.poolToken.totalSupply();\\n uint256 underlyingAmount = _poolTokenToUnderlying(\\n poolTokenAmount,\\n poolTokenTotalSupply,\\n liquidity.stakedBalance\\n );\\n\\n if (baseTokenAmount > underlyingAmount) {\\n revert InvalidParam();\\n }\\n\\n if (_poolRateState(data) == PoolRateState.Unstable) {\\n revert RateUnstable();\\n }\\n\\n // obtain the withdrawal amounts\\n InternalWithdrawalAmounts memory amounts = _poolWithdrawalAmounts(\\n pool,\\n poolTokenAmount,\\n baseTokenAmount,\\n liquidity,\\n data.tradingFeePPM,\\n poolTokenTotalSupply\\n );\\n\\n // execute the actual withdrawal\\n _executeWithdrawal(contextId, provider, pool, data, amounts);\\n\\n // if trading is enabled, then update the recent average rates\\n if (data.tradingEnabled) {\\n _updateAverageRates(\\n data,\\n Fraction({ n: data.liquidity.bntTradingLiquidity, d: data.liquidity.baseTokenTradingLiquidity })\\n );\\n }\\n\\n return amounts.baseTokensToTransferFromMasterVault;\\n }\\n\\n /**\\n * @inheritdoc IPoolCollection\\n */\\n function withdrawalAmounts(\\n Token pool,\\n uint256 poolTokenAmount\\n ) external view validAddress(address(pool)) greaterThanZero(poolTokenAmount) returns (WithdrawalAmounts memory) {\\n Pool storage data = _poolData[pool];\\n PoolLiquidity memory liquidity = data.liquidity;\\n\\n uint256 poolTokenTotalSupply = data.poolToken.totalSupply();\\n uint256 underlyingAmount = _poolTokenToUnderlying(\\n poolTokenAmount,\\n poolTokenTotalSupply,\\n liquidity.stakedBalance\\n );\\n\\n InternalWithdrawalAmounts memory amounts = _poolWithdrawalAmounts(\\n pool,\\n poolTokenAmount,\\n underlyingAmount,\\n liquidity,\\n data.tradingFeePPM,\\n poolTokenTotalSupply\\n );\\n\\n return\\n WithdrawalAmounts({\\n totalAmount: amounts.baseTokensWithdrawalAmount - amounts.baseTokensWithdrawalFee,\\n baseTokenAmount: amounts.baseTokensToTransferFromMasterVault + amounts.baseTokensToTransferFromEPV,\\n bntAmount: 0\\n });\\n }\\n\\n /**\\n * @inheritdoc IPoolCollection\\n */\\n function tradeBySourceAmount(\\n bytes32 contextId,\\n Token sourceToken,\\n Token targetToken,\\n uint256 sourceAmount,\\n uint256 minReturnAmount,\\n bool ignoreFees\\n )\\n external\\n only(address(_network))\\n greaterThanZero(sourceAmount)\\n greaterThanZero(minReturnAmount)\\n returns (TradeAmountAndFee memory)\\n {\\n TradeIntermediateResult memory result = _initTrade(\\n contextId,\\n sourceToken,\\n targetToken,\\n sourceAmount,\\n minReturnAmount,\\n true\\n );\\n if (ignoreFees) {\\n result.tradingFeePPM = 0;\\n }\\n\\n _performTrade(result);\\n\\n return\\n TradeAmountAndFee({\\n amount: result.targetAmount,\\n tradingFeeAmount: result.tradingFeeAmount,\\n networkFeeAmount: result.networkFeeAmount\\n });\\n }\\n\\n /**\\n * @inheritdoc IPoolCollection\\n */\\n function tradeByTargetAmount(\\n bytes32 contextId,\\n Token sourceToken,\\n Token targetToken,\\n uint256 targetAmount,\\n uint256 maxSourceAmount,\\n bool ignoreFees\\n )\\n external\\n only(address(_network))\\n greaterThanZero(targetAmount)\\n greaterThanZero(maxSourceAmount)\\n returns (TradeAmountAndFee memory)\\n {\\n TradeIntermediateResult memory result = _initTrade(\\n contextId,\\n sourceToken,\\n targetToken,\\n targetAmount,\\n maxSourceAmount,\\n false\\n );\\n if (ignoreFees) {\\n result.tradingFeePPM = 0;\\n }\\n\\n _performTrade(result);\\n\\n return\\n TradeAmountAndFee({\\n amount: result.sourceAmount,\\n tradingFeeAmount: result.tradingFeeAmount,\\n networkFeeAmount: result.networkFeeAmount\\n });\\n }\\n\\n /**\\n * @inheritdoc IPoolCollection\\n */\\n function tradeOutputAndFeeBySourceAmount(\\n Token sourceToken,\\n Token targetToken,\\n uint256 sourceAmount\\n ) external view greaterThanZero(sourceAmount) returns (TradeAmountAndFee memory) {\\n TradeIntermediateResult memory result = _initTrade(bytes32(0), sourceToken, targetToken, sourceAmount, 1, true);\\n\\n _processTrade(result);\\n\\n return\\n TradeAmountAndFee({\\n amount: result.targetAmount,\\n tradingFeeAmount: result.tradingFeeAmount,\\n networkFeeAmount: result.networkFeeAmount\\n });\\n }\\n\\n /**\\n * @inheritdoc IPoolCollection\\n */\\n function tradeInputAndFeeByTargetAmount(\\n Token sourceToken,\\n Token targetToken,\\n uint256 targetAmount\\n ) external view greaterThanZero(targetAmount) returns (TradeAmountAndFee memory) {\\n TradeIntermediateResult memory result = _initTrade(\\n bytes32(0),\\n sourceToken,\\n targetToken,\\n targetAmount,\\n type(uint256).max,\\n false\\n );\\n\\n _processTrade(result);\\n\\n return\\n TradeAmountAndFee({\\n amount: result.sourceAmount,\\n tradingFeeAmount: result.tradingFeeAmount,\\n networkFeeAmount: result.networkFeeAmount\\n });\\n }\\n\\n /**\\n * @inheritdoc IPoolCollection\\n */\\n function onFeesCollected(Token pool, uint256 feeAmount) external only(address(_network)) {\\n if (feeAmount == 0) {\\n return;\\n }\\n\\n Pool storage data = _poolStorage(pool);\\n\\n // increase the staked balance by the given amount\\n data.liquidity.stakedBalance += feeAmount;\\n }\\n\\n /**\\n * @inheritdoc IPoolCollection\\n */\\n function migratePoolIn(\\n Token pool,\\n Pool calldata data\\n ) external validAddress(address(pool)) only(address(_poolMigrator)) {\\n _addPool(pool, data);\\n\\n data.poolToken.acceptOwnership();\\n }\\n\\n /**\\n * @inheritdoc IPoolCollection\\n */\\n function migratePoolOut(\\n Token pool,\\n IPoolCollection targetPoolCollection\\n ) external validAddress(address(targetPoolCollection)) only(address(_poolMigrator)) {\\n IPoolToken cachedPoolToken = _poolData[pool].poolToken;\\n\\n _removePool(pool);\\n\\n cachedPoolToken.transferOwnership(address(targetPoolCollection));\\n }\\n\\n /**\\n * @dev adds a pool\\n */\\n function _addPool(Token pool, Pool memory data) private {\\n if (!_pools.add(address(pool))) {\\n revert AlreadyExists();\\n }\\n\\n _poolData[pool] = data;\\n }\\n\\n /**\\n * @dev removes a pool\\n */\\n function _removePool(Token pool) private {\\n if (!_pools.remove(address(pool))) {\\n revert DoesNotExist();\\n }\\n\\n delete _poolData[pool];\\n }\\n\\n /**\\n * @dev returns withdrawal amounts\\n */\\n function _poolWithdrawalAmounts(\\n Token pool,\\n uint256 poolTokenAmount,\\n uint256 baseTokensWithdrawalAmount,\\n PoolLiquidity memory liquidity,\\n uint32 poolTradingFeePPM,\\n uint256 poolTokenTotalSupply\\n ) internal view returns (InternalWithdrawalAmounts memory) {\\n // the base token trading liquidity of a given pool can never be higher than the base token balance of the vault\\n // whenever the base token trading liquidity is updated, it is set to at most the base token balance of the vault\\n uint256 baseTokenExcessAmount = pool.balanceOf(address(_masterVault)) - liquidity.baseTokenTradingLiquidity;\\n\\n PoolCollectionWithdrawal.Output memory output = PoolCollectionWithdrawal.calculateWithdrawalAmounts(\\n liquidity.bntTradingLiquidity,\\n liquidity.baseTokenTradingLiquidity,\\n baseTokenExcessAmount,\\n liquidity.stakedBalance,\\n pool.balanceOf(address(_externalProtectionVault)),\\n poolTradingFeePPM,\\n _networkSettings.withdrawalFeePPM(),\\n baseTokensWithdrawalAmount\\n );\\n\\n return\\n InternalWithdrawalAmounts({\\n baseTokensToTransferFromMasterVault: output.s,\\n bntToMintForProvider: output.t,\\n baseTokensToTransferFromEPV: output.u,\\n baseTokensTradingLiquidityDelta: output.r,\\n bntTradingLiquidityDelta: output.p,\\n bntProtocolHoldingsDelta: output.q,\\n baseTokensWithdrawalFee: output.v,\\n baseTokensWithdrawalAmount: baseTokensWithdrawalAmount,\\n poolTokenAmount: poolTokenAmount,\\n poolTokenTotalSupply: poolTokenTotalSupply,\\n newBaseTokenTradingLiquidity: output.r.isNeg\\n ? liquidity.baseTokenTradingLiquidity - output.r.value\\n : liquidity.baseTokenTradingLiquidity + output.r.value,\\n newBNTTradingLiquidity: output.p.isNeg\\n ? liquidity.bntTradingLiquidity - output.p.value\\n : liquidity.bntTradingLiquidity + output.p.value\\n });\\n }\\n\\n /**\\n * @dev executes the following actions:\\n *\\n * - burn the network's base pool tokens\\n * - update the pool's base token staked balance\\n * - update the pool's base token trading liquidity\\n * - update the pool's BNT trading liquidity\\n * - update the pool's trading liquidity product\\n * - emit an event if the pool's BNT trading liquidity has crossed the minimum threshold\\n * (either above the threshold or below the threshold)\\n */\\n function _executeWithdrawal(\\n bytes32 contextId,\\n address provider,\\n Token pool,\\n Pool storage data,\\n InternalWithdrawalAmounts memory amounts\\n ) private {\\n PoolLiquidity storage liquidity = data.liquidity;\\n PoolLiquidity memory prevLiquidity = liquidity;\\n\\n data.poolToken.burn(amounts.poolTokenAmount);\\n\\n uint256 newPoolTokenTotalSupply = amounts.poolTokenTotalSupply - amounts.poolTokenAmount;\\n uint256 newStakedBalance = MathEx.mulDivF(\\n liquidity.stakedBalance,\\n newPoolTokenTotalSupply,\\n amounts.poolTokenTotalSupply\\n );\\n\\n liquidity.stakedBalance = newStakedBalance;\\n\\n // trading liquidity is assumed to never exceed 128 bits (the cast below will revert otherwise)\\n liquidity.baseTokenTradingLiquidity = amounts.newBaseTokenTradingLiquidity.toUint128();\\n liquidity.bntTradingLiquidity = amounts.newBNTTradingLiquidity.toUint128();\\n\\n if (amounts.bntProtocolHoldingsDelta.value > 0) {\\n assert(amounts.bntProtocolHoldingsDelta.isNeg); // currently no support for requesting funding here\\n\\n _bntPool.renounceFunding(contextId, pool, amounts.bntProtocolHoldingsDelta.value);\\n } else if (amounts.bntTradingLiquidityDelta.value > 0) {\\n if (amounts.bntTradingLiquidityDelta.isNeg) {\\n _bntPool.burnFromVault(amounts.bntTradingLiquidityDelta.value);\\n } else {\\n _bntPool.mint(address(_masterVault), amounts.bntTradingLiquidityDelta.value);\\n }\\n }\\n\\n // if the provider should receive some base tokens from the external protection vault - remove the tokens from\\n // the external protection vault and send them to the master vault\\n if (amounts.baseTokensToTransferFromEPV > 0) {\\n _externalProtectionVault.withdrawFunds(\\n pool,\\n payable(address(_masterVault)),\\n amounts.baseTokensToTransferFromEPV\\n );\\n amounts.baseTokensToTransferFromMasterVault += amounts.baseTokensToTransferFromEPV;\\n }\\n\\n // if the provider should receive some base tokens from the master vault - remove the tokens from the master\\n // vault and send them to the provider\\n if (amounts.baseTokensToTransferFromMasterVault > 0) {\\n _masterVault.withdrawFunds(pool, payable(provider), amounts.baseTokensToTransferFromMasterVault);\\n }\\n\\n // ensure that the average rate is reset when the pool is being emptied\\n if (amounts.newBaseTokenTradingLiquidity == 0) {\\n data.averageRates.rate = zeroFraction112();\\n data.averageRates.invRate = zeroFraction112();\\n }\\n\\n // if the new BNT trading liquidity is below the minimum liquidity for trading - reset the liquidity\\n if (amounts.newBNTTradingLiquidity < _networkSettings.minLiquidityForTrading()) {\\n _resetTradingLiquidity(\\n contextId,\\n pool,\\n data,\\n prevLiquidity,\\n amounts.newBNTTradingLiquidity,\\n TRADING_STATUS_UPDATE_MIN_LIQUIDITY\\n );\\n } else {\\n _dispatchTradingLiquidityEvents(contextId, pool, prevLiquidity, liquidity);\\n }\\n\\n emit TokensWithdrawn({\\n contextId: contextId,\\n provider: provider,\\n token: pool,\\n baseTokenAmount: amounts.baseTokensToTransferFromMasterVault,\\n poolTokenAmount: amounts.poolTokenAmount,\\n externalProtectionBaseTokenAmount: amounts.baseTokensToTransferFromEPV,\\n bntAmount: 0,\\n withdrawalFeeAmount: amounts.baseTokensWithdrawalFee\\n });\\n\\n emit TotalLiquidityUpdated({\\n contextId: contextId,\\n pool: pool,\\n liquidity: pool.balanceOf(address(_masterVault)),\\n stakedBalance: newStakedBalance,\\n poolTokenSupply: newPoolTokenTotalSupply\\n });\\n }\\n\\n /**\\n * @dev sets the default trading fee (in units of PPM)\\n */\\n function _setDefaultTradingFeePPM(uint32 newDefaultTradingFeePPM) private {\\n uint32 prevDefaultTradingFeePPM = _defaultTradingFeePPM;\\n if (prevDefaultTradingFeePPM == newDefaultTradingFeePPM) {\\n return;\\n }\\n\\n _defaultTradingFeePPM = newDefaultTradingFeePPM;\\n\\n emit DefaultTradingFeePPMUpdated({ prevFeePPM: prevDefaultTradingFeePPM, newFeePPM: newDefaultTradingFeePPM });\\n }\\n\\n /**\\n * @dev sets the network fee (in units of PPM)\\n */\\n function _setNetworkFeePPM(uint32 newNetworkFeePPM) private {\\n uint32 prevNetworkFeePPM = _networkFeePPM;\\n if (prevNetworkFeePPM == newNetworkFeePPM) {\\n return;\\n }\\n\\n _networkFeePPM = newNetworkFeePPM;\\n\\n emit NetworkFeePPMUpdated({ prevFeePPM: prevNetworkFeePPM, newFeePPM: newNetworkFeePPM });\\n }\\n\\n /**\\n * @dev returns a storage reference to pool data\\n */\\n function _poolStorage(Token pool) private view returns (Pool storage) {\\n Pool storage data = _poolData[pool];\\n if (address(data.poolToken) == address(0)) {\\n revert DoesNotExist();\\n }\\n\\n return data;\\n }\\n\\n /**\\n * @dev calculates base tokens amount\\n */\\n function _poolTokenToUnderlying(\\n uint256 poolTokenAmount,\\n uint256 poolTokenSupply,\\n uint256 stakedBalance\\n ) private pure returns (uint256) {\\n if (poolTokenSupply == 0) {\\n // if this is the initial liquidity provision - use a one-to-one pool token to base token rate\\n if (stakedBalance > 0) {\\n revert InvalidStakedBalance();\\n }\\n\\n return poolTokenAmount;\\n }\\n\\n return MathEx.mulDivF(poolTokenAmount, stakedBalance, poolTokenSupply);\\n }\\n\\n /**\\n * @dev calculates pool tokens amount\\n */\\n function _underlyingToPoolToken(\\n uint256 baseTokenAmount,\\n uint256 poolTokenSupply,\\n uint256 stakedBalance\\n ) private pure returns (uint256) {\\n if (poolTokenSupply == 0) {\\n // if this is the initial liquidity provision - use a one-to-one pool token to base token rate\\n if (stakedBalance > 0) {\\n revert InvalidStakedBalance();\\n }\\n\\n return baseTokenAmount;\\n }\\n\\n return MathEx.mulDivC(baseTokenAmount, poolTokenSupply, stakedBalance);\\n }\\n\\n /**\\n * @dev calculates the target trading liquidities, taking into account the total out-of-curve base token liquidity,\\n * and the deltas between the new and the previous states\\n */\\n function _calcTargetTradingLiquidity(\\n uint256 baseTokenTotalLiquidity,\\n uint256 fundingLimit,\\n uint256 currentFunding,\\n PoolLiquidity memory liquidity,\\n Fraction memory fundingRate,\\n uint256 minLiquidityForTrading\\n ) private pure returns (TargetTradingLiquidity memory) {\\n // calculate the target BNT trading liquidity based on the following:\\n // - BNT liquidity required to match the based token unused (off-curve) liquidity\\n // - BNT funding limit\\n // - current BNT funding\\n uint256 targetBNTTradingLiquidity = liquidity.bntTradingLiquidity;\\n if (fundingLimit > currentFunding) {\\n // increase the trading liquidity\\n uint256 availableFunding = fundingLimit - currentFunding;\\n uint256 baseTokenUnusedLiquidity = baseTokenTotalLiquidity - liquidity.baseTokenTradingLiquidity;\\n uint256 targetBNTTradingLiquidityDelta = Math.min(\\n MathEx.mulDivF(baseTokenUnusedLiquidity, fundingRate.n, fundingRate.d),\\n availableFunding\\n );\\n targetBNTTradingLiquidity = liquidity.bntTradingLiquidity + targetBNTTradingLiquidityDelta;\\n } else if (fundingLimit < currentFunding) {\\n // decrease the trading liquidity\\n uint256 excessFunding = currentFunding - fundingLimit;\\n targetBNTTradingLiquidity = MathEx.subMax0(liquidity.bntTradingLiquidity, excessFunding);\\n }\\n\\n // if the target is equal to the current trading liquidity, no update is needed\\n if (targetBNTTradingLiquidity == liquidity.bntTradingLiquidity) {\\n return TargetTradingLiquidity({ update: false, bnt: 0, baseToken: 0 });\\n }\\n\\n // ensure that the target is above the minimum liquidity for trading\\n if (targetBNTTradingLiquidity < minLiquidityForTrading) {\\n return TargetTradingLiquidity({ update: true, bnt: 0, baseToken: 0 });\\n }\\n\\n // calculate the target base token trading liquidity using the following:\\n // - calculate the delta between the current/target BNT trading liquidity\\n // - calculate the base token trading liquidity delta based on the BNT trading liquidity delta and the funding rate\\n // - apply the base token trading liquidity delta to the current base token trading liquidity\\n //\\n // note that the effective funding rate is always the rate between BNT and the base token)\\n uint256 bntTradingLiquidityDelta;\\n uint256 baseTokenTradingLiquidityDelta;\\n\\n // liquidity increase\\n // note that liquidity increase is capped\\n if (targetBNTTradingLiquidity > liquidity.bntTradingLiquidity) {\\n uint256 tradingLiquidityCap;\\n if (liquidity.bntTradingLiquidity == 0) {\\n // the current BNT trading liquidity is 0 - cap the target trading liquidity\\n // by the default bootstrap amount, which includes a buffer to reduce the chance\\n // for trading to be disabled as a result of trades in the pool\\n tradingLiquidityCap = minLiquidityForTrading * BOOTSTRAPPING_LIQUIDITY_BUFFER_FACTOR;\\n } else {\\n // the current BNT trading liquidity is not 0 - cap the target using the growth factor\\n tradingLiquidityCap = liquidity.bntTradingLiquidity * LIQUIDITY_GROWTH_FACTOR;\\n }\\n\\n // apply the trading liquidity cap\\n targetBNTTradingLiquidity = Math.min(targetBNTTradingLiquidity, tradingLiquidityCap);\\n\\n // calculate the trading liquidity deltas and return them\\n bntTradingLiquidityDelta = targetBNTTradingLiquidity - liquidity.bntTradingLiquidity;\\n baseTokenTradingLiquidityDelta = MathEx.mulDivF(bntTradingLiquidityDelta, fundingRate.d, fundingRate.n);\\n\\n return\\n TargetTradingLiquidity({\\n update: true,\\n bnt: targetBNTTradingLiquidity,\\n baseToken: liquidity.baseTokenTradingLiquidity + baseTokenTradingLiquidityDelta\\n });\\n }\\n\\n // liquidity decrease\\n // note that liquidity decrease isn't capped\\n // calculate the trading liquidity deltas and return them\\n bntTradingLiquidityDelta = liquidity.bntTradingLiquidity - targetBNTTradingLiquidity;\\n baseTokenTradingLiquidityDelta = MathEx.mulDivF(bntTradingLiquidityDelta, fundingRate.d, fundingRate.n);\\n\\n return\\n TargetTradingLiquidity({\\n update: true,\\n bnt: targetBNTTradingLiquidity,\\n baseToken: MathEx.subMax0(liquidity.baseTokenTradingLiquidity, baseTokenTradingLiquidityDelta)\\n });\\n }\\n\\n /**\\n * @dev adjusts the trading liquidity based on the newly added tokens delta amount, and funding limits\\n */\\n function _updateTradingLiquidity(\\n bytes32 contextId,\\n Token pool,\\n Pool storage data,\\n Fraction memory fundingRate,\\n uint256 minLiquidityForTrading\\n ) private {\\n // ensure that the base token reserve isn't empty\\n uint256 baseTokenTotalLiquidity = pool.balanceOf(address(_masterVault));\\n if (baseTokenTotalLiquidity == 0) {\\n revert InsufficientLiquidity();\\n }\\n\\n if (_poolRateState(data) == PoolRateState.Unstable) {\\n return;\\n }\\n\\n PoolLiquidity memory prevLiquidity = data.liquidity;\\n if (!fundingRate.isPositive()) {\\n _resetTradingLiquidity(contextId, pool, data, prevLiquidity, TRADING_STATUS_UPDATE_MIN_LIQUIDITY);\\n return;\\n }\\n\\n TargetTradingLiquidity memory targetTradingLiquidity = _calcTargetTradingLiquidity(\\n baseTokenTotalLiquidity,\\n _networkSettings.poolFundingLimit(pool),\\n _bntPool.currentPoolFunding(pool),\\n prevLiquidity,\\n fundingRate,\\n minLiquidityForTrading\\n );\\n\\n if (!targetTradingLiquidity.update) {\\n return;\\n }\\n\\n if (targetTradingLiquidity.bnt == 0 || targetTradingLiquidity.baseToken == 0) {\\n _resetTradingLiquidity(contextId, pool, data, prevLiquidity, TRADING_STATUS_UPDATE_MIN_LIQUIDITY);\\n return;\\n }\\n\\n // update funding from the BNT pool\\n if (targetTradingLiquidity.bnt > prevLiquidity.bntTradingLiquidity) {\\n _bntPool.requestFunding(contextId, pool, targetTradingLiquidity.bnt - prevLiquidity.bntTradingLiquidity);\\n } else if (targetTradingLiquidity.bnt < prevLiquidity.bntTradingLiquidity) {\\n _bntPool.renounceFunding(contextId, pool, prevLiquidity.bntTradingLiquidity - targetTradingLiquidity.bnt);\\n }\\n\\n // trading liquidity is assumed to never exceed 128 bits (the cast below will revert otherwise)\\n PoolLiquidity memory newLiquidity = PoolLiquidity({\\n bntTradingLiquidity: targetTradingLiquidity.bnt.toUint128(),\\n baseTokenTradingLiquidity: targetTradingLiquidity.baseToken.toUint128(),\\n stakedBalance: prevLiquidity.stakedBalance\\n });\\n\\n // update the liquidity data of the pool\\n data.liquidity = newLiquidity;\\n\\n _dispatchTradingLiquidityEvents(contextId, pool, prevLiquidity, newLiquidity);\\n }\\n\\n function _dispatchTradingLiquidityEvents(\\n bytes32 contextId,\\n Token pool,\\n PoolLiquidity memory prevLiquidity,\\n PoolLiquidity memory newLiquidity\\n ) private {\\n if (newLiquidity.bntTradingLiquidity != prevLiquidity.bntTradingLiquidity) {\\n emit TradingLiquidityUpdated({\\n contextId: contextId,\\n pool: pool,\\n token: Token(address(_bnt)),\\n prevLiquidity: prevLiquidity.bntTradingLiquidity,\\n newLiquidity: newLiquidity.bntTradingLiquidity\\n });\\n }\\n\\n if (newLiquidity.baseTokenTradingLiquidity != prevLiquidity.baseTokenTradingLiquidity) {\\n emit TradingLiquidityUpdated({\\n contextId: contextId,\\n pool: pool,\\n token: pool,\\n prevLiquidity: prevLiquidity.baseTokenTradingLiquidity,\\n newLiquidity: newLiquidity.baseTokenTradingLiquidity\\n });\\n }\\n }\\n\\n /**\\n * @dev resets trading liquidity and renounces any remaining BNT funding\\n */\\n function _resetTradingLiquidity(\\n bytes32 contextId,\\n Token pool,\\n Pool storage data,\\n PoolLiquidity memory prevLiquidity,\\n uint8 reason\\n ) private {\\n _resetTradingLiquidity(contextId, pool, data, prevLiquidity, data.liquidity.bntTradingLiquidity, reason);\\n }\\n\\n /**\\n * @dev resets trading liquidity and renounces any remaining BNT funding\\n */\\n function _resetTradingLiquidity(\\n bytes32 contextId,\\n Token pool,\\n Pool storage data,\\n PoolLiquidity memory prevLiquidity,\\n uint256 currentBNTTradingLiquidity,\\n uint8 reason\\n ) private {\\n // reset the network and base token trading liquidities\\n data.liquidity.bntTradingLiquidity = 0;\\n data.liquidity.baseTokenTradingLiquidity = 0;\\n\\n // reset the recent average rage\\n data.averageRates = AverageRates({ blockNumber: 0, rate: zeroFraction112(), invRate: zeroFraction112() });\\n\\n // ensure that trading is disabled\\n if (data.tradingEnabled) {\\n data.tradingEnabled = false;\\n\\n emit TradingEnabled({ pool: pool, newStatus: false, reason: reason });\\n }\\n\\n // renounce all network liquidity\\n if (currentBNTTradingLiquidity > 0) {\\n _bntPool.renounceFunding(contextId, pool, currentBNTTradingLiquidity);\\n }\\n\\n _dispatchTradingLiquidityEvents(contextId, pool, prevLiquidity, data.liquidity);\\n }\\n\\n /**\\n * @dev returns initial trading params\\n */\\n function _initTrade(\\n bytes32 contextId,\\n Token sourceToken,\\n Token targetToken,\\n uint256 amount,\\n uint256 limit,\\n bool bySourceAmount\\n ) private view returns (TradeIntermediateResult memory result) {\\n // ensure that BNT is either the source or the target token\\n bool isSourceBNT = sourceToken.isEqual(_bnt);\\n bool isTargetBNT = targetToken.isEqual(_bnt);\\n\\n if (isSourceBNT && !isTargetBNT) {\\n result.isSourceBNT = true;\\n result.pool = targetToken;\\n } else if (!isSourceBNT && isTargetBNT) {\\n result.isSourceBNT = false;\\n result.pool = sourceToken;\\n } else {\\n // BNT isn't one of the tokens or is both of them\\n revert DoesNotExist();\\n }\\n\\n Pool storage data = _poolStorage(result.pool);\\n\\n // verify that trading is enabled\\n if (!data.tradingEnabled) {\\n revert TradingDisabled();\\n }\\n\\n result.contextId = contextId;\\n result.bySourceAmount = bySourceAmount;\\n\\n if (result.bySourceAmount) {\\n result.sourceAmount = amount;\\n } else {\\n result.targetAmount = amount;\\n }\\n\\n result.limit = limit;\\n result.tradingFeePPM = data.tradingFeePPM;\\n\\n PoolLiquidity memory liquidity = data.liquidity;\\n if (result.isSourceBNT) {\\n result.sourceBalance = liquidity.bntTradingLiquidity;\\n result.targetBalance = liquidity.baseTokenTradingLiquidity;\\n } else {\\n result.sourceBalance = liquidity.baseTokenTradingLiquidity;\\n result.targetBalance = liquidity.bntTradingLiquidity;\\n }\\n\\n result.stakedBalance = liquidity.stakedBalance;\\n }\\n\\n /**\\n * @dev returns trade amount and fee by providing the source amount\\n */\\n function _tradeAmountAndFeeBySourceAmount(\\n uint256 sourceBalance,\\n uint256 targetBalance,\\n uint32 feePPM,\\n uint256 sourceAmount\\n ) private pure returns (TradeAmountAndTradingFee memory) {\\n if (sourceBalance == 0 || targetBalance == 0) {\\n revert InsufficientLiquidity();\\n }\\n\\n uint256 targetAmount = MathEx.mulDivF(targetBalance, sourceAmount, sourceBalance + sourceAmount);\\n uint256 tradingFeeAmount = MathEx.mulDivF(targetAmount, feePPM, PPM_RESOLUTION);\\n\\n return\\n TradeAmountAndTradingFee({ amount: targetAmount - tradingFeeAmount, tradingFeeAmount: tradingFeeAmount });\\n }\\n\\n /**\\n * @dev returns trade amount and fee by providing either the target amount\\n */\\n function _tradeAmountAndFeeByTargetAmount(\\n uint256 sourceBalance,\\n uint256 targetBalance,\\n uint32 feePPM,\\n uint256 targetAmount\\n ) private pure returns (TradeAmountAndTradingFee memory) {\\n if (sourceBalance == 0) {\\n revert InsufficientLiquidity();\\n }\\n\\n uint256 tradingFeeAmount = MathEx.mulDivF(targetAmount, feePPM, PPM_RESOLUTION - feePPM);\\n uint256 fullTargetAmount = targetAmount + tradingFeeAmount;\\n uint256 sourceAmount = MathEx.mulDivF(sourceBalance, fullTargetAmount, targetBalance - fullTargetAmount);\\n\\n return TradeAmountAndTradingFee({ amount: sourceAmount, tradingFeeAmount: tradingFeeAmount });\\n }\\n\\n /**\\n * @dev processes a trade by providing either the source or the target amount and updates the in-memory intermediate\\n * result\\n */\\n function _processTrade(TradeIntermediateResult memory result) private view {\\n TradeAmountAndTradingFee memory tradeAmountAndFee;\\n\\n if (result.bySourceAmount) {\\n tradeAmountAndFee = _tradeAmountAndFeeBySourceAmount(\\n result.sourceBalance,\\n result.targetBalance,\\n result.tradingFeePPM,\\n result.sourceAmount\\n );\\n\\n result.targetAmount = tradeAmountAndFee.amount;\\n\\n // ensure that the target amount is above the requested minimum return amount\\n if (result.targetAmount < result.limit) {\\n revert InsufficientTargetAmount();\\n }\\n } else {\\n tradeAmountAndFee = _tradeAmountAndFeeByTargetAmount(\\n result.sourceBalance,\\n result.targetBalance,\\n result.tradingFeePPM,\\n result.targetAmount\\n );\\n\\n result.sourceAmount = tradeAmountAndFee.amount;\\n\\n // ensure that the user has provided enough tokens to make the trade\\n if (result.sourceAmount == 0 || result.sourceAmount > result.limit) {\\n revert InsufficientSourceAmount();\\n }\\n }\\n\\n result.tradingFeeAmount = tradeAmountAndFee.tradingFeeAmount;\\n\\n // sync the trading and staked balance\\n result.sourceBalance += result.sourceAmount;\\n result.targetBalance -= result.targetAmount;\\n\\n if (result.isSourceBNT) {\\n result.stakedBalance += result.tradingFeeAmount;\\n }\\n\\n _processNetworkFee(result);\\n }\\n\\n /**\\n * @dev processes the network fee and updates the in-memory intermediate result\\n */\\n function _processNetworkFee(TradeIntermediateResult memory result) private view {\\n if (_networkFeePPM == 0) {\\n return;\\n }\\n\\n // calculate the target network fee amount\\n uint256 targetNetworkFeeAmount = MathEx.mulDivF(result.tradingFeeAmount, _networkFeePPM, PPM_RESOLUTION);\\n\\n // update the target balance (but don't deduct it from the full trading fee amount)\\n result.targetBalance -= targetNetworkFeeAmount;\\n\\n if (!result.isSourceBNT) {\\n result.networkFeeAmount = targetNetworkFeeAmount;\\n\\n return;\\n }\\n\\n // trade the network fee (taken from the base token) to BNT\\n result.networkFeeAmount = _tradeAmountAndFeeBySourceAmount(\\n result.targetBalance,\\n result.sourceBalance,\\n 0,\\n targetNetworkFeeAmount\\n ).amount;\\n\\n // since we have received the network fee in base tokens and have traded them for BNT (so that the network fee\\n // is always kept in BNT), we'd need to adapt the trading liquidity and the staked balance accordingly\\n result.targetBalance += targetNetworkFeeAmount;\\n result.sourceBalance -= result.networkFeeAmount;\\n result.stakedBalance -= targetNetworkFeeAmount;\\n }\\n\\n /**\\n * @dev performs a trade\\n */\\n function _performTrade(TradeIntermediateResult memory result) private {\\n Pool storage data = _poolData[result.pool];\\n PoolLiquidity memory prevLiquidity = data.liquidity;\\n\\n // update the recent average rate\\n _updateAverageRates(\\n data,\\n Fraction({ n: prevLiquidity.bntTradingLiquidity, d: prevLiquidity.baseTokenTradingLiquidity })\\n );\\n\\n _processTrade(result);\\n\\n // trading liquidity is assumed to never exceed 128 bits (the cast below will revert otherwise)\\n PoolLiquidity memory newLiquidity = PoolLiquidity({\\n bntTradingLiquidity: (result.isSourceBNT ? result.sourceBalance : result.targetBalance).toUint128(),\\n baseTokenTradingLiquidity: (result.isSourceBNT ? result.targetBalance : result.sourceBalance).toUint128(),\\n stakedBalance: result.stakedBalance\\n });\\n\\n _dispatchTradingLiquidityEvents(result.contextId, result.pool, prevLiquidity, newLiquidity);\\n\\n // update the liquidity data of the pool\\n data.liquidity = newLiquidity;\\n }\\n\\n /**\\n * @dev returns the state of a pool's rate\\n */\\n function _poolRateState(Pool storage data) internal view returns (PoolRateState) {\\n Fraction memory spotRate = Fraction({\\n n: data.liquidity.bntTradingLiquidity,\\n d: data.liquidity.baseTokenTradingLiquidity\\n });\\n\\n AverageRates memory averageRates = data.averageRates;\\n Fraction112 memory rate = averageRates.rate;\\n if (!spotRate.isPositive() || !rate.isPositive()) {\\n return PoolRateState.Uninitialized;\\n }\\n\\n Fraction memory invSpotRate = spotRate.inverse();\\n Fraction112 memory invRate = averageRates.invRate;\\n if (!invSpotRate.isPositive() || !invRate.isPositive()) {\\n return PoolRateState.Uninitialized;\\n }\\n\\n AverageRates memory effectiveAverageRates = _effectiveAverageRates(averageRates, spotRate);\\n\\n if (\\n MathEx.isInRange(effectiveAverageRates.rate.fromFraction112(), spotRate, RATE_MAX_DEVIATION_PPM) &&\\n MathEx.isInRange(effectiveAverageRates.invRate.fromFraction112(), invSpotRate, RATE_MAX_DEVIATION_PPM)\\n ) {\\n return PoolRateState.Stable;\\n }\\n\\n return PoolRateState.Unstable;\\n }\\n\\n /**\\n * @dev updates the average rates\\n */\\n function _updateAverageRates(Pool storage data, Fraction memory spotRate) private {\\n data.averageRates = _effectiveAverageRates(data.averageRates, spotRate);\\n }\\n\\n /**\\n * @dev returns the effective average rates\\n */\\n function _effectiveAverageRates(\\n AverageRates memory averageRates,\\n Fraction memory spotRate\\n ) private view returns (AverageRates memory) {\\n // if the spot rate is 0, reset the average rates\\n if (!spotRate.isPositive()) {\\n return AverageRates({ blockNumber: 0, rate: zeroFraction112(), invRate: zeroFraction112() });\\n }\\n\\n uint32 blockNumber = _blockNumber();\\n\\n // can only be updated once in a single block\\n uint32 prevUpdateBlock = averageRates.blockNumber;\\n if (prevUpdateBlock == blockNumber) {\\n return averageRates;\\n }\\n\\n // if sufficient blocks have passed, or if one of the rates isn't positive,\\n // reset the average rates\\n if (\\n blockNumber - prevUpdateBlock >= RATE_RESET_BLOCK_THRESHOLD ||\\n !averageRates.rate.isPositive() ||\\n !averageRates.invRate.isPositive()\\n ) {\\n if (spotRate.isPositive()) {\\n return\\n AverageRates({\\n blockNumber: blockNumber,\\n rate: spotRate.toFraction112(),\\n invRate: spotRate.inverse().toFraction112()\\n });\\n }\\n\\n return AverageRates({ blockNumber: 0, rate: zeroFraction112(), invRate: zeroFraction112() });\\n }\\n\\n return\\n AverageRates({\\n blockNumber: blockNumber,\\n rate: _calcAverageRate(averageRates.rate, spotRate),\\n invRate: _calcAverageRate(averageRates.invRate, spotRate.inverse())\\n });\\n }\\n\\n /**\\n * @dev calculates the average rate\\n */\\n function _calcAverageRate(\\n Fraction112 memory averageRate,\\n Fraction memory rate\\n ) private pure returns (Fraction112 memory) {\\n if (rate.n * averageRate.d == rate.d * averageRate.n) {\\n return averageRate;\\n }\\n\\n return\\n MathEx\\n .weightedAverage(averageRate.fromFraction112(), rate, EMA_AVERAGE_RATE_WEIGHT, EMA_SPOT_RATE_WEIGHT)\\n .toFraction112();\\n }\\n\\n /**\\n * @dev verifies if the provided rate is valid\\n */\\n function _validRate(Fraction memory rate) internal pure {\\n if (!rate.isPositive()) {\\n revert InvalidRate();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xecd589ebce62b74aff1c7f8a7e430aaa9da7165c4bd6f855edeadae19a82c8d3\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/pools/PoolCollectionWithdrawal.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { PPM_RESOLUTION as M } from \\\"../utility/Constants.sol\\\";\\nimport { Sint256, Uint512, MathEx } from \\\"../utility/MathEx.sol\\\";\\n\\nerror PoolCollectionWithdrawalInputInvalid();\\n\\n/**\\n * @dev This library implements the mathematics behind base-token withdrawal.\\n * It exposes a single function which takes the following input values:\\n * `a` - BNT trading liquidity\\n * `b` - base token trading liquidity\\n * `c` - base token excess amount\\n * `e` - base token staked amount\\n * `w` - base token external protection vault balance\\n * `m` - trading fee in PPM units\\n * `n` - withdrawal fee in PPM units\\n * `x` - base token withdrawal amount\\n * And returns the following output values:\\n * `p` - BNT amount to add to the trading liquidity and to the master vault\\n * `q` - BNT amount to add to the protocol equity\\n * `r` - base token amount to add to the trading liquidity\\n * `s` - base token amount to transfer from the master vault to the provider\\n * `t` - BNT amount to mint directly for the provider\\n * `u` - base token amount to transfer from the external protection vault to the provider\\n * `v` - base token amount to keep in the pool as a withdrawal fee\\n * The following table depicts the actual formulae based on the current state of the system:\\n * +-----------+---------------------------------------------------------+----------------------------------------------------------+\\n * | | Deficit | Surplus |\\n * +-----------+---------------------------------------------------------+----------------------------------------------------------+\\n * | | p = a*x*(e*(1-n)-b-c)*(1-m)/(b*e-x*(e*(1-n)-b-c)*(1-m)) | p = -a*x*(b+c-e*(1-n))/(b*e*(1-m)+x*(b+c-e*(1-n))*(1-m)) |\\n * | | q = 0 | q = 0 |\\n * | | r = -x*(e*(1-n)-b-c)/e | r = x*(b+c-e*(1-n))/e |\\n * | Arbitrage | s = x*(1-n) | s = x*(1-n) |\\n * | | t = 0 | t = 0 |\\n * | | u = 0 | u = 0 |\\n * | | v = x*n | v = x*n |\\n * +-----------+---------------------------------------------------------+----------------------------------------------------------+\\n * | | p = -a*z/(b*e) where z = max(x*(1-n)*b-c*(e-x*(1-n)),0) | p = -a*z/b where z = max(x*(1-n)-c,0) |\\n * | | q = -a*z/(b*e) where z = max(x*(1-n)*b-c*(e-x*(1-n)),0) | q = -a*z/b where z = max(x*(1-n)-c,0) |\\n * | | r = -z/e where z = max(x*(1-n)*b-c*(e-x*(1-n)),0) | r = -z where z = max(x*(1-n)-c,0) |\\n * | Default | s = x*(1-n)*(b+c)/e | s = x*(1-n) |\\n * | | t = see function `externalProtection` | t = 0 |\\n * | | u = see function `externalProtection` | u = 0 |\\n * | | v = x*n | v = x*n |\\n * +-----------+---------------------------------------------------------+----------------------------------------------------------+\\n * | | p = 0 | p = 0 |\\n * | | q = 0 | q = 0 |\\n * | | r = 0 | r = 0 |\\n * | Bootstrap | s = x*(1-n)*c/e | s = x*(1-n) |\\n * | | t = see function `externalProtection` | t = 0 |\\n * | | u = see function `externalProtection` | u = 0 |\\n * | | v = x*n | v = x*n |\\n * +-----------+---------------------------------------------------------+----------------------------------------------------------+\\n * Note that for the sake of illustration, both `m` and `n` are assumed normalized (between 0 and 1).\\n * During runtime, it is taken into account that they are given in PPM units (between 0 and 1000000).\\n */\\nlibrary PoolCollectionWithdrawal {\\n using MathEx for uint256;\\n\\n struct Output {\\n Sint256 p;\\n Sint256 q;\\n Sint256 r;\\n uint256 s;\\n uint256 t;\\n uint256 u;\\n uint256 v;\\n }\\n\\n /**\\n * @dev returns `p`, `q`, `r`, `s`, `t`, `u` and `v` according to the current state:\\n * +-------------------+-----------------------------------------------------------+\\n * | `e > (b+c)/(1-n)` | bootstrap deficit or default deficit or arbitrage deficit |\\n * +-------------------+-----------------------------------------------------------+\\n * | `e < (b+c)` | bootstrap surplus or default surplus or arbitrage surplus |\\n * +-------------------+-----------------------------------------------------------+\\n * | otherwise | bootstrap surplus or default surplus |\\n * +-------------------+-----------------------------------------------------------+\\n */\\n function calculateWithdrawalAmounts(\\n uint256 a, // <= 2**128-1\\n uint256 b, // <= 2**128-1\\n uint256 c, // <= 2**128-1\\n uint256 e, // <= 2**128-1\\n uint256 w, // <= 2**128-1\\n uint256 m, // <= M == 1000000\\n uint256 n, // <= M == 1000000\\n uint256 x /// <= e <= 2**128-1\\n ) internal pure returns (Output memory output) {\\n if (\\n a > type(uint128).max ||\\n b > type(uint128).max ||\\n c > type(uint128).max ||\\n e > type(uint128).max ||\\n w > type(uint128).max ||\\n m > M ||\\n n > M ||\\n x > e\\n ) {\\n revert PoolCollectionWithdrawalInputInvalid();\\n }\\n\\n uint256 y = (x * (M - n)) / M;\\n\\n if ((e * (M - n)) / M > b + c) {\\n uint256 f = (e * (M - n)) / M - (b + c);\\n uint256 g = e - (b + c);\\n if (isStable(b, c, e, x) && affordableDeficit(b, e, f, g, m, n, x)) {\\n output = arbitrageDeficit(a, b, e, f, m, x, y);\\n } else if (a > 0) {\\n output = defaultDeficit(a, b, c, e, y);\\n (output.t, output.u) = externalProtection(a, b, e, g, y, w);\\n } else {\\n output.s = (y * c) / e;\\n (output.t, output.u) = externalProtection(a, b, e, g, y, w);\\n }\\n } else {\\n uint256 f = MathEx.subMax0(b + c, e);\\n if (f > 0 && isStable(b, c, e, x) && affordableSurplus(b, e, f, m, n, x)) {\\n output = arbitrageSurplus(a, b, e, f, m, n, x, y);\\n } else if (a > 0) {\\n output = defaultSurplus(a, b, c, y);\\n } else {\\n output.s = y;\\n }\\n }\\n\\n output.v = x - y;\\n }\\n\\n /**\\n * @dev returns `x < e*c/(b+c)`\\n */\\n function isStable(\\n uint256 b, // <= 2**128-1\\n uint256 c, // <= 2**128-1\\n uint256 e, // <= 2**128-1\\n uint256 x /// <= e <= 2**128-1\\n ) private pure returns (bool) {\\n return b * x < c * (e - x);\\n }\\n\\n /**\\n * @dev returns `b*e*((e*(1-n)-b-c)*m+e*n) > (e*(1-n)-b-c)*x*(e-b-c)*(1-m)`\\n */\\n function affordableDeficit(\\n uint256 /*b*/, // <= 2**128-1\\n uint256 /*e*/, // <= 2**128-1\\n uint256 /*f*/, // == e*(1-n)-b-c <= e <= 2**128-1\\n uint256 /*g*/, // == e-b-c <= e <= 2**128-1\\n uint256 /*m*/, // <= M == 1000000\\n uint256 /*n*/, // <= M == 1000000\\n uint256 /*x*/ /// < e*c/(b+c) <= e <= 2**128-1\\n ) private pure returns (bool) {\\n // temporarily disabled\\n //Uint512 memory lhs = MathEx.mul512(b * e, f * m + e * n);\\n //Uint512 memory rhs = MathEx.mul512(f * x, g * (M - m));\\n //return MathEx.gt512(lhs, rhs);\\n return false;\\n }\\n\\n /**\\n * @dev returns `b*e*((b+c-e)*m+e*n) > (b+c-e)*x*(b+c-e*(1-n))*(1-m)`\\n */\\n function affordableSurplus(\\n uint256 b, // <= 2**128-1\\n uint256 e, // <= 2**128-1\\n uint256 f, // == b+c-e <= 2**129-2\\n uint256 m, // <= M == 1000000\\n uint256 n, // <= M == 1000000\\n uint256 x /// < e*c/(b+c) <= e <= 2**128-1\\n ) private pure returns (bool) {\\n Uint512 memory lhs = MathEx.mul512(b * e, (f * m + e * n) * M);\\n Uint512 memory rhs = MathEx.mul512(f * x, (f * M + e * n) * (M - m));\\n return MathEx.gt512(lhs, rhs); // `x < e*c/(b+c)` --> `f*x < e*c*(b+c-e)/(b+c) <= e*c <= 2**256-1`\\n }\\n\\n /**\\n * @dev returns:\\n * `p = a*x*(e*(1-n)-b-c)*(1-m)/(b*e-x*(e*(1-n)-b-c)*(1-m))`\\n * `q = 0`\\n * `r = -x*(e*(1-n)-b-c)/e`\\n * `s = x*(1-n)`\\n */\\n function arbitrageDeficit(\\n uint256 a, // <= 2**128-1\\n uint256 b, // <= 2**128-1\\n uint256 e, // <= 2**128-1\\n uint256 f, // == e*(1-n)-b-c <= e <= 2**128-1\\n uint256 m, // <= M == 1000000\\n uint256 x, // <= e <= 2**128-1\\n uint256 y /// == x*(1-n) <= x <= e <= 2**128-1\\n ) private pure returns (Output memory output) {\\n uint256 i = f * (M - m);\\n uint256 j = mulSubMulDivF(b, e * M, x, i, 1);\\n output.p = MathEx.mulDivF(a * x, i, j).toPos256();\\n output.r = MathEx.mulDivF(x, f, e).toNeg256();\\n output.s = y;\\n }\\n\\n /**\\n * @dev returns:\\n * `p = -a*x*(b+c-e*(1-n))/(b*e*(1-m)+x*(b+c-e*(1-n))*(1-m))`\\n * `q = 0`\\n * `r = x*(b+c-e*(1-n))/e`\\n * `s = x*(1-n)`\\n */\\n function arbitrageSurplus(\\n uint256 a, // <= 2**128-1\\n uint256 b, // <= 2**128-1\\n uint256 e, // <= 2**128-1\\n uint256 f, // == b+c-e <= 2**129-2\\n uint256 m, // <= M == 1000000\\n uint256 n, // <= M == 1000000\\n uint256 x, // <= e <= 2**128-1\\n uint256 y /// == x*(1-n) <= x <= e <= 2**128-1\\n ) private pure returns (Output memory output) {\\n uint256 i = f * M + e * n;\\n uint256 j = mulAddMulDivF(b, e * (M - m), x, i * (M - m), M);\\n output.p = MathEx.mulDivF(a * x, i, j).toNeg256();\\n output.r = MathEx.mulDivF(x, i, e * M).toPos256();\\n output.s = y;\\n }\\n\\n /**\\n * @dev returns:\\n * `p = -a*z/(b*e)` where `z = max(x*(1-n)*b-c*(e-x*(1-n)),0)`\\n * `q = -a*z/(b*e)` where `z = max(x*(1-n)*b-c*(e-x*(1-n)),0)`\\n * `r = -z/e` where `z = max(x*(1-n)*b-c*(e-x*(1-n)),0)`\\n * `s = x*(1-n)*(b+c)/e`\\n */\\n function defaultDeficit(\\n uint256 a, // <= 2**128-1\\n uint256 b, // <= 2**128-1\\n uint256 c, // <= 2**128-1\\n uint256 e, // <= 2**128-1\\n uint256 y /// == x*(1-n) <= x <= e <= 2**128-1\\n ) private pure returns (Output memory output) {\\n uint256 z = MathEx.subMax0(y * b, c * (e - y));\\n output.p = MathEx.mulDivF(a, z, b * e).toNeg256();\\n output.q = output.p;\\n output.r = (z / e).toNeg256();\\n output.s = MathEx.mulDivF(y, b + c, e);\\n }\\n\\n /**\\n * @dev returns:\\n * `p = -a*z/b` where `z = max(x*(1-n)-c,0)`\\n * `q = -a*z/b` where `z = max(x*(1-n)-c,0)`\\n * `r = -z` where `z = max(x*(1-n)-c,0)`\\n * `s = x*(1-n)`\\n */\\n function defaultSurplus(\\n uint256 a, // <= 2**128-1\\n uint256 b, // <= 2**128-1\\n uint256 c, // <= 2**128-1\\n uint256 y /// == x*(1-n) <= x <= e <= 2**128-1\\n ) private pure returns (Output memory output) {\\n uint256 z = MathEx.subMax0(y, c);\\n output.p = MathEx.mulDivF(a, z, b).toNeg256();\\n output.q = output.p;\\n output.r = z.toNeg256();\\n output.s = y;\\n }\\n\\n /**\\n * @dev returns `t` and `u` according to the current state:\\n * +-----------------------+-------+---------------------------+-------------------+\\n * | x*(1-n)*(e-b-c)/e > w | a > 0 | t | u |\\n * +-----------------------+-------+---------------------------+-------------------+\\n * | true | true | a*(x*(1-n)*(e-b-c)/e-w)/b | w |\\n * +-----------------------+-------+---------------------------+-------------------+\\n * | true | false | 0 | w |\\n * +-----------------------+-------+---------------------------+-------------------+\\n * | false | true | 0 | x*(1-n)*(e-b-c)/e |\\n * +-----------------------+-------+---------------------------+-------------------+\\n * | false | false | 0 | x*(1-n)*(e-b-c)/e |\\n * +-----------------------+-------+---------------------------+-------------------+\\n */\\n function externalProtection(\\n uint256 a, // <= 2**128-1\\n uint256 b, // <= 2**128-1\\n uint256 e, // <= 2**128-1\\n uint256 g, // == e-b-c <= e <= 2**128-1\\n uint256 y, // == x*(1-n) <= x <= e <= 2**128-1\\n uint256 w /// <= 2**128-1\\n ) private pure returns (uint256 t, uint256 u) {\\n uint256 yg = y * g;\\n uint256 we = w * e;\\n if (yg > we) {\\n t = a > 0 ? MathEx.mulDivF(a, yg - we, b * e) : 0;\\n u = w;\\n } else {\\n t = 0;\\n u = yg / e;\\n }\\n }\\n\\n /**\\n * @dev returns `a*b+x*y/z`\\n */\\n function mulAddMulDivF(uint256 a, uint256 b, uint256 x, uint256 y, uint256 z) private pure returns (uint256) {\\n return a * b + MathEx.mulDivF(x, y, z);\\n }\\n\\n /**\\n * @dev returns `a*b-x*y/z`\\n */\\n function mulSubMulDivF(uint256 a, uint256 b, uint256 x, uint256 y, uint256 z) private pure returns (uint256) {\\n return a * b - MathEx.mulDivF(x, y, z);\\n }\\n}\\n\",\"keccak256\":\"0xe14055ca8e4da2eaf09971b60f4425c8fb0989d4e61870a33e76f7c34b541e70\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/pools/interfaces/IBNTPool.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { IPoolToken } from \\\"./IPoolToken.sol\\\";\\n\\nimport { Token } from \\\"../../token/Token.sol\\\";\\n\\nimport { IVault } from \\\"../../vaults/interfaces/IVault.sol\\\";\\n\\n// the BNT pool token manager role is required to access the BNT pool tokens\\nbytes32 constant ROLE_BNT_POOL_TOKEN_MANAGER = keccak256(\\\"ROLE_BNT_POOL_TOKEN_MANAGER\\\");\\n\\n// the BNT manager role is required to request the BNT pool to mint BNT\\nbytes32 constant ROLE_BNT_MANAGER = keccak256(\\\"ROLE_BNT_MANAGER\\\");\\n\\n// the vault manager role is required to request the BNT pool to burn BNT from the master vault\\nbytes32 constant ROLE_VAULT_MANAGER = keccak256(\\\"ROLE_VAULT_MANAGER\\\");\\n\\n// the funding manager role is required to request or renounce funding from the BNT pool\\nbytes32 constant ROLE_FUNDING_MANAGER = keccak256(\\\"ROLE_FUNDING_MANAGER\\\");\\n\\n/**\\n * @dev BNT Pool interface\\n */\\ninterface IBNTPool is IVault {\\n /**\\n * @dev returns the BNT pool token contract\\n */\\n function poolToken() external view returns (IPoolToken);\\n\\n /**\\n * @dev returns the total staked BNT balance in the network\\n */\\n function stakedBalance() external view returns (uint256);\\n\\n /**\\n * @dev returns the current funding of given pool\\n */\\n function currentPoolFunding(Token pool) external view returns (uint256);\\n\\n /**\\n * @dev returns the available BNT funding for a given pool\\n */\\n function availableFunding(Token pool) external view returns (uint256);\\n\\n /**\\n * @dev converts the specified pool token amount to the underlying BNT amount\\n */\\n function poolTokenToUnderlying(uint256 poolTokenAmount) external view returns (uint256);\\n\\n /**\\n * @dev converts the specified underlying BNT amount to pool token amount\\n */\\n function underlyingToPoolToken(uint256 bntAmount) external view returns (uint256);\\n\\n /**\\n * @dev returns the number of pool token to burn in order to increase everyone's underlying value by the specified\\n * amount\\n */\\n function poolTokenAmountToBurn(uint256 bntAmountToDistribute) external view returns (uint256);\\n\\n /**\\n * @dev mints BNT to the recipient\\n *\\n * requirements:\\n *\\n * - the caller must have the ROLE_BNT_MANAGER role\\n */\\n function mint(address recipient, uint256 bntAmount) external;\\n\\n /**\\n * @dev burns BNT from the vault\\n *\\n * requirements:\\n *\\n * - the caller must have the ROLE_VAULT_MANAGER role\\n */\\n function burnFromVault(uint256 bntAmount) external;\\n\\n /**\\n * @dev deposits BNT liquidity on behalf of a specific provider and returns the respective pool token amount\\n *\\n * requirements:\\n *\\n * - the caller must be the network contract\\n * - BNT tokens must have been already deposited into the contract\\n */\\n function depositFor(\\n bytes32 contextId,\\n address provider,\\n uint256 bntAmount,\\n bool isMigrating,\\n uint256 originalVBNTAmount\\n ) external returns (uint256);\\n\\n /**\\n * @dev withdraws BNT liquidity on behalf of a specific provider and returns the withdrawn BNT amount\\n *\\n * requirements:\\n *\\n * - the caller must be the network contract\\n * - bnBNT token must have been already deposited into the contract\\n * - vBNT token must have been already deposited into the contract\\n */\\n function withdraw(\\n bytes32 contextId,\\n address provider,\\n uint256 poolTokenAmount,\\n uint256 bntAmount\\n ) external returns (uint256);\\n\\n /**\\n * @dev returns the withdrawn BNT amount\\n */\\n function withdrawalAmount(uint256 poolTokenAmount) external view returns (uint256);\\n\\n /**\\n * @dev requests BNT funding\\n *\\n * requirements:\\n *\\n * - the caller must have the ROLE_FUNDING_MANAGER role\\n * - the token must have been whitelisted\\n * - the request amount should be below the funding limit for a given pool\\n * - the average rate of the pool must not deviate too much from its spot rate\\n */\\n function requestFunding(\\n bytes32 contextId,\\n Token pool,\\n uint256 bntAmount\\n ) external;\\n\\n /**\\n * @dev renounces BNT funding\\n *\\n * requirements:\\n *\\n * - the caller must have the ROLE_FUNDING_MANAGER role\\n * - the token must have been whitelisted\\n * - the average rate of the pool must not deviate too much from its spot rate\\n */\\n function renounceFunding(\\n bytes32 contextId,\\n Token pool,\\n uint256 bntAmount\\n ) external;\\n\\n /**\\n * @dev notifies the pool of accrued fees\\n *\\n * requirements:\\n *\\n * - the caller must be the network contract\\n */\\n function onFeesCollected(\\n Token pool,\\n uint256 feeAmount,\\n bool isTradeFee\\n ) external;\\n}\\n\",\"keccak256\":\"0xed6a5abb972bdc42e1d32dd4157c0968b5d34d3a6560dcffeb1479ed994fd5a8\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/pools/interfaces/IPoolCollection.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { IVersioned } from \\\"../../utility/interfaces/IVersioned.sol\\\";\\nimport { Fraction112 } from \\\"../../utility/FractionLibrary.sol\\\";\\n\\nimport { Token } from \\\"../../token/Token.sol\\\";\\n\\nimport { IPoolToken } from \\\"./IPoolToken.sol\\\";\\n\\nstruct PoolLiquidity {\\n uint128 bntTradingLiquidity; // the BNT trading liquidity\\n uint128 baseTokenTradingLiquidity; // the base token trading liquidity\\n uint256 stakedBalance; // the staked balance\\n}\\n\\nstruct AverageRates {\\n uint32 blockNumber;\\n Fraction112 rate;\\n Fraction112 invRate;\\n}\\n\\nstruct Pool {\\n IPoolToken poolToken; // the pool token of the pool\\n uint32 tradingFeePPM; // the trading fee (in units of PPM)\\n bool tradingEnabled; // whether trading is enabled\\n bool depositingEnabled; // whether depositing is enabled\\n AverageRates averageRates; // the recent average rates\\n PoolLiquidity liquidity; // the overall liquidity in the pool\\n}\\n\\nstruct WithdrawalAmounts {\\n uint256 totalAmount;\\n uint256 baseTokenAmount;\\n uint256 bntAmount;\\n}\\n\\n// trading enabling/disabling reasons\\nuint8 constant TRADING_STATUS_UPDATE_DEFAULT = 0;\\nuint8 constant TRADING_STATUS_UPDATE_ADMIN = 1;\\nuint8 constant TRADING_STATUS_UPDATE_MIN_LIQUIDITY = 2;\\nuint8 constant TRADING_STATUS_UPDATE_INVALID_STATE = 3;\\nuint8 constant TRADING_STATUS_UPDATE_NETWORK_DISABLE = 4;\\n\\nstruct TradeAmountAndFee {\\n uint256 amount; // the source/target amount (depending on the context) resulting from the trade\\n uint256 tradingFeeAmount; // the trading fee amount\\n uint256 networkFeeAmount; // the network fee amount (always in units of BNT)\\n}\\n\\n/**\\n * @dev Pool Collection interface\\n */\\ninterface IPoolCollection is IVersioned {\\n /**\\n * @dev returns the type of the pool\\n */\\n function poolType() external view returns (uint16);\\n\\n /**\\n * @dev returns the default trading fee (in units of PPM)\\n */\\n function defaultTradingFeePPM() external view returns (uint32);\\n\\n /**\\n * @dev returns the network fee (in units of PPM)\\n */\\n function networkFeePPM() external view returns (uint32);\\n\\n /**\\n * @dev returns all the pools which are managed by this pool collection\\n */\\n function pools() external view returns (Token[] memory);\\n\\n /**\\n * @dev returns the number of all the pools which are managed by this pool collection\\n */\\n function poolCount() external view returns (uint256);\\n\\n /**\\n * @dev returns whether a pool is valid\\n */\\n function isPoolValid(Token pool) external view returns (bool);\\n\\n /**\\n * @dev returns the overall liquidity in the pool\\n */\\n function poolLiquidity(Token pool) external view returns (PoolLiquidity memory);\\n\\n /**\\n * @dev returns the pool token of the pool\\n */\\n function poolToken(Token pool) external view returns (IPoolToken);\\n\\n /**\\n * @dev returns the trading fee (in units of PPM)\\n */\\n function tradingFeePPM(Token pool) external view returns (uint32);\\n\\n /**\\n * @dev returns whether trading is enabled\\n */\\n function tradingEnabled(Token pool) external view returns (bool);\\n\\n /**\\n * @dev returns whether depositing is enabled\\n */\\n function depositingEnabled(Token pool) external view returns (bool);\\n\\n /**\\n * @dev returns whether the pool is stable\\n */\\n function isPoolStable(Token pool) external view returns (bool);\\n\\n /**\\n * @dev converts the specified pool token amount to the underlying base token amount\\n */\\n function poolTokenToUnderlying(Token pool, uint256 poolTokenAmount) external view returns (uint256);\\n\\n /**\\n * @dev converts the specified underlying base token amount to pool token amount\\n */\\n function underlyingToPoolToken(Token pool, uint256 baseTokenAmount) external view returns (uint256);\\n\\n /**\\n * @dev returns the number of pool token to burn in order to increase everyone's underlying value by the specified\\n * amount\\n */\\n function poolTokenAmountToBurn(\\n Token pool,\\n uint256 baseTokenAmountToDistribute,\\n uint256 protocolPoolTokenAmount\\n ) external view returns (uint256);\\n\\n /**\\n * @dev creates a new pool\\n *\\n * requirements:\\n *\\n * - the caller must be the network contract\\n * - the pool should have been whitelisted\\n * - the pool isn't already defined in the collection\\n */\\n function createPool(Token token) external;\\n\\n /**\\n * @dev deposits base token liquidity on behalf of a specific provider and returns the respective pool token amount\\n *\\n * requirements:\\n *\\n * - the caller must be the network contract\\n * - assumes that the base token has been already deposited in the vault\\n */\\n function depositFor(\\n bytes32 contextId,\\n address provider,\\n Token pool,\\n uint256 baseTokenAmount\\n ) external returns (uint256);\\n\\n /**\\n * @dev handles some of the withdrawal-related actions and returns the withdrawn base token amount\\n *\\n * requirements:\\n *\\n * - the caller must be the network contract\\n * - the caller must have approved the collection to transfer/burn the pool token amount on its behalf\\n */\\n function withdraw(\\n bytes32 contextId,\\n address provider,\\n Token pool,\\n uint256 poolTokenAmount,\\n uint256 baseTokenAmount\\n ) external returns (uint256);\\n\\n /**\\n * @dev returns the amounts that would be returned if the position is currently withdrawn,\\n * along with the breakdown of the base token and the BNT compensation\\n */\\n function withdrawalAmounts(Token pool, uint256 poolTokenAmount) external view returns (WithdrawalAmounts memory);\\n\\n /**\\n * @dev performs a trade by providing the source amount and returns the target amount and the associated fee\\n *\\n * requirements:\\n *\\n * - the caller must be the network contract\\n */\\n function tradeBySourceAmount(\\n bytes32 contextId,\\n Token sourceToken,\\n Token targetToken,\\n uint256 sourceAmount,\\n uint256 minReturnAmount,\\n bool ignoreFees\\n ) external returns (TradeAmountAndFee memory);\\n\\n /**\\n * @dev performs a trade by providing the target amount and returns the required source amount and the associated fee\\n *\\n * requirements:\\n *\\n * - the caller must be the network contract\\n */\\n function tradeByTargetAmount(\\n bytes32 contextId,\\n Token sourceToken,\\n Token targetToken,\\n uint256 targetAmount,\\n uint256 maxSourceAmount,\\n bool ignoreFees\\n ) external returns (TradeAmountAndFee memory);\\n\\n /**\\n * @dev returns the output amount and fee when trading by providing the source amount\\n */\\n function tradeOutputAndFeeBySourceAmount(\\n Token sourceToken,\\n Token targetToken,\\n uint256 sourceAmount\\n ) external view returns (TradeAmountAndFee memory);\\n\\n /**\\n * @dev returns the input amount and fee when trading by providing the target amount\\n */\\n function tradeInputAndFeeByTargetAmount(\\n Token sourceToken,\\n Token targetToken,\\n uint256 targetAmount\\n ) external view returns (TradeAmountAndFee memory);\\n\\n /**\\n * @dev notifies the pool of accrued fees\\n *\\n * requirements:\\n *\\n * - the caller must be the network contract\\n */\\n function onFeesCollected(Token pool, uint256 feeAmount) external;\\n\\n /**\\n * @dev migrates a pool to this pool collection\\n *\\n * requirements:\\n *\\n * - the caller must be the pool migrator contract\\n */\\n function migratePoolIn(Token pool, Pool calldata data) external;\\n\\n /**\\n * @dev migrates a pool from this pool collection\\n *\\n * requirements:\\n *\\n * - the caller must be the pool migrator contract\\n */\\n function migratePoolOut(Token pool, IPoolCollection targetPoolCollection) external;\\n\\n /**\\n * @dev disables trading on a pool\\n *\\n * requirements:\\n *\\n * - the caller must be the network contract\\n */\\n function disableTradingByNetwork(Token pool) external;\\n}\\n\",\"keccak256\":\"0xb9433cded2e24fd4b1926c1ba0fa2969a15b115328d1c9f83d49ab16f36dfbc1\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/pools/interfaces/IPoolMigrator.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { Token } from \\\"../../token/Token.sol\\\";\\n\\nimport { IVersioned } from \\\"../../utility/interfaces/IVersioned.sol\\\";\\n\\nimport { IPoolCollection } from \\\"./IPoolCollection.sol\\\";\\n\\n/**\\n * @dev Pool Migrator interface\\n */\\ninterface IPoolMigrator is IVersioned {\\n /**\\n * @dev migrates a pool and returns the new pool collection it exists in\\n *\\n * notes:\\n *\\n * - invalid or incompatible pools will be skipped gracefully\\n *\\n * requirements:\\n *\\n * - the caller must be the network contract\\n */\\n function migratePool(Token pool, IPoolCollection newPoolCollection) external;\\n}\\n\",\"keccak256\":\"0x3dde1a08987c3d1a79bf10746c772ea68d1daa69b165b638dfdfeb6bfb269102\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/pools/interfaces/IPoolToken.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport { IERC20Permit } from \\\"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\\\";\\n\\nimport { IERC20Burnable } from \\\"../../token/interfaces/IERC20Burnable.sol\\\";\\nimport { Token } from \\\"../../token/Token.sol\\\";\\n\\nimport { IVersioned } from \\\"../../utility/interfaces/IVersioned.sol\\\";\\nimport { IOwned } from \\\"../../utility/interfaces/IOwned.sol\\\";\\n\\n/**\\n * @dev Pool Token interface\\n */\\ninterface IPoolToken is IVersioned, IOwned, IERC20, IERC20Permit, IERC20Burnable {\\n /**\\n * @dev returns the address of the reserve token\\n */\\n function reserveToken() external view returns (Token);\\n\\n /**\\n * @dev increases the token supply and sends the new tokens to the given account\\n *\\n * requirements:\\n *\\n * - the caller must be the owner of the contract\\n */\\n function mint(address recipient, uint256 amount) external;\\n}\\n\",\"keccak256\":\"0x698423b0fc59424e60d5effe3b79b8aeb5d478b04e5569e3a4ba5fe6936fb2b7\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/pools/interfaces/IPoolTokenFactory.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { Token } from \\\"../../token/Token.sol\\\";\\n\\nimport { IUpgradeable } from \\\"../../utility/interfaces/IUpgradeable.sol\\\";\\n\\nimport { IPoolToken } from \\\"./IPoolToken.sol\\\";\\n\\n/**\\n * @dev Pool Token Factory interface\\n */\\ninterface IPoolTokenFactory is IUpgradeable {\\n /**\\n * @dev returns the custom symbol override for a given reserve token\\n */\\n function tokenSymbolOverride(Token token) external view returns (string memory);\\n\\n /**\\n * @dev returns the custom decimals override for a given reserve token\\n */\\n function tokenDecimalsOverride(Token token) external view returns (uint8);\\n\\n /**\\n * @dev creates a pool token for the specified token\\n */\\n function createPoolToken(Token token) external returns (IPoolToken);\\n}\\n\",\"keccak256\":\"0xc0936c8ef93af6ffeb6eaa0c9ae13a7ea5c13c9ec7b42367ea952be26d17e748\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/token/SafeERC20Ex.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport { SafeERC20 } from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\n\\n/**\\n * @dev extends the SafeERC20 library with additional operations\\n */\\nlibrary SafeERC20Ex {\\n using SafeERC20 for IERC20;\\n\\n /**\\n * @dev ensures that the spender has sufficient allowance\\n */\\n function ensureApprove(IERC20 token, address spender, uint256 amount) internal {\\n if (amount == 0) {\\n return;\\n }\\n\\n uint256 allowance = token.allowance(address(this), spender);\\n if (allowance >= amount) {\\n return;\\n }\\n\\n if (allowance > 0) {\\n token.safeApprove(spender, 0);\\n }\\n token.safeApprove(spender, amount);\\n }\\n}\\n\",\"keccak256\":\"0x8976816df06d18659fd6c95611aa32aa48ca2d1d4f64e63235bf5c9802bf85bf\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/token/Token.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\n/**\\n * @dev the main purpose of the Token interfaces is to ensure artificially that we won't use ERC20's standard functions,\\n * but only their safe versions, which are provided by SafeERC20 and SafeERC20Ex via the TokenLibrary contract\\n */\\ninterface Token {\\n\\n}\\n\",\"keccak256\":\"0x49d0e5ac0dab272f4001a63e7f4117eb13b42c655ee788c42a333f56f19ac2e9\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/token/TokenLibrary.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport { ERC20 } from \\\"@openzeppelin/contracts/token/ERC20/ERC20.sol\\\";\\nimport { SafeERC20 } from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\n\\nimport { SafeERC20Ex } from \\\"./SafeERC20Ex.sol\\\";\\n\\nimport { Token } from \\\"./Token.sol\\\";\\n\\n/**\\n * @dev This library implements ERC20 and SafeERC20 utilities for both the native token and for ERC20 tokens\\n */\\nlibrary TokenLibrary {\\n using SafeERC20 for IERC20;\\n using SafeERC20Ex for IERC20;\\n\\n error PermitUnsupported();\\n\\n // the address that represents the native token reserve\\n address private constant NATIVE_TOKEN_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\\n\\n // the symbol that represents the native token\\n string private constant NATIVE_TOKEN_SYMBOL = \\\"ETH\\\";\\n\\n // the decimals for the native token\\n uint8 private constant NATIVE_TOKEN_DECIMALS = 18;\\n\\n // the token representing the native token\\n Token public constant NATIVE_TOKEN = Token(NATIVE_TOKEN_ADDRESS);\\n\\n /**\\n * @dev returns whether the provided token represents an ERC20 or the native token reserve\\n */\\n function isNative(Token token) internal pure returns (bool) {\\n return address(token) == NATIVE_TOKEN_ADDRESS;\\n }\\n\\n /**\\n * @dev returns the symbol of the native token/ERC20 token\\n */\\n function symbol(Token token) internal view returns (string memory) {\\n if (isNative(token)) {\\n return NATIVE_TOKEN_SYMBOL;\\n }\\n\\n return toERC20(token).symbol();\\n }\\n\\n /**\\n * @dev returns the decimals of the native token/ERC20 token\\n */\\n function decimals(Token token) internal view returns (uint8) {\\n if (isNative(token)) {\\n return NATIVE_TOKEN_DECIMALS;\\n }\\n\\n return toERC20(token).decimals();\\n }\\n\\n /**\\n * @dev returns the balance of the native token/ERC20 token\\n */\\n function balanceOf(Token token, address account) internal view returns (uint256) {\\n if (isNative(token)) {\\n return account.balance;\\n }\\n\\n return toIERC20(token).balanceOf(account);\\n }\\n\\n /**\\n * @dev transfers a specific amount of the native token/ERC20 token\\n */\\n function safeTransfer(Token token, address to, uint256 amount) internal {\\n if (amount == 0) {\\n return;\\n }\\n\\n if (isNative(token)) {\\n payable(to).transfer(amount);\\n } else {\\n toIERC20(token).safeTransfer(to, amount);\\n }\\n }\\n\\n /**\\n * @dev transfers a specific amount of the native token/ERC20 token from a specific holder using the allowance mechanism\\n *\\n * note that the function does not perform any action if the native token is provided\\n */\\n function safeTransferFrom(Token token, address from, address to, uint256 amount) internal {\\n if (amount == 0 || isNative(token)) {\\n return;\\n }\\n\\n toIERC20(token).safeTransferFrom(from, to, amount);\\n }\\n\\n /**\\n * @dev approves a specific amount of the native token/ERC20 token from a specific holder\\n *\\n * note that the function does not perform any action if the native token is provided\\n */\\n function safeApprove(Token token, address spender, uint256 amount) internal {\\n if (isNative(token)) {\\n return;\\n }\\n\\n toIERC20(token).safeApprove(spender, amount);\\n }\\n\\n /**\\n * @dev increases allowance of the native token/ERC20 token from a specific holder\\n *\\n * note that the function does not perform any action if the native token is provided\\n */\\n function safeIncreaseAllowance(Token token, address spender, uint256 amount) internal {\\n if (isNative(token)) {\\n return;\\n }\\n\\n toIERC20(token).safeIncreaseAllowance(spender, amount);\\n }\\n\\n /**\\n * @dev ensures that the spender has sufficient allowance\\n *\\n * note that the function does not perform any action if the native token is provided\\n */\\n function ensureApprove(Token token, address spender, uint256 amount) internal {\\n if (isNative(token)) {\\n return;\\n }\\n\\n toIERC20(token).ensureApprove(spender, amount);\\n }\\n\\n /**\\n * @dev compares between a token and another raw ERC20 token\\n */\\n function isEqual(Token token, IERC20 erc20Token) internal pure returns (bool) {\\n return toIERC20(token) == erc20Token;\\n }\\n\\n /**\\n * @dev utility function that converts a token to an IERC20\\n */\\n function toIERC20(Token token) internal pure returns (IERC20) {\\n return IERC20(address(token));\\n }\\n\\n /**\\n * @dev utility function that converts a token to an ERC20\\n */\\n function toERC20(Token token) internal pure returns (ERC20) {\\n return ERC20(address(token));\\n }\\n}\\n\",\"keccak256\":\"0x74eb4bbfb891affa1df59a729a6fe1c07fd875a0e8accbee345db3e6aab1fb3f\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/token/interfaces/IERC20Burnable.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\n/**\\n * @dev burnable ERC20 interface\\n */\\ninterface IERC20Burnable {\\n /**\\n * @dev Destroys tokens from the caller.\\n */\\n function burn(uint256 amount) external;\\n\\n /**\\n * @dev Destroys tokens from a recipient, deducting from the caller's allowance\\n *\\n * requirements:\\n *\\n * - the caller must have allowance for recipient's tokens of at least the specified amount\\n */\\n function burnFrom(address recipient, uint256 amount) external;\\n}\\n\",\"keccak256\":\"0x222a3ba8286edf54d3e75a70683ffcbe6eb3c5ba5f6b3c6a6d98a716e9bd5332\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/utility/BlockNumber.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\n/**\\n * @dev this contract abstracts the block number in order to allow for more flexible control in tests\\n */\\nabstract contract BlockNumber {\\n /**\\n * @dev returns the current block-number\\n */\\n function _blockNumber() internal view virtual returns (uint32) {\\n return uint32(block.number);\\n }\\n}\\n\",\"keccak256\":\"0x11d63faaec9f5a39da662887a91594b2fb1da86b0d9834456455bc9e30735630\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/utility/Constants.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nuint32 constant PPM_RESOLUTION = 1_000_000;\\n\",\"keccak256\":\"0x5215535db0a4e580cd19380cc1cf3a2b7edcbb8ee039e416319fe9f8867724ad\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/utility/Fraction.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nstruct Fraction {\\n uint256 n;\\n uint256 d;\\n}\\n\\nstruct Fraction112 {\\n uint112 n;\\n uint112 d;\\n}\\n\\nerror InvalidFraction();\\n\",\"keccak256\":\"0xb965a448e314353c82bc9fb7c0552057427a90100ebda4450b21fc932356a4d1\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/utility/FractionLibrary.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { Fraction, Fraction112, InvalidFraction } from \\\"./Fraction.sol\\\";\\nimport { MathEx } from \\\"./MathEx.sol\\\";\\n\\n// solhint-disable-next-line func-visibility\\nfunction zeroFraction() pure returns (Fraction memory) {\\n return Fraction({ n: 0, d: 1 });\\n}\\n\\n// solhint-disable-next-line func-visibility\\nfunction zeroFraction112() pure returns (Fraction112 memory) {\\n return Fraction112({ n: 0, d: 1 });\\n}\\n\\n/**\\n * @dev this library provides a set of fraction operations\\n */\\nlibrary FractionLibrary {\\n /**\\n * @dev returns whether a standard fraction is valid\\n */\\n function isValid(Fraction memory fraction) internal pure returns (bool) {\\n return fraction.d != 0;\\n }\\n\\n /**\\n * @dev returns whether a 112-bit fraction is valid\\n */\\n function isValid(Fraction112 memory fraction) internal pure returns (bool) {\\n return fraction.d != 0;\\n }\\n\\n /**\\n * @dev returns whether a standard fraction is positive\\n */\\n function isPositive(Fraction memory fraction) internal pure returns (bool) {\\n return isValid(fraction) && fraction.n != 0;\\n }\\n\\n /**\\n * @dev returns whether a 112-bit fraction is positive\\n */\\n function isPositive(Fraction112 memory fraction) internal pure returns (bool) {\\n return isValid(fraction) && fraction.n != 0;\\n }\\n\\n /**\\n * @dev returns the inverse of a given fraction\\n */\\n function inverse(Fraction memory fraction) internal pure returns (Fraction memory) {\\n Fraction memory invFraction = Fraction({ n: fraction.d, d: fraction.n });\\n\\n if (!isValid(invFraction)) {\\n revert InvalidFraction();\\n }\\n\\n return invFraction;\\n }\\n\\n /**\\n * @dev returns the inverse of a given fraction\\n */\\n function inverse(Fraction112 memory fraction) internal pure returns (Fraction112 memory) {\\n Fraction112 memory invFraction = Fraction112({ n: fraction.d, d: fraction.n });\\n\\n if (!isValid(invFraction)) {\\n revert InvalidFraction();\\n }\\n\\n return invFraction;\\n }\\n\\n /**\\n * @dev reduces a standard fraction to a 112-bit fraction\\n */\\n function toFraction112(Fraction memory fraction) internal pure returns (Fraction112 memory) {\\n Fraction memory truncatedFraction = MathEx.truncatedFraction(fraction, type(uint112).max);\\n\\n return Fraction112({ n: uint112(truncatedFraction.n), d: uint112(truncatedFraction.d) });\\n }\\n\\n /**\\n * @dev expands a 112-bit fraction to a standard fraction\\n */\\n function fromFraction112(Fraction112 memory fraction) internal pure returns (Fraction memory) {\\n return Fraction({ n: fraction.n, d: fraction.d });\\n }\\n}\\n\",\"keccak256\":\"0x480325242afb487705c5e7fafb3a1268ec1ac118ca99c7a52da3577e16a53606\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/utility/MathEx.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { Math } from \\\"@openzeppelin/contracts/utils/math/Math.sol\\\";\\nimport { Fraction, InvalidFraction } from \\\"./Fraction.sol\\\";\\n\\nimport { PPM_RESOLUTION } from \\\"./Constants.sol\\\";\\n\\nuint256 constant ONE = 0x80000000000000000000000000000000;\\nuint256 constant LN2 = 0x58b90bfbe8e7bcd5e4f1d9cc01f97b57;\\n\\nstruct Uint512 {\\n uint256 hi; // 256 most significant bits\\n uint256 lo; // 256 least significant bits\\n}\\n\\nstruct Sint256 {\\n uint256 value;\\n bool isNeg;\\n}\\n\\n/**\\n * @dev this library provides a set of complex math operations\\n */\\nlibrary MathEx {\\n error Overflow();\\n\\n /**\\n * @dev returns `2 ^ f` by calculating `e ^ (f * ln(2))`, where `e` is Euler's number:\\n * - Rewrite the input as a sum of binary exponents and a single residual r, as small as possible\\n * - The exponentiation of each binary exponent is given (pre-calculated)\\n * - The exponentiation of r is calculated via Taylor series for e^x, where x = r\\n * - The exponentiation of the input is calculated by multiplying the intermediate results above\\n * - For example: e^5.521692859 = e^(4 + 1 + 0.5 + 0.021692859) = e^4 * e^1 * e^0.5 * e^0.021692859\\n */\\n function exp2(Fraction memory f) internal pure returns (Fraction memory) {\\n uint256 x = MathEx.mulDivF(LN2, f.n, f.d);\\n uint256 y;\\n uint256 z;\\n uint256 n;\\n\\n if (x >= (ONE << 4)) {\\n revert Overflow();\\n }\\n\\n unchecked {\\n z = y = x % (ONE >> 3); // get the input modulo 2^(-3)\\n z = (z * y) / ONE;\\n n += z * 0x10e1b3be415a0000; // add y^02 * (20! / 02!)\\n z = (z * y) / ONE;\\n n += z * 0x05a0913f6b1e0000; // add y^03 * (20! / 03!)\\n z = (z * y) / ONE;\\n n += z * 0x0168244fdac78000; // add y^04 * (20! / 04!)\\n z = (z * y) / ONE;\\n n += z * 0x004807432bc18000; // add y^05 * (20! / 05!)\\n z = (z * y) / ONE;\\n n += z * 0x000c0135dca04000; // add y^06 * (20! / 06!)\\n z = (z * y) / ONE;\\n n += z * 0x0001b707b1cdc000; // add y^07 * (20! / 07!)\\n z = (z * y) / ONE;\\n n += z * 0x000036e0f639b800; // add y^08 * (20! / 08!)\\n z = (z * y) / ONE;\\n n += z * 0x00000618fee9f800; // add y^09 * (20! / 09!)\\n z = (z * y) / ONE;\\n n += z * 0x0000009c197dcc00; // add y^10 * (20! / 10!)\\n z = (z * y) / ONE;\\n n += z * 0x0000000e30dce400; // add y^11 * (20! / 11!)\\n z = (z * y) / ONE;\\n n += z * 0x000000012ebd1300; // add y^12 * (20! / 12!)\\n z = (z * y) / ONE;\\n n += z * 0x0000000017499f00; // add y^13 * (20! / 13!)\\n z = (z * y) / ONE;\\n n += z * 0x0000000001a9d480; // add y^14 * (20! / 14!)\\n z = (z * y) / ONE;\\n n += z * 0x00000000001c6380; // add y^15 * (20! / 15!)\\n z = (z * y) / ONE;\\n n += z * 0x000000000001c638; // add y^16 * (20! / 16!)\\n z = (z * y) / ONE;\\n n += z * 0x0000000000001ab8; // add y^17 * (20! / 17!)\\n z = (z * y) / ONE;\\n n += z * 0x000000000000017c; // add y^18 * (20! / 18!)\\n z = (z * y) / ONE;\\n n += z * 0x0000000000000014; // add y^19 * (20! / 19!)\\n z = (z * y) / ONE;\\n n += z * 0x0000000000000001; // add y^20 * (20! / 20!)\\n n = n / 0x21c3677c82b40000 + y + ONE; // divide by 20! and then add y^1 / 1! + y^0 / 0!\\n\\n if ((x & (ONE >> 3)) != 0)\\n n = (n * 0x1c3d6a24ed82218787d624d3e5eba95f9) / 0x18ebef9eac820ae8682b9793ac6d1e776; // multiply by e^(2^-3)\\n if ((x & (ONE >> 2)) != 0)\\n n = (n * 0x18ebef9eac820ae8682b9793ac6d1e778) / 0x1368b2fc6f9609fe7aceb46aa619baed4; // multiply by e^(2^-2)\\n if ((x & (ONE >> 1)) != 0)\\n n = (n * 0x1368b2fc6f9609fe7aceb46aa619baed5) / 0x0bc5ab1b16779be3575bd8f0520a9f21f; // multiply by e^(2^-1)\\n if ((x & (ONE << 0)) != 0)\\n n = (n * 0x0bc5ab1b16779be3575bd8f0520a9f21e) / 0x0454aaa8efe072e7f6ddbab84b40a55c9; // multiply by e^(2^+0)\\n if ((x & (ONE << 1)) != 0)\\n n = (n * 0x0454aaa8efe072e7f6ddbab84b40a55c5) / 0x00960aadc109e7a3bf4578099615711ea; // multiply by e^(2^+1)\\n if ((x & (ONE << 2)) != 0)\\n n = (n * 0x00960aadc109e7a3bf4578099615711d7) / 0x0002bf84208204f5977f9a8cf01fdce3d; // multiply by e^(2^+2)\\n if ((x & (ONE << 3)) != 0)\\n n = (n * 0x0002bf84208204f5977f9a8cf01fdc307) / 0x0000003c6ab775dd0b95b4cbee7e65d11; // multiply by e^(2^+3)\\n }\\n\\n return Fraction({ n: n, d: ONE });\\n }\\n\\n /**\\n * @dev returns a fraction with truncated components\\n * note that since the input value is truncated, the use of the method incurs precision loss\\n */\\n function truncatedFraction(Fraction memory fraction, uint256 max) internal pure returns (Fraction memory) {\\n uint256 scale = Math.ceilDiv(Math.max(fraction.n, fraction.d), max);\\n Fraction memory truncated = Fraction({ n: fraction.n / scale, d: fraction.d / scale });\\n if (truncated.d == 0) {\\n revert InvalidFraction();\\n }\\n\\n return truncated;\\n }\\n\\n /**\\n * @dev returns the weighted average of two fractions\\n */\\n function weightedAverage(\\n Fraction memory fraction1,\\n Fraction memory fraction2,\\n uint256 weight1,\\n uint256 weight2\\n ) internal pure returns (Fraction memory) {\\n return\\n Fraction({\\n n: fraction1.n * fraction2.d * weight1 + fraction1.d * fraction2.n * weight2,\\n d: fraction1.d * fraction2.d * (weight1 + weight2)\\n });\\n }\\n\\n /**\\n * @dev returns whether or not the deviation of an offset sample from a base sample is within a permitted range\\n * for example, if the maximum permitted deviation is 5%, then evaluate `95% * base <= offset <= 105% * base`\\n */\\n function isInRange(\\n Fraction memory baseSample,\\n Fraction memory offsetSample,\\n uint32 maxDeviationPPM\\n ) internal pure returns (bool) {\\n Uint512 memory min = mul512(baseSample.n, offsetSample.d * (PPM_RESOLUTION - maxDeviationPPM));\\n Uint512 memory mid = mul512(baseSample.d, offsetSample.n * PPM_RESOLUTION);\\n Uint512 memory max = mul512(baseSample.n, offsetSample.d * (PPM_RESOLUTION + maxDeviationPPM));\\n return lte512(min, mid) && lte512(mid, max);\\n }\\n\\n /**\\n * @dev returns an `Sint256` positive representation of an unsigned integer\\n */\\n function toPos256(uint256 n) internal pure returns (Sint256 memory) {\\n return Sint256({ value: n, isNeg: false });\\n }\\n\\n /**\\n * @dev returns an `Sint256` negative representation of an unsigned integer\\n */\\n function toNeg256(uint256 n) internal pure returns (Sint256 memory) {\\n return Sint256({ value: n, isNeg: true });\\n }\\n\\n /**\\n * @dev returns the largest integer smaller than or equal to `x * y / z`\\n */\\n function mulDivF(uint256 x, uint256 y, uint256 z) internal pure returns (uint256) {\\n Uint512 memory xy = mul512(x, y);\\n\\n // if `x * y < 2 ^ 256`\\n if (xy.hi == 0) {\\n return xy.lo / z;\\n }\\n\\n // assert `x * y / z < 2 ^ 256`\\n if (xy.hi >= z) {\\n revert Overflow();\\n }\\n\\n uint256 m = _mulMod(x, y, z); // `m = x * y % z`\\n Uint512 memory n = _sub512(xy, m); // `n = x * y - m` hence `n / z = floor(x * y / z)`\\n\\n // if `n < 2 ^ 256`\\n if (n.hi == 0) {\\n return n.lo / z;\\n }\\n\\n uint256 p = _unsafeSub(0, z) & z; // `p` is the largest power of 2 which `z` is divisible by\\n uint256 q = _div512(n, p); // `n` is divisible by `p` because `n` is divisible by `z` and `z` is divisible by `p`\\n uint256 r = _inv256(z / p); // `z / p = 1 mod 2` hence `inverse(z / p) = 1 mod 2 ^ 256`\\n return _unsafeMul(q, r); // `q * r = (n / p) * inverse(z / p) = n / z`\\n }\\n\\n /**\\n * @dev returns the smallest integer larger than or equal to `x * y / z`\\n */\\n function mulDivC(uint256 x, uint256 y, uint256 z) internal pure returns (uint256) {\\n uint256 w = mulDivF(x, y, z);\\n if (_mulMod(x, y, z) > 0) {\\n if (w >= type(uint256).max) {\\n revert Overflow();\\n }\\n\\n return w + 1;\\n }\\n return w;\\n }\\n\\n /**\\n * @dev returns the maximum of `n1 - n2` and 0\\n */\\n function subMax0(uint256 n1, uint256 n2) internal pure returns (uint256) {\\n return n1 > n2 ? n1 - n2 : 0;\\n }\\n\\n /**\\n * @dev returns the value of `x > y`\\n */\\n function gt512(Uint512 memory x, Uint512 memory y) internal pure returns (bool) {\\n return x.hi > y.hi || (x.hi == y.hi && x.lo > y.lo);\\n }\\n\\n /**\\n * @dev returns the value of `x < y`\\n */\\n function lt512(Uint512 memory x, Uint512 memory y) internal pure returns (bool) {\\n return x.hi < y.hi || (x.hi == y.hi && x.lo < y.lo);\\n }\\n\\n /**\\n * @dev returns the value of `x >= y`\\n */\\n function gte512(Uint512 memory x, Uint512 memory y) internal pure returns (bool) {\\n return !lt512(x, y);\\n }\\n\\n /**\\n * @dev returns the value of `x <= y`\\n */\\n function lte512(Uint512 memory x, Uint512 memory y) internal pure returns (bool) {\\n return !gt512(x, y);\\n }\\n\\n /**\\n * @dev returns the value of `x * y`\\n */\\n function mul512(uint256 x, uint256 y) internal pure returns (Uint512 memory) {\\n uint256 p = _mulModMax(x, y);\\n uint256 q = _unsafeMul(x, y);\\n if (p >= q) {\\n return Uint512({ hi: p - q, lo: q });\\n }\\n return Uint512({ hi: _unsafeSub(p, q) - 1, lo: q });\\n }\\n\\n /**\\n * @dev returns the value of `x - y`, given that `x >= y`\\n */\\n function _sub512(Uint512 memory x, uint256 y) private pure returns (Uint512 memory) {\\n if (x.lo >= y) {\\n return Uint512({ hi: x.hi, lo: x.lo - y });\\n }\\n return Uint512({ hi: x.hi - 1, lo: _unsafeSub(x.lo, y) });\\n }\\n\\n /**\\n * @dev returns the value of `x / pow2n`, given that `x` is divisible by `pow2n`\\n */\\n function _div512(Uint512 memory x, uint256 pow2n) private pure returns (uint256) {\\n uint256 pow2nInv = _unsafeAdd(_unsafeSub(0, pow2n) / pow2n, 1); // `1 << (256 - n)`\\n return _unsafeMul(x.hi, pow2nInv) | (x.lo / pow2n); // `(x.hi << (256 - n)) | (x.lo >> n)`\\n }\\n\\n /**\\n * @dev returns the inverse of `d` modulo `2 ^ 256`, given that `d` is congruent to `1` modulo `2`\\n */\\n function _inv256(uint256 d) private pure returns (uint256) {\\n // approximate the root of `f(x) = 1 / x - d` using the newton\\u2013raphson convergence method\\n uint256 x = 1;\\n for (uint256 i = 0; i < 8; i++) {\\n x = _unsafeMul(x, _unsafeSub(2, _unsafeMul(x, d))); // `x = x * (2 - x * d) mod 2 ^ 256`\\n }\\n return x;\\n }\\n\\n /**\\n * @dev returns `(x + y) % 2 ^ 256`\\n */\\n function _unsafeAdd(uint256 x, uint256 y) private pure returns (uint256) {\\n unchecked {\\n return x + y;\\n }\\n }\\n\\n /**\\n * @dev returns `(x - y) % 2 ^ 256`\\n */\\n function _unsafeSub(uint256 x, uint256 y) private pure returns (uint256) {\\n unchecked {\\n return x - y;\\n }\\n }\\n\\n /**\\n * @dev returns `(x * y) % 2 ^ 256`\\n */\\n function _unsafeMul(uint256 x, uint256 y) private pure returns (uint256) {\\n unchecked {\\n return x * y;\\n }\\n }\\n\\n /**\\n * @dev returns `x * y % (2 ^ 256 - 1)`\\n */\\n function _mulModMax(uint256 x, uint256 y) private pure returns (uint256) {\\n return mulmod(x, y, type(uint256).max);\\n }\\n\\n /**\\n * @dev returns `x * y % z`\\n */\\n function _mulMod(uint256 x, uint256 y, uint256 z) private pure returns (uint256) {\\n return mulmod(x, y, z);\\n }\\n}\\n\",\"keccak256\":\"0xabe13aa0b2ffde5e2c234a00f97656216a4cc818c85a3f4adbb09a702d2c7fa5\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/utility/Owned.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { IOwned } from \\\"./interfaces/IOwned.sol\\\";\\nimport { AccessDenied } from \\\"./Utils.sol\\\";\\n\\n/**\\n * @dev this contract provides support and utilities for contract ownership\\n */\\nabstract contract Owned is IOwned {\\n error SameOwner();\\n\\n address private _owner;\\n address private _newOwner;\\n\\n /**\\n * @dev triggered when the owner is updated\\n */\\n event OwnerUpdate(address indexed prevOwner, address indexed newOwner);\\n\\n // solhint-disable func-name-mixedcase\\n\\n /**\\n * @dev initializes the contract\\n */\\n constructor() {\\n _setOwnership(msg.sender);\\n }\\n\\n // solhint-enable func-name-mixedcase\\n\\n // allows execution by the owner only\\n modifier onlyOwner() {\\n _onlyOwner();\\n\\n _;\\n }\\n\\n // error message binary size optimization\\n function _onlyOwner() private view {\\n if (msg.sender != _owner) {\\n revert AccessDenied();\\n }\\n }\\n\\n /**\\n * @inheritdoc IOwned\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @inheritdoc IOwned\\n */\\n function transferOwnership(address ownerCandidate) public virtual onlyOwner {\\n if (ownerCandidate == _owner) {\\n revert SameOwner();\\n }\\n\\n _newOwner = ownerCandidate;\\n }\\n\\n /**\\n * @inheritdoc IOwned\\n */\\n function acceptOwnership() public virtual {\\n if (msg.sender != _newOwner) {\\n revert AccessDenied();\\n }\\n\\n _setOwnership(_newOwner);\\n }\\n\\n /**\\n * @dev returns the address of the new owner candidate\\n */\\n function newOwner() external view returns (address) {\\n return _newOwner;\\n }\\n\\n /**\\n * @dev sets the new owner internally\\n */\\n function _setOwnership(address ownerCandidate) private {\\n address prevOwner = _owner;\\n\\n _owner = ownerCandidate;\\n _newOwner = address(0);\\n\\n emit OwnerUpdate({ prevOwner: prevOwner, newOwner: ownerCandidate });\\n }\\n}\\n\",\"keccak256\":\"0xd0fb0e2c9f087e8535928c8840d5180ae9b8766a8055e8c28c5e021998eb9d87\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/utility/Utils.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { PPM_RESOLUTION } from \\\"./Constants.sol\\\";\\n\\nerror AccessDenied();\\nerror AlreadyExists();\\nerror DoesNotExist();\\nerror InvalidAddress();\\nerror InvalidExternalAddress();\\nerror InvalidFee();\\nerror InvalidPool();\\nerror InvalidPoolCollection();\\nerror InvalidStakedBalance();\\nerror InvalidToken();\\nerror InvalidParam();\\nerror NotEmpty();\\nerror NotPayable();\\nerror ZeroValue();\\n\\n/**\\n * @dev common utilities\\n */\\nabstract contract Utils {\\n // allows execution by the caller only\\n modifier only(address caller) {\\n _only(caller);\\n\\n _;\\n }\\n\\n function _only(address caller) internal view {\\n if (msg.sender != caller) {\\n revert AccessDenied();\\n }\\n }\\n\\n // verifies that a value is greater than zero\\n modifier greaterThanZero(uint256 value) {\\n _greaterThanZero(value);\\n\\n _;\\n }\\n\\n // error message binary size optimization\\n function _greaterThanZero(uint256 value) internal pure {\\n if (value == 0) {\\n revert ZeroValue();\\n }\\n }\\n\\n // validates an address - currently only checks that it isn't null\\n modifier validAddress(address addr) {\\n _validAddress(addr);\\n\\n _;\\n }\\n\\n // error message binary size optimization\\n function _validAddress(address addr) internal pure {\\n if (addr == address(0)) {\\n revert InvalidAddress();\\n }\\n }\\n\\n // validates an external address - currently only checks that it isn't null or this\\n modifier validExternalAddress(address addr) {\\n _validExternalAddress(addr);\\n\\n _;\\n }\\n\\n // error message binary size optimization\\n function _validExternalAddress(address addr) internal view {\\n if (addr == address(0) || addr == address(this)) {\\n revert InvalidExternalAddress();\\n }\\n }\\n\\n // ensures that the fee is valid\\n modifier validFee(uint32 fee) {\\n _validFee(fee);\\n\\n _;\\n }\\n\\n // error message binary size optimization\\n function _validFee(uint32 fee) internal pure {\\n if (fee > PPM_RESOLUTION) {\\n revert InvalidFee();\\n }\\n }\\n}\\n\",\"keccak256\":\"0x62b8b81d3069467eb6402b8f61adcc24f5b2e310db1a2ee64d719229306ab823\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/utility/interfaces/IOwned.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\n/**\\n * @dev Owned interface\\n */\\ninterface IOwned {\\n /**\\n * @dev returns the address of the current owner\\n */\\n function owner() external view returns (address);\\n\\n /**\\n * @dev allows transferring the contract ownership\\n *\\n * requirements:\\n *\\n * - the caller must be the owner of the contract\\n * - the new owner still needs to accept the transfer\\n */\\n function transferOwnership(address ownerCandidate) external;\\n\\n /**\\n * @dev used by a new owner to accept an ownership transfer\\n */\\n function acceptOwnership() external;\\n}\\n\",\"keccak256\":\"0xe6141c9a7cb5853352f35dc83e9504e2c552feadac7c70dd1e029c1b4368b6bb\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/utility/interfaces/IUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { IVersioned } from \\\"./IVersioned.sol\\\";\\n\\nimport { IAccessControlEnumerableUpgradeable } from \\\"@openzeppelin/contracts-upgradeable/access/IAccessControlEnumerableUpgradeable.sol\\\";\\n\\n/**\\n * @dev this is the common interface for upgradeable contracts\\n */\\ninterface IUpgradeable is IAccessControlEnumerableUpgradeable, IVersioned {\\n\\n}\\n\",\"keccak256\":\"0x6019e5e9c706cc023b96313932f5aa7fc3734f446fd0936a2c6530d0d25330da\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/utility/interfaces/IVersioned.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\n/**\\n * @dev an interface for a versioned contract\\n */\\ninterface IVersioned {\\n function version() external view returns (uint16);\\n}\\n\",\"keccak256\":\"0x1969c895e9adc0bc8a85e975517d2f2b9357e0c9011f159d01b90f7d1a464d76\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/vaults/interfaces/IExternalProtectionVault.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { IVault } from \\\"./IVault.sol\\\";\\n\\ninterface IExternalProtectionVault is IVault {}\\n\",\"keccak256\":\"0x0ae5812ccd4166ba2df080b90df2ec128806a237d3ce9359ca6bb23025d63d85\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/vaults/interfaces/IMasterVault.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { IVault } from \\\"./IVault.sol\\\";\\n\\ninterface IMasterVault is IVault {}\\n\",\"keccak256\":\"0x875a0f6792439d100fade7ffb778a34d8eac7ededb43b65d0160281d3d5a83f0\",\"license\":\"SEE LICENSE IN LICENSE\"},\"contracts/vaults/interfaces/IVault.sol\":{\"content\":\"// SPDX-License-Identifier: SEE LICENSE IN LICENSE\\npragma solidity 0.8.13;\\n\\nimport { IUpgradeable } from \\\"../../utility/interfaces/IUpgradeable.sol\\\";\\n\\nimport { Token } from \\\"../../token/Token.sol\\\";\\n\\n// the asset manager role is required to access all the funds\\nbytes32 constant ROLE_ASSET_MANAGER = keccak256(\\\"ROLE_ASSET_MANAGER\\\");\\n\\ninterface IVault is IUpgradeable {\\n /**\\n * @dev triggered when tokens have been withdrawn from the vault\\n */\\n event FundsWithdrawn(Token indexed token, address indexed caller, address indexed target, uint256 amount);\\n\\n /**\\n * @dev triggered when tokens have been burned from the vault\\n */\\n event FundsBurned(Token indexed token, address indexed caller, uint256 amount);\\n\\n /**\\n * @dev tells whether the vault accepts native token deposits\\n */\\n function isPayable() external view returns (bool);\\n\\n /**\\n * @dev withdraws funds held by the contract and sends them to an account\\n */\\n function withdrawFunds(\\n Token token,\\n address payable target,\\n uint256 amount\\n ) external;\\n\\n /**\\n * @dev burns funds held by the contract\\n */\\n function burn(Token token, uint256 amount) external;\\n}\\n\",\"keccak256\":\"0x1ac16bcccd209b3a73c00144df2b5c53fbd328434277e72457063c26645872d5\",\"license\":\"SEE LICENSE IN LICENSE\"}},\"version\":1}", + "bytecode": "0x6101806040523480156200001257600080fd5b50604051620063213803806200632183398101604081905262000035916200028b565b6200004033620000fc565b6200004b8862000156565b620000568762000156565b620000618662000156565b6200006c8562000156565b620000778462000156565b620000828362000156565b6200008d8262000156565b620000988162000156565b6001600160a01b0380891660805287811660a05286811660c05285811660e052848116610100528381166101205282811661014052811661016052620000e06107d062000181565b620000ee62030d40620001f4565b50505050505050506200034c565b600080546001600160a01b038381166001600160a01b031980841682178555600180549091169055604051919092169283917f343765429aea5a34b3ff6a3785a98a5abb2597aca87bfbb58632c173d585373a9190a35050565b6001600160a01b0381166200017e5760405163e6c4247b60e01b815260040160405180910390fd5b50565b60055463ffffffff90811690821681036200019a575050565b6005805463ffffffff191663ffffffff84811691821790925560408051928416835260208301919091527fb804b0ec3f0ea43004870df377170ce44cb789adca16d23286e337605558117f91015b60405180910390a15050565b60055463ffffffff6401000000009091048116908216810362000215575050565b6005805463ffffffff60201b191664010000000063ffffffff8581169182029290921790925560408051918416825260208201929092527f1f1f36475e04b1709caf649fc7f00350aa38c7f7f110f653e81f79011db0867c9101620001e8565b6001600160a01b03811681146200017e57600080fd5b600080600080600080600080610100898b031215620002a957600080fd5b8851620002b68162000275565b60208a0151909850620002c98162000275565b60408a0151909750620002dc8162000275565b60608a0151909650620002ef8162000275565b60808a0151909550620003028162000275565b60a08a0151909450620003158162000275565b60c08a0151909350620003288162000275565b60e08a01519092506200033b8162000275565b809150509295985092959890939650565b60805160a05160c05160e05161010051610120516101405161016051615eb26200046f600039600081816114bc0152611f150152600061126a015260008181612e2101526133560152600081816123d8015281816124a5015281816125770152818161316e015281816132080152818161325c0152614637015260008181611a3c0152818161225e01528181612dc5015281816132890152818161332601528181613406015261367b0152600081816108c1015281816111c001528181611aa201528181611cf20152818161234c01528181612e6101526134f3015260008181612a5801526142830152600081816107af01528181610dc3015281816110fa01528181611179015281816116ec01528181611e6b0152611fe90152615eb26000f3fe608060405234801561001057600080fd5b50600436106102485760003560e01c8063915b99411161013b578063c5c51dca116100b8578063ee4808fe1161007c578063ee4808fe1461062a578063f2fde38b1461063d578063f525cb6814610650578063f6c5786114610658578063fba8cdee1461068657600080fd5b8063c5c51dca146105cb578063d1aebfc7146105e0578063d3df2424146105f3578063d4ee1d9014610606578063df2c3ab41461061757600080fd5b8063a135ef17116100ff578063a135ef17146104c8578063aa55a9b11461054b578063b1dd61b61461055e578063bedf952514610565578063c2cf42521461059857600080fd5b8063915b99411461046e5780639181d2e314610481578063921a929e146104945780639f5c734b146104a75780639fc19231146104ba57600080fd5b806354fd4d50116101c957806379ba50971161018d57806379ba50971461041c578063814175851461042457806387a7db0f146104375780638da5cb5b1461044a5780639049f9d21461045b57600080fd5b806354fd4d501461038657806356aca36f1461039c5780635768adcf146103af5780636161b626146103f357806372d960e11461040957600080fd5b806330cdb3081161021057806330cdb308146102d45780633376af511461031f57806334afba2b146103325780634ceea75314610352578063541868c81461037357600080fd5b8063136efb7a1461024d5780631510748b146102765780631c754cae1461028b5780632258cc691461029e57806327910565146102c1575b600080fd5b61026061025b366004615637565b610699565b60405161026d9190615654565b60405180910390f35b61028961028436600461571a565b6107ad565b005b610289610299366004615746565b61080d565b6102b16102ac366004615637565b610a85565b604051901515815260200161026d565b6102896102cf366004615637565b610ac2565b61030a6102e2366004615637565b6001600160a01b0316600090815260026020526040902054600160a01b900463ffffffff1690565b60405163ffffffff909116815260200161026d565b61028961032d36600461578d565b610b24565b6103456103403660046157aa565b610b3f565b60405161026d91906157eb565b61036561036036600461571a565b610bb4565b60405190815260200161026d565b61034561038136600461571a565b610c4d565b600c5b60405161ffff909116815260200161026d565b6103656103aa36600461580c565b610dbf565b6103db6103bd366004615637565b6001600160a01b039081166000908152600260205260409020541690565b6040516001600160a01b03909116815260200161026d565b600554640100000000900463ffffffff1661030a565b6103456104173660046157aa565b610fb5565b610289611031565b61028961043236600461586c565b611073565b610289610445366004615637565b6110f8565b6000546001600160a01b03166103db565b610289610469366004615637565b611177565b61028961047c3660046158a5565b6114b0565b61028961048f3660046158e8565b611561565b6103656104a2366004615746565b611612565b6103656104b5366004615916565b6116e8565b60055463ffffffff1661030a565b61053e6104d6366004615637565b6040805160608082018352600080835260208084018290529284018190526001600160a01b0394909416845260028252928290208251938401835260048101546001600160801b038082168652600160801b9091041691840191909152600501549082015290565b60405161026d919061595e565b610289610559366004615637565b611ba4565b6001610389565b6102b1610573366004615637565b6001600160a01b0316600090815260026020526040902054600160c01b900460ff1690565b6102b16105a6366004615637565b6001600160a01b0316600090815260026020526040902054600160c81b900460ff1690565b6105d3611d95565b60405161026d919061598d565b6103456105ee3660046159da565b611e45565b610289610601366004615a41565b611f09565b6001546001600160a01b03166103db565b6103456106253660046159da565b611fc3565b61036561063836600461571a565b61207f565b61028961064b366004615637565b61210e565b610365612167565b6102b1610666366004615637565b6001600160a01b0390811660009081526002602052604090205416151590565b61028961069436600461578d565b612178565b6106a1615452565b506001600160a01b03908116600090815260026020818152604092839020835160c0810185528154958616815263ffffffff600160a01b870481168285015260ff600160c01b88048116151583880152600160c81b9097049096161515606080830191909152855180820187526001840154909716875285518087018752948301546001600160701b038082168752600160701b9182900481168787015288860196909652865180880188526003850154808816825291909104909516858501528686019490945260808101959095528351928301845260048101546001600160801b038082168552600160801b9091041691830191909152600501549181019190915260a082015290565b7f00000000000000000000000000000000000000000000000000000000000000006107d781612193565b81156108085760006107e8846121bf565b9050828160040160010160008282546108019190615a85565b9091555050505b505050565b6108156121fc565b604080518082019091528281526020810182905261083281612227565b600061083d856121bf565b8054909150600160c01b900460ff161561086a57604051637952fbad60e11b815260040160405180910390fd5b6040516bffffffffffffffffffffffff1933606090811b8216602084015287901b166034820152604881018590526068810184905260009060880160405160208183030381529060405280519060200120905060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166387ba006a6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561091d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109419190615a9d565b9050610950828885878561224d565b60048301546001600160801b031681111561097e5760405163bb55fd2760e01b815260040160405180910390fd5b6000610989856126b0565b9050604051806060016040528061099d4390565b63ffffffff1681526020018281526020016109b783612710565b905280516001868101805463ffffffff191663ffffffff909316929092179091556020808301518051600289018054928401516001600160701b039283166001600160e01b031994851617600160701b918416820217909155604095860151805160038c0180549290960151908416919094161792909116021790558554600160c01b60ff60c01b19909116178655905181906001600160a01b038b16907f162ed187f3ed3879ae360c5df2a0a5dcaac7a208a9d762c2cbbfb1f5fad8b81d90600090a45050505050505050565b6001600160a01b0381166000908152600260208190526040822090610aa98261276a565b6002811115610aba57610aba615ab6565b149392505050565b610aca6121fc565b6000610ad5826121bf565b6040805160608101825260048301546001600160801b038082168352600160801b909104166020820152600583015491810191909152909150610b20906000908490849060016128d7565b5050565b610b2c6121fc565b80610b36816128f7565b610b2082612921565b610b6360405180606001604052806000815260200160008152602001600081525090565b81610b6d816129a9565b6000610b7f81878787600019846129ca565b9050610b8a81612c08565b60408051606080820183528351825283015160208201526080909201519082015295945050505050565b6001600160a01b038083166000908152600260209081526040808320805482516318160ddd60e01b8152925194959194610c4394889492909316926318160ddd92600480820193918290030181865afa158015610c15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c399190615a9d565b6005840154612d33565b9150505b92915050565b610c7160405180606001604052806000815260200160008152602001600081525090565b82610c7b81612d76565b82610c85816129a9565b6001600160a01b03808616600090815260026020908152604080832081516060810183526004808301546001600160801b038082168452600160801b9091041682860152600583015482850152825484516318160ddd60e01b8152945193979296959216936318160ddd93818301939290918290030181865afa158015610d10573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d349190615a9d565b90506000610d4788838560400151612d33565b90506000610d6d8a8a84878960000160149054906101000a900463ffffffff1688612d9d565b905060405180606001604052808260c001518360e00151610d8e9190615acc565b815260200182604001518360000151610da79190615a85565b815260006020909101529a9950505050505050505050565b60007f0000000000000000000000000000000000000000000000000000000000000000610deb81612193565b85610df581612d76565b84610dff816129a9565b84610e09816129a9565b6000610e14896121bf565b604080516060810182526004808401546001600160801b038082168452600160801b90910416602080840191909152600585015483850152845484516318160ddd60e01b8152945195965092946000946001600160a01b03909416936318160ddd938181019392918290030181865afa158015610e95573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eb99190615a9d565b90506000610ecc8b838560400151612d33565b9050808a1115610eef57604051633494a40d60e21b815260040160405180910390fd5b6001610efa8561276a565b6002811115610f0b57610f0b615ab6565b03610f29576040516301a6272960e41b815260040160405180910390fd5b6000610f4d8d8d8d878960000160149054906101000a900463ffffffff1688612d9d565b9050610f5c8f8f8f8885612ff9565b8454600160c01b900460ff1615610fa2576040805180820190915260048601546001600160801b038082168352600160801b909104166020820152610fa29086906136c8565b519e9d5050505050505050505050505050565b610fd960405180606001604052806000815260200160008152602001600081525090565b81610fe3816129a9565b6000610ff4818787876001806129ca565b9050610fff81612c08565b604051806060016040528082602001518152602001826060015181526020018260800151815250925050509392505050565b6001546001600160a01b0316331461105c57604051634ca8886760e01b815260040160405180910390fd5b600154611071906001600160a01b03166137c2565b565b61107b6121fc565b6000611086836121bf565b8054909150821515600160c81b90910460ff161515036110a557505050565b805460ff60c81b1916600160c81b8315159081029190911782556040516001600160a01b038516907fa606e6917bc476eb72d24f486596af7f564fb7b50f73135c81c0e8e0553430cd90600090a3505050565b7f000000000000000000000000000000000000000000000000000000000000000061112281612193565b600061112d836121bf565b604080516060810182526004808401546001600160801b038082168452600160801b90910416602083015260058401549282019290925291925061080891600091869185916128d7565b7f00000000000000000000000000000000000000000000000000000000000000006111a181612193565b60405163b5af090f60e01b81526001600160a01b0383811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063b5af090f90602401602060405180830381865afa158015611207573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061122b9190615ae3565b61124857604051630b094f2760e31b815260040160405180910390fd5b604051632b625f2360e01b81526001600160a01b0383811660048301526000917f000000000000000000000000000000000000000000000000000000000000000090911690632b625f23906024016020604051808303816000875af11580156112b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112d99190615b00565b9050806001600160a01b03166379ba50976040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561131657600080fd5b505af115801561132a573d6000803e3d6000fd5b5050505060006040518060c00160405280836001600160a01b03168152602001600560009054906101000a900463ffffffff1663ffffffff1681526020016000151581526020016001151581526020016040518060600160405280600063ffffffff16815260200161139a61381c565b81526020016113a761381c565b9052815260408051606081018252600080825260208281018290529282015291015290506113d58482613845565b60408082015190516000911515906001600160a01b038716907f162ed187f3ed3879ae360c5df2a0a5dcaac7a208a9d762c2cbbfb1f5fad8b81d908490a4836001600160a01b03167fa2d66c1e2cc4b2cc5daaabc06447542e989ed748a9fb22476b6c913dcc1c7f4b6000836020015160405161146592919063ffffffff92831681529116602082015260400190565b60405180910390a280606001511515846001600160a01b03167fa606e6917bc476eb72d24f486596af7f564fb7b50f73135c81c0e8e0553430cd60405160405180910390a350505050565b816114ba81612d76565b7f00000000000000000000000000000000000000000000000000000000000000006114e481612193565b6114fc846114f736869003860186615cb0565b613845565b6115096020840184615637565b6001600160a01b03166379ba50976040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561154357600080fd5b505af1158015611557573d6000803e3d6000fd5b5050505050505050565b6115696121fc565b80611573816128f7565b600061157e846121bf565b805490915063ffffffff600160a01b909104811690841681036115a2575050505050565b815463ffffffff60a01b1916600160a01b63ffffffff86811691820292909217845560408051928416835260208301919091526001600160a01b038716917fa2d66c1e2cc4b2cc5daaabc06447542e989ed748a9fb22476b6c913dcc1c7f4b910160405180910390a25050505050565b600082600003611624575060006116e1565b6001600160a01b038085166000908152600260209081526040808320805482516318160ddd60e01b81529251919516926318160ddd92600480820193918290030181865afa15801561167a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061169e9190615a9d565b905060006116ac8287615d83565b90506116db81836116bd8882615acc565b60058701546116cc9190615d83565b6116d69085615a85565b61399e565b93505050505b9392505050565b60007f000000000000000000000000000000000000000000000000000000000000000061171481612193565b8461171e81612d76565b83611728816129a9565b6000611733876121bf565b8054909150600160c81b900460ff1661175f576040516303a5be3f60e31b815260040160405180910390fd5b8054604080516318160ddd60e01b815290516000926001600160a01b0316916318160ddd9160048083019260209291908290030181865afa1580156117a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117cc9190615a9d565b60058301549091506117dc6154aa565b821580156117e957508115155b1561186e576040805160608101825260048601546001600160801b038082168352600160801b909104166020820152600586015491810191909152600092506118368d8c878460036128d7565b6040518060600160405280600063ffffffff16815260200161185661381c565b815260200161186361381c565b815250915050611930565b604080516060808201835260048701546001600160801b038082168452600160801b9091048116602080850191825260058a0154858701528551938401865260018a015463ffffffff1684528551808701875260028b01546001600160701b038082168352600160701b91829004811683850152868401929092528751808901895260038d015480841682529190910490911681830152848701528551808701909652845183168652905190911690840152909161192c9190613a6a565b9150505b600061193d8a8585613bde565b90506119498a84615a85565b600586015584546040516340c10f1960e01b81526001600160a01b038e8116600483015260248201849052909116906340c10f1990604401600060405180830381600087803b15801561199b57600080fd5b505af11580156119af573d6000803e3d6000fd5b505050508a6001600160a01b03168c6001600160a01b03168e7fecb7e4cd1580472adaeba712b36acf94439b2e1760af55fedb61960ca4422af38d85604051611a02929190918252602082015260400190565b60405180910390a46001600160a01b038b168d7f67c4863f17da9847c57c9fa043e63a0ddf4f5a86fd63a6f71ea69057a11c411a611a60837f0000000000000000000000000000000000000000000000000000000000000000613c12565b6005890154611a6f868a615a85565b6040805193845260208401929092529082015260600160405180910390a3611b278d8c87611aa08660200151613cb6565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166387ba006a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611afe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b229190615a9d565b61224d565b8454600160c01b900460ff1615611b94576040805160608101825260048701546001600160801b038082168352600160801b9091048116602080840191825260058a015484860152845180860190955283518316855290519091169083015290611b929087906136c8565b505b9c9b505050505050505050505050565b611bac6121fc565b6000611bb7826121bf565b604080516060808201835260048401546001600160801b038082168452600160801b820490811660208086019190915260058701548587015294516bffffffffffffffffffffffff1933851b8116968201969096529288901b90941660348301526001600160801b0319608091821b8116604884015293901b909216605883015291925060009060680160408051601f198184030181528282528051602091820120606084018352600187015463ffffffff1684528251808401845260028801546001600160701b038082168352600160701b91829004811683860152868501929092528451808601865260038a01548084168252919091049091168184015284840152825180840190935285516001600160801b0390811684528683015116918301919091529250600091611cec91613a6a565b905060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166387ba006a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611d4e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d729190615a9d565b9050611d8d838787611d878660200151613cb6565b8561224d565b505050505050565b60606000611da36003613cf2565b905060008167ffffffffffffffff811115611dc057611dc0615b1d565b604051908082528060200260200182016040528015611de9578160200160208202803683370190505b50905060005b82811015611e3e57611e02600382613cfc565b828281518110611e1457611e14615da2565b6001600160a01b039092166020928302919091019091015280611e3681615db8565b915050611def565b5092915050565b611e6960405180606001604052806000815260200160008152602001600081525090565b7f0000000000000000000000000000000000000000000000000000000000000000611e9381612193565b84611e9d816129a9565b84611ea7816129a9565b6000611eb88b8b8b8b8b60016129ca565b90508515611ec95760006101608201525b611ed281613d08565b6040518060600160405280826020015181526020018260600151815260200182608001518152509450505050509695505050505050565b80611f1381612d76565b7f0000000000000000000000000000000000000000000000000000000000000000611f3d81612193565b6001600160a01b0380851660009081526002602052604090205416611f6185613e44565b60405163f2fde38b60e01b81526001600160a01b03858116600483015282169063f2fde38b90602401600060405180830381600087803b158015611fa457600080fd5b505af1158015611fb8573d6000803e3d6000fd5b505050505050505050565b611fe760405180606001604052806000815260200160008152602001600081525090565b7f000000000000000000000000000000000000000000000000000000000000000061201181612193565b8461201b816129a9565b84612025816129a9565b60006120368b8b8b8b8b60006129ca565b905085156120475760006101608201525b61205081613d08565b6040805160608082018352835182528301516020820152608090920151908201529a9950505050505050505050565b6001600160a01b038083166000908152600260209081526040808320805482516318160ddd60e01b8152925194959194610c4394889492909316926318160ddd92600480820193918290030181865afa1580156120e0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121049190615a9d565b6005840154613bde565b6121166121fc565b6000546001600160a01b039081169082160361214557604051630a98f1f360e21b815260040160405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60006121736003613cf2565b905090565b6121806121fc565b8061218a816128f7565b610b2082613ece565b336001600160a01b038216146121bc57604051634ca8886760e01b815260040160405180910390fd5b50565b6001600160a01b03808216600090815260026020526040812080549192909116610c475760405163b0ce759160e01b815260040160405180910390fd5b6000546001600160a01b0316331461107157604051634ca8886760e01b815260040160405180910390fd5b61223081613f38565b6121bc57604051636a43f8d160e01b815260040160405180910390fd5b60006122826001600160a01b0386167f0000000000000000000000000000000000000000000000000000000000000000613c12565b9050806000036122a55760405163bb55fd2760e01b815260040160405180910390fd5b60016122b08561276a565b60028111156122c1576122c1615ab6565b036122cc57506126a9565b6040805160608101825260048601546001600160801b038082168352600160801b90910416602082015260058601549181019190915261230b84613f38565b6123245761231d8787878460026128d7565b50506126a9565b60405163467e55df60e01b81526001600160a01b03878116600483015260009161244b9185917f00000000000000000000000000000000000000000000000000000000000000009091169063467e55df90602401602060405180830381865afa158015612395573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123b99190615a9d565b604051637ea6a56960e11b81526001600160a01b038b811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063fd4d4ad290602401602060405180830381865afa15801561241f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124439190615a9d565b858989613f55565b805190915061245c575050506126a9565b6020810151158061246f57506040810151155b1561248a576124828888888560026128d7565b5050506126a9565b81600001516001600160801b03168160200151111561255c577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166371c0feb7898985600001516001600160801b031685602001516124f19190615acc565b6040516001600160e01b031960e086901b16815260048101939093526001600160a01b0390911660248301526044820152606401600060405180830381600087803b15801561253f57600080fd5b505af1158015612553573d6000803e3d6000fd5b5050505061262a565b81600001516001600160801b03168160200151101561262a577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316631ebda06d8989846020015186600001516001600160801b03166125c39190615acc565b6040516001600160e01b031960e086901b16815260048101939093526001600160a01b0390911660248301526044820152606401600060405180830381600087803b15801561261157600080fd5b505af1158015612625573d6000803e3d6000fd5b505050505b6000604051806060016040528061264484602001516141d4565b6001600160801b0316815260200161265f84604001516141d4565b6001600160801b0390811682526040808701516020938401528351928401518216600160801b02929091169190911760048a015581015160058901559050611fb889898584614245565b5050505050565b604080518082019091526000808252602082015260006126d7836001600160701b0361436a565b9050604051806040016040528082600001516001600160701b0316815260200182602001516001600160701b0316815250915050919050565b6040805180820190915260008082526020820152604080518082019091526020838101516001600160701b03908116835284511690820181905215155b610c4757604051630d38a7e760e11b815260040160405180910390fd5b60408051808201825260048301546001600160801b038082168352600160801b909104166020808301919091528251606081018452600185015463ffffffff1681528351808501855260028601546001600160701b038082168352600160701b9182900481168386015283850192835286518088018852600389015480831682529290920416938101939093529381019190915291516000929061280d83613f38565b158061281f575061281d816143f9565b155b1561282f57506000949350505050565b600061283a84614428565b604084015190915061284b82613f38565b158061285d575061285b816143f9565b155b1561286f575060009695505050505050565b600061287b8587613a6a565b905061289661288d8260200151613cb6565b8761271061445d565b80156128b657506128b66128ad8260400151613cb6565b8461271061445d565b156128c957506002979650505050505050565b506001979650505050505050565b60048301546126a99086908690869086906001600160801b0316866144ff565b620f424063ffffffff821611156121bc576040516358d620b360e01b815260040160405180910390fd5b60055463ffffffff64010000000090910481169082168103612941575050565b6005805467ffffffff00000000191664010000000063ffffffff8581169182029290921790925560408051918416825260208201929092527f1f1f36475e04b1709caf649fc7f00350aa38c7f7f110f653e81f79011db0867c91015b60405180910390a15050565b806000036121bc57604051637c946ed760e01b815260040160405180910390fd5b612a4b604051806101a00160405280600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160006001600160a01b03168152602001600015158152602001600015158152602001600063ffffffff168152602001600080191681525090565b6001600160a01b038681167f0000000000000000000000000000000000000000000000000000000000000000821690811491871614818015612a8b575080155b15612aad5760016101208401526001600160a01b038716610100840152612af3565b81158015612ab85750805b15612ada5760006101208401526001600160a01b038816610100840152612af3565b60405163b0ce759160e01b815260040160405180910390fd5b6000612b038461010001516121bf565b8054909150600160c01b900460ff16612b2f5760405163bcb8b8fb60e01b815260040160405180910390fd5b61018084018a905284158015610140860152612b4d57868452612b55565b602084018790525b60408481018790528154600160a01b900463ffffffff16610160860152805160608101825260048301546001600160801b038082168352600160801b90910416602082015260058301549181019190915261012085015115612bd35780516001600160801b0390811660a087015260208201511660c0860152612bf1565b60208101516001600160801b0390811660a087015281511660c08601525b6040015160e0850152509198975050505050505050565b604080518082019091526000808252602082015281610140015115612c7957612c448260a001518360c0015184610160015185600001516146d9565b80516020840181905260408401519192501015612c745760405163f31ee7a560e01b815260040160405180910390fd5b612ccc565b612c968260a001518360c00151846101600151856020015161476b565b80518084529091501580612cae575060408201518251115b15612ccc5760405163681c2ccd60e11b815260040160405180910390fd5b60208101516060830152815160a083018051612ce9908390615a85565b905250602082015160c083018051612d02908390615acc565b90525061012082015115612d2a5781606001518260e001818151612d269190615a85565b9052505b610b2082614807565b600082600003612d63578115612d5c57604051636a9c61e160e01b815260040160405180910390fd5b50826116e1565b612d6e84838561399e565b949350505050565b6001600160a01b0381166121bc5760405163e6c4247b60e01b815260040160405180910390fd5b612da56154fb565b60208401516000906001600160801b0316612de96001600160a01b038a167f0000000000000000000000000000000000000000000000000000000000000000613c12565b612df39190615acc565b90506000612eed86600001516001600160801b031687602001516001600160801b0316848960400151612e587f00000000000000000000000000000000000000000000000000000000000000008f6001600160a01b0316613c1290919063ffffffff16565b8a63ffffffff167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316632aac012c6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612ebd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ee19190615dd1565b63ffffffff168e6148d7565b905060405180610180016040528082606001518152602001826080015181526020018260a0015181526020018260400151815260200182600001518152602001826020015181526020018260c001518152602001888152602001898152602001858152602001826040015160200151612f83576040830151516020890151612f7e91906001600160801b0316615a85565b612fa1565b6040830151516020890151612fa191906001600160801b0316615acc565b8152602001826000015160200151612fd0578251518851612fcb91906001600160801b0316615a85565b612fe8565b8251518851612fe891906001600160801b0316615acc565b9052925050505b9695505050505050565b60408051606081018252600484810180546001600160801b038082168552600160801b90910416602084015260058601548385015285546101008601519451630852cd8d60e31b815292830194909452926001600160a01b0316906342966c6890602401600060405180830381600087803b15801561307757600080fd5b505af115801561308b573d6000803e3d6000fd5b5050505060008361010001518461012001516130a79190615acc565b905060006130bf84600101548387610120015161399e565b90508084600101819055506130d88561014001516141d4565b84546001600160801b03918216600160801b0291161784556101608501516130ff906141d4565b84546001600160801b0319166001600160801b039190911617845560a085015151156131d2578460a001516020015161313a5761313a615dee565b60a085015151604051631ebda06d60e01b8152600481018b90526001600160a01b03898116602483015260448201929092527f000000000000000000000000000000000000000000000000000000000000000090911690631ebda06d906064015b600060405180830381600087803b1580156131b557600080fd5b505af11580156131c9573d6000803e3d6000fd5b505050506132f8565b608085015151156132f8578460800151602001511561323f57608085015151604051631538c64b60e31b815260048101919091527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063a9c632589060240161319b565b6080850151516040516340c10f1960e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016916340c10f19916132c5917f0000000000000000000000000000000000000000000000000000000000000000916004016001600160a01b03929092168252602082015260400190565b600060405180830381600087803b1580156132df57600080fd5b505af11580156132f3573d6000803e3d6000fd5b505050505b6040850151156133ce576040858101519051631c20fadd60e01b81526001600160a01b0389811660048301527f00000000000000000000000000000000000000000000000000000000000000008116602483015260448201929092527f000000000000000000000000000000000000000000000000000000000000000090911690631c20fadd90606401600060405180830381600087803b15801561339c57600080fd5b505af11580156133b0573d6000803e3d6000fd5b505050508460400151856000018181516133ca9190615a85565b9052505b845115613465578451604051631c20fadd60e01b81526001600160a01b0389811660048301528a8116602483015260448201929092527f000000000000000000000000000000000000000000000000000000000000000090911690631c20fadd90606401600060405180830381600087803b15801561344c57600080fd5b505af1158015613460573d6000803e3d6000fd5b505050505b8461014001516000036134f15761347a61381c565b80516002880180546020909301516001600160701b03908116600160701b026001600160e01b03199094169216919091179190911790556134b961381c565b80516003880180546020909301516001600160701b03908116600160701b026001600160e01b03199094169216919091179190911790555b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166387ba006a6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561354f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135739190615a9d565b8561016001511015613598576135938988888689610160015160026144ff565b6135da565b6040805160608101825285546001600160801b038082168352600160801b9091041660208201526001860154918101919091526135da908a9089908690614245565b845161010086015160408088015160c089015182519485526020850193909352908301526000606083015260808201526001600160a01b0380891691908a16908b907feab8ac9e9478a4b3c37a794ecef629b8a8bbcd96f9eaeac8ed26054d144da52d9060a00160405180910390a46001600160a01b038716897f67c4863f17da9847c57c9fa043e63a0ddf4f5a86fd63a6f71ea69057a11c411a61369f837f0000000000000000000000000000000000000000000000000000000000000000613c12565b6040805191825260208201869052810186905260600160405180910390a3505050505050505050565b60408051606081018252600184015463ffffffff1681528151808301835260028501546001600160701b038082168352600160701b918290048116602084810191909152808501939093528451808601865260038801548083168252929092041691810191909152918101919091526137419082613a6a565b805160018401805463ffffffff191663ffffffff9092169190911790556020808201518051600286018054928401516001600160701b039283166001600160e01b031994851617600160701b918416820217909155604090940151805160039097018054919094015196821692169190911794169091029290921790915550565b600080546001600160a01b038381166001600160a01b031980841682178555600180549091169055604051919092169283917f343765429aea5a34b3ff6a3785a98a5abb2597aca87bfbb58632c173d585373a9190a35050565b604080518082018252600080825260209182018190528251808401909352825260019082015290565b613850600383614b4d565b61386d5760405163119b4fd360e11b815260040160405180910390fd5b6001600160a01b039182166000908152600260208181526040928390208451815486840151878701516060890151939099166001600160c01b031990921691909117600160a01b63ffffffff928316021761ffff60c01b1916600160c01b9815159890980260ff60c81b191697909717600160c81b911515919091021781556080850151805160018301805463ffffffff191691909816179096558582015180519382018054918401516001600160701b039586166001600160e01b031993841617600160701b91871682021790915596850151805160038401805492860151918716929093169190911794169096029290921790945560a0909201518051938101516001600160801b03948516600160801b95909116949094029390931760048301559190910151600590910155565b6000806139ab8585614b62565b80519091506000036139cf578281602001516139c79190615e1a565b9150506116e1565b805183116139f057604051631a93c68960e11b815260040160405180910390fd5b60006139fd868686614be9565b90506000613a0b8383614c04565b8051909150600003613a3157848160200151613a279190615e1a565b93505050506116e1565b6000858103861690613a438383614c80565b90506000613a59613a54848a615e1a565b614cb7565b919091029998505050505050505050565b613a726154aa565b613a7b82613f38565b613ab5576040518060600160405280600063ffffffff168152602001613a9f61381c565b8152602001613aac61381c565b90529050610c47565b8251439063ffffffff80831690821603613ad3578492505050610c47565b6064613adf8284615e2e565b63ffffffff16101580613afc5750613afa85602001516143f9565b155b80613b115750613b0f85604001516143f9565b155b15613b9357613b1f84613f38565b15613b665760405180606001604052808363ffffffff168152602001613b44866126b0565b8152602001613b5a613b5587614428565b6126b0565b81525092505050610c47565b6040518060600160405280600063ffffffff168152602001613b8661381c565b8152602001613b5a61381c565b60405180606001604052808363ffffffff168152602001613bb8876020015187614ce2565b8152602001613bd38760400151613bce88614428565b614ce2565b905295945050505050565b600082600003613c07578115612d5c57604051636a9c61e160e01b815260040160405180910390fd5b612d6e848484614d4f565b600073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6001600160a01b03841603613c4957506001600160a01b03811631610c47565b826040516370a0823160e01b81526001600160a01b03848116600483015291909116906370a0823190602401602060405180830381865afa158015613c92573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116e19190615a9d565b6040805180820182526000808252602091820152815180830190925282516001600160701b039081168352928101519092169181019190915290565b6000610c47825490565b60006116e18383614d9f565b6101008101516001600160a01b0316600090815260026020908152604091829020825160608101845260048201546001600160801b038082168352600160801b9091048116828501908152600584015483870152855180870190965282518216865251169284019290925291613d7f9083906136c8565b613d8883612c08565b60006040518060600160405280613db6866101200151613dac578660c001516141d4565b8660a001516141d4565b6001600160801b03168152602001613de5866101200151613ddb578660a001516141d4565b8660c001516141d4565b6001600160801b031681526020018560e001518152509050613e138461018001518561010001518484614245565b805160208201516001600160801b03908116600160801b029116176004840155604001516005909201919091555050565b613e4f600382614dc9565b613e6c5760405163b0ce759160e01b815260040160405180910390fd5b6001600160a01b03166000908152600260208190526040822080546001600160d01b031916815560018101805463ffffffff1916905590810180546001600160e01b031990811690915560038201805490911690556004810182905560050155565b60055463ffffffff9081169082168103613ee6575050565b6005805463ffffffff191663ffffffff84811691821790925560408051928416835260208301919091527fb804b0ec3f0ea43004870df377170ce44cb789adca16d23286e337605558117f910161299d565b6000613f478260200151151590565b8015610c4757505051151590565b613f7b604051806060016040528060001515815260200160008152602001600081525090565b83516001600160801b031685871115613ffa576000613f9a8789615acc565b9050600086602001516001600160801b03168a613fb79190615acc565b90506000613fd7613fd18389600001518a6020015161399e565b84614dde565b8851909150613ff09082906001600160801b0316615a85565b935050505061402b565b8587101561402b57600061400e8888615acc565b905061402786600001516001600160801b031682614df4565b9150505b84516001600160801b03168103614064576040518060600160405280600015158152602001600081526020016000815250915050612fef565b82811015614094576040518060600160405280600115158152602001600081526020016000815250915050612fef565b60008086600001516001600160801b03168311156141665786516000906001600160801b031681036140d2576140cb600287615d83565b90506140ec565b87516140e9906002906001600160801b0316615d83565b90505b6140f68482614dde565b885190945061410e906001600160801b031685615acc565b9250614123838860200151896000015161399e565b91506040518060600160405280600115158152602001858152602001838a602001516001600160801b03166141589190615a85565b815250945050505050612fef565b865161417c9084906001600160801b0316615acc565b9150614191828760200151886000015161399e565b905060405180606001604052806001151581526020018481526020016141c489602001516001600160801b031684614df4565b90529a9950505050505050505050565b60006001600160801b038211156142415760405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20316044820152663238206269747360c81b606482015260840160405180910390fd5b5090565b815181516001600160801b039081169116146142d75781518151604080516001600160801b0393841681529290911660208301526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116929086169187917f6e96dc5343d067ec486a9920e0304c3610ed05c65e45cc029d9b9fe7ecfa7620910160405180910390a45b81602001516001600160801b031681602001516001600160801b03161461436457826001600160a01b0316836001600160a01b0316857f6e96dc5343d067ec486a9920e0304c3610ed05c65e45cc029d9b9fe7ecfa76208560200151856020015160405161435b9291906001600160801b0392831681529116602082015260400190565b60405180910390a45b50505050565b6040805180820190915260008082526020820152600061439b61439585600001518660200151614e0e565b84614e1e565b9050600060405180604001604052808387600001516143ba9190615e1a565b81526020018387602001516143cf9190615e1a565b81525090508060200151600003610c4357604051630d38a7e760e11b815260040160405180910390fd5b600061441182602001516001600160701b0316151590565b8015610c47575050516001600160701b0316151590565b60408051808201909152600080825260208201526040805180820190915260208381015182528351908201819052151561274d565b8251600090819061448f9061447585620f4240615e2e565b63ffffffff16866020015161448a9190615d83565b614b62565b905060006144b48660200151620f424063ffffffff16876000015161448a9190615d83565b86519091506000906144e2906144cd87620f4240615e53565b63ffffffff16886020015161448a9190615d83565b90506144ee8383614e50565b80156116db57506116db8282614e50565b60006004850181905560408051606081019091529081526020810161452261381c565b815260200161452f61381c565b9052805160018601805463ffffffff191663ffffffff9092169190911790556020808201518051600288018054928401516001600160701b039283166001600160e01b031994851617600160701b918416820217909155604090940151805160038a0180549290950151908316919093161791169092029190911790558354600160c01b900460ff161561460457835460ff60c01b1916845560405160ff8216906000906001600160a01b038816907f162ed187f3ed3879ae360c5df2a0a5dcaac7a208a9d762c2cbbfb1f5fad8b81d908390a45b811561469457604051631ebda06d60e01b8152600481018790526001600160a01b038681166024830152604482018490527f00000000000000000000000000000000000000000000000000000000000000001690631ebda06d90606401600060405180830381600087803b15801561467b57600080fd5b505af115801561468f573d6000803e3d6000fd5b505050505b6040805160608101825260048601546001600160801b038082168352600160801b909104166020820152600586015491810191909152611d8d90879087908690614245565b60408051808201909152600080825260208201528415806146f8575083155b156147165760405163bb55fd2760e01b815260040160405180910390fd5b600061472785846116d6818a615a85565b9050600061473f8263ffffffff8716620f424061399e565b9050604051806040016040528082846147589190615acc565b8152602001919091529695505050505050565b6040805180820190915260008082526020820152846000036147a05760405163bb55fd2760e01b815260040160405180910390fd5b60006147c58363ffffffff86166147ba87620f4240615e2e565b63ffffffff1661399e565b905060006147d38285615a85565b905060006147e688836116d6818b615acc565b60408051808201909152908152602081019390935250909695505050505050565b600554640100000000900463ffffffff166000036148225750565b606081015160055460009161484891640100000000900463ffffffff16620f424061399e565b9050808260c00181815161485c9190615acc565b90525061012082015161487157608090910152565b6148868260c001518360a001516000846146d9565b51608083015260c0820180518291906148a0908390615a85565b905250608082015160a0830180516148b9908390615acc565b90525060e0820180518291906148d0908390615acc565b9052505050565b6148df6155b3565b6001600160801b038911806148fa57506001600160801b0388115b8061490b57506001600160801b0387115b8061491c57506001600160801b0386115b8061492d57506001600160801b0385115b8061493a5750620f424084115b806149475750620f424083115b8061495157508582115b1561496f576040516318b103bd60e21b815260040160405180910390fd5b6000620f424061497f8582615acc565b6149899085615d83565b6149939190615e1a565b905061499f888a615a85565b620f42406149ad8682615acc565b6149b7908a615d83565b6149c19190615e1a565b1115614ab65760006149d3898b615a85565b620f42406149e18782615acc565b6149eb908b615d83565b6149f59190615e1a565b6149ff9190615acc565b90506000614a0d8a8c615a85565b614a17908a615acc565b9050614a258b8b8b88614e64565b8015614a2f575060005b15614a4a57614a438c8c8b858b8a89614e8e565b9350614aaf565b8b15614a7c57614a5d8c8c8c8c87614f67565b9350614a6d8c8c8b84878d614fe8565b60a08601526080850152614aaf565b88614a878b85615d83565b614a919190615e1a565b6060850152614aa48c8c8b84878d614fe8565b60a086015260808501525b5050614b31565b6000614acb614ac58a8c615a85565b89614df4565b9050600081118015614ae45750614ae48a8a8a87614e64565b8015614af95750614af98a898389898961505d565b15614b1557614b0e8b8b8a848a8a8a896150e7565b9250614b2f565b8a15614b2757614b0e8b8b8b85615195565b606083018290525b505b614b3b8184615acc565b60c08301525098975050505050505050565b60006116e1836001600160a01b038416615206565b60408051808201909152600080825260208201526000614b828484615255565b9050838302808210614bb75760405180604001604052808284614ba59190615acc565b81526020018281525092505050610c47565b60405180604001604052806001614bce8585900390565b614bd89190615acc565b815260200191909152949350505050565b60008180614bf957614bf9615e04565b838509949350505050565b604080518082019091526000808252602082015281836020015110614c4857604051806040016040528084600001518152602001838560200151613aac9190615acc565b604051806040016040528060018560000151614c649190615acc565b8152602001614c77856020015185900390565b90529392505050565b600080614c98614c9284808403615e1a565b60010190565b9050828460200151614caa9190615e1a565b8451820217949350505050565b60006001815b6008811015611e3e578382026002038202915080614cda81615db8565b915050614cbd565b604080518082019091526000808252602082015282516020830151614d10916001600160701b031690615d83565b60208401518351614d2a916001600160701b031690615d83565b03614d36575081610c47565b6116e1613b55614d4585613cb6565b8460046001615264565b600080614d5d85858561399e565b90506000614d6c868686614be9565b1115612d6e576000198110614d9457604051631a93c68960e11b815260040160405180910390fd5b6139c7816001615a85565b6000826000018281548110614db657614db6615da2565b9060005260206000200154905092915050565b60006116e1836001600160a01b0384166152f5565b6000818310614ded57816116e1565b5090919050565b6000818311614e045760006116e1565b6116e18284615acc565b600081831015614ded57816116e1565b6000614e2a8284615e7b565b15614e36576001614e39565b60005b60ff16614e468385615e1a565b6116e19190615a85565b6000614e5c83836153e8565b159392505050565b6000614e708284615acc565b614e7a9085615d83565b614e848387615d83565b1095945050505050565b614e966155b3565b6000614ea585620f4240615acc565b614eaf9087615d83565b90506000614ecd89614ec4620f42408b615d83565b87856001615410565b9050614f12614ee6614edf878d615d83565b848461399e565b604080518082019091526000808252602082015250604080518082019091529081526000602082015290565b8352614f4e614f2286898b61399e565b604080518082019091526000808252602082015250604080518082019091529081526001602082015290565b6040840152505060608101919091529695505050505050565b614f6f6155b3565b6000614f97614f7e8785615d83565b614f888587615acc565b614f929088615d83565b614df4565b9050614fab614f2288836116d6888b615d83565b8083526020830152614fc0614f228583615e1a565b6040830152614fd983614fd38789615a85565b8661399e565b60608301525095945050505050565b60008080614ff68686615d83565b905060006150048886615d83565b90508082111561503f5760008a1161501d576000615035565b6150358a61502b8385615acc565b6116d68b8d615d83565b9350849250615050565b6000935061504d8883615e1a565b92505b5050965096945050505050565b60008061509961506d888a615d83565b620f424061507b878b615d83565b615085898b615d83565b61508f9190615a85565b61448a9190615d83565b905060006150ce6150aa8589615d83565b6150b788620f4240615acc565b6150c1888c615d83565b615085620f42408c615d83565b90506150da82826153e8565b9998505050505050505050565b6150ef6155b3565b60006150fb8589615d83565b615108620f424089615d83565b6151129190615a85565b905060006151528a61512789620f4240615acc565b615131908c615d83565b8761513f8b620f4240615acc565b6151499087615d83565b620f4240615431565b9050615164614f22614edf878e615d83565b835261517b614ee686846116d6620f42408e615d83565b604084015250506060810191909152979650505050505050565b61519d6155b3565b60006151a98385614df4565b90506151b9614f2287838861399e565b80835260208301526151f181604080518082019091526000808252602082015250604080518082019091529081526001602082015290565b60408301525060608101919091529392505050565b600081815260018301602052604081205461524d57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610c47565b506000610c47565b60006000198284099392505050565b6040805180820190915260008082526020820152604051806040016040528083866000015188602001516152989190615d83565b6152a29190615d83565b6020870151885187916152b491615d83565b6152be9190615d83565b6152c89190615a85565b81526020016152d78486615a85565b866020015188602001516152eb9190615d83565b613bd39190615d83565b600081815260018301602052604081205480156153de576000615319600183615acc565b855490915060009061532d90600190615acc565b905081811461539257600086600001828154811061534d5761534d615da2565b906000526020600020015490508087600001848154811061537057615370615da2565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806153a3576153a3615e8f565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610c47565b6000915050610c47565b8051825160009110806116e15750815183511480156116e15750506020908101519101511190565b600061541d84848461399e565b6154278688615d83565b612fef9190615acc565b600061543e84848461399e565b6154488688615d83565b612fef9190615a85565b6040805160c0810182526000808252602082018190529181018290526060810191909152608081016154826154aa565b815260408051606081018252600080825260208281018290529282015291015290565b905290565b6040518060600160405280600063ffffffff1681526020016154dc604080518082019091526000808252602082015290565b81526020016154a5604080518082019091526000808252602082015290565b60405180610180016040528060008152602001600081526020016000815260200161553b6040518060400160405280600081526020016000151581525090565b815260200161555f6040518060400160405280600081526020016000151581525090565b81526020016155836040518060400160405280600081526020016000151581525090565b81526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b6040805161012081018252600060e082018181526101008301829052825282518084018452818152602080820183905280840191909152835180850185528281529081019190915290918201908152602001600081526020016000815260200160008152602001600081525090565b6001600160a01b03811681146121bc57600080fd5b60006020828403121561564957600080fd5b81356116e181615622565b81516001600160a01b0316815260208083015163ffffffff908116828401526040808501511515908401526060808501511515908401526080808501518051909216908401528082015180516001600160701b0390811660a08601529281015190921660c0840152610180830191506040015180516001600160701b0390811660e08501526020820151166101008401525060a083015180516001600160801b039081166101208501526020820151166101408401526040810151610160840152611e3e565b6000806040838503121561572d57600080fd5b823561573881615622565b946020939093013593505050565b60008060006060848603121561575b57600080fd5b833561576681615622565b95602085013595506040909401359392505050565b63ffffffff811681146121bc57600080fd5b60006020828403121561579f57600080fd5b81356116e18161577b565b6000806000606084860312156157bf57600080fd5b83356157ca81615622565b925060208401356157da81615622565b929592945050506040919091013590565b81518152602080830151908201526040808301519082015260608101610c47565b600080600080600060a0868803121561582457600080fd5b85359450602086013561583681615622565b9350604086013561584681615622565b94979396509394606081013594506080013592915050565b80151581146121bc57600080fd5b6000806040838503121561587f57600080fd5b823561588a81615622565b9150602083013561589a8161585e565b809150509250929050565b6000808284036101a08112156158ba57600080fd5b83356158c581615622565b9250610180601f19820112156158da57600080fd5b506020830190509250929050565b600080604083850312156158fb57600080fd5b823561590681615622565b9150602083013561589a8161577b565b6000806000806080858703121561592c57600080fd5b84359350602085013561593e81615622565b9250604085013561594e81615622565b9396929550929360600135925050565b81516001600160801b039081168252602080840151909116908201526040808301519082015260608101610c47565b6020808252825182820181905260009190848201906040850190845b818110156159ce5783516001600160a01b0316835292840192918401916001016159a9565b50909695505050505050565b60008060008060008060c087890312156159f357600080fd5b863595506020870135615a0581615622565b94506040870135615a1581615622565b9350606087013592506080870135915060a0870135615a338161585e565b809150509295509295509295565b60008060408385031215615a5457600080fd5b8235615a5f81615622565b9150602083013561589a81615622565b634e487b7160e01b600052601160045260246000fd5b60008219821115615a9857615a98615a6f565b500190565b600060208284031215615aaf57600080fd5b5051919050565b634e487b7160e01b600052602160045260246000fd5b600082821015615ade57615ade615a6f565b500390565b600060208284031215615af557600080fd5b81516116e18161585e565b600060208284031215615b1257600080fd5b81516116e181615622565b634e487b7160e01b600052604160045260246000fd5b60405160c0810167ffffffffffffffff81118282101715615b6457634e487b7160e01b600052604160045260246000fd5b60405290565b6040516060810167ffffffffffffffff81118282101715615b6457634e487b7160e01b600052604160045260246000fd5b80356001600160701b0381168114615bb257600080fd5b919050565b600060408284031215615bc957600080fd5b6040516040810181811067ffffffffffffffff82111715615bfa57634e487b7160e01b600052604160045260246000fd5b604052905080615c0983615b9b565b8152615c1760208401615b9b565b60208201525092915050565b80356001600160801b0381168114615bb257600080fd5b600060608284031215615c4c57600080fd5b6040516060810181811067ffffffffffffffff82111715615c7d57634e487b7160e01b600052604160045260246000fd5b604052905080615c8c83615c23565b8152615c9a60208401615c23565b6020820152604083013560408201525092915050565b6000818303610180811215615cc457600080fd5b615ccc615b33565b8335615cd781615622565b81526020840135615ce78161577b565b60208201526040840135615cfa8161585e565b60408201526060840135615d0d8161585e565b606082015260a0607f1983011215615d2457600080fd5b615d2c615b6a565b91506080840135615d3c8161577b565b8252615d4b8560a08601615bb7565b6020830152615d5d8560e08601615bb7565b6040830152816080820152615d76856101208601615c3a565b60a0820152949350505050565b6000816000190483118215151615615d9d57615d9d615a6f565b500290565b634e487b7160e01b600052603260045260246000fd5b600060018201615dca57615dca615a6f565b5060010190565b600060208284031215615de357600080fd5b81516116e18161577b565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b600082615e2957615e29615e04565b500490565b600063ffffffff83811690831681811015615e4b57615e4b615a6f565b039392505050565b600063ffffffff808316818516808303821115615e7257615e72615a6f565b01949350505050565b600082615e8a57615e8a615e04565b500690565b634e487b7160e01b600052603160045260246000fdfea164736f6c634300080d000a", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106102485760003560e01c8063915b99411161013b578063c5c51dca116100b8578063ee4808fe1161007c578063ee4808fe1461062a578063f2fde38b1461063d578063f525cb6814610650578063f6c5786114610658578063fba8cdee1461068657600080fd5b8063c5c51dca146105cb578063d1aebfc7146105e0578063d3df2424146105f3578063d4ee1d9014610606578063df2c3ab41461061757600080fd5b8063a135ef17116100ff578063a135ef17146104c8578063aa55a9b11461054b578063b1dd61b61461055e578063bedf952514610565578063c2cf42521461059857600080fd5b8063915b99411461046e5780639181d2e314610481578063921a929e146104945780639f5c734b146104a75780639fc19231146104ba57600080fd5b806354fd4d50116101c957806379ba50971161018d57806379ba50971461041c578063814175851461042457806387a7db0f146104375780638da5cb5b1461044a5780639049f9d21461045b57600080fd5b806354fd4d501461038657806356aca36f1461039c5780635768adcf146103af5780636161b626146103f357806372d960e11461040957600080fd5b806330cdb3081161021057806330cdb308146102d45780633376af511461031f57806334afba2b146103325780634ceea75314610352578063541868c81461037357600080fd5b8063136efb7a1461024d5780631510748b146102765780631c754cae1461028b5780632258cc691461029e57806327910565146102c1575b600080fd5b61026061025b366004615637565b610699565b60405161026d9190615654565b60405180910390f35b61028961028436600461571a565b6107ad565b005b610289610299366004615746565b61080d565b6102b16102ac366004615637565b610a85565b604051901515815260200161026d565b6102896102cf366004615637565b610ac2565b61030a6102e2366004615637565b6001600160a01b0316600090815260026020526040902054600160a01b900463ffffffff1690565b60405163ffffffff909116815260200161026d565b61028961032d36600461578d565b610b24565b6103456103403660046157aa565b610b3f565b60405161026d91906157eb565b61036561036036600461571a565b610bb4565b60405190815260200161026d565b61034561038136600461571a565b610c4d565b600c5b60405161ffff909116815260200161026d565b6103656103aa36600461580c565b610dbf565b6103db6103bd366004615637565b6001600160a01b039081166000908152600260205260409020541690565b6040516001600160a01b03909116815260200161026d565b600554640100000000900463ffffffff1661030a565b6103456104173660046157aa565b610fb5565b610289611031565b61028961043236600461586c565b611073565b610289610445366004615637565b6110f8565b6000546001600160a01b03166103db565b610289610469366004615637565b611177565b61028961047c3660046158a5565b6114b0565b61028961048f3660046158e8565b611561565b6103656104a2366004615746565b611612565b6103656104b5366004615916565b6116e8565b60055463ffffffff1661030a565b61053e6104d6366004615637565b6040805160608082018352600080835260208084018290529284018190526001600160a01b0394909416845260028252928290208251938401835260048101546001600160801b038082168652600160801b9091041691840191909152600501549082015290565b60405161026d919061595e565b610289610559366004615637565b611ba4565b6001610389565b6102b1610573366004615637565b6001600160a01b0316600090815260026020526040902054600160c01b900460ff1690565b6102b16105a6366004615637565b6001600160a01b0316600090815260026020526040902054600160c81b900460ff1690565b6105d3611d95565b60405161026d919061598d565b6103456105ee3660046159da565b611e45565b610289610601366004615a41565b611f09565b6001546001600160a01b03166103db565b6103456106253660046159da565b611fc3565b61036561063836600461571a565b61207f565b61028961064b366004615637565b61210e565b610365612167565b6102b1610666366004615637565b6001600160a01b0390811660009081526002602052604090205416151590565b61028961069436600461578d565b612178565b6106a1615452565b506001600160a01b03908116600090815260026020818152604092839020835160c0810185528154958616815263ffffffff600160a01b870481168285015260ff600160c01b88048116151583880152600160c81b9097049096161515606080830191909152855180820187526001840154909716875285518087018752948301546001600160701b038082168752600160701b9182900481168787015288860196909652865180880188526003850154808816825291909104909516858501528686019490945260808101959095528351928301845260048101546001600160801b038082168552600160801b9091041691830191909152600501549181019190915260a082015290565b7f00000000000000000000000000000000000000000000000000000000000000006107d781612193565b81156108085760006107e8846121bf565b9050828160040160010160008282546108019190615a85565b9091555050505b505050565b6108156121fc565b604080518082019091528281526020810182905261083281612227565b600061083d856121bf565b8054909150600160c01b900460ff161561086a57604051637952fbad60e11b815260040160405180910390fd5b6040516bffffffffffffffffffffffff1933606090811b8216602084015287901b166034820152604881018590526068810184905260009060880160405160208183030381529060405280519060200120905060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166387ba006a6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561091d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109419190615a9d565b9050610950828885878561224d565b60048301546001600160801b031681111561097e5760405163bb55fd2760e01b815260040160405180910390fd5b6000610989856126b0565b9050604051806060016040528061099d4390565b63ffffffff1681526020018281526020016109b783612710565b905280516001868101805463ffffffff191663ffffffff909316929092179091556020808301518051600289018054928401516001600160701b039283166001600160e01b031994851617600160701b918416820217909155604095860151805160038c0180549290960151908416919094161792909116021790558554600160c01b60ff60c01b19909116178655905181906001600160a01b038b16907f162ed187f3ed3879ae360c5df2a0a5dcaac7a208a9d762c2cbbfb1f5fad8b81d90600090a45050505050505050565b6001600160a01b0381166000908152600260208190526040822090610aa98261276a565b6002811115610aba57610aba615ab6565b149392505050565b610aca6121fc565b6000610ad5826121bf565b6040805160608101825260048301546001600160801b038082168352600160801b909104166020820152600583015491810191909152909150610b20906000908490849060016128d7565b5050565b610b2c6121fc565b80610b36816128f7565b610b2082612921565b610b6360405180606001604052806000815260200160008152602001600081525090565b81610b6d816129a9565b6000610b7f81878787600019846129ca565b9050610b8a81612c08565b60408051606080820183528351825283015160208201526080909201519082015295945050505050565b6001600160a01b038083166000908152600260209081526040808320805482516318160ddd60e01b8152925194959194610c4394889492909316926318160ddd92600480820193918290030181865afa158015610c15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c399190615a9d565b6005840154612d33565b9150505b92915050565b610c7160405180606001604052806000815260200160008152602001600081525090565b82610c7b81612d76565b82610c85816129a9565b6001600160a01b03808616600090815260026020908152604080832081516060810183526004808301546001600160801b038082168452600160801b9091041682860152600583015482850152825484516318160ddd60e01b8152945193979296959216936318160ddd93818301939290918290030181865afa158015610d10573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d349190615a9d565b90506000610d4788838560400151612d33565b90506000610d6d8a8a84878960000160149054906101000a900463ffffffff1688612d9d565b905060405180606001604052808260c001518360e00151610d8e9190615acc565b815260200182604001518360000151610da79190615a85565b815260006020909101529a9950505050505050505050565b60007f0000000000000000000000000000000000000000000000000000000000000000610deb81612193565b85610df581612d76565b84610dff816129a9565b84610e09816129a9565b6000610e14896121bf565b604080516060810182526004808401546001600160801b038082168452600160801b90910416602080840191909152600585015483850152845484516318160ddd60e01b8152945195965092946000946001600160a01b03909416936318160ddd938181019392918290030181865afa158015610e95573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eb99190615a9d565b90506000610ecc8b838560400151612d33565b9050808a1115610eef57604051633494a40d60e21b815260040160405180910390fd5b6001610efa8561276a565b6002811115610f0b57610f0b615ab6565b03610f29576040516301a6272960e41b815260040160405180910390fd5b6000610f4d8d8d8d878960000160149054906101000a900463ffffffff1688612d9d565b9050610f5c8f8f8f8885612ff9565b8454600160c01b900460ff1615610fa2576040805180820190915260048601546001600160801b038082168352600160801b909104166020820152610fa29086906136c8565b519e9d5050505050505050505050505050565b610fd960405180606001604052806000815260200160008152602001600081525090565b81610fe3816129a9565b6000610ff4818787876001806129ca565b9050610fff81612c08565b604051806060016040528082602001518152602001826060015181526020018260800151815250925050509392505050565b6001546001600160a01b0316331461105c57604051634ca8886760e01b815260040160405180910390fd5b600154611071906001600160a01b03166137c2565b565b61107b6121fc565b6000611086836121bf565b8054909150821515600160c81b90910460ff161515036110a557505050565b805460ff60c81b1916600160c81b8315159081029190911782556040516001600160a01b038516907fa606e6917bc476eb72d24f486596af7f564fb7b50f73135c81c0e8e0553430cd90600090a3505050565b7f000000000000000000000000000000000000000000000000000000000000000061112281612193565b600061112d836121bf565b604080516060810182526004808401546001600160801b038082168452600160801b90910416602083015260058401549282019290925291925061080891600091869185916128d7565b7f00000000000000000000000000000000000000000000000000000000000000006111a181612193565b60405163b5af090f60e01b81526001600160a01b0383811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063b5af090f90602401602060405180830381865afa158015611207573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061122b9190615ae3565b61124857604051630b094f2760e31b815260040160405180910390fd5b604051632b625f2360e01b81526001600160a01b0383811660048301526000917f000000000000000000000000000000000000000000000000000000000000000090911690632b625f23906024016020604051808303816000875af11580156112b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112d99190615b00565b9050806001600160a01b03166379ba50976040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561131657600080fd5b505af115801561132a573d6000803e3d6000fd5b5050505060006040518060c00160405280836001600160a01b03168152602001600560009054906101000a900463ffffffff1663ffffffff1681526020016000151581526020016001151581526020016040518060600160405280600063ffffffff16815260200161139a61381c565b81526020016113a761381c565b9052815260408051606081018252600080825260208281018290529282015291015290506113d58482613845565b60408082015190516000911515906001600160a01b038716907f162ed187f3ed3879ae360c5df2a0a5dcaac7a208a9d762c2cbbfb1f5fad8b81d908490a4836001600160a01b03167fa2d66c1e2cc4b2cc5daaabc06447542e989ed748a9fb22476b6c913dcc1c7f4b6000836020015160405161146592919063ffffffff92831681529116602082015260400190565b60405180910390a280606001511515846001600160a01b03167fa606e6917bc476eb72d24f486596af7f564fb7b50f73135c81c0e8e0553430cd60405160405180910390a350505050565b816114ba81612d76565b7f00000000000000000000000000000000000000000000000000000000000000006114e481612193565b6114fc846114f736869003860186615cb0565b613845565b6115096020840184615637565b6001600160a01b03166379ba50976040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561154357600080fd5b505af1158015611557573d6000803e3d6000fd5b5050505050505050565b6115696121fc565b80611573816128f7565b600061157e846121bf565b805490915063ffffffff600160a01b909104811690841681036115a2575050505050565b815463ffffffff60a01b1916600160a01b63ffffffff86811691820292909217845560408051928416835260208301919091526001600160a01b038716917fa2d66c1e2cc4b2cc5daaabc06447542e989ed748a9fb22476b6c913dcc1c7f4b910160405180910390a25050505050565b600082600003611624575060006116e1565b6001600160a01b038085166000908152600260209081526040808320805482516318160ddd60e01b81529251919516926318160ddd92600480820193918290030181865afa15801561167a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061169e9190615a9d565b905060006116ac8287615d83565b90506116db81836116bd8882615acc565b60058701546116cc9190615d83565b6116d69085615a85565b61399e565b93505050505b9392505050565b60007f000000000000000000000000000000000000000000000000000000000000000061171481612193565b8461171e81612d76565b83611728816129a9565b6000611733876121bf565b8054909150600160c81b900460ff1661175f576040516303a5be3f60e31b815260040160405180910390fd5b8054604080516318160ddd60e01b815290516000926001600160a01b0316916318160ddd9160048083019260209291908290030181865afa1580156117a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117cc9190615a9d565b60058301549091506117dc6154aa565b821580156117e957508115155b1561186e576040805160608101825260048601546001600160801b038082168352600160801b909104166020820152600586015491810191909152600092506118368d8c878460036128d7565b6040518060600160405280600063ffffffff16815260200161185661381c565b815260200161186361381c565b815250915050611930565b604080516060808201835260048701546001600160801b038082168452600160801b9091048116602080850191825260058a0154858701528551938401865260018a015463ffffffff1684528551808701875260028b01546001600160701b038082168352600160701b91829004811683850152868401929092528751808901895260038d015480841682529190910490911681830152848701528551808701909652845183168652905190911690840152909161192c9190613a6a565b9150505b600061193d8a8585613bde565b90506119498a84615a85565b600586015584546040516340c10f1960e01b81526001600160a01b038e8116600483015260248201849052909116906340c10f1990604401600060405180830381600087803b15801561199b57600080fd5b505af11580156119af573d6000803e3d6000fd5b505050508a6001600160a01b03168c6001600160a01b03168e7fecb7e4cd1580472adaeba712b36acf94439b2e1760af55fedb61960ca4422af38d85604051611a02929190918252602082015260400190565b60405180910390a46001600160a01b038b168d7f67c4863f17da9847c57c9fa043e63a0ddf4f5a86fd63a6f71ea69057a11c411a611a60837f0000000000000000000000000000000000000000000000000000000000000000613c12565b6005890154611a6f868a615a85565b6040805193845260208401929092529082015260600160405180910390a3611b278d8c87611aa08660200151613cb6565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166387ba006a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611afe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b229190615a9d565b61224d565b8454600160c01b900460ff1615611b94576040805160608101825260048701546001600160801b038082168352600160801b9091048116602080840191825260058a015484860152845180860190955283518316855290519091169083015290611b929087906136c8565b505b9c9b505050505050505050505050565b611bac6121fc565b6000611bb7826121bf565b604080516060808201835260048401546001600160801b038082168452600160801b820490811660208086019190915260058701548587015294516bffffffffffffffffffffffff1933851b8116968201969096529288901b90941660348301526001600160801b0319608091821b8116604884015293901b909216605883015291925060009060680160408051601f198184030181528282528051602091820120606084018352600187015463ffffffff1684528251808401845260028801546001600160701b038082168352600160701b91829004811683860152868501929092528451808601865260038a01548084168252919091049091168184015284840152825180840190935285516001600160801b0390811684528683015116918301919091529250600091611cec91613a6a565b905060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166387ba006a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611d4e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d729190615a9d565b9050611d8d838787611d878660200151613cb6565b8561224d565b505050505050565b60606000611da36003613cf2565b905060008167ffffffffffffffff811115611dc057611dc0615b1d565b604051908082528060200260200182016040528015611de9578160200160208202803683370190505b50905060005b82811015611e3e57611e02600382613cfc565b828281518110611e1457611e14615da2565b6001600160a01b039092166020928302919091019091015280611e3681615db8565b915050611def565b5092915050565b611e6960405180606001604052806000815260200160008152602001600081525090565b7f0000000000000000000000000000000000000000000000000000000000000000611e9381612193565b84611e9d816129a9565b84611ea7816129a9565b6000611eb88b8b8b8b8b60016129ca565b90508515611ec95760006101608201525b611ed281613d08565b6040518060600160405280826020015181526020018260600151815260200182608001518152509450505050509695505050505050565b80611f1381612d76565b7f0000000000000000000000000000000000000000000000000000000000000000611f3d81612193565b6001600160a01b0380851660009081526002602052604090205416611f6185613e44565b60405163f2fde38b60e01b81526001600160a01b03858116600483015282169063f2fde38b90602401600060405180830381600087803b158015611fa457600080fd5b505af1158015611fb8573d6000803e3d6000fd5b505050505050505050565b611fe760405180606001604052806000815260200160008152602001600081525090565b7f000000000000000000000000000000000000000000000000000000000000000061201181612193565b8461201b816129a9565b84612025816129a9565b60006120368b8b8b8b8b60006129ca565b905085156120475760006101608201525b61205081613d08565b6040805160608082018352835182528301516020820152608090920151908201529a9950505050505050505050565b6001600160a01b038083166000908152600260209081526040808320805482516318160ddd60e01b8152925194959194610c4394889492909316926318160ddd92600480820193918290030181865afa1580156120e0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121049190615a9d565b6005840154613bde565b6121166121fc565b6000546001600160a01b039081169082160361214557604051630a98f1f360e21b815260040160405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60006121736003613cf2565b905090565b6121806121fc565b8061218a816128f7565b610b2082613ece565b336001600160a01b038216146121bc57604051634ca8886760e01b815260040160405180910390fd5b50565b6001600160a01b03808216600090815260026020526040812080549192909116610c475760405163b0ce759160e01b815260040160405180910390fd5b6000546001600160a01b0316331461107157604051634ca8886760e01b815260040160405180910390fd5b61223081613f38565b6121bc57604051636a43f8d160e01b815260040160405180910390fd5b60006122826001600160a01b0386167f0000000000000000000000000000000000000000000000000000000000000000613c12565b9050806000036122a55760405163bb55fd2760e01b815260040160405180910390fd5b60016122b08561276a565b60028111156122c1576122c1615ab6565b036122cc57506126a9565b6040805160608101825260048601546001600160801b038082168352600160801b90910416602082015260058601549181019190915261230b84613f38565b6123245761231d8787878460026128d7565b50506126a9565b60405163467e55df60e01b81526001600160a01b03878116600483015260009161244b9185917f00000000000000000000000000000000000000000000000000000000000000009091169063467e55df90602401602060405180830381865afa158015612395573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123b99190615a9d565b604051637ea6a56960e11b81526001600160a01b038b811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063fd4d4ad290602401602060405180830381865afa15801561241f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124439190615a9d565b858989613f55565b805190915061245c575050506126a9565b6020810151158061246f57506040810151155b1561248a576124828888888560026128d7565b5050506126a9565b81600001516001600160801b03168160200151111561255c577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166371c0feb7898985600001516001600160801b031685602001516124f19190615acc565b6040516001600160e01b031960e086901b16815260048101939093526001600160a01b0390911660248301526044820152606401600060405180830381600087803b15801561253f57600080fd5b505af1158015612553573d6000803e3d6000fd5b5050505061262a565b81600001516001600160801b03168160200151101561262a577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316631ebda06d8989846020015186600001516001600160801b03166125c39190615acc565b6040516001600160e01b031960e086901b16815260048101939093526001600160a01b0390911660248301526044820152606401600060405180830381600087803b15801561261157600080fd5b505af1158015612625573d6000803e3d6000fd5b505050505b6000604051806060016040528061264484602001516141d4565b6001600160801b0316815260200161265f84604001516141d4565b6001600160801b0390811682526040808701516020938401528351928401518216600160801b02929091169190911760048a015581015160058901559050611fb889898584614245565b5050505050565b604080518082019091526000808252602082015260006126d7836001600160701b0361436a565b9050604051806040016040528082600001516001600160701b0316815260200182602001516001600160701b0316815250915050919050565b6040805180820190915260008082526020820152604080518082019091526020838101516001600160701b03908116835284511690820181905215155b610c4757604051630d38a7e760e11b815260040160405180910390fd5b60408051808201825260048301546001600160801b038082168352600160801b909104166020808301919091528251606081018452600185015463ffffffff1681528351808501855260028601546001600160701b038082168352600160701b9182900481168386015283850192835286518088018852600389015480831682529290920416938101939093529381019190915291516000929061280d83613f38565b158061281f575061281d816143f9565b155b1561282f57506000949350505050565b600061283a84614428565b604084015190915061284b82613f38565b158061285d575061285b816143f9565b155b1561286f575060009695505050505050565b600061287b8587613a6a565b905061289661288d8260200151613cb6565b8761271061445d565b80156128b657506128b66128ad8260400151613cb6565b8461271061445d565b156128c957506002979650505050505050565b506001979650505050505050565b60048301546126a99086908690869086906001600160801b0316866144ff565b620f424063ffffffff821611156121bc576040516358d620b360e01b815260040160405180910390fd5b60055463ffffffff64010000000090910481169082168103612941575050565b6005805467ffffffff00000000191664010000000063ffffffff8581169182029290921790925560408051918416825260208201929092527f1f1f36475e04b1709caf649fc7f00350aa38c7f7f110f653e81f79011db0867c91015b60405180910390a15050565b806000036121bc57604051637c946ed760e01b815260040160405180910390fd5b612a4b604051806101a00160405280600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160006001600160a01b03168152602001600015158152602001600015158152602001600063ffffffff168152602001600080191681525090565b6001600160a01b038681167f0000000000000000000000000000000000000000000000000000000000000000821690811491871614818015612a8b575080155b15612aad5760016101208401526001600160a01b038716610100840152612af3565b81158015612ab85750805b15612ada5760006101208401526001600160a01b038816610100840152612af3565b60405163b0ce759160e01b815260040160405180910390fd5b6000612b038461010001516121bf565b8054909150600160c01b900460ff16612b2f5760405163bcb8b8fb60e01b815260040160405180910390fd5b61018084018a905284158015610140860152612b4d57868452612b55565b602084018790525b60408481018790528154600160a01b900463ffffffff16610160860152805160608101825260048301546001600160801b038082168352600160801b90910416602082015260058301549181019190915261012085015115612bd35780516001600160801b0390811660a087015260208201511660c0860152612bf1565b60208101516001600160801b0390811660a087015281511660c08601525b6040015160e0850152509198975050505050505050565b604080518082019091526000808252602082015281610140015115612c7957612c448260a001518360c0015184610160015185600001516146d9565b80516020840181905260408401519192501015612c745760405163f31ee7a560e01b815260040160405180910390fd5b612ccc565b612c968260a001518360c00151846101600151856020015161476b565b80518084529091501580612cae575060408201518251115b15612ccc5760405163681c2ccd60e11b815260040160405180910390fd5b60208101516060830152815160a083018051612ce9908390615a85565b905250602082015160c083018051612d02908390615acc565b90525061012082015115612d2a5781606001518260e001818151612d269190615a85565b9052505b610b2082614807565b600082600003612d63578115612d5c57604051636a9c61e160e01b815260040160405180910390fd5b50826116e1565b612d6e84838561399e565b949350505050565b6001600160a01b0381166121bc5760405163e6c4247b60e01b815260040160405180910390fd5b612da56154fb565b60208401516000906001600160801b0316612de96001600160a01b038a167f0000000000000000000000000000000000000000000000000000000000000000613c12565b612df39190615acc565b90506000612eed86600001516001600160801b031687602001516001600160801b0316848960400151612e587f00000000000000000000000000000000000000000000000000000000000000008f6001600160a01b0316613c1290919063ffffffff16565b8a63ffffffff167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316632aac012c6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612ebd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ee19190615dd1565b63ffffffff168e6148d7565b905060405180610180016040528082606001518152602001826080015181526020018260a0015181526020018260400151815260200182600001518152602001826020015181526020018260c001518152602001888152602001898152602001858152602001826040015160200151612f83576040830151516020890151612f7e91906001600160801b0316615a85565b612fa1565b6040830151516020890151612fa191906001600160801b0316615acc565b8152602001826000015160200151612fd0578251518851612fcb91906001600160801b0316615a85565b612fe8565b8251518851612fe891906001600160801b0316615acc565b9052925050505b9695505050505050565b60408051606081018252600484810180546001600160801b038082168552600160801b90910416602084015260058601548385015285546101008601519451630852cd8d60e31b815292830194909452926001600160a01b0316906342966c6890602401600060405180830381600087803b15801561307757600080fd5b505af115801561308b573d6000803e3d6000fd5b5050505060008361010001518461012001516130a79190615acc565b905060006130bf84600101548387610120015161399e565b90508084600101819055506130d88561014001516141d4565b84546001600160801b03918216600160801b0291161784556101608501516130ff906141d4565b84546001600160801b0319166001600160801b039190911617845560a085015151156131d2578460a001516020015161313a5761313a615dee565b60a085015151604051631ebda06d60e01b8152600481018b90526001600160a01b03898116602483015260448201929092527f000000000000000000000000000000000000000000000000000000000000000090911690631ebda06d906064015b600060405180830381600087803b1580156131b557600080fd5b505af11580156131c9573d6000803e3d6000fd5b505050506132f8565b608085015151156132f8578460800151602001511561323f57608085015151604051631538c64b60e31b815260048101919091527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063a9c632589060240161319b565b6080850151516040516340c10f1960e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016916340c10f19916132c5917f0000000000000000000000000000000000000000000000000000000000000000916004016001600160a01b03929092168252602082015260400190565b600060405180830381600087803b1580156132df57600080fd5b505af11580156132f3573d6000803e3d6000fd5b505050505b6040850151156133ce576040858101519051631c20fadd60e01b81526001600160a01b0389811660048301527f00000000000000000000000000000000000000000000000000000000000000008116602483015260448201929092527f000000000000000000000000000000000000000000000000000000000000000090911690631c20fadd90606401600060405180830381600087803b15801561339c57600080fd5b505af11580156133b0573d6000803e3d6000fd5b505050508460400151856000018181516133ca9190615a85565b9052505b845115613465578451604051631c20fadd60e01b81526001600160a01b0389811660048301528a8116602483015260448201929092527f000000000000000000000000000000000000000000000000000000000000000090911690631c20fadd90606401600060405180830381600087803b15801561344c57600080fd5b505af1158015613460573d6000803e3d6000fd5b505050505b8461014001516000036134f15761347a61381c565b80516002880180546020909301516001600160701b03908116600160701b026001600160e01b03199094169216919091179190911790556134b961381c565b80516003880180546020909301516001600160701b03908116600160701b026001600160e01b03199094169216919091179190911790555b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166387ba006a6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561354f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135739190615a9d565b8561016001511015613598576135938988888689610160015160026144ff565b6135da565b6040805160608101825285546001600160801b038082168352600160801b9091041660208201526001860154918101919091526135da908a9089908690614245565b845161010086015160408088015160c089015182519485526020850193909352908301526000606083015260808201526001600160a01b0380891691908a16908b907feab8ac9e9478a4b3c37a794ecef629b8a8bbcd96f9eaeac8ed26054d144da52d9060a00160405180910390a46001600160a01b038716897f67c4863f17da9847c57c9fa043e63a0ddf4f5a86fd63a6f71ea69057a11c411a61369f837f0000000000000000000000000000000000000000000000000000000000000000613c12565b6040805191825260208201869052810186905260600160405180910390a3505050505050505050565b60408051606081018252600184015463ffffffff1681528151808301835260028501546001600160701b038082168352600160701b918290048116602084810191909152808501939093528451808601865260038801548083168252929092041691810191909152918101919091526137419082613a6a565b805160018401805463ffffffff191663ffffffff9092169190911790556020808201518051600286018054928401516001600160701b039283166001600160e01b031994851617600160701b918416820217909155604090940151805160039097018054919094015196821692169190911794169091029290921790915550565b600080546001600160a01b038381166001600160a01b031980841682178555600180549091169055604051919092169283917f343765429aea5a34b3ff6a3785a98a5abb2597aca87bfbb58632c173d585373a9190a35050565b604080518082018252600080825260209182018190528251808401909352825260019082015290565b613850600383614b4d565b61386d5760405163119b4fd360e11b815260040160405180910390fd5b6001600160a01b039182166000908152600260208181526040928390208451815486840151878701516060890151939099166001600160c01b031990921691909117600160a01b63ffffffff928316021761ffff60c01b1916600160c01b9815159890980260ff60c81b191697909717600160c81b911515919091021781556080850151805160018301805463ffffffff191691909816179096558582015180519382018054918401516001600160701b039586166001600160e01b031993841617600160701b91871682021790915596850151805160038401805492860151918716929093169190911794169096029290921790945560a0909201518051938101516001600160801b03948516600160801b95909116949094029390931760048301559190910151600590910155565b6000806139ab8585614b62565b80519091506000036139cf578281602001516139c79190615e1a565b9150506116e1565b805183116139f057604051631a93c68960e11b815260040160405180910390fd5b60006139fd868686614be9565b90506000613a0b8383614c04565b8051909150600003613a3157848160200151613a279190615e1a565b93505050506116e1565b6000858103861690613a438383614c80565b90506000613a59613a54848a615e1a565b614cb7565b919091029998505050505050505050565b613a726154aa565b613a7b82613f38565b613ab5576040518060600160405280600063ffffffff168152602001613a9f61381c565b8152602001613aac61381c565b90529050610c47565b8251439063ffffffff80831690821603613ad3578492505050610c47565b6064613adf8284615e2e565b63ffffffff16101580613afc5750613afa85602001516143f9565b155b80613b115750613b0f85604001516143f9565b155b15613b9357613b1f84613f38565b15613b665760405180606001604052808363ffffffff168152602001613b44866126b0565b8152602001613b5a613b5587614428565b6126b0565b81525092505050610c47565b6040518060600160405280600063ffffffff168152602001613b8661381c565b8152602001613b5a61381c565b60405180606001604052808363ffffffff168152602001613bb8876020015187614ce2565b8152602001613bd38760400151613bce88614428565b614ce2565b905295945050505050565b600082600003613c07578115612d5c57604051636a9c61e160e01b815260040160405180910390fd5b612d6e848484614d4f565b600073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6001600160a01b03841603613c4957506001600160a01b03811631610c47565b826040516370a0823160e01b81526001600160a01b03848116600483015291909116906370a0823190602401602060405180830381865afa158015613c92573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116e19190615a9d565b6040805180820182526000808252602091820152815180830190925282516001600160701b039081168352928101519092169181019190915290565b6000610c47825490565b60006116e18383614d9f565b6101008101516001600160a01b0316600090815260026020908152604091829020825160608101845260048201546001600160801b038082168352600160801b9091048116828501908152600584015483870152855180870190965282518216865251169284019290925291613d7f9083906136c8565b613d8883612c08565b60006040518060600160405280613db6866101200151613dac578660c001516141d4565b8660a001516141d4565b6001600160801b03168152602001613de5866101200151613ddb578660a001516141d4565b8660c001516141d4565b6001600160801b031681526020018560e001518152509050613e138461018001518561010001518484614245565b805160208201516001600160801b03908116600160801b029116176004840155604001516005909201919091555050565b613e4f600382614dc9565b613e6c5760405163b0ce759160e01b815260040160405180910390fd5b6001600160a01b03166000908152600260208190526040822080546001600160d01b031916815560018101805463ffffffff1916905590810180546001600160e01b031990811690915560038201805490911690556004810182905560050155565b60055463ffffffff9081169082168103613ee6575050565b6005805463ffffffff191663ffffffff84811691821790925560408051928416835260208301919091527fb804b0ec3f0ea43004870df377170ce44cb789adca16d23286e337605558117f910161299d565b6000613f478260200151151590565b8015610c4757505051151590565b613f7b604051806060016040528060001515815260200160008152602001600081525090565b83516001600160801b031685871115613ffa576000613f9a8789615acc565b9050600086602001516001600160801b03168a613fb79190615acc565b90506000613fd7613fd18389600001518a6020015161399e565b84614dde565b8851909150613ff09082906001600160801b0316615a85565b935050505061402b565b8587101561402b57600061400e8888615acc565b905061402786600001516001600160801b031682614df4565b9150505b84516001600160801b03168103614064576040518060600160405280600015158152602001600081526020016000815250915050612fef565b82811015614094576040518060600160405280600115158152602001600081526020016000815250915050612fef565b60008086600001516001600160801b03168311156141665786516000906001600160801b031681036140d2576140cb600287615d83565b90506140ec565b87516140e9906002906001600160801b0316615d83565b90505b6140f68482614dde565b885190945061410e906001600160801b031685615acc565b9250614123838860200151896000015161399e565b91506040518060600160405280600115158152602001858152602001838a602001516001600160801b03166141589190615a85565b815250945050505050612fef565b865161417c9084906001600160801b0316615acc565b9150614191828760200151886000015161399e565b905060405180606001604052806001151581526020018481526020016141c489602001516001600160801b031684614df4565b90529a9950505050505050505050565b60006001600160801b038211156142415760405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20316044820152663238206269747360c81b606482015260840160405180910390fd5b5090565b815181516001600160801b039081169116146142d75781518151604080516001600160801b0393841681529290911660208301526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116929086169187917f6e96dc5343d067ec486a9920e0304c3610ed05c65e45cc029d9b9fe7ecfa7620910160405180910390a45b81602001516001600160801b031681602001516001600160801b03161461436457826001600160a01b0316836001600160a01b0316857f6e96dc5343d067ec486a9920e0304c3610ed05c65e45cc029d9b9fe7ecfa76208560200151856020015160405161435b9291906001600160801b0392831681529116602082015260400190565b60405180910390a45b50505050565b6040805180820190915260008082526020820152600061439b61439585600001518660200151614e0e565b84614e1e565b9050600060405180604001604052808387600001516143ba9190615e1a565b81526020018387602001516143cf9190615e1a565b81525090508060200151600003610c4357604051630d38a7e760e11b815260040160405180910390fd5b600061441182602001516001600160701b0316151590565b8015610c47575050516001600160701b0316151590565b60408051808201909152600080825260208201526040805180820190915260208381015182528351908201819052151561274d565b8251600090819061448f9061447585620f4240615e2e565b63ffffffff16866020015161448a9190615d83565b614b62565b905060006144b48660200151620f424063ffffffff16876000015161448a9190615d83565b86519091506000906144e2906144cd87620f4240615e53565b63ffffffff16886020015161448a9190615d83565b90506144ee8383614e50565b80156116db57506116db8282614e50565b60006004850181905560408051606081019091529081526020810161452261381c565b815260200161452f61381c565b9052805160018601805463ffffffff191663ffffffff9092169190911790556020808201518051600288018054928401516001600160701b039283166001600160e01b031994851617600160701b918416820217909155604090940151805160038a0180549290950151908316919093161791169092029190911790558354600160c01b900460ff161561460457835460ff60c01b1916845560405160ff8216906000906001600160a01b038816907f162ed187f3ed3879ae360c5df2a0a5dcaac7a208a9d762c2cbbfb1f5fad8b81d908390a45b811561469457604051631ebda06d60e01b8152600481018790526001600160a01b038681166024830152604482018490527f00000000000000000000000000000000000000000000000000000000000000001690631ebda06d90606401600060405180830381600087803b15801561467b57600080fd5b505af115801561468f573d6000803e3d6000fd5b505050505b6040805160608101825260048601546001600160801b038082168352600160801b909104166020820152600586015491810191909152611d8d90879087908690614245565b60408051808201909152600080825260208201528415806146f8575083155b156147165760405163bb55fd2760e01b815260040160405180910390fd5b600061472785846116d6818a615a85565b9050600061473f8263ffffffff8716620f424061399e565b9050604051806040016040528082846147589190615acc565b8152602001919091529695505050505050565b6040805180820190915260008082526020820152846000036147a05760405163bb55fd2760e01b815260040160405180910390fd5b60006147c58363ffffffff86166147ba87620f4240615e2e565b63ffffffff1661399e565b905060006147d38285615a85565b905060006147e688836116d6818b615acc565b60408051808201909152908152602081019390935250909695505050505050565b600554640100000000900463ffffffff166000036148225750565b606081015160055460009161484891640100000000900463ffffffff16620f424061399e565b9050808260c00181815161485c9190615acc565b90525061012082015161487157608090910152565b6148868260c001518360a001516000846146d9565b51608083015260c0820180518291906148a0908390615a85565b905250608082015160a0830180516148b9908390615acc565b90525060e0820180518291906148d0908390615acc565b9052505050565b6148df6155b3565b6001600160801b038911806148fa57506001600160801b0388115b8061490b57506001600160801b0387115b8061491c57506001600160801b0386115b8061492d57506001600160801b0385115b8061493a5750620f424084115b806149475750620f424083115b8061495157508582115b1561496f576040516318b103bd60e21b815260040160405180910390fd5b6000620f424061497f8582615acc565b6149899085615d83565b6149939190615e1a565b905061499f888a615a85565b620f42406149ad8682615acc565b6149b7908a615d83565b6149c19190615e1a565b1115614ab65760006149d3898b615a85565b620f42406149e18782615acc565b6149eb908b615d83565b6149f59190615e1a565b6149ff9190615acc565b90506000614a0d8a8c615a85565b614a17908a615acc565b9050614a258b8b8b88614e64565b8015614a2f575060005b15614a4a57614a438c8c8b858b8a89614e8e565b9350614aaf565b8b15614a7c57614a5d8c8c8c8c87614f67565b9350614a6d8c8c8b84878d614fe8565b60a08601526080850152614aaf565b88614a878b85615d83565b614a919190615e1a565b6060850152614aa48c8c8b84878d614fe8565b60a086015260808501525b5050614b31565b6000614acb614ac58a8c615a85565b89614df4565b9050600081118015614ae45750614ae48a8a8a87614e64565b8015614af95750614af98a898389898961505d565b15614b1557614b0e8b8b8a848a8a8a896150e7565b9250614b2f565b8a15614b2757614b0e8b8b8b85615195565b606083018290525b505b614b3b8184615acc565b60c08301525098975050505050505050565b60006116e1836001600160a01b038416615206565b60408051808201909152600080825260208201526000614b828484615255565b9050838302808210614bb75760405180604001604052808284614ba59190615acc565b81526020018281525092505050610c47565b60405180604001604052806001614bce8585900390565b614bd89190615acc565b815260200191909152949350505050565b60008180614bf957614bf9615e04565b838509949350505050565b604080518082019091526000808252602082015281836020015110614c4857604051806040016040528084600001518152602001838560200151613aac9190615acc565b604051806040016040528060018560000151614c649190615acc565b8152602001614c77856020015185900390565b90529392505050565b600080614c98614c9284808403615e1a565b60010190565b9050828460200151614caa9190615e1a565b8451820217949350505050565b60006001815b6008811015611e3e578382026002038202915080614cda81615db8565b915050614cbd565b604080518082019091526000808252602082015282516020830151614d10916001600160701b031690615d83565b60208401518351614d2a916001600160701b031690615d83565b03614d36575081610c47565b6116e1613b55614d4585613cb6565b8460046001615264565b600080614d5d85858561399e565b90506000614d6c868686614be9565b1115612d6e576000198110614d9457604051631a93c68960e11b815260040160405180910390fd5b6139c7816001615a85565b6000826000018281548110614db657614db6615da2565b9060005260206000200154905092915050565b60006116e1836001600160a01b0384166152f5565b6000818310614ded57816116e1565b5090919050565b6000818311614e045760006116e1565b6116e18284615acc565b600081831015614ded57816116e1565b6000614e2a8284615e7b565b15614e36576001614e39565b60005b60ff16614e468385615e1a565b6116e19190615a85565b6000614e5c83836153e8565b159392505050565b6000614e708284615acc565b614e7a9085615d83565b614e848387615d83565b1095945050505050565b614e966155b3565b6000614ea585620f4240615acc565b614eaf9087615d83565b90506000614ecd89614ec4620f42408b615d83565b87856001615410565b9050614f12614ee6614edf878d615d83565b848461399e565b604080518082019091526000808252602082015250604080518082019091529081526000602082015290565b8352614f4e614f2286898b61399e565b604080518082019091526000808252602082015250604080518082019091529081526001602082015290565b6040840152505060608101919091529695505050505050565b614f6f6155b3565b6000614f97614f7e8785615d83565b614f888587615acc565b614f929088615d83565b614df4565b9050614fab614f2288836116d6888b615d83565b8083526020830152614fc0614f228583615e1a565b6040830152614fd983614fd38789615a85565b8661399e565b60608301525095945050505050565b60008080614ff68686615d83565b905060006150048886615d83565b90508082111561503f5760008a1161501d576000615035565b6150358a61502b8385615acc565b6116d68b8d615d83565b9350849250615050565b6000935061504d8883615e1a565b92505b5050965096945050505050565b60008061509961506d888a615d83565b620f424061507b878b615d83565b615085898b615d83565b61508f9190615a85565b61448a9190615d83565b905060006150ce6150aa8589615d83565b6150b788620f4240615acc565b6150c1888c615d83565b615085620f42408c615d83565b90506150da82826153e8565b9998505050505050505050565b6150ef6155b3565b60006150fb8589615d83565b615108620f424089615d83565b6151129190615a85565b905060006151528a61512789620f4240615acc565b615131908c615d83565b8761513f8b620f4240615acc565b6151499087615d83565b620f4240615431565b9050615164614f22614edf878e615d83565b835261517b614ee686846116d6620f42408e615d83565b604084015250506060810191909152979650505050505050565b61519d6155b3565b60006151a98385614df4565b90506151b9614f2287838861399e565b80835260208301526151f181604080518082019091526000808252602082015250604080518082019091529081526001602082015290565b60408301525060608101919091529392505050565b600081815260018301602052604081205461524d57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610c47565b506000610c47565b60006000198284099392505050565b6040805180820190915260008082526020820152604051806040016040528083866000015188602001516152989190615d83565b6152a29190615d83565b6020870151885187916152b491615d83565b6152be9190615d83565b6152c89190615a85565b81526020016152d78486615a85565b866020015188602001516152eb9190615d83565b613bd39190615d83565b600081815260018301602052604081205480156153de576000615319600183615acc565b855490915060009061532d90600190615acc565b905081811461539257600086600001828154811061534d5761534d615da2565b906000526020600020015490508087600001848154811061537057615370615da2565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806153a3576153a3615e8f565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610c47565b6000915050610c47565b8051825160009110806116e15750815183511480156116e15750506020908101519101511190565b600061541d84848461399e565b6154278688615d83565b612fef9190615acc565b600061543e84848461399e565b6154488688615d83565b612fef9190615a85565b6040805160c0810182526000808252602082018190529181018290526060810191909152608081016154826154aa565b815260408051606081018252600080825260208281018290529282015291015290565b905290565b6040518060600160405280600063ffffffff1681526020016154dc604080518082019091526000808252602082015290565b81526020016154a5604080518082019091526000808252602082015290565b60405180610180016040528060008152602001600081526020016000815260200161553b6040518060400160405280600081526020016000151581525090565b815260200161555f6040518060400160405280600081526020016000151581525090565b81526020016155836040518060400160405280600081526020016000151581525090565b81526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b6040805161012081018252600060e082018181526101008301829052825282518084018452818152602080820183905280840191909152835180850185528281529081019190915290918201908152602001600081526020016000815260200160008152602001600081525090565b6001600160a01b03811681146121bc57600080fd5b60006020828403121561564957600080fd5b81356116e181615622565b81516001600160a01b0316815260208083015163ffffffff908116828401526040808501511515908401526060808501511515908401526080808501518051909216908401528082015180516001600160701b0390811660a08601529281015190921660c0840152610180830191506040015180516001600160701b0390811660e08501526020820151166101008401525060a083015180516001600160801b039081166101208501526020820151166101408401526040810151610160840152611e3e565b6000806040838503121561572d57600080fd5b823561573881615622565b946020939093013593505050565b60008060006060848603121561575b57600080fd5b833561576681615622565b95602085013595506040909401359392505050565b63ffffffff811681146121bc57600080fd5b60006020828403121561579f57600080fd5b81356116e18161577b565b6000806000606084860312156157bf57600080fd5b83356157ca81615622565b925060208401356157da81615622565b929592945050506040919091013590565b81518152602080830151908201526040808301519082015260608101610c47565b600080600080600060a0868803121561582457600080fd5b85359450602086013561583681615622565b9350604086013561584681615622565b94979396509394606081013594506080013592915050565b80151581146121bc57600080fd5b6000806040838503121561587f57600080fd5b823561588a81615622565b9150602083013561589a8161585e565b809150509250929050565b6000808284036101a08112156158ba57600080fd5b83356158c581615622565b9250610180601f19820112156158da57600080fd5b506020830190509250929050565b600080604083850312156158fb57600080fd5b823561590681615622565b9150602083013561589a8161577b565b6000806000806080858703121561592c57600080fd5b84359350602085013561593e81615622565b9250604085013561594e81615622565b9396929550929360600135925050565b81516001600160801b039081168252602080840151909116908201526040808301519082015260608101610c47565b6020808252825182820181905260009190848201906040850190845b818110156159ce5783516001600160a01b0316835292840192918401916001016159a9565b50909695505050505050565b60008060008060008060c087890312156159f357600080fd5b863595506020870135615a0581615622565b94506040870135615a1581615622565b9350606087013592506080870135915060a0870135615a338161585e565b809150509295509295509295565b60008060408385031215615a5457600080fd5b8235615a5f81615622565b9150602083013561589a81615622565b634e487b7160e01b600052601160045260246000fd5b60008219821115615a9857615a98615a6f565b500190565b600060208284031215615aaf57600080fd5b5051919050565b634e487b7160e01b600052602160045260246000fd5b600082821015615ade57615ade615a6f565b500390565b600060208284031215615af557600080fd5b81516116e18161585e565b600060208284031215615b1257600080fd5b81516116e181615622565b634e487b7160e01b600052604160045260246000fd5b60405160c0810167ffffffffffffffff81118282101715615b6457634e487b7160e01b600052604160045260246000fd5b60405290565b6040516060810167ffffffffffffffff81118282101715615b6457634e487b7160e01b600052604160045260246000fd5b80356001600160701b0381168114615bb257600080fd5b919050565b600060408284031215615bc957600080fd5b6040516040810181811067ffffffffffffffff82111715615bfa57634e487b7160e01b600052604160045260246000fd5b604052905080615c0983615b9b565b8152615c1760208401615b9b565b60208201525092915050565b80356001600160801b0381168114615bb257600080fd5b600060608284031215615c4c57600080fd5b6040516060810181811067ffffffffffffffff82111715615c7d57634e487b7160e01b600052604160045260246000fd5b604052905080615c8c83615c23565b8152615c9a60208401615c23565b6020820152604083013560408201525092915050565b6000818303610180811215615cc457600080fd5b615ccc615b33565b8335615cd781615622565b81526020840135615ce78161577b565b60208201526040840135615cfa8161585e565b60408201526060840135615d0d8161585e565b606082015260a0607f1983011215615d2457600080fd5b615d2c615b6a565b91506080840135615d3c8161577b565b8252615d4b8560a08601615bb7565b6020830152615d5d8560e08601615bb7565b6040830152816080820152615d76856101208601615c3a565b60a0820152949350505050565b6000816000190483118215151615615d9d57615d9d615a6f565b500290565b634e487b7160e01b600052603260045260246000fd5b600060018201615dca57615dca615a6f565b5060010190565b600060208284031215615de357600080fd5b81516116e18161577b565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b600082615e2957615e29615e04565b500490565b600063ffffffff83811690831681811015615e4b57615e4b615a6f565b039392505050565b600063ffffffff808316818516808303821115615e7257615e72615a6f565b01949350505050565b600082615e8a57615e8a615e04565b500690565b634e487b7160e01b600052603160045260246000fdfea164736f6c634300080d000a", + "devdoc": { + "details": "Pool Collection contract notes: - the address of reserve token serves as the pool unique ID in both contract functions and events", + "events": { + "DefaultTradingFeePPMUpdated(uint32,uint32)": { + "details": "triggered when the default trading fee is updated" + }, + "DepositingEnabled(address,bool)": { + "details": "triggered when depositing into a specific pool is enabled/disabled" + }, + "NetworkFeePPMUpdated(uint32,uint32)": { + "details": "triggered when the network fee is updated" + }, + "TokensDeposited(bytes32,address,address,uint256,uint256)": { + "details": "triggered when new liquidity is deposited into a pool" + }, + "TokensWithdrawn(bytes32,address,address,uint256,uint256,uint256,uint256,uint256)": { + "details": "triggered when existing liquidity is withdrawn from a pool" + }, + "TotalLiquidityUpdated(bytes32,address,uint256,uint256,uint256)": { + "details": "triggered when the total liquidity in a pool is updated" + }, + "TradingEnabled(address,bool,uint8)": { + "details": "triggered when trading in a specific pool is enabled/disabled" + }, + "TradingFeePPMUpdated(address,uint32,uint32)": { + "details": "triggered when a specific pool's trading fee is updated" + }, + "TradingLiquidityUpdated(bytes32,address,address,uint256,uint256)": { + "details": "triggered when the trading liquidity in a pool is updated" + } + }, + "kind": "dev", + "methods": { + "acceptOwnership()": { + "details": "used by a new owner to accept an ownership transfer" + }, + "constructor": { + "details": "initializes a new PoolCollection contract" + }, + "createPool(address)": { + "details": "creates a new pool requirements: - the caller must be the network contract - the pool should have been whitelisted - the pool isn't already defined in the collection" + }, + "defaultTradingFeePPM()": { + "details": "returns the default trading fee (in units of PPM)" + }, + "depositFor(bytes32,address,address,uint256)": { + "details": "deposits base token liquidity on behalf of a specific provider and returns the respective pool token amount requirements: - the caller must be the network contract - assumes that the base token has been already deposited in the vault" + }, + "depositingEnabled(address)": { + "details": "returns whether depositing is enabled" + }, + "disableTrading(address)": { + "details": "disables trading in a given pool requirements: - the caller must be the owner of the contract" + }, + "disableTradingByNetwork(address)": { + "details": "disables trading on a pool requirements: - the caller must be the network contract" + }, + "enableDepositing(address,bool)": { + "details": "enables/disables depositing into a given pool requirements: - the caller must be the owner of the contract" + }, + "enableTrading(address,uint256,uint256)": { + "details": "enables trading in a given pool, by providing the funding rate as two virtual balances, and updates its trading liquidity note that the virtual balances should be derived from token prices, normalized to the smallest unit of tokens. In other words, the ratio between BNT and TKN virtual balances should be the ratio between the $ value of 1 wei of TKN and 1 wei of BNT, taking both of their decimals into account. For example: - if the price of one (10**18 wei) BNT is $X and the price of one (10**18 wei) TKN is $Y, then the virtual balances should represent a ratio of X to Y - if the price of one (10**18 wei) BNT is $X and the price of one (10**6 wei) USDC is $Y, then the virtual balances should represent a ratio of X to Y*10**12 requirements: - the caller must be the owner of the contract" + }, + "isPoolStable(address)": { + "details": "returns whether the pool is stable" + }, + "isPoolValid(address)": { + "details": "returns whether a pool is valid" + }, + "migratePoolIn(address,(address,uint32,bool,bool,(uint32,(uint112,uint112),(uint112,uint112)),(uint128,uint128,uint256)))": { + "details": "migrates a pool to this pool collection requirements: - the caller must be the pool migrator contract" + }, + "migratePoolOut(address,address)": { + "details": "migrates a pool from this pool collection requirements: - the caller must be the pool migrator contract" + }, + "networkFeePPM()": { + "details": "returns the network fee (in units of PPM)" + }, + "newOwner()": { + "details": "returns the address of the new owner candidate" + }, + "onFeesCollected(address,uint256)": { + "details": "notifies the pool of accrued fees requirements: - the caller must be the network contract" + }, + "owner()": { + "details": "returns the address of the current owner" + }, + "poolCount()": { + "details": "returns the number of all the pools which are managed by this pool collection" + }, + "poolData(address)": { + "details": "returns specific pool's data notes: - there is no guarantee that this function will remain forward compatible, so relying on it should be avoided and instead, rely on specific getters from the IPoolCollection interface" + }, + "poolLiquidity(address)": { + "details": "returns the overall liquidity in the pool" + }, + "poolToken(address)": { + "details": "returns the pool token of the pool" + }, + "poolTokenAmountToBurn(address,uint256,uint256)": { + "details": "returns the number of pool token to burn in order to increase everyone's underlying value by the specified amount" + }, + "poolTokenToUnderlying(address,uint256)": { + "details": "converts the specified pool token amount to the underlying base token amount" + }, + "poolType()": { + "details": "returns the type of the pool" + }, + "pools()": { + "details": "returns all the pools which are managed by this pool collection" + }, + "setDefaultTradingFeePPM(uint32)": { + "details": "sets the default trading fee (in units of PPM) requirements: - the caller must be the owner of the contract" + }, + "setNetworkFeePPM(uint32)": { + "details": "sets the network fee (in units of PPM) requirements: - the caller must be the owner of the contract" + }, + "setTradingFeePPM(address,uint32)": { + "details": "sets the trading fee of a given pool requirements: - the caller must be the owner of the contract" + }, + "tradeBySourceAmount(bytes32,address,address,uint256,uint256,bool)": { + "details": "performs a trade by providing the source amount and returns the target amount and the associated fee requirements: - the caller must be the network contract" + }, + "tradeByTargetAmount(bytes32,address,address,uint256,uint256,bool)": { + "details": "performs a trade by providing the target amount and returns the required source amount and the associated fee requirements: - the caller must be the network contract" + }, + "tradeInputAndFeeByTargetAmount(address,address,uint256)": { + "details": "returns the input amount and fee when trading by providing the target amount" + }, + "tradeOutputAndFeeBySourceAmount(address,address,uint256)": { + "details": "returns the output amount and fee when trading by providing the source amount" + }, + "tradingEnabled(address)": { + "details": "returns whether trading is enabled" + }, + "tradingFeePPM(address)": { + "details": "returns the trading fee (in units of PPM)" + }, + "transferOwnership(address)": { + "details": "allows transferring the contract ownership requirements: - the caller must be the owner of the contract - the new owner still needs to accept the transfer" + }, + "underlyingToPoolToken(address,uint256)": { + "details": "converts the specified underlying base token amount to pool token amount" + }, + "updateTradingLiquidity(address)": { + "details": "adjusts the trading liquidity in the given pool based on the base token vault balance/funding limit requirements: - the caller must be the owner of the contract" + }, + "withdraw(bytes32,address,address,uint256,uint256)": { + "details": "handles some of the withdrawal-related actions and returns the withdrawn base token amount requirements: - the caller must be the network contract - the caller must have approved the collection to transfer/burn the pool token amount on its behalf" + }, + "withdrawalAmounts(address,uint256)": { + "details": "returns the amounts that would be returned if the position is currently withdrawn, along with the breakdown of the base token and the BNT compensation" + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 32704, + "contract": "contracts/pools/PoolCollection.sol:PoolCollection", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 32706, + "contract": "contracts/pools/PoolCollection.sol:PoolCollection", + "label": "_newOwner", + "offset": 0, + "slot": "1", + "type": "t_address" + }, + { + "astId": 19849, + "contract": "contracts/pools/PoolCollection.sol:PoolCollection", + "label": "_poolData", + "offset": 0, + "slot": "2", + "type": "t_mapping(t_contract(Token)30851,t_struct(Pool)25429_storage)" + }, + { + "astId": 19852, + "contract": "contracts/pools/PoolCollection.sol:PoolCollection", + "label": "_pools", + "offset": 0, + "slot": "3", + "type": "t_struct(AddressSet)6608_storage" + }, + { + "astId": 19854, + "contract": "contracts/pools/PoolCollection.sol:PoolCollection", + "label": "_defaultTradingFeePPM", + "offset": 0, + "slot": "5", + "type": "t_uint32" + }, + { + "astId": 19856, + "contract": "contracts/pools/PoolCollection.sol:PoolCollection", + "label": "_networkFeePPM", + "offset": 4, + "slot": "5", + "type": "t_uint32" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_bytes32)dyn_storage": { + "base": "t_bytes32", + "encoding": "dynamic_array", + "label": "bytes32[]", + "numberOfBytes": "32" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_contract(IPoolToken)25816": { + "encoding": "inplace", + "label": "contract IPoolToken", + "numberOfBytes": "20" + }, + "t_contract(Token)30851": { + "encoding": "inplace", + "label": "contract Token", + "numberOfBytes": "20" + }, + "t_mapping(t_bytes32,t_uint256)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_mapping(t_contract(Token)30851,t_struct(Pool)25429_storage)": { + "encoding": "mapping", + "key": "t_contract(Token)30851", + "label": "mapping(contract Token => struct Pool)", + "numberOfBytes": "32", + "value": "t_struct(Pool)25429_storage" + }, + "t_struct(AddressSet)6608_storage": { + "encoding": "inplace", + "label": "struct EnumerableSet.AddressSet", + "members": [ + { + "astId": 6607, + "contract": "contracts/pools/PoolCollection.sol:PoolCollection", + "label": "_inner", + "offset": 0, + "slot": "0", + "type": "t_struct(Set)6307_storage" + } + ], + "numberOfBytes": "64" + }, + "t_struct(AverageRates)25413_storage": { + "encoding": "inplace", + "label": "struct AverageRates", + "members": [ + { + "astId": 25406, + "contract": "contracts/pools/PoolCollection.sol:PoolCollection", + "label": "blockNumber", + "offset": 0, + "slot": "0", + "type": "t_uint32" + }, + { + "astId": 25409, + "contract": "contracts/pools/PoolCollection.sol:PoolCollection", + "label": "rate", + "offset": 0, + "slot": "1", + "type": "t_struct(Fraction112)31238_storage" + }, + { + "astId": 25412, + "contract": "contracts/pools/PoolCollection.sol:PoolCollection", + "label": "invRate", + "offset": 0, + "slot": "2", + "type": "t_struct(Fraction112)31238_storage" + } + ], + "numberOfBytes": "96" + }, + "t_struct(Fraction112)31238_storage": { + "encoding": "inplace", + "label": "struct Fraction112", + "members": [ + { + "astId": 31235, + "contract": "contracts/pools/PoolCollection.sol:PoolCollection", + "label": "n", + "offset": 0, + "slot": "0", + "type": "t_uint112" + }, + { + "astId": 31237, + "contract": "contracts/pools/PoolCollection.sol:PoolCollection", + "label": "d", + "offset": 14, + "slot": "0", + "type": "t_uint112" + } + ], + "numberOfBytes": "32" + }, + "t_struct(Pool)25429_storage": { + "encoding": "inplace", + "label": "struct Pool", + "members": [ + { + "astId": 25416, + "contract": "contracts/pools/PoolCollection.sol:PoolCollection", + "label": "poolToken", + "offset": 0, + "slot": "0", + "type": "t_contract(IPoolToken)25816" + }, + { + "astId": 25418, + "contract": "contracts/pools/PoolCollection.sol:PoolCollection", + "label": "tradingFeePPM", + "offset": 20, + "slot": "0", + "type": "t_uint32" + }, + { + "astId": 25420, + "contract": "contracts/pools/PoolCollection.sol:PoolCollection", + "label": "tradingEnabled", + "offset": 24, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 25422, + "contract": "contracts/pools/PoolCollection.sol:PoolCollection", + "label": "depositingEnabled", + "offset": 25, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 25425, + "contract": "contracts/pools/PoolCollection.sol:PoolCollection", + "label": "averageRates", + "offset": 0, + "slot": "1", + "type": "t_struct(AverageRates)25413_storage" + }, + { + "astId": 25428, + "contract": "contracts/pools/PoolCollection.sol:PoolCollection", + "label": "liquidity", + "offset": 0, + "slot": "4", + "type": "t_struct(PoolLiquidity)25404_storage" + } + ], + "numberOfBytes": "192" + }, + "t_struct(PoolLiquidity)25404_storage": { + "encoding": "inplace", + "label": "struct PoolLiquidity", + "members": [ + { + "astId": 25399, + "contract": "contracts/pools/PoolCollection.sol:PoolCollection", + "label": "bntTradingLiquidity", + "offset": 0, + "slot": "0", + "type": "t_uint128" + }, + { + "astId": 25401, + "contract": "contracts/pools/PoolCollection.sol:PoolCollection", + "label": "baseTokenTradingLiquidity", + "offset": 16, + "slot": "0", + "type": "t_uint128" + }, + { + "astId": 25403, + "contract": "contracts/pools/PoolCollection.sol:PoolCollection", + "label": "stakedBalance", + "offset": 0, + "slot": "1", + "type": "t_uint256" + } + ], + "numberOfBytes": "64" + }, + "t_struct(Set)6307_storage": { + "encoding": "inplace", + "label": "struct EnumerableSet.Set", + "members": [ + { + "astId": 6302, + "contract": "contracts/pools/PoolCollection.sol:PoolCollection", + "label": "_values", + "offset": 0, + "slot": "0", + "type": "t_array(t_bytes32)dyn_storage" + }, + { + "astId": 6306, + "contract": "contracts/pools/PoolCollection.sol:PoolCollection", + "label": "_indexes", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_bytes32,t_uint256)" + } + ], + "numberOfBytes": "64" + }, + "t_uint112": { + "encoding": "inplace", + "label": "uint112", + "numberOfBytes": "14" + }, + "t_uint128": { + "encoding": "inplace", + "label": "uint128", + "numberOfBytes": "16" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint32": { + "encoding": "inplace", + "label": "uint32", + "numberOfBytes": "4" + } + } + } +} \ No newline at end of file diff --git a/deployments/mainnet/types/contracts/pools/PoolCollectionType1V12.ts b/deployments/mainnet/types/contracts/pools/PoolCollectionType1V12.ts index 649d1de0a..eb6c3180c 100644 --- a/deployments/mainnet/types/contracts/pools/PoolCollectionType1V12.ts +++ b/deployments/mainnet/types/contracts/pools/PoolCollectionType1V12.ts @@ -8,7 +8,6 @@ import type { TypedEvent, TypedListener, OnEvent, - PromiseOrValue, } from "../../common"; import type { FunctionFragment, @@ -29,10 +28,7 @@ import type { utils, } from "ethers"; -export type Fraction112Struct = { - n: PromiseOrValue; - d: PromiseOrValue; -}; +export type Fraction112Struct = { n: BigNumberish; d: BigNumberish }; export type Fraction112StructOutput = [BigNumber, BigNumber] & { n: BigNumber; @@ -40,7 +36,7 @@ export type Fraction112StructOutput = [BigNumber, BigNumber] & { }; export type AverageRatesStruct = { - blockNumber: PromiseOrValue; + blockNumber: BigNumberish; rate: Fraction112Struct; invRate: Fraction112Struct; }; @@ -56,9 +52,9 @@ export type AverageRatesStructOutput = [ }; export type PoolLiquidityStruct = { - bntTradingLiquidity: PromiseOrValue; - baseTokenTradingLiquidity: PromiseOrValue; - stakedBalance: PromiseOrValue; + bntTradingLiquidity: BigNumberish; + baseTokenTradingLiquidity: BigNumberish; + stakedBalance: BigNumberish; }; export type PoolLiquidityStructOutput = [BigNumber, BigNumber, BigNumber] & { @@ -68,10 +64,10 @@ export type PoolLiquidityStructOutput = [BigNumber, BigNumber, BigNumber] & { }; export type PoolStruct = { - poolToken: PromiseOrValue; - tradingFeePPM: PromiseOrValue; - tradingEnabled: PromiseOrValue; - depositingEnabled: PromiseOrValue; + poolToken: string; + tradingFeePPM: BigNumberish; + tradingEnabled: boolean; + depositingEnabled: boolean; averageRates: AverageRatesStruct; liquidity: PoolLiquidityStruct; }; @@ -93,9 +89,9 @@ export type PoolStructOutput = [ }; export type TradeAmountAndFeeStruct = { - amount: PromiseOrValue; - tradingFeeAmount: PromiseOrValue; - networkFeeAmount: PromiseOrValue; + amount: BigNumberish; + tradingFeeAmount: BigNumberish; + networkFeeAmount: BigNumberish; }; export type TradeAmountAndFeeStructOutput = [ @@ -109,9 +105,9 @@ export type TradeAmountAndFeeStructOutput = [ }; export type WithdrawalAmountsStruct = { - totalAmount: PromiseOrValue; - baseTokenAmount: PromiseOrValue; - bntAmount: PromiseOrValue; + totalAmount: BigNumberish; + baseTokenAmount: BigNumberish; + bntAmount: BigNumberish; }; export type WithdrawalAmountsStructOutput = [ @@ -132,6 +128,7 @@ export interface PoolCollectionInterface extends utils.Interface { "depositFor(bytes32,address,address,uint256)": FunctionFragment; "depositingEnabled(address)": FunctionFragment; "disableTrading(address)": FunctionFragment; + "disableTradingByNetwork(address)": FunctionFragment; "enableDepositing(address,bool)": FunctionFragment; "enableTrading(address,uint256,uint256)": FunctionFragment; "isPoolStable(address)": FunctionFragment; @@ -175,6 +172,7 @@ export interface PoolCollectionInterface extends utils.Interface { | "depositFor" | "depositingEnabled" | "disableTrading" + | "disableTradingByNetwork" | "enableDepositing" | "enableTrading" | "isPoolStable" @@ -214,58 +212,47 @@ export interface PoolCollectionInterface extends utils.Interface { functionFragment: "acceptOwnership", values?: undefined ): string; - encodeFunctionData( - functionFragment: "createPool", - values: [PromiseOrValue] - ): string; + encodeFunctionData(functionFragment: "createPool", values: [string]): string; encodeFunctionData( functionFragment: "defaultTradingFeePPM", values?: undefined ): string; encodeFunctionData( functionFragment: "depositFor", - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] + values: [BytesLike, string, string, BigNumberish] ): string; encodeFunctionData( functionFragment: "depositingEnabled", - values: [PromiseOrValue] + values: [string] ): string; encodeFunctionData( functionFragment: "disableTrading", - values: [PromiseOrValue] + values: [string] + ): string; + encodeFunctionData( + functionFragment: "disableTradingByNetwork", + values: [string] ): string; encodeFunctionData( functionFragment: "enableDepositing", - values: [PromiseOrValue, PromiseOrValue] + values: [string, boolean] ): string; encodeFunctionData( functionFragment: "enableTrading", - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] + values: [string, BigNumberish, BigNumberish] ): string; encodeFunctionData( functionFragment: "isPoolStable", - values: [PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "isPoolValid", - values: [PromiseOrValue] + values: [string] ): string; + encodeFunctionData(functionFragment: "isPoolValid", values: [string]): string; encodeFunctionData( functionFragment: "migratePoolIn", - values: [PromiseOrValue, PoolStruct] + values: [string, PoolStruct] ): string; encodeFunctionData( functionFragment: "migratePoolOut", - values: [PromiseOrValue, PromiseOrValue] + values: [string, string] ): string; encodeFunctionData( functionFragment: "networkFeePPM", @@ -274,120 +261,82 @@ export interface PoolCollectionInterface extends utils.Interface { encodeFunctionData(functionFragment: "newOwner", values?: undefined): string; encodeFunctionData( functionFragment: "onFeesCollected", - values: [PromiseOrValue, PromiseOrValue] + values: [string, BigNumberish] ): string; encodeFunctionData(functionFragment: "owner", values?: undefined): string; encodeFunctionData(functionFragment: "poolCount", values?: undefined): string; - encodeFunctionData( - functionFragment: "poolData", - values: [PromiseOrValue] - ): string; + encodeFunctionData(functionFragment: "poolData", values: [string]): string; encodeFunctionData( functionFragment: "poolLiquidity", - values: [PromiseOrValue] - ): string; - encodeFunctionData( - functionFragment: "poolToken", - values: [PromiseOrValue] + values: [string] ): string; + encodeFunctionData(functionFragment: "poolToken", values: [string]): string; encodeFunctionData( functionFragment: "poolTokenAmountToBurn", - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] + values: [string, BigNumberish, BigNumberish] ): string; encodeFunctionData( functionFragment: "poolTokenToUnderlying", - values: [PromiseOrValue, PromiseOrValue] + values: [string, BigNumberish] ): string; encodeFunctionData(functionFragment: "poolType", values?: undefined): string; encodeFunctionData(functionFragment: "pools", values?: undefined): string; encodeFunctionData( functionFragment: "setDefaultTradingFeePPM", - values: [PromiseOrValue] + values: [BigNumberish] ): string; encodeFunctionData( functionFragment: "setNetworkFeePPM", - values: [PromiseOrValue] + values: [BigNumberish] ): string; encodeFunctionData( functionFragment: "setTradingFeePPM", - values: [PromiseOrValue, PromiseOrValue] + values: [string, BigNumberish] ): string; encodeFunctionData( functionFragment: "tradeBySourceAmount", - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] + values: [BytesLike, string, string, BigNumberish, BigNumberish, boolean] ): string; encodeFunctionData( functionFragment: "tradeByTargetAmount", - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] + values: [BytesLike, string, string, BigNumberish, BigNumberish, boolean] ): string; encodeFunctionData( functionFragment: "tradeInputAndFeeByTargetAmount", - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] + values: [string, string, BigNumberish] ): string; encodeFunctionData( functionFragment: "tradeOutputAndFeeBySourceAmount", - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] + values: [string, string, BigNumberish] ): string; encodeFunctionData( functionFragment: "tradingEnabled", - values: [PromiseOrValue] + values: [string] ): string; encodeFunctionData( functionFragment: "tradingFeePPM", - values: [PromiseOrValue] + values: [string] ): string; encodeFunctionData( functionFragment: "transferOwnership", - values: [PromiseOrValue] + values: [string] ): string; encodeFunctionData( functionFragment: "underlyingToPoolToken", - values: [PromiseOrValue, PromiseOrValue] + values: [string, BigNumberish] ): string; encodeFunctionData( functionFragment: "updateTradingLiquidity", - values: [PromiseOrValue] + values: [string] ): string; encodeFunctionData(functionFragment: "version", values?: undefined): string; encodeFunctionData( functionFragment: "withdraw", - values: [ - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue, - PromiseOrValue - ] + values: [BytesLike, string, string, BigNumberish, BigNumberish] ): string; encodeFunctionData( functionFragment: "withdrawalAmounts", - values: [PromiseOrValue, PromiseOrValue] + values: [string, BigNumberish] ): string; decodeFunctionResult( @@ -408,6 +357,10 @@ export interface PoolCollectionInterface extends utils.Interface { functionFragment: "disableTrading", data: BytesLike ): Result; + decodeFunctionResult( + functionFragment: "disableTradingByNetwork", + data: BytesLike + ): Result; decodeFunctionResult( functionFragment: "enableDepositing", data: BytesLike @@ -711,67 +664,66 @@ export interface PoolCollection extends BaseContract { functions: { acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } + overrides?: Overrides & { from?: string } ): Promise; createPool( - token: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + token: string, + overrides?: Overrides & { from?: string } ): Promise; defaultTradingFeePPM(overrides?: CallOverrides): Promise<[number]>; depositFor( - contextId: PromiseOrValue, - provider: PromiseOrValue, - pool: PromiseOrValue, - baseTokenAmount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + contextId: BytesLike, + provider: string, + pool: string, + baseTokenAmount: BigNumberish, + overrides?: Overrides & { from?: string } ): Promise; depositingEnabled( - pool: PromiseOrValue, + pool: string, overrides?: CallOverrides ): Promise<[boolean]>; disableTrading( - pool: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + pool: string, + overrides?: Overrides & { from?: string } + ): Promise; + + disableTradingByNetwork( + pool: string, + overrides?: Overrides & { from?: string } ): Promise; enableDepositing( - pool: PromiseOrValue, - status: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + pool: string, + status: boolean, + overrides?: Overrides & { from?: string } ): Promise; enableTrading( - pool: PromiseOrValue, - bntVirtualBalance: PromiseOrValue, - baseTokenVirtualBalance: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + pool: string, + bntVirtualBalance: BigNumberish, + baseTokenVirtualBalance: BigNumberish, + overrides?: Overrides & { from?: string } ): Promise; - isPoolStable( - pool: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[boolean]>; + isPoolStable(pool: string, overrides?: CallOverrides): Promise<[boolean]>; - isPoolValid( - pool: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[boolean]>; + isPoolValid(pool: string, overrides?: CallOverrides): Promise<[boolean]>; migratePoolIn( - pool: PromiseOrValue, + pool: string, data: PoolStruct, - overrides?: Overrides & { from?: PromiseOrValue } + overrides?: Overrides & { from?: string } ): Promise; migratePoolOut( - pool: PromiseOrValue, - targetPoolCollection: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + pool: string, + targetPoolCollection: string, + overrides?: Overrides & { from?: string } ): Promise; networkFeePPM(overrides?: CallOverrides): Promise<[number]>; @@ -779,9 +731,9 @@ export interface PoolCollection extends BaseContract { newOwner(overrides?: CallOverrides): Promise<[string]>; onFeesCollected( - pool: PromiseOrValue, - feeAmount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + pool: string, + feeAmount: BigNumberish, + overrides?: Overrides & { from?: string } ): Promise; owner(overrides?: CallOverrides): Promise<[string]>; @@ -789,30 +741,27 @@ export interface PoolCollection extends BaseContract { poolCount(overrides?: CallOverrides): Promise<[BigNumber]>; poolData( - pool: PromiseOrValue, + pool: string, overrides?: CallOverrides ): Promise<[PoolStructOutput]>; poolLiquidity( - pool: PromiseOrValue, + pool: string, overrides?: CallOverrides ): Promise<[PoolLiquidityStructOutput]>; - poolToken( - pool: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[string]>; + poolToken(pool: string, overrides?: CallOverrides): Promise<[string]>; poolTokenAmountToBurn( - pool: PromiseOrValue, - baseTokenAmountToDistribute: PromiseOrValue, - protocolPoolTokenAmount: PromiseOrValue, + pool: string, + baseTokenAmountToDistribute: BigNumberish, + protocolPoolTokenAmount: BigNumberish, overrides?: CallOverrides ): Promise<[BigNumber]>; poolTokenToUnderlying( - pool: PromiseOrValue, - poolTokenAmount: PromiseOrValue, + pool: string, + poolTokenAmount: BigNumberish, overrides?: CallOverrides ): Promise<[BigNumber]>; @@ -821,161 +770,151 @@ export interface PoolCollection extends BaseContract { pools(overrides?: CallOverrides): Promise<[string[]]>; setDefaultTradingFeePPM( - newDefaultTradingFeePPM: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + newDefaultTradingFeePPM: BigNumberish, + overrides?: Overrides & { from?: string } ): Promise; setNetworkFeePPM( - newNetworkFeePPM: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + newNetworkFeePPM: BigNumberish, + overrides?: Overrides & { from?: string } ): Promise; setTradingFeePPM( - pool: PromiseOrValue, - newTradingFeePPM: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + pool: string, + newTradingFeePPM: BigNumberish, + overrides?: Overrides & { from?: string } ): Promise; tradeBySourceAmount( - contextId: PromiseOrValue, - sourceToken: PromiseOrValue, - targetToken: PromiseOrValue, - sourceAmount: PromiseOrValue, - minReturnAmount: PromiseOrValue, - ignoreFees: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + contextId: BytesLike, + sourceToken: string, + targetToken: string, + sourceAmount: BigNumberish, + minReturnAmount: BigNumberish, + ignoreFees: boolean, + overrides?: Overrides & { from?: string } ): Promise; tradeByTargetAmount( - contextId: PromiseOrValue, - sourceToken: PromiseOrValue, - targetToken: PromiseOrValue, - targetAmount: PromiseOrValue, - maxSourceAmount: PromiseOrValue, - ignoreFees: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + contextId: BytesLike, + sourceToken: string, + targetToken: string, + targetAmount: BigNumberish, + maxSourceAmount: BigNumberish, + ignoreFees: boolean, + overrides?: Overrides & { from?: string } ): Promise; tradeInputAndFeeByTargetAmount( - sourceToken: PromiseOrValue, - targetToken: PromiseOrValue, - targetAmount: PromiseOrValue, + sourceToken: string, + targetToken: string, + targetAmount: BigNumberish, overrides?: CallOverrides ): Promise<[TradeAmountAndFeeStructOutput]>; tradeOutputAndFeeBySourceAmount( - sourceToken: PromiseOrValue, - targetToken: PromiseOrValue, - sourceAmount: PromiseOrValue, + sourceToken: string, + targetToken: string, + sourceAmount: BigNumberish, overrides?: CallOverrides ): Promise<[TradeAmountAndFeeStructOutput]>; - tradingEnabled( - pool: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[boolean]>; + tradingEnabled(pool: string, overrides?: CallOverrides): Promise<[boolean]>; - tradingFeePPM( - pool: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[number]>; + tradingFeePPM(pool: string, overrides?: CallOverrides): Promise<[number]>; transferOwnership( - ownerCandidate: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + ownerCandidate: string, + overrides?: Overrides & { from?: string } ): Promise; underlyingToPoolToken( - pool: PromiseOrValue, - baseTokenAmount: PromiseOrValue, + pool: string, + baseTokenAmount: BigNumberish, overrides?: CallOverrides ): Promise<[BigNumber]>; updateTradingLiquidity( - pool: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + pool: string, + overrides?: Overrides & { from?: string } ): Promise; version(overrides?: CallOverrides): Promise<[number]>; withdraw( - contextId: PromiseOrValue, - provider: PromiseOrValue, - pool: PromiseOrValue, - poolTokenAmount: PromiseOrValue, - baseTokenAmount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + contextId: BytesLike, + provider: string, + pool: string, + poolTokenAmount: BigNumberish, + baseTokenAmount: BigNumberish, + overrides?: Overrides & { from?: string } ): Promise; withdrawalAmounts( - pool: PromiseOrValue, - poolTokenAmount: PromiseOrValue, + pool: string, + poolTokenAmount: BigNumberish, overrides?: CallOverrides ): Promise<[WithdrawalAmountsStructOutput]>; }; acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } + overrides?: Overrides & { from?: string } ): Promise; createPool( - token: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + token: string, + overrides?: Overrides & { from?: string } ): Promise; defaultTradingFeePPM(overrides?: CallOverrides): Promise; depositFor( - contextId: PromiseOrValue, - provider: PromiseOrValue, - pool: PromiseOrValue, - baseTokenAmount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + contextId: BytesLike, + provider: string, + pool: string, + baseTokenAmount: BigNumberish, + overrides?: Overrides & { from?: string } ): Promise; - depositingEnabled( - pool: PromiseOrValue, - overrides?: CallOverrides - ): Promise; + depositingEnabled(pool: string, overrides?: CallOverrides): Promise; disableTrading( - pool: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + pool: string, + overrides?: Overrides & { from?: string } + ): Promise; + + disableTradingByNetwork( + pool: string, + overrides?: Overrides & { from?: string } ): Promise; enableDepositing( - pool: PromiseOrValue, - status: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + pool: string, + status: boolean, + overrides?: Overrides & { from?: string } ): Promise; enableTrading( - pool: PromiseOrValue, - bntVirtualBalance: PromiseOrValue, - baseTokenVirtualBalance: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + pool: string, + bntVirtualBalance: BigNumberish, + baseTokenVirtualBalance: BigNumberish, + overrides?: Overrides & { from?: string } ): Promise; - isPoolStable( - pool: PromiseOrValue, - overrides?: CallOverrides - ): Promise; + isPoolStable(pool: string, overrides?: CallOverrides): Promise; - isPoolValid( - pool: PromiseOrValue, - overrides?: CallOverrides - ): Promise; + isPoolValid(pool: string, overrides?: CallOverrides): Promise; migratePoolIn( - pool: PromiseOrValue, + pool: string, data: PoolStruct, - overrides?: Overrides & { from?: PromiseOrValue } + overrides?: Overrides & { from?: string } ): Promise; migratePoolOut( - pool: PromiseOrValue, - targetPoolCollection: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + pool: string, + targetPoolCollection: string, + overrides?: Overrides & { from?: string } ): Promise; networkFeePPM(overrides?: CallOverrides): Promise; @@ -983,40 +922,34 @@ export interface PoolCollection extends BaseContract { newOwner(overrides?: CallOverrides): Promise; onFeesCollected( - pool: PromiseOrValue, - feeAmount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + pool: string, + feeAmount: BigNumberish, + overrides?: Overrides & { from?: string } ): Promise; owner(overrides?: CallOverrides): Promise; poolCount(overrides?: CallOverrides): Promise; - poolData( - pool: PromiseOrValue, - overrides?: CallOverrides - ): Promise; + poolData(pool: string, overrides?: CallOverrides): Promise; poolLiquidity( - pool: PromiseOrValue, + pool: string, overrides?: CallOverrides ): Promise; - poolToken( - pool: PromiseOrValue, - overrides?: CallOverrides - ): Promise; + poolToken(pool: string, overrides?: CallOverrides): Promise; poolTokenAmountToBurn( - pool: PromiseOrValue, - baseTokenAmountToDistribute: PromiseOrValue, - protocolPoolTokenAmount: PromiseOrValue, + pool: string, + baseTokenAmountToDistribute: BigNumberish, + protocolPoolTokenAmount: BigNumberish, overrides?: CallOverrides ): Promise; poolTokenToUnderlying( - pool: PromiseOrValue, - poolTokenAmount: PromiseOrValue, + pool: string, + poolTokenAmount: BigNumberish, overrides?: CallOverrides ): Promise; @@ -1025,158 +958,145 @@ export interface PoolCollection extends BaseContract { pools(overrides?: CallOverrides): Promise; setDefaultTradingFeePPM( - newDefaultTradingFeePPM: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + newDefaultTradingFeePPM: BigNumberish, + overrides?: Overrides & { from?: string } ): Promise; setNetworkFeePPM( - newNetworkFeePPM: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + newNetworkFeePPM: BigNumberish, + overrides?: Overrides & { from?: string } ): Promise; setTradingFeePPM( - pool: PromiseOrValue, - newTradingFeePPM: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + pool: string, + newTradingFeePPM: BigNumberish, + overrides?: Overrides & { from?: string } ): Promise; tradeBySourceAmount( - contextId: PromiseOrValue, - sourceToken: PromiseOrValue, - targetToken: PromiseOrValue, - sourceAmount: PromiseOrValue, - minReturnAmount: PromiseOrValue, - ignoreFees: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + contextId: BytesLike, + sourceToken: string, + targetToken: string, + sourceAmount: BigNumberish, + minReturnAmount: BigNumberish, + ignoreFees: boolean, + overrides?: Overrides & { from?: string } ): Promise; tradeByTargetAmount( - contextId: PromiseOrValue, - sourceToken: PromiseOrValue, - targetToken: PromiseOrValue, - targetAmount: PromiseOrValue, - maxSourceAmount: PromiseOrValue, - ignoreFees: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + contextId: BytesLike, + sourceToken: string, + targetToken: string, + targetAmount: BigNumberish, + maxSourceAmount: BigNumberish, + ignoreFees: boolean, + overrides?: Overrides & { from?: string } ): Promise; tradeInputAndFeeByTargetAmount( - sourceToken: PromiseOrValue, - targetToken: PromiseOrValue, - targetAmount: PromiseOrValue, + sourceToken: string, + targetToken: string, + targetAmount: BigNumberish, overrides?: CallOverrides ): Promise; tradeOutputAndFeeBySourceAmount( - sourceToken: PromiseOrValue, - targetToken: PromiseOrValue, - sourceAmount: PromiseOrValue, + sourceToken: string, + targetToken: string, + sourceAmount: BigNumberish, overrides?: CallOverrides ): Promise; - tradingEnabled( - pool: PromiseOrValue, - overrides?: CallOverrides - ): Promise; + tradingEnabled(pool: string, overrides?: CallOverrides): Promise; - tradingFeePPM( - pool: PromiseOrValue, - overrides?: CallOverrides - ): Promise; + tradingFeePPM(pool: string, overrides?: CallOverrides): Promise; transferOwnership( - ownerCandidate: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + ownerCandidate: string, + overrides?: Overrides & { from?: string } ): Promise; underlyingToPoolToken( - pool: PromiseOrValue, - baseTokenAmount: PromiseOrValue, + pool: string, + baseTokenAmount: BigNumberish, overrides?: CallOverrides ): Promise; updateTradingLiquidity( - pool: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + pool: string, + overrides?: Overrides & { from?: string } ): Promise; version(overrides?: CallOverrides): Promise; withdraw( - contextId: PromiseOrValue, - provider: PromiseOrValue, - pool: PromiseOrValue, - poolTokenAmount: PromiseOrValue, - baseTokenAmount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + contextId: BytesLike, + provider: string, + pool: string, + poolTokenAmount: BigNumberish, + baseTokenAmount: BigNumberish, + overrides?: Overrides & { from?: string } ): Promise; withdrawalAmounts( - pool: PromiseOrValue, - poolTokenAmount: PromiseOrValue, + pool: string, + poolTokenAmount: BigNumberish, overrides?: CallOverrides ): Promise; callStatic: { acceptOwnership(overrides?: CallOverrides): Promise; - createPool( - token: PromiseOrValue, - overrides?: CallOverrides - ): Promise; + createPool(token: string, overrides?: CallOverrides): Promise; defaultTradingFeePPM(overrides?: CallOverrides): Promise; depositFor( - contextId: PromiseOrValue, - provider: PromiseOrValue, - pool: PromiseOrValue, - baseTokenAmount: PromiseOrValue, + contextId: BytesLike, + provider: string, + pool: string, + baseTokenAmount: BigNumberish, overrides?: CallOverrides ): Promise; depositingEnabled( - pool: PromiseOrValue, + pool: string, overrides?: CallOverrides ): Promise; - disableTrading( - pool: PromiseOrValue, + disableTrading(pool: string, overrides?: CallOverrides): Promise; + + disableTradingByNetwork( + pool: string, overrides?: CallOverrides ): Promise; enableDepositing( - pool: PromiseOrValue, - status: PromiseOrValue, + pool: string, + status: boolean, overrides?: CallOverrides ): Promise; enableTrading( - pool: PromiseOrValue, - bntVirtualBalance: PromiseOrValue, - baseTokenVirtualBalance: PromiseOrValue, + pool: string, + bntVirtualBalance: BigNumberish, + baseTokenVirtualBalance: BigNumberish, overrides?: CallOverrides ): Promise; - isPoolStable( - pool: PromiseOrValue, - overrides?: CallOverrides - ): Promise; + isPoolStable(pool: string, overrides?: CallOverrides): Promise; - isPoolValid( - pool: PromiseOrValue, - overrides?: CallOverrides - ): Promise; + isPoolValid(pool: string, overrides?: CallOverrides): Promise; migratePoolIn( - pool: PromiseOrValue, + pool: string, data: PoolStruct, overrides?: CallOverrides ): Promise; migratePoolOut( - pool: PromiseOrValue, - targetPoolCollection: PromiseOrValue, + pool: string, + targetPoolCollection: string, overrides?: CallOverrides ): Promise; @@ -1185,8 +1105,8 @@ export interface PoolCollection extends BaseContract { newOwner(overrides?: CallOverrides): Promise; onFeesCollected( - pool: PromiseOrValue, - feeAmount: PromiseOrValue, + pool: string, + feeAmount: BigNumberish, overrides?: CallOverrides ): Promise; @@ -1195,30 +1115,27 @@ export interface PoolCollection extends BaseContract { poolCount(overrides?: CallOverrides): Promise; poolData( - pool: PromiseOrValue, + pool: string, overrides?: CallOverrides ): Promise; poolLiquidity( - pool: PromiseOrValue, + pool: string, overrides?: CallOverrides ): Promise; - poolToken( - pool: PromiseOrValue, - overrides?: CallOverrides - ): Promise; + poolToken(pool: string, overrides?: CallOverrides): Promise; poolTokenAmountToBurn( - pool: PromiseOrValue, - baseTokenAmountToDistribute: PromiseOrValue, - protocolPoolTokenAmount: PromiseOrValue, + pool: string, + baseTokenAmountToDistribute: BigNumberish, + protocolPoolTokenAmount: BigNumberish, overrides?: CallOverrides ): Promise; poolTokenToUnderlying( - pool: PromiseOrValue, - poolTokenAmount: PromiseOrValue, + pool: string, + poolTokenAmount: BigNumberish, overrides?: CallOverrides ): Promise; @@ -1227,95 +1144,89 @@ export interface PoolCollection extends BaseContract { pools(overrides?: CallOverrides): Promise; setDefaultTradingFeePPM( - newDefaultTradingFeePPM: PromiseOrValue, + newDefaultTradingFeePPM: BigNumberish, overrides?: CallOverrides ): Promise; setNetworkFeePPM( - newNetworkFeePPM: PromiseOrValue, + newNetworkFeePPM: BigNumberish, overrides?: CallOverrides ): Promise; setTradingFeePPM( - pool: PromiseOrValue, - newTradingFeePPM: PromiseOrValue, + pool: string, + newTradingFeePPM: BigNumberish, overrides?: CallOverrides ): Promise; tradeBySourceAmount( - contextId: PromiseOrValue, - sourceToken: PromiseOrValue, - targetToken: PromiseOrValue, - sourceAmount: PromiseOrValue, - minReturnAmount: PromiseOrValue, - ignoreFees: PromiseOrValue, + contextId: BytesLike, + sourceToken: string, + targetToken: string, + sourceAmount: BigNumberish, + minReturnAmount: BigNumberish, + ignoreFees: boolean, overrides?: CallOverrides ): Promise; tradeByTargetAmount( - contextId: PromiseOrValue, - sourceToken: PromiseOrValue, - targetToken: PromiseOrValue, - targetAmount: PromiseOrValue, - maxSourceAmount: PromiseOrValue, - ignoreFees: PromiseOrValue, + contextId: BytesLike, + sourceToken: string, + targetToken: string, + targetAmount: BigNumberish, + maxSourceAmount: BigNumberish, + ignoreFees: boolean, overrides?: CallOverrides ): Promise; tradeInputAndFeeByTargetAmount( - sourceToken: PromiseOrValue, - targetToken: PromiseOrValue, - targetAmount: PromiseOrValue, + sourceToken: string, + targetToken: string, + targetAmount: BigNumberish, overrides?: CallOverrides ): Promise; tradeOutputAndFeeBySourceAmount( - sourceToken: PromiseOrValue, - targetToken: PromiseOrValue, - sourceAmount: PromiseOrValue, + sourceToken: string, + targetToken: string, + sourceAmount: BigNumberish, overrides?: CallOverrides ): Promise; - tradingEnabled( - pool: PromiseOrValue, - overrides?: CallOverrides - ): Promise; + tradingEnabled(pool: string, overrides?: CallOverrides): Promise; - tradingFeePPM( - pool: PromiseOrValue, - overrides?: CallOverrides - ): Promise; + tradingFeePPM(pool: string, overrides?: CallOverrides): Promise; transferOwnership( - ownerCandidate: PromiseOrValue, + ownerCandidate: string, overrides?: CallOverrides ): Promise; underlyingToPoolToken( - pool: PromiseOrValue, - baseTokenAmount: PromiseOrValue, + pool: string, + baseTokenAmount: BigNumberish, overrides?: CallOverrides ): Promise; updateTradingLiquidity( - pool: PromiseOrValue, + pool: string, overrides?: CallOverrides ): Promise; version(overrides?: CallOverrides): Promise; withdraw( - contextId: PromiseOrValue, - provider: PromiseOrValue, - pool: PromiseOrValue, - poolTokenAmount: PromiseOrValue, - baseTokenAmount: PromiseOrValue, + contextId: BytesLike, + provider: string, + pool: string, + poolTokenAmount: BigNumberish, + baseTokenAmount: BigNumberish, overrides?: CallOverrides ): Promise; withdrawalAmounts( - pool: PromiseOrValue, - poolTokenAmount: PromiseOrValue, + pool: string, + poolTokenAmount: BigNumberish, overrides?: CallOverrides ): Promise; }; @@ -1331,12 +1242,12 @@ export interface PoolCollection extends BaseContract { ): DefaultTradingFeePPMUpdatedEventFilter; "DepositingEnabled(address,bool)"( - pool?: PromiseOrValue | null, - newStatus?: PromiseOrValue | null + pool?: string | null, + newStatus?: boolean | null ): DepositingEnabledEventFilter; DepositingEnabled( - pool?: PromiseOrValue | null, - newStatus?: PromiseOrValue | null + pool?: string | null, + newStatus?: boolean | null ): DepositingEnabledEventFilter; "NetworkFeePPMUpdated(uint32,uint32)"( @@ -1349,33 +1260,33 @@ export interface PoolCollection extends BaseContract { ): NetworkFeePPMUpdatedEventFilter; "OwnerUpdate(address,address)"( - prevOwner?: PromiseOrValue | null, - newOwner?: PromiseOrValue | null + prevOwner?: string | null, + newOwner?: string | null ): OwnerUpdateEventFilter; OwnerUpdate( - prevOwner?: PromiseOrValue | null, - newOwner?: PromiseOrValue | null + prevOwner?: string | null, + newOwner?: string | null ): OwnerUpdateEventFilter; "TokensDeposited(bytes32,address,address,uint256,uint256)"( - contextId?: PromiseOrValue | null, - provider?: PromiseOrValue | null, - token?: PromiseOrValue | null, + contextId?: BytesLike | null, + provider?: string | null, + token?: string | null, baseTokenAmount?: null, poolTokenAmount?: null ): TokensDepositedEventFilter; TokensDeposited( - contextId?: PromiseOrValue | null, - provider?: PromiseOrValue | null, - token?: PromiseOrValue | null, + contextId?: BytesLike | null, + provider?: string | null, + token?: string | null, baseTokenAmount?: null, poolTokenAmount?: null ): TokensDepositedEventFilter; "TokensWithdrawn(bytes32,address,address,uint256,uint256,uint256,uint256,uint256)"( - contextId?: PromiseOrValue | null, - provider?: PromiseOrValue | null, - token?: PromiseOrValue | null, + contextId?: BytesLike | null, + provider?: string | null, + token?: string | null, baseTokenAmount?: null, poolTokenAmount?: null, externalProtectionBaseTokenAmount?: null, @@ -1383,9 +1294,9 @@ export interface PoolCollection extends BaseContract { withdrawalFeeAmount?: null ): TokensWithdrawnEventFilter; TokensWithdrawn( - contextId?: PromiseOrValue | null, - provider?: PromiseOrValue | null, - token?: PromiseOrValue | null, + contextId?: BytesLike | null, + provider?: string | null, + token?: string | null, baseTokenAmount?: null, poolTokenAmount?: null, externalProtectionBaseTokenAmount?: null, @@ -1394,53 +1305,53 @@ export interface PoolCollection extends BaseContract { ): TokensWithdrawnEventFilter; "TotalLiquidityUpdated(bytes32,address,uint256,uint256,uint256)"( - contextId?: PromiseOrValue | null, - pool?: PromiseOrValue | null, + contextId?: BytesLike | null, + pool?: string | null, liquidity?: null, stakedBalance?: null, poolTokenSupply?: null ): TotalLiquidityUpdatedEventFilter; TotalLiquidityUpdated( - contextId?: PromiseOrValue | null, - pool?: PromiseOrValue | null, + contextId?: BytesLike | null, + pool?: string | null, liquidity?: null, stakedBalance?: null, poolTokenSupply?: null ): TotalLiquidityUpdatedEventFilter; "TradingEnabled(address,bool,uint8)"( - pool?: PromiseOrValue | null, - newStatus?: PromiseOrValue | null, - reason?: PromiseOrValue | null + pool?: string | null, + newStatus?: boolean | null, + reason?: BigNumberish | null ): TradingEnabledEventFilter; TradingEnabled( - pool?: PromiseOrValue | null, - newStatus?: PromiseOrValue | null, - reason?: PromiseOrValue | null + pool?: string | null, + newStatus?: boolean | null, + reason?: BigNumberish | null ): TradingEnabledEventFilter; "TradingFeePPMUpdated(address,uint32,uint32)"( - pool?: PromiseOrValue | null, + pool?: string | null, prevFeePPM?: null, newFeePPM?: null ): TradingFeePPMUpdatedEventFilter; TradingFeePPMUpdated( - pool?: PromiseOrValue | null, + pool?: string | null, prevFeePPM?: null, newFeePPM?: null ): TradingFeePPMUpdatedEventFilter; "TradingLiquidityUpdated(bytes32,address,address,uint256,uint256)"( - contextId?: PromiseOrValue | null, - pool?: PromiseOrValue | null, - token?: PromiseOrValue | null, + contextId?: BytesLike | null, + pool?: string | null, + token?: string | null, prevLiquidity?: null, newLiquidity?: null ): TradingLiquidityUpdatedEventFilter; TradingLiquidityUpdated( - contextId?: PromiseOrValue | null, - pool?: PromiseOrValue | null, - token?: PromiseOrValue | null, + contextId?: BytesLike | null, + pool?: string | null, + token?: string | null, prevLiquidity?: null, newLiquidity?: null ): TradingLiquidityUpdatedEventFilter; @@ -1448,67 +1359,66 @@ export interface PoolCollection extends BaseContract { estimateGas: { acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } + overrides?: Overrides & { from?: string } ): Promise; createPool( - token: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + token: string, + overrides?: Overrides & { from?: string } ): Promise; defaultTradingFeePPM(overrides?: CallOverrides): Promise; depositFor( - contextId: PromiseOrValue, - provider: PromiseOrValue, - pool: PromiseOrValue, - baseTokenAmount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + contextId: BytesLike, + provider: string, + pool: string, + baseTokenAmount: BigNumberish, + overrides?: Overrides & { from?: string } ): Promise; depositingEnabled( - pool: PromiseOrValue, + pool: string, overrides?: CallOverrides ): Promise; disableTrading( - pool: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + pool: string, + overrides?: Overrides & { from?: string } + ): Promise; + + disableTradingByNetwork( + pool: string, + overrides?: Overrides & { from?: string } ): Promise; enableDepositing( - pool: PromiseOrValue, - status: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + pool: string, + status: boolean, + overrides?: Overrides & { from?: string } ): Promise; enableTrading( - pool: PromiseOrValue, - bntVirtualBalance: PromiseOrValue, - baseTokenVirtualBalance: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + pool: string, + bntVirtualBalance: BigNumberish, + baseTokenVirtualBalance: BigNumberish, + overrides?: Overrides & { from?: string } ): Promise; - isPoolStable( - pool: PromiseOrValue, - overrides?: CallOverrides - ): Promise; + isPoolStable(pool: string, overrides?: CallOverrides): Promise; - isPoolValid( - pool: PromiseOrValue, - overrides?: CallOverrides - ): Promise; + isPoolValid(pool: string, overrides?: CallOverrides): Promise; migratePoolIn( - pool: PromiseOrValue, + pool: string, data: PoolStruct, - overrides?: Overrides & { from?: PromiseOrValue } + overrides?: Overrides & { from?: string } ): Promise; migratePoolOut( - pool: PromiseOrValue, - targetPoolCollection: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + pool: string, + targetPoolCollection: string, + overrides?: Overrides & { from?: string } ): Promise; networkFeePPM(overrides?: CallOverrides): Promise; @@ -1516,40 +1426,31 @@ export interface PoolCollection extends BaseContract { newOwner(overrides?: CallOverrides): Promise; onFeesCollected( - pool: PromiseOrValue, - feeAmount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + pool: string, + feeAmount: BigNumberish, + overrides?: Overrides & { from?: string } ): Promise; owner(overrides?: CallOverrides): Promise; poolCount(overrides?: CallOverrides): Promise; - poolData( - pool: PromiseOrValue, - overrides?: CallOverrides - ): Promise; + poolData(pool: string, overrides?: CallOverrides): Promise; - poolLiquidity( - pool: PromiseOrValue, - overrides?: CallOverrides - ): Promise; + poolLiquidity(pool: string, overrides?: CallOverrides): Promise; - poolToken( - pool: PromiseOrValue, - overrides?: CallOverrides - ): Promise; + poolToken(pool: string, overrides?: CallOverrides): Promise; poolTokenAmountToBurn( - pool: PromiseOrValue, - baseTokenAmountToDistribute: PromiseOrValue, - protocolPoolTokenAmount: PromiseOrValue, + pool: string, + baseTokenAmountToDistribute: BigNumberish, + protocolPoolTokenAmount: BigNumberish, overrides?: CallOverrides ): Promise; poolTokenToUnderlying( - pool: PromiseOrValue, - poolTokenAmount: PromiseOrValue, + pool: string, + poolTokenAmount: BigNumberish, overrides?: CallOverrides ): Promise; @@ -1558,107 +1459,101 @@ export interface PoolCollection extends BaseContract { pools(overrides?: CallOverrides): Promise; setDefaultTradingFeePPM( - newDefaultTradingFeePPM: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + newDefaultTradingFeePPM: BigNumberish, + overrides?: Overrides & { from?: string } ): Promise; setNetworkFeePPM( - newNetworkFeePPM: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + newNetworkFeePPM: BigNumberish, + overrides?: Overrides & { from?: string } ): Promise; setTradingFeePPM( - pool: PromiseOrValue, - newTradingFeePPM: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + pool: string, + newTradingFeePPM: BigNumberish, + overrides?: Overrides & { from?: string } ): Promise; tradeBySourceAmount( - contextId: PromiseOrValue, - sourceToken: PromiseOrValue, - targetToken: PromiseOrValue, - sourceAmount: PromiseOrValue, - minReturnAmount: PromiseOrValue, - ignoreFees: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + contextId: BytesLike, + sourceToken: string, + targetToken: string, + sourceAmount: BigNumberish, + minReturnAmount: BigNumberish, + ignoreFees: boolean, + overrides?: Overrides & { from?: string } ): Promise; tradeByTargetAmount( - contextId: PromiseOrValue, - sourceToken: PromiseOrValue, - targetToken: PromiseOrValue, - targetAmount: PromiseOrValue, - maxSourceAmount: PromiseOrValue, - ignoreFees: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + contextId: BytesLike, + sourceToken: string, + targetToken: string, + targetAmount: BigNumberish, + maxSourceAmount: BigNumberish, + ignoreFees: boolean, + overrides?: Overrides & { from?: string } ): Promise; tradeInputAndFeeByTargetAmount( - sourceToken: PromiseOrValue, - targetToken: PromiseOrValue, - targetAmount: PromiseOrValue, + sourceToken: string, + targetToken: string, + targetAmount: BigNumberish, overrides?: CallOverrides ): Promise; tradeOutputAndFeeBySourceAmount( - sourceToken: PromiseOrValue, - targetToken: PromiseOrValue, - sourceAmount: PromiseOrValue, + sourceToken: string, + targetToken: string, + sourceAmount: BigNumberish, overrides?: CallOverrides ): Promise; - tradingEnabled( - pool: PromiseOrValue, - overrides?: CallOverrides - ): Promise; + tradingEnabled(pool: string, overrides?: CallOverrides): Promise; - tradingFeePPM( - pool: PromiseOrValue, - overrides?: CallOverrides - ): Promise; + tradingFeePPM(pool: string, overrides?: CallOverrides): Promise; transferOwnership( - ownerCandidate: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + ownerCandidate: string, + overrides?: Overrides & { from?: string } ): Promise; underlyingToPoolToken( - pool: PromiseOrValue, - baseTokenAmount: PromiseOrValue, + pool: string, + baseTokenAmount: BigNumberish, overrides?: CallOverrides ): Promise; updateTradingLiquidity( - pool: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + pool: string, + overrides?: Overrides & { from?: string } ): Promise; version(overrides?: CallOverrides): Promise; withdraw( - contextId: PromiseOrValue, - provider: PromiseOrValue, - pool: PromiseOrValue, - poolTokenAmount: PromiseOrValue, - baseTokenAmount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + contextId: BytesLike, + provider: string, + pool: string, + poolTokenAmount: BigNumberish, + baseTokenAmount: BigNumberish, + overrides?: Overrides & { from?: string } ): Promise; withdrawalAmounts( - pool: PromiseOrValue, - poolTokenAmount: PromiseOrValue, + pool: string, + poolTokenAmount: BigNumberish, overrides?: CallOverrides ): Promise; }; populateTransaction: { acceptOwnership( - overrides?: Overrides & { from?: PromiseOrValue } + overrides?: Overrides & { from?: string } ): Promise; createPool( - token: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + token: string, + overrides?: Overrides & { from?: string } ): Promise; defaultTradingFeePPM( @@ -1666,56 +1561,61 @@ export interface PoolCollection extends BaseContract { ): Promise; depositFor( - contextId: PromiseOrValue, - provider: PromiseOrValue, - pool: PromiseOrValue, - baseTokenAmount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + contextId: BytesLike, + provider: string, + pool: string, + baseTokenAmount: BigNumberish, + overrides?: Overrides & { from?: string } ): Promise; depositingEnabled( - pool: PromiseOrValue, + pool: string, overrides?: CallOverrides ): Promise; disableTrading( - pool: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + pool: string, + overrides?: Overrides & { from?: string } + ): Promise; + + disableTradingByNetwork( + pool: string, + overrides?: Overrides & { from?: string } ): Promise; enableDepositing( - pool: PromiseOrValue, - status: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + pool: string, + status: boolean, + overrides?: Overrides & { from?: string } ): Promise; enableTrading( - pool: PromiseOrValue, - bntVirtualBalance: PromiseOrValue, - baseTokenVirtualBalance: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + pool: string, + bntVirtualBalance: BigNumberish, + baseTokenVirtualBalance: BigNumberish, + overrides?: Overrides & { from?: string } ): Promise; isPoolStable( - pool: PromiseOrValue, + pool: string, overrides?: CallOverrides ): Promise; isPoolValid( - pool: PromiseOrValue, + pool: string, overrides?: CallOverrides ): Promise; migratePoolIn( - pool: PromiseOrValue, + pool: string, data: PoolStruct, - overrides?: Overrides & { from?: PromiseOrValue } + overrides?: Overrides & { from?: string } ): Promise; migratePoolOut( - pool: PromiseOrValue, - targetPoolCollection: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + pool: string, + targetPoolCollection: string, + overrides?: Overrides & { from?: string } ): Promise; networkFeePPM(overrides?: CallOverrides): Promise; @@ -1723,9 +1623,9 @@ export interface PoolCollection extends BaseContract { newOwner(overrides?: CallOverrides): Promise; onFeesCollected( - pool: PromiseOrValue, - feeAmount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + pool: string, + feeAmount: BigNumberish, + overrides?: Overrides & { from?: string } ): Promise; owner(overrides?: CallOverrides): Promise; @@ -1733,30 +1633,30 @@ export interface PoolCollection extends BaseContract { poolCount(overrides?: CallOverrides): Promise; poolData( - pool: PromiseOrValue, + pool: string, overrides?: CallOverrides ): Promise; poolLiquidity( - pool: PromiseOrValue, + pool: string, overrides?: CallOverrides ): Promise; poolToken( - pool: PromiseOrValue, + pool: string, overrides?: CallOverrides ): Promise; poolTokenAmountToBurn( - pool: PromiseOrValue, - baseTokenAmountToDistribute: PromiseOrValue, - protocolPoolTokenAmount: PromiseOrValue, + pool: string, + baseTokenAmountToDistribute: BigNumberish, + protocolPoolTokenAmount: BigNumberish, overrides?: CallOverrides ): Promise; poolTokenToUnderlying( - pool: PromiseOrValue, - poolTokenAmount: PromiseOrValue, + pool: string, + poolTokenAmount: BigNumberish, overrides?: CallOverrides ): Promise; @@ -1765,95 +1665,95 @@ export interface PoolCollection extends BaseContract { pools(overrides?: CallOverrides): Promise; setDefaultTradingFeePPM( - newDefaultTradingFeePPM: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + newDefaultTradingFeePPM: BigNumberish, + overrides?: Overrides & { from?: string } ): Promise; setNetworkFeePPM( - newNetworkFeePPM: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + newNetworkFeePPM: BigNumberish, + overrides?: Overrides & { from?: string } ): Promise; setTradingFeePPM( - pool: PromiseOrValue, - newTradingFeePPM: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + pool: string, + newTradingFeePPM: BigNumberish, + overrides?: Overrides & { from?: string } ): Promise; tradeBySourceAmount( - contextId: PromiseOrValue, - sourceToken: PromiseOrValue, - targetToken: PromiseOrValue, - sourceAmount: PromiseOrValue, - minReturnAmount: PromiseOrValue, - ignoreFees: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + contextId: BytesLike, + sourceToken: string, + targetToken: string, + sourceAmount: BigNumberish, + minReturnAmount: BigNumberish, + ignoreFees: boolean, + overrides?: Overrides & { from?: string } ): Promise; tradeByTargetAmount( - contextId: PromiseOrValue, - sourceToken: PromiseOrValue, - targetToken: PromiseOrValue, - targetAmount: PromiseOrValue, - maxSourceAmount: PromiseOrValue, - ignoreFees: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + contextId: BytesLike, + sourceToken: string, + targetToken: string, + targetAmount: BigNumberish, + maxSourceAmount: BigNumberish, + ignoreFees: boolean, + overrides?: Overrides & { from?: string } ): Promise; tradeInputAndFeeByTargetAmount( - sourceToken: PromiseOrValue, - targetToken: PromiseOrValue, - targetAmount: PromiseOrValue, + sourceToken: string, + targetToken: string, + targetAmount: BigNumberish, overrides?: CallOverrides ): Promise; tradeOutputAndFeeBySourceAmount( - sourceToken: PromiseOrValue, - targetToken: PromiseOrValue, - sourceAmount: PromiseOrValue, + sourceToken: string, + targetToken: string, + sourceAmount: BigNumberish, overrides?: CallOverrides ): Promise; tradingEnabled( - pool: PromiseOrValue, + pool: string, overrides?: CallOverrides ): Promise; tradingFeePPM( - pool: PromiseOrValue, + pool: string, overrides?: CallOverrides ): Promise; transferOwnership( - ownerCandidate: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + ownerCandidate: string, + overrides?: Overrides & { from?: string } ): Promise; underlyingToPoolToken( - pool: PromiseOrValue, - baseTokenAmount: PromiseOrValue, + pool: string, + baseTokenAmount: BigNumberish, overrides?: CallOverrides ): Promise; updateTradingLiquidity( - pool: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + pool: string, + overrides?: Overrides & { from?: string } ): Promise; version(overrides?: CallOverrides): Promise; withdraw( - contextId: PromiseOrValue, - provider: PromiseOrValue, - pool: PromiseOrValue, - poolTokenAmount: PromiseOrValue, - baseTokenAmount: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } + contextId: BytesLike, + provider: string, + pool: string, + poolTokenAmount: BigNumberish, + baseTokenAmount: BigNumberish, + overrides?: Overrides & { from?: string } ): Promise; withdrawalAmounts( - pool: PromiseOrValue, - poolTokenAmount: PromiseOrValue, + pool: string, + poolTokenAmount: BigNumberish, overrides?: CallOverrides ): Promise; }; diff --git a/deployments/mainnet/types/factories/contracts/pools/PoolCollectionType1V12__factory.ts b/deployments/mainnet/types/factories/contracts/pools/PoolCollectionType1V12__factory.ts index c8781b523..da09b27db 100644 --- a/deployments/mainnet/types/factories/contracts/pools/PoolCollectionType1V12__factory.ts +++ b/deployments/mainnet/types/factories/contracts/pools/PoolCollectionType1V12__factory.ts @@ -3,1594 +3,1615 @@ /* tslint:disable */ /* eslint-disable */ -import type { PromiseOrValue } from '../../../common'; -import type { PoolCollection, PoolCollectionInterface } from '../../../contracts/pools/PoolCollectionType1V12'; -import type { Provider, TransactionRequest } from '@ethersproject/providers'; -import { Contract, ContractFactory, Overrides, Signer, utils } from 'ethers'; +import type { + PoolCollection, + PoolCollectionInterface, +} from "../../../contracts/pools/PoolCollection"; +import type { Provider, TransactionRequest } from "@ethersproject/providers"; +import { Signer, utils, Contract, ContractFactory, Overrides } from "ethers"; const _abi = [ - { - inputs: [ - { - internalType: 'contract IBancorNetwork', - name: 'initNetwork', - type: 'address' - }, - { - internalType: 'contract IERC20', - name: 'initBNT', - type: 'address' - }, - { - internalType: 'contract INetworkSettings', - name: 'initNetworkSettings', - type: 'address' - }, - { - internalType: 'contract IMasterVault', - name: 'initMasterVault', - type: 'address' - }, - { - internalType: 'contract IBNTPool', - name: 'initBNTPool', - type: 'address' - }, - { - internalType: 'contract IExternalProtectionVault', - name: 'initExternalProtectionVault', - type: 'address' - }, - { - internalType: 'contract IPoolTokenFactory', - name: 'initPoolTokenFactory', - type: 'address' - }, - { - internalType: 'contract IPoolMigrator', - name: 'initPoolMigrator', - type: 'address' - } - ], - stateMutability: 'nonpayable', - type: 'constructor' - }, - { - inputs: [], - name: 'AccessDenied', - type: 'error' - }, - { - inputs: [], - name: 'AlreadyEnabled', - type: 'error' - }, - { - inputs: [], - name: 'AlreadyExists', - type: 'error' - }, - { - inputs: [], - name: 'DepositingDisabled', - type: 'error' - }, - { - inputs: [], - name: 'DoesNotExist', - type: 'error' - }, - { - inputs: [], - name: 'FundingLimitTooHigh', - type: 'error' - }, - { - inputs: [], - name: 'InsufficientLiquidity', - type: 'error' - }, - { - inputs: [], - name: 'InsufficientSourceAmount', - type: 'error' - }, - { - inputs: [], - name: 'InsufficientTargetAmount', - type: 'error' - }, - { - inputs: [], - name: 'InvalidAddress', - type: 'error' - }, - { - inputs: [], - name: 'InvalidFee', - type: 'error' - }, - { - inputs: [], - name: 'InvalidFraction', - type: 'error' - }, - { - inputs: [], - name: 'InvalidParam', - type: 'error' - }, - { - inputs: [], - name: 'InvalidRate', - type: 'error' - }, - { - inputs: [], - name: 'InvalidStakedBalance', - type: 'error' - }, - { - inputs: [], - name: 'NotWhitelisted', - type: 'error' - }, - { - inputs: [], - name: 'Overflow', - type: 'error' - }, - { - inputs: [], - name: 'PoolCollectionWithdrawalInputInvalid', - type: 'error' - }, - { - inputs: [], - name: 'RateUnstable', - type: 'error' - }, - { - inputs: [], - name: 'SameOwner', - type: 'error' - }, - { - inputs: [], - name: 'TradingDisabled', - type: 'error' - }, - { - inputs: [], - name: 'ZeroValue', - type: 'error' - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint32', - name: 'prevFeePPM', - type: 'uint32' - }, - { - indexed: false, - internalType: 'uint32', - name: 'newFeePPM', - type: 'uint32' - } - ], - name: 'DefaultTradingFeePPMUpdated', - type: 'event' - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'contract Token', - name: 'pool', - type: 'address' - }, - { - indexed: true, - internalType: 'bool', - name: 'newStatus', - type: 'bool' - } - ], - name: 'DepositingEnabled', - type: 'event' - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint32', - name: 'prevFeePPM', - type: 'uint32' - }, - { - indexed: false, - internalType: 'uint32', - name: 'newFeePPM', - type: 'uint32' - } - ], - name: 'NetworkFeePPMUpdated', - type: 'event' - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'prevOwner', - type: 'address' - }, - { - indexed: true, - internalType: 'address', - name: 'newOwner', - type: 'address' - } - ], - name: 'OwnerUpdate', - type: 'event' - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'bytes32', - name: 'contextId', - type: 'bytes32' - }, - { - indexed: true, - internalType: 'address', - name: 'provider', - type: 'address' - }, - { - indexed: true, - internalType: 'contract Token', - name: 'token', - type: 'address' - }, - { - indexed: false, - internalType: 'uint256', - name: 'baseTokenAmount', - type: 'uint256' - }, - { - indexed: false, - internalType: 'uint256', - name: 'poolTokenAmount', - type: 'uint256' - } - ], - name: 'TokensDeposited', - type: 'event' - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'bytes32', - name: 'contextId', - type: 'bytes32' - }, - { - indexed: true, - internalType: 'address', - name: 'provider', - type: 'address' - }, - { - indexed: true, - internalType: 'contract Token', - name: 'token', - type: 'address' - }, - { - indexed: false, - internalType: 'uint256', - name: 'baseTokenAmount', - type: 'uint256' - }, - { - indexed: false, - internalType: 'uint256', - name: 'poolTokenAmount', - type: 'uint256' - }, - { - indexed: false, - internalType: 'uint256', - name: 'externalProtectionBaseTokenAmount', - type: 'uint256' - }, - { - indexed: false, - internalType: 'uint256', - name: 'bntAmount', - type: 'uint256' - }, - { - indexed: false, - internalType: 'uint256', - name: 'withdrawalFeeAmount', - type: 'uint256' - } - ], - name: 'TokensWithdrawn', - type: 'event' - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'bytes32', - name: 'contextId', - type: 'bytes32' - }, - { - indexed: true, - internalType: 'contract Token', - name: 'pool', - type: 'address' - }, - { - indexed: false, - internalType: 'uint256', - name: 'liquidity', - type: 'uint256' - }, - { - indexed: false, - internalType: 'uint256', - name: 'stakedBalance', - type: 'uint256' - }, - { - indexed: false, - internalType: 'uint256', - name: 'poolTokenSupply', - type: 'uint256' - } - ], - name: 'TotalLiquidityUpdated', - type: 'event' - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'contract Token', - name: 'pool', - type: 'address' - }, - { - indexed: true, - internalType: 'bool', - name: 'newStatus', - type: 'bool' - }, - { - indexed: true, - internalType: 'uint8', - name: 'reason', - type: 'uint8' - } - ], - name: 'TradingEnabled', - type: 'event' - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'contract Token', - name: 'pool', - type: 'address' - }, - { - indexed: false, - internalType: 'uint32', - name: 'prevFeePPM', - type: 'uint32' - }, - { - indexed: false, - internalType: 'uint32', - name: 'newFeePPM', - type: 'uint32' - } - ], - name: 'TradingFeePPMUpdated', - type: 'event' - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'bytes32', - name: 'contextId', - type: 'bytes32' - }, - { - indexed: true, - internalType: 'contract Token', - name: 'pool', - type: 'address' - }, - { - indexed: true, - internalType: 'contract Token', - name: 'token', - type: 'address' - }, - { - indexed: false, - internalType: 'uint256', - name: 'prevLiquidity', - type: 'uint256' - }, - { - indexed: false, - internalType: 'uint256', - name: 'newLiquidity', - type: 'uint256' - } - ], - name: 'TradingLiquidityUpdated', - type: 'event' - }, - { - inputs: [], - name: 'acceptOwnership', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'contract Token', - name: 'token', - type: 'address' - } - ], - name: 'createPool', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [], - name: 'defaultTradingFeePPM', - outputs: [ - { - internalType: 'uint32', - name: '', - type: 'uint32' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'contextId', - type: 'bytes32' - }, - { - internalType: 'address', - name: 'provider', - type: 'address' - }, - { - internalType: 'contract Token', - name: 'pool', - type: 'address' - }, - { - internalType: 'uint256', - name: 'baseTokenAmount', - type: 'uint256' - } - ], - name: 'depositFor', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256' - } - ], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'contract Token', - name: 'pool', - type: 'address' - } - ], - name: 'depositingEnabled', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [ - { - internalType: 'contract Token', - name: 'pool', - type: 'address' - } - ], - name: 'disableTrading', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'contract Token', - name: 'pool', - type: 'address' - }, - { - internalType: 'bool', - name: 'status', - type: 'bool' - } - ], - name: 'enableDepositing', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'contract Token', - name: 'pool', - type: 'address' - }, - { - internalType: 'uint256', - name: 'bntVirtualBalance', - type: 'uint256' - }, - { - internalType: 'uint256', - name: 'baseTokenVirtualBalance', - type: 'uint256' - } - ], - name: 'enableTrading', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'contract Token', - name: 'pool', - type: 'address' - } - ], - name: 'isPoolStable', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [ - { - internalType: 'contract Token', - name: 'pool', - type: 'address' - } - ], - name: 'isPoolValid', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [ - { - internalType: 'contract Token', - name: 'pool', - type: 'address' - }, - { - components: [ - { - internalType: 'contract IPoolToken', - name: 'poolToken', - type: 'address' - }, - { - internalType: 'uint32', - name: 'tradingFeePPM', - type: 'uint32' - }, - { - internalType: 'bool', - name: 'tradingEnabled', - type: 'bool' - }, - { - internalType: 'bool', - name: 'depositingEnabled', - type: 'bool' - }, - { - components: [ - { - internalType: 'uint32', - name: 'blockNumber', - type: 'uint32' - }, - { - components: [ - { - internalType: 'uint112', - name: 'n', - type: 'uint112' - }, - { - internalType: 'uint112', - name: 'd', - type: 'uint112' - } - ], - internalType: 'struct Fraction112', - name: 'rate', - type: 'tuple' - }, - { - components: [ - { - internalType: 'uint112', - name: 'n', - type: 'uint112' - }, - { - internalType: 'uint112', - name: 'd', - type: 'uint112' - } - ], - internalType: 'struct Fraction112', - name: 'invRate', - type: 'tuple' - } - ], - internalType: 'struct AverageRates', - name: 'averageRates', - type: 'tuple' - }, - { - components: [ - { - internalType: 'uint128', - name: 'bntTradingLiquidity', - type: 'uint128' - }, - { - internalType: 'uint128', - name: 'baseTokenTradingLiquidity', - type: 'uint128' - }, - { - internalType: 'uint256', - name: 'stakedBalance', - type: 'uint256' - } - ], - internalType: 'struct PoolLiquidity', - name: 'liquidity', - type: 'tuple' - } - ], - internalType: 'struct Pool', - name: 'data', - type: 'tuple' - } - ], - name: 'migratePoolIn', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'contract Token', - name: 'pool', - type: 'address' - }, - { - internalType: 'contract IPoolCollection', - name: 'targetPoolCollection', - type: 'address' - } - ], - name: 'migratePoolOut', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [], - name: 'networkFeePPM', - outputs: [ - { - internalType: 'uint32', - name: '', - type: 'uint32' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'newOwner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [ - { - internalType: 'contract Token', - name: 'pool', - type: 'address' - }, - { - internalType: 'uint256', - name: 'feeAmount', - type: 'uint256' - } - ], - name: 'onFeesCollected', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [], - name: 'owner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'poolCount', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [ - { - internalType: 'contract Token', - name: 'pool', - type: 'address' - } - ], - name: 'poolData', - outputs: [ - { - components: [ - { - internalType: 'contract IPoolToken', - name: 'poolToken', - type: 'address' - }, - { - internalType: 'uint32', - name: 'tradingFeePPM', - type: 'uint32' - }, - { - internalType: 'bool', - name: 'tradingEnabled', - type: 'bool' - }, - { - internalType: 'bool', - name: 'depositingEnabled', - type: 'bool' - }, - { - components: [ - { - internalType: 'uint32', - name: 'blockNumber', - type: 'uint32' - }, - { - components: [ - { - internalType: 'uint112', - name: 'n', - type: 'uint112' - }, - { - internalType: 'uint112', - name: 'd', - type: 'uint112' - } - ], - internalType: 'struct Fraction112', - name: 'rate', - type: 'tuple' - }, - { - components: [ - { - internalType: 'uint112', - name: 'n', - type: 'uint112' - }, - { - internalType: 'uint112', - name: 'd', - type: 'uint112' - } - ], - internalType: 'struct Fraction112', - name: 'invRate', - type: 'tuple' - } - ], - internalType: 'struct AverageRates', - name: 'averageRates', - type: 'tuple' - }, - { - components: [ - { - internalType: 'uint128', - name: 'bntTradingLiquidity', - type: 'uint128' - }, - { - internalType: 'uint128', - name: 'baseTokenTradingLiquidity', - type: 'uint128' - }, - { - internalType: 'uint256', - name: 'stakedBalance', - type: 'uint256' - } - ], - internalType: 'struct PoolLiquidity', - name: 'liquidity', - type: 'tuple' - } - ], - internalType: 'struct Pool', - name: '', - type: 'tuple' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [ - { - internalType: 'contract Token', - name: 'pool', - type: 'address' - } - ], - name: 'poolLiquidity', - outputs: [ - { - components: [ - { - internalType: 'uint128', - name: 'bntTradingLiquidity', - type: 'uint128' - }, - { - internalType: 'uint128', - name: 'baseTokenTradingLiquidity', - type: 'uint128' - }, - { - internalType: 'uint256', - name: 'stakedBalance', - type: 'uint256' - } - ], - internalType: 'struct PoolLiquidity', - name: '', - type: 'tuple' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [ - { - internalType: 'contract Token', - name: 'pool', - type: 'address' - } - ], - name: 'poolToken', - outputs: [ - { - internalType: 'contract IPoolToken', - name: '', - type: 'address' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [ - { - internalType: 'contract Token', - name: 'pool', - type: 'address' - }, - { - internalType: 'uint256', - name: 'baseTokenAmountToDistribute', - type: 'uint256' - }, - { - internalType: 'uint256', - name: 'protocolPoolTokenAmount', - type: 'uint256' - } - ], - name: 'poolTokenAmountToBurn', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [ - { - internalType: 'contract Token', - name: 'pool', - type: 'address' - }, - { - internalType: 'uint256', - name: 'poolTokenAmount', - type: 'uint256' - } - ], - name: 'poolTokenToUnderlying', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'poolType', - outputs: [ - { - internalType: 'uint16', - name: '', - type: 'uint16' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'pools', - outputs: [ - { - internalType: 'contract Token[]', - name: '', - type: 'address[]' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [ - { - internalType: 'uint32', - name: 'newDefaultTradingFeePPM', - type: 'uint32' - } - ], - name: 'setDefaultTradingFeePPM', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'uint32', - name: 'newNetworkFeePPM', - type: 'uint32' - } - ], - name: 'setNetworkFeePPM', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'contract Token', - name: 'pool', - type: 'address' - }, - { - internalType: 'uint32', - name: 'newTradingFeePPM', - type: 'uint32' - } - ], - name: 'setTradingFeePPM', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'contextId', - type: 'bytes32' - }, - { - internalType: 'contract Token', - name: 'sourceToken', - type: 'address' - }, - { - internalType: 'contract Token', - name: 'targetToken', - type: 'address' - }, - { - internalType: 'uint256', - name: 'sourceAmount', - type: 'uint256' - }, - { - internalType: 'uint256', - name: 'minReturnAmount', - type: 'uint256' - }, - { - internalType: 'bool', - name: 'ignoreFees', - type: 'bool' - } - ], - name: 'tradeBySourceAmount', - outputs: [ - { + { + inputs: [ + { + internalType: "contract IBancorNetwork", + name: "initNetwork", + type: "address", + }, + { + internalType: "contract IERC20", + name: "initBNT", + type: "address", + }, + { + internalType: "contract INetworkSettings", + name: "initNetworkSettings", + type: "address", + }, + { + internalType: "contract IMasterVault", + name: "initMasterVault", + type: "address", + }, + { + internalType: "contract IBNTPool", + name: "initBNTPool", + type: "address", + }, + { + internalType: "contract IExternalProtectionVault", + name: "initExternalProtectionVault", + type: "address", + }, + { + internalType: "contract IPoolTokenFactory", + name: "initPoolTokenFactory", + type: "address", + }, + { + internalType: "contract IPoolMigrator", + name: "initPoolMigrator", + type: "address", + }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + inputs: [], + name: "AccessDenied", + type: "error", + }, + { + inputs: [], + name: "AlreadyEnabled", + type: "error", + }, + { + inputs: [], + name: "AlreadyExists", + type: "error", + }, + { + inputs: [], + name: "DepositingDisabled", + type: "error", + }, + { + inputs: [], + name: "DoesNotExist", + type: "error", + }, + { + inputs: [], + name: "FundingLimitTooHigh", + type: "error", + }, + { + inputs: [], + name: "InsufficientLiquidity", + type: "error", + }, + { + inputs: [], + name: "InsufficientSourceAmount", + type: "error", + }, + { + inputs: [], + name: "InsufficientTargetAmount", + type: "error", + }, + { + inputs: [], + name: "InvalidAddress", + type: "error", + }, + { + inputs: [], + name: "InvalidFee", + type: "error", + }, + { + inputs: [], + name: "InvalidFraction", + type: "error", + }, + { + inputs: [], + name: "InvalidParam", + type: "error", + }, + { + inputs: [], + name: "InvalidRate", + type: "error", + }, + { + inputs: [], + name: "InvalidStakedBalance", + type: "error", + }, + { + inputs: [], + name: "NotWhitelisted", + type: "error", + }, + { + inputs: [], + name: "Overflow", + type: "error", + }, + { + inputs: [], + name: "PoolCollectionWithdrawalInputInvalid", + type: "error", + }, + { + inputs: [], + name: "RateUnstable", + type: "error", + }, + { + inputs: [], + name: "SameOwner", + type: "error", + }, + { + inputs: [], + name: "TradingDisabled", + type: "error", + }, + { + inputs: [], + name: "ZeroValue", + type: "error", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint32", + name: "prevFeePPM", + type: "uint32", + }, + { + indexed: false, + internalType: "uint32", + name: "newFeePPM", + type: "uint32", + }, + ], + name: "DefaultTradingFeePPMUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "contract Token", + name: "pool", + type: "address", + }, + { + indexed: true, + internalType: "bool", + name: "newStatus", + type: "bool", + }, + ], + name: "DepositingEnabled", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint32", + name: "prevFeePPM", + type: "uint32", + }, + { + indexed: false, + internalType: "uint32", + name: "newFeePPM", + type: "uint32", + }, + ], + name: "NetworkFeePPMUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "prevOwner", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "OwnerUpdate", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "contextId", + type: "bytes32", + }, + { + indexed: true, + internalType: "address", + name: "provider", + type: "address", + }, + { + indexed: true, + internalType: "contract Token", + name: "token", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "baseTokenAmount", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "poolTokenAmount", + type: "uint256", + }, + ], + name: "TokensDeposited", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "contextId", + type: "bytes32", + }, + { + indexed: true, + internalType: "address", + name: "provider", + type: "address", + }, + { + indexed: true, + internalType: "contract Token", + name: "token", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "baseTokenAmount", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "poolTokenAmount", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "externalProtectionBaseTokenAmount", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "bntAmount", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "withdrawalFeeAmount", + type: "uint256", + }, + ], + name: "TokensWithdrawn", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "contextId", + type: "bytes32", + }, + { + indexed: true, + internalType: "contract Token", + name: "pool", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "liquidity", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "stakedBalance", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "poolTokenSupply", + type: "uint256", + }, + ], + name: "TotalLiquidityUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "contract Token", + name: "pool", + type: "address", + }, + { + indexed: true, + internalType: "bool", + name: "newStatus", + type: "bool", + }, + { + indexed: true, + internalType: "uint8", + name: "reason", + type: "uint8", + }, + ], + name: "TradingEnabled", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "contract Token", + name: "pool", + type: "address", + }, + { + indexed: false, + internalType: "uint32", + name: "prevFeePPM", + type: "uint32", + }, + { + indexed: false, + internalType: "uint32", + name: "newFeePPM", + type: "uint32", + }, + ], + name: "TradingFeePPMUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "contextId", + type: "bytes32", + }, + { + indexed: true, + internalType: "contract Token", + name: "pool", + type: "address", + }, + { + indexed: true, + internalType: "contract Token", + name: "token", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "prevLiquidity", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "newLiquidity", + type: "uint256", + }, + ], + name: "TradingLiquidityUpdated", + type: "event", + }, + { + inputs: [], + name: "acceptOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "contract Token", + name: "token", + type: "address", + }, + ], + name: "createPool", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "defaultTradingFeePPM", + outputs: [ + { + internalType: "uint32", + name: "", + type: "uint32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "contextId", + type: "bytes32", + }, + { + internalType: "address", + name: "provider", + type: "address", + }, + { + internalType: "contract Token", + name: "pool", + type: "address", + }, + { + internalType: "uint256", + name: "baseTokenAmount", + type: "uint256", + }, + ], + name: "depositFor", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "contract Token", + name: "pool", + type: "address", + }, + ], + name: "depositingEnabled", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "contract Token", + name: "pool", + type: "address", + }, + ], + name: "disableTrading", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "contract Token", + name: "pool", + type: "address", + }, + ], + name: "disableTradingByNetwork", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "contract Token", + name: "pool", + type: "address", + }, + { + internalType: "bool", + name: "status", + type: "bool", + }, + ], + name: "enableDepositing", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "contract Token", + name: "pool", + type: "address", + }, + { + internalType: "uint256", + name: "bntVirtualBalance", + type: "uint256", + }, + { + internalType: "uint256", + name: "baseTokenVirtualBalance", + type: "uint256", + }, + ], + name: "enableTrading", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "contract Token", + name: "pool", + type: "address", + }, + ], + name: "isPoolStable", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "contract Token", + name: "pool", + type: "address", + }, + ], + name: "isPoolValid", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "contract Token", + name: "pool", + type: "address", + }, + { + components: [ + { + internalType: "contract IPoolToken", + name: "poolToken", + type: "address", + }, + { + internalType: "uint32", + name: "tradingFeePPM", + type: "uint32", + }, + { + internalType: "bool", + name: "tradingEnabled", + type: "bool", + }, + { + internalType: "bool", + name: "depositingEnabled", + type: "bool", + }, + { + components: [ + { + internalType: "uint32", + name: "blockNumber", + type: "uint32", + }, + { components: [ - { - internalType: 'uint256', - name: 'amount', - type: 'uint256' - }, - { - internalType: 'uint256', - name: 'tradingFeeAmount', - type: 'uint256' - }, - { - internalType: 'uint256', - name: 'networkFeeAmount', - type: 'uint256' - } + { + internalType: "uint112", + name: "n", + type: "uint112", + }, + { + internalType: "uint112", + name: "d", + type: "uint112", + }, ], - internalType: 'struct TradeAmountAndFee', - name: '', - type: 'tuple' - } - ], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'contextId', - type: 'bytes32' - }, - { - internalType: 'contract Token', - name: 'sourceToken', - type: 'address' - }, - { - internalType: 'contract Token', - name: 'targetToken', - type: 'address' - }, - { - internalType: 'uint256', - name: 'targetAmount', - type: 'uint256' - }, - { - internalType: 'uint256', - name: 'maxSourceAmount', - type: 'uint256' - }, - { - internalType: 'bool', - name: 'ignoreFees', - type: 'bool' - } - ], - name: 'tradeByTargetAmount', - outputs: [ - { + internalType: "struct Fraction112", + name: "rate", + type: "tuple", + }, + { components: [ - { - internalType: 'uint256', - name: 'amount', - type: 'uint256' - }, - { - internalType: 'uint256', - name: 'tradingFeeAmount', - type: 'uint256' - }, - { - internalType: 'uint256', - name: 'networkFeeAmount', - type: 'uint256' - } + { + internalType: "uint112", + name: "n", + type: "uint112", + }, + { + internalType: "uint112", + name: "d", + type: "uint112", + }, ], - internalType: 'struct TradeAmountAndFee', - name: '', - type: 'tuple' - } - ], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'contract Token', - name: 'sourceToken', - type: 'address' - }, - { - internalType: 'contract Token', - name: 'targetToken', - type: 'address' - }, - { - internalType: 'uint256', - name: 'targetAmount', - type: 'uint256' - } - ], - name: 'tradeInputAndFeeByTargetAmount', - outputs: [ - { + internalType: "struct Fraction112", + name: "invRate", + type: "tuple", + }, + ], + internalType: "struct AverageRates", + name: "averageRates", + type: "tuple", + }, + { + components: [ + { + internalType: "uint128", + name: "bntTradingLiquidity", + type: "uint128", + }, + { + internalType: "uint128", + name: "baseTokenTradingLiquidity", + type: "uint128", + }, + { + internalType: "uint256", + name: "stakedBalance", + type: "uint256", + }, + ], + internalType: "struct PoolLiquidity", + name: "liquidity", + type: "tuple", + }, + ], + internalType: "struct Pool", + name: "data", + type: "tuple", + }, + ], + name: "migratePoolIn", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "contract Token", + name: "pool", + type: "address", + }, + { + internalType: "contract IPoolCollection", + name: "targetPoolCollection", + type: "address", + }, + ], + name: "migratePoolOut", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "networkFeePPM", + outputs: [ + { + internalType: "uint32", + name: "", + type: "uint32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "newOwner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "contract Token", + name: "pool", + type: "address", + }, + { + internalType: "uint256", + name: "feeAmount", + type: "uint256", + }, + ], + name: "onFeesCollected", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "owner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "poolCount", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "contract Token", + name: "pool", + type: "address", + }, + ], + name: "poolData", + outputs: [ + { + components: [ + { + internalType: "contract IPoolToken", + name: "poolToken", + type: "address", + }, + { + internalType: "uint32", + name: "tradingFeePPM", + type: "uint32", + }, + { + internalType: "bool", + name: "tradingEnabled", + type: "bool", + }, + { + internalType: "bool", + name: "depositingEnabled", + type: "bool", + }, + { + components: [ + { + internalType: "uint32", + name: "blockNumber", + type: "uint32", + }, + { components: [ - { - internalType: 'uint256', - name: 'amount', - type: 'uint256' - }, - { - internalType: 'uint256', - name: 'tradingFeeAmount', - type: 'uint256' - }, - { - internalType: 'uint256', - name: 'networkFeeAmount', - type: 'uint256' - } + { + internalType: "uint112", + name: "n", + type: "uint112", + }, + { + internalType: "uint112", + name: "d", + type: "uint112", + }, ], - internalType: 'struct TradeAmountAndFee', - name: '', - type: 'tuple' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [ - { - internalType: 'contract Token', - name: 'sourceToken', - type: 'address' - }, - { - internalType: 'contract Token', - name: 'targetToken', - type: 'address' - }, - { - internalType: 'uint256', - name: 'sourceAmount', - type: 'uint256' - } - ], - name: 'tradeOutputAndFeeBySourceAmount', - outputs: [ - { + internalType: "struct Fraction112", + name: "rate", + type: "tuple", + }, + { components: [ - { - internalType: 'uint256', - name: 'amount', - type: 'uint256' - }, - { - internalType: 'uint256', - name: 'tradingFeeAmount', - type: 'uint256' - }, - { - internalType: 'uint256', - name: 'networkFeeAmount', - type: 'uint256' - } + { + internalType: "uint112", + name: "n", + type: "uint112", + }, + { + internalType: "uint112", + name: "d", + type: "uint112", + }, ], - internalType: 'struct TradeAmountAndFee', - name: '', - type: 'tuple' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [ - { - internalType: 'contract Token', - name: 'pool', - type: 'address' - } - ], - name: 'tradingEnabled', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [ - { - internalType: 'contract Token', - name: 'pool', - type: 'address' - } - ], - name: 'tradingFeePPM', - outputs: [ - { - internalType: 'uint32', - name: '', - type: 'uint32' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [ - { - internalType: 'address', - name: 'ownerCandidate', - type: 'address' - } - ], - name: 'transferOwnership', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'contract Token', - name: 'pool', - type: 'address' - }, - { - internalType: 'uint256', - name: 'baseTokenAmount', - type: 'uint256' - } - ], - name: 'underlyingToPoolToken', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [ - { - internalType: 'contract Token', - name: 'pool', - type: 'address' - } - ], - name: 'updateTradingLiquidity', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [], - name: 'version', - outputs: [ - { - internalType: 'uint16', - name: '', - type: 'uint16' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'contextId', - type: 'bytes32' - }, - { - internalType: 'address', - name: 'provider', - type: 'address' - }, - { - internalType: 'contract Token', - name: 'pool', - type: 'address' - }, - { - internalType: 'uint256', - name: 'poolTokenAmount', - type: 'uint256' - }, - { - internalType: 'uint256', - name: 'baseTokenAmount', - type: 'uint256' - } - ], - name: 'withdraw', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256' - } - ], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'contract Token', - name: 'pool', - type: 'address' - }, - { - internalType: 'uint256', - name: 'poolTokenAmount', - type: 'uint256' - } - ], - name: 'withdrawalAmounts', - outputs: [ - { - components: [ - { - internalType: 'uint256', - name: 'totalAmount', - type: 'uint256' - }, - { - internalType: 'uint256', - name: 'baseTokenAmount', - type: 'uint256' - }, - { - internalType: 'uint256', - name: 'bntAmount', - type: 'uint256' - } - ], - internalType: 'struct WithdrawalAmounts', - name: '', - type: 'tuple' - } - ], - stateMutability: 'view', - type: 'function' - } + internalType: "struct Fraction112", + name: "invRate", + type: "tuple", + }, + ], + internalType: "struct AverageRates", + name: "averageRates", + type: "tuple", + }, + { + components: [ + { + internalType: "uint128", + name: "bntTradingLiquidity", + type: "uint128", + }, + { + internalType: "uint128", + name: "baseTokenTradingLiquidity", + type: "uint128", + }, + { + internalType: "uint256", + name: "stakedBalance", + type: "uint256", + }, + ], + internalType: "struct PoolLiquidity", + name: "liquidity", + type: "tuple", + }, + ], + internalType: "struct Pool", + name: "", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "contract Token", + name: "pool", + type: "address", + }, + ], + name: "poolLiquidity", + outputs: [ + { + components: [ + { + internalType: "uint128", + name: "bntTradingLiquidity", + type: "uint128", + }, + { + internalType: "uint128", + name: "baseTokenTradingLiquidity", + type: "uint128", + }, + { + internalType: "uint256", + name: "stakedBalance", + type: "uint256", + }, + ], + internalType: "struct PoolLiquidity", + name: "", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "contract Token", + name: "pool", + type: "address", + }, + ], + name: "poolToken", + outputs: [ + { + internalType: "contract IPoolToken", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "contract Token", + name: "pool", + type: "address", + }, + { + internalType: "uint256", + name: "baseTokenAmountToDistribute", + type: "uint256", + }, + { + internalType: "uint256", + name: "protocolPoolTokenAmount", + type: "uint256", + }, + ], + name: "poolTokenAmountToBurn", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "contract Token", + name: "pool", + type: "address", + }, + { + internalType: "uint256", + name: "poolTokenAmount", + type: "uint256", + }, + ], + name: "poolTokenToUnderlying", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "poolType", + outputs: [ + { + internalType: "uint16", + name: "", + type: "uint16", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "pools", + outputs: [ + { + internalType: "contract Token[]", + name: "", + type: "address[]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint32", + name: "newDefaultTradingFeePPM", + type: "uint32", + }, + ], + name: "setDefaultTradingFeePPM", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint32", + name: "newNetworkFeePPM", + type: "uint32", + }, + ], + name: "setNetworkFeePPM", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "contract Token", + name: "pool", + type: "address", + }, + { + internalType: "uint32", + name: "newTradingFeePPM", + type: "uint32", + }, + ], + name: "setTradingFeePPM", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "contextId", + type: "bytes32", + }, + { + internalType: "contract Token", + name: "sourceToken", + type: "address", + }, + { + internalType: "contract Token", + name: "targetToken", + type: "address", + }, + { + internalType: "uint256", + name: "sourceAmount", + type: "uint256", + }, + { + internalType: "uint256", + name: "minReturnAmount", + type: "uint256", + }, + { + internalType: "bool", + name: "ignoreFees", + type: "bool", + }, + ], + name: "tradeBySourceAmount", + outputs: [ + { + components: [ + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + internalType: "uint256", + name: "tradingFeeAmount", + type: "uint256", + }, + { + internalType: "uint256", + name: "networkFeeAmount", + type: "uint256", + }, + ], + internalType: "struct TradeAmountAndFee", + name: "", + type: "tuple", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "contextId", + type: "bytes32", + }, + { + internalType: "contract Token", + name: "sourceToken", + type: "address", + }, + { + internalType: "contract Token", + name: "targetToken", + type: "address", + }, + { + internalType: "uint256", + name: "targetAmount", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxSourceAmount", + type: "uint256", + }, + { + internalType: "bool", + name: "ignoreFees", + type: "bool", + }, + ], + name: "tradeByTargetAmount", + outputs: [ + { + components: [ + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + internalType: "uint256", + name: "tradingFeeAmount", + type: "uint256", + }, + { + internalType: "uint256", + name: "networkFeeAmount", + type: "uint256", + }, + ], + internalType: "struct TradeAmountAndFee", + name: "", + type: "tuple", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "contract Token", + name: "sourceToken", + type: "address", + }, + { + internalType: "contract Token", + name: "targetToken", + type: "address", + }, + { + internalType: "uint256", + name: "targetAmount", + type: "uint256", + }, + ], + name: "tradeInputAndFeeByTargetAmount", + outputs: [ + { + components: [ + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + internalType: "uint256", + name: "tradingFeeAmount", + type: "uint256", + }, + { + internalType: "uint256", + name: "networkFeeAmount", + type: "uint256", + }, + ], + internalType: "struct TradeAmountAndFee", + name: "", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "contract Token", + name: "sourceToken", + type: "address", + }, + { + internalType: "contract Token", + name: "targetToken", + type: "address", + }, + { + internalType: "uint256", + name: "sourceAmount", + type: "uint256", + }, + ], + name: "tradeOutputAndFeeBySourceAmount", + outputs: [ + { + components: [ + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + internalType: "uint256", + name: "tradingFeeAmount", + type: "uint256", + }, + { + internalType: "uint256", + name: "networkFeeAmount", + type: "uint256", + }, + ], + internalType: "struct TradeAmountAndFee", + name: "", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "contract Token", + name: "pool", + type: "address", + }, + ], + name: "tradingEnabled", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "contract Token", + name: "pool", + type: "address", + }, + ], + name: "tradingFeePPM", + outputs: [ + { + internalType: "uint32", + name: "", + type: "uint32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "ownerCandidate", + type: "address", + }, + ], + name: "transferOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "contract Token", + name: "pool", + type: "address", + }, + { + internalType: "uint256", + name: "baseTokenAmount", + type: "uint256", + }, + ], + name: "underlyingToPoolToken", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "contract Token", + name: "pool", + type: "address", + }, + ], + name: "updateTradingLiquidity", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "version", + outputs: [ + { + internalType: "uint16", + name: "", + type: "uint16", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "contextId", + type: "bytes32", + }, + { + internalType: "address", + name: "provider", + type: "address", + }, + { + internalType: "contract Token", + name: "pool", + type: "address", + }, + { + internalType: "uint256", + name: "poolTokenAmount", + type: "uint256", + }, + { + internalType: "uint256", + name: "baseTokenAmount", + type: "uint256", + }, + ], + name: "withdraw", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "contract Token", + name: "pool", + type: "address", + }, + { + internalType: "uint256", + name: "poolTokenAmount", + type: "uint256", + }, + ], + name: "withdrawalAmounts", + outputs: [ + { + components: [ + { + internalType: "uint256", + name: "totalAmount", + type: "uint256", + }, + { + internalType: "uint256", + name: "baseTokenAmount", + type: "uint256", + }, + { + internalType: "uint256", + name: "bntAmount", + type: "uint256", + }, + ], + internalType: "struct WithdrawalAmounts", + name: "", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, ] as const; const _bytecode = - '0x6101806040526005805460ff60401b191690553480156200001f57600080fd5b50604051620063fd380380620063fd833981016040819052620000429162000298565b6200004d3362000109565b620000588862000163565b620000638762000163565b6200006e8662000163565b620000798562000163565b620000848462000163565b6200008f8362000163565b6200009a8262000163565b620000a58162000163565b6001600160a01b0380891660805287811660a05286811660c05285811660e052848116610100528381166101205282811661014052811661016052620000ed6107d06200018e565b620000fb62030d4062000201565b505050505050505062000359565b600080546001600160a01b038381166001600160a01b031980841682178555600180549091169055604051919092169283917f343765429aea5a34b3ff6a3785a98a5abb2597aca87bfbb58632c173d585373a9190a35050565b6001600160a01b0381166200018b5760405163e6c4247b60e01b815260040160405180910390fd5b50565b60055463ffffffff9081169082168103620001a7575050565b6005805463ffffffff191663ffffffff84811691821790925560408051928416835260208301919091527fb804b0ec3f0ea43004870df377170ce44cb789adca16d23286e337605558117f91015b60405180910390a15050565b60055463ffffffff6401000000009091048116908216810362000222575050565b6005805463ffffffff60201b191664010000000063ffffffff8581169182029290921790925560408051918416825260208201929092527f1f1f36475e04b1709caf649fc7f00350aa38c7f7f110f653e81f79011db0867c9101620001f5565b6001600160a01b03811681146200018b57600080fd5b600080600080600080600080610100898b031215620002b657600080fd5b8851620002c38162000282565b60208a0151909850620002d68162000282565b60408a0151909750620002e98162000282565b60608a0151909650620002fc8162000282565b60808a01519095506200030f8162000282565b60a08a0151909450620003228162000282565b60c08a0151909350620003358162000282565b60e08a0151909250620003488162000282565b809150509295985092959890939650565b60805160a05160c05160e05161010051610120516101405161016051615f816200047c600039600081816114780152611f1101526000611226015260008181612e1a01526133fe0152600081816123d10152818161249e015281816125700152818161316701528181613201015281816132550152818161334101526146e9015260008181611a380152818161225701528181612dbe01528181613282015281816133ce015281816134ae015261373c0152600081816108de0152818161117c01528181611a9e01528181611cee0152818161234501528181612e5a015261359b015260008181612a5101526143350152600081816107cc01528181610dfe01528181611135015281816116e801528181611e670152611fe50152615f816000f3fe608060405234801561001057600080fd5b50600436106102535760003560e01c8063915b994111610146578063c2cf4252116100c3578063df2c3ab411610087578063df2c3ab414610634578063ee4808fe14610647578063f2fde38b1461065a578063f525cb681461066d578063f6c5786114610675578063fba8cdee146106a357600080fd5b8063c2cf4252146105b5578063c5c51dca146105e8578063d1aebfc7146105fd578063d3df242414610610578063d4ee1d901461062357600080fd5b80639fc192311161010a5780639fc19231146104d7578063a135ef17146104e5578063aa55a9b114610568578063b1dd61b61461057b578063bedf95251461058257600080fd5b8063915b9941146104785780639181d2e31461048b578063921a929e1461049e5780639dad4613146104b15780639f5c734b146104c457600080fd5b806354fd4d50116101d45780637516baec116101985780637516baec1461042757806379ba50971461043957806381417585146104415780638da5cb5b146104545780639049f9d21461046557600080fd5b806354fd4d501461039157806356aca36f146103a75780635768adcf146103ba5780636161b626146103fe57806372d960e11461041457600080fd5b806330cdb3081161021b57806330cdb308146102df5780633376af511461032a57806334afba2b1461033d5780634ceea7531461035d578063541868c81461037e57600080fd5b8063136efb7a146102585780631510748b146102815780631c754cae146102965780632258cc69146102a957806327910565146102cc575b600080fd5b61026b6102663660046156e9565b6106b6565b6040516102789190615706565b60405180910390f35b61029461028f3660046157cc565b6107ca565b005b6102946102a43660046157f8565b61082a565b6102bc6102b73660046156e9565b610aa2565b6040519015158152602001610278565b6102946102da3660046156e9565b610adf565b6103156102ed3660046156e9565b6001600160a01b0316600090815260026020526040902054600160a01b900463ffffffff1690565b60405163ffffffff9091168152602001610278565b61029461033836600461583f565b610b41565b61035061034b36600461585c565b610b5c565b604051610278919061589d565b61037061036b3660046157cc565b610bd1565b604051908152602001610278565b61035061038c3660046157cc565b610c6a565b600b5b60405161ffff9091168152602001610278565b6103706103b53660046158be565b610dfa565b6103e66103c83660046156e9565b6001600160a01b039081166000908152600260205260409020541690565b6040516001600160a01b039091168152602001610278565b600554640100000000900463ffffffff16610315565b61035061042236600461585c565b610ff0565b600554600160401b900460ff166102bc565b61029461106c565b61029461044f36600461591e565b6110ae565b6000546001600160a01b03166103e6565b6102946104733660046156e9565b611133565b610294610486366004615957565b61146c565b61029461049936600461599a565b61151d565b6103706104ac3660046157f8565b6115ce565b6102946104bf3660046159c8565b6116a4565b6103706104d23660046159e5565b6116e4565b60055463ffffffff16610315565b61055b6104f33660046156e9565b6040805160608082018352600080835260208084018290529284018190526001600160a01b0394909416845260028252928290208251938401835260048101546001600160801b038082168652600160801b9091041691840191909152600501549082015290565b6040516102789190615a2d565b6102946105763660046156e9565b611ba0565b6001610394565b6102bc6105903660046156e9565b6001600160a01b0316600090815260026020526040902054600160c01b900460ff1690565b6102bc6105c33660046156e9565b6001600160a01b0316600090815260026020526040902054600160c81b900460ff1690565b6105f0611d91565b6040516102789190615a5c565b61035061060b366004615aa9565b611e41565b61029461061e366004615b10565b611f05565b6001546001600160a01b03166103e6565b610350610642366004615aa9565b611fbf565b6103706106553660046157cc565b61207b565b6102946106683660046156e9565b61210a565b610370612163565b6102bc6106833660046156e9565b6001600160a01b0390811660009081526002602052604090205416151590565b6102946106b136600461583f565b612174565b6106be615504565b506001600160a01b03908116600090815260026020818152604092839020835160c0810185528154958616815263ffffffff600160a01b870481168285015260ff600160c01b88048116151583880152600160c81b9097049096161515606080830191909152855180820187526001840154909716875285518087018752948301546001600160701b038082168752600160701b9182900481168787015288860196909652865180880188526003850154808816825291909104909516858501528686019490945260808101959095528351928301845260048101546001600160801b038082168552600160801b9091041691830191909152600501549181019190915260a082015290565b7f00000000000000000000000000000000000000000000000000000000000000006107f48161218f565b8115610825576000610805846121b8565b90508281600401600101600082825461081e9190615b54565b9091555050505b505050565b6108326121f5565b604080518082019091528281526020810182905261084f81612220565b600061085a856121b8565b8054909150600160c01b900460ff161561088757604051637952fbad60e11b815260040160405180910390fd5b6040516bffffffffffffffffffffffff1933606090811b8216602084015287901b166034820152604881018590526068810184905260009060880160405160208183030381529060405280519060200120905060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166387ba006a6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561093a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061095e9190615b6c565b905061096d8288858785612246565b60048301546001600160801b031681111561099b5760405163bb55fd2760e01b815260040160405180910390fd5b60006109a6856126a9565b905060405180606001604052806109ba4390565b63ffffffff1681526020018281526020016109d483612709565b905280516001868101805463ffffffff191663ffffffff909316929092179091556020808301518051600289018054928401516001600160701b039283166001600160e01b031994851617600160701b918416820217909155604095860151805160038c0180549290960151908416919094161792909116021790558554600160c01b60ff60c01b19909116178655905181906001600160a01b038b16907f162ed187f3ed3879ae360c5df2a0a5dcaac7a208a9d762c2cbbfb1f5fad8b81d90600090a45050505050505050565b6001600160a01b0381166000908152600260208190526040822090610ac682612763565b6002811115610ad757610ad7615b85565b149392505050565b610ae76121f5565b6000610af2826121b8565b6040805160608101825260048301546001600160801b038082168352600160801b909104166020820152600583015491810191909152909150610b3d906000908490849060016128d0565b5050565b610b496121f5565b80610b53816128f0565b610b3d8261291a565b610b8060405180606001604052806000815260200160008152602001600081525090565b81610b8a816129a2565b6000610b9c81878787600019846129c3565b9050610ba781612c01565b60408051606080820183528351825283015160208201526080909201519082015295945050505050565b6001600160a01b038083166000908152600260209081526040808320805482516318160ddd60e01b8152925194959194610c6094889492909316926318160ddd92600480820193918290030181865afa158015610c32573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c569190615b6c565b6005840154612d2c565b9150505b92915050565b610c8e60405180606001604052806000815260200160008152602001600081525090565b82610c9881612d6f565b82610ca2816129a2565b6001600160a01b03808616600090815260026020908152604080832081516060810183526004808301546001600160801b038082168452600160801b9091041682860152600583015482850152825484516318160ddd60e01b8152945193979296959216936318160ddd93818301939290918290030181865afa158015610d2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d519190615b6c565b90506000610d6488838560400151612d2c565b90506000610d8a8a8a84878960000160149054906101000a900463ffffffff1688612d96565b905060405180606001604052808260c001518360e00151610dab9190615b9b565b815260200182604001518360000151610dc49190615b54565b8152602001600560089054906101000a900460ff16610de4576000610dea565b82602001515b90529a9950505050505050505050565b60007f0000000000000000000000000000000000000000000000000000000000000000610e268161218f565b85610e3081612d6f565b84610e3a816129a2565b84610e44816129a2565b6000610e4f896121b8565b604080516060810182526004808401546001600160801b038082168452600160801b90910416602080840191909152600585015483850152845484516318160ddd60e01b8152945195965092946000946001600160a01b03909416936318160ddd938181019392918290030181865afa158015610ed0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ef49190615b6c565b90506000610f078b838560400151612d2c565b9050808a1115610f2a57604051633494a40d60e21b815260040160405180910390fd5b6001610f3585612763565b6002811115610f4657610f46615b85565b03610f64576040516301a6272960e41b815260040160405180910390fd5b6000610f888d8d8d878960000160149054906101000a900463ffffffff1688612d96565b9050610f978f8f8f8885612ff2565b8454600160c01b900460ff1615610fdd576040805180820190915260048601546001600160801b038082168352600160801b909104166020820152610fdd90869061378a565b519e9d5050505050505050505050505050565b61101460405180606001604052806000815260200160008152602001600081525090565b8161101e816129a2565b600061102f818787876001806129c3565b905061103a81612c01565b604051806060016040528082602001518152602001826060015181526020018260800151815250925050509392505050565b6001546001600160a01b0316331461109757604051634ca8886760e01b815260040160405180910390fd5b6001546110ac906001600160a01b0316613884565b565b6110b66121f5565b60006110c1836121b8565b8054909150821515600160c81b90910460ff161515036110e057505050565b805460ff60c81b1916600160c81b8315159081029190911782556040516001600160a01b038516907fa606e6917bc476eb72d24f486596af7f564fb7b50f73135c81c0e8e0553430cd90600090a3505050565b7f000000000000000000000000000000000000000000000000000000000000000061115d8161218f565b60405163b5af090f60e01b81526001600160a01b0383811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063b5af090f90602401602060405180830381865afa1580156111c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111e79190615bb2565b61120457604051630b094f2760e31b815260040160405180910390fd5b604051632b625f2360e01b81526001600160a01b0383811660048301526000917f000000000000000000000000000000000000000000000000000000000000000090911690632b625f23906024016020604051808303816000875af1158015611271573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112959190615bcf565b9050806001600160a01b03166379ba50976040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156112d257600080fd5b505af11580156112e6573d6000803e3d6000fd5b5050505060006040518060c00160405280836001600160a01b03168152602001600560009054906101000a900463ffffffff1663ffffffff1681526020016000151581526020016001151581526020016040518060600160405280600063ffffffff1681526020016113566138de565b81526020016113636138de565b9052815260408051606081018252600080825260208281018290529282015291015290506113918482613907565b60408082015190516000911515906001600160a01b038716907f162ed187f3ed3879ae360c5df2a0a5dcaac7a208a9d762c2cbbfb1f5fad8b81d908490a4836001600160a01b03167fa2d66c1e2cc4b2cc5daaabc06447542e989ed748a9fb22476b6c913dcc1c7f4b6000836020015160405161142192919063ffffffff92831681529116602082015260400190565b60405180910390a280606001511515846001600160a01b03167fa606e6917bc476eb72d24f486596af7f564fb7b50f73135c81c0e8e0553430cd60405160405180910390a350505050565b8161147681612d6f565b7f00000000000000000000000000000000000000000000000000000000000000006114a08161218f565b6114b8846114b336869003860186615d7f565b613907565b6114c560208401846156e9565b6001600160a01b03166379ba50976040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156114ff57600080fd5b505af1158015611513573d6000803e3d6000fd5b5050505050505050565b6115256121f5565b8061152f816128f0565b600061153a846121b8565b805490915063ffffffff600160a01b9091048116908416810361155e575050505050565b815463ffffffff60a01b1916600160a01b63ffffffff86811691820292909217845560408051928416835260208301919091526001600160a01b038716917fa2d66c1e2cc4b2cc5daaabc06447542e989ed748a9fb22476b6c913dcc1c7f4b910160405180910390a25050505050565b6000826000036115e05750600061169d565b6001600160a01b038085166000908152600260209081526040808320805482516318160ddd60e01b81529251919516926318160ddd92600480820193918290030181865afa158015611636573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061165a9190615b6c565b905060006116688287615e52565b905061169781836116798882615b9b565b60058701546116889190615e52565b6116929085615b54565b613a60565b93505050505b9392505050565b6116ac6121f5565b60055460ff600160401b909104161515811515146116e1576005805468ff00000000000000001916600160401b831515021790555b50565b60007f00000000000000000000000000000000000000000000000000000000000000006117108161218f565b8461171a81612d6f565b83611724816129a2565b600061172f876121b8565b8054909150600160c81b900460ff1661175b576040516303a5be3f60e31b815260040160405180910390fd5b8054604080516318160ddd60e01b815290516000926001600160a01b0316916318160ddd9160048083019260209291908290030181865afa1580156117a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117c89190615b6c565b60058301549091506117d861555c565b821580156117e557508115155b1561186a576040805160608101825260048601546001600160801b038082168352600160801b909104166020820152600586015491810191909152600092506118328d8c878460036128d0565b6040518060600160405280600063ffffffff1681526020016118526138de565b815260200161185f6138de565b81525091505061192c565b604080516060808201835260048701546001600160801b038082168452600160801b9091048116602080850191825260058a0154858701528551938401865260018a015463ffffffff1684528551808701875260028b01546001600160701b038082168352600160701b91829004811683850152868401929092528751808901895260038d01548084168252919091049091168183015284870152855180870190965284518316865290519091169084015290916119289190613b2c565b9150505b60006119398a8585613ca0565b90506119458a84615b54565b600586015584546040516340c10f1960e01b81526001600160a01b038e8116600483015260248201849052909116906340c10f1990604401600060405180830381600087803b15801561199757600080fd5b505af11580156119ab573d6000803e3d6000fd5b505050508a6001600160a01b03168c6001600160a01b03168e7fecb7e4cd1580472adaeba712b36acf94439b2e1760af55fedb61960ca4422af38d856040516119fe929190918252602082015260400190565b60405180910390a46001600160a01b038b168d7f67c4863f17da9847c57c9fa043e63a0ddf4f5a86fd63a6f71ea69057a11c411a611a5c837f0000000000000000000000000000000000000000000000000000000000000000613cd4565b6005890154611a6b868a615b54565b6040805193845260208401929092529082015260600160405180910390a3611b238d8c87611a9c8660200151613d78565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166387ba006a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611afa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b1e9190615b6c565b612246565b8454600160c01b900460ff1615611b90576040805160608101825260048701546001600160801b038082168352600160801b9091048116602080840191825260058a015484860152845180860190955283518316855290519091169083015290611b8e90879061378a565b505b9c9b505050505050505050505050565b611ba86121f5565b6000611bb3826121b8565b604080516060808201835260048401546001600160801b038082168452600160801b820490811660208086019190915260058701548587015294516bffffffffffffffffffffffff1933851b8116968201969096529288901b90941660348301526001600160801b0319608091821b8116604884015293901b909216605883015291925060009060680160408051601f198184030181528282528051602091820120606084018352600187015463ffffffff1684528251808401845260028801546001600160701b038082168352600160701b91829004811683860152868501929092528451808601865260038a01548084168252919091049091168184015284840152825180840190935285516001600160801b0390811684528683015116918301919091529250600091611ce891613b2c565b905060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166387ba006a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611d4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d6e9190615b6c565b9050611d89838787611d838660200151613d78565b85612246565b505050505050565b60606000611d9f6003613db4565b905060008167ffffffffffffffff811115611dbc57611dbc615bec565b604051908082528060200260200182016040528015611de5578160200160208202803683370190505b50905060005b82811015611e3a57611dfe600382613dbe565b828281518110611e1057611e10615e71565b6001600160a01b039092166020928302919091019091015280611e3281615e87565b915050611deb565b5092915050565b611e6560405180606001604052806000815260200160008152602001600081525090565b7f0000000000000000000000000000000000000000000000000000000000000000611e8f8161218f565b84611e99816129a2565b84611ea3816129a2565b6000611eb48b8b8b8b8b60016129c3565b90508515611ec55760006101608201525b611ece81613dca565b6040518060600160405280826020015181526020018260600151815260200182608001518152509450505050509695505050505050565b80611f0f81612d6f565b7f0000000000000000000000000000000000000000000000000000000000000000611f398161218f565b6001600160a01b0380851660009081526002602052604090205416611f5d85613f06565b60405163f2fde38b60e01b81526001600160a01b03858116600483015282169063f2fde38b90602401600060405180830381600087803b158015611fa057600080fd5b505af1158015611fb4573d6000803e3d6000fd5b505050505050505050565b611fe360405180606001604052806000815260200160008152602001600081525090565b7f000000000000000000000000000000000000000000000000000000000000000061200d8161218f565b84612017816129a2565b84612021816129a2565b60006120328b8b8b8b8b60006129c3565b905085156120435760006101608201525b61204c81613dca565b6040805160608082018352835182528301516020820152608090920151908201529a9950505050505050505050565b6001600160a01b038083166000908152600260209081526040808320805482516318160ddd60e01b8152925194959194610c6094889492909316926318160ddd92600480820193918290030181865afa1580156120dc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121009190615b6c565b6005840154613ca0565b6121126121f5565b6000546001600160a01b039081169082160361214157604051630a98f1f360e21b815260040160405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b600061216f6003613db4565b905090565b61217c6121f5565b80612186816128f0565b610b3d82613f90565b336001600160a01b038216146116e157604051634ca8886760e01b815260040160405180910390fd5b6001600160a01b03808216600090815260026020526040812080549192909116610c645760405163b0ce759160e01b815260040160405180910390fd5b6000546001600160a01b031633146110ac57604051634ca8886760e01b815260040160405180910390fd5b61222981613ffa565b6116e157604051636a43f8d160e01b815260040160405180910390fd5b600061227b6001600160a01b0386167f0000000000000000000000000000000000000000000000000000000000000000613cd4565b90508060000361229e5760405163bb55fd2760e01b815260040160405180910390fd5b60016122a985612763565b60028111156122ba576122ba615b85565b036122c557506126a2565b6040805160608101825260048601546001600160801b038082168352600160801b90910416602082015260058601549181019190915261230484613ffa565b61231d576123168787878460026128d0565b50506126a2565b60405163467e55df60e01b81526001600160a01b0387811660048301526000916124449185917f00000000000000000000000000000000000000000000000000000000000000009091169063467e55df90602401602060405180830381865afa15801561238e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123b29190615b6c565b604051637ea6a56960e11b81526001600160a01b038b811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063fd4d4ad290602401602060405180830381865afa158015612418573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061243c9190615b6c565b858989614017565b8051909150612455575050506126a2565b6020810151158061246857506040810151155b156124835761247b8888888560026128d0565b5050506126a2565b81600001516001600160801b031681602001511115612555577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166371c0feb7898985600001516001600160801b031685602001516124ea9190615b9b565b6040516001600160e01b031960e086901b16815260048101939093526001600160a01b0390911660248301526044820152606401600060405180830381600087803b15801561253857600080fd5b505af115801561254c573d6000803e3d6000fd5b50505050612623565b81600001516001600160801b031681602001511015612623577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316631ebda06d8989846020015186600001516001600160801b03166125bc9190615b9b565b6040516001600160e01b031960e086901b16815260048101939093526001600160a01b0390911660248301526044820152606401600060405180830381600087803b15801561260a57600080fd5b505af115801561261e573d6000803e3d6000fd5b505050505b6000604051806060016040528061263d8460200151614286565b6001600160801b031681526020016126588460400151614286565b6001600160801b0390811682526040808701516020938401528351928401518216600160801b02929091169190911760048a015581015160058901559050611fb4898985846142f7565b5050505050565b604080518082019091526000808252602082015260006126d0836001600160701b0361441c565b9050604051806040016040528082600001516001600160701b0316815260200182602001516001600160701b0316815250915050919050565b6040805180820190915260008082526020820152604080518082019091526020838101516001600160701b03908116835284511690820181905215155b610c6457604051630d38a7e760e11b815260040160405180910390fd5b60408051808201825260048301546001600160801b038082168352600160801b909104166020808301919091528251606081018452600185015463ffffffff1681528351808501855260028601546001600160701b038082168352600160701b9182900481168386015283850192835286518088018852600389015480831682529290920416938101939093529381019190915291516000929061280683613ffa565b15806128185750612816816144ab565b155b1561282857506000949350505050565b6000612833846144da565b604084015190915061284482613ffa565b15806128565750612854816144ab565b155b15612868575060009695505050505050565b60006128748587613b2c565b905061288f6128868260200151613d78565b8761271061450f565b80156128af57506128af6128a68260400151613d78565b8461271061450f565b156128c257506002979650505050505050565b506001979650505050505050565b60048301546126a29086908690869086906001600160801b0316866145b1565b620f424063ffffffff821611156116e1576040516358d620b360e01b815260040160405180910390fd5b60055463ffffffff6401000000009091048116908216810361293a575050565b6005805467ffffffff00000000191664010000000063ffffffff8581169182029290921790925560408051918416825260208201929092527f1f1f36475e04b1709caf649fc7f00350aa38c7f7f110f653e81f79011db0867c91015b60405180910390a15050565b806000036116e157604051637c946ed760e01b815260040160405180910390fd5b612a44604051806101a00160405280600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160006001600160a01b03168152602001600015158152602001600015158152602001600063ffffffff168152602001600080191681525090565b6001600160a01b038681167f0000000000000000000000000000000000000000000000000000000000000000821690811491871614818015612a84575080155b15612aa65760016101208401526001600160a01b038716610100840152612aec565b81158015612ab15750805b15612ad35760006101208401526001600160a01b038816610100840152612aec565b60405163b0ce759160e01b815260040160405180910390fd5b6000612afc8461010001516121b8565b8054909150600160c01b900460ff16612b285760405163bcb8b8fb60e01b815260040160405180910390fd5b61018084018a905284158015610140860152612b4657868452612b4e565b602084018790525b60408481018790528154600160a01b900463ffffffff16610160860152805160608101825260048301546001600160801b038082168352600160801b90910416602082015260058301549181019190915261012085015115612bcc5780516001600160801b0390811660a087015260208201511660c0860152612bea565b60208101516001600160801b0390811660a087015281511660c08601525b6040015160e0850152509198975050505050505050565b604080518082019091526000808252602082015281610140015115612c7257612c3d8260a001518360c00151846101600151856000015161478b565b80516020840181905260408401519192501015612c6d5760405163f31ee7a560e01b815260040160405180910390fd5b612cc5565b612c8f8260a001518360c00151846101600151856020015161481d565b80518084529091501580612ca7575060408201518251115b15612cc55760405163681c2ccd60e11b815260040160405180910390fd5b60208101516060830152815160a083018051612ce2908390615b54565b905250602082015160c083018051612cfb908390615b9b565b90525061012082015115612d235781606001518260e001818151612d1f9190615b54565b9052505b610b3d826148b9565b600082600003612d5c578115612d5557604051636a9c61e160e01b815260040160405180910390fd5b508261169d565b612d67848385613a60565b949350505050565b6001600160a01b0381166116e15760405163e6c4247b60e01b815260040160405180910390fd5b612d9e6155ad565b60208401516000906001600160801b0316612de26001600160a01b038a167f0000000000000000000000000000000000000000000000000000000000000000613cd4565b612dec9190615b9b565b90506000612ee686600001516001600160801b031687602001516001600160801b0316848960400151612e517f00000000000000000000000000000000000000000000000000000000000000008f6001600160a01b0316613cd490919063ffffffff16565b8a63ffffffff167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316632aac012c6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612eb6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612eda9190615ea0565b63ffffffff168e614989565b905060405180610180016040528082606001518152602001826080015181526020018260a0015181526020018260400151815260200182600001518152602001826020015181526020018260c001518152602001888152602001898152602001858152602001826040015160200151612f7c576040830151516020890151612f7791906001600160801b0316615b54565b612f9a565b6040830151516020890151612f9a91906001600160801b0316615b9b565b8152602001826000015160200151612fc9578251518851612fc491906001600160801b0316615b54565b612fe1565b8251518851612fe191906001600160801b0316615b9b565b9052925050505b9695505050505050565b60408051606081018252600484810180546001600160801b038082168552600160801b90910416602084015260058601548385015285546101008601519451630852cd8d60e31b815292830194909452926001600160a01b0316906342966c6890602401600060405180830381600087803b15801561307057600080fd5b505af1158015613084573d6000803e3d6000fd5b5050505060008361010001518461012001516130a09190615b9b565b905060006130b8846001015483876101200151613a60565b90508084600101819055506130d1856101400151614286565b84546001600160801b03918216600160801b0291161784556101608501516130f890614286565b84546001600160801b0319166001600160801b039190911617845560a085015151156131cb578460a001516020015161313357613133615ebd565b60a085015151604051631ebda06d60e01b8152600481018b90526001600160a01b03898116602483015260448201929092527f000000000000000000000000000000000000000000000000000000000000000090911690631ebda06d906064015b600060405180830381600087803b1580156131ae57600080fd5b505af11580156131c2573d6000803e3d6000fd5b505050506132f1565b608085015151156132f1578460800151602001511561323857608085015151604051631538c64b60e31b815260048101919091527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063a9c6325890602401613194565b6080850151516040516340c10f1960e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016916340c10f19916132be917f0000000000000000000000000000000000000000000000000000000000000000916004016001600160a01b03929092168252602082015260400190565b600060405180830381600087803b1580156132d857600080fd5b505af11580156132ec573d6000803e3d6000fd5b505050505b6005546020860151600160401b90910460ff1690158015906133105750805b156133a05760208601516040516340c10f1960e01b81526001600160a01b038b8116600483015260248201929092527f0000000000000000000000000000000000000000000000000000000000000000909116906340c10f1990604401600060405180830381600087803b15801561338757600080fd5b505af115801561339b573d6000803e3d6000fd5b505050505b604086015115613476576040868101519051631c20fadd60e01b81526001600160a01b038a811660048301527f00000000000000000000000000000000000000000000000000000000000000008116602483015260448201929092527f000000000000000000000000000000000000000000000000000000000000000090911690631c20fadd90606401600060405180830381600087803b15801561344457600080fd5b505af1158015613458573d6000803e3d6000fd5b505050508560400151866000018181516134729190615b54565b9052505b85511561350d578551604051631c20fadd60e01b81526001600160a01b038a811660048301528b8116602483015260448201929092527f000000000000000000000000000000000000000000000000000000000000000090911690631c20fadd90606401600060405180830381600087803b1580156134f457600080fd5b505af1158015613508573d6000803e3d6000fd5b505050505b856101400151600003613599576135226138de565b80516002890180546020909301516001600160701b03908116600160701b026001600160e01b03199094169216919091179190911790556135616138de565b80516003890180546020909301516001600160701b03908116600160701b026001600160e01b03199094169216919091179190911790555b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166387ba006a6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156135f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061361b9190615b6c565b86610160015110156136405761363b8a8989878a610160015160026145b1565b613682565b6040805160608101825286546001600160801b038082168352600160801b909104166020820152600187015491810191909152613682908b908a9087906142f7565b876001600160a01b0316896001600160a01b03168b7feab8ac9e9478a4b3c37a794ecef629b8a8bbcd96f9eaeac8ed26054d144da52d89600001518a61010001518b60400151876136d45760006136da565b8c602001515b60c08e0151604080519586526020860194909452928401919091526060830152608082015260a00160405180910390a46001600160a01b0388168a7f67c4863f17da9847c57c9fa043e63a0ddf4f5a86fd63a6f71ea69057a11c411a613760837f0000000000000000000000000000000000000000000000000000000000000000613cd4565b6040805191825260208201879052810187905260600160405180910390a350505050505050505050565b60408051606081018252600184015463ffffffff1681528151808301835260028501546001600160701b038082168352600160701b918290048116602084810191909152808501939093528451808601865260038801548083168252929092041691810191909152918101919091526138039082613b2c565b805160018401805463ffffffff191663ffffffff9092169190911790556020808201518051600286018054928401516001600160701b039283166001600160e01b031994851617600160701b918416820217909155604090940151805160039097018054919094015196821692169190911794169091029290921790915550565b600080546001600160a01b038381166001600160a01b031980841682178555600180549091169055604051919092169283917f343765429aea5a34b3ff6a3785a98a5abb2597aca87bfbb58632c173d585373a9190a35050565b604080518082018252600080825260209182018190528251808401909352825260019082015290565b613912600383614bff565b61392f5760405163119b4fd360e11b815260040160405180910390fd5b6001600160a01b039182166000908152600260208181526040928390208451815486840151878701516060890151939099166001600160c01b031990921691909117600160a01b63ffffffff928316021761ffff60c01b1916600160c01b9815159890980260ff60c81b191697909717600160c81b911515919091021781556080850151805160018301805463ffffffff191691909816179096558582015180519382018054918401516001600160701b039586166001600160e01b031993841617600160701b91871682021790915596850151805160038401805492860151918716929093169190911794169096029290921790945560a0909201518051938101516001600160801b03948516600160801b95909116949094029390931760048301559190910151600590910155565b600080613a6d8585614c14565b8051909150600003613a9157828160200151613a899190615ee9565b91505061169d565b80518311613ab257604051631a93c68960e11b815260040160405180910390fd5b6000613abf868686614c9b565b90506000613acd8383614cb6565b8051909150600003613af357848160200151613ae99190615ee9565b935050505061169d565b6000858103861690613b058383614d32565b90506000613b1b613b16848a615ee9565b614d69565b919091029998505050505050505050565b613b3461555c565b613b3d82613ffa565b613b77576040518060600160405280600063ffffffff168152602001613b616138de565b8152602001613b6e6138de565b90529050610c64565b8251439063ffffffff80831690821603613b95578492505050610c64565b6064613ba18284615efd565b63ffffffff16101580613bbe5750613bbc85602001516144ab565b155b80613bd35750613bd185604001516144ab565b155b15613c5557613be184613ffa565b15613c285760405180606001604052808363ffffffff168152602001613c06866126a9565b8152602001613c1c613c17876144da565b6126a9565b81525092505050610c64565b6040518060600160405280600063ffffffff168152602001613c486138de565b8152602001613c1c6138de565b60405180606001604052808363ffffffff168152602001613c7a876020015187614d94565b8152602001613c958760400151613c90886144da565b614d94565b905295945050505050565b600082600003613cc9578115612d5557604051636a9c61e160e01b815260040160405180910390fd5b612d67848484614e01565b600073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6001600160a01b03841603613d0b57506001600160a01b03811631610c64565b826040516370a0823160e01b81526001600160a01b03848116600483015291909116906370a0823190602401602060405180830381865afa158015613d54573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061169d9190615b6c565b6040805180820182526000808252602091820152815180830190925282516001600160701b039081168352928101519092169181019190915290565b6000610c64825490565b600061169d8383614e51565b6101008101516001600160a01b0316600090815260026020908152604091829020825160608101845260048201546001600160801b038082168352600160801b9091048116828501908152600584015483870152855180870190965282518216865251169284019290925291613e4190839061378a565b613e4a83612c01565b60006040518060600160405280613e78866101200151613e6e578660c00151614286565b8660a00151614286565b6001600160801b03168152602001613ea7866101200151613e9d578660a00151614286565b8660c00151614286565b6001600160801b031681526020018560e001518152509050613ed584610180015185610100015184846142f7565b805160208201516001600160801b03908116600160801b029116176004840155604001516005909201919091555050565b613f11600382614e7b565b613f2e5760405163b0ce759160e01b815260040160405180910390fd5b6001600160a01b03166000908152600260208190526040822080546001600160d01b031916815560018101805463ffffffff1916905590810180546001600160e01b031990811690915560038201805490911690556004810182905560050155565b60055463ffffffff9081169082168103613fa8575050565b6005805463ffffffff191663ffffffff84811691821790925560408051928416835260208301919091527fb804b0ec3f0ea43004870df377170ce44cb789adca16d23286e337605558117f9101612996565b60006140098260200151151590565b8015610c6457505051151590565b61403d604051806060016040528060001515815260200160008152602001600081525090565b83516001600160801b0316858711156140bc57600061405c8789615b9b565b9050600086602001516001600160801b03168a6140799190615b9b565b905060006140996140938389600001518a60200151613a60565b84614e90565b88519091506140b29082906001600160801b0316615b54565b93505050506140ed565b858710156140ed5760006140d08888615b9b565b90506140e986600001516001600160801b031682614ea6565b9150505b84516001600160801b03168103614126576040518060600160405280600015158152602001600081526020016000815250915050612fe8565b82811015614156576040518060600160405280600115158152602001600081526020016000815250915050612fe8565b60008086600001516001600160801b03168311156142285786516000906001600160801b031681036141945761418d600287615e52565b90506141ae565b87516141ab906002906001600160801b0316615e52565b90505b6141b88482614e90565b88519094506141d0906001600160801b031685615b9b565b92506141e58388602001518960000151613a60565b91506040518060600160405280600115158152602001858152602001838a602001516001600160801b031661421a9190615b54565b815250945050505050612fe8565b865161423e9084906001600160801b0316615b9b565b91506142538287602001518860000151613a60565b90506040518060600160405280600115158152602001848152602001610dea89602001516001600160801b031684614ea6565b60006001600160801b038211156142f35760405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20316044820152663238206269747360c81b606482015260840160405180910390fd5b5090565b815181516001600160801b039081169116146143895781518151604080516001600160801b0393841681529290911660208301526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116929086169187917f6e96dc5343d067ec486a9920e0304c3610ed05c65e45cc029d9b9fe7ecfa7620910160405180910390a45b81602001516001600160801b031681602001516001600160801b03161461441657826001600160a01b0316836001600160a01b0316857f6e96dc5343d067ec486a9920e0304c3610ed05c65e45cc029d9b9fe7ecfa76208560200151856020015160405161440d9291906001600160801b0392831681529116602082015260400190565b60405180910390a45b50505050565b6040805180820190915260008082526020820152600061444d61444785600001518660200151614ec0565b84614ed0565b90506000604051806040016040528083876000015161446c9190615ee9565b81526020018387602001516144819190615ee9565b81525090508060200151600003610c6057604051630d38a7e760e11b815260040160405180910390fd5b60006144c382602001516001600160701b0316151590565b8015610c64575050516001600160701b0316151590565b604080518082019091526000808252602082015260408051808201909152602083810151825283519082018190521515612746565b825160009081906145419061452785620f4240615efd565b63ffffffff16866020015161453c9190615e52565b614c14565b905060006145668660200151620f424063ffffffff16876000015161453c9190615e52565b86519091506000906145949061457f87620f4240615f22565b63ffffffff16886020015161453c9190615e52565b90506145a08383614f02565b801561169757506116978282614f02565b6000600485018190556040805160608101909152908152602081016145d46138de565b81526020016145e16138de565b9052805160018601805463ffffffff191663ffffffff9092169190911790556020808201518051600288018054928401516001600160701b039283166001600160e01b031994851617600160701b918416820217909155604090940151805160038a0180549290950151908316919093161791169092029190911790558354600160c01b900460ff16156146b657835460ff60c01b1916845560405160ff8216906000906001600160a01b038816907f162ed187f3ed3879ae360c5df2a0a5dcaac7a208a9d762c2cbbfb1f5fad8b81d908390a45b811561474657604051631ebda06d60e01b8152600481018790526001600160a01b038681166024830152604482018490527f00000000000000000000000000000000000000000000000000000000000000001690631ebda06d90606401600060405180830381600087803b15801561472d57600080fd5b505af1158015614741573d6000803e3d6000fd5b505050505b6040805160608101825260048601546001600160801b038082168352600160801b909104166020820152600586015491810191909152611d89908790879086906142f7565b60408051808201909152600080825260208201528415806147aa575083155b156147c85760405163bb55fd2760e01b815260040160405180910390fd5b60006147d98584611692818a615b54565b905060006147f18263ffffffff8716620f4240613a60565b90506040518060400160405280828461480a9190615b9b565b8152602001919091529695505050505050565b6040805180820190915260008082526020820152846000036148525760405163bb55fd2760e01b815260040160405180910390fd5b60006148778363ffffffff861661486c87620f4240615efd565b63ffffffff16613a60565b905060006148858285615b54565b905060006148988883611692818b615b9b565b60408051808201909152908152602081019390935250909695505050505050565b600554640100000000900463ffffffff166000036148d45750565b60608101516005546000916148fa91640100000000900463ffffffff16620f4240613a60565b9050808260c00181815161490e9190615b9b565b90525061012082015161492357608090910152565b6149388260c001518360a0015160008461478b565b51608083015260c082018051829190614952908390615b54565b905250608082015160a08301805161496b908390615b9b565b90525060e082018051829190614982908390615b9b565b9052505050565b614991615665565b6001600160801b038911806149ac57506001600160801b0388115b806149bd57506001600160801b0387115b806149ce57506001600160801b0386115b806149df57506001600160801b0385115b806149ec5750620f424084115b806149f95750620f424083115b80614a0357508582115b15614a21576040516318b103bd60e21b815260040160405180910390fd5b6000620f4240614a318582615b9b565b614a3b9085615e52565b614a459190615ee9565b9050614a51888a615b54565b620f4240614a5f8682615b9b565b614a69908a615e52565b614a739190615ee9565b1115614b68576000614a85898b615b54565b620f4240614a938782615b9b565b614a9d908b615e52565b614aa79190615ee9565b614ab19190615b9b565b90506000614abf8a8c615b54565b614ac9908a615b9b565b9050614ad78b8b8b88614f16565b8015614ae1575060005b15614afc57614af58c8c8b858b8a89614f40565b9350614b61565b8b15614b2e57614b0f8c8c8c8c87615019565b9350614b1f8c8c8b84878d61509a565b60a08601526080850152614b61565b88614b398b85615e52565b614b439190615ee9565b6060850152614b568c8c8b84878d61509a565b60a086015260808501525b5050614be3565b6000614b7d614b778a8c615b54565b89614ea6565b9050600081118015614b965750614b968a8a8a87614f16565b8015614bab5750614bab8a898389898961510f565b15614bc757614bc08b8b8a848a8a8a89615199565b9250614be1565b8a15614bd957614bc08b8b8b85615247565b606083018290525b505b614bed8184615b9b565b60c08301525098975050505050505050565b600061169d836001600160a01b0384166152b8565b60408051808201909152600080825260208201526000614c348484615307565b9050838302808210614c695760405180604001604052808284614c579190615b9b565b81526020018281525092505050610c64565b60405180604001604052806001614c808585900390565b614c8a9190615b9b565b815260200191909152949350505050565b60008180614cab57614cab615ed3565b838509949350505050565b604080518082019091526000808252602082015281836020015110614cfa57604051806040016040528084600001518152602001838560200151613b6e9190615b9b565b604051806040016040528060018560000151614d169190615b9b565b8152602001614d29856020015185900390565b90529392505050565b600080614d4a614d4484808403615ee9565b60010190565b9050828460200151614d5c9190615ee9565b8451820217949350505050565b60006001815b6008811015611e3a578382026002038202915080614d8c81615e87565b915050614d6f565b604080518082019091526000808252602082015282516020830151614dc2916001600160701b031690615e52565b60208401518351614ddc916001600160701b031690615e52565b03614de8575081610c64565b61169d613c17614df785613d78565b8460046001615316565b600080614e0f858585613a60565b90506000614e1e868686614c9b565b1115612d67576000198110614e4657604051631a93c68960e11b815260040160405180910390fd5b613a89816001615b54565b6000826000018281548110614e6857614e68615e71565b9060005260206000200154905092915050565b600061169d836001600160a01b0384166153a7565b6000818310614e9f578161169d565b5090919050565b6000818311614eb657600061169d565b61169d8284615b9b565b600081831015614e9f578161169d565b6000614edc8284615f4a565b15614ee8576001614eeb565b60005b60ff16614ef88385615ee9565b61169d9190615b54565b6000614f0e838361549a565b159392505050565b6000614f228284615b9b565b614f2c9085615e52565b614f368387615e52565b1095945050505050565b614f48615665565b6000614f5785620f4240615b9b565b614f619087615e52565b90506000614f7f89614f76620f42408b615e52565b878560016154c2565b9050614fc4614f98614f91878d615e52565b8484613a60565b604080518082019091526000808252602082015250604080518082019091529081526000602082015290565b8352615000614fd486898b613a60565b604080518082019091526000808252602082015250604080518082019091529081526001602082015290565b6040840152505060608101919091529695505050505050565b615021615665565b60006150496150308785615e52565b61503a8587615b9b565b6150449088615e52565b614ea6565b905061505d614fd48883611692888b615e52565b8083526020830152615072614fd48583615ee9565b604083015261508b836150858789615b54565b86613a60565b60608301525095945050505050565b600080806150a88686615e52565b905060006150b68886615e52565b9050808211156150f15760008a116150cf5760006150e7565b6150e78a6150dd8385615b9b565b6116928b8d615e52565b9350849250615102565b600093506150ff8883615ee9565b92505b5050965096945050505050565b60008061514b61511f888a615e52565b620f424061512d878b615e52565b615137898b615e52565b6151419190615b54565b61453c9190615e52565b9050600061518061515c8589615e52565b61516988620f4240615b9b565b615173888c615e52565b615137620f42408c615e52565b905061518c828261549a565b9998505050505050505050565b6151a1615665565b60006151ad8589615e52565b6151ba620f424089615e52565b6151c49190615b54565b905060006152048a6151d989620f4240615b9b565b6151e3908c615e52565b876151f18b620f4240615b9b565b6151fb9087615e52565b620f42406154e3565b9050615216614fd4614f91878e615e52565b835261522d614f988684611692620f42408e615e52565b604084015250506060810191909152979650505050505050565b61524f615665565b600061525b8385614ea6565b905061526b614fd4878388613a60565b80835260208301526152a381604080518082019091526000808252602082015250604080518082019091529081526001602082015290565b60408301525060608101919091529392505050565b60008181526001830160205260408120546152ff57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610c64565b506000610c64565b60006000198284099392505050565b60408051808201909152600080825260208201526040518060400160405280838660000151886020015161534a9190615e52565b6153549190615e52565b60208701518851879161536691615e52565b6153709190615e52565b61537a9190615b54565b81526020016153898486615b54565b8660200151886020015161539d9190615e52565b613c959190615e52565b600081815260018301602052604081205480156154905760006153cb600183615b9b565b85549091506000906153df90600190615b9b565b90508181146154445760008660000182815481106153ff576153ff615e71565b906000526020600020015490508087600001848154811061542257615422615e71565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061545557615455615f5e565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610c64565b6000915050610c64565b80518251600091108061169d57508151835114801561169d5750506020908101519101511190565b60006154cf848484613a60565b6154d98688615e52565b612fe89190615b9b565b60006154f0848484613a60565b6154fa8688615e52565b612fe89190615b54565b6040805160c08101825260008082526020820181905291810182905260608101919091526080810161553461555c565b815260408051606081018252600080825260208281018290529282015291015290565b905290565b6040518060600160405280600063ffffffff16815260200161558e604080518082019091526000808252602082015290565b8152602001615557604080518082019091526000808252602082015290565b6040518061018001604052806000815260200160008152602001600081526020016155ed6040518060400160405280600081526020016000151581525090565b81526020016156116040518060400160405280600081526020016000151581525090565b81526020016156356040518060400160405280600081526020016000151581525090565b81526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b6040805161012081018252600060e082018181526101008301829052825282518084018452818152602080820183905280840191909152835180850185528281529081019190915290918201908152602001600081526020016000815260200160008152602001600081525090565b6001600160a01b03811681146116e157600080fd5b6000602082840312156156fb57600080fd5b813561169d816156d4565b81516001600160a01b0316815260208083015163ffffffff908116828401526040808501511515908401526060808501511515908401526080808501518051909216908401528082015180516001600160701b0390811660a08601529281015190921660c0840152610180830191506040015180516001600160701b0390811660e08501526020820151166101008401525060a083015180516001600160801b039081166101208501526020820151166101408401526040810151610160840152611e3a565b600080604083850312156157df57600080fd5b82356157ea816156d4565b946020939093013593505050565b60008060006060848603121561580d57600080fd5b8335615818816156d4565b95602085013595506040909401359392505050565b63ffffffff811681146116e157600080fd5b60006020828403121561585157600080fd5b813561169d8161582d565b60008060006060848603121561587157600080fd5b833561587c816156d4565b9250602084013561588c816156d4565b929592945050506040919091013590565b81518152602080830151908201526040808301519082015260608101610c64565b600080600080600060a086880312156158d657600080fd5b8535945060208601356158e8816156d4565b935060408601356158f8816156d4565b94979396509394606081013594506080013592915050565b80151581146116e157600080fd5b6000806040838503121561593157600080fd5b823561593c816156d4565b9150602083013561594c81615910565b809150509250929050565b6000808284036101a081121561596c57600080fd5b8335615977816156d4565b9250610180601f198201121561598c57600080fd5b506020830190509250929050565b600080604083850312156159ad57600080fd5b82356159b8816156d4565b9150602083013561594c8161582d565b6000602082840312156159da57600080fd5b813561169d81615910565b600080600080608085870312156159fb57600080fd5b843593506020850135615a0d816156d4565b92506040850135615a1d816156d4565b9396929550929360600135925050565b81516001600160801b039081168252602080840151909116908201526040808301519082015260608101610c64565b6020808252825182820181905260009190848201906040850190845b81811015615a9d5783516001600160a01b031683529284019291840191600101615a78565b50909695505050505050565b60008060008060008060c08789031215615ac257600080fd5b863595506020870135615ad4816156d4565b94506040870135615ae4816156d4565b9350606087013592506080870135915060a0870135615b0281615910565b809150509295509295509295565b60008060408385031215615b2357600080fd5b8235615b2e816156d4565b9150602083013561594c816156d4565b634e487b7160e01b600052601160045260246000fd5b60008219821115615b6757615b67615b3e565b500190565b600060208284031215615b7e57600080fd5b5051919050565b634e487b7160e01b600052602160045260246000fd5b600082821015615bad57615bad615b3e565b500390565b600060208284031215615bc457600080fd5b815161169d81615910565b600060208284031215615be157600080fd5b815161169d816156d4565b634e487b7160e01b600052604160045260246000fd5b60405160c0810167ffffffffffffffff81118282101715615c3357634e487b7160e01b600052604160045260246000fd5b60405290565b6040516060810167ffffffffffffffff81118282101715615c3357634e487b7160e01b600052604160045260246000fd5b80356001600160701b0381168114615c8157600080fd5b919050565b600060408284031215615c9857600080fd5b6040516040810181811067ffffffffffffffff82111715615cc957634e487b7160e01b600052604160045260246000fd5b604052905080615cd883615c6a565b8152615ce660208401615c6a565b60208201525092915050565b80356001600160801b0381168114615c8157600080fd5b600060608284031215615d1b57600080fd5b6040516060810181811067ffffffffffffffff82111715615d4c57634e487b7160e01b600052604160045260246000fd5b604052905080615d5b83615cf2565b8152615d6960208401615cf2565b6020820152604083013560408201525092915050565b6000818303610180811215615d9357600080fd5b615d9b615c02565b8335615da6816156d4565b81526020840135615db68161582d565b60208201526040840135615dc981615910565b60408201526060840135615ddc81615910565b606082015260a0607f1983011215615df357600080fd5b615dfb615c39565b91506080840135615e0b8161582d565b8252615e1a8560a08601615c86565b6020830152615e2c8560e08601615c86565b6040830152816080820152615e45856101208601615d09565b60a0820152949350505050565b6000816000190483118215151615615e6c57615e6c615b3e565b500290565b634e487b7160e01b600052603260045260246000fd5b600060018201615e9957615e99615b3e565b5060010190565b600060208284031215615eb257600080fd5b815161169d8161582d565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b600082615ef857615ef8615ed3565b500490565b600063ffffffff83811690831681811015615f1a57615f1a615b3e565b039392505050565b600063ffffffff808316818516808303821115615f4157615f41615b3e565b01949350505050565b600082615f5957615f59615ed3565b500690565b634e487b7160e01b600052603160045260246000fdfea164736f6c634300080d000a'; + "0x6101806040523480156200001257600080fd5b50604051620063213803806200632183398101604081905262000035916200028b565b6200004033620000fc565b6200004b8862000156565b620000568762000156565b620000618662000156565b6200006c8562000156565b620000778462000156565b620000828362000156565b6200008d8262000156565b620000988162000156565b6001600160a01b0380891660805287811660a05286811660c05285811660e052848116610100528381166101205282811661014052811661016052620000e06107d062000181565b620000ee62030d40620001f4565b50505050505050506200034c565b600080546001600160a01b038381166001600160a01b031980841682178555600180549091169055604051919092169283917f343765429aea5a34b3ff6a3785a98a5abb2597aca87bfbb58632c173d585373a9190a35050565b6001600160a01b0381166200017e5760405163e6c4247b60e01b815260040160405180910390fd5b50565b60055463ffffffff90811690821681036200019a575050565b6005805463ffffffff191663ffffffff84811691821790925560408051928416835260208301919091527fb804b0ec3f0ea43004870df377170ce44cb789adca16d23286e337605558117f91015b60405180910390a15050565b60055463ffffffff6401000000009091048116908216810362000215575050565b6005805463ffffffff60201b191664010000000063ffffffff8581169182029290921790925560408051918416825260208201929092527f1f1f36475e04b1709caf649fc7f00350aa38c7f7f110f653e81f79011db0867c9101620001e8565b6001600160a01b03811681146200017e57600080fd5b600080600080600080600080610100898b031215620002a957600080fd5b8851620002b68162000275565b60208a0151909850620002c98162000275565b60408a0151909750620002dc8162000275565b60608a0151909650620002ef8162000275565b60808a0151909550620003028162000275565b60a08a0151909450620003158162000275565b60c08a0151909350620003288162000275565b60e08a01519092506200033b8162000275565b809150509295985092959890939650565b60805160a05160c05160e05161010051610120516101405161016051615eb26200046f600039600081816114bc0152611f150152600061126a015260008181612e2101526133560152600081816123d8015281816124a5015281816125770152818161316e015281816132080152818161325c0152614637015260008181611a3c0152818161225e01528181612dc5015281816132890152818161332601528181613406015261367b0152600081816108c1015281816111c001528181611aa201528181611cf20152818161234c01528181612e6101526134f3015260008181612a5801526142830152600081816107af01528181610dc3015281816110fa01528181611179015281816116ec01528181611e6b0152611fe90152615eb26000f3fe608060405234801561001057600080fd5b50600436106102485760003560e01c8063915b99411161013b578063c5c51dca116100b8578063ee4808fe1161007c578063ee4808fe1461062a578063f2fde38b1461063d578063f525cb6814610650578063f6c5786114610658578063fba8cdee1461068657600080fd5b8063c5c51dca146105cb578063d1aebfc7146105e0578063d3df2424146105f3578063d4ee1d9014610606578063df2c3ab41461061757600080fd5b8063a135ef17116100ff578063a135ef17146104c8578063aa55a9b11461054b578063b1dd61b61461055e578063bedf952514610565578063c2cf42521461059857600080fd5b8063915b99411461046e5780639181d2e314610481578063921a929e146104945780639f5c734b146104a75780639fc19231146104ba57600080fd5b806354fd4d50116101c957806379ba50971161018d57806379ba50971461041c578063814175851461042457806387a7db0f146104375780638da5cb5b1461044a5780639049f9d21461045b57600080fd5b806354fd4d501461038657806356aca36f1461039c5780635768adcf146103af5780636161b626146103f357806372d960e11461040957600080fd5b806330cdb3081161021057806330cdb308146102d45780633376af511461031f57806334afba2b146103325780634ceea75314610352578063541868c81461037357600080fd5b8063136efb7a1461024d5780631510748b146102765780631c754cae1461028b5780632258cc691461029e57806327910565146102c1575b600080fd5b61026061025b366004615637565b610699565b60405161026d9190615654565b60405180910390f35b61028961028436600461571a565b6107ad565b005b610289610299366004615746565b61080d565b6102b16102ac366004615637565b610a85565b604051901515815260200161026d565b6102896102cf366004615637565b610ac2565b61030a6102e2366004615637565b6001600160a01b0316600090815260026020526040902054600160a01b900463ffffffff1690565b60405163ffffffff909116815260200161026d565b61028961032d36600461578d565b610b24565b6103456103403660046157aa565b610b3f565b60405161026d91906157eb565b61036561036036600461571a565b610bb4565b60405190815260200161026d565b61034561038136600461571a565b610c4d565b600c5b60405161ffff909116815260200161026d565b6103656103aa36600461580c565b610dbf565b6103db6103bd366004615637565b6001600160a01b039081166000908152600260205260409020541690565b6040516001600160a01b03909116815260200161026d565b600554640100000000900463ffffffff1661030a565b6103456104173660046157aa565b610fb5565b610289611031565b61028961043236600461586c565b611073565b610289610445366004615637565b6110f8565b6000546001600160a01b03166103db565b610289610469366004615637565b611177565b61028961047c3660046158a5565b6114b0565b61028961048f3660046158e8565b611561565b6103656104a2366004615746565b611612565b6103656104b5366004615916565b6116e8565b60055463ffffffff1661030a565b61053e6104d6366004615637565b6040805160608082018352600080835260208084018290529284018190526001600160a01b0394909416845260028252928290208251938401835260048101546001600160801b038082168652600160801b9091041691840191909152600501549082015290565b60405161026d919061595e565b610289610559366004615637565b611ba4565b6001610389565b6102b1610573366004615637565b6001600160a01b0316600090815260026020526040902054600160c01b900460ff1690565b6102b16105a6366004615637565b6001600160a01b0316600090815260026020526040902054600160c81b900460ff1690565b6105d3611d95565b60405161026d919061598d565b6103456105ee3660046159da565b611e45565b610289610601366004615a41565b611f09565b6001546001600160a01b03166103db565b6103456106253660046159da565b611fc3565b61036561063836600461571a565b61207f565b61028961064b366004615637565b61210e565b610365612167565b6102b1610666366004615637565b6001600160a01b0390811660009081526002602052604090205416151590565b61028961069436600461578d565b612178565b6106a1615452565b506001600160a01b03908116600090815260026020818152604092839020835160c0810185528154958616815263ffffffff600160a01b870481168285015260ff600160c01b88048116151583880152600160c81b9097049096161515606080830191909152855180820187526001840154909716875285518087018752948301546001600160701b038082168752600160701b9182900481168787015288860196909652865180880188526003850154808816825291909104909516858501528686019490945260808101959095528351928301845260048101546001600160801b038082168552600160801b9091041691830191909152600501549181019190915260a082015290565b7f00000000000000000000000000000000000000000000000000000000000000006107d781612193565b81156108085760006107e8846121bf565b9050828160040160010160008282546108019190615a85565b9091555050505b505050565b6108156121fc565b604080518082019091528281526020810182905261083281612227565b600061083d856121bf565b8054909150600160c01b900460ff161561086a57604051637952fbad60e11b815260040160405180910390fd5b6040516bffffffffffffffffffffffff1933606090811b8216602084015287901b166034820152604881018590526068810184905260009060880160405160208183030381529060405280519060200120905060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166387ba006a6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561091d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109419190615a9d565b9050610950828885878561224d565b60048301546001600160801b031681111561097e5760405163bb55fd2760e01b815260040160405180910390fd5b6000610989856126b0565b9050604051806060016040528061099d4390565b63ffffffff1681526020018281526020016109b783612710565b905280516001868101805463ffffffff191663ffffffff909316929092179091556020808301518051600289018054928401516001600160701b039283166001600160e01b031994851617600160701b918416820217909155604095860151805160038c0180549290960151908416919094161792909116021790558554600160c01b60ff60c01b19909116178655905181906001600160a01b038b16907f162ed187f3ed3879ae360c5df2a0a5dcaac7a208a9d762c2cbbfb1f5fad8b81d90600090a45050505050505050565b6001600160a01b0381166000908152600260208190526040822090610aa98261276a565b6002811115610aba57610aba615ab6565b149392505050565b610aca6121fc565b6000610ad5826121bf565b6040805160608101825260048301546001600160801b038082168352600160801b909104166020820152600583015491810191909152909150610b20906000908490849060016128d7565b5050565b610b2c6121fc565b80610b36816128f7565b610b2082612921565b610b6360405180606001604052806000815260200160008152602001600081525090565b81610b6d816129a9565b6000610b7f81878787600019846129ca565b9050610b8a81612c08565b60408051606080820183528351825283015160208201526080909201519082015295945050505050565b6001600160a01b038083166000908152600260209081526040808320805482516318160ddd60e01b8152925194959194610c4394889492909316926318160ddd92600480820193918290030181865afa158015610c15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c399190615a9d565b6005840154612d33565b9150505b92915050565b610c7160405180606001604052806000815260200160008152602001600081525090565b82610c7b81612d76565b82610c85816129a9565b6001600160a01b03808616600090815260026020908152604080832081516060810183526004808301546001600160801b038082168452600160801b9091041682860152600583015482850152825484516318160ddd60e01b8152945193979296959216936318160ddd93818301939290918290030181865afa158015610d10573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d349190615a9d565b90506000610d4788838560400151612d33565b90506000610d6d8a8a84878960000160149054906101000a900463ffffffff1688612d9d565b905060405180606001604052808260c001518360e00151610d8e9190615acc565b815260200182604001518360000151610da79190615a85565b815260006020909101529a9950505050505050505050565b60007f0000000000000000000000000000000000000000000000000000000000000000610deb81612193565b85610df581612d76565b84610dff816129a9565b84610e09816129a9565b6000610e14896121bf565b604080516060810182526004808401546001600160801b038082168452600160801b90910416602080840191909152600585015483850152845484516318160ddd60e01b8152945195965092946000946001600160a01b03909416936318160ddd938181019392918290030181865afa158015610e95573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eb99190615a9d565b90506000610ecc8b838560400151612d33565b9050808a1115610eef57604051633494a40d60e21b815260040160405180910390fd5b6001610efa8561276a565b6002811115610f0b57610f0b615ab6565b03610f29576040516301a6272960e41b815260040160405180910390fd5b6000610f4d8d8d8d878960000160149054906101000a900463ffffffff1688612d9d565b9050610f5c8f8f8f8885612ff9565b8454600160c01b900460ff1615610fa2576040805180820190915260048601546001600160801b038082168352600160801b909104166020820152610fa29086906136c8565b519e9d5050505050505050505050505050565b610fd960405180606001604052806000815260200160008152602001600081525090565b81610fe3816129a9565b6000610ff4818787876001806129ca565b9050610fff81612c08565b604051806060016040528082602001518152602001826060015181526020018260800151815250925050509392505050565b6001546001600160a01b0316331461105c57604051634ca8886760e01b815260040160405180910390fd5b600154611071906001600160a01b03166137c2565b565b61107b6121fc565b6000611086836121bf565b8054909150821515600160c81b90910460ff161515036110a557505050565b805460ff60c81b1916600160c81b8315159081029190911782556040516001600160a01b038516907fa606e6917bc476eb72d24f486596af7f564fb7b50f73135c81c0e8e0553430cd90600090a3505050565b7f000000000000000000000000000000000000000000000000000000000000000061112281612193565b600061112d836121bf565b604080516060810182526004808401546001600160801b038082168452600160801b90910416602083015260058401549282019290925291925061080891600091869185916128d7565b7f00000000000000000000000000000000000000000000000000000000000000006111a181612193565b60405163b5af090f60e01b81526001600160a01b0383811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063b5af090f90602401602060405180830381865afa158015611207573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061122b9190615ae3565b61124857604051630b094f2760e31b815260040160405180910390fd5b604051632b625f2360e01b81526001600160a01b0383811660048301526000917f000000000000000000000000000000000000000000000000000000000000000090911690632b625f23906024016020604051808303816000875af11580156112b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112d99190615b00565b9050806001600160a01b03166379ba50976040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561131657600080fd5b505af115801561132a573d6000803e3d6000fd5b5050505060006040518060c00160405280836001600160a01b03168152602001600560009054906101000a900463ffffffff1663ffffffff1681526020016000151581526020016001151581526020016040518060600160405280600063ffffffff16815260200161139a61381c565b81526020016113a761381c565b9052815260408051606081018252600080825260208281018290529282015291015290506113d58482613845565b60408082015190516000911515906001600160a01b038716907f162ed187f3ed3879ae360c5df2a0a5dcaac7a208a9d762c2cbbfb1f5fad8b81d908490a4836001600160a01b03167fa2d66c1e2cc4b2cc5daaabc06447542e989ed748a9fb22476b6c913dcc1c7f4b6000836020015160405161146592919063ffffffff92831681529116602082015260400190565b60405180910390a280606001511515846001600160a01b03167fa606e6917bc476eb72d24f486596af7f564fb7b50f73135c81c0e8e0553430cd60405160405180910390a350505050565b816114ba81612d76565b7f00000000000000000000000000000000000000000000000000000000000000006114e481612193565b6114fc846114f736869003860186615cb0565b613845565b6115096020840184615637565b6001600160a01b03166379ba50976040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561154357600080fd5b505af1158015611557573d6000803e3d6000fd5b5050505050505050565b6115696121fc565b80611573816128f7565b600061157e846121bf565b805490915063ffffffff600160a01b909104811690841681036115a2575050505050565b815463ffffffff60a01b1916600160a01b63ffffffff86811691820292909217845560408051928416835260208301919091526001600160a01b038716917fa2d66c1e2cc4b2cc5daaabc06447542e989ed748a9fb22476b6c913dcc1c7f4b910160405180910390a25050505050565b600082600003611624575060006116e1565b6001600160a01b038085166000908152600260209081526040808320805482516318160ddd60e01b81529251919516926318160ddd92600480820193918290030181865afa15801561167a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061169e9190615a9d565b905060006116ac8287615d83565b90506116db81836116bd8882615acc565b60058701546116cc9190615d83565b6116d69085615a85565b61399e565b93505050505b9392505050565b60007f000000000000000000000000000000000000000000000000000000000000000061171481612193565b8461171e81612d76565b83611728816129a9565b6000611733876121bf565b8054909150600160c81b900460ff1661175f576040516303a5be3f60e31b815260040160405180910390fd5b8054604080516318160ddd60e01b815290516000926001600160a01b0316916318160ddd9160048083019260209291908290030181865afa1580156117a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117cc9190615a9d565b60058301549091506117dc6154aa565b821580156117e957508115155b1561186e576040805160608101825260048601546001600160801b038082168352600160801b909104166020820152600586015491810191909152600092506118368d8c878460036128d7565b6040518060600160405280600063ffffffff16815260200161185661381c565b815260200161186361381c565b815250915050611930565b604080516060808201835260048701546001600160801b038082168452600160801b9091048116602080850191825260058a0154858701528551938401865260018a015463ffffffff1684528551808701875260028b01546001600160701b038082168352600160701b91829004811683850152868401929092528751808901895260038d015480841682529190910490911681830152848701528551808701909652845183168652905190911690840152909161192c9190613a6a565b9150505b600061193d8a8585613bde565b90506119498a84615a85565b600586015584546040516340c10f1960e01b81526001600160a01b038e8116600483015260248201849052909116906340c10f1990604401600060405180830381600087803b15801561199b57600080fd5b505af11580156119af573d6000803e3d6000fd5b505050508a6001600160a01b03168c6001600160a01b03168e7fecb7e4cd1580472adaeba712b36acf94439b2e1760af55fedb61960ca4422af38d85604051611a02929190918252602082015260400190565b60405180910390a46001600160a01b038b168d7f67c4863f17da9847c57c9fa043e63a0ddf4f5a86fd63a6f71ea69057a11c411a611a60837f0000000000000000000000000000000000000000000000000000000000000000613c12565b6005890154611a6f868a615a85565b6040805193845260208401929092529082015260600160405180910390a3611b278d8c87611aa08660200151613cb6565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166387ba006a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611afe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b229190615a9d565b61224d565b8454600160c01b900460ff1615611b94576040805160608101825260048701546001600160801b038082168352600160801b9091048116602080840191825260058a015484860152845180860190955283518316855290519091169083015290611b929087906136c8565b505b9c9b505050505050505050505050565b611bac6121fc565b6000611bb7826121bf565b604080516060808201835260048401546001600160801b038082168452600160801b820490811660208086019190915260058701548587015294516bffffffffffffffffffffffff1933851b8116968201969096529288901b90941660348301526001600160801b0319608091821b8116604884015293901b909216605883015291925060009060680160408051601f198184030181528282528051602091820120606084018352600187015463ffffffff1684528251808401845260028801546001600160701b038082168352600160701b91829004811683860152868501929092528451808601865260038a01548084168252919091049091168184015284840152825180840190935285516001600160801b0390811684528683015116918301919091529250600091611cec91613a6a565b905060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166387ba006a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611d4e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d729190615a9d565b9050611d8d838787611d878660200151613cb6565b8561224d565b505050505050565b60606000611da36003613cf2565b905060008167ffffffffffffffff811115611dc057611dc0615b1d565b604051908082528060200260200182016040528015611de9578160200160208202803683370190505b50905060005b82811015611e3e57611e02600382613cfc565b828281518110611e1457611e14615da2565b6001600160a01b039092166020928302919091019091015280611e3681615db8565b915050611def565b5092915050565b611e6960405180606001604052806000815260200160008152602001600081525090565b7f0000000000000000000000000000000000000000000000000000000000000000611e9381612193565b84611e9d816129a9565b84611ea7816129a9565b6000611eb88b8b8b8b8b60016129ca565b90508515611ec95760006101608201525b611ed281613d08565b6040518060600160405280826020015181526020018260600151815260200182608001518152509450505050509695505050505050565b80611f1381612d76565b7f0000000000000000000000000000000000000000000000000000000000000000611f3d81612193565b6001600160a01b0380851660009081526002602052604090205416611f6185613e44565b60405163f2fde38b60e01b81526001600160a01b03858116600483015282169063f2fde38b90602401600060405180830381600087803b158015611fa457600080fd5b505af1158015611fb8573d6000803e3d6000fd5b505050505050505050565b611fe760405180606001604052806000815260200160008152602001600081525090565b7f000000000000000000000000000000000000000000000000000000000000000061201181612193565b8461201b816129a9565b84612025816129a9565b60006120368b8b8b8b8b60006129ca565b905085156120475760006101608201525b61205081613d08565b6040805160608082018352835182528301516020820152608090920151908201529a9950505050505050505050565b6001600160a01b038083166000908152600260209081526040808320805482516318160ddd60e01b8152925194959194610c4394889492909316926318160ddd92600480820193918290030181865afa1580156120e0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121049190615a9d565b6005840154613bde565b6121166121fc565b6000546001600160a01b039081169082160361214557604051630a98f1f360e21b815260040160405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60006121736003613cf2565b905090565b6121806121fc565b8061218a816128f7565b610b2082613ece565b336001600160a01b038216146121bc57604051634ca8886760e01b815260040160405180910390fd5b50565b6001600160a01b03808216600090815260026020526040812080549192909116610c475760405163b0ce759160e01b815260040160405180910390fd5b6000546001600160a01b0316331461107157604051634ca8886760e01b815260040160405180910390fd5b61223081613f38565b6121bc57604051636a43f8d160e01b815260040160405180910390fd5b60006122826001600160a01b0386167f0000000000000000000000000000000000000000000000000000000000000000613c12565b9050806000036122a55760405163bb55fd2760e01b815260040160405180910390fd5b60016122b08561276a565b60028111156122c1576122c1615ab6565b036122cc57506126a9565b6040805160608101825260048601546001600160801b038082168352600160801b90910416602082015260058601549181019190915261230b84613f38565b6123245761231d8787878460026128d7565b50506126a9565b60405163467e55df60e01b81526001600160a01b03878116600483015260009161244b9185917f00000000000000000000000000000000000000000000000000000000000000009091169063467e55df90602401602060405180830381865afa158015612395573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123b99190615a9d565b604051637ea6a56960e11b81526001600160a01b038b811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063fd4d4ad290602401602060405180830381865afa15801561241f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124439190615a9d565b858989613f55565b805190915061245c575050506126a9565b6020810151158061246f57506040810151155b1561248a576124828888888560026128d7565b5050506126a9565b81600001516001600160801b03168160200151111561255c577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166371c0feb7898985600001516001600160801b031685602001516124f19190615acc565b6040516001600160e01b031960e086901b16815260048101939093526001600160a01b0390911660248301526044820152606401600060405180830381600087803b15801561253f57600080fd5b505af1158015612553573d6000803e3d6000fd5b5050505061262a565b81600001516001600160801b03168160200151101561262a577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316631ebda06d8989846020015186600001516001600160801b03166125c39190615acc565b6040516001600160e01b031960e086901b16815260048101939093526001600160a01b0390911660248301526044820152606401600060405180830381600087803b15801561261157600080fd5b505af1158015612625573d6000803e3d6000fd5b505050505b6000604051806060016040528061264484602001516141d4565b6001600160801b0316815260200161265f84604001516141d4565b6001600160801b0390811682526040808701516020938401528351928401518216600160801b02929091169190911760048a015581015160058901559050611fb889898584614245565b5050505050565b604080518082019091526000808252602082015260006126d7836001600160701b0361436a565b9050604051806040016040528082600001516001600160701b0316815260200182602001516001600160701b0316815250915050919050565b6040805180820190915260008082526020820152604080518082019091526020838101516001600160701b03908116835284511690820181905215155b610c4757604051630d38a7e760e11b815260040160405180910390fd5b60408051808201825260048301546001600160801b038082168352600160801b909104166020808301919091528251606081018452600185015463ffffffff1681528351808501855260028601546001600160701b038082168352600160701b9182900481168386015283850192835286518088018852600389015480831682529290920416938101939093529381019190915291516000929061280d83613f38565b158061281f575061281d816143f9565b155b1561282f57506000949350505050565b600061283a84614428565b604084015190915061284b82613f38565b158061285d575061285b816143f9565b155b1561286f575060009695505050505050565b600061287b8587613a6a565b905061289661288d8260200151613cb6565b8761271061445d565b80156128b657506128b66128ad8260400151613cb6565b8461271061445d565b156128c957506002979650505050505050565b506001979650505050505050565b60048301546126a99086908690869086906001600160801b0316866144ff565b620f424063ffffffff821611156121bc576040516358d620b360e01b815260040160405180910390fd5b60055463ffffffff64010000000090910481169082168103612941575050565b6005805467ffffffff00000000191664010000000063ffffffff8581169182029290921790925560408051918416825260208201929092527f1f1f36475e04b1709caf649fc7f00350aa38c7f7f110f653e81f79011db0867c91015b60405180910390a15050565b806000036121bc57604051637c946ed760e01b815260040160405180910390fd5b612a4b604051806101a00160405280600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160006001600160a01b03168152602001600015158152602001600015158152602001600063ffffffff168152602001600080191681525090565b6001600160a01b038681167f0000000000000000000000000000000000000000000000000000000000000000821690811491871614818015612a8b575080155b15612aad5760016101208401526001600160a01b038716610100840152612af3565b81158015612ab85750805b15612ada5760006101208401526001600160a01b038816610100840152612af3565b60405163b0ce759160e01b815260040160405180910390fd5b6000612b038461010001516121bf565b8054909150600160c01b900460ff16612b2f5760405163bcb8b8fb60e01b815260040160405180910390fd5b61018084018a905284158015610140860152612b4d57868452612b55565b602084018790525b60408481018790528154600160a01b900463ffffffff16610160860152805160608101825260048301546001600160801b038082168352600160801b90910416602082015260058301549181019190915261012085015115612bd35780516001600160801b0390811660a087015260208201511660c0860152612bf1565b60208101516001600160801b0390811660a087015281511660c08601525b6040015160e0850152509198975050505050505050565b604080518082019091526000808252602082015281610140015115612c7957612c448260a001518360c0015184610160015185600001516146d9565b80516020840181905260408401519192501015612c745760405163f31ee7a560e01b815260040160405180910390fd5b612ccc565b612c968260a001518360c00151846101600151856020015161476b565b80518084529091501580612cae575060408201518251115b15612ccc5760405163681c2ccd60e11b815260040160405180910390fd5b60208101516060830152815160a083018051612ce9908390615a85565b905250602082015160c083018051612d02908390615acc565b90525061012082015115612d2a5781606001518260e001818151612d269190615a85565b9052505b610b2082614807565b600082600003612d63578115612d5c57604051636a9c61e160e01b815260040160405180910390fd5b50826116e1565b612d6e84838561399e565b949350505050565b6001600160a01b0381166121bc5760405163e6c4247b60e01b815260040160405180910390fd5b612da56154fb565b60208401516000906001600160801b0316612de96001600160a01b038a167f0000000000000000000000000000000000000000000000000000000000000000613c12565b612df39190615acc565b90506000612eed86600001516001600160801b031687602001516001600160801b0316848960400151612e587f00000000000000000000000000000000000000000000000000000000000000008f6001600160a01b0316613c1290919063ffffffff16565b8a63ffffffff167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316632aac012c6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612ebd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ee19190615dd1565b63ffffffff168e6148d7565b905060405180610180016040528082606001518152602001826080015181526020018260a0015181526020018260400151815260200182600001518152602001826020015181526020018260c001518152602001888152602001898152602001858152602001826040015160200151612f83576040830151516020890151612f7e91906001600160801b0316615a85565b612fa1565b6040830151516020890151612fa191906001600160801b0316615acc565b8152602001826000015160200151612fd0578251518851612fcb91906001600160801b0316615a85565b612fe8565b8251518851612fe891906001600160801b0316615acc565b9052925050505b9695505050505050565b60408051606081018252600484810180546001600160801b038082168552600160801b90910416602084015260058601548385015285546101008601519451630852cd8d60e31b815292830194909452926001600160a01b0316906342966c6890602401600060405180830381600087803b15801561307757600080fd5b505af115801561308b573d6000803e3d6000fd5b5050505060008361010001518461012001516130a79190615acc565b905060006130bf84600101548387610120015161399e565b90508084600101819055506130d88561014001516141d4565b84546001600160801b03918216600160801b0291161784556101608501516130ff906141d4565b84546001600160801b0319166001600160801b039190911617845560a085015151156131d2578460a001516020015161313a5761313a615dee565b60a085015151604051631ebda06d60e01b8152600481018b90526001600160a01b03898116602483015260448201929092527f000000000000000000000000000000000000000000000000000000000000000090911690631ebda06d906064015b600060405180830381600087803b1580156131b557600080fd5b505af11580156131c9573d6000803e3d6000fd5b505050506132f8565b608085015151156132f8578460800151602001511561323f57608085015151604051631538c64b60e31b815260048101919091527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063a9c632589060240161319b565b6080850151516040516340c10f1960e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016916340c10f19916132c5917f0000000000000000000000000000000000000000000000000000000000000000916004016001600160a01b03929092168252602082015260400190565b600060405180830381600087803b1580156132df57600080fd5b505af11580156132f3573d6000803e3d6000fd5b505050505b6040850151156133ce576040858101519051631c20fadd60e01b81526001600160a01b0389811660048301527f00000000000000000000000000000000000000000000000000000000000000008116602483015260448201929092527f000000000000000000000000000000000000000000000000000000000000000090911690631c20fadd90606401600060405180830381600087803b15801561339c57600080fd5b505af11580156133b0573d6000803e3d6000fd5b505050508460400151856000018181516133ca9190615a85565b9052505b845115613465578451604051631c20fadd60e01b81526001600160a01b0389811660048301528a8116602483015260448201929092527f000000000000000000000000000000000000000000000000000000000000000090911690631c20fadd90606401600060405180830381600087803b15801561344c57600080fd5b505af1158015613460573d6000803e3d6000fd5b505050505b8461014001516000036134f15761347a61381c565b80516002880180546020909301516001600160701b03908116600160701b026001600160e01b03199094169216919091179190911790556134b961381c565b80516003880180546020909301516001600160701b03908116600160701b026001600160e01b03199094169216919091179190911790555b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166387ba006a6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561354f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135739190615a9d565b8561016001511015613598576135938988888689610160015160026144ff565b6135da565b6040805160608101825285546001600160801b038082168352600160801b9091041660208201526001860154918101919091526135da908a9089908690614245565b845161010086015160408088015160c089015182519485526020850193909352908301526000606083015260808201526001600160a01b0380891691908a16908b907feab8ac9e9478a4b3c37a794ecef629b8a8bbcd96f9eaeac8ed26054d144da52d9060a00160405180910390a46001600160a01b038716897f67c4863f17da9847c57c9fa043e63a0ddf4f5a86fd63a6f71ea69057a11c411a61369f837f0000000000000000000000000000000000000000000000000000000000000000613c12565b6040805191825260208201869052810186905260600160405180910390a3505050505050505050565b60408051606081018252600184015463ffffffff1681528151808301835260028501546001600160701b038082168352600160701b918290048116602084810191909152808501939093528451808601865260038801548083168252929092041691810191909152918101919091526137419082613a6a565b805160018401805463ffffffff191663ffffffff9092169190911790556020808201518051600286018054928401516001600160701b039283166001600160e01b031994851617600160701b918416820217909155604090940151805160039097018054919094015196821692169190911794169091029290921790915550565b600080546001600160a01b038381166001600160a01b031980841682178555600180549091169055604051919092169283917f343765429aea5a34b3ff6a3785a98a5abb2597aca87bfbb58632c173d585373a9190a35050565b604080518082018252600080825260209182018190528251808401909352825260019082015290565b613850600383614b4d565b61386d5760405163119b4fd360e11b815260040160405180910390fd5b6001600160a01b039182166000908152600260208181526040928390208451815486840151878701516060890151939099166001600160c01b031990921691909117600160a01b63ffffffff928316021761ffff60c01b1916600160c01b9815159890980260ff60c81b191697909717600160c81b911515919091021781556080850151805160018301805463ffffffff191691909816179096558582015180519382018054918401516001600160701b039586166001600160e01b031993841617600160701b91871682021790915596850151805160038401805492860151918716929093169190911794169096029290921790945560a0909201518051938101516001600160801b03948516600160801b95909116949094029390931760048301559190910151600590910155565b6000806139ab8585614b62565b80519091506000036139cf578281602001516139c79190615e1a565b9150506116e1565b805183116139f057604051631a93c68960e11b815260040160405180910390fd5b60006139fd868686614be9565b90506000613a0b8383614c04565b8051909150600003613a3157848160200151613a279190615e1a565b93505050506116e1565b6000858103861690613a438383614c80565b90506000613a59613a54848a615e1a565b614cb7565b919091029998505050505050505050565b613a726154aa565b613a7b82613f38565b613ab5576040518060600160405280600063ffffffff168152602001613a9f61381c565b8152602001613aac61381c565b90529050610c47565b8251439063ffffffff80831690821603613ad3578492505050610c47565b6064613adf8284615e2e565b63ffffffff16101580613afc5750613afa85602001516143f9565b155b80613b115750613b0f85604001516143f9565b155b15613b9357613b1f84613f38565b15613b665760405180606001604052808363ffffffff168152602001613b44866126b0565b8152602001613b5a613b5587614428565b6126b0565b81525092505050610c47565b6040518060600160405280600063ffffffff168152602001613b8661381c565b8152602001613b5a61381c565b60405180606001604052808363ffffffff168152602001613bb8876020015187614ce2565b8152602001613bd38760400151613bce88614428565b614ce2565b905295945050505050565b600082600003613c07578115612d5c57604051636a9c61e160e01b815260040160405180910390fd5b612d6e848484614d4f565b600073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6001600160a01b03841603613c4957506001600160a01b03811631610c47565b826040516370a0823160e01b81526001600160a01b03848116600483015291909116906370a0823190602401602060405180830381865afa158015613c92573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116e19190615a9d565b6040805180820182526000808252602091820152815180830190925282516001600160701b039081168352928101519092169181019190915290565b6000610c47825490565b60006116e18383614d9f565b6101008101516001600160a01b0316600090815260026020908152604091829020825160608101845260048201546001600160801b038082168352600160801b9091048116828501908152600584015483870152855180870190965282518216865251169284019290925291613d7f9083906136c8565b613d8883612c08565b60006040518060600160405280613db6866101200151613dac578660c001516141d4565b8660a001516141d4565b6001600160801b03168152602001613de5866101200151613ddb578660a001516141d4565b8660c001516141d4565b6001600160801b031681526020018560e001518152509050613e138461018001518561010001518484614245565b805160208201516001600160801b03908116600160801b029116176004840155604001516005909201919091555050565b613e4f600382614dc9565b613e6c5760405163b0ce759160e01b815260040160405180910390fd5b6001600160a01b03166000908152600260208190526040822080546001600160d01b031916815560018101805463ffffffff1916905590810180546001600160e01b031990811690915560038201805490911690556004810182905560050155565b60055463ffffffff9081169082168103613ee6575050565b6005805463ffffffff191663ffffffff84811691821790925560408051928416835260208301919091527fb804b0ec3f0ea43004870df377170ce44cb789adca16d23286e337605558117f910161299d565b6000613f478260200151151590565b8015610c4757505051151590565b613f7b604051806060016040528060001515815260200160008152602001600081525090565b83516001600160801b031685871115613ffa576000613f9a8789615acc565b9050600086602001516001600160801b03168a613fb79190615acc565b90506000613fd7613fd18389600001518a6020015161399e565b84614dde565b8851909150613ff09082906001600160801b0316615a85565b935050505061402b565b8587101561402b57600061400e8888615acc565b905061402786600001516001600160801b031682614df4565b9150505b84516001600160801b03168103614064576040518060600160405280600015158152602001600081526020016000815250915050612fef565b82811015614094576040518060600160405280600115158152602001600081526020016000815250915050612fef565b60008086600001516001600160801b03168311156141665786516000906001600160801b031681036140d2576140cb600287615d83565b90506140ec565b87516140e9906002906001600160801b0316615d83565b90505b6140f68482614dde565b885190945061410e906001600160801b031685615acc565b9250614123838860200151896000015161399e565b91506040518060600160405280600115158152602001858152602001838a602001516001600160801b03166141589190615a85565b815250945050505050612fef565b865161417c9084906001600160801b0316615acc565b9150614191828760200151886000015161399e565b905060405180606001604052806001151581526020018481526020016141c489602001516001600160801b031684614df4565b90529a9950505050505050505050565b60006001600160801b038211156142415760405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20316044820152663238206269747360c81b606482015260840160405180910390fd5b5090565b815181516001600160801b039081169116146142d75781518151604080516001600160801b0393841681529290911660208301526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116929086169187917f6e96dc5343d067ec486a9920e0304c3610ed05c65e45cc029d9b9fe7ecfa7620910160405180910390a45b81602001516001600160801b031681602001516001600160801b03161461436457826001600160a01b0316836001600160a01b0316857f6e96dc5343d067ec486a9920e0304c3610ed05c65e45cc029d9b9fe7ecfa76208560200151856020015160405161435b9291906001600160801b0392831681529116602082015260400190565b60405180910390a45b50505050565b6040805180820190915260008082526020820152600061439b61439585600001518660200151614e0e565b84614e1e565b9050600060405180604001604052808387600001516143ba9190615e1a565b81526020018387602001516143cf9190615e1a565b81525090508060200151600003610c4357604051630d38a7e760e11b815260040160405180910390fd5b600061441182602001516001600160701b0316151590565b8015610c47575050516001600160701b0316151590565b60408051808201909152600080825260208201526040805180820190915260208381015182528351908201819052151561274d565b8251600090819061448f9061447585620f4240615e2e565b63ffffffff16866020015161448a9190615d83565b614b62565b905060006144b48660200151620f424063ffffffff16876000015161448a9190615d83565b86519091506000906144e2906144cd87620f4240615e53565b63ffffffff16886020015161448a9190615d83565b90506144ee8383614e50565b80156116db57506116db8282614e50565b60006004850181905560408051606081019091529081526020810161452261381c565b815260200161452f61381c565b9052805160018601805463ffffffff191663ffffffff9092169190911790556020808201518051600288018054928401516001600160701b039283166001600160e01b031994851617600160701b918416820217909155604090940151805160038a0180549290950151908316919093161791169092029190911790558354600160c01b900460ff161561460457835460ff60c01b1916845560405160ff8216906000906001600160a01b038816907f162ed187f3ed3879ae360c5df2a0a5dcaac7a208a9d762c2cbbfb1f5fad8b81d908390a45b811561469457604051631ebda06d60e01b8152600481018790526001600160a01b038681166024830152604482018490527f00000000000000000000000000000000000000000000000000000000000000001690631ebda06d90606401600060405180830381600087803b15801561467b57600080fd5b505af115801561468f573d6000803e3d6000fd5b505050505b6040805160608101825260048601546001600160801b038082168352600160801b909104166020820152600586015491810191909152611d8d90879087908690614245565b60408051808201909152600080825260208201528415806146f8575083155b156147165760405163bb55fd2760e01b815260040160405180910390fd5b600061472785846116d6818a615a85565b9050600061473f8263ffffffff8716620f424061399e565b9050604051806040016040528082846147589190615acc565b8152602001919091529695505050505050565b6040805180820190915260008082526020820152846000036147a05760405163bb55fd2760e01b815260040160405180910390fd5b60006147c58363ffffffff86166147ba87620f4240615e2e565b63ffffffff1661399e565b905060006147d38285615a85565b905060006147e688836116d6818b615acc565b60408051808201909152908152602081019390935250909695505050505050565b600554640100000000900463ffffffff166000036148225750565b606081015160055460009161484891640100000000900463ffffffff16620f424061399e565b9050808260c00181815161485c9190615acc565b90525061012082015161487157608090910152565b6148868260c001518360a001516000846146d9565b51608083015260c0820180518291906148a0908390615a85565b905250608082015160a0830180516148b9908390615acc565b90525060e0820180518291906148d0908390615acc565b9052505050565b6148df6155b3565b6001600160801b038911806148fa57506001600160801b0388115b8061490b57506001600160801b0387115b8061491c57506001600160801b0386115b8061492d57506001600160801b0385115b8061493a5750620f424084115b806149475750620f424083115b8061495157508582115b1561496f576040516318b103bd60e21b815260040160405180910390fd5b6000620f424061497f8582615acc565b6149899085615d83565b6149939190615e1a565b905061499f888a615a85565b620f42406149ad8682615acc565b6149b7908a615d83565b6149c19190615e1a565b1115614ab65760006149d3898b615a85565b620f42406149e18782615acc565b6149eb908b615d83565b6149f59190615e1a565b6149ff9190615acc565b90506000614a0d8a8c615a85565b614a17908a615acc565b9050614a258b8b8b88614e64565b8015614a2f575060005b15614a4a57614a438c8c8b858b8a89614e8e565b9350614aaf565b8b15614a7c57614a5d8c8c8c8c87614f67565b9350614a6d8c8c8b84878d614fe8565b60a08601526080850152614aaf565b88614a878b85615d83565b614a919190615e1a565b6060850152614aa48c8c8b84878d614fe8565b60a086015260808501525b5050614b31565b6000614acb614ac58a8c615a85565b89614df4565b9050600081118015614ae45750614ae48a8a8a87614e64565b8015614af95750614af98a898389898961505d565b15614b1557614b0e8b8b8a848a8a8a896150e7565b9250614b2f565b8a15614b2757614b0e8b8b8b85615195565b606083018290525b505b614b3b8184615acc565b60c08301525098975050505050505050565b60006116e1836001600160a01b038416615206565b60408051808201909152600080825260208201526000614b828484615255565b9050838302808210614bb75760405180604001604052808284614ba59190615acc565b81526020018281525092505050610c47565b60405180604001604052806001614bce8585900390565b614bd89190615acc565b815260200191909152949350505050565b60008180614bf957614bf9615e04565b838509949350505050565b604080518082019091526000808252602082015281836020015110614c4857604051806040016040528084600001518152602001838560200151613aac9190615acc565b604051806040016040528060018560000151614c649190615acc565b8152602001614c77856020015185900390565b90529392505050565b600080614c98614c9284808403615e1a565b60010190565b9050828460200151614caa9190615e1a565b8451820217949350505050565b60006001815b6008811015611e3e578382026002038202915080614cda81615db8565b915050614cbd565b604080518082019091526000808252602082015282516020830151614d10916001600160701b031690615d83565b60208401518351614d2a916001600160701b031690615d83565b03614d36575081610c47565b6116e1613b55614d4585613cb6565b8460046001615264565b600080614d5d85858561399e565b90506000614d6c868686614be9565b1115612d6e576000198110614d9457604051631a93c68960e11b815260040160405180910390fd5b6139c7816001615a85565b6000826000018281548110614db657614db6615da2565b9060005260206000200154905092915050565b60006116e1836001600160a01b0384166152f5565b6000818310614ded57816116e1565b5090919050565b6000818311614e045760006116e1565b6116e18284615acc565b600081831015614ded57816116e1565b6000614e2a8284615e7b565b15614e36576001614e39565b60005b60ff16614e468385615e1a565b6116e19190615a85565b6000614e5c83836153e8565b159392505050565b6000614e708284615acc565b614e7a9085615d83565b614e848387615d83565b1095945050505050565b614e966155b3565b6000614ea585620f4240615acc565b614eaf9087615d83565b90506000614ecd89614ec4620f42408b615d83565b87856001615410565b9050614f12614ee6614edf878d615d83565b848461399e565b604080518082019091526000808252602082015250604080518082019091529081526000602082015290565b8352614f4e614f2286898b61399e565b604080518082019091526000808252602082015250604080518082019091529081526001602082015290565b6040840152505060608101919091529695505050505050565b614f6f6155b3565b6000614f97614f7e8785615d83565b614f888587615acc565b614f929088615d83565b614df4565b9050614fab614f2288836116d6888b615d83565b8083526020830152614fc0614f228583615e1a565b6040830152614fd983614fd38789615a85565b8661399e565b60608301525095945050505050565b60008080614ff68686615d83565b905060006150048886615d83565b90508082111561503f5760008a1161501d576000615035565b6150358a61502b8385615acc565b6116d68b8d615d83565b9350849250615050565b6000935061504d8883615e1a565b92505b5050965096945050505050565b60008061509961506d888a615d83565b620f424061507b878b615d83565b615085898b615d83565b61508f9190615a85565b61448a9190615d83565b905060006150ce6150aa8589615d83565b6150b788620f4240615acc565b6150c1888c615d83565b615085620f42408c615d83565b90506150da82826153e8565b9998505050505050505050565b6150ef6155b3565b60006150fb8589615d83565b615108620f424089615d83565b6151129190615a85565b905060006151528a61512789620f4240615acc565b615131908c615d83565b8761513f8b620f4240615acc565b6151499087615d83565b620f4240615431565b9050615164614f22614edf878e615d83565b835261517b614ee686846116d6620f42408e615d83565b604084015250506060810191909152979650505050505050565b61519d6155b3565b60006151a98385614df4565b90506151b9614f2287838861399e565b80835260208301526151f181604080518082019091526000808252602082015250604080518082019091529081526001602082015290565b60408301525060608101919091529392505050565b600081815260018301602052604081205461524d57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610c47565b506000610c47565b60006000198284099392505050565b6040805180820190915260008082526020820152604051806040016040528083866000015188602001516152989190615d83565b6152a29190615d83565b6020870151885187916152b491615d83565b6152be9190615d83565b6152c89190615a85565b81526020016152d78486615a85565b866020015188602001516152eb9190615d83565b613bd39190615d83565b600081815260018301602052604081205480156153de576000615319600183615acc565b855490915060009061532d90600190615acc565b905081811461539257600086600001828154811061534d5761534d615da2565b906000526020600020015490508087600001848154811061537057615370615da2565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806153a3576153a3615e8f565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610c47565b6000915050610c47565b8051825160009110806116e15750815183511480156116e15750506020908101519101511190565b600061541d84848461399e565b6154278688615d83565b612fef9190615acc565b600061543e84848461399e565b6154488688615d83565b612fef9190615a85565b6040805160c0810182526000808252602082018190529181018290526060810191909152608081016154826154aa565b815260408051606081018252600080825260208281018290529282015291015290565b905290565b6040518060600160405280600063ffffffff1681526020016154dc604080518082019091526000808252602082015290565b81526020016154a5604080518082019091526000808252602082015290565b60405180610180016040528060008152602001600081526020016000815260200161553b6040518060400160405280600081526020016000151581525090565b815260200161555f6040518060400160405280600081526020016000151581525090565b81526020016155836040518060400160405280600081526020016000151581525090565b81526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b6040805161012081018252600060e082018181526101008301829052825282518084018452818152602080820183905280840191909152835180850185528281529081019190915290918201908152602001600081526020016000815260200160008152602001600081525090565b6001600160a01b03811681146121bc57600080fd5b60006020828403121561564957600080fd5b81356116e181615622565b81516001600160a01b0316815260208083015163ffffffff908116828401526040808501511515908401526060808501511515908401526080808501518051909216908401528082015180516001600160701b0390811660a08601529281015190921660c0840152610180830191506040015180516001600160701b0390811660e08501526020820151166101008401525060a083015180516001600160801b039081166101208501526020820151166101408401526040810151610160840152611e3e565b6000806040838503121561572d57600080fd5b823561573881615622565b946020939093013593505050565b60008060006060848603121561575b57600080fd5b833561576681615622565b95602085013595506040909401359392505050565b63ffffffff811681146121bc57600080fd5b60006020828403121561579f57600080fd5b81356116e18161577b565b6000806000606084860312156157bf57600080fd5b83356157ca81615622565b925060208401356157da81615622565b929592945050506040919091013590565b81518152602080830151908201526040808301519082015260608101610c47565b600080600080600060a0868803121561582457600080fd5b85359450602086013561583681615622565b9350604086013561584681615622565b94979396509394606081013594506080013592915050565b80151581146121bc57600080fd5b6000806040838503121561587f57600080fd5b823561588a81615622565b9150602083013561589a8161585e565b809150509250929050565b6000808284036101a08112156158ba57600080fd5b83356158c581615622565b9250610180601f19820112156158da57600080fd5b506020830190509250929050565b600080604083850312156158fb57600080fd5b823561590681615622565b9150602083013561589a8161577b565b6000806000806080858703121561592c57600080fd5b84359350602085013561593e81615622565b9250604085013561594e81615622565b9396929550929360600135925050565b81516001600160801b039081168252602080840151909116908201526040808301519082015260608101610c47565b6020808252825182820181905260009190848201906040850190845b818110156159ce5783516001600160a01b0316835292840192918401916001016159a9565b50909695505050505050565b60008060008060008060c087890312156159f357600080fd5b863595506020870135615a0581615622565b94506040870135615a1581615622565b9350606087013592506080870135915060a0870135615a338161585e565b809150509295509295509295565b60008060408385031215615a5457600080fd5b8235615a5f81615622565b9150602083013561589a81615622565b634e487b7160e01b600052601160045260246000fd5b60008219821115615a9857615a98615a6f565b500190565b600060208284031215615aaf57600080fd5b5051919050565b634e487b7160e01b600052602160045260246000fd5b600082821015615ade57615ade615a6f565b500390565b600060208284031215615af557600080fd5b81516116e18161585e565b600060208284031215615b1257600080fd5b81516116e181615622565b634e487b7160e01b600052604160045260246000fd5b60405160c0810167ffffffffffffffff81118282101715615b6457634e487b7160e01b600052604160045260246000fd5b60405290565b6040516060810167ffffffffffffffff81118282101715615b6457634e487b7160e01b600052604160045260246000fd5b80356001600160701b0381168114615bb257600080fd5b919050565b600060408284031215615bc957600080fd5b6040516040810181811067ffffffffffffffff82111715615bfa57634e487b7160e01b600052604160045260246000fd5b604052905080615c0983615b9b565b8152615c1760208401615b9b565b60208201525092915050565b80356001600160801b0381168114615bb257600080fd5b600060608284031215615c4c57600080fd5b6040516060810181811067ffffffffffffffff82111715615c7d57634e487b7160e01b600052604160045260246000fd5b604052905080615c8c83615c23565b8152615c9a60208401615c23565b6020820152604083013560408201525092915050565b6000818303610180811215615cc457600080fd5b615ccc615b33565b8335615cd781615622565b81526020840135615ce78161577b565b60208201526040840135615cfa8161585e565b60408201526060840135615d0d8161585e565b606082015260a0607f1983011215615d2457600080fd5b615d2c615b6a565b91506080840135615d3c8161577b565b8252615d4b8560a08601615bb7565b6020830152615d5d8560e08601615bb7565b6040830152816080820152615d76856101208601615c3a565b60a0820152949350505050565b6000816000190483118215151615615d9d57615d9d615a6f565b500290565b634e487b7160e01b600052603260045260246000fd5b600060018201615dca57615dca615a6f565b5060010190565b600060208284031215615de357600080fd5b81516116e18161577b565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b600082615e2957615e29615e04565b500490565b600063ffffffff83811690831681811015615e4b57615e4b615a6f565b039392505050565b600063ffffffff808316818516808303821115615e7257615e72615a6f565b01949350505050565b600082615e8a57615e8a615e04565b500690565b634e487b7160e01b600052603160045260246000fdfea164736f6c634300080d000a"; -type PoolCollectionConstructorParams = [signer?: Signer] | ConstructorParameters; +type PoolCollectionConstructorParams = + | [signer?: Signer] + | ConstructorParameters; -const isSuperArgs = (xs: PoolCollectionConstructorParams): xs is ConstructorParameters => - xs.length > 1; +const isSuperArgs = ( + xs: PoolCollectionConstructorParams +): xs is ConstructorParameters => xs.length > 1; export class PoolCollection__factory extends ContractFactory { - constructor(...args: PoolCollectionConstructorParams) { - if (isSuperArgs(args)) { - super(...args); - } else { - super(_abi, _bytecode, args[0]); - } + constructor(...args: PoolCollectionConstructorParams) { + if (isSuperArgs(args)) { + super(...args); + } else { + super(_abi, _bytecode, args[0]); } + } - override deploy( - initNetwork: PromiseOrValue, - initBNT: PromiseOrValue, - initNetworkSettings: PromiseOrValue, - initMasterVault: PromiseOrValue, - initBNTPool: PromiseOrValue, - initExternalProtectionVault: PromiseOrValue, - initPoolTokenFactory: PromiseOrValue, - initPoolMigrator: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise { - return super.deploy( - initNetwork, - initBNT, - initNetworkSettings, - initMasterVault, - initBNTPool, - initExternalProtectionVault, - initPoolTokenFactory, - initPoolMigrator, - overrides || {} - ) as Promise; - } - override getDeployTransaction( - initNetwork: PromiseOrValue, - initBNT: PromiseOrValue, - initNetworkSettings: PromiseOrValue, - initMasterVault: PromiseOrValue, - initBNTPool: PromiseOrValue, - initExternalProtectionVault: PromiseOrValue, - initPoolTokenFactory: PromiseOrValue, - initPoolMigrator: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): TransactionRequest { - return super.getDeployTransaction( - initNetwork, - initBNT, - initNetworkSettings, - initMasterVault, - initBNTPool, - initExternalProtectionVault, - initPoolTokenFactory, - initPoolMigrator, - overrides || {} - ); - } - override attach(address: string): PoolCollection { - return super.attach(address) as PoolCollection; - } - override connect(signer: Signer): PoolCollection__factory { - return super.connect(signer) as PoolCollection__factory; - } + override deploy( + initNetwork: string, + initBNT: string, + initNetworkSettings: string, + initMasterVault: string, + initBNTPool: string, + initExternalProtectionVault: string, + initPoolTokenFactory: string, + initPoolMigrator: string, + overrides?: Overrides & { from?: string } + ): Promise { + return super.deploy( + initNetwork, + initBNT, + initNetworkSettings, + initMasterVault, + initBNTPool, + initExternalProtectionVault, + initPoolTokenFactory, + initPoolMigrator, + overrides || {} + ) as Promise; + } + override getDeployTransaction( + initNetwork: string, + initBNT: string, + initNetworkSettings: string, + initMasterVault: string, + initBNTPool: string, + initExternalProtectionVault: string, + initPoolTokenFactory: string, + initPoolMigrator: string, + overrides?: Overrides & { from?: string } + ): TransactionRequest { + return super.getDeployTransaction( + initNetwork, + initBNT, + initNetworkSettings, + initMasterVault, + initBNTPool, + initExternalProtectionVault, + initPoolTokenFactory, + initPoolMigrator, + overrides || {} + ); + } + override attach(address: string): PoolCollection { + return super.attach(address) as PoolCollection; + } + override connect(signer: Signer): PoolCollection__factory { + return super.connect(signer) as PoolCollection__factory; + } - static readonly bytecode = _bytecode; - static readonly abi = _abi; - static createInterface(): PoolCollectionInterface { - return new utils.Interface(_abi) as PoolCollectionInterface; - } - static connect(address: string, signerOrProvider: Signer | Provider): PoolCollection { - return new Contract(address, _abi, signerOrProvider) as PoolCollection; - } + static readonly bytecode = _bytecode; + static readonly abi = _abi; + static createInterface(): PoolCollectionInterface { + return new utils.Interface(_abi) as PoolCollectionInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): PoolCollection { + return new Contract(address, _abi, signerOrProvider) as PoolCollection; + } } diff --git a/package.json b/package.json index bb79064b3..6aa3c322b 100644 --- a/package.json +++ b/package.json @@ -117,7 +117,7 @@ "glob": "^10.2.7", "hardhat-contract-sizer": "^2.10.0", "hardhat-dependency-compiler": "^1.1.3", - "hardhat-deploy": "0.11.29", + "hardhat-deploy": "0.11.34", "hardhat-deploy-tenderly": "^0.2.0", "hardhat-storage-layout": "^0.1.7", "hardhat-watcher": "^2.5.0", diff --git a/yarn.lock b/yarn.lock index dd0cffdb4..083e630db 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1360,14 +1360,14 @@ "@noble/hashes" "~1.3.0" "@scure/base" "~1.1.0" -"@sentry-internal/tracing@7.68.0": - version "7.68.0" - resolved "https://registry.yarnpkg.com/@sentry-internal/tracing/-/tracing-7.68.0.tgz#cb83a797baa671702cf43caf2280868850a0ef04" - integrity sha512-nNKS/q21+Iqzxs2K7T/l3dZi8Z9s/uxsAazpk2AYhFzx9mFnPj1Xfe3dgbFoygNifE+IrpUuldr6D5HQamTDPQ== - dependencies: - "@sentry/core" "7.68.0" - "@sentry/types" "7.68.0" - "@sentry/utils" "7.68.0" +"@sentry-internal/tracing@7.69.0": + version "7.69.0" + resolved "https://registry.yarnpkg.com/@sentry-internal/tracing/-/tracing-7.69.0.tgz#8d8eb740b72967b6ba3fdc0a5173aa55331b7d35" + integrity sha512-4BgeWZUj9MO6IgfO93C9ocP3+AdngqujF/+zB2rFdUe+y9S6koDyUC7jr9Knds/0Ta72N/0D6PwhgSCpHK8s0Q== + dependencies: + "@sentry/core" "7.69.0" + "@sentry/types" "7.69.0" + "@sentry/utils" "7.69.0" tslib "^2.4.1 || ^1.9.3" "@sentry/core@5.30.0": @@ -1381,13 +1381,13 @@ "@sentry/utils" "5.30.0" tslib "^1.9.3" -"@sentry/core@7.68.0": - version "7.68.0" - resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.68.0.tgz#323817afea06b1fc22db37620bf74f3f8a46dbcf" - integrity sha512-mT3ObBWgvAky/QF3dZy4KBoXbRXbNsD6evn+mYi9UEeIZQ5NpnQYDEp78mapiEjI/TAHZIhTIuaBhj1Jk0qUUA== +"@sentry/core@7.69.0": + version "7.69.0" + resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.69.0.tgz#ebbe01df573f438f8613107020a4e18eb9adca4d" + integrity sha512-V6jvK2lS8bhqZDMFUtvwe2XvNstFQf5A+2LMKCNBOV/NN6eSAAd6THwEpginabjet9dHsNRmMk7WNKvrUfQhZw== dependencies: - "@sentry/types" "7.68.0" - "@sentry/utils" "7.68.0" + "@sentry/types" "7.69.0" + "@sentry/utils" "7.69.0" tslib "^2.4.1 || ^1.9.3" "@sentry/hub@5.30.0": @@ -1400,13 +1400,13 @@ tslib "^1.9.3" "@sentry/hub@^7.56.0": - version "7.68.0" - resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-7.68.0.tgz#f317877a1d2819e9426696bfc0ba0c7cbe608e29" - integrity sha512-MfXGFR1idRnVMnRvuGzrIFmY3DLjytje4gZJ1pT29gTArpMth68ujJ+61Ptj9QZBSJH7vBlVSdF4UuNBJEI6Dg== + version "7.69.0" + resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-7.69.0.tgz#3ef3b98e1810b05cb4fb37a861bd700ef592a2a9" + integrity sha512-71TQ7P5de9+cdW1ETGI9wgi2VNqfyWaM3cnUvheXaSjPRBrr6mhwoaSjo+GGsiwx97Ob9DESZEIhdzcLupzkFA== dependencies: - "@sentry/core" "7.68.0" - "@sentry/types" "7.68.0" - "@sentry/utils" "7.68.0" + "@sentry/core" "7.69.0" + "@sentry/types" "7.69.0" + "@sentry/utils" "7.69.0" tslib "^2.4.1 || ^1.9.3" "@sentry/minimal@5.30.0": @@ -1434,14 +1434,14 @@ tslib "^1.9.3" "@sentry/node@^7.56.0": - version "7.68.0" - resolved "https://registry.yarnpkg.com/@sentry/node/-/node-7.68.0.tgz#da3407ba7455109cf625c9a134a3f74ec5f5ca6b" - integrity sha512-gtcHoi6Xu6Iu8MpPgKJA4E0nozqLvYF0fKtt+27T0QBzWioO6lkxSQkKGWMyJGL0AmpLCex0E28fck/rlbt0LA== - dependencies: - "@sentry-internal/tracing" "7.68.0" - "@sentry/core" "7.68.0" - "@sentry/types" "7.68.0" - "@sentry/utils" "7.68.0" + version "7.69.0" + resolved "https://registry.yarnpkg.com/@sentry/node/-/node-7.69.0.tgz#938200095a17f41a2445fec168df293db7c24836" + integrity sha512-T0NgPcmDQvEuz5hy6aEhXghTHHTWsiP3IWoeEAakDBHAXmtpT6lYFQZgb5AiEOt9F5KO/G/1yH3YYdpDAnKhPw== + dependencies: + "@sentry-internal/tracing" "7.69.0" + "@sentry/core" "7.69.0" + "@sentry/types" "7.69.0" + "@sentry/utils" "7.69.0" cookie "^0.4.1" https-proxy-agent "^5.0.0" lru_map "^0.3.3" @@ -1463,10 +1463,10 @@ resolved "https://registry.yarnpkg.com/@sentry/types/-/types-5.30.0.tgz#19709bbe12a1a0115bc790b8942917da5636f402" integrity sha512-R8xOqlSTZ+htqrfteCWU5Nk0CDN5ApUTvrlvBuiH1DyP6czDZ4ktbZB0hAgBlVcK0U+qpD3ag3Tqqpa5Q67rPw== -"@sentry/types@7.68.0", "@sentry/types@^7.56.0": - version "7.68.0" - resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.68.0.tgz#6134511106eed90bf033dc2ce76955f61582b48f" - integrity sha512-5J2pH1Pjx/029zTm3CNY9MaE8Aui81nG7JCtlMp7uEfQ//9Ja4d4Sliz/kV4ARbkIKUZerSgaRAm3xCy5XOXLg== +"@sentry/types@7.69.0", "@sentry/types@^7.56.0": + version "7.69.0" + resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.69.0.tgz#012b8d90d270a473cc2a5cf58a56870542739292" + integrity sha512-zPyCox0mzitzU6SIa1KIbNoJAInYDdUpdiA+PoUmMn2hFMH1llGU/cS7f4w/mAsssTlbtlBi72RMnWUCy578bw== "@sentry/utils@5.30.0": version "5.30.0" @@ -1476,12 +1476,12 @@ "@sentry/types" "5.30.0" tslib "^1.9.3" -"@sentry/utils@7.68.0", "@sentry/utils@^7.56.0": - version "7.68.0" - resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.68.0.tgz#e9fd33f4e856cf6ef3843ae11af3c836d88cbb88" - integrity sha512-NecnQegvKARyeFmBx7mYmbI17mTvjARWs1nfzY5jhPyNc3Zk4M3bQsgIdnJ1t+jo93UYudlNND7hxhDzjcBAVg== +"@sentry/utils@7.69.0", "@sentry/utils@^7.56.0": + version "7.69.0" + resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.69.0.tgz#b7594e4eb2a88b9b25298770b841dd3f81bd2aa4" + integrity sha512-4eBixe5Y+0EGVU95R4NxH3jkkjtkE4/CmSZD4In8SCkWGSauogePtq6hyiLsZuP1QHdpPb9Kt0+zYiBb2LouBA== dependencies: - "@sentry/types" "7.68.0" + "@sentry/types" "7.69.0" tslib "^2.4.1 || ^1.9.3" "@sindresorhus/is@^0.14.0": @@ -3519,9 +3519,9 @@ camelcase@^6.0.0: integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== caniuse-lite@^1.0.30000844: - version "1.0.30001533" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001533.tgz#1180daeb2518b93c82f19b904d1fefcf82197707" - integrity sha512-9aY/b05NKU4Yl2sbcJhn4A7MsGwR1EPfW/nrqsnqVA0Oq50wpmPaGI+R1Z0UKlUl96oxUkGEOILWtOHck0eCWw== + version "1.0.30001534" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001534.tgz#f24a9b2a6d39630bac5c132b5dff89b39a12e7dd" + integrity sha512-vlPVrhsCS7XaSh2VvWluIQEzVhefrUQcEsQWSS5A5V+dM07uv1qHeQzAOTGIMy9i3e9bH15+muvI/UHojVgS/Q== case@^1.6.3: version "1.6.3" @@ -4242,11 +4242,21 @@ deferred-leveldown@~5.3.0: abstract-leveldown "~6.2.1" inherits "^2.0.3" +define-data-property@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/define-data-property/-/define-data-property-1.0.1.tgz#37589faaa735405b557fcb9537b46b575655c4cb" + integrity sha512-22M+6zEspQHx10bfFQl2ET39IvfuQ7+rZIH7+ard8fCC4hPmkOSy+8JhKxBRLaWUziJ0O63NTYT97LR8zUfPTw== + dependencies: + get-intrinsic "^1.2.1" + gopd "^1.0.1" + has-property-descriptors "^1.0.0" + define-properties@^1.1.2, define-properties@^1.1.3, define-properties@^1.1.4, define-properties@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.2.0.tgz#52988570670c9eacedd8064f4a990f2405849bd5" - integrity sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA== + version "1.2.1" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.2.1.tgz#10781cc616eb951a80a034bafcaa7377f6af2b6c" + integrity sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg== dependencies: + define-data-property "^1.0.1" has-property-descriptors "^1.0.0" object-keys "^1.1.1" @@ -4425,9 +4435,9 @@ eip55@^2.1.1: keccak "^3.0.3" electron-to-chromium@^1.3.47: - version "1.4.515" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.515.tgz#f5fec9662106ac5752894af221606cf4db443e70" - integrity sha512-VTq6vjk3kCfG2qdzQRd/i9dIyVVm0dbtZIgFzrLgfB73mXDQT2HPKVRc1EoZcAVUv9XhXAu08DWqJuababdGGg== + version "1.4.519" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.519.tgz#01b9bc3f1bb50c4971bdd1eeca6d9a73575bd581" + integrity sha512-kqs9oGYL4UFVkLKhqCTgBCYZv+wZ374yABDMqlDda9HvlkQxvSr7kgf4hfWVjMieDbX+1MwPHFBsOGCMIBaFKg== elliptic@6.5.4, elliptic@^6.4.0, elliptic@^6.5.2, elliptic@^6.5.3, elliptic@^6.5.4: version "6.5.4" @@ -6235,10 +6245,10 @@ hardhat-deploy-tenderly@^0.2.0: axios "^0.24.0" js-yaml "^4.1.0" -hardhat-deploy@0.11.29: - version "0.11.29" - resolved "https://registry.yarnpkg.com/hardhat-deploy/-/hardhat-deploy-0.11.29.tgz#e6d76e37fa2ed74d76d15b01f3849da3bda49a81" - integrity sha512-9F+MRFkEocelzB8d+SDDCcTL7edBYAj2S63ldknvfIIBSajeB6q1/jm+dlK1GjcWzAzw7EVoxtjJXzxAxZfZcg== +hardhat-deploy@0.11.34: + version "0.11.34" + resolved "https://registry.yarnpkg.com/hardhat-deploy/-/hardhat-deploy-0.11.34.tgz#61252ebf5dfdda7b0b31298dd5580b0735c05910" + integrity sha512-N6xcwD8LSMV/IyfEr8TfR2YRbOh9Q4QvitR9MKZRTXQmgQiiMGjX+2efMjKgNMxwCVlmpfnE1tyDxOJOOUseLQ== dependencies: "@ethersproject/abi" "^5.7.0" "@ethersproject/abstract-signer" "^5.7.0" @@ -9426,13 +9436,13 @@ regex-not@^1.0.0, regex-not@^1.0.2: safe-regex "^1.1.0" regexp.prototype.flags@^1.2.0, regexp.prototype.flags@^1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.5.0.tgz#fe7ce25e7e4cca8db37b6634c8a2c7009199b9cb" - integrity sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA== + version "1.5.1" + resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.5.1.tgz#90ce989138db209f81492edd734183ce99f9677e" + integrity sha512-sy6TXMN+hnP/wMy+ISxg3krXx7BAtWVO4UouuCN/ziM9UEne0euamVNafDfvC83bRNr95y0V5iijeDQFUNpvrg== dependencies: call-bind "^1.0.2" define-properties "^1.2.0" - functions-have-names "^1.2.3" + set-function-name "^2.0.0" regexpu-core@^2.0.0: version "2.0.0" @@ -9836,6 +9846,14 @@ set-blocking@^2.0.0: resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" integrity sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw== +set-function-name@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-function-name/-/set-function-name-2.0.0.tgz#e59e53e7fa23f9c2da1c0999fa202d5ed09c4756" + integrity sha512-WmS8UHojv5s1eSoRSmzO5zzgDq8PE1/X/ij0k+9fMYmINCc6+j+SF3Om8YyucKn2yjnK4ItNZOoQycNnHsZJTw== + dependencies: + define-data-property "^1.0.1" + has-property-descriptors "^1.0.0" + set-immediate-shim@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz#4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61"