diff --git a/deployments/mainnet/.migrations.json b/deployments/mainnet/.migrations.json index 80c1fc9ca..4de65179d 100644 --- a/deployments/mainnet/.migrations.json +++ b/deployments/mainnet/.migrations.json @@ -62,5 +62,6 @@ "000061-upgrade-network-settings-v4": 1694606550, "000062-pool-collection-type1-v12": 1694606727, "000063-upgrade-network-v9": 1694606812, - "000064-upgrade-network-v10": 1698318798 + "000064-upgrade-network-v10": 1698318798, + "000065-upgrade-network-v11": 1730276341 } \ No newline at end of file diff --git a/deployments/mainnet/BancorNetwork.json b/deployments/mainnet/BancorNetwork.json index 299e93d23..959b18404 100644 --- a/deployments/mainnet/BancorNetwork.json +++ b/deployments/mainnet/BancorNetwork.json @@ -151,6 +151,11 @@ "name": "InsufficientFlashLoanReturn", "type": "error" }, + { + "inputs": [], + "name": "InvalidExternalAddress", + "type": "error" + }, { "inputs": [], "name": "InvalidFee", @@ -201,6 +206,32 @@ "name": "ZeroValue", "type": "error" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "AddressAddedToWhitelist", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "AddressRemovedFromWhitelist", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -633,6 +664,19 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "addToWhitelist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [], "name": "burnNetworkFees", @@ -781,6 +825,19 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "feeExemptionWhitelist", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { @@ -960,6 +1017,25 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "isWhitelisted", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "liquidityPools", @@ -1122,6 +1198,19 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "removeFromWhitelist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -1511,8 +1600,8 @@ "type": "constructor" } ], - "numDeployments": 10, - "solcInputHash": "dd6f39588320c08a585d6628d2a51262", + "numDeployments": 11, + "solcInputHash": "75c10dc0a0cf10192f6eeb9735bc76a1", "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", @@ -1522,7 +1611,7 @@ "0x" ] }, - "implementation": "0x3006EB573bA4b6f28C36AAd49d2062C5e82Cfc75", + "implementation": "0x2F14750b0d267be47dCD30A134796c2E4b1638a3", "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 6ef65e5dd..f5f9265c0 100644 --- a/deployments/mainnet/BancorNetwork_Implementation.json +++ b/deployments/mainnet/BancorNetwork_Implementation.json @@ -1,5 +1,5 @@ { - "address": "0x3006EB573bA4b6f28C36AAd49d2062C5e82Cfc75", + "address": "0x2F14750b0d267be47dCD30A134796c2E4b1638a3", "abi": [ { "inputs": [ @@ -33,11 +33,6 @@ "name": "initBNTPoolToken", "type": "address" }, - { - "internalType": "address", - "name": "bancorArbitrage", - "type": "address" - }, { "internalType": "address", "name": "carbonPOL", @@ -87,6 +82,11 @@ "name": "InvalidAddress", "type": "error" }, + { + "inputs": [], + "name": "InvalidExternalAddress", + "type": "error" + }, { "inputs": [], "name": "InvalidFee", @@ -137,6 +137,32 @@ "name": "ZeroValue", "type": "error" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "AddressAddedToWhitelist", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "AddressRemovedFromWhitelist", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -569,6 +595,19 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "addToWhitelist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [], "name": "burnNetworkFees", @@ -717,6 +756,19 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "feeExemptionWhitelist", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { @@ -896,6 +948,25 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "isWhitelisted", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "liquidityPools", @@ -1058,6 +1129,19 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "removeFromWhitelist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -1430,19 +1514,19 @@ "type": "receive" } ], - "transactionHash": "0x5c91eecc094a85380cc739115bdf4666cd052b3eac5654628eb4e50d3785c00e", + "transactionHash": "0x969b4f4ce9dcee6b3340f3a5b9149291e019c37d358f26731683291be4abeeef", "receipt": { "to": null, "from": "0x5bEBA4D3533a963Dedb270a95ae5f7752fA0Fe22", - "contractAddress": "0x3006EB573bA4b6f28C36AAd49d2062C5e82Cfc75", - "transactionIndex": 6, - "gasUsed": "5250483", + "contractAddress": "0x2F14750b0d267be47dCD30A134796c2E4b1638a3", + "transactionIndex": 139, + "gasUsed": "5351238", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x454fc003681ade374daa0eaccead31881bff8c3eec2bec44b56d439f9c23946e", - "transactionHash": "0x5c91eecc094a85380cc739115bdf4666cd052b3eac5654628eb4e50d3785c00e", + "blockHash": "0x167788419a3cee7b41a6849fb3ba8a5fc4894dae963f5f1b2a0ee6001d71ada8", + "transactionHash": "0x969b4f4ce9dcee6b3340f3a5b9149291e019c37d358f26731683291be4abeeef", "logs": [], - "blockNumber": 18434016, - "cumulativeGasUsed": "6215890", + "blockNumber": 21077215, + "cumulativeGasUsed": "15616920", "status": 1, "byzantium": true }, @@ -1453,17 +1537,22 @@ "0x649765821D9f64198c905eC0B2B037a4a52Bc373", "0xFd31662b3d54eddE9B6Bdd32c9c27C8E292cAD57", "0xAB05Cf7C6c3a288cd36326e4f7b8600e7268E344", - "0x41Eeba3355d7D6FF628B7982F3F9D055c39488cB", "0xD06146D292F9651C1D7cf54A3162791DFc2bEf46" ], - "numDeployments": 9, - "solcInputHash": "dd6f39588320c08a585d6628d2a51262", - "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\":false,\"internalType\":\"uint256\",\"name\":\"oldMinNetworkFeeBurn\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newMinNetworkFeeBurn\",\"type\":\"uint256\"}],\"name\":\"MinNetworkFeeBurnUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"NetworkFeesBurned\",\"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\":[],\"name\":\"burnNetworkFees\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"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\":\"minNetworkFeeBurn\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"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\":[{\"internalType\":\"uint256\",\"name\":\"newMinNetworkFeeBurn\",\"type\":\"uint256\"}],\"name\":\"setMinNetworkFeeBurn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"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\":\"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\"},\"MinNetworkFeeBurnUpdated(uint256,uint256)\":{\"details\":\"triggered when the min network fee burn is updated\"},\"NetworkFeesBurned(address,uint256)\":{\"details\":\"triggered when network fees are burned\"},\"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\":{\"burnNetworkFees()\":{\"details\":\"burns pending network fees, and returns the amount of fees burned\"},\"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\"},\"minNetworkFeeBurn()\":{\"details\":\"returns the min network fee burn\"},\"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\"},\"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\"},\"setMinNetworkFeeBurn(uint256)\":{\"details\":\"set the min network fee burn\"},\"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\"},\"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 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\\n uint256 internal _pendingNetworkFeeAmount;\\n\\n bool private _depositingEnabled = true;\\n\\n uint32 private _polRewardsPPM;\\n\\n // min network fee amount that can be burned\\n uint256 private _minNetworkFeeBurn;\\n\\n // upgrade forward-compatibility storage gap\\n uint256[MAX_GAP - 12] 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 burned\\n */\\n event NetworkFeesBurned(address indexed caller, 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 triggered when the min network fee burn is updated\\n */\\n event MinNetworkFeeBurnUpdated(uint256 oldMinNetworkFeeBurn, uint256 newMinNetworkFeeBurn);\\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\\n _depositingEnabled = true;\\n\\n _setPOLRewardsPPM(2000);\\n _setMinNetworkFeeBurn(1_000_000e18);\\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 10;\\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 pending network fee amount to be burned\\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 burnNetworkFees() external whenNotPaused nonReentrant returns (uint256) {\\n uint256 currentPendingNetworkFeeAmount = _pendingNetworkFeeAmount;\\n if (currentPendingNetworkFeeAmount < _minNetworkFeeBurn) {\\n return 0;\\n }\\n\\n _pendingNetworkFeeAmount = 0;\\n\\n // transferring bnt to the token's address burns the tokens\\n _masterVault.withdrawFunds(Token(address(_bnt)), payable(address(_bnt)), currentPendingNetworkFeeAmount);\\n\\n emit NetworkFeesBurned(msg.sender, 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 returns the min network fee burn\\n */\\n function minNetworkFeeBurn() external view returns (uint256) {\\n return _minNetworkFeeBurn;\\n }\\n\\n /**\\n * @dev set the min network fee burn\\n */\\n function setMinNetworkFeeBurn(\\n uint256 newMinNetworkFeeBurn\\n ) external onlyAdmin greaterThanZero(newMinNetworkFeeBurn) {\\n _setMinNetworkFeeBurn(newMinNetworkFeeBurn);\\n }\\n\\n /**\\n * @dev set the min network fee burn\\n */\\n function _setMinNetworkFeeBurn(uint256 newMinNetworkFeeBurn) private {\\n uint256 oldMinNetworkFeeBurn = _minNetworkFeeBurn;\\n if (oldMinNetworkFeeBurn == newMinNetworkFeeBurn) {\\n return;\\n }\\n\\n _minNetworkFeeBurn = newMinNetworkFeeBurn;\\n emit MinNetworkFeeBurnUpdated(oldMinNetworkFeeBurn, newMinNetworkFeeBurn);\\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\":\"0xeca5994fc6a2222ad235e3f8cb2d7c3fe66bda143063872fda6edcfb3992c788\",\"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 burns pending network fees, and returns the amount of fees burned\\n */\\n function burnNetworkFees() 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\":\"0x786767aa9089770d368e4e8a914846b886604113f1eb9d16271e833f785da7fd\",\"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": "0x6101c0604052610169805460ff191660011790553480156200002057600080fd5b50604051620061a3380380620061a3833981016040819052620000439162000222565b876200004f81620001e1565b876200005b81620001e1565b876200006781620001e1565b876200007381620001e1565b876200007f81620001e1565b876200008b81620001e1565b876200009781620001e1565b87620000a381620001e1565b8f6001600160a01b031660a0816001600160a01b0316815250508f6001600160a01b031663fc0c546a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015620000fc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001229190620002e3565b6001600160a01b039081166080528f1660e081905260408051637e062a3560e11b8152905163fc0c546a916004808201926020929091908290030181865afa15801562000173573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001999190620002e3565b6001600160a01b0390811660c0529d8e1661010052505050509789166101205250505092851661014052908416610160528316610180529091166101a052506200030a915050565b6001600160a01b038116620002095760405163e6c4247b60e01b815260040160405180910390fd5b50565b6001600160a01b03811681146200020957600080fd5b600080600080600080600080610100898b0312156200024057600080fd5b88516200024d816200020c565b60208a015190985062000260816200020c565b60408a015190975062000273816200020c565b60608a015190965062000286816200020c565b60808a015190955062000299816200020c565b60a08a0151909450620002ac816200020c565b60c08a0151909350620002bf816200020c565b60e08a0151909250620002d2816200020c565b809150509295985092959890939650565b600060208284031215620002f657600080fd5b815162000303816200020c565b9392505050565b60805160a05160c05160e05161010051610120516101405161016051610180516101a051615d586200044b6000396000611688015260008181611b990152818161231c015281816124c00152818161356c0152613d21015260008181610cf00152612faa01526000818161287d0152612b2a0152600081816108da0152818161150b015281816116600152818161171601528181611c9801528181611df301528181611e2d015281816127ee01528181612a9b015281816141c40152818161423e015261464c01526000818161146501528181611b020152611bec0152600050506000612c76015260005050600081816109070152818161102001528181611aad01528181611e5c0152818161325f015281816133fb015281816136be015281816143f1015281816144c601528181614b240152614b610152615d586000f3fe6080604052600436106102765760003560e01c80635c975abb1161014f578063a8bf9046116100c1578063d0d145811161007a578063d0d1458114610758578063d3a4acd31461076b578063d547741f1461077e578063d6efd7c31461079e578063d895feee146107b3578063e6aac07e146107c657600080fd5b8063a8bf9046146106a5578063adf51de1146106c5578063b3db428b146106e5578063c0c53b8b146106f8578063c109ba1314610718578063ca15c8731461073857600080fd5b80638ffcca07116101135780638ffcca07146105bd5780639010d07c146105dd57806391d148541461061557806393867fb5146106355780639bca0e7014610656578063a217fddf1461069057600080fd5b80635c975abb1461054057806371f43f9a146105595780637bf6a425146105725780638456cb59146105885780638cd2403d1461059d57600080fd5b806336568abe116101e857806341f435b3116101ac57806341f435b31461049d57806342659964146104be57806345d6602c146104de57806347e7ef24146104f1578063533007721461050457806354fd4d501461052457600080fd5b806336568abe146104125780633982b5311461043257806339fadf98146104485780633d1c24e71461046a5780633efcfda41461047d57600080fd5b8063248a9ca31161023a578063248a9ca31461034257806326e6b697146103725780632d944b80146103925780632e1a7d4d146103b25780632f2ff15d146103d2578063357a0333146103f257600080fd5b806301ffc9a714610282578063046f7da2146102b7578063079767de146102ce5780631329db29146102f1578063230df83a1461032257600080fd5b3661027d57005b600080fd5b34801561028e57600080fd5b506102a261029d366004615359565b6107f9565b60405190151581526020015b60405180910390f35b3480156102c357600080fd5b506102cc610824565b005b3480156102da57600080fd5b506102e3610848565b6040519081526020016102ae565b3480156102fd57600080fd5b5061016954610100900463ffffffff1660405163ffffffff90911681526020016102ae565b34801561032e57600080fd5b506102cc61033d366004615398565b6109a5565b34801561034e57600080fd5b506102e361035d3660046153b5565b60009081526065602052604090206001015490565b34801561037e57600080fd5b506102cc61038d3660046153dc565b610b4a565b34801561039e57600080fd5b506102cc6103ad3660046153b5565b610b87565b3480156103be57600080fd5b506102e36103cd3660046153b5565b610bb6565b3480156103de57600080fd5b506102cc6103ed3660046153f9565b610d5b565b3480156103fe57600080fd5b506102e361040d366004615429565b610d86565b34801561041e57600080fd5b506102cc61042d3660046153f9565b610e00565b34801561043e57600080fd5b5061016a546102e3565b34801561045457600080fd5b5061045d610e7a565b6040516102ae9190615455565b6102cc6104783660046154a2565b610f2c565b34801561048957600080fd5b506102e36104983660046153b5565b6110ce565b3480156104a957600080fd5b50600080516020615cec8339815191526102e3565b3480156104ca57600080fd5b506102cc6104d93660046154f3565b6111a2565b6102e36104ec366004615579565b61126f565b6102e36104ff366004615429565b6112e1565b34801561051057600080fd5b506102cc61051f3660046155f2565b611356565b34801561053057600080fd5b50604051600a81526020016102ae565b34801561054c57600080fd5b5061012d5460ff166102a2565b34801561056557600080fd5b506101695460ff166102a2565b34801561057e57600080fd5b50610168546102e3565b34801561059457600080fd5b506102cc611381565b3480156105a957600080fd5b506102cc6105b8366004615658565b6113a2565b3480156105c957600080fd5b506102e36105d8366004615398565b6113f3565b3480156105e957600080fd5b506105fd6105f836600461569a565b6117e1565b6040516001600160a01b0390911681526020016102ae565b34801561062157600080fd5b506102a26106303660046153f9565b611800565b34801561064157600080fd5b50600080516020615d2c8339815191526102e3565b34801561066257600080fd5b506105fd610671366004615398565b6001600160a01b03908116600090815261016760205260409020541690565b34801561069c57600080fd5b506102e3600081565b3480156106b157600080fd5b506102cc6106c0366004615398565b61182b565b3480156106d157600080fd5b506102cc6106e03660046156bc565b611a42565b6102e36106f336600461572f565b611fc6565b34801561070457600080fd5b506102cc610713366004615770565b612045565b34801561072457600080fd5b506102cc6107333660046154f3565b61212d565b34801561074457600080fd5b506102e36107533660046153b5565b6122d7565b6102e3610766366004615579565b6122ee565b6102e3610779366004615579565b61235f565b34801561078a57600080fd5b506102cc6107993660046153f9565b6123c1565b3480156107aa57600080fd5b5061045d6123e7565b6102e36107c1366004615579565b612492565b3480156107d257600080fd5b507fdf8c9529ea4b244b569bac557a549516f317e7b5cf82dc5e0d8b6d874930a3f56102e3565b60006001600160e01b03198216635a05180f60e01b148061081e575061081e826124f7565b92915050565b600080516020615cec83398151915261083d813361252c565b610845612553565b50565b600061085761012d5460ff1690565b1561087d5760405162461bcd60e51b8152600401610874906157b0565b60405180910390fd5b600260fb540361089f5760405162461bcd60e51b8152600401610874906157da565b600260fb556101685461016a548110156108bd57600091505061099d565b600061016855604051631c20fadd60e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690631c20fadd90610933907f00000000000000000000000000000000000000000000000000000000000000009081908690600401615811565b600060405180830381600087803b15801561094d57600080fd5b505af1158015610961573d6000803e3d6000fd5b50506040518381523392507f032863b8ce7ba939f971bf78a7ee035ae1044bef5dadf789c7cd09d26c0c40f4915060200160405180910390a290505b600160fb5590565b806109af816125e8565b6109c7600080516020615d2c8339815191523361252c565b600260fb54036109e95760405162461bcd60e51b8152600401610874906157da565b600260fb81905550816001600160a01b031663f525cb686040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a2f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a539190615835565b15610a71576040516332e7879360e01b815260040160405180910390fd5b610a7d6101628361260f565b610a9a5760405163b0ce759160e01b815260040160405180910390fd5b610aa5826000612624565b816001600160a01b0316826001600160a01b031663b1dd61b66040518163ffffffff1660e01b8152600401602060405180830381865afa158015610aed573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b11919061584e565b61ffff167fa0c1e3924f995e5ba38f53b4effb6d4b3eeb84176a2951c589115140f638ac0960405160405180910390a35050600160fb55565b610b62600080516020615d2c8339815191523361252c565b6101695460ff1615158115151461084557610169805482151560ff1990911617905550565b610b9f600080516020615d2c8339815191523361252c565b80610ba981612b5b565b610bb282612b7c565b5050565b6000610bc561012d5460ff1690565b15610be25760405162461bcd60e51b8152600401610874906157b0565b600260fb5403610c045760405162461bcd60e51b8152600401610874906157da565b600260fb55336000610c6784836000814260405160609290921b6001600160601b031916602083015260e01b6001600160e01b03191660348201526038810184905260580160405160208183030381529060405280519060200120905092915050565b6101605460405163158591ab60e11b8152600481018390526001600160a01b0385811660248301526044820188905292935060009290911690632b0b2356906064016060604051808303816000875af1158015610cc8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cec91906158bf565b90507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031681600001516001600160a01b031603610d4057610d36828483612bcf565b9350505050610d51565b610d4b828483612d89565b93505050505b600160fb55919050565b600082815260656020526040902060010154610d778133612f20565b610d818383612f84565b505050565b600082610d92816125e8565b82610d9c81612b5b565b61012d5460ff1615610dc05760405162461bcd60e51b8152600401610874906157b0565b600260fb5403610de25760405162461bcd60e51b8152600401610874906157da565b600260fb55610df2338686612fa6565b600160fb5595945050505050565b6001600160a01b0381163314610e705760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610874565b610bb282826131e7565b60606000610e89610162613209565b905060008167ffffffffffffffff811115610ea657610ea6615872565b604051908082528060200260200182016040528015610ecf578160200160208202803683370190505b50905060005b82811015610f2557610ee961016282613213565b828281518110610efb57610efb615903565b6001600160a01b039092166020928302919091019091015280610f1d8161592f565b915050610ed5565b5092915050565b61012d5460ff1615610f505760405162461bcd60e51b8152600401610874906157b0565b7fdf8c9529ea4b244b569bac557a549516f317e7b5cf82dc5e0d8b6d874930a3f5610f7b813361252c565b600260fb5403610f9d5760405162461bcd60e51b8152600401610874906157da565b600260fb55604080516001600160601b031933606090811b82166020808501919091526001600160e01b03194260e01b1660348501528a821b8316603885015289821b909216604c84015282018790526080820186905260a08083018690528351808403909101815260c090920190925280519101206001600160a01b038088167f0000000000000000000000000000000000000000000000000000000000000000919091160361105d576110578187873360018861321f565b5061106d565b61106b818789883389613366565b505b60408051868152602081018690529081018490526001600160a01b03808816919089169083907f102bce4e43a6a8cf0306fde6154221c1f5460f64ba63b92b156bce998ef0db569060600160405180910390a45050600160fb555050505050565b60006110dd61012d5460ff1690565b156110fa5760405162461bcd60e51b8152600401610874906157b0565b600260fb540361111c5760405162461bcd60e51b8152600401610874906157da565b600260fb5561016054604051635f23b6c560e11b8152336004820152602481018490526001600160a01b039091169063be476d8a906044016020604051808303816000875af1158015611173573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111979190615835565b600160fb5592915050565b806111ac816125e8565b6111c4600080516020615d2c8339815191523361252c565b600260fb54036111e65760405162461bcd60e51b8152600401610874906157da565b600260fb556111f7610162836133c6565b6112145760405163b0ce759160e01b815260040160405180910390fd5b8260005b818110156112625761125086868381811061123557611235615903565b905060200201602081019061124a9190615398565b856133e8565b8061125a8161592f565b915050611218565b5050600160fb5550505050565b600061127e61012d5460ff1690565b1561129b5760405162461bcd60e51b8152600401610874906157b0565b600260fb54036112bd5760405162461bcd60e51b8152600401610874906157da565b600260fb556112d187878787878733613559565b600160fb55979650505050505050565b60006112eb613631565b826112f5816125e8565b826112ff81612b5b565b61012d5460ff16156113235760405162461bcd60e51b8152600401610874906157b0565b600260fb54036113455760405162461bcd60e51b8152600401610874906157da565b600260fb55610df233868682613657565b61136e600080516020615d2c8339815191523361252c565b8061137881613715565b610bb28261373f565b600080516020615cec83398151915261139a813361252c565b6108456137b8565b60c9546000906113b79061ffff166001615948565b905061ffff8116600a146113dd5760405162dc149f60e41b815260040160405180910390fd5b60c9805461ffff191661ffff8316179055505050565b600061140261012d5460ff1690565b1561141f5760405162461bcd60e51b8152600401610874906157b0565b600260fb54036114415760405162461bcd60e51b8152600401610874906157da565b600260fb5560405163ce53e72960e01b81526001600160a01b0383811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063ce53e72990602401602060405180830381865afa1580156114ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114d0919061596e565b6114ed576040516307d7f4eb60e21b815260040160405180910390fd5b60006114f883613812565b9050600061152f6001600160a01b0385167f000000000000000000000000000000000000000000000000000000000000000061384e565b60405163a135ef1760e01b81526001600160a01b03868116600483015291925060009184169063a135ef1790602401606060405180830381865afa15801561157b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061159f91906159b0565b60408101519091508281106115c7576040516341e43e3960e01b815260040160405180910390fd5b6040516387a7db0f60e01b81526001600160a01b0387811660048301528516906387a7db0f90602401600060405180830381600087803b15801561160a57600080fd5b505af115801561161e573d6000803e3d6000fd5b505050506000818461163091906159fa565b61016954909150600090611654908390610100900463ffffffff16620f42406138dc565b90506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016631c20fadd897f00000000000000000000000000000000000000000000000000000000000000006116b185876159fa565b6040518463ffffffff1660e01b81526004016116cf93929190615811565b600060405180830381600087803b1580156116e957600080fd5b505af11580156116fd573d6000803e3d6000fd5b5050604051631c20fadd60e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169250631c20fadd9150611751908b9033908690600401615811565b600060405180830381600087803b15801561176b57600080fd5b505af115801561177f573d6000803e3d6000fd5b5050506001600160a01b0389169050337f5ad7a2184454b6259cd118e4041a953dc9d6498302bbe528e4f967bed91971296117ba84866159fa565b60408051918252602082018690520160405180910390a350600160fb559695505050505050565b60008281526097602052604081206117f99083613213565b9392505050565b60009182526065602090815260408084206001600160a01b0393909316845291905290205460ff1690565b80611835816125e8565b61184d600080516020615d2c8339815191523361252c565b600260fb540361186f5760405162461bcd60e51b8152600401610874906157da565b600260fb819055506000826001600160a01b031663b1dd61b66040518163ffffffff1660e01b8152600401602060405180830381865afa1580156118b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118db919061584e565b90506000836001600160a01b03166354fd4d506040518163ffffffff1660e01b8152600401602060405180830381865afa15801561191d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611941919061584e565b9050600061194f83836139a8565b90506001600160a01b038116151580611971575061196f61016286613ae0565b155b1561198f5760405163119b4fd360e11b815260040160405180910390fd5b61199a856001612624565b846001600160a01b0316856001600160a01b031663b1dd61b66040518163ffffffff1660e01b8152600401602060405180830381865afa1580156119e2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a06919061584e565b61ffff167f5ae87719d73cb0fabb219f0e4b6e0a614ed7506f8a08bdb20bebf313573151b760405160405180910390a35050600160fb55505050565b84611a4c816125e8565b84611a5681612b5b565b84611a60816125e8565b61012d5460ff1615611a845760405162461bcd60e51b8152600401610874906157b0565b600260fb5403611aa65760405162461bcd60e51b8152600401610874906157da565b600260fb557f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811690891614158015611b6f575060405163b5af090f60e01b81526001600160a01b0389811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063b5af090f90602401602060405180830381865afa158015611b49573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b6d919061596e565b155b15611b8d57604051630b094f2760e31b815260040160405180910390fd5b60006001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163303611bc757506000611c69565b604051637c36afad60e01b81526001600160a01b038a81166004830152611c66918a917f00000000000000000000000000000000000000000000000000000000000000001690637c36afad90602401602060405180830381865afa158015611c33573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c579190615a11565b63ffffffff16620f42406138dc565b90505b6000611c7e6001600160a01b038b163061384e565b604051631c20fadd60e01b81529091506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690631c20fadd90611cd1908d908c908e90600401615811565b600060405180830381600087803b158015611ceb57600080fd5b505af1158015611cff573d6000803e3d6000fd5b50505050876001600160a01b03166323e30c8b33611d238d6001600160a01b031690565b8c868c8c6040518763ffffffff1660e01b8152600401611d4896959493929190615a2e565b600060405180830381600087803b158015611d6257600080fd5b505af1158015611d76573d6000803e3d6000fd5b50505050600081611d99308d6001600160a01b031661384e90919063ffffffff16565b611da391906159fa565b9050611daf838b615a8a565b811015611dcf5760405163b7ed78bf60e01b815260040160405180910390fd5b611de18b6001600160a01b0316613af5565b15611e1e57611e196001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001682613b17565b611e52565b611e526001600160a01b038c167f000000000000000000000000000000000000000000000000000000000000000083613c30565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116908c1603611efb5761015f54604051637c8f622d60e01b81526001600160a01b038d811660048301526024820186905260006044830152909116908190637c8f622d90606401600060405180830381600087803b158015611edd57600080fd5b505af1158015611ef1573d6000803e3d6000fd5b5050505050611f6e565b6000611f068c613812565b604051631510748b60e01b81526001600160a01b038e811660048301526024820187905291925090821690631510748b90604401600060405180830381600087803b158015611f5457600080fd5b505af1158015611f68573d6000803e3d6000fd5b50505050505b604080518b81526020810185905233916001600160a01b038e16917f0da3485ef1bb570df7bb888887eae5aa01d81b83cd8ccc80c0ea0922a677ecef910160405180910390a35050600160fb55505050505050505050565b6000611fd0613631565b83611fda816125e8565b83611fe4816125e8565b83611fee81612b5b565b61012d5460ff16156120125760405162461bcd60e51b8152600401610874906157b0565b600260fb54036120345760405162461bcd60e51b8152600401610874906157da565b600260fb556112d187878733613657565b8261204f816125e8565b82612059816125e8565b82612063816125e8565b600054610100900460ff1661207e5760005460ff1615612082565b303b155b6120e55760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610874565b600054610100900460ff16158015612107576000805461ffff19166101011790555b612112878787613c9b565b8015612124576000805461ff00191690555b50505050505050565b600260fb540361214f5760405162461bcd60e51b8152600401610874906157da565b600260fb55612160610162826133c6565b61217d5760405163b0ce759160e01b815260040160405180910390fd5b8160005b818110156122cb57600085858381811061219d5761219d615903565b90506020020160208101906121b29190615398565b6101615460405163772b7e9760e01b81526001600160a01b038084166004830152878116602483015292935091169063772b7e9790604401600060405180830381600087803b15801561220457600080fd5b505af1158015612218573d6000803e3d6000fd5b5050506001600160a01b038083166000818152610167602052604080822080548a86166001600160a01b031982161790915590519316935083927f987eb3c2f78454541205f72f34839b434c306c9eaf4922efd7c0c3060fdb2e4c9190a3846001600160a01b0316826001600160a01b03167f95f865c2808f8b2a85eea2611db7843150ee7835ef1403f9755918a97d76933c60405160405180910390a3505080806122c39061592f565b915050612181565b5050600160fb55505050565b600081815260976020526040812061081e90613209565b60006122fd61012d5460ff1690565b1561231a5760405162461bcd60e51b8152600401610874906157b0565b7f000000000000000000000000000000000000000000000000000000000000000061234481613ce5565b61235388888888888833613559565b98975050505050505050565b600061236e61012d5460ff1690565b1561238b5760405162461bcd60e51b8152600401610874906157b0565b600260fb54036123ad5760405162461bcd60e51b8152600401610874906157da565b600260fb556112d187878787878733613d0e565b6000828152606560205260409020600101546123dd8133612f20565b610d8183836131e7565b606060006123f6610165613209565b905060008167ffffffffffffffff81111561241357612413615872565b60405190808252806020026020018201604052801561243c578160200160208202803683370190505b50905060005b82811015610f255761245661016582613213565b82828151811061246857612468615903565b6001600160a01b03909216602092830291909101909101528061248a8161592f565b915050612442565b60006124a161012d5460ff1690565b156124be5760405162461bcd60e51b8152600401610874906157b0565b7f00000000000000000000000000000000000000000000000000000000000000006124e881613ce5565b61235388888888888833613d0e565b60006001600160e01b03198216637965db0b60e01b148061081e57506301ffc9a760e01b6001600160e01b031983161461081e565b6125368282611800565b610bb257604051634ca8886760e01b815260040160405180910390fd5b61012d5460ff1661259d5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610874565b61012d805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6001600160a01b0381166108455760405163e6c4247b60e01b815260040160405180910390fd5b60006117f9836001600160a01b038416613dd9565b8181156128d85761015f54604051632f2ff15d60e01b81527f4cbb5676e6e25e1a3b8a36de10472bcac96f97bd8dd87af6f330881b84739eb860048201526001600160a01b03838116602483015290911690632f2ff15d90604401600060405180830381600087803b15801561269957600080fd5b505af11580156126ad573d6000803e3d6000fd5b505061015f54604051632f2ff15d60e01b81527f0d0d17bf5382c809d9a3899d6a94e57386dfb2036f0401b94ef3cf6c1a9ab73f60048201526001600160a01b0385811660248301529091169250632f2ff15d9150604401600060405180830381600087803b15801561271f57600080fd5b505af1158015612733573d6000803e3d6000fd5b505061015f54604051632f2ff15d60e01b81527fca51b9188e78415f30da725e0d94567b4d65bc6777d4e5d573191e9f55b88a3260048201526001600160a01b0385811660248301529091169250632f2ff15d9150604401600060405180830381600087803b1580156127a557600080fd5b505af11580156127b9573d6000803e3d6000fd5b5050604051632f2ff15d60e01b8152600080516020615d0c83398151915260048201526001600160a01b0384811660248301527f0000000000000000000000000000000000000000000000000000000000000000169250632f2ff15d9150604401600060405180830381600087803b15801561283457600080fd5b505af1158015612848573d6000803e3d6000fd5b5050604051632f2ff15d60e01b8152600080516020615d0c83398151915260048201526001600160a01b0384811660248301527f0000000000000000000000000000000000000000000000000000000000000000169250632f2ff15d91506044015b600060405180830381600087803b1580156128c457600080fd5b505af1158015612124573d6000803e3d6000fd5b61015f5460405163d547741f60e01b81527f4cbb5676e6e25e1a3b8a36de10472bcac96f97bd8dd87af6f330881b84739eb860048201526001600160a01b0383811660248301529091169063d547741f90604401600060405180830381600087803b15801561294657600080fd5b505af115801561295a573d6000803e3d6000fd5b505061015f5460405163d547741f60e01b81527f0d0d17bf5382c809d9a3899d6a94e57386dfb2036f0401b94ef3cf6c1a9ab73f60048201526001600160a01b038581166024830152909116925063d547741f9150604401600060405180830381600087803b1580156129cc57600080fd5b505af11580156129e0573d6000803e3d6000fd5b505061015f5460405163d547741f60e01b81527fca51b9188e78415f30da725e0d94567b4d65bc6777d4e5d573191e9f55b88a3260048201526001600160a01b038581166024830152909116925063d547741f9150604401600060405180830381600087803b158015612a5257600080fd5b505af1158015612a66573d6000803e3d6000fd5b505060405163d547741f60e01b8152600080516020615d0c83398151915260048201526001600160a01b0384811660248301527f000000000000000000000000000000000000000000000000000000000000000016925063d547741f9150604401600060405180830381600087803b158015612ae157600080fd5b505af1158015612af5573d6000803e3d6000fd5b505060405163d547741f60e01b8152600080516020615d0c83398151915260048201526001600160a01b0384811660248301527f000000000000000000000000000000000000000000000000000000000000000016925063d547741f91506044016128aa565b8060000361084557604051637c946ed760e01b815260040160405180910390fd5b61016a54818103612b8b575050565b61016a82905560408051828152602081018490527f7cf7d95d939472232a091a8af32b247f54067369068b83e2add6f34dafac377591015b60405180910390a15050565b61015f5481516101605460208401516040516323b872dd60e01b81526000946001600160a01b03908116948116936323b872dd93612c169391909216918691600401615811565b6020604051808303816000875af1158015612c35573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c59919061596e565b5060208301516040516323b872dd60e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016916323b872dd91612cae918891869190600401615811565b6020604051808303816000875af1158015612ccd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612cf1919061596e565b50602083015160408085015190516372026c6760e11b8152600481018890526001600160a01b038781166024830152604482019390935260648101919091529082169063e404d8ce906084016020604051808303816000875af1158015612d5c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d809190615835565b95945050505050565b60008082600001516001600160a01b031663f4325d676040518163ffffffff1660e01b8152600401602060405180830381865afa158015612dce573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612df29190615aa2565b90506000612dff82613812565b84516101605460208701516040516323b872dd60e01b81529394506001600160a01b03928316936323b872dd93612e3c9316918691600401615811565b6020604051808303816000875af1158015612e5b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e7f919061596e565b50602084015160408086015190516356aca36f60e01b8152600481018990526001600160a01b038881166024830152858116604483015260648201939093526084810191909152908216906356aca36f9060a4016020604051808303816000875af1158015612ef2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f169190615835565b9695505050505050565b612f2a8282611800565b610bb257612f42816001600160a01b03166014613ecc565b612f4d836020613ecc565b604051602001612f5e929190615aeb565b60408051601f198184030181529082905262461bcd60e51b825261087491600401615b60565b612f8e8282614068565b6000828152609760205260409020610d819082613ae0565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b0316146130ee576000836001600160a01b031663f4325d676040518163ffffffff1660e01b8152600401602060405180830381865afa158015613021573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130459190615aa2565b9050836001600160a01b031661305a82613812565b604051635768adcf60e01b81526001600160a01b0384811660048301529190911690635768adcf90602401602060405180830381865afa1580156130a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130c69190615aa2565b6001600160a01b0316146130ec5760405162820f3560e61b815260040160405180910390fd5b505b610160546040516323b872dd60e01b81526001600160a01b03808616926323b872dd9261312392899216908790600401615811565b6020604051808303816000875af1158015613142573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613166919061596e565b50610160546040516313e7e7d160e11b81526001600160a01b03909116906327cfcfa29061319c90879087908790600401615811565b6020604051808303816000875af11580156131bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131df9190615835565b949350505050565b6131f182826140ee565b6000828152609760205260409020610d81908261260f565b600061081e825490565b60006117f98383614155565b60003415613240576040516342f7487960e11b815260040160405180910390fd5b61015f546040516323b872dd60e01b81526001600160a01b03918216917f000000000000000000000000000000000000000000000000000000000000000016906323b872dd9061329890889085908b90600401615811565b6020604051808303816000875af11580156132b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132db919061596e565b5060405163e06bf20d60e01b8152600481018990526001600160a01b0388811660248301526044820188905285151560648301526084820185905282169063e06bf20d9060a4015b6020604051808303816000875af1158015613342573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123539190615835565b600061337385848461417f565b600061337e86613812565b604051639f5c734b60e01b8152600481018a90526001600160a01b03898116602483015288811660448301526064820188905291925090821690639f5c734b90608401613323565b6001600160a01b038116600090815260018301602052604081205415156117f9565b6133f1826125e8565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081169083160361343d5760405163c1ab6dc160e01b815260040160405180910390fd5b61344961016583613ae0565b6134665760405163119b4fd360e11b815260040160405180910390fd5b604051634824fce960e11b81526001600160a01b038381166004830152821690639049f9d290602401600060405180830381600087803b1580156134a957600080fd5b505af11580156134bd573d6000803e3d6000fd5b505050506001600160a01b038281166000818152610167602052604080822080546001600160a01b0319169486169485179055517f4f2ce4e40f623ca765fc0167a25cb7842ceaafb8d82d3dec26ca0d0e0d2d48969190a3806001600160a01b0316826001600160a01b03167f95f865c2808f8b2a85eea2611db7843150ee7835ef1403f9755918a97d76933c60405160405180910390a35050565b60006135688888888888614263565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b0316036135a7575060015b61362460405180604001604052808b6001600160a01b031681526020018a6001600160a01b031681525060405180608001604052808a81526020018981526020016000151581526020018415158152506040518060400160405280876001600160a01b03168152602001886001600160a01b0316815250886142e7565b9998505050505050505050565b6101695460ff16613655576040516303a5be3f60e31b815260040160405180910390fd5b565b604080516001600160601b0319606084811b82166020808501919091526001600160e01b03194260e01b16603485015288821b8316603885015287821b909216604c84015280830186905283518084039091018152608090920190925280519101206000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811690861603613707576136ff8187868660008061321f565b9150506131df565b612f16818787878789613366565b620f424063ffffffff82161115610845576040516358d620b360e01b815260040160405180910390fd5b6101695463ffffffff6101009091048116908216810361375d575050565b610169805464ffffffff00191661010063ffffffff8581169182029290921790925560408051918416825260208201929092527fa159b13d7eac36d9a65034b4fd6ace1d9cb070d063dc950c564a266f4d0918029101612bc3565b61012d5460ff16156137dc5760405162461bcd60e51b8152600401610874906157b0565b61012d805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586125cb3390565b6001600160a01b03808216600090815261016760205260408120549091168061081e5760405163c1ab6dc160e01b815260040160405180910390fd5b600061385983613af5565b1561386f57506001600160a01b0381163161081e565b826040516370a0823160e01b81526001600160a01b03848116600483015291909116906370a0823190602401602060405180830381865afa1580156138b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117f99190615835565b6000806138e985856146eb565b805190915060000361390d578281602001516139059190615ba9565b9150506117f9565b8051831161392e57604051631a93c68960e11b815260040160405180910390fd5b600061393b868686614772565b90506000613949838361478d565b805190915060000361396f578481602001516139659190615ba9565b93505050506117f9565b60008581038616906139818383614812565b90506000613997613992848a615ba9565b614849565b919091029998505050505050505050565b6000806139b6610162613209565b905060005b81811015613ad55760006139d161016283613213565b90508561ffff16816001600160a01b031663b1dd61b66040518163ffffffff1660e01b8152600401602060405180830381865afa158015613a16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a3a919061584e565b61ffff16148015613ab357508461ffff16816001600160a01b03166354fd4d506040518163ffffffff1660e01b8152600401602060405180830381865afa158015613a89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613aad919061584e565b61ffff16145b15613ac257925061081e915050565b5080613acd8161592f565b9150506139bb565b506000949350505050565b60006117f9836001600160a01b038416614874565b6001600160a01b031673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1490565b80471015613b675760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610874565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114613bb4576040519150601f19603f3d011682016040523d82523d6000602084013e613bb9565b606091505b5050905080610d815760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610874565b80600003613c3d57505050565b613c4683613af5565b15613c87576040516001600160a01b0383169082156108fc029083906000818181858888f19350505050158015613c81573d6000803e3d6000fd5b50505050565b610d816001600160a01b03841683836148c3565b600054610100900460ff16613cc25760405162461bcd60e51b815260040161087490615bcb565b613cca614926565b613cd261495d565b613cda61498c565b610d818383836149bb565b336001600160a01b0382161461084557604051634ca8886760e01b815260040160405180910390fd5b6000613d1d8888888888614263565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b031603613d5c575060015b61362460405180604001604052808b6001600160a01b031681526020018a6001600160a01b031681525060405180608001604052808a81526020018981526020016001151581526020018415158152506040518060400160405280876001600160a01b03168152602001886001600160a01b0316815250886142e7565b60008181526001830160205260408120548015613ec2576000613dfd6001836159fa565b8554909150600090613e11906001906159fa565b9050818114613e76576000866000018281548110613e3157613e31615903565b9060005260206000200154905080876000018481548110613e5457613e54615903565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080613e8757613e87615c16565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061081e565b600091505061081e565b60606000613edb836002615c2c565b613ee6906002615a8a565b67ffffffffffffffff811115613efe57613efe615872565b6040519080825280601f01601f191660200182016040528015613f28576020820181803683370190505b509050600360fc1b81600081518110613f4357613f43615903565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110613f7257613f72615903565b60200101906001600160f81b031916908160001a9053506000613f96846002615c2c565b613fa1906001615a8a565b90505b6001811115614019576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110613fd557613fd5615903565b1a60f81b828281518110613feb57613feb615903565b60200101906001600160f81b031916908160001a90535060049490941c9361401281615c4b565b9050613fa4565b5083156117f95760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610874565b6140728282611800565b610bb25760008281526065602090815260408083206001600160a01b03851684529091529020805460ff191660011790556140aa3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6140f88282611800565b15610bb25760008281526065602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600082600001828154811061416c5761416c615903565b9060005260206000200154905092915050565b614191836001600160a01b0316613af5565b1561420f57803410156141b7576040516342f7487960e11b815260040160405180910390fd5b6141ea6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001682613b17565b80341115610d8157610d816141ff82346159fa565b6001600160a01b03841690613b17565b341561422e576040516342f7487960e11b815260040160405180910390fd5b610d816001600160a01b038416837f000000000000000000000000000000000000000000000000000000000000000084614aac565b61426c856125e8565b614275846125e8565b836001600160a01b0316856001600160a01b0316036142a75760405163c1ab6dc160e01b815260040160405180910390fd5b6142b083612b5b565b6142b982612b5b565b4263ffffffff168110156142e057604051631ab7da6b60e01b815260040160405180910390fd5b5050505050565b60208201516000906001600160a01b031661430d5782516001600160a01b031660208401525b825185516020808801518751888301516040808b0151858b015182516001600160601b031960609a8b1b8116828a01526001600160e01b03194260e01b166034830152988a1b8916603882015295891b8816604c87015288860194909452608080860193909352151560f81b60a085015260a1840189905291861b90941660c1830152805160b581840301815260d5830180835281519185019190912061015584018352600080835260f5850181905261011585018190526101359094018490528251958601835283865293850183905290840182905293830152919087516000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b039081169116036144b757614433848a6020015160018b614ad6565b91508192508160600151905088602001516001600160a01b031689600001516001600160a01b0316857f5c02c2bb2d1d082317eb23916ca27b3e7c294398b60061a2ad54f1c3c018c318856000015186602001518760000151886040015160008f600001516040516144aa96959493929190615c62565b60405180910390a4614616565b60208901516001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116911603614579576144ff848a6000015160008b614ad6565b91508192508160600151905088602001516001600160a01b031689600001516001600160a01b0316857f5c02c2bb2d1d082317eb23916ca27b3e7c294398b60061a2ad54f1c3c018c318856000015186602001518760200151886040015189604001518f600001516040516144aa96959493929190615c62565b614584848a8a614df8565b6060808201519083015192955090935061459d91615a8a565b905088602001516001600160a01b031689600001516001600160a01b0316857f5c02c2bb2d1d082317eb23916ca27b3e7c294398b60061a2ad54f1c3c018c31886600001518660200151886020015188604001518a604001518f6000015160405161460d96959493929190615c62565b60405180910390a45b88518751845161462792919061417f565b6020808a01518882015191840151604051631c20fadd60e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001693631c20fadd93614681939092600401615811565b600060405180830381600087803b15801561469b57600080fd5b505af11580156146af573d6000803e3d6000fd5b505050508061016860008282546146c69190615a8a565b909155505060408801516146db578251613624565b5060200151979650505050505050565b6040805180820190915260008082526020820152600061470b8484614f9b565b9050838302808210614740576040518060400160405280828461472e91906159fa565b8152602001828152509250505061081e565b604051806040016040528060016147578585900390565b61476191906159fa565b815260200191909152949350505050565b6000818061478257614782615b93565b838509949350505050565b6040805180820190915260008082526020820152818360200151106147da576040518060400160405280846000015181526020018385602001516147d191906159fa565b9052905061081e565b6040518060400160405280600185600001516147f691906159fa565b8152602001614809856020015185900390565b90529392505050565b60008061482a61482484808403615ba9565b60010190565b905082846020015161483c9190615ba9565b8451820217949350505050565b60006001815b6008811015610f2557838202600203820291508061486c8161592f565b91505061484f565b60008181526001830160205260408120546148bb5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561081e565b50600061081e565b6040516001600160a01b038316602482015260448101829052610d8190849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152614faa565b600054610100900460ff1661494d5760405162461bcd60e51b815260040161087490615bcb565b61495561507c565b6136556150a3565b600054610100900460ff166149845760405162461bcd60e51b815260040161087490615bcb565b613655615108565b600054610100900460ff166149b35760405162461bcd60e51b815260040161087490615bcb565b613655615136565b600054610100900460ff166149e25760405162461bcd60e51b815260040161087490615bcb565b61015f80546001600160a01b038086166001600160a01b0319928316179092556101608054858416908316179055610161805492841692909116919091179055614a5a7fdf8c9529ea4b244b569bac557a549516f317e7b5cf82dc5e0d8b6d874930a3f5600080516020615d2c83398151915261516a565b614a80600080516020615cec833981519152600080516020615d2c83398151915261516a565b610169805460ff19166001179055614a996107d061373f565b610d8169d3c21bcecceda1000000612b7c565b801580614abd5750614abd84613af5565b613c8157613c816001600160a01b0385168484846151b5565b614b016040518060800160405280600081526020016000815260200160008152602001600081525090565b600083614b54576040518060400160405280866001600160a01b031681526020017f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316815250614b9c565b60405180604001604052807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602001866001600160a01b03168152505b905060008360400151614c5a57614bb286613812565b825160208085015187519188015160608901516040516337cb0ead60e21b8152600481018e90526001600160a01b03958616602482015292851660448401526064830193909352608482015290151560a482015291169063df2c3ab49060c4016060604051808303816000875af1158015614c31573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614c559190615c93565b614d06565b614c6386613812565b8251602080850151875191880151606089015160405163d1aebfc760e01b8152600481018e90526001600160a01b03958616602482015292851660448401526064830193909352608482015290151560a482015291169063d1aebfc79060c4016060604051808303816000875af1158015614ce2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614d069190615c93565b905084614d9f5761015f54604082015160208301516001600160a01b0390921691637c8f622d918991614d3991906159fa565b6040516001600160e01b031960e085901b1681526001600160a01b039092166004830152602482015260016044820152606401600060405180830381600087803b158015614d8657600080fd5b505af1158015614d9a573d6000803e3d6000fd5b505050505b60405180608001604052808560400151614dba578251614dbd565b85515b81526020018560400151614dd2578551614dd5565b82515b815260200182602001518152602001826040015181525092505050949350505050565b614e236040518060800160405280600081526020016000815260200160008152602001600081525090565b614e4e6040518060800160405280600081526020016000815260200160008152602001600081525090565b826040015115614ef8576000836000015190506000846020015190506000614ea788886000015160006040518060800160405280888152602001600181526020016001151581526020018b606001511515815250614ad6565b90506000614ee989896020015160016040518060800160405280876020015181526020018881526020016001151581526020018c606001511515815250614ad6565b919550909350614f9392505050565b6000836000015190506000846020015190506000614f488888602001516001604051806080016040528088815260200160001981526020016000151581526020018b606001511515815250614ad6565b90506000614f8a89896000015160006040518060800160405280876000015181526020018881526020016000151581526020018c606001511515815250614ad6565b95509093505050505b935093915050565b60006000198284099392505050565b6000614fff826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166151d69092919063ffffffff16565b805190915015610d81578080602001905181019061501d919061596e565b610d815760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610874565b600054610100900460ff166136555760405162461bcd60e51b815260040161087490615bcb565b600054610100900460ff166150ca5760405162461bcd60e51b815260040161087490615bcb565b60c9805461ffff191660011790556150f0600080516020615d2c8339815191528061516a565b613655600080516020615d2c833981519152336151e5565b600054610100900460ff1661512f5760405162461bcd60e51b815260040161087490615bcb565b600160fb55565b600054610100900460ff1661515d5760405162461bcd60e51b815260040161087490615bcb565b61012d805460ff19169055565b600082815260656020526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b613c81846323b872dd60e01b8585856040516024016148ef93929190615811565b60606131df84846000856151ef565b610bb28282612f84565b6060824710156152505760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610874565b6001600160a01b0385163b6152a75760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610874565b600080866001600160a01b031685876040516152c39190615ccf565b60006040518083038185875af1925050503d8060008114615300576040519150601f19603f3d011682016040523d82523d6000602084013e615305565b606091505b5091509150615315828286615320565b979650505050505050565b6060831561532f5750816117f9565b82511561533f5782518084602001fd5b8160405162461bcd60e51b81526004016108749190615b60565b60006020828403121561536b57600080fd5b81356001600160e01b0319811681146117f957600080fd5b6001600160a01b038116811461084557600080fd5b6000602082840312156153aa57600080fd5b81356117f981615383565b6000602082840312156153c757600080fd5b5035919050565b801515811461084557600080fd5b6000602082840312156153ee57600080fd5b81356117f9816153ce565b6000806040838503121561540c57600080fd5b82359150602083013561541e81615383565b809150509250929050565b6000806040838503121561543c57600080fd5b823561544781615383565b946020939093013593505050565b6020808252825182820181905260009190848201906040850190845b818110156154965783516001600160a01b031683529284019291840191600101615471565b50909695505050505050565b600080600080600060a086880312156154ba57600080fd5b85356154c581615383565b945060208601356154d581615383565b94979496505050506040830135926060810135926080909101359150565b60008060006040848603121561550857600080fd5b833567ffffffffffffffff8082111561552057600080fd5b818601915086601f83011261553457600080fd5b81358181111561554357600080fd5b8760208260051b850101111561555857600080fd5b6020928301955093505084013561556e81615383565b809150509250925092565b60008060008060008060c0878903121561559257600080fd5b863561559d81615383565b955060208701356155ad81615383565b945060408701359350606087013592506080870135915060a08701356155d281615383565b809150509295509295509295565b63ffffffff8116811461084557600080fd5b60006020828403121561560457600080fd5b81356117f9816155e0565b60008083601f84011261562157600080fd5b50813567ffffffffffffffff81111561563957600080fd5b60208301915083602082850101111561565157600080fd5b9250929050565b6000806020838503121561566b57600080fd5b823567ffffffffffffffff81111561568257600080fd5b61568e8582860161560f565b90969095509350505050565b600080604083850312156156ad57600080fd5b50508035926020909101359150565b6000806000806000608086880312156156d457600080fd5b85356156df81615383565b94506020860135935060408601356156f681615383565b9250606086013567ffffffffffffffff81111561571257600080fd5b61571e8882890161560f565b969995985093965092949392505050565b60008060006060848603121561574457600080fd5b833561574f81615383565b9250602084013561575f81615383565b929592945050506040919091013590565b60008060006060848603121561578557600080fd5b833561579081615383565b925060208401356157a081615383565b9150604084013561556e81615383565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b60006020828403121561584757600080fd5b5051919050565b60006020828403121561586057600080fd5b815161ffff811681146117f957600080fd5b634e487b7160e01b600052604160045260246000fd5b6040516060810167ffffffffffffffff811182821017156158b957634e487b7160e01b600052604160045260246000fd5b60405290565b6000606082840312156158d157600080fd5b6158d9615888565b82516158e481615383565b8152602083810151908201526040928301519281019290925250919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161594157615941615919565b5060010190565b600061ffff80831681851680830382111561596557615965615919565b01949350505050565b60006020828403121561598057600080fd5b81516117f9816153ce565b80516fffffffffffffffffffffffffffffffff811681146159ab57600080fd5b919050565b6000606082840312156159c257600080fd5b6159ca615888565b6159d38361598b565b81526159e16020840161598b565b6020820152604083015160408201528091505092915050565b600082821015615a0c57615a0c615919565b500390565b600060208284031215615a2357600080fd5b81516117f9816155e0565b6001600160a01b03878116825286166020820152604081018590526060810184905260a06080820181905281018290526000828460c0840137600060c0848401015260c0601f19601f8501168301019050979650505050505050565b60008219821115615a9d57615a9d615919565b500190565b600060208284031215615ab457600080fd5b81516117f981615383565b60005b83811015615ada578181015183820152602001615ac2565b83811115613c815750506000910152565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351615b23816017850160208801615abf565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351615b54816028840160208801615abf565b01602801949350505050565b6020815260008251806020840152615b7f816040850160208701615abf565b601f01601f19169190910160400192915050565b634e487b7160e01b600052601260045260246000fd5b600082615bc657634e487b7160e01b600052601260045260246000fd5b500490565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b634e487b7160e01b600052603160045260246000fd5b6000816000190483118215151615615c4657615c46615919565b500290565b600081615c5a57615c5a615919565b506000190190565b95865260208601949094526040850192909252606084015260808301526001600160a01b031660a082015260c00190565b600060608284031215615ca557600080fd5b615cad615888565b8251815260208301516020820152604083015160408201528091505092915050565b60008251615ce1818460208701615abf565b919091019291505056fef28f409b8cbe6b50c7ca45afe893f01f69626f8a4e33cb480bc1bc2d618c084589ce14d20697a788f57260f7690044299bde7ea88cfb7e43d120a0c031f1ffc12172861495e7b85edac73e3cd5fbb42dd675baadf627720e687bcfdaca025096a164736f6c634300080d000a", - "deployedBytecode": "0x6080604052600436106102765760003560e01c80635c975abb1161014f578063a8bf9046116100c1578063d0d145811161007a578063d0d1458114610758578063d3a4acd31461076b578063d547741f1461077e578063d6efd7c31461079e578063d895feee146107b3578063e6aac07e146107c657600080fd5b8063a8bf9046146106a5578063adf51de1146106c5578063b3db428b146106e5578063c0c53b8b146106f8578063c109ba1314610718578063ca15c8731461073857600080fd5b80638ffcca07116101135780638ffcca07146105bd5780639010d07c146105dd57806391d148541461061557806393867fb5146106355780639bca0e7014610656578063a217fddf1461069057600080fd5b80635c975abb1461054057806371f43f9a146105595780637bf6a425146105725780638456cb59146105885780638cd2403d1461059d57600080fd5b806336568abe116101e857806341f435b3116101ac57806341f435b31461049d57806342659964146104be57806345d6602c146104de57806347e7ef24146104f1578063533007721461050457806354fd4d501461052457600080fd5b806336568abe146104125780633982b5311461043257806339fadf98146104485780633d1c24e71461046a5780633efcfda41461047d57600080fd5b8063248a9ca31161023a578063248a9ca31461034257806326e6b697146103725780632d944b80146103925780632e1a7d4d146103b25780632f2ff15d146103d2578063357a0333146103f257600080fd5b806301ffc9a714610282578063046f7da2146102b7578063079767de146102ce5780631329db29146102f1578063230df83a1461032257600080fd5b3661027d57005b600080fd5b34801561028e57600080fd5b506102a261029d366004615359565b6107f9565b60405190151581526020015b60405180910390f35b3480156102c357600080fd5b506102cc610824565b005b3480156102da57600080fd5b506102e3610848565b6040519081526020016102ae565b3480156102fd57600080fd5b5061016954610100900463ffffffff1660405163ffffffff90911681526020016102ae565b34801561032e57600080fd5b506102cc61033d366004615398565b6109a5565b34801561034e57600080fd5b506102e361035d3660046153b5565b60009081526065602052604090206001015490565b34801561037e57600080fd5b506102cc61038d3660046153dc565b610b4a565b34801561039e57600080fd5b506102cc6103ad3660046153b5565b610b87565b3480156103be57600080fd5b506102e36103cd3660046153b5565b610bb6565b3480156103de57600080fd5b506102cc6103ed3660046153f9565b610d5b565b3480156103fe57600080fd5b506102e361040d366004615429565b610d86565b34801561041e57600080fd5b506102cc61042d3660046153f9565b610e00565b34801561043e57600080fd5b5061016a546102e3565b34801561045457600080fd5b5061045d610e7a565b6040516102ae9190615455565b6102cc6104783660046154a2565b610f2c565b34801561048957600080fd5b506102e36104983660046153b5565b6110ce565b3480156104a957600080fd5b50600080516020615cec8339815191526102e3565b3480156104ca57600080fd5b506102cc6104d93660046154f3565b6111a2565b6102e36104ec366004615579565b61126f565b6102e36104ff366004615429565b6112e1565b34801561051057600080fd5b506102cc61051f3660046155f2565b611356565b34801561053057600080fd5b50604051600a81526020016102ae565b34801561054c57600080fd5b5061012d5460ff166102a2565b34801561056557600080fd5b506101695460ff166102a2565b34801561057e57600080fd5b50610168546102e3565b34801561059457600080fd5b506102cc611381565b3480156105a957600080fd5b506102cc6105b8366004615658565b6113a2565b3480156105c957600080fd5b506102e36105d8366004615398565b6113f3565b3480156105e957600080fd5b506105fd6105f836600461569a565b6117e1565b6040516001600160a01b0390911681526020016102ae565b34801561062157600080fd5b506102a26106303660046153f9565b611800565b34801561064157600080fd5b50600080516020615d2c8339815191526102e3565b34801561066257600080fd5b506105fd610671366004615398565b6001600160a01b03908116600090815261016760205260409020541690565b34801561069c57600080fd5b506102e3600081565b3480156106b157600080fd5b506102cc6106c0366004615398565b61182b565b3480156106d157600080fd5b506102cc6106e03660046156bc565b611a42565b6102e36106f336600461572f565b611fc6565b34801561070457600080fd5b506102cc610713366004615770565b612045565b34801561072457600080fd5b506102cc6107333660046154f3565b61212d565b34801561074457600080fd5b506102e36107533660046153b5565b6122d7565b6102e3610766366004615579565b6122ee565b6102e3610779366004615579565b61235f565b34801561078a57600080fd5b506102cc6107993660046153f9565b6123c1565b3480156107aa57600080fd5b5061045d6123e7565b6102e36107c1366004615579565b612492565b3480156107d257600080fd5b507fdf8c9529ea4b244b569bac557a549516f317e7b5cf82dc5e0d8b6d874930a3f56102e3565b60006001600160e01b03198216635a05180f60e01b148061081e575061081e826124f7565b92915050565b600080516020615cec83398151915261083d813361252c565b610845612553565b50565b600061085761012d5460ff1690565b1561087d5760405162461bcd60e51b8152600401610874906157b0565b60405180910390fd5b600260fb540361089f5760405162461bcd60e51b8152600401610874906157da565b600260fb556101685461016a548110156108bd57600091505061099d565b600061016855604051631c20fadd60e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690631c20fadd90610933907f00000000000000000000000000000000000000000000000000000000000000009081908690600401615811565b600060405180830381600087803b15801561094d57600080fd5b505af1158015610961573d6000803e3d6000fd5b50506040518381523392507f032863b8ce7ba939f971bf78a7ee035ae1044bef5dadf789c7cd09d26c0c40f4915060200160405180910390a290505b600160fb5590565b806109af816125e8565b6109c7600080516020615d2c8339815191523361252c565b600260fb54036109e95760405162461bcd60e51b8152600401610874906157da565b600260fb81905550816001600160a01b031663f525cb686040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a2f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a539190615835565b15610a71576040516332e7879360e01b815260040160405180910390fd5b610a7d6101628361260f565b610a9a5760405163b0ce759160e01b815260040160405180910390fd5b610aa5826000612624565b816001600160a01b0316826001600160a01b031663b1dd61b66040518163ffffffff1660e01b8152600401602060405180830381865afa158015610aed573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b11919061584e565b61ffff167fa0c1e3924f995e5ba38f53b4effb6d4b3eeb84176a2951c589115140f638ac0960405160405180910390a35050600160fb55565b610b62600080516020615d2c8339815191523361252c565b6101695460ff1615158115151461084557610169805482151560ff1990911617905550565b610b9f600080516020615d2c8339815191523361252c565b80610ba981612b5b565b610bb282612b7c565b5050565b6000610bc561012d5460ff1690565b15610be25760405162461bcd60e51b8152600401610874906157b0565b600260fb5403610c045760405162461bcd60e51b8152600401610874906157da565b600260fb55336000610c6784836000814260405160609290921b6001600160601b031916602083015260e01b6001600160e01b03191660348201526038810184905260580160405160208183030381529060405280519060200120905092915050565b6101605460405163158591ab60e11b8152600481018390526001600160a01b0385811660248301526044820188905292935060009290911690632b0b2356906064016060604051808303816000875af1158015610cc8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cec91906158bf565b90507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031681600001516001600160a01b031603610d4057610d36828483612bcf565b9350505050610d51565b610d4b828483612d89565b93505050505b600160fb55919050565b600082815260656020526040902060010154610d778133612f20565b610d818383612f84565b505050565b600082610d92816125e8565b82610d9c81612b5b565b61012d5460ff1615610dc05760405162461bcd60e51b8152600401610874906157b0565b600260fb5403610de25760405162461bcd60e51b8152600401610874906157da565b600260fb55610df2338686612fa6565b600160fb5595945050505050565b6001600160a01b0381163314610e705760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610874565b610bb282826131e7565b60606000610e89610162613209565b905060008167ffffffffffffffff811115610ea657610ea6615872565b604051908082528060200260200182016040528015610ecf578160200160208202803683370190505b50905060005b82811015610f2557610ee961016282613213565b828281518110610efb57610efb615903565b6001600160a01b039092166020928302919091019091015280610f1d8161592f565b915050610ed5565b5092915050565b61012d5460ff1615610f505760405162461bcd60e51b8152600401610874906157b0565b7fdf8c9529ea4b244b569bac557a549516f317e7b5cf82dc5e0d8b6d874930a3f5610f7b813361252c565b600260fb5403610f9d5760405162461bcd60e51b8152600401610874906157da565b600260fb55604080516001600160601b031933606090811b82166020808501919091526001600160e01b03194260e01b1660348501528a821b8316603885015289821b909216604c84015282018790526080820186905260a08083018690528351808403909101815260c090920190925280519101206001600160a01b038088167f0000000000000000000000000000000000000000000000000000000000000000919091160361105d576110578187873360018861321f565b5061106d565b61106b818789883389613366565b505b60408051868152602081018690529081018490526001600160a01b03808816919089169083907f102bce4e43a6a8cf0306fde6154221c1f5460f64ba63b92b156bce998ef0db569060600160405180910390a45050600160fb555050505050565b60006110dd61012d5460ff1690565b156110fa5760405162461bcd60e51b8152600401610874906157b0565b600260fb540361111c5760405162461bcd60e51b8152600401610874906157da565b600260fb5561016054604051635f23b6c560e11b8152336004820152602481018490526001600160a01b039091169063be476d8a906044016020604051808303816000875af1158015611173573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111979190615835565b600160fb5592915050565b806111ac816125e8565b6111c4600080516020615d2c8339815191523361252c565b600260fb54036111e65760405162461bcd60e51b8152600401610874906157da565b600260fb556111f7610162836133c6565b6112145760405163b0ce759160e01b815260040160405180910390fd5b8260005b818110156112625761125086868381811061123557611235615903565b905060200201602081019061124a9190615398565b856133e8565b8061125a8161592f565b915050611218565b5050600160fb5550505050565b600061127e61012d5460ff1690565b1561129b5760405162461bcd60e51b8152600401610874906157b0565b600260fb54036112bd5760405162461bcd60e51b8152600401610874906157da565b600260fb556112d187878787878733613559565b600160fb55979650505050505050565b60006112eb613631565b826112f5816125e8565b826112ff81612b5b565b61012d5460ff16156113235760405162461bcd60e51b8152600401610874906157b0565b600260fb54036113455760405162461bcd60e51b8152600401610874906157da565b600260fb55610df233868682613657565b61136e600080516020615d2c8339815191523361252c565b8061137881613715565b610bb28261373f565b600080516020615cec83398151915261139a813361252c565b6108456137b8565b60c9546000906113b79061ffff166001615948565b905061ffff8116600a146113dd5760405162dc149f60e41b815260040160405180910390fd5b60c9805461ffff191661ffff8316179055505050565b600061140261012d5460ff1690565b1561141f5760405162461bcd60e51b8152600401610874906157b0565b600260fb54036114415760405162461bcd60e51b8152600401610874906157da565b600260fb5560405163ce53e72960e01b81526001600160a01b0383811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063ce53e72990602401602060405180830381865afa1580156114ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114d0919061596e565b6114ed576040516307d7f4eb60e21b815260040160405180910390fd5b60006114f883613812565b9050600061152f6001600160a01b0385167f000000000000000000000000000000000000000000000000000000000000000061384e565b60405163a135ef1760e01b81526001600160a01b03868116600483015291925060009184169063a135ef1790602401606060405180830381865afa15801561157b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061159f91906159b0565b60408101519091508281106115c7576040516341e43e3960e01b815260040160405180910390fd5b6040516387a7db0f60e01b81526001600160a01b0387811660048301528516906387a7db0f90602401600060405180830381600087803b15801561160a57600080fd5b505af115801561161e573d6000803e3d6000fd5b505050506000818461163091906159fa565b61016954909150600090611654908390610100900463ffffffff16620f42406138dc565b90506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016631c20fadd897f00000000000000000000000000000000000000000000000000000000000000006116b185876159fa565b6040518463ffffffff1660e01b81526004016116cf93929190615811565b600060405180830381600087803b1580156116e957600080fd5b505af11580156116fd573d6000803e3d6000fd5b5050604051631c20fadd60e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169250631c20fadd9150611751908b9033908690600401615811565b600060405180830381600087803b15801561176b57600080fd5b505af115801561177f573d6000803e3d6000fd5b5050506001600160a01b0389169050337f5ad7a2184454b6259cd118e4041a953dc9d6498302bbe528e4f967bed91971296117ba84866159fa565b60408051918252602082018690520160405180910390a350600160fb559695505050505050565b60008281526097602052604081206117f99083613213565b9392505050565b60009182526065602090815260408084206001600160a01b0393909316845291905290205460ff1690565b80611835816125e8565b61184d600080516020615d2c8339815191523361252c565b600260fb540361186f5760405162461bcd60e51b8152600401610874906157da565b600260fb819055506000826001600160a01b031663b1dd61b66040518163ffffffff1660e01b8152600401602060405180830381865afa1580156118b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118db919061584e565b90506000836001600160a01b03166354fd4d506040518163ffffffff1660e01b8152600401602060405180830381865afa15801561191d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611941919061584e565b9050600061194f83836139a8565b90506001600160a01b038116151580611971575061196f61016286613ae0565b155b1561198f5760405163119b4fd360e11b815260040160405180910390fd5b61199a856001612624565b846001600160a01b0316856001600160a01b031663b1dd61b66040518163ffffffff1660e01b8152600401602060405180830381865afa1580156119e2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a06919061584e565b61ffff167f5ae87719d73cb0fabb219f0e4b6e0a614ed7506f8a08bdb20bebf313573151b760405160405180910390a35050600160fb55505050565b84611a4c816125e8565b84611a5681612b5b565b84611a60816125e8565b61012d5460ff1615611a845760405162461bcd60e51b8152600401610874906157b0565b600260fb5403611aa65760405162461bcd60e51b8152600401610874906157da565b600260fb557f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811690891614158015611b6f575060405163b5af090f60e01b81526001600160a01b0389811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063b5af090f90602401602060405180830381865afa158015611b49573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b6d919061596e565b155b15611b8d57604051630b094f2760e31b815260040160405180910390fd5b60006001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163303611bc757506000611c69565b604051637c36afad60e01b81526001600160a01b038a81166004830152611c66918a917f00000000000000000000000000000000000000000000000000000000000000001690637c36afad90602401602060405180830381865afa158015611c33573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c579190615a11565b63ffffffff16620f42406138dc565b90505b6000611c7e6001600160a01b038b163061384e565b604051631c20fadd60e01b81529091506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690631c20fadd90611cd1908d908c908e90600401615811565b600060405180830381600087803b158015611ceb57600080fd5b505af1158015611cff573d6000803e3d6000fd5b50505050876001600160a01b03166323e30c8b33611d238d6001600160a01b031690565b8c868c8c6040518763ffffffff1660e01b8152600401611d4896959493929190615a2e565b600060405180830381600087803b158015611d6257600080fd5b505af1158015611d76573d6000803e3d6000fd5b50505050600081611d99308d6001600160a01b031661384e90919063ffffffff16565b611da391906159fa565b9050611daf838b615a8a565b811015611dcf5760405163b7ed78bf60e01b815260040160405180910390fd5b611de18b6001600160a01b0316613af5565b15611e1e57611e196001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001682613b17565b611e52565b611e526001600160a01b038c167f000000000000000000000000000000000000000000000000000000000000000083613c30565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116908c1603611efb5761015f54604051637c8f622d60e01b81526001600160a01b038d811660048301526024820186905260006044830152909116908190637c8f622d90606401600060405180830381600087803b158015611edd57600080fd5b505af1158015611ef1573d6000803e3d6000fd5b5050505050611f6e565b6000611f068c613812565b604051631510748b60e01b81526001600160a01b038e811660048301526024820187905291925090821690631510748b90604401600060405180830381600087803b158015611f5457600080fd5b505af1158015611f68573d6000803e3d6000fd5b50505050505b604080518b81526020810185905233916001600160a01b038e16917f0da3485ef1bb570df7bb888887eae5aa01d81b83cd8ccc80c0ea0922a677ecef910160405180910390a35050600160fb55505050505050505050565b6000611fd0613631565b83611fda816125e8565b83611fe4816125e8565b83611fee81612b5b565b61012d5460ff16156120125760405162461bcd60e51b8152600401610874906157b0565b600260fb54036120345760405162461bcd60e51b8152600401610874906157da565b600260fb556112d187878733613657565b8261204f816125e8565b82612059816125e8565b82612063816125e8565b600054610100900460ff1661207e5760005460ff1615612082565b303b155b6120e55760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610874565b600054610100900460ff16158015612107576000805461ffff19166101011790555b612112878787613c9b565b8015612124576000805461ff00191690555b50505050505050565b600260fb540361214f5760405162461bcd60e51b8152600401610874906157da565b600260fb55612160610162826133c6565b61217d5760405163b0ce759160e01b815260040160405180910390fd5b8160005b818110156122cb57600085858381811061219d5761219d615903565b90506020020160208101906121b29190615398565b6101615460405163772b7e9760e01b81526001600160a01b038084166004830152878116602483015292935091169063772b7e9790604401600060405180830381600087803b15801561220457600080fd5b505af1158015612218573d6000803e3d6000fd5b5050506001600160a01b038083166000818152610167602052604080822080548a86166001600160a01b031982161790915590519316935083927f987eb3c2f78454541205f72f34839b434c306c9eaf4922efd7c0c3060fdb2e4c9190a3846001600160a01b0316826001600160a01b03167f95f865c2808f8b2a85eea2611db7843150ee7835ef1403f9755918a97d76933c60405160405180910390a3505080806122c39061592f565b915050612181565b5050600160fb55505050565b600081815260976020526040812061081e90613209565b60006122fd61012d5460ff1690565b1561231a5760405162461bcd60e51b8152600401610874906157b0565b7f000000000000000000000000000000000000000000000000000000000000000061234481613ce5565b61235388888888888833613559565b98975050505050505050565b600061236e61012d5460ff1690565b1561238b5760405162461bcd60e51b8152600401610874906157b0565b600260fb54036123ad5760405162461bcd60e51b8152600401610874906157da565b600260fb556112d187878787878733613d0e565b6000828152606560205260409020600101546123dd8133612f20565b610d8183836131e7565b606060006123f6610165613209565b905060008167ffffffffffffffff81111561241357612413615872565b60405190808252806020026020018201604052801561243c578160200160208202803683370190505b50905060005b82811015610f255761245661016582613213565b82828151811061246857612468615903565b6001600160a01b03909216602092830291909101909101528061248a8161592f565b915050612442565b60006124a161012d5460ff1690565b156124be5760405162461bcd60e51b8152600401610874906157b0565b7f00000000000000000000000000000000000000000000000000000000000000006124e881613ce5565b61235388888888888833613d0e565b60006001600160e01b03198216637965db0b60e01b148061081e57506301ffc9a760e01b6001600160e01b031983161461081e565b6125368282611800565b610bb257604051634ca8886760e01b815260040160405180910390fd5b61012d5460ff1661259d5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610874565b61012d805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6001600160a01b0381166108455760405163e6c4247b60e01b815260040160405180910390fd5b60006117f9836001600160a01b038416613dd9565b8181156128d85761015f54604051632f2ff15d60e01b81527f4cbb5676e6e25e1a3b8a36de10472bcac96f97bd8dd87af6f330881b84739eb860048201526001600160a01b03838116602483015290911690632f2ff15d90604401600060405180830381600087803b15801561269957600080fd5b505af11580156126ad573d6000803e3d6000fd5b505061015f54604051632f2ff15d60e01b81527f0d0d17bf5382c809d9a3899d6a94e57386dfb2036f0401b94ef3cf6c1a9ab73f60048201526001600160a01b0385811660248301529091169250632f2ff15d9150604401600060405180830381600087803b15801561271f57600080fd5b505af1158015612733573d6000803e3d6000fd5b505061015f54604051632f2ff15d60e01b81527fca51b9188e78415f30da725e0d94567b4d65bc6777d4e5d573191e9f55b88a3260048201526001600160a01b0385811660248301529091169250632f2ff15d9150604401600060405180830381600087803b1580156127a557600080fd5b505af11580156127b9573d6000803e3d6000fd5b5050604051632f2ff15d60e01b8152600080516020615d0c83398151915260048201526001600160a01b0384811660248301527f0000000000000000000000000000000000000000000000000000000000000000169250632f2ff15d9150604401600060405180830381600087803b15801561283457600080fd5b505af1158015612848573d6000803e3d6000fd5b5050604051632f2ff15d60e01b8152600080516020615d0c83398151915260048201526001600160a01b0384811660248301527f0000000000000000000000000000000000000000000000000000000000000000169250632f2ff15d91506044015b600060405180830381600087803b1580156128c457600080fd5b505af1158015612124573d6000803e3d6000fd5b61015f5460405163d547741f60e01b81527f4cbb5676e6e25e1a3b8a36de10472bcac96f97bd8dd87af6f330881b84739eb860048201526001600160a01b0383811660248301529091169063d547741f90604401600060405180830381600087803b15801561294657600080fd5b505af115801561295a573d6000803e3d6000fd5b505061015f5460405163d547741f60e01b81527f0d0d17bf5382c809d9a3899d6a94e57386dfb2036f0401b94ef3cf6c1a9ab73f60048201526001600160a01b038581166024830152909116925063d547741f9150604401600060405180830381600087803b1580156129cc57600080fd5b505af11580156129e0573d6000803e3d6000fd5b505061015f5460405163d547741f60e01b81527fca51b9188e78415f30da725e0d94567b4d65bc6777d4e5d573191e9f55b88a3260048201526001600160a01b038581166024830152909116925063d547741f9150604401600060405180830381600087803b158015612a5257600080fd5b505af1158015612a66573d6000803e3d6000fd5b505060405163d547741f60e01b8152600080516020615d0c83398151915260048201526001600160a01b0384811660248301527f000000000000000000000000000000000000000000000000000000000000000016925063d547741f9150604401600060405180830381600087803b158015612ae157600080fd5b505af1158015612af5573d6000803e3d6000fd5b505060405163d547741f60e01b8152600080516020615d0c83398151915260048201526001600160a01b0384811660248301527f000000000000000000000000000000000000000000000000000000000000000016925063d547741f91506044016128aa565b8060000361084557604051637c946ed760e01b815260040160405180910390fd5b61016a54818103612b8b575050565b61016a82905560408051828152602081018490527f7cf7d95d939472232a091a8af32b247f54067369068b83e2add6f34dafac377591015b60405180910390a15050565b61015f5481516101605460208401516040516323b872dd60e01b81526000946001600160a01b03908116948116936323b872dd93612c169391909216918691600401615811565b6020604051808303816000875af1158015612c35573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c59919061596e565b5060208301516040516323b872dd60e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016916323b872dd91612cae918891869190600401615811565b6020604051808303816000875af1158015612ccd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612cf1919061596e565b50602083015160408085015190516372026c6760e11b8152600481018890526001600160a01b038781166024830152604482019390935260648101919091529082169063e404d8ce906084016020604051808303816000875af1158015612d5c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d809190615835565b95945050505050565b60008082600001516001600160a01b031663f4325d676040518163ffffffff1660e01b8152600401602060405180830381865afa158015612dce573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612df29190615aa2565b90506000612dff82613812565b84516101605460208701516040516323b872dd60e01b81529394506001600160a01b03928316936323b872dd93612e3c9316918691600401615811565b6020604051808303816000875af1158015612e5b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e7f919061596e565b50602084015160408086015190516356aca36f60e01b8152600481018990526001600160a01b038881166024830152858116604483015260648201939093526084810191909152908216906356aca36f9060a4016020604051808303816000875af1158015612ef2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f169190615835565b9695505050505050565b612f2a8282611800565b610bb257612f42816001600160a01b03166014613ecc565b612f4d836020613ecc565b604051602001612f5e929190615aeb565b60408051601f198184030181529082905262461bcd60e51b825261087491600401615b60565b612f8e8282614068565b6000828152609760205260409020610d819082613ae0565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b0316146130ee576000836001600160a01b031663f4325d676040518163ffffffff1660e01b8152600401602060405180830381865afa158015613021573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130459190615aa2565b9050836001600160a01b031661305a82613812565b604051635768adcf60e01b81526001600160a01b0384811660048301529190911690635768adcf90602401602060405180830381865afa1580156130a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130c69190615aa2565b6001600160a01b0316146130ec5760405162820f3560e61b815260040160405180910390fd5b505b610160546040516323b872dd60e01b81526001600160a01b03808616926323b872dd9261312392899216908790600401615811565b6020604051808303816000875af1158015613142573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613166919061596e565b50610160546040516313e7e7d160e11b81526001600160a01b03909116906327cfcfa29061319c90879087908790600401615811565b6020604051808303816000875af11580156131bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131df9190615835565b949350505050565b6131f182826140ee565b6000828152609760205260409020610d81908261260f565b600061081e825490565b60006117f98383614155565b60003415613240576040516342f7487960e11b815260040160405180910390fd5b61015f546040516323b872dd60e01b81526001600160a01b03918216917f000000000000000000000000000000000000000000000000000000000000000016906323b872dd9061329890889085908b90600401615811565b6020604051808303816000875af11580156132b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132db919061596e565b5060405163e06bf20d60e01b8152600481018990526001600160a01b0388811660248301526044820188905285151560648301526084820185905282169063e06bf20d9060a4015b6020604051808303816000875af1158015613342573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123539190615835565b600061337385848461417f565b600061337e86613812565b604051639f5c734b60e01b8152600481018a90526001600160a01b03898116602483015288811660448301526064820188905291925090821690639f5c734b90608401613323565b6001600160a01b038116600090815260018301602052604081205415156117f9565b6133f1826125e8565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081169083160361343d5760405163c1ab6dc160e01b815260040160405180910390fd5b61344961016583613ae0565b6134665760405163119b4fd360e11b815260040160405180910390fd5b604051634824fce960e11b81526001600160a01b038381166004830152821690639049f9d290602401600060405180830381600087803b1580156134a957600080fd5b505af11580156134bd573d6000803e3d6000fd5b505050506001600160a01b038281166000818152610167602052604080822080546001600160a01b0319169486169485179055517f4f2ce4e40f623ca765fc0167a25cb7842ceaafb8d82d3dec26ca0d0e0d2d48969190a3806001600160a01b0316826001600160a01b03167f95f865c2808f8b2a85eea2611db7843150ee7835ef1403f9755918a97d76933c60405160405180910390a35050565b60006135688888888888614263565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b0316036135a7575060015b61362460405180604001604052808b6001600160a01b031681526020018a6001600160a01b031681525060405180608001604052808a81526020018981526020016000151581526020018415158152506040518060400160405280876001600160a01b03168152602001886001600160a01b0316815250886142e7565b9998505050505050505050565b6101695460ff16613655576040516303a5be3f60e31b815260040160405180910390fd5b565b604080516001600160601b0319606084811b82166020808501919091526001600160e01b03194260e01b16603485015288821b8316603885015287821b909216604c84015280830186905283518084039091018152608090920190925280519101206000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811690861603613707576136ff8187868660008061321f565b9150506131df565b612f16818787878789613366565b620f424063ffffffff82161115610845576040516358d620b360e01b815260040160405180910390fd5b6101695463ffffffff6101009091048116908216810361375d575050565b610169805464ffffffff00191661010063ffffffff8581169182029290921790925560408051918416825260208201929092527fa159b13d7eac36d9a65034b4fd6ace1d9cb070d063dc950c564a266f4d0918029101612bc3565b61012d5460ff16156137dc5760405162461bcd60e51b8152600401610874906157b0565b61012d805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586125cb3390565b6001600160a01b03808216600090815261016760205260408120549091168061081e5760405163c1ab6dc160e01b815260040160405180910390fd5b600061385983613af5565b1561386f57506001600160a01b0381163161081e565b826040516370a0823160e01b81526001600160a01b03848116600483015291909116906370a0823190602401602060405180830381865afa1580156138b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117f99190615835565b6000806138e985856146eb565b805190915060000361390d578281602001516139059190615ba9565b9150506117f9565b8051831161392e57604051631a93c68960e11b815260040160405180910390fd5b600061393b868686614772565b90506000613949838361478d565b805190915060000361396f578481602001516139659190615ba9565b93505050506117f9565b60008581038616906139818383614812565b90506000613997613992848a615ba9565b614849565b919091029998505050505050505050565b6000806139b6610162613209565b905060005b81811015613ad55760006139d161016283613213565b90508561ffff16816001600160a01b031663b1dd61b66040518163ffffffff1660e01b8152600401602060405180830381865afa158015613a16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a3a919061584e565b61ffff16148015613ab357508461ffff16816001600160a01b03166354fd4d506040518163ffffffff1660e01b8152600401602060405180830381865afa158015613a89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613aad919061584e565b61ffff16145b15613ac257925061081e915050565b5080613acd8161592f565b9150506139bb565b506000949350505050565b60006117f9836001600160a01b038416614874565b6001600160a01b031673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1490565b80471015613b675760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610874565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114613bb4576040519150601f19603f3d011682016040523d82523d6000602084013e613bb9565b606091505b5050905080610d815760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610874565b80600003613c3d57505050565b613c4683613af5565b15613c87576040516001600160a01b0383169082156108fc029083906000818181858888f19350505050158015613c81573d6000803e3d6000fd5b50505050565b610d816001600160a01b03841683836148c3565b600054610100900460ff16613cc25760405162461bcd60e51b815260040161087490615bcb565b613cca614926565b613cd261495d565b613cda61498c565b610d818383836149bb565b336001600160a01b0382161461084557604051634ca8886760e01b815260040160405180910390fd5b6000613d1d8888888888614263565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b031603613d5c575060015b61362460405180604001604052808b6001600160a01b031681526020018a6001600160a01b031681525060405180608001604052808a81526020018981526020016001151581526020018415158152506040518060400160405280876001600160a01b03168152602001886001600160a01b0316815250886142e7565b60008181526001830160205260408120548015613ec2576000613dfd6001836159fa565b8554909150600090613e11906001906159fa565b9050818114613e76576000866000018281548110613e3157613e31615903565b9060005260206000200154905080876000018481548110613e5457613e54615903565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080613e8757613e87615c16565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061081e565b600091505061081e565b60606000613edb836002615c2c565b613ee6906002615a8a565b67ffffffffffffffff811115613efe57613efe615872565b6040519080825280601f01601f191660200182016040528015613f28576020820181803683370190505b509050600360fc1b81600081518110613f4357613f43615903565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110613f7257613f72615903565b60200101906001600160f81b031916908160001a9053506000613f96846002615c2c565b613fa1906001615a8a565b90505b6001811115614019576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110613fd557613fd5615903565b1a60f81b828281518110613feb57613feb615903565b60200101906001600160f81b031916908160001a90535060049490941c9361401281615c4b565b9050613fa4565b5083156117f95760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610874565b6140728282611800565b610bb25760008281526065602090815260408083206001600160a01b03851684529091529020805460ff191660011790556140aa3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6140f88282611800565b15610bb25760008281526065602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600082600001828154811061416c5761416c615903565b9060005260206000200154905092915050565b614191836001600160a01b0316613af5565b1561420f57803410156141b7576040516342f7487960e11b815260040160405180910390fd5b6141ea6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001682613b17565b80341115610d8157610d816141ff82346159fa565b6001600160a01b03841690613b17565b341561422e576040516342f7487960e11b815260040160405180910390fd5b610d816001600160a01b038416837f000000000000000000000000000000000000000000000000000000000000000084614aac565b61426c856125e8565b614275846125e8565b836001600160a01b0316856001600160a01b0316036142a75760405163c1ab6dc160e01b815260040160405180910390fd5b6142b083612b5b565b6142b982612b5b565b4263ffffffff168110156142e057604051631ab7da6b60e01b815260040160405180910390fd5b5050505050565b60208201516000906001600160a01b031661430d5782516001600160a01b031660208401525b825185516020808801518751888301516040808b0151858b015182516001600160601b031960609a8b1b8116828a01526001600160e01b03194260e01b166034830152988a1b8916603882015295891b8816604c87015288860194909452608080860193909352151560f81b60a085015260a1840189905291861b90941660c1830152805160b581840301815260d5830180835281519185019190912061015584018352600080835260f5850181905261011585018190526101359094018490528251958601835283865293850183905290840182905293830152919087516000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b039081169116036144b757614433848a6020015160018b614ad6565b91508192508160600151905088602001516001600160a01b031689600001516001600160a01b0316857f5c02c2bb2d1d082317eb23916ca27b3e7c294398b60061a2ad54f1c3c018c318856000015186602001518760000151886040015160008f600001516040516144aa96959493929190615c62565b60405180910390a4614616565b60208901516001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116911603614579576144ff848a6000015160008b614ad6565b91508192508160600151905088602001516001600160a01b031689600001516001600160a01b0316857f5c02c2bb2d1d082317eb23916ca27b3e7c294398b60061a2ad54f1c3c018c318856000015186602001518760200151886040015189604001518f600001516040516144aa96959493929190615c62565b614584848a8a614df8565b6060808201519083015192955090935061459d91615a8a565b905088602001516001600160a01b031689600001516001600160a01b0316857f5c02c2bb2d1d082317eb23916ca27b3e7c294398b60061a2ad54f1c3c018c31886600001518660200151886020015188604001518a604001518f6000015160405161460d96959493929190615c62565b60405180910390a45b88518751845161462792919061417f565b6020808a01518882015191840151604051631c20fadd60e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001693631c20fadd93614681939092600401615811565b600060405180830381600087803b15801561469b57600080fd5b505af11580156146af573d6000803e3d6000fd5b505050508061016860008282546146c69190615a8a565b909155505060408801516146db578251613624565b5060200151979650505050505050565b6040805180820190915260008082526020820152600061470b8484614f9b565b9050838302808210614740576040518060400160405280828461472e91906159fa565b8152602001828152509250505061081e565b604051806040016040528060016147578585900390565b61476191906159fa565b815260200191909152949350505050565b6000818061478257614782615b93565b838509949350505050565b6040805180820190915260008082526020820152818360200151106147da576040518060400160405280846000015181526020018385602001516147d191906159fa565b9052905061081e565b6040518060400160405280600185600001516147f691906159fa565b8152602001614809856020015185900390565b90529392505050565b60008061482a61482484808403615ba9565b60010190565b905082846020015161483c9190615ba9565b8451820217949350505050565b60006001815b6008811015610f2557838202600203820291508061486c8161592f565b91505061484f565b60008181526001830160205260408120546148bb5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561081e565b50600061081e565b6040516001600160a01b038316602482015260448101829052610d8190849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152614faa565b600054610100900460ff1661494d5760405162461bcd60e51b815260040161087490615bcb565b61495561507c565b6136556150a3565b600054610100900460ff166149845760405162461bcd60e51b815260040161087490615bcb565b613655615108565b600054610100900460ff166149b35760405162461bcd60e51b815260040161087490615bcb565b613655615136565b600054610100900460ff166149e25760405162461bcd60e51b815260040161087490615bcb565b61015f80546001600160a01b038086166001600160a01b0319928316179092556101608054858416908316179055610161805492841692909116919091179055614a5a7fdf8c9529ea4b244b569bac557a549516f317e7b5cf82dc5e0d8b6d874930a3f5600080516020615d2c83398151915261516a565b614a80600080516020615cec833981519152600080516020615d2c83398151915261516a565b610169805460ff19166001179055614a996107d061373f565b610d8169d3c21bcecceda1000000612b7c565b801580614abd5750614abd84613af5565b613c8157613c816001600160a01b0385168484846151b5565b614b016040518060800160405280600081526020016000815260200160008152602001600081525090565b600083614b54576040518060400160405280866001600160a01b031681526020017f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316815250614b9c565b60405180604001604052807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602001866001600160a01b03168152505b905060008360400151614c5a57614bb286613812565b825160208085015187519188015160608901516040516337cb0ead60e21b8152600481018e90526001600160a01b03958616602482015292851660448401526064830193909352608482015290151560a482015291169063df2c3ab49060c4016060604051808303816000875af1158015614c31573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614c559190615c93565b614d06565b614c6386613812565b8251602080850151875191880151606089015160405163d1aebfc760e01b8152600481018e90526001600160a01b03958616602482015292851660448401526064830193909352608482015290151560a482015291169063d1aebfc79060c4016060604051808303816000875af1158015614ce2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614d069190615c93565b905084614d9f5761015f54604082015160208301516001600160a01b0390921691637c8f622d918991614d3991906159fa565b6040516001600160e01b031960e085901b1681526001600160a01b039092166004830152602482015260016044820152606401600060405180830381600087803b158015614d8657600080fd5b505af1158015614d9a573d6000803e3d6000fd5b505050505b60405180608001604052808560400151614dba578251614dbd565b85515b81526020018560400151614dd2578551614dd5565b82515b815260200182602001518152602001826040015181525092505050949350505050565b614e236040518060800160405280600081526020016000815260200160008152602001600081525090565b614e4e6040518060800160405280600081526020016000815260200160008152602001600081525090565b826040015115614ef8576000836000015190506000846020015190506000614ea788886000015160006040518060800160405280888152602001600181526020016001151581526020018b606001511515815250614ad6565b90506000614ee989896020015160016040518060800160405280876020015181526020018881526020016001151581526020018c606001511515815250614ad6565b919550909350614f9392505050565b6000836000015190506000846020015190506000614f488888602001516001604051806080016040528088815260200160001981526020016000151581526020018b606001511515815250614ad6565b90506000614f8a89896000015160006040518060800160405280876000015181526020018881526020016000151581526020018c606001511515815250614ad6565b95509093505050505b935093915050565b60006000198284099392505050565b6000614fff826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166151d69092919063ffffffff16565b805190915015610d81578080602001905181019061501d919061596e565b610d815760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610874565b600054610100900460ff166136555760405162461bcd60e51b815260040161087490615bcb565b600054610100900460ff166150ca5760405162461bcd60e51b815260040161087490615bcb565b60c9805461ffff191660011790556150f0600080516020615d2c8339815191528061516a565b613655600080516020615d2c833981519152336151e5565b600054610100900460ff1661512f5760405162461bcd60e51b815260040161087490615bcb565b600160fb55565b600054610100900460ff1661515d5760405162461bcd60e51b815260040161087490615bcb565b61012d805460ff19169055565b600082815260656020526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b613c81846323b872dd60e01b8585856040516024016148ef93929190615811565b60606131df84846000856151ef565b610bb28282612f84565b6060824710156152505760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610874565b6001600160a01b0385163b6152a75760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610874565b600080866001600160a01b031685876040516152c39190615ccf565b60006040518083038185875af1925050503d8060008114615300576040519150601f19603f3d011682016040523d82523d6000602084013e615305565b606091505b5091509150615315828286615320565b979650505050505050565b6060831561532f5750816117f9565b82511561533f5782518084602001fd5b8160405162461bcd60e51b81526004016108749190615b60565b60006020828403121561536b57600080fd5b81356001600160e01b0319811681146117f957600080fd5b6001600160a01b038116811461084557600080fd5b6000602082840312156153aa57600080fd5b81356117f981615383565b6000602082840312156153c757600080fd5b5035919050565b801515811461084557600080fd5b6000602082840312156153ee57600080fd5b81356117f9816153ce565b6000806040838503121561540c57600080fd5b82359150602083013561541e81615383565b809150509250929050565b6000806040838503121561543c57600080fd5b823561544781615383565b946020939093013593505050565b6020808252825182820181905260009190848201906040850190845b818110156154965783516001600160a01b031683529284019291840191600101615471565b50909695505050505050565b600080600080600060a086880312156154ba57600080fd5b85356154c581615383565b945060208601356154d581615383565b94979496505050506040830135926060810135926080909101359150565b60008060006040848603121561550857600080fd5b833567ffffffffffffffff8082111561552057600080fd5b818601915086601f83011261553457600080fd5b81358181111561554357600080fd5b8760208260051b850101111561555857600080fd5b6020928301955093505084013561556e81615383565b809150509250925092565b60008060008060008060c0878903121561559257600080fd5b863561559d81615383565b955060208701356155ad81615383565b945060408701359350606087013592506080870135915060a08701356155d281615383565b809150509295509295509295565b63ffffffff8116811461084557600080fd5b60006020828403121561560457600080fd5b81356117f9816155e0565b60008083601f84011261562157600080fd5b50813567ffffffffffffffff81111561563957600080fd5b60208301915083602082850101111561565157600080fd5b9250929050565b6000806020838503121561566b57600080fd5b823567ffffffffffffffff81111561568257600080fd5b61568e8582860161560f565b90969095509350505050565b600080604083850312156156ad57600080fd5b50508035926020909101359150565b6000806000806000608086880312156156d457600080fd5b85356156df81615383565b94506020860135935060408601356156f681615383565b9250606086013567ffffffffffffffff81111561571257600080fd5b61571e8882890161560f565b969995985093965092949392505050565b60008060006060848603121561574457600080fd5b833561574f81615383565b9250602084013561575f81615383565b929592945050506040919091013590565b60008060006060848603121561578557600080fd5b833561579081615383565b925060208401356157a081615383565b9150604084013561556e81615383565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b60006020828403121561584757600080fd5b5051919050565b60006020828403121561586057600080fd5b815161ffff811681146117f957600080fd5b634e487b7160e01b600052604160045260246000fd5b6040516060810167ffffffffffffffff811182821017156158b957634e487b7160e01b600052604160045260246000fd5b60405290565b6000606082840312156158d157600080fd5b6158d9615888565b82516158e481615383565b8152602083810151908201526040928301519281019290925250919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161594157615941615919565b5060010190565b600061ffff80831681851680830382111561596557615965615919565b01949350505050565b60006020828403121561598057600080fd5b81516117f9816153ce565b80516fffffffffffffffffffffffffffffffff811681146159ab57600080fd5b919050565b6000606082840312156159c257600080fd5b6159ca615888565b6159d38361598b565b81526159e16020840161598b565b6020820152604083015160408201528091505092915050565b600082821015615a0c57615a0c615919565b500390565b600060208284031215615a2357600080fd5b81516117f9816155e0565b6001600160a01b03878116825286166020820152604081018590526060810184905260a06080820181905281018290526000828460c0840137600060c0848401015260c0601f19601f8501168301019050979650505050505050565b60008219821115615a9d57615a9d615919565b500190565b600060208284031215615ab457600080fd5b81516117f981615383565b60005b83811015615ada578181015183820152602001615ac2565b83811115613c815750506000910152565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351615b23816017850160208801615abf565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351615b54816028840160208801615abf565b01602801949350505050565b6020815260008251806020840152615b7f816040850160208701615abf565b601f01601f19169190910160400192915050565b634e487b7160e01b600052601260045260246000fd5b600082615bc657634e487b7160e01b600052601260045260246000fd5b500490565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b634e487b7160e01b600052603160045260246000fd5b6000816000190483118215151615615c4657615c46615919565b500290565b600081615c5a57615c5a615919565b506000190190565b95865260208601949094526040850192909252606084015260808301526001600160a01b031660a082015260c00190565b600060608284031215615ca557600080fd5b615cad615888565b8251815260208301516020820152604083015160408201528091505092915050565b60008251615ce1818460208701615abf565b919091019291505056fef28f409b8cbe6b50c7ca45afe893f01f69626f8a4e33cb480bc1bc2d618c084589ce14d20697a788f57260f7690044299bde7ea88cfb7e43d120a0c031f1ffc12172861495e7b85edac73e3cd5fbb42dd675baadf627720e687bcfdaca025096a164736f6c634300080d000a", + "numDeployments": 10, + "solcInputHash": "75c10dc0a0cf10192f6eeb9735bc76a1", + "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\":\"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\":\"InvalidExternalAddress\",\"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\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"AddressAddedToWhitelist\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"AddressRemovedFromWhitelist\",\"type\":\"event\"},{\"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\":false,\"internalType\":\"uint256\",\"name\":\"oldMinNetworkFeeBurn\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newMinNetworkFeeBurn\",\"type\":\"uint256\"}],\"name\":\"MinNetworkFeeBurnUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"NetworkFeesBurned\",\"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\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"addToWhitelist\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"burnNetworkFees\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"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\":[],\"name\":\"feeExemptionWhitelist\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"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\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"isWhitelisted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"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\":\"minNetworkFeeBurn\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"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\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"removeFromWhitelist\",\"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\":[{\"internalType\":\"uint256\",\"name\":\"newMinNetworkFeeBurn\",\"type\":\"uint256\"}],\"name\":\"setMinNetworkFeeBurn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"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\":\"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\":{\"AddressAddedToWhitelist(address)\":{\"details\":\"triggered when an address gets added to the fee exemption whitelist\"},\"AddressRemovedFromWhitelist(address)\":{\"details\":\"triggered when an address gets removed from the fee exemption whitelist\"},\"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\"},\"MinNetworkFeeBurnUpdated(uint256,uint256)\":{\"details\":\"triggered when the min network fee burn is updated\"},\"NetworkFeesBurned(address,uint256)\":{\"details\":\"triggered when network fees are burned\"},\"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\":{\"addToWhitelist(address)\":{\"details\":\"adds an address to the fee exemption whitelist requirements: - the caller must be the admin of the contract\"},\"burnNetworkFees()\":{\"details\":\"burns pending network fees, and returns the amount of fees burned\"},\"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\"},\"feeExemptionWhitelist()\":{\"details\":\"returns the fee exemption whitelist\"},\"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\"},\"isWhitelisted(address)\":{\"details\":\"returns whether an address is in the fee exemption whitelist\"},\"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\"},\"minNetworkFeeBurn()\":{\"details\":\"returns the min network fee burn\"},\"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\"},\"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\"},\"removeFromWhitelist(address)\":{\"details\":\"removes an address from the fee exemption 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`.\"},\"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\"},\"setMinNetworkFeeBurn(uint256)\":{\"details\":\"set the min network fee burn\"},\"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 in the fee exemption whitelist\"},\"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 in the fee exemption whitelist\"},\"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\"},\"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,\\n NotEmpty,\\n AccessDenied\\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 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 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\\n uint256 internal _pendingNetworkFeeAmount;\\n\\n bool private _depositingEnabled = true;\\n\\n uint32 private _polRewardsPPM;\\n\\n // min network fee amount that can be burned\\n uint256 private _minNetworkFeeBurn;\\n\\n // a set of addresses which are exempt from trading / flashloan fees\\n EnumerableSetUpgradeable.AddressSet private _feeExemptionWhitelist;\\n\\n // upgrade forward-compatibility storage gap\\n uint256[MAX_GAP - 14] 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 burned\\n */\\n event NetworkFeesBurned(address indexed caller, 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 triggered when the min network fee burn is updated\\n */\\n event MinNetworkFeeBurnUpdated(uint256 oldMinNetworkFeeBurn, uint256 newMinNetworkFeeBurn);\\n\\n /**\\n * @dev triggered when an address gets added to the fee exemption whitelist\\n */\\n event AddressAddedToWhitelist(address indexed addr);\\n\\n /**\\n * @dev triggered when an address gets removed from the fee exemption whitelist\\n */\\n event AddressRemovedFromWhitelist(address indexed addr);\\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 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(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 _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\\n _depositingEnabled = true;\\n\\n _setPOLRewardsPPM(2000);\\n _setMinNetworkFeeBurn(1_000_000e18);\\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 modifier onlyWhitelisted(address addr) {\\n _onlyWhitelisted(addr);\\n\\n _;\\n }\\n\\n function _onlyWhitelisted(address addr) internal view {\\n if (!_feeExemptionWhitelist.contains(addr)) {\\n revert AccessDenied();\\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 11;\\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 pending network fee amount to be burned\\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 false\\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 false\\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 onlyWhitelisted(msg.sender) returns (uint256) {\\n return\\n _tradeBySourceAmount(\\n sourceToken,\\n targetToken,\\n sourceAmount,\\n minReturnAmount,\\n deadline,\\n beneficiary,\\n msg.sender,\\n true\\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 onlyWhitelisted(msg.sender) returns (uint256) {\\n return\\n _tradeByTargetAmount(\\n sourceToken,\\n targetToken,\\n targetAmount,\\n maxSourceAmount,\\n deadline,\\n beneficiary,\\n msg.sender,\\n true\\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 (_feeExemptionWhitelist.contains(msg.sender)) {\\n // exempt 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 burnNetworkFees() external whenNotPaused nonReentrant returns (uint256) {\\n uint256 currentPendingNetworkFeeAmount = _pendingNetworkFeeAmount;\\n if (currentPendingNetworkFeeAmount < _minNetworkFeeBurn) {\\n return 0;\\n }\\n\\n _pendingNetworkFeeAmount = 0;\\n\\n // transferring bnt to the token's address burns the tokens\\n _masterVault.withdrawFunds(Token(address(_bnt)), payable(address(_bnt)), currentPendingNetworkFeeAmount);\\n\\n emit NetworkFeesBurned(msg.sender, 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 * @inheritdoc IBancorNetwork\\n */\\n function feeExemptionWhitelist() external view returns (address[] memory) {\\n uint256 length = _feeExemptionWhitelist.length();\\n address[] memory list = new address[](length);\\n for (uint256 i = 0; i < length; ++i) {\\n list[i] = _feeExemptionWhitelist.at(i);\\n }\\n return list;\\n }\\n\\n /**\\n * @dev adds an address to the fee exemption whitelist\\n *\\n * requirements:\\n *\\n * - the caller must be the admin of the contract\\n */\\n function addToWhitelist(address addr) external onlyAdmin {\\n _addToWhitelist(addr);\\n }\\n\\n /**\\n * @dev removes an address from the fee exemption whitelist\\n *\\n * requirements:\\n *\\n * - the caller must be the admin of the contract\\n */\\n function removeFromWhitelist(address addr) external onlyAdmin {\\n if (!_feeExemptionWhitelist.remove(addr)) {\\n revert DoesNotExist();\\n }\\n\\n emit AddressRemovedFromWhitelist(addr);\\n }\\n\\n /**\\n * @inheritdoc IBancorNetwork\\n */\\n function isWhitelisted(address addr) external view returns (bool) {\\n return _feeExemptionWhitelist.contains(addr);\\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 returns the min network fee burn\\n */\\n function minNetworkFeeBurn() external view returns (uint256) {\\n return _minNetworkFeeBurn;\\n }\\n\\n /**\\n * @dev set the min network fee burn\\n */\\n function setMinNetworkFeeBurn(\\n uint256 newMinNetworkFeeBurn\\n ) external onlyAdmin greaterThanZero(newMinNetworkFeeBurn) {\\n _setMinNetworkFeeBurn(newMinNetworkFeeBurn);\\n }\\n\\n /**\\n * @dev set the min network fee burn\\n */\\n function _setMinNetworkFeeBurn(uint256 newMinNetworkFeeBurn) private {\\n uint256 oldMinNetworkFeeBurn = _minNetworkFeeBurn;\\n if (oldMinNetworkFeeBurn == newMinNetworkFeeBurn) {\\n return;\\n }\\n\\n _minNetworkFeeBurn = newMinNetworkFeeBurn;\\n emit MinNetworkFeeBurnUpdated(oldMinNetworkFeeBurn, newMinNetworkFeeBurn);\\n }\\n\\n /**\\n * @dev adds an address to the fee exemption whitelist\\n */\\n function _addToWhitelist(address addr) private validExternalAddress(addr) {\\n if (!_feeExemptionWhitelist.add(addr)) {\\n revert AlreadyExists();\\n }\\n\\n emit AddressAddedToWhitelist(addr);\\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 bool ignoreFees\\n ) private returns (uint256) {\\n _verifyTradeParams(sourceToken, targetToken, sourceAmount, minReturnAmount, deadline);\\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 bool ignoreFees\\n ) private returns (uint256) {\\n _verifyTradeParams(sourceToken, targetToken, targetAmount, maxSourceAmount, deadline);\\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\":\"0x5ec8c4e79bdf23a9b5008a09c0a262a76060934685d9a00750fb434fd433d7f3\",\"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 in the fee exemption whitelist\\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 in the fee exemption whitelist\\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 burns pending network fees, and returns the amount of fees burned\\n */\\n function burnNetworkFees() 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 /**\\n * @dev returns whether an address is in the fee exemption whitelist\\n */\\n function isWhitelisted(address _address) external view returns (bool);\\n\\n /**\\n * @dev returns the fee exemption whitelist\\n */\\n function feeExemptionWhitelist() external view returns (address[] memory);\\n}\\n\",\"keccak256\":\"0x6d7968b1744cf4efbc0ba8c3a77462a079b5e6eba43347d9c5cb82d8fb8c88f8\",\"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\",\"keccak256\":\"0x16ae140655866de96a928cf5f362fe89665e816afe4625ab7ed385fd34987b60\",\"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": "0x6101a0604052610169805460ff191660011790553480156200002057600080fd5b506040516200631738038062006317833981016040819052620000439162000200565b866200004f81620001bf565b866200005b81620001bf565b866200006781620001bf565b866200007381620001bf565b866200007f81620001bf565b866200008b81620001bf565b866200009781620001bf565b6001600160a01b038e1660a081905260408051637e062a3560e11b8152905163fc0c546a916004808201926020929091908290030181865afa158015620000e2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001089190620002ab565b6001600160a01b039081166080528d1660e081905260408051637e062a3560e11b8152905163fc0c546a916004808201926020929091908290030181865afa15801562000159573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200017f9190620002ab565b6001600160a01b0390811660c0529b8c166101005250505050958716610120525050918416610140528316610160529091166101805250620002d2915050565b6001600160a01b038116620001e75760405163e6c4247b60e01b815260040160405180910390fd5b50565b6001600160a01b0381168114620001e757600080fd5b600080600080600080600060e0888a0312156200021c57600080fd5b87516200022981620001ea565b60208901519097506200023c81620001ea565b60408901519096506200024f81620001ea565b60608901519095506200026281620001ea565b60808901519094506200027581620001ea565b60a08901519093506200028881620001ea565b60c08901519092506200029b81620001ea565b8091505092959891949750929550565b600060208284031215620002be57600080fd5b8151620002cb81620001ea565b9392505050565b60805160a05160c05160e0516101005161012051610140516101605161018051615f2b620003ec600039600061186a015260008181610da10152613154015260008181612a270152612cd401526000818161098b015281816116ed01528181611842015281816118f801528181611e5b01528181611fb601528181611ff00152818161299801528181612c450152818161435b015281816143d501526147e301526000818161164701528181611ce40152611daf0152600050506000612e20015260005050600081816109b8015281816110df01528181611c8f0152818161201f0152818161342b015281816135a501528181613829015281816145880152818161465d01528181614cf70152614d340152615f2b6000f3fe6080604052600436106102b25760003560e01c806371f43f9a11610175578063a8bf9046116100dc578063d0d1458111610095578063d6efd7c31161006f578063d6efd7c31461082f578063d895feee14610844578063e43252d714610857578063e6aac07e1461087757600080fd5b8063d0d14581146107e9578063d3a4acd3146107fc578063d547741f1461080f57600080fd5b8063a8bf904614610736578063adf51de114610756578063b3db428b14610776578063c0c53b8b14610789578063c109ba13146107a9578063ca15c873146107c957600080fd5b80638ffcca071161012e5780638ffcca071461064e5780639010d07c1461066e57806391d14854146106a657806393867fb5146106c65780639bca0e70146106e7578063a217fddf1461072157600080fd5b806371f43f9a146105b55780637576b2d6146105ce5780637bf6a425146105e35780638456cb59146105f95780638ab1d6811461060e5780638cd2403d1461062e57600080fd5b80633982b5311161021957806342659964116101d2578063426599641461051a57806345d6602c1461053a57806347e7ef241461054d578063533007721461056057806354fd4d50146105805780635c975abb1461059c57600080fd5b80633982b5311461046e57806339fadf98146104845780633af32abf146104a65780633d1c24e7146104c65780633efcfda4146104d957806341f435b3146104f957600080fd5b806326e6b6971161026b57806326e6b697146103ae5780632d944b80146103ce5780632e1a7d4d146103ee5780632f2ff15d1461040e578063357a03331461042e57806336568abe1461044e57600080fd5b806301ffc9a7146102be578063046f7da2146102f3578063079767de1461030a5780631329db291461032d578063230df83a1461035e578063248a9ca31461037e57600080fd5b366102b957005b600080fd5b3480156102ca57600080fd5b506102de6102d936600461552c565b6108aa565b60405190151581526020015b60405180910390f35b3480156102ff57600080fd5b506103086108d5565b005b34801561031657600080fd5b5061031f6108f9565b6040519081526020016102ea565b34801561033957600080fd5b5061016954610100900463ffffffff1660405163ffffffff90911681526020016102ea565b34801561036a57600080fd5b5061030861037936600461556b565b610a56565b34801561038a57600080fd5b5061031f610399366004615588565b60009081526065602052604090206001015490565b3480156103ba57600080fd5b506103086103c93660046155af565b610bfb565b3480156103da57600080fd5b506103086103e9366004615588565b610c38565b3480156103fa57600080fd5b5061031f610409366004615588565b610c67565b34801561041a57600080fd5b506103086104293660046155cc565b610e0c565b34801561043a57600080fd5b5061031f6104493660046155fc565b610e37565b34801561045a57600080fd5b506103086104693660046155cc565b610eb1565b34801561047a57600080fd5b5061016a5461031f565b34801561049057600080fd5b50610499610f2b565b6040516102ea9190615628565b3480156104b257600080fd5b506102de6104c136600461556b565b610fdd565b6103086104d4366004615675565b610feb565b3480156104e557600080fd5b5061031f6104f4366004615588565b61118d565b34801561050557600080fd5b50600080516020615ebf83398151915261031f565b34801561052657600080fd5b506103086105353660046156c6565b611261565b61031f61054836600461574c565b61132e565b61031f61055b3660046155fc565b6113a2565b34801561056c57600080fd5b5061030861057b3660046157c5565b611417565b34801561058c57600080fd5b50604051600b81526020016102ea565b3480156105a857600080fd5b5061012d5460ff166102de565b3480156105c157600080fd5b506101695460ff166102de565b3480156105da57600080fd5b50610499611442565b3480156105ef57600080fd5b506101685461031f565b34801561060557600080fd5b506103086114eb565b34801561061a57600080fd5b5061030861062936600461556b565b61150c565b34801561063a57600080fd5b5061030861064936600461582b565b611584565b34801561065a57600080fd5b5061031f61066936600461556b565b6115d5565b34801561067a57600080fd5b5061068e61068936600461586d565b6119c3565b6040516001600160a01b0390911681526020016102ea565b3480156106b257600080fd5b506102de6106c13660046155cc565b6119e2565b3480156106d257600080fd5b50600080516020615eff83398151915261031f565b3480156106f357600080fd5b5061068e61070236600461556b565b6001600160a01b03908116600090815261016760205260409020541690565b34801561072d57600080fd5b5061031f600081565b34801561074257600080fd5b5061030861075136600461556b565b611a0d565b34801561076257600080fd5b5061030861077136600461588f565b611c24565b61031f610784366004615902565b612189565b34801561079557600080fd5b506103086107a4366004615943565b612208565b3480156107b557600080fd5b506103086107c43660046156c6565b6122f0565b3480156107d557600080fd5b5061031f6107e4366004615588565b61249a565b61031f6107f736600461574c565b6124b1565b61031f61080a36600461574c565b612504565b34801561081b57600080fd5b5061030861082a3660046155cc565b612568565b34801561083b57600080fd5b5061049961258e565b61031f61085236600461574c565b612639565b34801561086357600080fd5b5061030861087236600461556b565b612680565b34801561088357600080fd5b507fdf8c9529ea4b244b569bac557a549516f317e7b5cf82dc5e0d8b6d874930a3f561031f565b60006001600160e01b03198216635a05180f60e01b14806108cf57506108cf826126a1565b92915050565b600080516020615ebf8339815191526108ee81336126d6565b6108f66126fd565b50565b600061090861012d5460ff1690565b1561092e5760405162461bcd60e51b815260040161092590615983565b60405180910390fd5b600260fb54036109505760405162461bcd60e51b8152600401610925906159ad565b600260fb556101685461016a5481101561096e576000915050610a4e565b600061016855604051631c20fadd60e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690631c20fadd906109e4907f000000000000000000000000000000000000000000000000000000000000000090819086906004016159e4565b600060405180830381600087803b1580156109fe57600080fd5b505af1158015610a12573d6000803e3d6000fd5b50506040518381523392507f032863b8ce7ba939f971bf78a7ee035ae1044bef5dadf789c7cd09d26c0c40f4915060200160405180910390a290505b600160fb5590565b80610a6081612792565b610a78600080516020615eff833981519152336126d6565b600260fb5403610a9a5760405162461bcd60e51b8152600401610925906159ad565b600260fb81905550816001600160a01b031663f525cb686040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ae0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b049190615a08565b15610b22576040516332e7879360e01b815260040160405180910390fd5b610b2e610162836127b9565b610b4b5760405163b0ce759160e01b815260040160405180910390fd5b610b568260006127ce565b816001600160a01b0316826001600160a01b031663b1dd61b66040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b9e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bc29190615a21565b61ffff167fa0c1e3924f995e5ba38f53b4effb6d4b3eeb84176a2951c589115140f638ac0960405160405180910390a35050600160fb55565b610c13600080516020615eff833981519152336126d6565b6101695460ff161515811515146108f657610169805482151560ff1990911617905550565b610c50600080516020615eff833981519152336126d6565b80610c5a81612d05565b610c6382612d26565b5050565b6000610c7661012d5460ff1690565b15610c935760405162461bcd60e51b815260040161092590615983565b600260fb5403610cb55760405162461bcd60e51b8152600401610925906159ad565b600260fb55336000610d1884836000814260405160609290921b6001600160601b031916602083015260e01b6001600160e01b03191660348201526038810184905260580160405160208183030381529060405280519060200120905092915050565b6101605460405163158591ab60e11b8152600481018390526001600160a01b0385811660248301526044820188905292935060009290911690632b0b2356906064016060604051808303816000875af1158015610d79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d9d9190615a92565b90507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031681600001516001600160a01b031603610df157610de7828483612d79565b9350505050610e02565b610dfc828483612f33565b93505050505b600160fb55919050565b600082815260656020526040902060010154610e2881336130ca565b610e32838361312e565b505050565b600082610e4381612792565b82610e4d81612d05565b61012d5460ff1615610e715760405162461bcd60e51b815260040161092590615983565b600260fb5403610e935760405162461bcd60e51b8152600401610925906159ad565b600260fb55610ea3338686613150565b600160fb5595945050505050565b6001600160a01b0381163314610f215760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610925565b610c638282613391565b60606000610f3a6101626133b3565b905060008167ffffffffffffffff811115610f5757610f57615a45565b604051908082528060200260200182016040528015610f80578160200160208202803683370190505b50905060005b82811015610fd657610f9a610162826133bd565b828281518110610fac57610fac615ad6565b6001600160a01b039092166020928302919091019091015280610fce81615b02565b915050610f86565b5092915050565b60006108cf61016b836133c9565b61012d5460ff161561100f5760405162461bcd60e51b815260040161092590615983565b7fdf8c9529ea4b244b569bac557a549516f317e7b5cf82dc5e0d8b6d874930a3f561103a81336126d6565b600260fb540361105c5760405162461bcd60e51b8152600401610925906159ad565b600260fb55604080516001600160601b031933606090811b82166020808501919091526001600160e01b03194260e01b1660348501528a821b8316603885015289821b909216604c84015282018790526080820186905260a08083018690528351808403909101815260c090920190925280519101206001600160a01b038088167f0000000000000000000000000000000000000000000000000000000000000000919091160361111c57611116818787336001886133eb565b5061112c565b61112a818789883389613532565b505b60408051868152602081018690529081018490526001600160a01b03808816919089169083907f102bce4e43a6a8cf0306fde6154221c1f5460f64ba63b92b156bce998ef0db569060600160405180910390a45050600160fb555050505050565b600061119c61012d5460ff1690565b156111b95760405162461bcd60e51b815260040161092590615983565b600260fb54036111db5760405162461bcd60e51b8152600401610925906159ad565b600260fb5561016054604051635f23b6c560e11b8152336004820152602481018490526001600160a01b039091169063be476d8a906044016020604051808303816000875af1158015611232573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112569190615a08565b600160fb5592915050565b8061126b81612792565b611283600080516020615eff833981519152336126d6565b600260fb54036112a55760405162461bcd60e51b8152600401610925906159ad565b600260fb556112b6610162836133c9565b6112d35760405163b0ce759160e01b815260040160405180910390fd5b8260005b818110156113215761130f8686838181106112f4576112f4615ad6565b9050602002016020810190611309919061556b565b85613592565b8061131981615b02565b9150506112d7565b5050600160fb5550505050565b600061133d61012d5460ff1690565b1561135a5760405162461bcd60e51b815260040161092590615983565b600260fb540361137c5760405162461bcd60e51b8152600401610925906159ad565b600260fb55611392878787878787336000613703565b600160fb55979650505050505050565b60006113ac61379c565b826113b681612792565b826113c081612d05565b61012d5460ff16156113e45760405162461bcd60e51b815260040161092590615983565b600260fb54036114065760405162461bcd60e51b8152600401610925906159ad565b600260fb55610ea3338686826137c2565b61142f600080516020615eff833981519152336126d6565b8061143981613880565b610c63826138aa565b6060600061145161016b6133b3565b905060008167ffffffffffffffff81111561146e5761146e615a45565b604051908082528060200260200182016040528015611497578160200160208202803683370190505b50905060005b82811015610fd6576114b161016b826133bd565b8282815181106114c3576114c3615ad6565b6001600160a01b03909216602092830291909101909101526114e481615b02565b905061149d565b600080516020615ebf83398151915261150481336126d6565b6108f6613923565b611524600080516020615eff833981519152336126d6565b61153061016b826127b9565b61154d5760405163b0ce759160e01b815260040160405180910390fd5b6040516001600160a01b038216907f535611fb62fa2a833988f283b779e417e996813e44046f521d76c17b5943b08c90600090a250565b60c9546000906115999061ffff166001615b1b565b905061ffff8116600b146115bf5760405162dc149f60e41b815260040160405180910390fd5b60c9805461ffff191661ffff8316179055505050565b60006115e461012d5460ff1690565b156116015760405162461bcd60e51b815260040161092590615983565b600260fb54036116235760405162461bcd60e51b8152600401610925906159ad565b600260fb5560405163ce53e72960e01b81526001600160a01b0383811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063ce53e72990602401602060405180830381865afa15801561168e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116b29190615b41565b6116cf576040516307d7f4eb60e21b815260040160405180910390fd5b60006116da8361397d565b905060006117116001600160a01b0385167f00000000000000000000000000000000000000000000000000000000000000006139b9565b60405163a135ef1760e01b81526001600160a01b03868116600483015291925060009184169063a135ef1790602401606060405180830381865afa15801561175d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117819190615b83565b60408101519091508281106117a9576040516341e43e3960e01b815260040160405180910390fd5b6040516387a7db0f60e01b81526001600160a01b0387811660048301528516906387a7db0f90602401600060405180830381600087803b1580156117ec57600080fd5b505af1158015611800573d6000803e3d6000fd5b50505050600081846118129190615bcd565b61016954909150600090611836908390610100900463ffffffff16620f4240613a47565b90506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016631c20fadd897f00000000000000000000000000000000000000000000000000000000000000006118938587615bcd565b6040518463ffffffff1660e01b81526004016118b1939291906159e4565b600060405180830381600087803b1580156118cb57600080fd5b505af11580156118df573d6000803e3d6000fd5b5050604051631c20fadd60e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169250631c20fadd9150611933908b90339086906004016159e4565b600060405180830381600087803b15801561194d57600080fd5b505af1158015611961573d6000803e3d6000fd5b5050506001600160a01b0389169050337f5ad7a2184454b6259cd118e4041a953dc9d6498302bbe528e4f967bed919712961199c8486615bcd565b60408051918252602082018690520160405180910390a350600160fb559695505050505050565b60008281526097602052604081206119db90836133bd565b9392505050565b60009182526065602090815260408084206001600160a01b0393909316845291905290205460ff1690565b80611a1781612792565b611a2f600080516020615eff833981519152336126d6565b600260fb5403611a515760405162461bcd60e51b8152600401610925906159ad565b600260fb819055506000826001600160a01b031663b1dd61b66040518163ffffffff1660e01b8152600401602060405180830381865afa158015611a99573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611abd9190615a21565b90506000836001600160a01b03166354fd4d506040518163ffffffff1660e01b8152600401602060405180830381865afa158015611aff573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b239190615a21565b90506000611b318383613b13565b90506001600160a01b038116151580611b535750611b5161016286613c4b565b155b15611b715760405163119b4fd360e11b815260040160405180910390fd5b611b7c8560016127ce565b846001600160a01b0316856001600160a01b031663b1dd61b66040518163ffffffff1660e01b8152600401602060405180830381865afa158015611bc4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611be89190615a21565b61ffff167f5ae87719d73cb0fabb219f0e4b6e0a614ed7506f8a08bdb20bebf313573151b760405160405180910390a35050600160fb55505050565b84611c2e81612792565b84611c3881612d05565b84611c4281612792565b61012d5460ff1615611c665760405162461bcd60e51b815260040161092590615983565b600260fb5403611c885760405162461bcd60e51b8152600401610925906159ad565b600260fb557f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811690891614158015611d51575060405163b5af090f60e01b81526001600160a01b0389811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063b5af090f90602401602060405180830381865afa158015611d2b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d4f9190615b41565b155b15611d6f57604051630b094f2760e31b815260040160405180910390fd5b6000611d7d61016b336133c9565b15611d8a57506000611e2c565b604051637c36afad60e01b81526001600160a01b038a81166004830152611e29918a917f00000000000000000000000000000000000000000000000000000000000000001690637c36afad90602401602060405180830381865afa158015611df6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e1a9190615be4565b63ffffffff16620f4240613a47565b90505b6000611e416001600160a01b038b16306139b9565b604051631c20fadd60e01b81529091506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690631c20fadd90611e94908d908c908e906004016159e4565b600060405180830381600087803b158015611eae57600080fd5b505af1158015611ec2573d6000803e3d6000fd5b50505050876001600160a01b03166323e30c8b33611ee68d6001600160a01b031690565b8c868c8c6040518763ffffffff1660e01b8152600401611f0b96959493929190615c01565b600060405180830381600087803b158015611f2557600080fd5b505af1158015611f39573d6000803e3d6000fd5b50505050600081611f5c308d6001600160a01b03166139b990919063ffffffff16565b611f669190615bcd565b9050611f72838b615c5d565b811015611f925760405163b7ed78bf60e01b815260040160405180910390fd5b611fa48b6001600160a01b0316613c60565b15611fe157611fdc6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001682613c82565b612015565b6120156001600160a01b038c167f000000000000000000000000000000000000000000000000000000000000000083613d9b565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116908c16036120be5761015f54604051637c8f622d60e01b81526001600160a01b038d811660048301526024820186905260006044830152909116908190637c8f622d90606401600060405180830381600087803b1580156120a057600080fd5b505af11580156120b4573d6000803e3d6000fd5b5050505050612131565b60006120c98c61397d565b604051631510748b60e01b81526001600160a01b038e811660048301526024820187905291925090821690631510748b90604401600060405180830381600087803b15801561211757600080fd5b505af115801561212b573d6000803e3d6000fd5b50505050505b604080518b81526020810185905233916001600160a01b038e16917f0da3485ef1bb570df7bb888887eae5aa01d81b83cd8ccc80c0ea0922a677ecef910160405180910390a35050600160fb55505050505050505050565b600061219361379c565b8361219d81612792565b836121a781612792565b836121b181612d05565b61012d5460ff16156121d55760405162461bcd60e51b815260040161092590615983565b600260fb54036121f75760405162461bcd60e51b8152600401610925906159ad565b600260fb55611392878787336137c2565b8261221281612792565b8261221c81612792565b8261222681612792565b600054610100900460ff166122415760005460ff1615612245565b303b155b6122a85760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610925565b600054610100900460ff161580156122ca576000805461ffff19166101011790555b6122d5878787613e06565b80156122e7576000805461ff00191690555b50505050505050565b600260fb54036123125760405162461bcd60e51b8152600401610925906159ad565b600260fb55612323610162826133c9565b6123405760405163b0ce759160e01b815260040160405180910390fd5b8160005b8181101561248e57600085858381811061236057612360615ad6565b9050602002016020810190612375919061556b565b6101615460405163772b7e9760e01b81526001600160a01b038084166004830152878116602483015292935091169063772b7e9790604401600060405180830381600087803b1580156123c757600080fd5b505af11580156123db573d6000803e3d6000fd5b5050506001600160a01b038083166000818152610167602052604080822080548a86166001600160a01b031982161790915590519316935083927f987eb3c2f78454541205f72f34839b434c306c9eaf4922efd7c0c3060fdb2e4c9190a3846001600160a01b0316826001600160a01b03167f95f865c2808f8b2a85eea2611db7843150ee7835ef1403f9755918a97d76933c60405160405180910390a35050808061248690615b02565b915050612344565b5050600160fb55505050565b60008181526097602052604081206108cf906133b3565b60006124c061012d5460ff1690565b156124dd5760405162461bcd60e51b815260040161092590615983565b336124e781613e50565b6124f8888888888888336001613703565b98975050505050505050565b600061251361012d5460ff1690565b156125305760405162461bcd60e51b815260040161092590615983565b600260fb54036125525760405162461bcd60e51b8152600401610925906159ad565b600260fb55611392878787878787336000613e79565b60008281526065602052604090206001015461258481336130ca565b610e328383613391565b6060600061259d6101656133b3565b905060008167ffffffffffffffff8111156125ba576125ba615a45565b6040519080825280602002602001820160405280156125e3578160200160208202803683370190505b50905060005b82811015610fd6576125fd610165826133bd565b82828151811061260f5761260f615ad6565b6001600160a01b03909216602092830291909101909101528061263181615b02565b9150506125e9565b600061264861012d5460ff1690565b156126655760405162461bcd60e51b815260040161092590615983565b3361266f81613e50565b6124f8888888888888336001613e79565b612698600080516020615eff833981519152336126d6565b6108f681613f05565b60006001600160e01b03198216637965db0b60e01b14806108cf57506301ffc9a760e01b6001600160e01b03198316146108cf565b6126e082826119e2565b610c6357604051634ca8886760e01b815260040160405180910390fd5b61012d5460ff166127475760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610925565b61012d805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6001600160a01b0381166108f65760405163e6c4247b60e01b815260040160405180910390fd5b60006119db836001600160a01b038416613f70565b818115612a825761015f54604051632f2ff15d60e01b81527f4cbb5676e6e25e1a3b8a36de10472bcac96f97bd8dd87af6f330881b84739eb860048201526001600160a01b03838116602483015290911690632f2ff15d90604401600060405180830381600087803b15801561284357600080fd5b505af1158015612857573d6000803e3d6000fd5b505061015f54604051632f2ff15d60e01b81527f0d0d17bf5382c809d9a3899d6a94e57386dfb2036f0401b94ef3cf6c1a9ab73f60048201526001600160a01b0385811660248301529091169250632f2ff15d9150604401600060405180830381600087803b1580156128c957600080fd5b505af11580156128dd573d6000803e3d6000fd5b505061015f54604051632f2ff15d60e01b81527fca51b9188e78415f30da725e0d94567b4d65bc6777d4e5d573191e9f55b88a3260048201526001600160a01b0385811660248301529091169250632f2ff15d9150604401600060405180830381600087803b15801561294f57600080fd5b505af1158015612963573d6000803e3d6000fd5b5050604051632f2ff15d60e01b8152600080516020615edf83398151915260048201526001600160a01b0384811660248301527f0000000000000000000000000000000000000000000000000000000000000000169250632f2ff15d9150604401600060405180830381600087803b1580156129de57600080fd5b505af11580156129f2573d6000803e3d6000fd5b5050604051632f2ff15d60e01b8152600080516020615edf83398151915260048201526001600160a01b0384811660248301527f0000000000000000000000000000000000000000000000000000000000000000169250632f2ff15d91506044015b600060405180830381600087803b158015612a6e57600080fd5b505af11580156122e7573d6000803e3d6000fd5b61015f5460405163d547741f60e01b81527f4cbb5676e6e25e1a3b8a36de10472bcac96f97bd8dd87af6f330881b84739eb860048201526001600160a01b0383811660248301529091169063d547741f90604401600060405180830381600087803b158015612af057600080fd5b505af1158015612b04573d6000803e3d6000fd5b505061015f5460405163d547741f60e01b81527f0d0d17bf5382c809d9a3899d6a94e57386dfb2036f0401b94ef3cf6c1a9ab73f60048201526001600160a01b038581166024830152909116925063d547741f9150604401600060405180830381600087803b158015612b7657600080fd5b505af1158015612b8a573d6000803e3d6000fd5b505061015f5460405163d547741f60e01b81527fca51b9188e78415f30da725e0d94567b4d65bc6777d4e5d573191e9f55b88a3260048201526001600160a01b038581166024830152909116925063d547741f9150604401600060405180830381600087803b158015612bfc57600080fd5b505af1158015612c10573d6000803e3d6000fd5b505060405163d547741f60e01b8152600080516020615edf83398151915260048201526001600160a01b0384811660248301527f000000000000000000000000000000000000000000000000000000000000000016925063d547741f9150604401600060405180830381600087803b158015612c8b57600080fd5b505af1158015612c9f573d6000803e3d6000fd5b505060405163d547741f60e01b8152600080516020615edf83398151915260048201526001600160a01b0384811660248301527f000000000000000000000000000000000000000000000000000000000000000016925063d547741f9150604401612a54565b806000036108f657604051637c946ed760e01b815260040160405180910390fd5b61016a54818103612d35575050565b61016a82905560408051828152602081018490527f7cf7d95d939472232a091a8af32b247f54067369068b83e2add6f34dafac377591015b60405180910390a15050565b61015f5481516101605460208401516040516323b872dd60e01b81526000946001600160a01b03908116948116936323b872dd93612dc093919092169186916004016159e4565b6020604051808303816000875af1158015612ddf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e039190615b41565b5060208301516040516323b872dd60e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016916323b872dd91612e589188918691906004016159e4565b6020604051808303816000875af1158015612e77573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e9b9190615b41565b50602083015160408085015190516372026c6760e11b8152600481018890526001600160a01b038781166024830152604482019390935260648101919091529082169063e404d8ce906084016020604051808303816000875af1158015612f06573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f2a9190615a08565b95945050505050565b60008082600001516001600160a01b031663f4325d676040518163ffffffff1660e01b8152600401602060405180830381865afa158015612f78573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f9c9190615c75565b90506000612fa98261397d565b84516101605460208701516040516323b872dd60e01b81529394506001600160a01b03928316936323b872dd93612fe693169186916004016159e4565b6020604051808303816000875af1158015613005573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130299190615b41565b50602084015160408086015190516356aca36f60e01b8152600481018990526001600160a01b038881166024830152858116604483015260648201939093526084810191909152908216906356aca36f9060a4016020604051808303816000875af115801561309c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130c09190615a08565b9695505050505050565b6130d482826119e2565b610c63576130ec816001600160a01b03166014614063565b6130f7836020614063565b604051602001613108929190615cbe565b60408051601f198184030181529082905262461bcd60e51b825261092591600401615d33565b61313882826141ff565b6000828152609760205260409020610e329082613c4b565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b031614613298576000836001600160a01b031663f4325d676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156131cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131ef9190615c75565b9050836001600160a01b03166132048261397d565b604051635768adcf60e01b81526001600160a01b0384811660048301529190911690635768adcf90602401602060405180830381865afa15801561324c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132709190615c75565b6001600160a01b0316146132965760405162820f3560e61b815260040160405180910390fd5b505b610160546040516323b872dd60e01b81526001600160a01b03808616926323b872dd926132cd928992169087906004016159e4565b6020604051808303816000875af11580156132ec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133109190615b41565b50610160546040516313e7e7d160e11b81526001600160a01b03909116906327cfcfa290613346908790879087906004016159e4565b6020604051808303816000875af1158015613365573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133899190615a08565b949350505050565b61339b8282614285565b6000828152609760205260409020610e3290826127b9565b60006108cf825490565b60006119db83836142ec565b6001600160a01b038116600090815260018301602052604081205415156119db565b6000341561340c576040516342f7487960e11b815260040160405180910390fd5b61015f546040516323b872dd60e01b81526001600160a01b03918216917f000000000000000000000000000000000000000000000000000000000000000016906323b872dd9061346490889085908b906004016159e4565b6020604051808303816000875af1158015613483573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906134a79190615b41565b5060405163e06bf20d60e01b8152600481018990526001600160a01b0388811660248301526044820188905285151560648301526084820185905282169063e06bf20d9060a4015b6020604051808303816000875af115801561350e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124f89190615a08565b600061353f858484614316565b600061354a8661397d565b604051639f5c734b60e01b8152600481018a90526001600160a01b03898116602483015288811660448301526064820188905291925090821690639f5c734b906084016134ef565b61359b82612792565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116908316036135e75760405163c1ab6dc160e01b815260040160405180910390fd5b6135f361016583613c4b565b6136105760405163119b4fd360e11b815260040160405180910390fd5b604051634824fce960e11b81526001600160a01b038381166004830152821690639049f9d290602401600060405180830381600087803b15801561365357600080fd5b505af1158015613667573d6000803e3d6000fd5b505050506001600160a01b038281166000818152610167602052604080822080546001600160a01b0319169486169485179055517f4f2ce4e40f623ca765fc0167a25cb7842ceaafb8d82d3dec26ca0d0e0d2d48969190a3806001600160a01b0316826001600160a01b03167f95f865c2808f8b2a85eea2611db7843150ee7835ef1403f9755918a97d76933c60405160405180910390a35050565b600061371289898989896143fa565b61378f60405180604001604052808b6001600160a01b031681526020018a6001600160a01b031681525060405180608001604052808a81526020018981526020016000151581526020018515158152506040518060400160405280876001600160a01b03168152602001886001600160a01b03168152508861447e565b9998505050505050505050565b6101695460ff166137c0576040516303a5be3f60e31b815260040160405180910390fd5b565b604080516001600160601b0319606084811b82166020808501919091526001600160e01b03194260e01b16603485015288821b8316603885015287821b909216604c84015280830186905283518084039091018152608090920190925280519101206000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03908116908616036138725761386a818786866000806133eb565b915050613389565b6130c0818787878789613532565b620f424063ffffffff821611156108f6576040516358d620b360e01b815260040160405180910390fd5b6101695463ffffffff610100909104811690821681036138c8575050565b610169805464ffffffff00191661010063ffffffff8581169182029290921790925560408051918416825260208201929092527fa159b13d7eac36d9a65034b4fd6ace1d9cb070d063dc950c564a266f4d0918029101612d6d565b61012d5460ff16156139475760405162461bcd60e51b815260040161092590615983565b61012d805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586127753390565b6001600160a01b0380821660009081526101676020526040812054909116806108cf5760405163c1ab6dc160e01b815260040160405180910390fd5b60006139c483613c60565b156139da57506001600160a01b038116316108cf565b826040516370a0823160e01b81526001600160a01b03848116600483015291909116906370a0823190602401602060405180830381865afa158015613a23573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119db9190615a08565b600080613a548585614882565b8051909150600003613a7857828160200151613a709190615d7c565b9150506119db565b80518311613a9957604051631a93c68960e11b815260040160405180910390fd5b6000613aa6868686614909565b90506000613ab48383614924565b8051909150600003613ada57848160200151613ad09190615d7c565b93505050506119db565b6000858103861690613aec83836149a9565b90506000613b02613afd848a615d7c565b6149e0565b919091029998505050505050505050565b600080613b216101626133b3565b905060005b81811015613c40576000613b3c610162836133bd565b90508561ffff16816001600160a01b031663b1dd61b66040518163ffffffff1660e01b8152600401602060405180830381865afa158015613b81573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ba59190615a21565b61ffff16148015613c1e57508461ffff16816001600160a01b03166354fd4d506040518163ffffffff1660e01b8152600401602060405180830381865afa158015613bf4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613c189190615a21565b61ffff16145b15613c2d5792506108cf915050565b5080613c3881615b02565b915050613b26565b506000949350505050565b60006119db836001600160a01b038416614a0b565b6001600160a01b031673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1490565b80471015613cd25760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610925565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114613d1f576040519150601f19603f3d011682016040523d82523d6000602084013e613d24565b606091505b5050905080610e325760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610925565b80600003613da857505050565b613db183613c60565b15613df2576040516001600160a01b0383169082156108fc029083906000818181858888f19350505050158015613dec573d6000803e3d6000fd5b50505050565b610e326001600160a01b0384168383614a5a565b600054610100900460ff16613e2d5760405162461bcd60e51b815260040161092590615d9e565b613e35614abd565b613e3d614af4565b613e45614b23565b610e32838383614b52565b613e5c61016b826133c9565b6108f657604051634ca8886760e01b815260040160405180910390fd5b6000613e8889898989896143fa565b61378f60405180604001604052808b6001600160a01b031681526020018a6001600160a01b031681525060405180608001604052808a81526020018981526020016001151581526020018515158152506040518060400160405280876001600160a01b03168152602001886001600160a01b03168152508861447e565b80613f0f81614c43565b613f1b61016b83613c4b565b613f385760405163119b4fd360e11b815260040160405180910390fd5b6040516001600160a01b038316907f534d18c8ff24ba5980906d732f3075704749427353734fbbf05d50485643b12490600090a25050565b60008181526001830160205260408120548015614059576000613f94600183615bcd565b8554909150600090613fa890600190615bcd565b905081811461400d576000866000018281548110613fc857613fc8615ad6565b9060005260206000200154905080876000018481548110613feb57613feb615ad6565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061401e5761401e615de9565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506108cf565b60009150506108cf565b60606000614072836002615dff565b61407d906002615c5d565b67ffffffffffffffff81111561409557614095615a45565b6040519080825280601f01601f1916602001820160405280156140bf576020820181803683370190505b509050600360fc1b816000815181106140da576140da615ad6565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061410957614109615ad6565b60200101906001600160f81b031916908160001a905350600061412d846002615dff565b614138906001615c5d565b90505b60018111156141b0576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061416c5761416c615ad6565b1a60f81b82828151811061418257614182615ad6565b60200101906001600160f81b031916908160001a90535060049490941c936141a981615e1e565b905061413b565b5083156119db5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610925565b61420982826119e2565b610c635760008281526065602090815260408083206001600160a01b03851684529091529020805460ff191660011790556142413390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b61428f82826119e2565b15610c635760008281526065602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600082600001828154811061430357614303615ad6565b9060005260206000200154905092915050565b614328836001600160a01b0316613c60565b156143a6578034101561434e576040516342f7487960e11b815260040160405180910390fd5b6143816001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001682613c82565b80341115610e3257610e326143968234615bcd565b6001600160a01b03841690613c82565b34156143c5576040516342f7487960e11b815260040160405180910390fd5b610e326001600160a01b038416837f000000000000000000000000000000000000000000000000000000000000000084614c7f565b61440385612792565b61440c84612792565b836001600160a01b0316856001600160a01b03160361443e5760405163c1ab6dc160e01b815260040160405180910390fd5b61444783612d05565b61445082612d05565b4263ffffffff1681101561447757604051631ab7da6b60e01b815260040160405180910390fd5b5050505050565b60208201516000906001600160a01b03166144a45782516001600160a01b031660208401525b825185516020808801518751888301516040808b0151858b015182516001600160601b031960609a8b1b8116828a01526001600160e01b03194260e01b166034830152988a1b8916603882015295891b8816604c87015288860194909452608080860193909352151560f81b60a085015260a1840189905291861b90941660c1830152805160b581840301815260d5830180835281519185019190912061015584018352600080835260f5850181905261011585018190526101359094018490528251958601835283865293850183905290840182905293830152919087516000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691160361464e576145ca848a6020015160018b614ca9565b91508192508160600151905088602001516001600160a01b031689600001516001600160a01b0316857f5c02c2bb2d1d082317eb23916ca27b3e7c294398b60061a2ad54f1c3c018c318856000015186602001518760000151886040015160008f6000015160405161464196959493929190615e35565b60405180910390a46147ad565b60208901516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811691160361471057614696848a6000015160008b614ca9565b91508192508160600151905088602001516001600160a01b031689600001516001600160a01b0316857f5c02c2bb2d1d082317eb23916ca27b3e7c294398b60061a2ad54f1c3c018c318856000015186602001518760200151886040015189604001518f6000015160405161464196959493929190615e35565b61471b848a8a614fcb565b6060808201519083015192955090935061473491615c5d565b905088602001516001600160a01b031689600001516001600160a01b0316857f5c02c2bb2d1d082317eb23916ca27b3e7c294398b60061a2ad54f1c3c018c31886600001518660200151886020015188604001518a604001518f600001516040516147a496959493929190615e35565b60405180910390a45b8851875184516147be929190614316565b6020808a01518882015191840151604051631c20fadd60e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001693631c20fadd936148189390926004016159e4565b600060405180830381600087803b15801561483257600080fd5b505af1158015614846573d6000803e3d6000fd5b5050505080610168600082825461485d9190615c5d565b9091555050604088015161487257825161378f565b5060200151979650505050505050565b604080518082019091526000808252602082015260006148a2848461516e565b90508383028082106148d757604051806040016040528082846148c59190615bcd565b815260200182815250925050506108cf565b604051806040016040528060016148ee8585900390565b6148f89190615bcd565b815260200191909152949350505050565b6000818061491957614919615d66565b838509949350505050565b604080518082019091526000808252602082015281836020015110614971576040518060400160405280846000015181526020018385602001516149689190615bcd565b905290506108cf565b60405180604001604052806001856000015161498d9190615bcd565b81526020016149a0856020015185900390565b90529392505050565b6000806149c16149bb84808403615d7c565b60010190565b90508284602001516149d39190615d7c565b8451820217949350505050565b60006001815b6008811015610fd6578382026002038202915080614a0381615b02565b9150506149e6565b6000818152600183016020526040812054614a52575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556108cf565b5060006108cf565b6040516001600160a01b038316602482015260448101829052610e3290849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261517d565b600054610100900460ff16614ae45760405162461bcd60e51b815260040161092590615d9e565b614aec61524f565b6137c0615276565b600054610100900460ff16614b1b5760405162461bcd60e51b815260040161092590615d9e565b6137c06152db565b600054610100900460ff16614b4a5760405162461bcd60e51b815260040161092590615d9e565b6137c0615309565b600054610100900460ff16614b795760405162461bcd60e51b815260040161092590615d9e565b61015f80546001600160a01b038086166001600160a01b0319928316179092556101608054858416908316179055610161805492841692909116919091179055614bf17fdf8c9529ea4b244b569bac557a549516f317e7b5cf82dc5e0d8b6d874930a3f5600080516020615eff83398151915261533d565b614c17600080516020615ebf833981519152600080516020615eff83398151915261533d565b610169805460ff19166001179055614c306107d06138aa565b610e3269d3c21bcecceda1000000612d26565b6001600160a01b0381161580614c6157506001600160a01b03811630145b156108f657604051638e052b6760e01b815260040160405180910390fd5b801580614c905750614c9084613c60565b613dec57613dec6001600160a01b038516848484615388565b614cd46040518060800160405280600081526020016000815260200160008152602001600081525090565b600083614d27576040518060400160405280866001600160a01b031681526020017f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316815250614d6f565b60405180604001604052807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602001866001600160a01b03168152505b905060008360400151614e2d57614d858661397d565b825160208085015187519188015160608901516040516337cb0ead60e21b8152600481018e90526001600160a01b03958616602482015292851660448401526064830193909352608482015290151560a482015291169063df2c3ab49060c4016060604051808303816000875af1158015614e04573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614e289190615e66565b614ed9565b614e368661397d565b8251602080850151875191880151606089015160405163d1aebfc760e01b8152600481018e90526001600160a01b03958616602482015292851660448401526064830193909352608482015290151560a482015291169063d1aebfc79060c4016060604051808303816000875af1158015614eb5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614ed99190615e66565b905084614f725761015f54604082015160208301516001600160a01b0390921691637c8f622d918991614f0c9190615bcd565b6040516001600160e01b031960e085901b1681526001600160a01b039092166004830152602482015260016044820152606401600060405180830381600087803b158015614f5957600080fd5b505af1158015614f6d573d6000803e3d6000fd5b505050505b60405180608001604052808560400151614f8d578251614f90565b85515b81526020018560400151614fa5578551614fa8565b82515b815260200182602001518152602001826040015181525092505050949350505050565b614ff66040518060800160405280600081526020016000815260200160008152602001600081525090565b6150216040518060800160405280600081526020016000815260200160008152602001600081525090565b8260400151156150cb57600083600001519050600084602001519050600061507a88886000015160006040518060800160405280888152602001600181526020016001151581526020018b606001511515815250614ca9565b905060006150bc89896020015160016040518060800160405280876020015181526020018881526020016001151581526020018c606001511515815250614ca9565b91955090935061516692505050565b600083600001519050600084602001519050600061511b8888602001516001604051806080016040528088815260200160001981526020016000151581526020018b606001511515815250614ca9565b9050600061515d89896000015160006040518060800160405280876000015181526020018881526020016000151581526020018c606001511515815250614ca9565b95509093505050505b935093915050565b60006000198284099392505050565b60006151d2826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166153a99092919063ffffffff16565b805190915015610e3257808060200190518101906151f09190615b41565b610e325760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610925565b600054610100900460ff166137c05760405162461bcd60e51b815260040161092590615d9e565b600054610100900460ff1661529d5760405162461bcd60e51b815260040161092590615d9e565b60c9805461ffff191660011790556152c3600080516020615eff8339815191528061533d565b6137c0600080516020615eff833981519152336153b8565b600054610100900460ff166153025760405162461bcd60e51b815260040161092590615d9e565b600160fb55565b600054610100900460ff166153305760405162461bcd60e51b815260040161092590615d9e565b61012d805460ff19169055565b600082815260656020526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b613dec846323b872dd60e01b858585604051602401614a86939291906159e4565b606061338984846000856153c2565b610c63828261312e565b6060824710156154235760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610925565b6001600160a01b0385163b61547a5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610925565b600080866001600160a01b031685876040516154969190615ea2565b60006040518083038185875af1925050503d80600081146154d3576040519150601f19603f3d011682016040523d82523d6000602084013e6154d8565b606091505b50915091506154e88282866154f3565b979650505050505050565b606083156155025750816119db565b8251156155125782518084602001fd5b8160405162461bcd60e51b81526004016109259190615d33565b60006020828403121561553e57600080fd5b81356001600160e01b0319811681146119db57600080fd5b6001600160a01b03811681146108f657600080fd5b60006020828403121561557d57600080fd5b81356119db81615556565b60006020828403121561559a57600080fd5b5035919050565b80151581146108f657600080fd5b6000602082840312156155c157600080fd5b81356119db816155a1565b600080604083850312156155df57600080fd5b8235915060208301356155f181615556565b809150509250929050565b6000806040838503121561560f57600080fd5b823561561a81615556565b946020939093013593505050565b6020808252825182820181905260009190848201906040850190845b818110156156695783516001600160a01b031683529284019291840191600101615644565b50909695505050505050565b600080600080600060a0868803121561568d57600080fd5b853561569881615556565b945060208601356156a881615556565b94979496505050506040830135926060810135926080909101359150565b6000806000604084860312156156db57600080fd5b833567ffffffffffffffff808211156156f357600080fd5b818601915086601f83011261570757600080fd5b81358181111561571657600080fd5b8760208260051b850101111561572b57600080fd5b6020928301955093505084013561574181615556565b809150509250925092565b60008060008060008060c0878903121561576557600080fd5b863561577081615556565b9550602087013561578081615556565b945060408701359350606087013592506080870135915060a08701356157a581615556565b809150509295509295509295565b63ffffffff811681146108f657600080fd5b6000602082840312156157d757600080fd5b81356119db816157b3565b60008083601f8401126157f457600080fd5b50813567ffffffffffffffff81111561580c57600080fd5b60208301915083602082850101111561582457600080fd5b9250929050565b6000806020838503121561583e57600080fd5b823567ffffffffffffffff81111561585557600080fd5b615861858286016157e2565b90969095509350505050565b6000806040838503121561588057600080fd5b50508035926020909101359150565b6000806000806000608086880312156158a757600080fd5b85356158b281615556565b94506020860135935060408601356158c981615556565b9250606086013567ffffffffffffffff8111156158e557600080fd5b6158f1888289016157e2565b969995985093965092949392505050565b60008060006060848603121561591757600080fd5b833561592281615556565b9250602084013561593281615556565b929592945050506040919091013590565b60008060006060848603121561595857600080fd5b833561596381615556565b9250602084013561597381615556565b9150604084013561574181615556565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b600060208284031215615a1a57600080fd5b5051919050565b600060208284031215615a3357600080fd5b815161ffff811681146119db57600080fd5b634e487b7160e01b600052604160045260246000fd5b6040516060810167ffffffffffffffff81118282101715615a8c57634e487b7160e01b600052604160045260246000fd5b60405290565b600060608284031215615aa457600080fd5b615aac615a5b565b8251615ab781615556565b8152602083810151908201526040928301519281019290925250919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201615b1457615b14615aec565b5060010190565b600061ffff808316818516808303821115615b3857615b38615aec565b01949350505050565b600060208284031215615b5357600080fd5b81516119db816155a1565b80516fffffffffffffffffffffffffffffffff81168114615b7e57600080fd5b919050565b600060608284031215615b9557600080fd5b615b9d615a5b565b615ba683615b5e565b8152615bb460208401615b5e565b6020820152604083015160408201528091505092915050565b600082821015615bdf57615bdf615aec565b500390565b600060208284031215615bf657600080fd5b81516119db816157b3565b6001600160a01b03878116825286166020820152604081018590526060810184905260a06080820181905281018290526000828460c0840137600060c0848401015260c0601f19601f8501168301019050979650505050505050565b60008219821115615c7057615c70615aec565b500190565b600060208284031215615c8757600080fd5b81516119db81615556565b60005b83811015615cad578181015183820152602001615c95565b83811115613dec5750506000910152565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351615cf6816017850160208801615c92565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351615d27816028840160208801615c92565b01602801949350505050565b6020815260008251806020840152615d52816040850160208701615c92565b601f01601f19169190910160400192915050565b634e487b7160e01b600052601260045260246000fd5b600082615d9957634e487b7160e01b600052601260045260246000fd5b500490565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b634e487b7160e01b600052603160045260246000fd5b6000816000190483118215151615615e1957615e19615aec565b500290565b600081615e2d57615e2d615aec565b506000190190565b95865260208601949094526040850192909252606084015260808301526001600160a01b031660a082015260c00190565b600060608284031215615e7857600080fd5b615e80615a5b565b8251815260208301516020820152604083015160408201528091505092915050565b60008251615eb4818460208701615c92565b919091019291505056fef28f409b8cbe6b50c7ca45afe893f01f69626f8a4e33cb480bc1bc2d618c084589ce14d20697a788f57260f7690044299bde7ea88cfb7e43d120a0c031f1ffc12172861495e7b85edac73e3cd5fbb42dd675baadf627720e687bcfdaca025096a164736f6c634300080d000a", + "deployedBytecode": "0x6080604052600436106102b25760003560e01c806371f43f9a11610175578063a8bf9046116100dc578063d0d1458111610095578063d6efd7c31161006f578063d6efd7c31461082f578063d895feee14610844578063e43252d714610857578063e6aac07e1461087757600080fd5b8063d0d14581146107e9578063d3a4acd3146107fc578063d547741f1461080f57600080fd5b8063a8bf904614610736578063adf51de114610756578063b3db428b14610776578063c0c53b8b14610789578063c109ba13146107a9578063ca15c873146107c957600080fd5b80638ffcca071161012e5780638ffcca071461064e5780639010d07c1461066e57806391d14854146106a657806393867fb5146106c65780639bca0e70146106e7578063a217fddf1461072157600080fd5b806371f43f9a146105b55780637576b2d6146105ce5780637bf6a425146105e35780638456cb59146105f95780638ab1d6811461060e5780638cd2403d1461062e57600080fd5b80633982b5311161021957806342659964116101d2578063426599641461051a57806345d6602c1461053a57806347e7ef241461054d578063533007721461056057806354fd4d50146105805780635c975abb1461059c57600080fd5b80633982b5311461046e57806339fadf98146104845780633af32abf146104a65780633d1c24e7146104c65780633efcfda4146104d957806341f435b3146104f957600080fd5b806326e6b6971161026b57806326e6b697146103ae5780632d944b80146103ce5780632e1a7d4d146103ee5780632f2ff15d1461040e578063357a03331461042e57806336568abe1461044e57600080fd5b806301ffc9a7146102be578063046f7da2146102f3578063079767de1461030a5780631329db291461032d578063230df83a1461035e578063248a9ca31461037e57600080fd5b366102b957005b600080fd5b3480156102ca57600080fd5b506102de6102d936600461552c565b6108aa565b60405190151581526020015b60405180910390f35b3480156102ff57600080fd5b506103086108d5565b005b34801561031657600080fd5b5061031f6108f9565b6040519081526020016102ea565b34801561033957600080fd5b5061016954610100900463ffffffff1660405163ffffffff90911681526020016102ea565b34801561036a57600080fd5b5061030861037936600461556b565b610a56565b34801561038a57600080fd5b5061031f610399366004615588565b60009081526065602052604090206001015490565b3480156103ba57600080fd5b506103086103c93660046155af565b610bfb565b3480156103da57600080fd5b506103086103e9366004615588565b610c38565b3480156103fa57600080fd5b5061031f610409366004615588565b610c67565b34801561041a57600080fd5b506103086104293660046155cc565b610e0c565b34801561043a57600080fd5b5061031f6104493660046155fc565b610e37565b34801561045a57600080fd5b506103086104693660046155cc565b610eb1565b34801561047a57600080fd5b5061016a5461031f565b34801561049057600080fd5b50610499610f2b565b6040516102ea9190615628565b3480156104b257600080fd5b506102de6104c136600461556b565b610fdd565b6103086104d4366004615675565b610feb565b3480156104e557600080fd5b5061031f6104f4366004615588565b61118d565b34801561050557600080fd5b50600080516020615ebf83398151915261031f565b34801561052657600080fd5b506103086105353660046156c6565b611261565b61031f61054836600461574c565b61132e565b61031f61055b3660046155fc565b6113a2565b34801561056c57600080fd5b5061030861057b3660046157c5565b611417565b34801561058c57600080fd5b50604051600b81526020016102ea565b3480156105a857600080fd5b5061012d5460ff166102de565b3480156105c157600080fd5b506101695460ff166102de565b3480156105da57600080fd5b50610499611442565b3480156105ef57600080fd5b506101685461031f565b34801561060557600080fd5b506103086114eb565b34801561061a57600080fd5b5061030861062936600461556b565b61150c565b34801561063a57600080fd5b5061030861064936600461582b565b611584565b34801561065a57600080fd5b5061031f61066936600461556b565b6115d5565b34801561067a57600080fd5b5061068e61068936600461586d565b6119c3565b6040516001600160a01b0390911681526020016102ea565b3480156106b257600080fd5b506102de6106c13660046155cc565b6119e2565b3480156106d257600080fd5b50600080516020615eff83398151915261031f565b3480156106f357600080fd5b5061068e61070236600461556b565b6001600160a01b03908116600090815261016760205260409020541690565b34801561072d57600080fd5b5061031f600081565b34801561074257600080fd5b5061030861075136600461556b565b611a0d565b34801561076257600080fd5b5061030861077136600461588f565b611c24565b61031f610784366004615902565b612189565b34801561079557600080fd5b506103086107a4366004615943565b612208565b3480156107b557600080fd5b506103086107c43660046156c6565b6122f0565b3480156107d557600080fd5b5061031f6107e4366004615588565b61249a565b61031f6107f736600461574c565b6124b1565b61031f61080a36600461574c565b612504565b34801561081b57600080fd5b5061030861082a3660046155cc565b612568565b34801561083b57600080fd5b5061049961258e565b61031f61085236600461574c565b612639565b34801561086357600080fd5b5061030861087236600461556b565b612680565b34801561088357600080fd5b507fdf8c9529ea4b244b569bac557a549516f317e7b5cf82dc5e0d8b6d874930a3f561031f565b60006001600160e01b03198216635a05180f60e01b14806108cf57506108cf826126a1565b92915050565b600080516020615ebf8339815191526108ee81336126d6565b6108f66126fd565b50565b600061090861012d5460ff1690565b1561092e5760405162461bcd60e51b815260040161092590615983565b60405180910390fd5b600260fb54036109505760405162461bcd60e51b8152600401610925906159ad565b600260fb556101685461016a5481101561096e576000915050610a4e565b600061016855604051631c20fadd60e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690631c20fadd906109e4907f000000000000000000000000000000000000000000000000000000000000000090819086906004016159e4565b600060405180830381600087803b1580156109fe57600080fd5b505af1158015610a12573d6000803e3d6000fd5b50506040518381523392507f032863b8ce7ba939f971bf78a7ee035ae1044bef5dadf789c7cd09d26c0c40f4915060200160405180910390a290505b600160fb5590565b80610a6081612792565b610a78600080516020615eff833981519152336126d6565b600260fb5403610a9a5760405162461bcd60e51b8152600401610925906159ad565b600260fb81905550816001600160a01b031663f525cb686040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ae0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b049190615a08565b15610b22576040516332e7879360e01b815260040160405180910390fd5b610b2e610162836127b9565b610b4b5760405163b0ce759160e01b815260040160405180910390fd5b610b568260006127ce565b816001600160a01b0316826001600160a01b031663b1dd61b66040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b9e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bc29190615a21565b61ffff167fa0c1e3924f995e5ba38f53b4effb6d4b3eeb84176a2951c589115140f638ac0960405160405180910390a35050600160fb55565b610c13600080516020615eff833981519152336126d6565b6101695460ff161515811515146108f657610169805482151560ff1990911617905550565b610c50600080516020615eff833981519152336126d6565b80610c5a81612d05565b610c6382612d26565b5050565b6000610c7661012d5460ff1690565b15610c935760405162461bcd60e51b815260040161092590615983565b600260fb5403610cb55760405162461bcd60e51b8152600401610925906159ad565b600260fb55336000610d1884836000814260405160609290921b6001600160601b031916602083015260e01b6001600160e01b03191660348201526038810184905260580160405160208183030381529060405280519060200120905092915050565b6101605460405163158591ab60e11b8152600481018390526001600160a01b0385811660248301526044820188905292935060009290911690632b0b2356906064016060604051808303816000875af1158015610d79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d9d9190615a92565b90507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031681600001516001600160a01b031603610df157610de7828483612d79565b9350505050610e02565b610dfc828483612f33565b93505050505b600160fb55919050565b600082815260656020526040902060010154610e2881336130ca565b610e32838361312e565b505050565b600082610e4381612792565b82610e4d81612d05565b61012d5460ff1615610e715760405162461bcd60e51b815260040161092590615983565b600260fb5403610e935760405162461bcd60e51b8152600401610925906159ad565b600260fb55610ea3338686613150565b600160fb5595945050505050565b6001600160a01b0381163314610f215760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610925565b610c638282613391565b60606000610f3a6101626133b3565b905060008167ffffffffffffffff811115610f5757610f57615a45565b604051908082528060200260200182016040528015610f80578160200160208202803683370190505b50905060005b82811015610fd657610f9a610162826133bd565b828281518110610fac57610fac615ad6565b6001600160a01b039092166020928302919091019091015280610fce81615b02565b915050610f86565b5092915050565b60006108cf61016b836133c9565b61012d5460ff161561100f5760405162461bcd60e51b815260040161092590615983565b7fdf8c9529ea4b244b569bac557a549516f317e7b5cf82dc5e0d8b6d874930a3f561103a81336126d6565b600260fb540361105c5760405162461bcd60e51b8152600401610925906159ad565b600260fb55604080516001600160601b031933606090811b82166020808501919091526001600160e01b03194260e01b1660348501528a821b8316603885015289821b909216604c84015282018790526080820186905260a08083018690528351808403909101815260c090920190925280519101206001600160a01b038088167f0000000000000000000000000000000000000000000000000000000000000000919091160361111c57611116818787336001886133eb565b5061112c565b61112a818789883389613532565b505b60408051868152602081018690529081018490526001600160a01b03808816919089169083907f102bce4e43a6a8cf0306fde6154221c1f5460f64ba63b92b156bce998ef0db569060600160405180910390a45050600160fb555050505050565b600061119c61012d5460ff1690565b156111b95760405162461bcd60e51b815260040161092590615983565b600260fb54036111db5760405162461bcd60e51b8152600401610925906159ad565b600260fb5561016054604051635f23b6c560e11b8152336004820152602481018490526001600160a01b039091169063be476d8a906044016020604051808303816000875af1158015611232573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112569190615a08565b600160fb5592915050565b8061126b81612792565b611283600080516020615eff833981519152336126d6565b600260fb54036112a55760405162461bcd60e51b8152600401610925906159ad565b600260fb556112b6610162836133c9565b6112d35760405163b0ce759160e01b815260040160405180910390fd5b8260005b818110156113215761130f8686838181106112f4576112f4615ad6565b9050602002016020810190611309919061556b565b85613592565b8061131981615b02565b9150506112d7565b5050600160fb5550505050565b600061133d61012d5460ff1690565b1561135a5760405162461bcd60e51b815260040161092590615983565b600260fb540361137c5760405162461bcd60e51b8152600401610925906159ad565b600260fb55611392878787878787336000613703565b600160fb55979650505050505050565b60006113ac61379c565b826113b681612792565b826113c081612d05565b61012d5460ff16156113e45760405162461bcd60e51b815260040161092590615983565b600260fb54036114065760405162461bcd60e51b8152600401610925906159ad565b600260fb55610ea3338686826137c2565b61142f600080516020615eff833981519152336126d6565b8061143981613880565b610c63826138aa565b6060600061145161016b6133b3565b905060008167ffffffffffffffff81111561146e5761146e615a45565b604051908082528060200260200182016040528015611497578160200160208202803683370190505b50905060005b82811015610fd6576114b161016b826133bd565b8282815181106114c3576114c3615ad6565b6001600160a01b03909216602092830291909101909101526114e481615b02565b905061149d565b600080516020615ebf83398151915261150481336126d6565b6108f6613923565b611524600080516020615eff833981519152336126d6565b61153061016b826127b9565b61154d5760405163b0ce759160e01b815260040160405180910390fd5b6040516001600160a01b038216907f535611fb62fa2a833988f283b779e417e996813e44046f521d76c17b5943b08c90600090a250565b60c9546000906115999061ffff166001615b1b565b905061ffff8116600b146115bf5760405162dc149f60e41b815260040160405180910390fd5b60c9805461ffff191661ffff8316179055505050565b60006115e461012d5460ff1690565b156116015760405162461bcd60e51b815260040161092590615983565b600260fb54036116235760405162461bcd60e51b8152600401610925906159ad565b600260fb5560405163ce53e72960e01b81526001600160a01b0383811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063ce53e72990602401602060405180830381865afa15801561168e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116b29190615b41565b6116cf576040516307d7f4eb60e21b815260040160405180910390fd5b60006116da8361397d565b905060006117116001600160a01b0385167f00000000000000000000000000000000000000000000000000000000000000006139b9565b60405163a135ef1760e01b81526001600160a01b03868116600483015291925060009184169063a135ef1790602401606060405180830381865afa15801561175d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117819190615b83565b60408101519091508281106117a9576040516341e43e3960e01b815260040160405180910390fd5b6040516387a7db0f60e01b81526001600160a01b0387811660048301528516906387a7db0f90602401600060405180830381600087803b1580156117ec57600080fd5b505af1158015611800573d6000803e3d6000fd5b50505050600081846118129190615bcd565b61016954909150600090611836908390610100900463ffffffff16620f4240613a47565b90506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016631c20fadd897f00000000000000000000000000000000000000000000000000000000000000006118938587615bcd565b6040518463ffffffff1660e01b81526004016118b1939291906159e4565b600060405180830381600087803b1580156118cb57600080fd5b505af11580156118df573d6000803e3d6000fd5b5050604051631c20fadd60e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169250631c20fadd9150611933908b90339086906004016159e4565b600060405180830381600087803b15801561194d57600080fd5b505af1158015611961573d6000803e3d6000fd5b5050506001600160a01b0389169050337f5ad7a2184454b6259cd118e4041a953dc9d6498302bbe528e4f967bed919712961199c8486615bcd565b60408051918252602082018690520160405180910390a350600160fb559695505050505050565b60008281526097602052604081206119db90836133bd565b9392505050565b60009182526065602090815260408084206001600160a01b0393909316845291905290205460ff1690565b80611a1781612792565b611a2f600080516020615eff833981519152336126d6565b600260fb5403611a515760405162461bcd60e51b8152600401610925906159ad565b600260fb819055506000826001600160a01b031663b1dd61b66040518163ffffffff1660e01b8152600401602060405180830381865afa158015611a99573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611abd9190615a21565b90506000836001600160a01b03166354fd4d506040518163ffffffff1660e01b8152600401602060405180830381865afa158015611aff573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b239190615a21565b90506000611b318383613b13565b90506001600160a01b038116151580611b535750611b5161016286613c4b565b155b15611b715760405163119b4fd360e11b815260040160405180910390fd5b611b7c8560016127ce565b846001600160a01b0316856001600160a01b031663b1dd61b66040518163ffffffff1660e01b8152600401602060405180830381865afa158015611bc4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611be89190615a21565b61ffff167f5ae87719d73cb0fabb219f0e4b6e0a614ed7506f8a08bdb20bebf313573151b760405160405180910390a35050600160fb55505050565b84611c2e81612792565b84611c3881612d05565b84611c4281612792565b61012d5460ff1615611c665760405162461bcd60e51b815260040161092590615983565b600260fb5403611c885760405162461bcd60e51b8152600401610925906159ad565b600260fb557f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811690891614158015611d51575060405163b5af090f60e01b81526001600160a01b0389811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063b5af090f90602401602060405180830381865afa158015611d2b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d4f9190615b41565b155b15611d6f57604051630b094f2760e31b815260040160405180910390fd5b6000611d7d61016b336133c9565b15611d8a57506000611e2c565b604051637c36afad60e01b81526001600160a01b038a81166004830152611e29918a917f00000000000000000000000000000000000000000000000000000000000000001690637c36afad90602401602060405180830381865afa158015611df6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e1a9190615be4565b63ffffffff16620f4240613a47565b90505b6000611e416001600160a01b038b16306139b9565b604051631c20fadd60e01b81529091506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690631c20fadd90611e94908d908c908e906004016159e4565b600060405180830381600087803b158015611eae57600080fd5b505af1158015611ec2573d6000803e3d6000fd5b50505050876001600160a01b03166323e30c8b33611ee68d6001600160a01b031690565b8c868c8c6040518763ffffffff1660e01b8152600401611f0b96959493929190615c01565b600060405180830381600087803b158015611f2557600080fd5b505af1158015611f39573d6000803e3d6000fd5b50505050600081611f5c308d6001600160a01b03166139b990919063ffffffff16565b611f669190615bcd565b9050611f72838b615c5d565b811015611f925760405163b7ed78bf60e01b815260040160405180910390fd5b611fa48b6001600160a01b0316613c60565b15611fe157611fdc6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001682613c82565b612015565b6120156001600160a01b038c167f000000000000000000000000000000000000000000000000000000000000000083613d9b565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116908c16036120be5761015f54604051637c8f622d60e01b81526001600160a01b038d811660048301526024820186905260006044830152909116908190637c8f622d90606401600060405180830381600087803b1580156120a057600080fd5b505af11580156120b4573d6000803e3d6000fd5b5050505050612131565b60006120c98c61397d565b604051631510748b60e01b81526001600160a01b038e811660048301526024820187905291925090821690631510748b90604401600060405180830381600087803b15801561211757600080fd5b505af115801561212b573d6000803e3d6000fd5b50505050505b604080518b81526020810185905233916001600160a01b038e16917f0da3485ef1bb570df7bb888887eae5aa01d81b83cd8ccc80c0ea0922a677ecef910160405180910390a35050600160fb55505050505050505050565b600061219361379c565b8361219d81612792565b836121a781612792565b836121b181612d05565b61012d5460ff16156121d55760405162461bcd60e51b815260040161092590615983565b600260fb54036121f75760405162461bcd60e51b8152600401610925906159ad565b600260fb55611392878787336137c2565b8261221281612792565b8261221c81612792565b8261222681612792565b600054610100900460ff166122415760005460ff1615612245565b303b155b6122a85760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610925565b600054610100900460ff161580156122ca576000805461ffff19166101011790555b6122d5878787613e06565b80156122e7576000805461ff00191690555b50505050505050565b600260fb54036123125760405162461bcd60e51b8152600401610925906159ad565b600260fb55612323610162826133c9565b6123405760405163b0ce759160e01b815260040160405180910390fd5b8160005b8181101561248e57600085858381811061236057612360615ad6565b9050602002016020810190612375919061556b565b6101615460405163772b7e9760e01b81526001600160a01b038084166004830152878116602483015292935091169063772b7e9790604401600060405180830381600087803b1580156123c757600080fd5b505af11580156123db573d6000803e3d6000fd5b5050506001600160a01b038083166000818152610167602052604080822080548a86166001600160a01b031982161790915590519316935083927f987eb3c2f78454541205f72f34839b434c306c9eaf4922efd7c0c3060fdb2e4c9190a3846001600160a01b0316826001600160a01b03167f95f865c2808f8b2a85eea2611db7843150ee7835ef1403f9755918a97d76933c60405160405180910390a35050808061248690615b02565b915050612344565b5050600160fb55505050565b60008181526097602052604081206108cf906133b3565b60006124c061012d5460ff1690565b156124dd5760405162461bcd60e51b815260040161092590615983565b336124e781613e50565b6124f8888888888888336001613703565b98975050505050505050565b600061251361012d5460ff1690565b156125305760405162461bcd60e51b815260040161092590615983565b600260fb54036125525760405162461bcd60e51b8152600401610925906159ad565b600260fb55611392878787878787336000613e79565b60008281526065602052604090206001015461258481336130ca565b610e328383613391565b6060600061259d6101656133b3565b905060008167ffffffffffffffff8111156125ba576125ba615a45565b6040519080825280602002602001820160405280156125e3578160200160208202803683370190505b50905060005b82811015610fd6576125fd610165826133bd565b82828151811061260f5761260f615ad6565b6001600160a01b03909216602092830291909101909101528061263181615b02565b9150506125e9565b600061264861012d5460ff1690565b156126655760405162461bcd60e51b815260040161092590615983565b3361266f81613e50565b6124f8888888888888336001613e79565b612698600080516020615eff833981519152336126d6565b6108f681613f05565b60006001600160e01b03198216637965db0b60e01b14806108cf57506301ffc9a760e01b6001600160e01b03198316146108cf565b6126e082826119e2565b610c6357604051634ca8886760e01b815260040160405180910390fd5b61012d5460ff166127475760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610925565b61012d805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6001600160a01b0381166108f65760405163e6c4247b60e01b815260040160405180910390fd5b60006119db836001600160a01b038416613f70565b818115612a825761015f54604051632f2ff15d60e01b81527f4cbb5676e6e25e1a3b8a36de10472bcac96f97bd8dd87af6f330881b84739eb860048201526001600160a01b03838116602483015290911690632f2ff15d90604401600060405180830381600087803b15801561284357600080fd5b505af1158015612857573d6000803e3d6000fd5b505061015f54604051632f2ff15d60e01b81527f0d0d17bf5382c809d9a3899d6a94e57386dfb2036f0401b94ef3cf6c1a9ab73f60048201526001600160a01b0385811660248301529091169250632f2ff15d9150604401600060405180830381600087803b1580156128c957600080fd5b505af11580156128dd573d6000803e3d6000fd5b505061015f54604051632f2ff15d60e01b81527fca51b9188e78415f30da725e0d94567b4d65bc6777d4e5d573191e9f55b88a3260048201526001600160a01b0385811660248301529091169250632f2ff15d9150604401600060405180830381600087803b15801561294f57600080fd5b505af1158015612963573d6000803e3d6000fd5b5050604051632f2ff15d60e01b8152600080516020615edf83398151915260048201526001600160a01b0384811660248301527f0000000000000000000000000000000000000000000000000000000000000000169250632f2ff15d9150604401600060405180830381600087803b1580156129de57600080fd5b505af11580156129f2573d6000803e3d6000fd5b5050604051632f2ff15d60e01b8152600080516020615edf83398151915260048201526001600160a01b0384811660248301527f0000000000000000000000000000000000000000000000000000000000000000169250632f2ff15d91506044015b600060405180830381600087803b158015612a6e57600080fd5b505af11580156122e7573d6000803e3d6000fd5b61015f5460405163d547741f60e01b81527f4cbb5676e6e25e1a3b8a36de10472bcac96f97bd8dd87af6f330881b84739eb860048201526001600160a01b0383811660248301529091169063d547741f90604401600060405180830381600087803b158015612af057600080fd5b505af1158015612b04573d6000803e3d6000fd5b505061015f5460405163d547741f60e01b81527f0d0d17bf5382c809d9a3899d6a94e57386dfb2036f0401b94ef3cf6c1a9ab73f60048201526001600160a01b038581166024830152909116925063d547741f9150604401600060405180830381600087803b158015612b7657600080fd5b505af1158015612b8a573d6000803e3d6000fd5b505061015f5460405163d547741f60e01b81527fca51b9188e78415f30da725e0d94567b4d65bc6777d4e5d573191e9f55b88a3260048201526001600160a01b038581166024830152909116925063d547741f9150604401600060405180830381600087803b158015612bfc57600080fd5b505af1158015612c10573d6000803e3d6000fd5b505060405163d547741f60e01b8152600080516020615edf83398151915260048201526001600160a01b0384811660248301527f000000000000000000000000000000000000000000000000000000000000000016925063d547741f9150604401600060405180830381600087803b158015612c8b57600080fd5b505af1158015612c9f573d6000803e3d6000fd5b505060405163d547741f60e01b8152600080516020615edf83398151915260048201526001600160a01b0384811660248301527f000000000000000000000000000000000000000000000000000000000000000016925063d547741f9150604401612a54565b806000036108f657604051637c946ed760e01b815260040160405180910390fd5b61016a54818103612d35575050565b61016a82905560408051828152602081018490527f7cf7d95d939472232a091a8af32b247f54067369068b83e2add6f34dafac377591015b60405180910390a15050565b61015f5481516101605460208401516040516323b872dd60e01b81526000946001600160a01b03908116948116936323b872dd93612dc093919092169186916004016159e4565b6020604051808303816000875af1158015612ddf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e039190615b41565b5060208301516040516323b872dd60e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016916323b872dd91612e589188918691906004016159e4565b6020604051808303816000875af1158015612e77573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e9b9190615b41565b50602083015160408085015190516372026c6760e11b8152600481018890526001600160a01b038781166024830152604482019390935260648101919091529082169063e404d8ce906084016020604051808303816000875af1158015612f06573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f2a9190615a08565b95945050505050565b60008082600001516001600160a01b031663f4325d676040518163ffffffff1660e01b8152600401602060405180830381865afa158015612f78573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f9c9190615c75565b90506000612fa98261397d565b84516101605460208701516040516323b872dd60e01b81529394506001600160a01b03928316936323b872dd93612fe693169186916004016159e4565b6020604051808303816000875af1158015613005573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130299190615b41565b50602084015160408086015190516356aca36f60e01b8152600481018990526001600160a01b038881166024830152858116604483015260648201939093526084810191909152908216906356aca36f9060a4016020604051808303816000875af115801561309c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130c09190615a08565b9695505050505050565b6130d482826119e2565b610c63576130ec816001600160a01b03166014614063565b6130f7836020614063565b604051602001613108929190615cbe565b60408051601f198184030181529082905262461bcd60e51b825261092591600401615d33565b61313882826141ff565b6000828152609760205260409020610e329082613c4b565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b031614613298576000836001600160a01b031663f4325d676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156131cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131ef9190615c75565b9050836001600160a01b03166132048261397d565b604051635768adcf60e01b81526001600160a01b0384811660048301529190911690635768adcf90602401602060405180830381865afa15801561324c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132709190615c75565b6001600160a01b0316146132965760405162820f3560e61b815260040160405180910390fd5b505b610160546040516323b872dd60e01b81526001600160a01b03808616926323b872dd926132cd928992169087906004016159e4565b6020604051808303816000875af11580156132ec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133109190615b41565b50610160546040516313e7e7d160e11b81526001600160a01b03909116906327cfcfa290613346908790879087906004016159e4565b6020604051808303816000875af1158015613365573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133899190615a08565b949350505050565b61339b8282614285565b6000828152609760205260409020610e3290826127b9565b60006108cf825490565b60006119db83836142ec565b6001600160a01b038116600090815260018301602052604081205415156119db565b6000341561340c576040516342f7487960e11b815260040160405180910390fd5b61015f546040516323b872dd60e01b81526001600160a01b03918216917f000000000000000000000000000000000000000000000000000000000000000016906323b872dd9061346490889085908b906004016159e4565b6020604051808303816000875af1158015613483573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906134a79190615b41565b5060405163e06bf20d60e01b8152600481018990526001600160a01b0388811660248301526044820188905285151560648301526084820185905282169063e06bf20d9060a4015b6020604051808303816000875af115801561350e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124f89190615a08565b600061353f858484614316565b600061354a8661397d565b604051639f5c734b60e01b8152600481018a90526001600160a01b03898116602483015288811660448301526064820188905291925090821690639f5c734b906084016134ef565b61359b82612792565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116908316036135e75760405163c1ab6dc160e01b815260040160405180910390fd5b6135f361016583613c4b565b6136105760405163119b4fd360e11b815260040160405180910390fd5b604051634824fce960e11b81526001600160a01b038381166004830152821690639049f9d290602401600060405180830381600087803b15801561365357600080fd5b505af1158015613667573d6000803e3d6000fd5b505050506001600160a01b038281166000818152610167602052604080822080546001600160a01b0319169486169485179055517f4f2ce4e40f623ca765fc0167a25cb7842ceaafb8d82d3dec26ca0d0e0d2d48969190a3806001600160a01b0316826001600160a01b03167f95f865c2808f8b2a85eea2611db7843150ee7835ef1403f9755918a97d76933c60405160405180910390a35050565b600061371289898989896143fa565b61378f60405180604001604052808b6001600160a01b031681526020018a6001600160a01b031681525060405180608001604052808a81526020018981526020016000151581526020018515158152506040518060400160405280876001600160a01b03168152602001886001600160a01b03168152508861447e565b9998505050505050505050565b6101695460ff166137c0576040516303a5be3f60e31b815260040160405180910390fd5b565b604080516001600160601b0319606084811b82166020808501919091526001600160e01b03194260e01b16603485015288821b8316603885015287821b909216604c84015280830186905283518084039091018152608090920190925280519101206000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03908116908616036138725761386a818786866000806133eb565b915050613389565b6130c0818787878789613532565b620f424063ffffffff821611156108f6576040516358d620b360e01b815260040160405180910390fd5b6101695463ffffffff610100909104811690821681036138c8575050565b610169805464ffffffff00191661010063ffffffff8581169182029290921790925560408051918416825260208201929092527fa159b13d7eac36d9a65034b4fd6ace1d9cb070d063dc950c564a266f4d0918029101612d6d565b61012d5460ff16156139475760405162461bcd60e51b815260040161092590615983565b61012d805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586127753390565b6001600160a01b0380821660009081526101676020526040812054909116806108cf5760405163c1ab6dc160e01b815260040160405180910390fd5b60006139c483613c60565b156139da57506001600160a01b038116316108cf565b826040516370a0823160e01b81526001600160a01b03848116600483015291909116906370a0823190602401602060405180830381865afa158015613a23573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119db9190615a08565b600080613a548585614882565b8051909150600003613a7857828160200151613a709190615d7c565b9150506119db565b80518311613a9957604051631a93c68960e11b815260040160405180910390fd5b6000613aa6868686614909565b90506000613ab48383614924565b8051909150600003613ada57848160200151613ad09190615d7c565b93505050506119db565b6000858103861690613aec83836149a9565b90506000613b02613afd848a615d7c565b6149e0565b919091029998505050505050505050565b600080613b216101626133b3565b905060005b81811015613c40576000613b3c610162836133bd565b90508561ffff16816001600160a01b031663b1dd61b66040518163ffffffff1660e01b8152600401602060405180830381865afa158015613b81573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ba59190615a21565b61ffff16148015613c1e57508461ffff16816001600160a01b03166354fd4d506040518163ffffffff1660e01b8152600401602060405180830381865afa158015613bf4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613c189190615a21565b61ffff16145b15613c2d5792506108cf915050565b5080613c3881615b02565b915050613b26565b506000949350505050565b60006119db836001600160a01b038416614a0b565b6001600160a01b031673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1490565b80471015613cd25760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610925565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114613d1f576040519150601f19603f3d011682016040523d82523d6000602084013e613d24565b606091505b5050905080610e325760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610925565b80600003613da857505050565b613db183613c60565b15613df2576040516001600160a01b0383169082156108fc029083906000818181858888f19350505050158015613dec573d6000803e3d6000fd5b50505050565b610e326001600160a01b0384168383614a5a565b600054610100900460ff16613e2d5760405162461bcd60e51b815260040161092590615d9e565b613e35614abd565b613e3d614af4565b613e45614b23565b610e32838383614b52565b613e5c61016b826133c9565b6108f657604051634ca8886760e01b815260040160405180910390fd5b6000613e8889898989896143fa565b61378f60405180604001604052808b6001600160a01b031681526020018a6001600160a01b031681525060405180608001604052808a81526020018981526020016001151581526020018515158152506040518060400160405280876001600160a01b03168152602001886001600160a01b03168152508861447e565b80613f0f81614c43565b613f1b61016b83613c4b565b613f385760405163119b4fd360e11b815260040160405180910390fd5b6040516001600160a01b038316907f534d18c8ff24ba5980906d732f3075704749427353734fbbf05d50485643b12490600090a25050565b60008181526001830160205260408120548015614059576000613f94600183615bcd565b8554909150600090613fa890600190615bcd565b905081811461400d576000866000018281548110613fc857613fc8615ad6565b9060005260206000200154905080876000018481548110613feb57613feb615ad6565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061401e5761401e615de9565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506108cf565b60009150506108cf565b60606000614072836002615dff565b61407d906002615c5d565b67ffffffffffffffff81111561409557614095615a45565b6040519080825280601f01601f1916602001820160405280156140bf576020820181803683370190505b509050600360fc1b816000815181106140da576140da615ad6565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061410957614109615ad6565b60200101906001600160f81b031916908160001a905350600061412d846002615dff565b614138906001615c5d565b90505b60018111156141b0576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061416c5761416c615ad6565b1a60f81b82828151811061418257614182615ad6565b60200101906001600160f81b031916908160001a90535060049490941c936141a981615e1e565b905061413b565b5083156119db5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610925565b61420982826119e2565b610c635760008281526065602090815260408083206001600160a01b03851684529091529020805460ff191660011790556142413390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b61428f82826119e2565b15610c635760008281526065602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600082600001828154811061430357614303615ad6565b9060005260206000200154905092915050565b614328836001600160a01b0316613c60565b156143a6578034101561434e576040516342f7487960e11b815260040160405180910390fd5b6143816001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001682613c82565b80341115610e3257610e326143968234615bcd565b6001600160a01b03841690613c82565b34156143c5576040516342f7487960e11b815260040160405180910390fd5b610e326001600160a01b038416837f000000000000000000000000000000000000000000000000000000000000000084614c7f565b61440385612792565b61440c84612792565b836001600160a01b0316856001600160a01b03160361443e5760405163c1ab6dc160e01b815260040160405180910390fd5b61444783612d05565b61445082612d05565b4263ffffffff1681101561447757604051631ab7da6b60e01b815260040160405180910390fd5b5050505050565b60208201516000906001600160a01b03166144a45782516001600160a01b031660208401525b825185516020808801518751888301516040808b0151858b015182516001600160601b031960609a8b1b8116828a01526001600160e01b03194260e01b166034830152988a1b8916603882015295891b8816604c87015288860194909452608080860193909352151560f81b60a085015260a1840189905291861b90941660c1830152805160b581840301815260d5830180835281519185019190912061015584018352600080835260f5850181905261011585018190526101359094018490528251958601835283865293850183905290840182905293830152919087516000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691160361464e576145ca848a6020015160018b614ca9565b91508192508160600151905088602001516001600160a01b031689600001516001600160a01b0316857f5c02c2bb2d1d082317eb23916ca27b3e7c294398b60061a2ad54f1c3c018c318856000015186602001518760000151886040015160008f6000015160405161464196959493929190615e35565b60405180910390a46147ad565b60208901516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811691160361471057614696848a6000015160008b614ca9565b91508192508160600151905088602001516001600160a01b031689600001516001600160a01b0316857f5c02c2bb2d1d082317eb23916ca27b3e7c294398b60061a2ad54f1c3c018c318856000015186602001518760200151886040015189604001518f6000015160405161464196959493929190615e35565b61471b848a8a614fcb565b6060808201519083015192955090935061473491615c5d565b905088602001516001600160a01b031689600001516001600160a01b0316857f5c02c2bb2d1d082317eb23916ca27b3e7c294398b60061a2ad54f1c3c018c31886600001518660200151886020015188604001518a604001518f600001516040516147a496959493929190615e35565b60405180910390a45b8851875184516147be929190614316565b6020808a01518882015191840151604051631c20fadd60e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001693631c20fadd936148189390926004016159e4565b600060405180830381600087803b15801561483257600080fd5b505af1158015614846573d6000803e3d6000fd5b5050505080610168600082825461485d9190615c5d565b9091555050604088015161487257825161378f565b5060200151979650505050505050565b604080518082019091526000808252602082015260006148a2848461516e565b90508383028082106148d757604051806040016040528082846148c59190615bcd565b815260200182815250925050506108cf565b604051806040016040528060016148ee8585900390565b6148f89190615bcd565b815260200191909152949350505050565b6000818061491957614919615d66565b838509949350505050565b604080518082019091526000808252602082015281836020015110614971576040518060400160405280846000015181526020018385602001516149689190615bcd565b905290506108cf565b60405180604001604052806001856000015161498d9190615bcd565b81526020016149a0856020015185900390565b90529392505050565b6000806149c16149bb84808403615d7c565b60010190565b90508284602001516149d39190615d7c565b8451820217949350505050565b60006001815b6008811015610fd6578382026002038202915080614a0381615b02565b9150506149e6565b6000818152600183016020526040812054614a52575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556108cf565b5060006108cf565b6040516001600160a01b038316602482015260448101829052610e3290849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261517d565b600054610100900460ff16614ae45760405162461bcd60e51b815260040161092590615d9e565b614aec61524f565b6137c0615276565b600054610100900460ff16614b1b5760405162461bcd60e51b815260040161092590615d9e565b6137c06152db565b600054610100900460ff16614b4a5760405162461bcd60e51b815260040161092590615d9e565b6137c0615309565b600054610100900460ff16614b795760405162461bcd60e51b815260040161092590615d9e565b61015f80546001600160a01b038086166001600160a01b0319928316179092556101608054858416908316179055610161805492841692909116919091179055614bf17fdf8c9529ea4b244b569bac557a549516f317e7b5cf82dc5e0d8b6d874930a3f5600080516020615eff83398151915261533d565b614c17600080516020615ebf833981519152600080516020615eff83398151915261533d565b610169805460ff19166001179055614c306107d06138aa565b610e3269d3c21bcecceda1000000612d26565b6001600160a01b0381161580614c6157506001600160a01b03811630145b156108f657604051638e052b6760e01b815260040160405180910390fd5b801580614c905750614c9084613c60565b613dec57613dec6001600160a01b038516848484615388565b614cd46040518060800160405280600081526020016000815260200160008152602001600081525090565b600083614d27576040518060400160405280866001600160a01b031681526020017f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316815250614d6f565b60405180604001604052807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602001866001600160a01b03168152505b905060008360400151614e2d57614d858661397d565b825160208085015187519188015160608901516040516337cb0ead60e21b8152600481018e90526001600160a01b03958616602482015292851660448401526064830193909352608482015290151560a482015291169063df2c3ab49060c4016060604051808303816000875af1158015614e04573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614e289190615e66565b614ed9565b614e368661397d565b8251602080850151875191880151606089015160405163d1aebfc760e01b8152600481018e90526001600160a01b03958616602482015292851660448401526064830193909352608482015290151560a482015291169063d1aebfc79060c4016060604051808303816000875af1158015614eb5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190614ed99190615e66565b905084614f725761015f54604082015160208301516001600160a01b0390921691637c8f622d918991614f0c9190615bcd565b6040516001600160e01b031960e085901b1681526001600160a01b039092166004830152602482015260016044820152606401600060405180830381600087803b158015614f5957600080fd5b505af1158015614f6d573d6000803e3d6000fd5b505050505b60405180608001604052808560400151614f8d578251614f90565b85515b81526020018560400151614fa5578551614fa8565b82515b815260200182602001518152602001826040015181525092505050949350505050565b614ff66040518060800160405280600081526020016000815260200160008152602001600081525090565b6150216040518060800160405280600081526020016000815260200160008152602001600081525090565b8260400151156150cb57600083600001519050600084602001519050600061507a88886000015160006040518060800160405280888152602001600181526020016001151581526020018b606001511515815250614ca9565b905060006150bc89896020015160016040518060800160405280876020015181526020018881526020016001151581526020018c606001511515815250614ca9565b91955090935061516692505050565b600083600001519050600084602001519050600061511b8888602001516001604051806080016040528088815260200160001981526020016000151581526020018b606001511515815250614ca9565b9050600061515d89896000015160006040518060800160405280876000015181526020018881526020016000151581526020018c606001511515815250614ca9565b95509093505050505b935093915050565b60006000198284099392505050565b60006151d2826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166153a99092919063ffffffff16565b805190915015610e3257808060200190518101906151f09190615b41565b610e325760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610925565b600054610100900460ff166137c05760405162461bcd60e51b815260040161092590615d9e565b600054610100900460ff1661529d5760405162461bcd60e51b815260040161092590615d9e565b60c9805461ffff191660011790556152c3600080516020615eff8339815191528061533d565b6137c0600080516020615eff833981519152336153b8565b600054610100900460ff166153025760405162461bcd60e51b815260040161092590615d9e565b600160fb55565b600054610100900460ff166153305760405162461bcd60e51b815260040161092590615d9e565b61012d805460ff19169055565b600082815260656020526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b613dec846323b872dd60e01b858585604051602401614a86939291906159e4565b606061338984846000856153c2565b610c63828261312e565b6060824710156154235760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610925565b6001600160a01b0385163b61547a5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610925565b600080866001600160a01b031685876040516154969190615ea2565b60006040518083038185875af1925050503d80600081146154d3576040519150601f19603f3d011682016040523d82523d6000602084013e6154d8565b606091505b50915091506154e88282866154f3565b979650505050505050565b606083156155025750816119db565b8251156155125782518084602001fd5b8160405162461bcd60e51b81526004016109259190615d33565b60006020828403121561553e57600080fd5b81356001600160e01b0319811681146119db57600080fd5b6001600160a01b03811681146108f657600080fd5b60006020828403121561557d57600080fd5b81356119db81615556565b60006020828403121561559a57600080fd5b5035919050565b80151581146108f657600080fd5b6000602082840312156155c157600080fd5b81356119db816155a1565b600080604083850312156155df57600080fd5b8235915060208301356155f181615556565b809150509250929050565b6000806040838503121561560f57600080fd5b823561561a81615556565b946020939093013593505050565b6020808252825182820181905260009190848201906040850190845b818110156156695783516001600160a01b031683529284019291840191600101615644565b50909695505050505050565b600080600080600060a0868803121561568d57600080fd5b853561569881615556565b945060208601356156a881615556565b94979496505050506040830135926060810135926080909101359150565b6000806000604084860312156156db57600080fd5b833567ffffffffffffffff808211156156f357600080fd5b818601915086601f83011261570757600080fd5b81358181111561571657600080fd5b8760208260051b850101111561572b57600080fd5b6020928301955093505084013561574181615556565b809150509250925092565b60008060008060008060c0878903121561576557600080fd5b863561577081615556565b9550602087013561578081615556565b945060408701359350606087013592506080870135915060a08701356157a581615556565b809150509295509295509295565b63ffffffff811681146108f657600080fd5b6000602082840312156157d757600080fd5b81356119db816157b3565b60008083601f8401126157f457600080fd5b50813567ffffffffffffffff81111561580c57600080fd5b60208301915083602082850101111561582457600080fd5b9250929050565b6000806020838503121561583e57600080fd5b823567ffffffffffffffff81111561585557600080fd5b615861858286016157e2565b90969095509350505050565b6000806040838503121561588057600080fd5b50508035926020909101359150565b6000806000806000608086880312156158a757600080fd5b85356158b281615556565b94506020860135935060408601356158c981615556565b9250606086013567ffffffffffffffff8111156158e557600080fd5b6158f1888289016157e2565b969995985093965092949392505050565b60008060006060848603121561591757600080fd5b833561592281615556565b9250602084013561593281615556565b929592945050506040919091013590565b60008060006060848603121561595857600080fd5b833561596381615556565b9250602084013561597381615556565b9150604084013561574181615556565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b600060208284031215615a1a57600080fd5b5051919050565b600060208284031215615a3357600080fd5b815161ffff811681146119db57600080fd5b634e487b7160e01b600052604160045260246000fd5b6040516060810167ffffffffffffffff81118282101715615a8c57634e487b7160e01b600052604160045260246000fd5b60405290565b600060608284031215615aa457600080fd5b615aac615a5b565b8251615ab781615556565b8152602083810151908201526040928301519281019290925250919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201615b1457615b14615aec565b5060010190565b600061ffff808316818516808303821115615b3857615b38615aec565b01949350505050565b600060208284031215615b5357600080fd5b81516119db816155a1565b80516fffffffffffffffffffffffffffffffff81168114615b7e57600080fd5b919050565b600060608284031215615b9557600080fd5b615b9d615a5b565b615ba683615b5e565b8152615bb460208401615b5e565b6020820152604083015160408201528091505092915050565b600082821015615bdf57615bdf615aec565b500390565b600060208284031215615bf657600080fd5b81516119db816157b3565b6001600160a01b03878116825286166020820152604081018590526060810184905260a06080820181905281018290526000828460c0840137600060c0848401015260c0601f19601f8501168301019050979650505050505050565b60008219821115615c7057615c70615aec565b500190565b600060208284031215615c8757600080fd5b81516119db81615556565b60005b83811015615cad578181015183820152602001615c95565b83811115613dec5750506000910152565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351615cf6816017850160208801615c92565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351615d27816028840160208801615c92565b01602801949350505050565b6020815260008251806020840152615d52816040850160208701615c92565b601f01601f19169190910160400192915050565b634e487b7160e01b600052601260045260246000fd5b600082615d9957634e487b7160e01b600052601260045260246000fd5b500490565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b634e487b7160e01b600052603160045260246000fd5b6000816000190483118215151615615e1957615e19615aec565b500290565b600081615e2d57615e2d615aec565b506000190190565b95865260208601949094526040850192909252606084015260808301526001600160a01b031660a082015260c00190565b600060608284031215615e7857600080fd5b615e80615a5b565b8251815260208301516020820152604083015160408201528091505092915050565b60008251615eb4818460208701615c92565b919091019291505056fef28f409b8cbe6b50c7ca45afe893f01f69626f8a4e33cb480bc1bc2d618c084589ce14d20697a788f57260f7690044299bde7ea88cfb7e43d120a0c031f1ffc12172861495e7b85edac73e3cd5fbb42dd675baadf627720e687bcfdaca025096a164736f6c634300080d000a", "devdoc": { "details": "Bancor Network contract", "events": { + "AddressAddedToWhitelist(address)": { + "details": "triggered when an address gets added to the fee exemption whitelist" + }, + "AddressRemovedFromWhitelist(address)": { + "details": "triggered when an address gets removed from the fee exemption whitelist" + }, "FlashLoanCompleted(address,address,uint256,uint256)": { "details": "triggered when a flash-loan is completed" }, @@ -1503,6 +1592,9 @@ }, "kind": "dev", "methods": { + "addToWhitelist(address)": { + "details": "adds an address to the fee exemption whitelist requirements: - the caller must be the admin of the contract" + }, "burnNetworkFees()": { "details": "burns pending network fees, and returns the amount of fees burned" }, @@ -1530,6 +1622,9 @@ "enableDepositing(bool)": { "details": "enables/disables depositing into a given pool requirements: - the caller must be the owner of the contract" }, + "feeExemptionWhitelist()": { + "details": "returns the fee exemption whitelist" + }, "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" }, @@ -1554,6 +1649,9 @@ "initialize(address,address,address)": { "details": "fully initializes the contract and its parents" }, + "isWhitelisted(address)": { + "details": "returns whether an address is in the fee exemption whitelist" + }, "liquidityPools()": { "details": "returns the set of all liquidity pools" }, @@ -1587,6 +1685,9 @@ "registerPoolCollection(address)": { "details": "registers new pool collection with the network requirements: - the caller must be the admin of the contract" }, + "removeFromWhitelist(address)": { + "details": "removes an address from the fee exemption 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`." }, @@ -1618,13 +1719,13 @@ "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" + "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 in the fee exemption whitelist" }, "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" + "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 in the fee exemption whitelist" }, "unregisterPoolCollection(address)": { "details": "unregisters an existing pool collection from the network requirements: - the caller must be the admin of the contract" @@ -1710,7 +1811,7 @@ "type": "t_array(t_uint256)49_storage" }, { - "astId": 33038, + "astId": 33183, "contract": "contracts/network/BancorNetwork.sol:BancorNetwork", "label": "_initializations", "offset": 0, @@ -1718,7 +1819,7 @@ "type": "t_uint16" }, { - "astId": 33044, + "astId": 33189, "contract": "contracts/network/BancorNetwork.sol:BancorNetwork", "label": "__gap", "offset": 0, @@ -1758,31 +1859,31 @@ "type": "t_array(t_uint256)49_storage" }, { - "astId": 11397, + "astId": 11393, "contract": "contracts/network/BancorNetwork.sol:BancorNetwork", "label": "_bntPool", "offset": 0, "slot": "351", - "type": "t_contract(IBNTPool)25422" + "type": "t_contract(IBNTPool)25567" }, { - "astId": 11400, + "astId": 11396, "contract": "contracts/network/BancorNetwork.sol:BancorNetwork", "label": "_pendingWithdrawals", "offset": 0, "slot": "352", - "type": "t_contract(IPendingWithdrawals)18396" + "type": "t_contract(IPendingWithdrawals)18541" }, { - "astId": 11403, + "astId": 11399, "contract": "contracts/network/BancorNetwork.sol:BancorNetwork", "label": "_poolMigrator", "offset": 0, "slot": "353", - "type": "t_contract(IPoolMigrator)25810" + "type": "t_contract(IPoolMigrator)25955" }, { - "astId": 11406, + "astId": 11402, "contract": "contracts/network/BancorNetwork.sol:BancorNetwork", "label": "_poolCollections", "offset": 0, @@ -1790,7 +1891,7 @@ "type": "t_struct(AddressSet)1737_storage" }, { - "astId": 11408, + "astId": 11404, "contract": "contracts/network/BancorNetwork.sol:BancorNetwork", "label": "_deprecated0", "offset": 0, @@ -1798,7 +1899,7 @@ "type": "t_uint256" }, { - "astId": 11411, + "astId": 11407, "contract": "contracts/network/BancorNetwork.sol:BancorNetwork", "label": "_liquidityPools", "offset": 0, @@ -1806,15 +1907,15 @@ "type": "t_struct(AddressSet)1737_storage" }, { - "astId": 11417, + "astId": 11413, "contract": "contracts/network/BancorNetwork.sol:BancorNetwork", "label": "_collectionByPool", "offset": 0, "slot": "359", - "type": "t_mapping(t_contract(Token)30886,t_contract(IPoolCollection)25788)" + "type": "t_mapping(t_contract(Token)31031,t_contract(IPoolCollection)25933)" }, { - "astId": 11419, + "astId": 11415, "contract": "contracts/network/BancorNetwork.sol:BancorNetwork", "label": "_pendingNetworkFeeAmount", "offset": 0, @@ -1822,7 +1923,7 @@ "type": "t_uint256" }, { - "astId": 11422, + "astId": 11418, "contract": "contracts/network/BancorNetwork.sol:BancorNetwork", "label": "_depositingEnabled", "offset": 0, @@ -1830,7 +1931,7 @@ "type": "t_bool" }, { - "astId": 11424, + "astId": 11420, "contract": "contracts/network/BancorNetwork.sol:BancorNetwork", "label": "_polRewardsPPM", "offset": 1, @@ -1838,7 +1939,7 @@ "type": "t_uint32" }, { - "astId": 11426, + "astId": 11422, "contract": "contracts/network/BancorNetwork.sol:BancorNetwork", "label": "_minNetworkFeeBurn", "offset": 0, @@ -1846,12 +1947,20 @@ "type": "t_uint256" }, { - "astId": 11432, + "astId": 11425, "contract": "contracts/network/BancorNetwork.sol:BancorNetwork", - "label": "__gap", + "label": "_feeExemptionWhitelist", "offset": 0, "slot": "363", - "type": "t_array(t_uint256)38_storage" + "type": "t_struct(AddressSet)1737_storage" + }, + { + "astId": 11431, + "contract": "contracts/network/BancorNetwork.sol:BancorNetwork", + "label": "__gap", + "offset": 0, + "slot": "365", + "type": "t_array(t_uint256)36_storage" } ], "types": { @@ -1866,11 +1975,11 @@ "label": "bytes32[]", "numberOfBytes": "32" }, - "t_array(t_uint256)38_storage": { + "t_array(t_uint256)36_storage": { "base": "t_uint256", "encoding": "inplace", - "label": "uint256[38]", - "numberOfBytes": "1216" + "label": "uint256[36]", + "numberOfBytes": "1152" }, "t_array(t_uint256)49_storage": { "base": "t_uint256", @@ -1894,27 +2003,27 @@ "label": "bytes32", "numberOfBytes": "32" }, - "t_contract(IBNTPool)25422": { + "t_contract(IBNTPool)25567": { "encoding": "inplace", "label": "contract IBNTPool", "numberOfBytes": "20" }, - "t_contract(IPendingWithdrawals)18396": { + "t_contract(IPendingWithdrawals)18541": { "encoding": "inplace", "label": "contract IPendingWithdrawals", "numberOfBytes": "20" }, - "t_contract(IPoolCollection)25788": { + "t_contract(IPoolCollection)25933": { "encoding": "inplace", "label": "contract IPoolCollection", "numberOfBytes": "20" }, - "t_contract(IPoolMigrator)25810": { + "t_contract(IPoolMigrator)25955": { "encoding": "inplace", "label": "contract IPoolMigrator", "numberOfBytes": "20" }, - "t_contract(Token)30886": { + "t_contract(Token)31031": { "encoding": "inplace", "label": "contract Token", "numberOfBytes": "20" @@ -1947,12 +2056,12 @@ "numberOfBytes": "32", "value": "t_uint256" }, - "t_mapping(t_contract(Token)30886,t_contract(IPoolCollection)25788)": { + "t_mapping(t_contract(Token)31031,t_contract(IPoolCollection)25933)": { "encoding": "mapping", - "key": "t_contract(Token)30886", + "key": "t_contract(Token)31031", "label": "mapping(contract Token => contract IPoolCollection)", "numberOfBytes": "32", - "value": "t_contract(IPoolCollection)25788" + "value": "t_contract(IPoolCollection)25933" }, "t_struct(AddressSet)1737_storage": { "encoding": "inplace", diff --git a/yarn.lock b/yarn.lock index fc64c3ce0..9878833f1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1521,9 +1521,9 @@ fs-extra "^9.1.0" "@types/adm-zip@^0.5.0": - version "0.5.5" - resolved "https://registry.yarnpkg.com/@types/adm-zip/-/adm-zip-0.5.5.tgz#4588042726aa5f351d7ea88232e4a952f60e7c1a" - integrity sha512-YCGstVMjc4LTY5uK9/obvxBya93axZOVOyf2GSUulADzmLhYE45u2nAssCs/fWBs1Ifq5Vat75JTPwd5XZoPJw== + version "0.5.6" + resolved "https://registry.yarnpkg.com/@types/adm-zip/-/adm-zip-0.5.6.tgz#12e010a45f68a40cbaf9906a329baf4ee7749c67" + integrity sha512-lRlcSLg5Yoo7C2H2AUiAoYlvifWoCx/se7iUNiCBTfEVVYFVn+Tr9ZGed4K73tYgLe9O4PjdJvbxlkdAOx/qiw== dependencies: "@types/node" "*" @@ -1552,15 +1552,22 @@ "@types/responselike" "^1.0.0" "@types/chai@*": - version "5.0.0" - resolved "https://registry.yarnpkg.com/@types/chai/-/chai-5.0.0.tgz#7f981e71e69c9b2d422f58f78de1c59179782133" - integrity sha512-+DwhEHAaFPPdJ2ral3kNHFQXnTfscEEFsUxzD+d7nlcLrFK23JtNjH71RGasTcHb88b4vVi4mTyfpf8u2L8bdA== + version "5.0.1" + resolved "https://registry.yarnpkg.com/@types/chai/-/chai-5.0.1.tgz#2c3705555cf11f5f59c836a84c44afcfe4e5689d" + integrity sha512-5T8ajsg3M/FOncpLYW7sdOcD6yf4+722sze/tc4KQV0P8Z2rAr3SAuHCIkYmYpt8VbcQlnz8SxlOlPQYefe4cA== + dependencies: + "@types/deep-eql" "*" "@types/chai@^4.3.4": version "4.3.20" resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.3.20.tgz#cb291577ed342ca92600430841a00329ba05cecc" integrity sha512-/pC9HAB5I/xMlc5FP77qjCnI16ChlJfW0tGa0IUcFn38VJrTV6DeZ60NU5KZBtaOZqjdpwTWohz5HU1RrhiYxQ== +"@types/deep-eql@*": + version "4.0.2" + resolved "https://registry.yarnpkg.com/@types/deep-eql/-/deep-eql-4.0.2.tgz#334311971d3a07121e7eb91b684a605e7eea9cbd" + integrity sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw== + "@types/glob@^7.1.1": version "7.2.0" resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.2.0.tgz#bc1b5bf3aa92f25bd5dd39f35c57361bdce5b2eb" @@ -1597,9 +1604,9 @@ "@types/node" "*" "@types/lodash@^4.14.191": - version "4.17.12" - resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.17.12.tgz#25d71312bf66512105d71e55d42e22c36bcfc689" - integrity sha512-sviUmCE8AYdaF/KIHLDJBQgeYzPBI0vf/17NaYehBJfYD1j6/L95Slh07NlyK2iNyBNaEkb3En2jRt+a8y3xZQ== + version "4.17.13" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.17.13.tgz#786e2d67cfd95e32862143abe7463a7f90c300eb" + integrity sha512-lfx+dftrEZcdBPczf9d0Qv0x+j/rfNCMuC6OcfXmO8gkfeNAY88PgKUbvG56whcN23gc27yenwF6oJZXGFpYxg== "@types/lru-cache@^5.1.0": version "5.1.1" @@ -1632,9 +1639,9 @@ form-data "^4.0.0" "@types/node@*": - version "22.8.1" - resolved "https://registry.yarnpkg.com/@types/node/-/node-22.8.1.tgz#b39d4b98165e2ae792ce213f610c7c6108ccfa16" - integrity sha512-k6Gi8Yyo8EtrNtkHXutUu2corfDf9su95VYVP10aGYMMROM6SAItZi0w1XszA6RtWTHSVp5OeFof37w0IEqCQg== + version "22.8.4" + resolved "https://registry.yarnpkg.com/@types/node/-/node-22.8.4.tgz#ab754f7ac52e1fe74174f761c5b03acaf06da0dc" + integrity sha512-SpNNxkftTJOPk0oN+y2bIqurEXHTA2AOZ3EJDDKeJ5VzkvvORSvmQXGQarcOzWV1ac7DCaPBEdMDxBsM+d8jWw== dependencies: undici-types "~6.19.8" @@ -1644,9 +1651,9 @@ integrity sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ== "@types/node@^20.3.1": - version "20.17.1" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.17.1.tgz#2b968e060dfb04b7f9550fe3db5f552721c14566" - integrity sha512-j2VlPv1NnwPJbaCNv69FO/1z4lId0QmGvpT41YxitRtWlg96g/j8qcv2RKsLKe2F6OJgyXhupN1Xo17b2m139Q== + version "20.17.3" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.17.3.tgz#1ad87177c53fa2b237e79a4929fd37932f779f0c" + integrity sha512-tSQrmKKatLDGnG92h40GD7FzUt0MjahaHwOME4VAFeeA/Xopayq5qLyQRy7Jg/pjgKIFBXuKcGhJo+UdYG55jQ== dependencies: undici-types "~6.19.2" @@ -3362,9 +3369,9 @@ camelcase@^6.0.0: integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== caniuse-lite@^1.0.30000844: - version "1.0.30001673" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001673.tgz#5aa291557af1c71340e809987367410aab7a5a9e" - integrity sha512-WTrjUCSMp3LYX0nE12ECkV0a+e6LC85E0Auz75555/qr78Oc8YWhEPNfDd6SHdtlCMSzqtuXY0uyEMNRcsKpKw== + version "1.0.30001675" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001675.tgz#0c1f01fc9cc543b61839753a4c234f995588d1b9" + integrity sha512-/wV1bQwPrkLiQMjaJF5yUMVM/VdRPOCU8QZ+PmG6uW6DvYSrNY1bpwHI/3mOcUosLaJCzYDi5o91IQB51ft6cg== case@^1.6.3: version "1.6.3" @@ -4255,9 +4262,9 @@ eip55@^2.1.1: keccak "^3.0.3" electron-to-chromium@^1.3.47: - version "1.5.47" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.47.tgz#ef0751bc19b28be8ee44cd8405309de3bf3b20c7" - integrity sha512-zS5Yer0MOYw4rtK2iq43cJagHZ8sXN0jDHDKzB+86gSBSAI4v07S97mcq+Gs2vclAxSh1j7vOAHxSVgduiiuVQ== + version "1.5.49" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.49.tgz#9358f514ab6eeed809a8689f4b39ea5114ae729c" + integrity sha512-ZXfs1Of8fDb6z7WEYZjXpgIRF6MEu8JdeGA0A40aZq6OQbS+eJpnnV49epZRna2DU/YsEjSQuGtQPPtvt6J65A== elliptic@6.5.4: version "6.5.4" @@ -7829,9 +7836,9 @@ mocha-silent-reporter@^1.0.0: chalk "^0.5.1" mocha@^10.0.0, mocha@^10.2.0: - version "10.7.3" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.7.3.tgz#ae32003cabbd52b59aece17846056a68eb4b0752" - integrity sha512-uQWxAu44wwiACGqjbPYmjo7Lg8sFrS3dQe7PP2FQI+woptP4vZXSMcfMyFL/e1yFEeEpV4RtyTpZROOKmxis+A== + version "10.8.1" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.8.1.tgz#dc56251be909d7bea999c50f604c50e8dfd9d075" + integrity sha512-WxSpEWgF03HfgNKBuysfK40DUaOSVX5zxgLDoieMGO+zyE69iq2eQ1vBypvIJ5mOPKpuVAqWiTbt4Orj7L6wVw== dependencies: ansi-colors "^4.1.3" browser-stdout "^1.3.1" @@ -9843,7 +9850,7 @@ string-format@^2.0.0: resolved "https://registry.yarnpkg.com/string-format/-/string-format-2.0.0.tgz#f2df2e7097440d3b65de31b6d40d54c96eaffb9b" integrity sha512-bbEs3scLeYNXLecRRuk6uJxdXUSj6le/8rNPHChIJTn2V79aXVTR1EH2OH5zLKKoz0V02fOUKZZcw01pLUShZA== -"string-width-cjs@npm:string-width@^4.2.0": +"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -9861,15 +9868,6 @@ string-width@^1.0.1: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" -string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - string-width@^5.0.1, string-width@^5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794" @@ -9926,7 +9924,7 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1": +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -9947,13 +9945,6 @@ strip-ansi@^3.0.0, strip-ansi@^3.0.1: dependencies: ansi-regex "^2.0.0" -strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - strip-ansi@^7.0.1: version "7.1.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" @@ -11132,7 +11123,7 @@ workerpool@^6.5.1: resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.5.1.tgz#060f73b39d0caf97c6db64da004cd01b4c099544" integrity sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -11149,15 +11140,6 @@ wrap-ansi@^2.0.0: string-width "^1.0.1" strip-ansi "^3.0.1" -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"