From 9590f0a51d61b9a33d59e7350667662950922fed Mon Sep 17 00:00:00 2001 From: Debugger022 Date: Tue, 13 Feb 2024 14:58:18 +0530 Subject: [PATCH] feat: update converter implementation deployment files --- .../RiskFundConverter_Implementation.json | 72 +++++----- .../bsctestnet/SingleTokenConverterImp.json | 69 +++++----- .../e9f683aad829bf9574e4eef6b067ab3e.json | 123 ++++++++++++++++++ 3 files changed, 194 insertions(+), 70 deletions(-) create mode 100644 deployments/bsctestnet/solcInputs/e9f683aad829bf9574e4eef6b067ab3e.json diff --git a/deployments/bsctestnet/RiskFundConverter_Implementation.json b/deployments/bsctestnet/RiskFundConverter_Implementation.json index 29b51b77..1772c07d 100644 --- a/deployments/bsctestnet/RiskFundConverter_Implementation.json +++ b/deployments/bsctestnet/RiskFundConverter_Implementation.json @@ -1,5 +1,5 @@ { - "address": "0xbF732B12f87963dF5d7c729E84E5CF3698F8d349", + "address": "0x1a6660059E61e88402bD34FC96C2332c5EeAF195", "abi": [ { "inputs": [ @@ -1622,30 +1622,30 @@ "type": "function" } ], - "transactionHash": "0xfad767e8ed7dd26d0bb429a9e293ab1e7c43febfe0abc5667bf44d0785dc3f7d", + "transactionHash": "0x51b90ec28ac939185ebdc2d03af1ddf63add4ec352c4473b396456b0fd7825e7", "receipt": { "to": null, - "from": "0x02EB950C215D12d723b44a18CfF098C6E166C531", - "contractAddress": "0xbF732B12f87963dF5d7c729E84E5CF3698F8d349", - "transactionIndex": 0, - "gasUsed": "4940305", - "logsBloom": "0x00000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000010000000100000000000", - "blockHash": "0xdc9ea9055f49f85ad8534f5adfa2a2b57c4a66c911b6d3f13de42ff4dcb34725", - "transactionHash": "0xfad767e8ed7dd26d0bb429a9e293ab1e7c43febfe0abc5667bf44d0785dc3f7d", + "from": "0x7Bf1Fe2C42E79dbA813Bf5026B7720935a55ec5f", + "contractAddress": "0x1a6660059E61e88402bD34FC96C2332c5EeAF195", + "transactionIndex": 1, + "gasUsed": "4951352", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xe7eb97c3ce0803a746d0c0dc4b0c3653edc508b73f765af46e4d58a18e4f2d54", + "transactionHash": "0x51b90ec28ac939185ebdc2d03af1ddf63add4ec352c4473b396456b0fd7825e7", "logs": [ { - "transactionIndex": 0, - "blockNumber": 36750496, - "transactionHash": "0xfad767e8ed7dd26d0bb429a9e293ab1e7c43febfe0abc5667bf44d0785dc3f7d", - "address": "0xbF732B12f87963dF5d7c729E84E5CF3698F8d349", + "transactionIndex": 1, + "blockNumber": 37698154, + "transactionHash": "0x51b90ec28ac939185ebdc2d03af1ddf63add4ec352c4473b396456b0fd7825e7", + "address": "0x1a6660059E61e88402bD34FC96C2332c5EeAF195", "topics": ["0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498"], "data": "0x00000000000000000000000000000000000000000000000000000000000000ff", "logIndex": 0, - "blockHash": "0xdc9ea9055f49f85ad8534f5adfa2a2b57c4a66c911b6d3f13de42ff4dcb34725" + "blockHash": "0xe7eb97c3ce0803a746d0c0dc4b0c3653edc508b73f765af46e4d58a18e4f2d54" } ], - "blockNumber": 36750496, - "cumulativeGasUsed": "4940305", + "blockNumber": 37698154, + "cumulativeGasUsed": "4982593", "status": 1, "byzantium": true }, @@ -1654,11 +1654,11 @@ "0x2E7222e51c0f6e98610A1543Aa3836E092CDe62c", "0xae13d989daC2f0dEbFf460aC112a837C89BAa7cd" ], - "numDeployments": 1, - "solcInputHash": "d02e743d886d63634298edb2c3d7a019", - "metadata": "{\"compiler\":{\"version\":\"0.8.13+commit.abaa5c0e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"corePoolComptroller_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"vBNB_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"nativeWrapped_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountInMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountInMaxMantissa\",\"type\":\"uint256\"}],\"name\":\"AmountInHigherThanMax\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AmountInMismatched\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOutMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMinMantissa\",\"type\":\"uint256\"}],\"name\":\"AmountOutLowerThanMinRequired\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AmountOutMismatched\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ConversionConfigNotEnabled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ConversionEnabledOnlyForPrivateConversions\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ConversionTokensActive\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ConversionTokensPaused\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DeflationaryTokenNotSupported\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"incentive\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxIncentive\",\"type\":\"uint256\"}],\"name\":\"IncentiveTooHigh\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InputLengthMisMatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientBalance\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientInputAmount\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientOutputAmount\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientPoolLiquidity\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidArguments\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidConverterNetwork\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidMinimumAmountToConvert\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidToAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidTokenConfigAddresses\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"comptroller\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"}],\"name\":\"MarketNotExistInPool\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NonZeroIncentiveForPrivateConversion\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ReentrancyGuardError\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"calledContract\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"methodSignature\",\"type\":\"string\"}],\"name\":\"Unauthorized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddressNotAllowed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroValueNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"comptroller\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"AssetTransferredToDestination\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"comptroller\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"AssetsReservesUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldIncentive\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newIncentive\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"enum IAbstractTokenConverter.ConversionAccessibility\",\"name\":\"oldAccess\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"enum IAbstractTokenConverter.ConversionAccessibility\",\"name\":\"newAccess\",\"type\":\"uint8\"}],\"name\":\"ConversionConfigUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"ConversionPaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"ConversionResumed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"name\":\"ConvertedExactTokens\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"name\":\"ConvertedExactTokensSupportingFeeOnTransferTokens\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"name\":\"ConvertedForExactTokens\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"name\":\"ConvertedForExactTokensSupportingFeeOnTransferTokens\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldConverterNetwork\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"converterNetwork\",\"type\":\"address\"}],\"name\":\"ConverterNetworkAddressUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldDestinationAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"destinationAddress\",\"type\":\"address\"}],\"name\":\"DestinationAddressUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldMinAmountToConvert\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newMinAmountToConvert\",\"type\":\"uint256\"}],\"name\":\"MinAmountToConvertUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldAccessControlManager\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAccessControlManager\",\"type\":\"address\"}],\"name\":\"NewAccessControlManager\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"comptroller\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"value\",\"type\":\"bool\"}],\"name\":\"PoolAssetsDirectTransferUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldPoolRegistry\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newPoolRegistry\",\"type\":\"address\"}],\"name\":\"PoolRegistryUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract ResilientOracle\",\"name\":\"oldPriceOracle\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"contract ResilientOracle\",\"name\":\"priceOracle\",\"type\":\"address\"}],\"name\":\"PriceOracleUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"SweepToken\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"CORE_POOL_COMPTROLLER\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_INCENTIVE\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"NATIVE_WRAPPED\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"VBNB\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"accessControlManager\",\"outputs\":[{\"internalType\":\"contract IAccessControlManagerV8\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenBalance\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"conversionConfigurations\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"incentive\",\"type\":\"uint256\"},{\"internalType\":\"enum IAbstractTokenConverter.ConversionAccessibility\",\"name\":\"conversionAccess\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"conversionPaused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountInMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMinMantissa\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"convertExactTokens\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"actualAmountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actualAmountOut\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountInMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMinMantissa\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"convertExactTokensSupportingFeeOnTransferTokens\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"actualAmountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actualAmountOut\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountInMaxMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMantissa\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"convertForExactTokens\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"actualAmountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actualAmountOut\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountInMaxMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMantissa\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"convertForExactTokensSupportingFeeOnTransferTokens\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"actualAmountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actualAmountOut\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"converterNetwork\",\"outputs\":[{\"internalType\":\"contract IConverterNetwork\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"destinationAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOutMantissa\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"}],\"name\":\"getAmountIn\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountConvertedMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountInMantissa\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountInMantissa\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"}],\"name\":\"getAmountOut\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountConvertedMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMantissa\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"comptroller\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"}],\"name\":\"getPoolAssetReserve\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"reserves\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"getPools\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"poolsWithCore\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOutMantissa\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"}],\"name\":\"getUpdatedAmountIn\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountConvertedMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountInMantissa\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountInMantissa\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"}],\"name\":\"getUpdatedAmountOut\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountConvertedMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMantissa\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"accessControlManager_\",\"type\":\"address\"},{\"internalType\":\"contract ResilientOracle\",\"name\":\"priceOracle_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"destinationAddress_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"poolRegistry_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"minAmountToConvert_\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"comptrollers\",\"type\":\"address[]\"},{\"internalType\":\"address[][]\",\"name\":\"assets\",\"type\":\"address[][]\"},{\"internalType\":\"bool[][]\",\"name\":\"values\",\"type\":\"bool[][]\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"minAmountToConvert\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pauseConversion\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pendingOwner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"poolRegistry\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"poolsAssetsDirectTransfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"priceOracle\",\"outputs\":[{\"internalType\":\"contract ResilientOracle\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"resumeConversion\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"accessControlManager_\",\"type\":\"address\"}],\"name\":\"setAccessControlManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"incentive\",\"type\":\"uint256\"},{\"internalType\":\"enum IAbstractTokenConverter.ConversionAccessibility\",\"name\":\"conversionAccess\",\"type\":\"uint8\"}],\"internalType\":\"struct IAbstractTokenConverter.ConversionConfig\",\"name\":\"conversionConfig\",\"type\":\"tuple\"}],\"name\":\"setConversionConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"tokenAddressesOut\",\"type\":\"address[]\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"incentive\",\"type\":\"uint256\"},{\"internalType\":\"enum IAbstractTokenConverter.ConversionAccessibility\",\"name\":\"conversionAccess\",\"type\":\"uint8\"}],\"internalType\":\"struct IAbstractTokenConverter.ConversionConfig[]\",\"name\":\"conversionConfigs\",\"type\":\"tuple[]\"}],\"name\":\"setConversionConfigs\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IConverterNetwork\",\"name\":\"converterNetwork_\",\"type\":\"address\"}],\"name\":\"setConverterNetwork\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"destinationAddress_\",\"type\":\"address\"}],\"name\":\"setDestination\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minAmountToConvert_\",\"type\":\"uint256\"}],\"name\":\"setMinAmountToConvert\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"poolRegistry_\",\"type\":\"address\"}],\"name\":\"setPoolRegistry\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"comptrollers\",\"type\":\"address[]\"},{\"internalType\":\"address[][]\",\"name\":\"assets\",\"type\":\"address[][]\"},{\"internalType\":\"bool[][]\",\"name\":\"values\",\"type\":\"bool[][]\"}],\"name\":\"setPoolsAssetsDirectTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ResilientOracle\",\"name\":\"priceOracle_\",\"type\":\"address\"}],\"name\":\"setPriceOracle\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"sweepToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"comptroller\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"}],\"name\":\"updateAssetsState\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Venus\",\"custom:security-contact\":\"https://github.com/VenusProtocol/protocol-reserve#discussion\",\"errors\":{\"ReentrancyGuardError()\":[{\"details\":\"This error is used to safeguard against reentrancy attacks, ensuring that a certain operation cannot be called recursively within the same transaction.\"}]},\"kind\":\"dev\",\"methods\":{\"acceptOwnership()\":{\"details\":\"The new owner accepts the ownership transfer.\"},\"balanceOf(address)\":{\"params\":{\"tokenAddress\":\"Address of the token\"},\"returns\":{\"tokenBalance\":\"Reserves of the token the contract has\"}},\"constructor\":{\"custom:oz-upgrades-unsafe-allow\":\"constructor\",\"params\":{\"corePoolComptroller_\":\"Address of the Comptroller pool\",\"nativeWrapped_\":\"Address of the wrapped native currency\",\"vBNB_\":\"Address of the vBNB\"}},\"convertExactTokens(uint256,uint256,address,address,address)\":{\"custom:error\":\"ZeroAddressNotAllowed is thrown when to address is zeroInvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOutAmountOutLowerThanMinRequired error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissaAmountInMismatched error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa\",\"custom:event\":\"Emits ConvertedExactTokens event on success\",\"details\":\"Method does not support deflationary tokens transfer\",\"params\":{\"amountInMantissa\":\"Amount of tokenAddressIn\",\"amountOutMinMantissa\":\"Min amount of tokenAddressOut required as output\",\"to\":\"Address of the tokenAddressOut receiver\",\"tokenAddressIn\":\"Address of the token to convert\",\"tokenAddressOut\":\"Address of the token to get after conversion\"},\"returns\":{\"actualAmountIn\":\"Actual amount transferred to destination\",\"actualAmountOut\":\"Actual amount transferred to user\"}},\"convertExactTokensSupportingFeeOnTransferTokens(uint256,uint256,address,address,address)\":{\"custom:error\":\"ZeroAddressNotAllowed is thrown when to address is zeroInvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOutAmountOutLowerThanMinRequired error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa\",\"custom:event\":\"Emits ConvertedExactTokensSupportingFeeOnTransferTokens event on success\",\"params\":{\"amountInMantissa\":\"Amount of tokenAddressIn\",\"amountOutMinMantissa\":\"Min amount of tokenAddressOut required as output\",\"to\":\"Address of the tokenAddressOut receiver\",\"tokenAddressIn\":\"Address of the token to convert\",\"tokenAddressOut\":\"Address of the token to get after conversion\"},\"returns\":{\"actualAmountIn\":\"Actual amount transferred to destination\",\"actualAmountOut\":\"Actual amount transferred to user\"}},\"convertForExactTokens(uint256,uint256,address,address,address)\":{\"custom:error\":\"ZeroAddressNotAllowed is thrown when to address is zeroInvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOutAmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissaAmountOutMismatched error is thrown when actualAmountOut is does not match amountOutMantissa\",\"custom:event\":\"Emits ConvertedForExactTokens event on success\",\"details\":\"Method does not support deflationary tokens transfer\",\"params\":{\"amountInMaxMantissa\":\"Max amount of tokenAddressIn\",\"amountOutMantissa\":\"Amount of tokenAddressOut required as output\",\"to\":\"Address of the tokenAddressOut receiver\",\"tokenAddressIn\":\"Address of the token to convert\",\"tokenAddressOut\":\"Address of the token to get after conversion\"},\"returns\":{\"actualAmountIn\":\"Actual amount transferred to destination\",\"actualAmountOut\":\"Actual amount transferred to user\"}},\"convertForExactTokensSupportingFeeOnTransferTokens(uint256,uint256,address,address,address)\":{\"custom:error\":\"ZeroAddressNotAllowed is thrown when to address is zeroInvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOutAmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissa\",\"custom:event\":\"Emits ConvertedForExactTokensSupportingFeeOnTransferTokens event on success\",\"params\":{\"amountInMaxMantissa\":\"Max amount of tokenAddressIn\",\"amountOutMantissa\":\"Amount of tokenAddressOut required as output\",\"to\":\"Address of the tokenAddressOut receiver\",\"tokenAddressIn\":\"Address of the token to convert\",\"tokenAddressOut\":\"Address of the token to get after conversion\"},\"returns\":{\"actualAmountIn\":\"Actual amount transferred to destination\",\"actualAmountOut\":\"Actual amount transferred to user\"}},\"getAmountIn(uint256,address,address)\":{\"custom:error\":\"InsufficientInputAmount error is thrown when given input amount is zeroConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pairConversionEnabledOnlyForPrivateConversions is thrown when conversion is only enabled for private conversion\",\"details\":\"This function retrieves values without altering token prices\",\"params\":{\"amountOutMantissa\":\"Amount of tokenAddressOut user wants to receive\",\"tokenAddressIn\":\"Address of the token to convert\",\"tokenAddressOut\":\"Address of the token to get after conversion\"},\"returns\":{\"amountConvertedMantissa\":\"Amount of tokenAddressOut should be transferred after conversion\",\"amountInMantissa\":\"Amount of the tokenAddressIn sender would send to contract before conversion\"}},\"getAmountOut(uint256,address,address)\":{\"custom:error\":\"InsufficientInputAmount error is thrown when given input amount is zeroConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pairConversionEnabledOnlyForPrivateConversions is thrown when conversion is only enabled for private conversion\",\"details\":\"This function retrieves values without altering token prices\",\"params\":{\"amountInMantissa\":\"Amount of tokenAddressIn\",\"tokenAddressIn\":\"Address of the token to convert\",\"tokenAddressOut\":\"Address of the token to get after conversion\"},\"returns\":{\"amountConvertedMantissa\":\"Amount of tokenAddressIn should be transferred after conversion\",\"amountOutMantissa\":\"Amount of the tokenAddressOut sender should receive after conversion\"}},\"getPoolAssetReserve(address,address)\":{\"custom:error\":\"MarketNotExistInPool When asset does not exist in the pool(comptroller)ReentrancyGuardError thrown to prevent reentrancy during the function execution\",\"details\":\"Get the Amount of the asset in the risk fund for the specific pool\",\"params\":{\"asset\":\"Asset address\",\"comptroller\":\"Comptroller address (pool)\"},\"returns\":{\"reserves\":\"Asset's reserve in risk fund\"}},\"getPools(address)\":{\"params\":{\"tokenAddress\":\"Address of the token\"},\"returns\":{\"poolsWithCore\":\"Array of the pools addresses in which token is available\"}},\"getUpdatedAmountIn(uint256,address,address)\":{\"custom:error\":\"InsufficientInputAmount error is thrown when given input amount is zeroConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\",\"params\":{\"amountOutMantissa\":\"Amount of tokenAddressOut user wants to receive\",\"tokenAddressIn\":\"Address of the token to convert\",\"tokenAddressOut\":\"Address of the token to get after conversion\"},\"returns\":{\"amountConvertedMantissa\":\"Amount of tokenAddressOut should be transferred after conversion\",\"amountInMantissa\":\"Amount of the tokenAddressIn sender would send to contract before conversion\"}},\"getUpdatedAmountOut(uint256,address,address)\":{\"custom:error\":\"InsufficientInputAmount error is thrown when given input amount is zeroConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\",\"params\":{\"amountInMantissa\":\"Amount of tokenAddressIn\",\"tokenAddressIn\":\"Address of the token to convert\",\"tokenAddressOut\":\"Address of the token to get after conversion\"},\"returns\":{\"amountConvertedMantissa\":\"Amount of tokenAddressIn should be transferred after conversion\",\"amountOutMantissa\":\"Amount of the tokenAddressOut sender should receive after conversion\"}},\"initialize(address,address,address,address,uint256,address[],address[][],bool[][])\":{\"custom:event\":\"PoolAssetsDirectTransferUpdated emits on success\",\"params\":{\"accessControlManager_\":\"Access control manager contract address\",\"assets\":\"Addresses of the assets need to be added for direct transfer\",\"comptrollers\":\"Addresses of the pools\",\"destinationAddress_\":\"Address at all incoming tokens will transferred to\",\"minAmountToConvert_\":\"minimum amount to convert\",\"poolRegistry_\":\"Address of the pool registry\",\"priceOracle_\":\"Resilient oracle address\",\"values\":\"Boolean value to indicate whether direct transfer is allowed for each asset.\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"pauseConversion()\":{\"custom:access\":\"Restricted by ACM\",\"custom:error\":\"ConversionTokensPaused thrown when conversion is already paused\",\"custom:event\":\"Emits ConversionPaused on success\"},\"pendingOwner()\":{\"details\":\"Returns the address of the pending owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.\"},\"resumeConversion()\":{\"custom:access\":\"Restricted by ACM\",\"custom:error\":\"ConversionTokensActive thrown when conversion is already active\",\"custom:event\":\"Emits ConversionResumed on success\"},\"setAccessControlManager(address)\":{\"custom:access\":\"Only Governance\",\"custom:event\":\"Emits NewAccessControlManager event\",\"details\":\"Admin function to set address of AccessControlManager\",\"params\":{\"accessControlManager_\":\"The new address of the AccessControlManager\"}},\"setConversionConfig(address,address,(uint256,uint8))\":{\"custom:access\":\"Controlled by AccessControlManager\",\"custom:error\":\"Unauthorized error is thrown when the call is not authorized by AccessControlManagerZeroAddressNotAllowed is thrown when pool registry address is zeroNonZeroIncentiveForPrivateConversion is thrown when incentive is non zero for private conversion\",\"custom:event\":\"Emits ConversionConfigUpdated event on success\",\"params\":{\"conversionConfig\":\"ConversionConfig config details to update\",\"tokenAddressIn\":\"Address of tokenIn\",\"tokenAddressOut\":\"Address of tokenOut\"}},\"setConversionConfigs(address,address[],(uint256,uint8)[])\":{\"custom:error\":\"InputLengthMisMatch is thrown when tokenAddressesOut and conversionConfigs array length mismatches\",\"params\":{\"conversionConfigs\":\"Array of conversionConfig config details to update\",\"tokenAddressIn\":\"Address of tokenIn\",\"tokenAddressesOut\":\"Array of addresses of tokenOut\"}},\"setConverterNetwork(address)\":{\"custom:access\":\"Only Governance\",\"params\":{\"converterNetwork_\":\"The converterNetwork address to be set\"}},\"setDestination(address)\":{\"custom:access\":\"Only Governance\",\"params\":{\"destinationAddress_\":\"The new destination address to be set\"}},\"setMinAmountToConvert(uint256)\":{\"custom:access\":\"Only Governance\",\"params\":{\"minAmountToConvert_\":\"Min amount to convert\"}},\"setPoolRegistry(address)\":{\"custom:access\":\"Only Governance\",\"custom:error\":\"ZeroAddressNotAllowed is thrown when pool registry address is zero\",\"custom:event\":\"PoolRegistryUpdated emits on success\",\"details\":\"Pool registry setter\",\"params\":{\"poolRegistry_\":\"Address of the pool registry\"}},\"setPoolsAssetsDirectTransfer(address[],address[][],bool[][])\":{\"custom:access\":\"Restricted by ACM\",\"custom:event\":\"PoolAssetsDirectTransferUpdated emits on success\",\"params\":{\"assets\":\"Addresses of the assets need to be added for direct transfer\",\"comptrollers\":\"Addresses of the pools\",\"values\":\"Boolean value to indicate whether direct transfer is allowed for each asset.\"}},\"setPriceOracle(address)\":{\"custom:access\":\"Only Governance\",\"params\":{\"priceOracle_\":\"Address of the new price oracle to set\"}},\"sweepToken(address,address,uint256)\":{\"custom:access\":\"Only Governance\",\"custom:error\":\"ZeroAddressNotAllowed is thrown when tokenAddress/to address is zero\",\"custom:event\":\"Emits SweepToken event on success\",\"params\":{\"amount\":\"The amount to transfer\",\"to\":\"The address to which tokens will be transferred\",\"tokenAddress\":\"The address of the ERC-20 token to sweep\"}},\"transferOwnership(address)\":{\"details\":\"Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. Can only be called by the current owner.\"},\"updateAssetsState(address,address)\":{\"details\":\"This function is called by protocolShareReservecall _updateAssetsState to update the states related to the comptroller and asset transfer to the specific converter then it calls the _privateConversion which will convert the asset into destination's base asset and transfer it to destination address\",\"params\":{\"asset\":\"Asset address\",\"comptroller\":\"Comptroller address (pool)\"}}},\"stateVariables\":{\"CORE_POOL_COMPTROLLER\":{\"custom:oz-upgrades-unsafe-allow\":\"state-variable-immutable\"},\"NATIVE_WRAPPED\":{\"custom:oz-upgrades-unsafe-allow\":\"state-variable-immutable\"},\"VBNB\":{\"custom:oz-upgrades-unsafe-allow\":\"state-variable-immutable\",\"details\":\"This address is used to include the BNB market while in getPools method\"},\"poolsAssetsDirectTransfer\":{\"details\":\"Comptroller(pool) -> Asset -> bool(should transfer directly on true)\"},\"poolsAssetsReserves\":{\"details\":\"Comptroller(pool) -> Asset -> amount\"}},\"title\":\"RiskFundConverter\",\"version\":1},\"userdoc\":{\"errors\":{\"AmountInHigherThanMax(uint256,uint256)\":[{\"notice\":\"Thrown when amountIn is higher than amountInMax\"}],\"AmountInMismatched()\":[{\"notice\":\"Thrown when actualAmountIn does not match with amountInMantissa for convertForExactTokens\"}],\"AmountOutLowerThanMinRequired(uint256,uint256)\":[{\"notice\":\"Thrown when amountOut is lower than amountOutMin\"}],\"AmountOutMismatched()\":[{\"notice\":\"Thrown when actualAmountOut does not match with amountOutMantissa for convertForExactTokens\"}],\"ConversionConfigNotEnabled()\":[{\"notice\":\"Thrown when conversion is disabled or config does not exist for given pair\"}],\"ConversionEnabledOnlyForPrivateConversions()\":[{\"notice\":\"Thrown when conversion is enabled only for private conversions\"}],\"ConversionTokensActive()\":[{\"notice\":\"Thrown when conversion is Active\"}],\"ConversionTokensPaused()\":[{\"notice\":\"Thrown when conversion is paused\"}],\"DeflationaryTokenNotSupported()\":[{\"notice\":\"Thrown when using convertForExactTokens deflationary tokens\"}],\"IncentiveTooHigh(uint256,uint256)\":[{\"notice\":\"Thrown when incentive is higher than the MAX_INCENTIVE\"}],\"InputLengthMisMatch()\":[{\"notice\":\"Thrown when there is a mismatch in the length of input arrays\"}],\"InsufficientBalance()\":[{\"notice\":\"thrown when amount entered is greater than balance\"}],\"InsufficientInputAmount()\":[{\"notice\":\"Thrown when given input amount is zero\"}],\"InsufficientOutputAmount()\":[{\"notice\":\"Thrown when given output amount is zero\"}],\"InsufficientPoolLiquidity()\":[{\"notice\":\"Thrown when contract has less liquidity for tokenAddressOut than amountOutMantissa\"}],\"InvalidConverterNetwork()\":[{\"notice\":\"When address of the ConverterNetwork is not set or Zero address\"}],\"InvalidMinimumAmountToConvert()\":[{\"notice\":\"Thrown when minimum amount to convert is zero\"}],\"InvalidToAddress()\":[{\"notice\":\"Thrown when address(to) is same as tokenAddressIn or tokenAddressOut\"}],\"InvalidTokenConfigAddresses()\":[{\"notice\":\"Thrown when tokenInAddress is same as tokeOutAdress OR tokeInAddress is not the base asset of the destination\"}],\"MarketNotExistInPool(address,address)\":[{\"notice\":\"thrown when asset does not exist in the pool\"}],\"NonZeroIncentiveForPrivateConversion()\":[{\"notice\":\"Thrown when trying to set non zero incentive for private conversion\"}],\"ReentrancyGuardError()\":[{\"notice\":\"thrown to prevent reentrancy\"}],\"Unauthorized(address,address,string)\":[{\"notice\":\"Thrown when the action is prohibited by AccessControlManager\"}],\"ZeroAddressNotAllowed()\":[{\"notice\":\"Thrown if the supplied address is a zero address where it is not allowed\"}],\"ZeroValueNotAllowed()\":[{\"notice\":\"Thrown if the supplied value is 0 where it is not allowed\"}]},\"events\":{\"AssetTransferredToDestination(address,address,address,uint256)\":{\"notice\":\"Emmitted after the funds transferred to the destination address\"},\"AssetsReservesUpdated(address,address,uint256)\":{\"notice\":\"Emitted after updating of the assets reserves amount -> reserve increased by amount\"},\"ConversionConfigUpdated(address,address,uint256,uint256,uint8,uint8)\":{\"notice\":\"Emitted when config is updated for tokens pair\"},\"ConversionPaused(address)\":{\"notice\":\"Emitted when conversion is paused\"},\"ConversionResumed(address)\":{\"notice\":\"Emitted when conversion is unpaused\"},\"ConvertedExactTokens(address,address,address,address,uint256,uint256)\":{\"notice\":\"Emitted when exact amount of tokens are converted for tokens\"},\"ConvertedExactTokensSupportingFeeOnTransferTokens(address,address,address,address,uint256,uint256)\":{\"notice\":\"Emitted when exact amount of tokens are converted for tokens, for deflationary tokens\"},\"ConvertedForExactTokens(address,address,address,address,uint256,uint256)\":{\"notice\":\"Emitted when tokens are converted for exact amount of tokens\"},\"ConvertedForExactTokensSupportingFeeOnTransferTokens(address,address,address,address,uint256,uint256)\":{\"notice\":\"Emitted when tokens are converted for exact amount of tokens, for deflationary tokens\"},\"ConverterNetworkAddressUpdated(address,address)\":{\"notice\":\"Emitted when converterNetwork address is updated\"},\"DestinationAddressUpdated(address,address)\":{\"notice\":\"Emitted when destination address is updated\"},\"MinAmountToConvertUpdated(uint256,uint256)\":{\"notice\":\"Emitted when minimum amount to convert is updated\"},\"NewAccessControlManager(address,address)\":{\"notice\":\"Emitted when access control manager contract address is changed\"},\"PoolAssetsDirectTransferUpdated(address,address,bool)\":{\"notice\":\"Emitted after the poolsAssetsDirectTransfer mapping is updated\"},\"PoolRegistryUpdated(address,address)\":{\"notice\":\"Emitted when pool registry address is updated\"},\"PriceOracleUpdated(address,address)\":{\"notice\":\"Emitted when price oracle address is updated\"},\"SweepToken(address,address,uint256)\":{\"notice\":\"Event emitted when tokens are swept\"}},\"kind\":\"user\",\"methods\":{\"CORE_POOL_COMPTROLLER()\":{\"notice\":\"Address of the core pool comptroller\"},\"MAX_INCENTIVE()\":{\"notice\":\"Maximum incentive could be\"},\"NATIVE_WRAPPED()\":{\"notice\":\"Address of the native wrapped currency\"},\"VBNB()\":{\"notice\":\"Address of the vBNB\"},\"accessControlManager()\":{\"notice\":\"Returns the address of the access control manager contract\"},\"balanceOf(address)\":{\"notice\":\"Get the balance for specific token\"},\"conversionConfigurations(address,address)\":{\"notice\":\"conversion configurations for the existing pairs\"},\"conversionPaused()\":{\"notice\":\"Boolean for if conversion is paused\"},\"convertExactTokens(uint256,uint256,address,address,address)\":{\"notice\":\"Converts exact amount of tokenAddressIn for tokenAddressOut if there is enough tokens held by the contract\"},\"convertExactTokensSupportingFeeOnTransferTokens(uint256,uint256,address,address,address)\":{\"notice\":\"Converts exact amount of tokenAddressIn for tokenAddressOut if there is enough tokens held by the contract\"},\"convertForExactTokens(uint256,uint256,address,address,address)\":{\"notice\":\"Converts tokens for tokenAddressIn for exact amount of tokenAddressOut if there is enough tokens held by the contract, otherwise the amount is adjusted\"},\"convertForExactTokensSupportingFeeOnTransferTokens(uint256,uint256,address,address,address)\":{\"notice\":\"Converts tokens for tokenAddressIn for amount of tokenAddressOut calculated on the basis of amount of tokenAddressIn received by the contract, if there is enough tokens held by the contract, otherwise the amount is adjusted. The user will be responsible for bearing any fees associated with token transfers, whether pulling in or pushing out tokens\"},\"converterNetwork()\":{\"notice\":\"Address of the converterNetwork contract\"},\"destinationAddress()\":{\"notice\":\"Address that all incoming tokens are transferred to\"},\"getAmountIn(uint256,address,address)\":{\"notice\":\"To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut. This function does not account for potential token transfer fees(in case of deflationary tokens)\"},\"getAmountOut(uint256,address,address)\":{\"notice\":\"To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn. This function does not account for potential token transfer fees(in case of deflationary tokens)\"},\"getPools(address)\":{\"notice\":\"Get the array of all pools addresses\"},\"getUpdatedAmountIn(uint256,address,address)\":{\"notice\":\"To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut\"},\"getUpdatedAmountOut(uint256,address,address)\":{\"notice\":\"To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn\"},\"minAmountToConvert()\":{\"notice\":\"Min amount to convert for private conversions. Defined in USD, with 18 decimals\"},\"pauseConversion()\":{\"notice\":\"Pause conversion of tokens\"},\"poolRegistry()\":{\"notice\":\"Address of pool registry contract\"},\"poolsAssetsDirectTransfer(address,address)\":{\"notice\":\"The mapping contains the assets for each pool which are sent to RiskFund directly\"},\"priceOracle()\":{\"notice\":\"Venus price oracle contract\"},\"resumeConversion()\":{\"notice\":\"Resume conversion of tokens.\"},\"setAccessControlManager(address)\":{\"notice\":\"Sets the address of AccessControlManager\"},\"setConversionConfig(address,address,(uint256,uint8))\":{\"notice\":\"Set the configuration for new or existing conversion pair\"},\"setConversionConfigs(address,address[],(uint256,uint8)[])\":{\"notice\":\"Batch sets the conversion configurations\"},\"setConverterNetwork(address)\":{\"notice\":\"Sets a converter network contract address\"},\"setDestination(address)\":{\"notice\":\"Sets a new destination address\"},\"setMinAmountToConvert(uint256)\":{\"notice\":\"Min amount to convert setter\"},\"setPoolsAssetsDirectTransfer(address[],address[][],bool[][])\":{\"notice\":\"Update the poolsAssetsDirectTransfer mapping\"},\"setPriceOracle(address)\":{\"notice\":\"Sets a new price oracle\"},\"sweepToken(address,address,uint256)\":{\"notice\":\"To sweep ERC20 tokens and transfer them to user(to address)\"},\"updateAssetsState(address,address)\":{\"notice\":\"This method updated the states of this contract after getting funds from PSR after settling the amount(if any) through privateConversion between converters\"}},\"notice\":\"RiskFundConverter used for token conversions and sends received token to RiskFund\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/TokenConverter/RiskFundConverter.sol\":\"RiskFundConverter\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable2Step.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./OwnableUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership} and {acceptOwnership}.\\n *\\n * This module is used through inheritance. It will make available all functions\\n * from parent (Ownable).\\n */\\nabstract contract Ownable2StepUpgradeable is Initializable, OwnableUpgradeable {\\n function __Ownable2Step_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable2Step_init_unchained() internal onlyInitializing {\\n }\\n address private _pendingOwner;\\n\\n event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Returns the address of the pending owner.\\n */\\n function pendingOwner() public view virtual returns (address) {\\n return _pendingOwner;\\n }\\n\\n /**\\n * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual override onlyOwner {\\n _pendingOwner = newOwner;\\n emit OwnershipTransferStarted(owner(), newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual override {\\n delete _pendingOwner;\\n super._transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev The new owner accepts the ownership transfer.\\n */\\n function acceptOwnership() public virtual {\\n address sender = _msgSender();\\n require(pendingOwner() == sender, \\\"Ownable2Step: caller is not the new owner\\\");\\n _transferOwnership(sender);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x84efb8889801b0ac817324aff6acc691d07bbee816b671817132911d287a8c63\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function __Ownable_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable_init_unchained() internal onlyInitializing {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby disabling any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x4075622496acc77fd6d4de4cc30a8577a744d5c75afad33fdeacf1704d6eda98\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```solidity\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n *\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized != type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0x89be10e757d242e9b18d5a32c9fbe2019f6d63052bbe46397a430a1d60d7f794\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which allows children to implement an emergency stop\\n * mechanism that can be triggered by an authorized account.\\n *\\n * This module is used through inheritance. It will make available the\\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\\n * the functions of your contract. Note that they will not be pausable by\\n * simply including this module, only once the modifiers are put in place.\\n */\\nabstract contract PausableUpgradeable is Initializable, ContextUpgradeable {\\n /**\\n * @dev Emitted when the pause is triggered by `account`.\\n */\\n event Paused(address account);\\n\\n /**\\n * @dev Emitted when the pause is lifted by `account`.\\n */\\n event Unpaused(address account);\\n\\n bool private _paused;\\n\\n /**\\n * @dev Initializes the contract in unpaused state.\\n */\\n function __Pausable_init() internal onlyInitializing {\\n __Pausable_init_unchained();\\n }\\n\\n function __Pausable_init_unchained() internal onlyInitializing {\\n _paused = false;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is not paused.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n modifier whenNotPaused() {\\n _requireNotPaused();\\n _;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is paused.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n modifier whenPaused() {\\n _requirePaused();\\n _;\\n }\\n\\n /**\\n * @dev Returns true if the contract is paused, and false otherwise.\\n */\\n function paused() public view virtual returns (bool) {\\n return _paused;\\n }\\n\\n /**\\n * @dev Throws if the contract is paused.\\n */\\n function _requireNotPaused() internal view virtual {\\n require(!paused(), \\\"Pausable: paused\\\");\\n }\\n\\n /**\\n * @dev Throws if the contract is not paused.\\n */\\n function _requirePaused() internal view virtual {\\n require(paused(), \\\"Pausable: not paused\\\");\\n }\\n\\n /**\\n * @dev Triggers stopped state.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n function _pause() internal virtual whenNotPaused {\\n _paused = true;\\n emit Paused(_msgSender());\\n }\\n\\n /**\\n * @dev Returns to normal state.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n function _unpause() internal virtual whenPaused {\\n _paused = false;\\n emit Unpaused(_msgSender());\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x40c636b4572ff5f1dc50cf22097e93c0723ee14eff87e99ac2b02636eeca1250\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module that helps prevent reentrant calls to a function.\\n *\\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\\n * available, which can be applied to functions to make sure there are no nested\\n * (reentrant) calls to them.\\n *\\n * Note that because there is a single `nonReentrant` guard, functions marked as\\n * `nonReentrant` may not call one another. This can be worked around by making\\n * those functions `private`, and then adding `external` `nonReentrant` entry\\n * points to them.\\n *\\n * TIP: If you would like to learn more about reentrancy and alternative ways\\n * to protect against it, check out our blog post\\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\\n */\\nabstract contract ReentrancyGuardUpgradeable is Initializable {\\n // Booleans are more expensive than uint256 or any type that takes up a full\\n // word because each write operation emits an extra SLOAD to first read the\\n // slot's contents, replace the bits taken up by the boolean, and then write\\n // back. This is the compiler's defense against contract upgrades and\\n // pointer aliasing, and it cannot be disabled.\\n\\n // The values being non-zero value makes deployment a bit more expensive,\\n // but in exchange the refund on every call to nonReentrant will be lower in\\n // amount. Since refunds are capped to a percentage of the total\\n // transaction's gas, it is best to keep them low in cases like this one, to\\n // increase the likelihood of the full refund coming into effect.\\n uint256 private constant _NOT_ENTERED = 1;\\n uint256 private constant _ENTERED = 2;\\n\\n uint256 private _status;\\n\\n function __ReentrancyGuard_init() internal onlyInitializing {\\n __ReentrancyGuard_init_unchained();\\n }\\n\\n function __ReentrancyGuard_init_unchained() internal onlyInitializing {\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Prevents a contract from calling itself, directly or indirectly.\\n * Calling a `nonReentrant` function from another `nonReentrant`\\n * function is not supported. It is possible to prevent this from happening\\n * by making the `nonReentrant` function external, and making it call a\\n * `private` function that does the actual work.\\n */\\n modifier nonReentrant() {\\n _nonReentrantBefore();\\n _;\\n _nonReentrantAfter();\\n }\\n\\n function _nonReentrantBefore() private {\\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\\n require(_status != _ENTERED, \\\"ReentrancyGuard: reentrant call\\\");\\n\\n // Any calls to nonReentrant after this point will fail\\n _status = _ENTERED;\\n }\\n\\n function _nonReentrantAfter() private {\\n // By storing the original value once again, a refund is triggered (see\\n // https://eips.ethereum.org/EIPS/eip-2200)\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Returns true if the reentrancy guard is currently set to \\\"entered\\\", which indicates there is a\\n * `nonReentrant` function in the call stack.\\n */\\n function _reentrancyGuardEntered() internal view returns (bool) {\\n return _status == _ENTERED;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0xb82ef33f43b6b96109687d91b39c94573fdccaaa423fe28e8ba0977b31c023e0\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20Upgradeable {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x0e1f0f5f62f67a881cd1a9597acbc0a5e4071f3c2c10449a183b922ae7272e3f\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20PermitUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\\n *\\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\\n * need to send a transaction, and thus is not required to hold Ether at all.\\n */\\ninterface IERC20PermitUpgradeable {\\n /**\\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\\n * given ``owner``'s signed approval.\\n *\\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\\n * ordering also apply here.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `deadline` must be a timestamp in the future.\\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\\n * over the EIP712-formatted function arguments.\\n * - the signature must use ``owner``'s current nonce (see {nonces}).\\n *\\n * For more information on the signature format, see the\\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\\n * section].\\n */\\n function permit(\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external;\\n\\n /**\\n * @dev Returns the current nonce for `owner`. This value must be\\n * included whenever a signature is generated for {permit}.\\n *\\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\\n * prevents a signature from being used multiple times.\\n */\\n function nonces(address owner) external view returns (uint256);\\n\\n /**\\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0xd60f939a3ca0199014d079b4dd66aa757954334947d81eb5c1d35d7a83061ab3\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20Upgradeable.sol\\\";\\nimport \\\"../extensions/IERC20PermitUpgradeable.sol\\\";\\nimport \\\"../../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20Upgradeable {\\n using AddressUpgradeable for address;\\n\\n /**\\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeTransfer(IERC20Upgradeable token, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n /**\\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\\n */\\n function safeTransferFrom(IERC20Upgradeable token, address from, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\\n }\\n\\n /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\n */\\n function safeApprove(IERC20Upgradeable token, address spender, uint256 value) internal {\\n // safeApprove should only be called when setting an initial allowance,\\n // or when resetting it to zero. To increase and decrease it, use\\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\\n require(\\n (value == 0) || (token.allowance(address(this), spender) == 0),\\n \\\"SafeERC20: approve from non-zero to non-zero allowance\\\"\\n );\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\\n }\\n\\n /**\\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeIncreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));\\n }\\n\\n /**\\n * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeDecreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {\\n unchecked {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n require(oldAllowance >= value, \\\"SafeERC20: decreased allowance below zero\\\");\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));\\n }\\n }\\n\\n /**\\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\\n * to be set to zero before setting it to a non-zero value, such as USDT.\\n */\\n function forceApprove(IERC20Upgradeable token, address spender, uint256 value) internal {\\n bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);\\n\\n if (!_callOptionalReturnBool(token, approvalCall)) {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));\\n _callOptionalReturn(token, approvalCall);\\n }\\n }\\n\\n /**\\n * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.\\n * Revert on invalid signature.\\n */\\n function safePermit(\\n IERC20PermitUpgradeable token,\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal {\\n uint256 nonceBefore = token.nonces(owner);\\n token.permit(owner, spender, value, deadline, v, r, s);\\n uint256 nonceAfter = token.nonces(owner);\\n require(nonceAfter == nonceBefore + 1, \\\"SafeERC20: permit did not succeed\\\");\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20Upgradeable token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\n require(returndata.length == 0 || abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n *\\n * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\\n */\\n function _callOptionalReturnBool(IERC20Upgradeable token, bytes memory data) private returns (bool) {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\\n // and not revert is the subcall reverts.\\n\\n (bool success, bytes memory returndata) = address(token).call(data);\\n return\\n success && (returndata.length == 0 || abi.decode(returndata, (bool))) && AddressUpgradeable.isContract(address(token));\\n }\\n}\\n\",\"keccak256\":\"0x23b997be73d3dd46885262704f0f8cfc7273fdadfe303d37969a9561373972b5\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary AddressUpgradeable {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n *\\n * Furthermore, `isContract` will also return true if the target contract within\\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\\n * which only has an effect at the end of a transaction.\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x9c80f545915582e63fe206c6ce27cbe85a86fc10b9cd2a0e8c9488fb7c2ee422\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract ContextUpgradeable is Initializable {\\n function __Context_init() internal onlyInitializing {\\n }\\n\\n function __Context_init_unchained() internal onlyInitializing {\\n }\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/IAccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev External interface of AccessControl declared to support ERC165 detection.\\n */\\ninterface IAccessControl {\\n /**\\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\\n *\\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\\n * {RoleAdminChanged} not being emitted signaling this.\\n *\\n * _Available since v3.1._\\n */\\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\\n\\n /**\\n * @dev Emitted when `account` is granted `role`.\\n *\\n * `sender` is the account that originated the contract call, an admin role\\n * bearer except when using {AccessControl-_setupRole}.\\n */\\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Emitted when `account` is revoked `role`.\\n *\\n * `sender` is the account that originated the contract call:\\n * - if using `revokeRole`, it is the admin role bearer\\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\\n */\\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) external view returns (bool);\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function grantRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function revokeRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been granted `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n */\\n function renounceRole(bytes32 role, address account) external;\\n}\\n\",\"keccak256\":\"0x59ce320a585d7e1f163cd70390a0ef2ff9cec832e2aa544293a00692465a7a57\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x8de418a5503946cabe331f35fe242d3201a73f67f77aaeb7110acb1f30423aca\",\"license\":\"MIT\"},\"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol\\\";\\n\\nimport \\\"./IAccessControlManagerV8.sol\\\";\\n\\n/**\\n * @title AccessControlledV8\\n * @author Venus\\n * @notice This contract is helper between access control manager and actual contract. This contract further inherited by other contract (using solidity 0.8.13)\\n * to integrate access controlled mechanism. It provides initialise methods and verifying access methods.\\n */\\nabstract contract AccessControlledV8 is Initializable, Ownable2StepUpgradeable {\\n /// @notice Access control manager contract\\n IAccessControlManagerV8 private _accessControlManager;\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n\\n /// @notice Emitted when access control manager contract address is changed\\n event NewAccessControlManager(address oldAccessControlManager, address newAccessControlManager);\\n\\n /// @notice Thrown when the action is prohibited by AccessControlManager\\n error Unauthorized(address sender, address calledContract, string methodSignature);\\n\\n function __AccessControlled_init(address accessControlManager_) internal onlyInitializing {\\n __Ownable2Step_init();\\n __AccessControlled_init_unchained(accessControlManager_);\\n }\\n\\n function __AccessControlled_init_unchained(address accessControlManager_) internal onlyInitializing {\\n _setAccessControlManager(accessControlManager_);\\n }\\n\\n /**\\n * @notice Sets the address of AccessControlManager\\n * @dev Admin function to set address of AccessControlManager\\n * @param accessControlManager_ The new address of the AccessControlManager\\n * @custom:event Emits NewAccessControlManager event\\n * @custom:access Only Governance\\n */\\n function setAccessControlManager(address accessControlManager_) external onlyOwner {\\n _setAccessControlManager(accessControlManager_);\\n }\\n\\n /**\\n * @notice Returns the address of the access control manager contract\\n */\\n function accessControlManager() external view returns (IAccessControlManagerV8) {\\n return _accessControlManager;\\n }\\n\\n /**\\n * @dev Internal function to set address of AccessControlManager\\n * @param accessControlManager_ The new address of the AccessControlManager\\n */\\n function _setAccessControlManager(address accessControlManager_) internal {\\n require(address(accessControlManager_) != address(0), \\\"invalid acess control manager address\\\");\\n address oldAccessControlManager = address(_accessControlManager);\\n _accessControlManager = IAccessControlManagerV8(accessControlManager_);\\n emit NewAccessControlManager(oldAccessControlManager, accessControlManager_);\\n }\\n\\n /**\\n * @notice Reverts if the call is not allowed by AccessControlManager\\n * @param signature Method signature\\n */\\n function _checkAccessAllowed(string memory signature) internal view {\\n bool isAllowedToCall = _accessControlManager.isAllowedToCall(msg.sender, signature);\\n\\n if (!isAllowedToCall) {\\n revert Unauthorized(msg.sender, address(this), signature);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x1b805a5d09990e2c4f7839afe7726a02f8452261eb3d0d488e24129ec0a7736d\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/governance-contracts/contracts/Governance/IAccessControlManagerV8.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\nimport \\\"@openzeppelin/contracts/access/IAccessControl.sol\\\";\\n\\n/**\\n * @title IAccessControlManagerV8\\n * @author Venus\\n * @notice Interface implemented by the `AccessControlManagerV8` contract.\\n */\\ninterface IAccessControlManagerV8 is IAccessControl {\\n function giveCallPermission(address contractAddress, string calldata functionSig, address accountToPermit) external;\\n\\n function revokeCallPermission(\\n address contractAddress,\\n string calldata functionSig,\\n address accountToRevoke\\n ) external;\\n\\n function isAllowedToCall(address account, string calldata functionSig) external view returns (bool);\\n\\n function hasPermission(\\n address account,\\n address contractAddress,\\n string calldata functionSig\\n ) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x8adbe291d659987faf4de606736227ad9d8e1a0e284a33a6ca12b30ab2a504b2\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/oracle/contracts/ResilientOracle.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\n// SPDX-FileCopyrightText: 2022 Venus\\npragma solidity 0.8.13;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol\\\";\\nimport \\\"./interfaces/VBep20Interface.sol\\\";\\nimport \\\"./interfaces/OracleInterface.sol\\\";\\nimport \\\"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\\\";\\n\\n/**\\n * @title ResilientOracle\\n * @author Venus\\n * @notice The Resilient Oracle is the main contract that the protocol uses to fetch prices of assets.\\n * \\n * DeFi protocols are vulnerable to price oracle failures including oracle manipulation and incorrectly\\n * reported prices. If only one oracle is used, this creates a single point of failure and opens a vector\\n * for attacking the protocol.\\n * \\n * The Resilient Oracle uses multiple sources and fallback mechanisms to provide accurate prices and protect\\n * the protocol from oracle attacks. Currently it includes integrations with Chainlink, Pyth, Binance Oracle\\n * and TWAP (Time-Weighted Average Price) oracles. TWAP uses PancakeSwap as the on-chain price source.\\n * \\n * For every market (vToken) we configure the main, pivot and fallback oracles. The oracles are configured per \\n * vToken's underlying asset address. The main oracle oracle is the most trustworthy price source, the pivot \\n * oracle is used as a loose sanity checker and the fallback oracle is used as a backup price source. \\n * \\n * To validate prices returned from two oracles, we use an upper and lower bound ratio that is set for every\\n * market. The upper bound ratio represents the deviation between reported price (the price that\\u2019s being\\n * validated) and the anchor price (the price we are validating against) above which the reported price will\\n * be invalidated. The lower bound ratio presents the deviation between reported price and anchor price below\\n * which the reported price will be invalidated. So for oracle price to be considered valid the below statement\\n * should be true:\\n\\n```\\nanchorRatio = anchorPrice/reporterPrice\\nisValid = anchorRatio <= upperBoundAnchorRatio && anchorRatio >= lowerBoundAnchorRatio\\n```\\n\\n * In most cases, Chainlink is used as the main oracle, TWAP or Pyth oracles are used as the pivot oracle depending\\n * on which supports the given market and Binance oracle is used as the fallback oracle. For some markets we may\\n * use Pyth or TWAP as the main oracle if the token price is not supported by Chainlink or Binance oracles. \\n * \\n * For a fetched price to be valid it must be positive and not stagnant. If the price is invalid then we consider the\\n * oracle to be stagnant and treat it like it's disabled.\\n */\\ncontract ResilientOracle is PausableUpgradeable, AccessControlledV8, ResilientOracleInterface {\\n /**\\n * @dev Oracle roles:\\n * **main**: The most trustworthy price source\\n * **pivot**: Price oracle used as a loose sanity checker\\n * **fallback**: The backup source when main oracle price is invalidated\\n */\\n enum OracleRole {\\n MAIN,\\n PIVOT,\\n FALLBACK\\n }\\n\\n struct TokenConfig {\\n /// @notice asset address\\n address asset;\\n /// @notice `oracles` stores the oracles based on their role in the following order:\\n /// [main, pivot, fallback],\\n /// It can be indexed with the corresponding enum OracleRole value\\n address[3] oracles;\\n /// @notice `enableFlagsForOracles` stores the enabled state\\n /// for each oracle in the same order as `oracles`\\n bool[3] enableFlagsForOracles;\\n }\\n\\n uint256 public constant INVALID_PRICE = 0;\\n\\n /// @notice Native market address\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address public immutable nativeMarket;\\n\\n /// @notice VAI address\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address public immutable vai;\\n\\n /// @notice Set this as asset address for Native token on each chain.This is the underlying for vBNB (on bsc)\\n /// and can serve as any underlying asset of a market that supports native tokens\\n address public constant NATIVE_TOKEN_ADDR = 0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB;\\n\\n /// @notice Bound validator contract address\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n BoundValidatorInterface public immutable boundValidator;\\n\\n mapping(address => TokenConfig) private tokenConfigs;\\n\\n event TokenConfigAdded(\\n address indexed asset,\\n address indexed mainOracle,\\n address indexed pivotOracle,\\n address fallbackOracle\\n );\\n\\n /// Event emitted when an oracle is set\\n event OracleSet(address indexed asset, address indexed oracle, uint256 indexed role);\\n\\n /// Event emitted when an oracle is enabled or disabled\\n event OracleEnabled(address indexed asset, uint256 indexed role, bool indexed enable);\\n\\n /**\\n * @notice Checks whether an address is null or not\\n */\\n modifier notNullAddress(address someone) {\\n if (someone == address(0)) revert(\\\"can't be zero address\\\");\\n _;\\n }\\n\\n /**\\n * @notice Checks whether token config exists by checking whether asset is null address\\n * @dev address can't be null, so it's suitable to be used to check the validity of the config\\n * @param asset asset address\\n */\\n modifier checkTokenConfigExistence(address asset) {\\n if (tokenConfigs[asset].asset == address(0)) revert(\\\"token config must exist\\\");\\n _;\\n }\\n\\n /// @notice Constructor for the implementation contract. Sets immutable variables.\\n /// @dev nativeMarketAddress can be address(0) if on the chain we do not support native market\\n /// (e.g vETH on ethereum would not be supported, only vWETH)\\n /// @param nativeMarketAddress The address of a native market (for bsc it would be vBNB address)\\n /// @param vaiAddress The address of the VAI token (if there is VAI on the deployed chain).\\n /// Set to address(0) of VAI is not existent.\\n /// @param _boundValidator Address of the bound validator contract\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(\\n address nativeMarketAddress,\\n address vaiAddress,\\n BoundValidatorInterface _boundValidator\\n ) notNullAddress(address(_boundValidator)) {\\n nativeMarket = nativeMarketAddress;\\n vai = vaiAddress;\\n boundValidator = _boundValidator;\\n\\n _disableInitializers();\\n }\\n\\n /**\\n * @notice Initializes the contract admin and sets the BoundValidator contract address\\n * @param accessControlManager_ Address of the access control manager contract\\n */\\n function initialize(address accessControlManager_) external initializer {\\n __AccessControlled_init(accessControlManager_);\\n __Pausable_init();\\n }\\n\\n /**\\n * @notice Pauses oracle\\n * @custom:access Only Governance\\n */\\n function pause() external {\\n _checkAccessAllowed(\\\"pause()\\\");\\n _pause();\\n }\\n\\n /**\\n * @notice Unpauses oracle\\n * @custom:access Only Governance\\n */\\n function unpause() external {\\n _checkAccessAllowed(\\\"unpause()\\\");\\n _unpause();\\n }\\n\\n /**\\n * @notice Batch sets token configs\\n * @param tokenConfigs_ Token config array\\n * @custom:access Only Governance\\n * @custom:error Throws a length error if the length of the token configs array is 0\\n */\\n function setTokenConfigs(TokenConfig[] memory tokenConfigs_) external {\\n if (tokenConfigs_.length == 0) revert(\\\"length can't be 0\\\");\\n uint256 numTokenConfigs = tokenConfigs_.length;\\n for (uint256 i; i < numTokenConfigs; ) {\\n setTokenConfig(tokenConfigs_[i]);\\n unchecked {\\n ++i;\\n }\\n }\\n }\\n\\n /**\\n * @notice Sets oracle for a given asset and role.\\n * @dev Supplied asset **must** exist and main oracle may not be null\\n * @param asset Asset address\\n * @param oracle Oracle address\\n * @param role Oracle role\\n * @custom:access Only Governance\\n * @custom:error Null address error if main-role oracle address is null\\n * @custom:error NotNullAddress error is thrown if asset address is null\\n * @custom:error TokenConfigExistance error is thrown if token config is not set\\n * @custom:event Emits OracleSet event with asset address, oracle address and role of the oracle for the asset\\n */\\n function setOracle(\\n address asset,\\n address oracle,\\n OracleRole role\\n ) external notNullAddress(asset) checkTokenConfigExistence(asset) {\\n _checkAccessAllowed(\\\"setOracle(address,address,uint8)\\\");\\n if (oracle == address(0) && role == OracleRole.MAIN) revert(\\\"can't set zero address to main oracle\\\");\\n tokenConfigs[asset].oracles[uint256(role)] = oracle;\\n emit OracleSet(asset, oracle, uint256(role));\\n }\\n\\n /**\\n * @notice Enables/ disables oracle for the input asset. Token config for the input asset **must** exist\\n * @dev Configuration for the asset **must** already exist and the asset cannot be 0 address\\n * @param asset Asset address\\n * @param role Oracle role\\n * @param enable Enabled boolean of the oracle\\n * @custom:access Only Governance\\n * @custom:error NotNullAddress error is thrown if asset address is null\\n * @custom:error TokenConfigExistance error is thrown if token config is not set\\n */\\n function enableOracle(\\n address asset,\\n OracleRole role,\\n bool enable\\n ) external notNullAddress(asset) checkTokenConfigExistence(asset) {\\n _checkAccessAllowed(\\\"enableOracle(address,uint8,bool)\\\");\\n tokenConfigs[asset].enableFlagsForOracles[uint256(role)] = enable;\\n emit OracleEnabled(asset, uint256(role), enable);\\n }\\n\\n /**\\n * @notice Updates the TWAP pivot oracle price.\\n * @dev This function should always be called before calling getUnderlyingPrice\\n * @param vToken vToken address\\n */\\n function updatePrice(address vToken) external override {\\n address asset = _getUnderlyingAsset(vToken);\\n (address pivotOracle, bool pivotOracleEnabled) = getOracle(asset, OracleRole.PIVOT);\\n if (pivotOracle != address(0) && pivotOracleEnabled) {\\n //if pivot oracle is not TwapOracle it will revert so we need to catch the revert\\n try TwapInterface(pivotOracle).updateTwap(asset) {} catch {}\\n }\\n }\\n\\n /**\\n * @notice Updates the pivot oracle price. Currently using TWAP\\n * @dev This function should always be called before calling getPrice\\n * @param asset asset address\\n */\\n function updateAssetPrice(address asset) external {\\n (address pivotOracle, bool pivotOracleEnabled) = getOracle(asset, OracleRole.PIVOT);\\n if (pivotOracle != address(0) && pivotOracleEnabled) {\\n //if pivot oracle is not TwapOracle it will revert so we need to catch the revert\\n try TwapInterface(pivotOracle).updateTwap(asset) {} catch {}\\n }\\n }\\n\\n /**\\n * @dev Gets token config by asset address\\n * @param asset asset address\\n * @return tokenConfig Config for the asset\\n */\\n function getTokenConfig(address asset) external view returns (TokenConfig memory) {\\n return tokenConfigs[asset];\\n }\\n\\n /**\\n * @notice Gets price of the underlying asset for a given vToken. Validation flow:\\n * - Check if the oracle is paused globally\\n * - Validate price from main oracle against pivot oracle\\n * - Validate price from fallback oracle against pivot oracle if the first validation failed\\n * - Validate price from main oracle against fallback oracle if the second validation failed\\n * In the case that the pivot oracle is not available but main price is available and validation is successful,\\n * main oracle price is returned.\\n * @param vToken vToken address\\n * @return price USD price in scaled decimal places.\\n * @custom:error Paused error is thrown when resilent oracle is paused\\n * @custom:error Invalid resilient oracle price error is thrown if fetched prices from oracle is invalid\\n */\\n function getUnderlyingPrice(address vToken) external view override returns (uint256) {\\n if (paused()) revert(\\\"resilient oracle is paused\\\");\\n\\n address asset = _getUnderlyingAsset(vToken);\\n return _getPrice(asset);\\n }\\n\\n /**\\n * @notice Gets price of the asset\\n * @param asset asset address\\n * @return price USD price in scaled decimal places.\\n * @custom:error Paused error is thrown when resilent oracle is paused\\n * @custom:error Invalid resilient oracle price error is thrown if fetched prices from oracle is invalid\\n */\\n function getPrice(address asset) external view override returns (uint256) {\\n if (paused()) revert(\\\"resilient oracle is paused\\\");\\n return _getPrice(asset);\\n }\\n\\n /**\\n * @notice Sets/resets single token configs.\\n * @dev main oracle **must not** be a null address\\n * @param tokenConfig Token config struct\\n * @custom:access Only Governance\\n * @custom:error NotNullAddress is thrown if asset address is null\\n * @custom:error NotNullAddress is thrown if main-role oracle address for asset is null\\n * @custom:event Emits TokenConfigAdded event when the asset config is set successfully by the authorized account\\n */\\n function setTokenConfig(\\n TokenConfig memory tokenConfig\\n ) public notNullAddress(tokenConfig.asset) notNullAddress(tokenConfig.oracles[uint256(OracleRole.MAIN)]) {\\n _checkAccessAllowed(\\\"setTokenConfig(TokenConfig)\\\");\\n\\n tokenConfigs[tokenConfig.asset] = tokenConfig;\\n emit TokenConfigAdded(\\n tokenConfig.asset,\\n tokenConfig.oracles[uint256(OracleRole.MAIN)],\\n tokenConfig.oracles[uint256(OracleRole.PIVOT)],\\n tokenConfig.oracles[uint256(OracleRole.FALLBACK)]\\n );\\n }\\n\\n /**\\n * @notice Gets oracle and enabled status by asset address\\n * @param asset asset address\\n * @param role Oracle role\\n * @return oracle Oracle address based on role\\n * @return enabled Enabled flag of the oracle based on token config\\n */\\n function getOracle(address asset, OracleRole role) public view returns (address oracle, bool enabled) {\\n oracle = tokenConfigs[asset].oracles[uint256(role)];\\n enabled = tokenConfigs[asset].enableFlagsForOracles[uint256(role)];\\n }\\n\\n function _getPrice(address asset) internal view returns (uint256) {\\n uint256 pivotPrice = INVALID_PRICE;\\n\\n // Get pivot oracle price, Invalid price if not available or error\\n (address pivotOracle, bool pivotOracleEnabled) = getOracle(asset, OracleRole.PIVOT);\\n if (pivotOracleEnabled && pivotOracle != address(0)) {\\n try OracleInterface(pivotOracle).getPrice(asset) returns (uint256 pricePivot) {\\n pivotPrice = pricePivot;\\n } catch {}\\n }\\n\\n // Compare main price and pivot price, return main price and if validation was successful\\n // note: In case pivot oracle is not available but main price is available and\\n // validation is successful, the main oracle price is returned.\\n (uint256 mainPrice, bool validatedPivotMain) = _getMainOraclePrice(\\n asset,\\n pivotPrice,\\n pivotOracleEnabled && pivotOracle != address(0)\\n );\\n if (mainPrice != INVALID_PRICE && validatedPivotMain) return mainPrice;\\n\\n // Compare fallback and pivot if main oracle comparision fails with pivot\\n // Return fallback price when fallback price is validated successfully with pivot oracle\\n (uint256 fallbackPrice, bool validatedPivotFallback) = _getFallbackOraclePrice(asset, pivotPrice);\\n if (fallbackPrice != INVALID_PRICE && validatedPivotFallback) return fallbackPrice;\\n\\n // Lastly compare main price and fallback price\\n if (\\n mainPrice != INVALID_PRICE &&\\n fallbackPrice != INVALID_PRICE &&\\n boundValidator.validatePriceWithAnchorPrice(asset, mainPrice, fallbackPrice)\\n ) {\\n return mainPrice;\\n }\\n\\n revert(\\\"invalid resilient oracle price\\\");\\n }\\n\\n /**\\n * @notice Gets a price for the provided asset\\n * @dev This function won't revert when price is 0, because the fallback oracle may still be\\n * able to fetch a correct price\\n * @param asset asset address\\n * @param pivotPrice Pivot oracle price\\n * @param pivotEnabled If pivot oracle is not empty and enabled\\n * @return price USD price in scaled decimals\\n * e.g. asset decimals is 8 then price is returned as 10**18 * 10**(18-8) = 10**28 decimals\\n * @return pivotValidated Boolean representing if the validation of main oracle price\\n * and pivot oracle price were successful\\n * @custom:error Invalid price error is thrown if main oracle fails to fetch price of the asset\\n * @custom:error Invalid price error is thrown if main oracle is not enabled or main oracle\\n * address is null\\n */\\n function _getMainOraclePrice(\\n address asset,\\n uint256 pivotPrice,\\n bool pivotEnabled\\n ) internal view returns (uint256, bool) {\\n (address mainOracle, bool mainOracleEnabled) = getOracle(asset, OracleRole.MAIN);\\n if (mainOracleEnabled && mainOracle != address(0)) {\\n try OracleInterface(mainOracle).getPrice(asset) returns (uint256 mainOraclePrice) {\\n if (!pivotEnabled) {\\n return (mainOraclePrice, true);\\n }\\n if (pivotPrice == INVALID_PRICE) {\\n return (mainOraclePrice, false);\\n }\\n return (\\n mainOraclePrice,\\n boundValidator.validatePriceWithAnchorPrice(asset, mainOraclePrice, pivotPrice)\\n );\\n } catch {\\n return (INVALID_PRICE, false);\\n }\\n }\\n\\n return (INVALID_PRICE, false);\\n }\\n\\n /**\\n * @dev This function won't revert when the price is 0 because getPrice checks if price is > 0\\n * @param asset asset address\\n * @return price USD price in 18 decimals\\n * @return pivotValidated Boolean representing if the validation of fallback oracle price\\n * and pivot oracle price were successfull\\n * @custom:error Invalid price error is thrown if fallback oracle fails to fetch price of the asset\\n * @custom:error Invalid price error is thrown if fallback oracle is not enabled or fallback oracle\\n * address is null\\n */\\n function _getFallbackOraclePrice(address asset, uint256 pivotPrice) private view returns (uint256, bool) {\\n (address fallbackOracle, bool fallbackEnabled) = getOracle(asset, OracleRole.FALLBACK);\\n if (fallbackEnabled && fallbackOracle != address(0)) {\\n try OracleInterface(fallbackOracle).getPrice(asset) returns (uint256 fallbackOraclePrice) {\\n if (pivotPrice == INVALID_PRICE) {\\n return (fallbackOraclePrice, false);\\n }\\n return (\\n fallbackOraclePrice,\\n boundValidator.validatePriceWithAnchorPrice(asset, fallbackOraclePrice, pivotPrice)\\n );\\n } catch {\\n return (INVALID_PRICE, false);\\n }\\n }\\n\\n return (INVALID_PRICE, false);\\n }\\n\\n /**\\n * @dev This function returns the underlying asset of a vToken\\n * @param vToken vToken address\\n * @return asset underlying asset address\\n */\\n function _getUnderlyingAsset(address vToken) private view notNullAddress(vToken) returns (address asset) {\\n if (vToken == nativeMarket) {\\n asset = NATIVE_TOKEN_ADDR;\\n } else if (vToken == vai) {\\n asset = vai;\\n } else {\\n asset = VBep20Interface(vToken).underlying();\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3bead63c5f2aca7e1ea5e9a075816e9e3551ce3a886f5f3707040262ad6d2c35\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/oracle/contracts/interfaces/OracleInterface.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\ninterface OracleInterface {\\n function getPrice(address asset) external view returns (uint256);\\n}\\n\\ninterface ResilientOracleInterface is OracleInterface {\\n function updatePrice(address vToken) external;\\n\\n function updateAssetPrice(address asset) external;\\n\\n function getUnderlyingPrice(address vToken) external view returns (uint256);\\n}\\n\\ninterface TwapInterface is OracleInterface {\\n function updateTwap(address asset) external returns (uint256);\\n}\\n\\ninterface BoundValidatorInterface {\\n function validatePriceWithAnchorPrice(\\n address asset,\\n uint256 reporterPrice,\\n uint256 anchorPrice\\n ) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x40031b19684ca0c912e794d08c2c0b0d8be77d3c1bdc937830a0658eff899650\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/oracle/contracts/interfaces/VBep20Interface.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\\\";\\n\\ninterface VBep20Interface is IERC20Metadata {\\n /**\\n * @notice Underlying asset for this VToken\\n */\\n function underlying() external view returns (address);\\n}\\n\",\"keccak256\":\"0x3f845cd51b2d82f7932ac6c0ab714df97f733b01ce50f6fb0adb4c28447d4618\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/solidity-utilities/contracts/constants.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\n/// @dev Base unit for computations, usually used in scaling (multiplications, divisions)\\nuint256 constant EXP_SCALE = 1e18;\\n\\n/// @dev A unit (literal one) in EXP_SCALE, usually used in additions/subtractions\\nuint256 constant MANTISSA_ONE = EXP_SCALE;\\n\\n/// @dev The approximate number of seconds per year\\nuint256 constant SECONDS_PER_YEAR = 31_536_000;\\n\",\"keccak256\":\"0x0464dd1b882ea2925e06e967c025a232c824e9e4c7aee7b97cc255d040594a59\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/solidity-utilities/contracts/validators.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\n/// @notice Thrown if the supplied address is a zero address where it is not allowed\\nerror ZeroAddressNotAllowed();\\n\\n/// @notice Thrown if the supplied value is 0 where it is not allowed\\nerror ZeroValueNotAllowed();\\n\\n/// @notice Checks if the provided address is nonzero, reverts otherwise\\n/// @param address_ Address to check\\n/// @custom:error ZeroAddressNotAllowed is thrown if the provided address is a zero address\\nfunction ensureNonzeroAddress(address address_) pure {\\n if (address_ == address(0)) {\\n revert ZeroAddressNotAllowed();\\n }\\n}\\n\\n/// @notice Checks if the provided value is nonzero, reverts otherwise\\n/// @param value_ Value to check\\n/// @custom:error ZeroValueNotAllowed is thrown if the provided value is 0\\nfunction ensureNonzeroValue(uint256 value_) pure {\\n if (value_ == 0) {\\n revert ZeroValueNotAllowed();\\n }\\n}\\n\",\"keccak256\":\"0xd55726634a83a862a9cef9d34c41694d3d0fea86cdbc57d6674af066792194b1\",\"license\":\"BSD-3-Clause\"},\"contracts/Interfaces/IComptroller.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\ninterface IComptroller {\\n function isComptroller() external view returns (bool);\\n\\n function markets(address) external view returns (bool);\\n\\n function getAllMarkets() external view returns (address[] memory);\\n}\\n\",\"keccak256\":\"0x7d85db8d34103352b25f29f591c1e45159222f0d2bbafaa3fcd42f42bf9a523d\",\"license\":\"BSD-3-Clause\"},\"contracts/Interfaces/IConverterNetwork.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\nimport { IAbstractTokenConverter } from \\\"../TokenConverter/IAbstractTokenConverter.sol\\\";\\n\\n/**\\n * @title IConverterNetwork\\n * @author Venus\\n * @notice Interface implemented by `ConverterNetwork`.\\n */\\ninterface IConverterNetwork {\\n /// @notice Adds new converter to the array\\n /// @param _tokenConverter Address of the token converter\\n function addTokenConverter(IAbstractTokenConverter _tokenConverter) external;\\n\\n /// @notice Removes converter from the array\\n /// @param _tokenConverter Address of the token converter\\n function removeTokenConverter(IAbstractTokenConverter _tokenConverter) external;\\n\\n /// @notice Used to get the array of converters supporting conversions, arranged in descending order based on token balances\\n /// @param _tokenAddressIn Address of tokenIn\\n /// @param _tokenAddressOut Address of tokenOut\\n /// @return converters Array of the conveters on the basis of the tokens pair\\n /// @return convertersBalance Array of balances with respect to token out\\n function findTokenConverters(address _tokenAddressIn, address _tokenAddressOut)\\n external\\n returns (address[] memory converters, uint256[] memory convertersBalance);\\n\\n /// @notice Used to get the array of converters supporting conversions, arranged in descending order based on token balances\\n /// @param _tokenAddressIn Address of tokenIn\\n /// @param _tokenAddressOut Address of tokenOut\\n /// @return converters Array of the conveters on the basis of the tokens pair\\n /// @return convertersBalance Array of balances with respect to token out\\n function findTokenConvertersForConverters(address _tokenAddressIn, address _tokenAddressOut)\\n external\\n returns (address[] memory converters, uint256[] memory convertersBalance);\\n\\n /// @notice This function returns the array containing all the converters addresses\\n /// @return Array containing all the converters addresses\\n function getAllConverters() external view returns (IAbstractTokenConverter[] memory);\\n\\n /// @notice This function checks for given address is converter or not\\n /// @param _tokenConverter Address of the token converter\\n /// @return boolean true if given address is converter otherwise false\\n function isTokenConverter(address _tokenConverter) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x185dac944af690a34378319c568454fb7ce917c2ab6acdb514eec02e00965107\",\"license\":\"BSD-3-Clause\"},\"contracts/Interfaces/IPoolRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\ninterface IPoolRegistry {\\n /// @notice Get VToken in the Pool for an Asset\\n function getVTokenForAsset(address comptroller, address asset) external view returns (address);\\n\\n /// @notice Get the addresss of the Pools supported that include a market for the provided asset\\n function getPoolsSupportedByAsset(address asset) external view returns (address[] memory);\\n}\\n\",\"keccak256\":\"0xb38a3b61926e55588096e0657b758b178130386143a5658030d659038ec7075c\",\"license\":\"BSD-3-Clause\"},\"contracts/Interfaces/IRiskFund.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\n/**\\n * @title IRiskFund\\n * @author Venus\\n * @notice Interface implemented by `RiskFund`.\\n */\\ninterface IRiskFund {\\n function transferReserveForAuction(address comptroller, uint256 amount) external returns (uint256);\\n\\n function updatePoolState(\\n address comptroller,\\n address asset,\\n uint256 amount\\n ) external;\\n\\n function getPoolsBaseAssetReserves(address comptroller) external view returns (uint256);\\n}\\n\\n/**\\n * @title IRiskFundGetters\\n * @author Venus\\n * @notice Interface implemented by `RiskFund` for getter methods.\\n */\\ninterface IRiskFundGetters {\\n function convertibleBaseAsset() external view returns (address);\\n}\\n\",\"keccak256\":\"0x5f2a65443264433c222053b317aa489aad17311f8d5def1975221073176dbc0f\",\"license\":\"BSD-3-Clause\"},\"contracts/Interfaces/IVToken.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\ninterface IVToken {\\n function underlying() external view returns (address);\\n}\\n\",\"keccak256\":\"0x0718e50835da441b2dddcf6d52a671c43d386b96dbcc9eb41d68c3647b82c117\",\"license\":\"BSD-3-Clause\"},\"contracts/TokenConverter/AbstractTokenConverter.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\nimport { ReentrancyGuardUpgradeable } from \\\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\\\";\\nimport { SafeERC20Upgradeable } from \\\"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\\\";\\nimport { AccessControlledV8 } from \\\"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\\\";\\nimport { IERC20Upgradeable } from \\\"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\\\";\\nimport { ResilientOracle } from \\\"@venusprotocol/oracle/contracts/ResilientOracle.sol\\\";\\nimport { ensureNonzeroAddress, ensureNonzeroValue } from \\\"@venusprotocol/solidity-utilities/contracts/validators.sol\\\";\\nimport { MANTISSA_ONE, EXP_SCALE } from \\\"@venusprotocol/solidity-utilities/contracts/constants.sol\\\";\\n\\nimport { IAbstractTokenConverter } from \\\"./IAbstractTokenConverter.sol\\\";\\nimport { IConverterNetwork } from \\\"../Interfaces/IConverterNetwork.sol\\\";\\n\\n/// @title AbstractTokenConverter\\n/// @author Venus\\n/// @notice Abstract contract will be extended by SingleTokenConverter and RiskFundConverter\\n/*\\n * This contract specifies four functions for converting tokens, each applicable under following circumstances:\\n *\\n * Case I: TokenIn -> deflationary token, TokenOut -> deflationary token\\n * In this scenario, functions supporting fees can only be utilized to convert tokens which are:\\n * a. convertExactTokensSupportingFeeOnTransferTokens\\n * b. convertForExactTokensSupportingFeeOnTransferTokens\\n *\\n * Case II: TokenIn -> deflationary token, TokenOut -> non-deflationary token\\n * In this scenario, functions supporting fee can only be utilized to convert tokens which are:\\n * similar to Case I.\\n *\\n * Case III: TokenIn -> non-deflationary token, TokenOut -> deflationary token\\n * In this scenario, functions with or without supporting fee can be utilized to convert tokens which are:\\n * a. convertExactTokens\\n * b. convertForExactTokens\\n * c. convertExactTokensSupportingFeeOnTransferTokens\\n * d. convertForExactTokensSupportingFeeOnTransferTokens\\n *\\n * Case IV: TokenIn -> non-deflationary token, TokenOut -> non-deflationary token\\n * In this scenario, functions with or without supporting fee can be utilized to convert tokens which are:\\n * similar to Case III.\\n *\\n * ------------------------------------------------------------------------------------------------------------------------------------\\n * Example 1:-\\n * tokenInAddress - 0xaaaa.....\\n * tokenOutAddress - 0xbbbb.....\\n * tokenInAmount - 100\\n * tokenOutMinAmount - minimum amount desired by the user(let's say 70)\\n * Here user can use `convertExactTokens` or `convertExactTokensSupportingFeeOnTransferTokens`, if tokenIn is deflationary\\n * then `convertExactTokensSupportingFeeOnTransferTokens` should be used(let's suppose `convertExactTokens` is used).\\n * Now first tokenInAddress tokens will be transferred from the user to the contract, on the basis of amount\\n * received(as tokenInAddress can be deflationary token) tokenAmountOut will be calculated and will be transferred\\n * to the user and if amount sent is less than tokenOutMinAmount, tx will revert. If amount sent is satisfied(let's say\\n * 80 or even 70) then at last the actual amount received and the amount that was supposed to be received by the contract will\\n * be compared, if they differ then the whole tx will revert as user was supposed to use `convertExactTokensSupportingFeeOnTransferTokens`\\n * function for tokenIn as deflationary token.\\n *\\n * Example 2:-\\n * tokenInAddress - 0xaaaa.....\\n * tokenOutAddress - 0xbbbb.....\\n * tokenInMaxAmount - maximum amount user is willing to provide(let's say 100)\\n * tokenOutAmount - 70\\n * Here user can use `convertForExactTokens` or `convertForExactTokensSupportingFeeOnTransferTokens`, if tokenIn is deflationary\\n * then `convertForExactTokensSupportingFeeOnTransferTokens` should be used(let's suppose `convertForExactTokens` is used),\\n * which on the basis of tokenOutAmount provided will calculate tokenInAmount based on the tokens prices and will transfer\\n * tokens from the user to the contract, now the actual amount received(as tokenInAddress can be deflationary token) will be\\n * compared with tokenInMaxAmount if it is greater, tx will revert. If In amount is satisfied(let's say 90 or even 100) then\\n * new tokenOutAmount will be calculated, and tokenOutAddress tokens will be transferred to the user, but at last the\\n * old tokenOutAmount and new tokenOutAmount will be compared and if they differ whole tx will revert, because user was\\n * supposed to use `convertForExactTokensSupportingFeeOnTransferTokens` function for tokenIn as deflationary token.\\n * ------------------------------------------------------------------------------------------------------------------------------------\\n *\\n * This contract also supports private conversion between the converters:\\n * Private conversions:\\n * Private conversions is designed in order to convert the maximum amount of tokens received from PSR(to any converter) between\\n * existing converters to save incentive and lower the dependency of users for conversion. So Private Conversion will be executed\\n * by converters on it's own whenever funds are received from PSR. No incentive will be offered during private conversion.\\n *\\n * It will execute on updateAssetsState() function call in Converter Contracts. After this function call, converter will first\\n * check for the amount received. If base asset is received then it will be directly sent to the destination address and no private\\n * conversion will happen otherwise converter will interact with ConverterNetwork contract to find other valid converters who are providing the conversion for:\\n *\\n * tokenAddressIn: As asset received by that converter on updateAssetsState() function call.\\n * tokenAddressOut: As base asset of that converter.\\n *\\n * ConverterNetwork:\\n * This contract will contain all the converters, and will provide valid converters which can perform the execution according to tokenAddressIn\\n * and tokenAddressOut provided.\\n *\\n * findTokenConverters():\\n * It will return an array of converter addresses along with their corresponding balances, sorted in descending order based on the converter's balances\\n * relative to tokenAddressOut. This function filter the converter addresses on the basis of the conversionAccess(for users).\\n *\\n * findTokenConvertersForConverters():\\n * It will return an array of converter addresses along with their corresponding balances, sorted in descending order based on the converter's balances\\n * relative to tokenAddressOut. This function filter the converter addresses on the basis of the conversionAccess(for converters).\\n */\\n\\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\\nabstract contract AbstractTokenConverter is AccessControlledV8, IAbstractTokenConverter, ReentrancyGuardUpgradeable {\\n using SafeERC20Upgradeable for IERC20Upgradeable;\\n\\n /// @notice Maximum incentive could be\\n uint256 public constant MAX_INCENTIVE = 0.5e18;\\n\\n /// @notice Min amount to convert for private conversions. Defined in USD, with 18 decimals\\n uint256 public minAmountToConvert;\\n\\n /// @notice Venus price oracle contract\\n ResilientOracle public priceOracle;\\n\\n /// @notice conversion configurations for the existing pairs\\n /// @dev tokenAddressIn => tokenAddressOut => ConversionConfig\\n mapping(address => mapping(address => ConversionConfig)) public conversionConfigurations;\\n\\n /// @notice Address that all incoming tokens are transferred to\\n address public destinationAddress;\\n\\n /// @notice Boolean for if conversion is paused\\n bool public conversionPaused;\\n\\n /// @notice Address of the converterNetwork contract\\n IConverterNetwork public converterNetwork;\\n\\n /// @dev This empty reserved space is put in place to allow future versions to add new\\n /// variables without shifting down storage in the inheritance chain.\\n /// See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n uint256[45] private __gap;\\n\\n /// @notice Emitted when config is updated for tokens pair\\n event ConversionConfigUpdated(\\n address indexed tokenAddressIn,\\n address indexed tokenAddressOut,\\n uint256 oldIncentive,\\n uint256 newIncentive,\\n ConversionAccessibility oldAccess,\\n ConversionAccessibility newAccess\\n );\\n /// @notice Emitted when price oracle address is updated\\n event PriceOracleUpdated(ResilientOracle indexed oldPriceOracle, ResilientOracle indexed priceOracle);\\n\\n /// @notice Emitted when destination address is updated\\n event DestinationAddressUpdated(address indexed oldDestinationAddress, address indexed destinationAddress);\\n\\n /// @notice Emitted when converterNetwork address is updated\\n event ConverterNetworkAddressUpdated(address indexed oldConverterNetwork, address indexed converterNetwork);\\n\\n /// @notice Emitted when exact amount of tokens are converted for tokens\\n event ConvertedExactTokens(\\n address indexed sender,\\n address indexed receiver,\\n address tokenAddressIn,\\n address indexed tokenAddressOut,\\n uint256 amountIn,\\n uint256 amountOut\\n );\\n\\n /// @notice Emitted when tokens are converted for exact amount of tokens\\n event ConvertedForExactTokens(\\n address indexed sender,\\n address indexed receiver,\\n address tokenAddressIn,\\n address indexed tokenAddressOut,\\n uint256 amountIn,\\n uint256 amountOut\\n );\\n\\n /// @notice Emitted when exact amount of tokens are converted for tokens, for deflationary tokens\\n event ConvertedExactTokensSupportingFeeOnTransferTokens(\\n address indexed sender,\\n address indexed receiver,\\n address tokenAddressIn,\\n address indexed tokenAddressOut,\\n uint256 amountIn,\\n uint256 amountOut\\n );\\n\\n /// @notice Emitted when tokens are converted for exact amount of tokens, for deflationary tokens\\n event ConvertedForExactTokensSupportingFeeOnTransferTokens(\\n address indexed sender,\\n address indexed receiver,\\n address tokenAddressIn,\\n address indexed tokenAddressOut,\\n uint256 amountIn,\\n uint256 amountOut\\n );\\n\\n /// @notice Emitted when conversion is paused\\n event ConversionPaused(address indexed sender);\\n\\n /// @notice Emitted when conversion is unpaused\\n event ConversionResumed(address indexed sender);\\n\\n /// @notice Event emitted when tokens are swept\\n event SweepToken(address indexed token, address indexed to, uint256 amount);\\n\\n /// @notice Emitted when minimum amount to convert is updated\\n event MinAmountToConvertUpdated(uint256 oldMinAmountToConvert, uint256 newMinAmountToConvert);\\n\\n /// @notice Thrown when actualAmountOut does not match with amountOutMantissa for convertForExactTokens\\n error AmountOutMismatched();\\n\\n /// @notice Thrown when actualAmountIn does not match with amountInMantissa for convertForExactTokens\\n error AmountInMismatched();\\n\\n /// @notice Thrown when given input amount is zero\\n error InsufficientInputAmount();\\n\\n /// @notice Thrown when given output amount is zero\\n error InsufficientOutputAmount();\\n\\n /// @notice Thrown when conversion is disabled or config does not exist for given pair\\n error ConversionConfigNotEnabled();\\n\\n /// @notice Thrown when conversion is enabled only for private conversions\\n error ConversionEnabledOnlyForPrivateConversions();\\n\\n /// @notice Thrown when address(to) is same as tokenAddressIn or tokenAddressOut\\n error InvalidToAddress();\\n\\n /// @notice Thrown when incentive is higher than the MAX_INCENTIVE\\n error IncentiveTooHigh(uint256 incentive, uint256 maxIncentive);\\n\\n /// @notice Thrown when amountOut is lower than amountOutMin\\n error AmountOutLowerThanMinRequired(uint256 amountOutMantissa, uint256 amountOutMinMantissa);\\n\\n /// @notice Thrown when amountIn is higher than amountInMax\\n error AmountInHigherThanMax(uint256 amountInMantissa, uint256 amountInMaxMantissa);\\n\\n /// @notice Thrown when conversion is paused\\n error ConversionTokensPaused();\\n\\n /// @notice Thrown when conversion is Active\\n error ConversionTokensActive();\\n\\n /// @notice Thrown when tokenInAddress is same as tokeOutAdress OR tokeInAddress is not the base asset of the destination\\n error InvalidTokenConfigAddresses();\\n\\n /// @notice Thrown when contract has less liquidity for tokenAddressOut than amountOutMantissa\\n error InsufficientPoolLiquidity();\\n\\n /// @notice When address of the ConverterNetwork is not set or Zero address\\n error InvalidConverterNetwork();\\n\\n /// @notice Thrown when trying to set non zero incentive for private conversion\\n error NonZeroIncentiveForPrivateConversion();\\n\\n /// @notice Thrown when using convertForExactTokens deflationary tokens\\n error DeflationaryTokenNotSupported();\\n\\n /// @notice Thrown when minimum amount to convert is zero\\n error InvalidMinimumAmountToConvert();\\n\\n /// @notice Thrown when there is a mismatch in the length of input arrays\\n error InputLengthMisMatch();\\n\\n /**\\n * @notice Modifier to ensure valid conversion parameters for a token conversion\\n * and check if conversion is paused or not\\n * @param to The recipient address for the converted tokens\\n * @param tokenAddressIn The input token address for the conversion\\n * @param tokenAddressOut The output token address for the conversion\\n */\\n modifier validConversionParameters(\\n address to,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) {\\n _checkConversionPaused();\\n ensureNonzeroAddress(to);\\n if (to == tokenAddressIn || to == tokenAddressOut) {\\n revert InvalidToAddress();\\n }\\n _;\\n }\\n\\n /// @notice Pause conversion of tokens\\n /// @custom:event Emits ConversionPaused on success\\n /// @custom:error ConversionTokensPaused thrown when conversion is already paused\\n /// @custom:access Restricted by ACM\\n function pauseConversion() external {\\n _checkAccessAllowed(\\\"pauseConversion()\\\");\\n _checkConversionPaused();\\n conversionPaused = true;\\n emit ConversionPaused(msg.sender);\\n }\\n\\n /// @notice Resume conversion of tokens.\\n /// @custom:event Emits ConversionResumed on success\\n /// @custom:error ConversionTokensActive thrown when conversion is already active\\n /// @custom:access Restricted by ACM\\n function resumeConversion() external {\\n _checkAccessAllowed(\\\"resumeConversion()\\\");\\n if (!conversionPaused) {\\n revert ConversionTokensActive();\\n }\\n\\n conversionPaused = false;\\n emit ConversionResumed(msg.sender);\\n }\\n\\n /// @notice Sets a new price oracle\\n /// @param priceOracle_ Address of the new price oracle to set\\n /// @custom:access Only Governance\\n function setPriceOracle(ResilientOracle priceOracle_) external onlyOwner {\\n _setPriceOracle(priceOracle_);\\n }\\n\\n /// @notice Sets a new destination address\\n /// @param destinationAddress_ The new destination address to be set\\n /// @custom:access Only Governance\\n function setDestination(address destinationAddress_) external onlyOwner {\\n _setDestination(destinationAddress_);\\n }\\n\\n /// @notice Sets a converter network contract address\\n /// @param converterNetwork_ The converterNetwork address to be set\\n /// @custom:access Only Governance\\n function setConverterNetwork(IConverterNetwork converterNetwork_) external onlyOwner {\\n _setConverterNetwork(converterNetwork_);\\n }\\n\\n /// @notice Min amount to convert setter\\n /// @param minAmountToConvert_ Min amount to convert\\n /// @custom:access Only Governance\\n function setMinAmountToConvert(uint256 minAmountToConvert_) external {\\n _checkAccessAllowed(\\\"setMinAmountToConvert(uint256)\\\");\\n _setMinAmountToConvert(minAmountToConvert_);\\n }\\n\\n /// @notice Batch sets the conversion configurations\\n /// @param tokenAddressIn Address of tokenIn\\n /// @param tokenAddressesOut Array of addresses of tokenOut\\n /// @param conversionConfigs Array of conversionConfig config details to update\\n /// @custom:error InputLengthMisMatch is thrown when tokenAddressesOut and conversionConfigs array length mismatches\\n function setConversionConfigs(\\n address tokenAddressIn,\\n address[] calldata tokenAddressesOut,\\n ConversionConfig[] calldata conversionConfigs\\n ) external {\\n uint256 tokenOutArrayLength = tokenAddressesOut.length;\\n if (tokenOutArrayLength != conversionConfigs.length) revert InputLengthMisMatch();\\n\\n for (uint256 i; i < tokenOutArrayLength; ) {\\n setConversionConfig(tokenAddressIn, tokenAddressesOut[i], conversionConfigs[i]);\\n unchecked {\\n ++i;\\n }\\n }\\n }\\n\\n /// @notice Converts exact amount of tokenAddressIn for tokenAddressOut if there is enough tokens held by the contract\\n /// @dev Method does not support deflationary tokens transfer\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @param to Address of the tokenAddressOut receiver\\n /// @return actualAmountIn Actual amount transferred to destination\\n /// @return actualAmountOut Actual amount transferred to user\\n /// @custom:event Emits ConvertedExactTokens event on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when to address is zero\\n /// @custom:error InvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOut\\n /// @custom:error AmountOutLowerThanMinRequired error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa\\n /// @custom:error AmountInMismatched error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa\\n function convertExactTokens(\\n uint256 amountInMantissa,\\n uint256 amountOutMinMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n )\\n external\\n validConversionParameters(to, tokenAddressIn, tokenAddressOut)\\n nonReentrant\\n returns (uint256 actualAmountIn, uint256 actualAmountOut)\\n {\\n (actualAmountIn, actualAmountOut) = _convertExactTokens(\\n amountInMantissa,\\n amountOutMinMantissa,\\n tokenAddressIn,\\n tokenAddressOut,\\n to\\n );\\n\\n if (actualAmountIn != amountInMantissa) {\\n revert AmountInMismatched();\\n }\\n\\n _postConversionHook(tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\\n emit ConvertedExactTokens(msg.sender, to, tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\\n }\\n\\n /// @notice Converts tokens for tokenAddressIn for exact amount of tokenAddressOut if there is enough tokens held by the contract,\\n /// otherwise the amount is adjusted\\n /// @dev Method does not support deflationary tokens transfer\\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @param to Address of the tokenAddressOut receiver\\n /// @return actualAmountIn Actual amount transferred to destination\\n /// @return actualAmountOut Actual amount transferred to user\\n /// @custom:event Emits ConvertedForExactTokens event on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when to address is zero\\n /// @custom:error InvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOut\\n /// @custom:error AmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissa\\n /// @custom:error AmountOutMismatched error is thrown when actualAmountOut is does not match amountOutMantissa\\n function convertForExactTokens(\\n uint256 amountInMaxMantissa,\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n )\\n external\\n validConversionParameters(to, tokenAddressIn, tokenAddressOut)\\n nonReentrant\\n returns (uint256 actualAmountIn, uint256 actualAmountOut)\\n {\\n (actualAmountIn, actualAmountOut) = _convertForExactTokens(\\n amountInMaxMantissa,\\n amountOutMantissa,\\n tokenAddressIn,\\n tokenAddressOut,\\n to\\n );\\n\\n if (actualAmountOut != amountOutMantissa) {\\n revert AmountOutMismatched();\\n }\\n\\n _postConversionHook(tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\\n emit ConvertedForExactTokens(msg.sender, to, tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\\n }\\n\\n /// @notice Converts exact amount of tokenAddressIn for tokenAddressOut if there is enough tokens held by the contract\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @param to Address of the tokenAddressOut receiver\\n /// @return actualAmountIn Actual amount transferred to destination\\n /// @return actualAmountOut Actual amount transferred to user\\n /// @custom:event Emits ConvertedExactTokensSupportingFeeOnTransferTokens event on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when to address is zero\\n /// @custom:error InvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOut\\n /// @custom:error AmountOutLowerThanMinRequired error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa\\n function convertExactTokensSupportingFeeOnTransferTokens(\\n uint256 amountInMantissa,\\n uint256 amountOutMinMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n )\\n external\\n validConversionParameters(to, tokenAddressIn, tokenAddressOut)\\n nonReentrant\\n returns (uint256 actualAmountIn, uint256 actualAmountOut)\\n {\\n (actualAmountIn, actualAmountOut) = _convertExactTokens(\\n amountInMantissa,\\n amountOutMinMantissa,\\n tokenAddressIn,\\n tokenAddressOut,\\n to\\n );\\n\\n _postConversionHook(tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\\n emit ConvertedExactTokensSupportingFeeOnTransferTokens(\\n msg.sender,\\n to,\\n tokenAddressIn,\\n tokenAddressOut,\\n actualAmountIn,\\n actualAmountOut\\n );\\n }\\n\\n /// @notice Converts tokens for tokenAddressIn for amount of tokenAddressOut calculated on the basis of amount of\\n /// tokenAddressIn received by the contract, if there is enough tokens held by the contract, otherwise the amount is adjusted.\\n /// The user will be responsible for bearing any fees associated with token transfers, whether pulling in or pushing out tokens\\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @param to Address of the tokenAddressOut receiver\\n /// @return actualAmountIn Actual amount transferred to destination\\n /// @return actualAmountOut Actual amount transferred to user\\n /// @custom:event Emits ConvertedForExactTokensSupportingFeeOnTransferTokens event on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when to address is zero\\n /// @custom:error InvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOut\\n /// @custom:error AmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissa\\n function convertForExactTokensSupportingFeeOnTransferTokens(\\n uint256 amountInMaxMantissa,\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n )\\n external\\n validConversionParameters(to, tokenAddressIn, tokenAddressOut)\\n nonReentrant\\n returns (uint256 actualAmountIn, uint256 actualAmountOut)\\n {\\n (actualAmountIn, actualAmountOut) = _convertForExactTokensSupportingFeeOnTransferTokens(\\n amountInMaxMantissa,\\n amountOutMantissa,\\n tokenAddressIn,\\n tokenAddressOut,\\n to\\n );\\n\\n _postConversionHook(tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\\n emit ConvertedForExactTokensSupportingFeeOnTransferTokens(\\n msg.sender,\\n to,\\n tokenAddressIn,\\n tokenAddressOut,\\n actualAmountIn,\\n actualAmountOut\\n );\\n }\\n\\n /// @notice To sweep ERC20 tokens and transfer them to user(to address)\\n /// @param tokenAddress The address of the ERC-20 token to sweep\\n /// @param to The address to which tokens will be transferred\\n /// @param amount The amount to transfer\\n /// @custom:event Emits SweepToken event on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when tokenAddress/to address is zero\\n /// @custom:access Only Governance\\n function sweepToken(\\n address tokenAddress,\\n address to,\\n uint256 amount\\n ) external onlyOwner nonReentrant {\\n ensureNonzeroAddress(tokenAddress);\\n ensureNonzeroAddress(to);\\n ensureNonzeroValue(amount);\\n\\n IERC20Upgradeable token = IERC20Upgradeable(tokenAddress);\\n preSweepToken(tokenAddress, amount);\\n token.safeTransfer(to, amount);\\n\\n emit SweepToken(tokenAddress, to, amount);\\n }\\n\\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn.\\n /// This function does not account for potential token transfer fees(in case of deflationary tokens)\\n /// @dev This function retrieves values without altering token prices\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountConvertedMantissa Amount of tokenAddressIn should be transferred after conversion\\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n /// @custom:error ConversionEnabledOnlyForPrivateConversions is thrown when conversion is only enabled for private conversion\\n function getAmountOut(\\n uint256 amountInMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) external view returns (uint256 amountConvertedMantissa, uint256 amountOutMantissa) {\\n if (\\n conversionConfigurations[tokenAddressIn][tokenAddressOut].conversionAccess ==\\n ConversionAccessibility.ONLY_FOR_CONVERTERS\\n ) {\\n revert ConversionEnabledOnlyForPrivateConversions();\\n }\\n\\n amountConvertedMantissa = amountInMantissa;\\n uint256 tokenInToOutConversion;\\n (amountOutMantissa, tokenInToOutConversion) = _getAmountOut(amountInMantissa, tokenAddressIn, tokenAddressOut);\\n\\n uint256 maxTokenOutReserve = balanceOf(tokenAddressOut);\\n\\n /// If contract has less liquidity for tokenAddressOut than amountOutMantissa\\n if (maxTokenOutReserve < amountOutMantissa) {\\n amountConvertedMantissa =\\n ((maxTokenOutReserve * EXP_SCALE) + tokenInToOutConversion - 1) /\\n tokenInToOutConversion; //round-up\\n amountOutMantissa = maxTokenOutReserve;\\n }\\n }\\n\\n /// @notice To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut.\\n /// This function does not account for potential token transfer fees(in case of deflationary tokens)\\n /// @dev This function retrieves values without altering token prices\\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountConvertedMantissa Amount of tokenAddressOut should be transferred after conversion\\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n /// @custom:error ConversionEnabledOnlyForPrivateConversions is thrown when conversion is only enabled for private conversion\\n function getAmountIn(\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) external view returns (uint256 amountConvertedMantissa, uint256 amountInMantissa) {\\n if (\\n conversionConfigurations[tokenAddressIn][tokenAddressOut].conversionAccess ==\\n ConversionAccessibility.ONLY_FOR_CONVERTERS\\n ) {\\n revert ConversionEnabledOnlyForPrivateConversions();\\n }\\n\\n uint256 maxTokenOutReserve = balanceOf(tokenAddressOut);\\n\\n /// If contract has less liquidity for tokenAddressOut than amountOutMantissa\\n if (maxTokenOutReserve < amountOutMantissa) {\\n amountOutMantissa = maxTokenOutReserve;\\n }\\n\\n amountConvertedMantissa = amountOutMantissa;\\n (amountInMantissa, ) = _getAmountIn(amountOutMantissa, tokenAddressIn, tokenAddressOut);\\n }\\n\\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountConvertedMantissa Amount of tokenAddressIn should be transferred after conversion\\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n function getUpdatedAmountOut(\\n uint256 amountInMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) public returns (uint256 amountConvertedMantissa, uint256 amountOutMantissa) {\\n priceOracle.updateAssetPrice(tokenAddressIn);\\n priceOracle.updateAssetPrice(tokenAddressOut);\\n\\n (amountOutMantissa, ) = _getAmountOut(amountInMantissa, tokenAddressIn, tokenAddressOut);\\n amountConvertedMantissa = amountInMantissa;\\n }\\n\\n /// @notice To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut\\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountConvertedMantissa Amount of tokenAddressOut should be transferred after conversion\\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n function getUpdatedAmountIn(\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) public returns (uint256 amountConvertedMantissa, uint256 amountInMantissa) {\\n priceOracle.updateAssetPrice(tokenAddressIn);\\n priceOracle.updateAssetPrice(tokenAddressOut);\\n\\n (amountInMantissa, ) = _getAmountIn(amountOutMantissa, tokenAddressIn, tokenAddressOut);\\n amountConvertedMantissa = amountOutMantissa;\\n }\\n\\n /// @notice This method updated the states of this contract after getting funds from PSR\\n /// after settling the amount(if any) through privateConversion between converters\\n /// @dev This function is called by protocolShareReserve\\n /// @dev call _updateAssetsState to update the states related to the comptroller and asset transfer to the specific converter then\\n /// it calls the _privateConversion which will convert the asset into destination's base asset and transfer it to destination address\\n /// @param comptroller Comptroller address (pool)\\n /// @param asset Asset address\\n function updateAssetsState(address comptroller, address asset) public nonReentrant {\\n uint256 balanceDiff = _updateAssetsState(comptroller, asset);\\n if (balanceDiff > 0) {\\n _privateConversion(comptroller, asset, balanceDiff);\\n }\\n }\\n\\n /// @notice Set the configuration for new or existing conversion pair\\n /// @param tokenAddressIn Address of tokenIn\\n /// @param tokenAddressOut Address of tokenOut\\n /// @param conversionConfig ConversionConfig config details to update\\n /// @custom:event Emits ConversionConfigUpdated event on success\\n /// @custom:error Unauthorized error is thrown when the call is not authorized by AccessControlManager\\n /// @custom:error ZeroAddressNotAllowed is thrown when pool registry address is zero\\n /// @custom:error NonZeroIncentiveForPrivateConversion is thrown when incentive is non zero for private conversion\\n /// @custom:access Controlled by AccessControlManager\\n function setConversionConfig(\\n address tokenAddressIn,\\n address tokenAddressOut,\\n ConversionConfig calldata conversionConfig\\n ) public {\\n _checkAccessAllowed(\\\"setConversionConfig(address,address,ConversionConfig)\\\");\\n ensureNonzeroAddress(tokenAddressIn);\\n ensureNonzeroAddress(tokenAddressOut);\\n\\n if (conversionConfig.incentive > MAX_INCENTIVE) {\\n revert IncentiveTooHigh(conversionConfig.incentive, MAX_INCENTIVE);\\n }\\n\\n if (\\n (tokenAddressIn == tokenAddressOut) ||\\n (tokenAddressIn != _getDestinationBaseAsset()) ||\\n conversionConfigurations[tokenAddressOut][tokenAddressIn].conversionAccess != ConversionAccessibility.NONE\\n ) {\\n revert InvalidTokenConfigAddresses();\\n }\\n\\n if (\\n (conversionConfig.conversionAccess == ConversionAccessibility.ONLY_FOR_CONVERTERS) &&\\n conversionConfig.incentive != 0\\n ) {\\n revert NonZeroIncentiveForPrivateConversion();\\n }\\n\\n if (\\n ((conversionConfig.conversionAccess == ConversionAccessibility.ONLY_FOR_CONVERTERS) ||\\n (conversionConfig.conversionAccess == ConversionAccessibility.ALL)) &&\\n (address(converterNetwork) == address(0))\\n ) {\\n revert InvalidConverterNetwork();\\n }\\n\\n ConversionConfig storage configuration = conversionConfigurations[tokenAddressIn][tokenAddressOut];\\n\\n emit ConversionConfigUpdated(\\n tokenAddressIn,\\n tokenAddressOut,\\n configuration.incentive,\\n conversionConfig.incentive,\\n configuration.conversionAccess,\\n conversionConfig.conversionAccess\\n );\\n\\n if (conversionConfig.conversionAccess == ConversionAccessibility.NONE) {\\n delete conversionConfigurations[tokenAddressIn][tokenAddressOut];\\n } else {\\n configuration.incentive = conversionConfig.incentive;\\n configuration.conversionAccess = conversionConfig.conversionAccess;\\n }\\n }\\n\\n /// @notice Get the balance for specific token\\n /// @param token Address of the token\\n /// @return tokenBalance Balance of the token the contract has\\n function balanceOf(address token) public view virtual returns (uint256 tokenBalance);\\n\\n /// @dev Operations to perform before sweeping tokens\\n /// @param token Address of the token\\n /// @param amount Amount transferred to address(to)\\n function preSweepToken(address token, uint256 amount) internal virtual {}\\n\\n /// @dev Converts exact amount of tokenAddressIn for tokenAddressOut\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @param to Address of the tokenAddressOut receiver\\n /// @return actualAmountIn Actual amount of tokenAddressIn transferred\\n /// @return amountOutMantissa Actual amount of tokenAddressOut transferred\\n /// @custom:error AmountOutLowerThanMinRequired error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa\\n function _convertExactTokens(\\n uint256 amountInMantissa,\\n uint256 amountOutMinMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n ) internal returns (uint256 actualAmountIn, uint256 amountOutMantissa) {\\n _checkPrivateConversion(tokenAddressIn, tokenAddressOut);\\n actualAmountIn = _doTransferIn(tokenAddressIn, amountInMantissa);\\n\\n (, amountOutMantissa) = getUpdatedAmountOut(actualAmountIn, tokenAddressIn, tokenAddressOut);\\n\\n if (amountOutMantissa < amountOutMinMantissa) {\\n revert AmountOutLowerThanMinRequired(amountOutMantissa, amountOutMinMantissa);\\n }\\n\\n _doTransferOut(tokenAddressOut, to, amountOutMantissa);\\n }\\n\\n /// @dev Converts tokens for tokenAddressIn for exact amount of tokenAddressOut used for non deflationry tokens\\n /// it is called by convertForExactTokens function\\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @param to Address of the tokenAddressOut receiver\\n /// @return actualAmountIn Actual amount of tokenAddressIn transferred\\n /// @return actualAmountOut Actual amount of tokenAddressOut transferred\\n /// @custom:error DeflationaryTokenNotSupported is thrown if tokenAddressIn is deflationary token\\n /// @custom:error AmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissa\\n function _convertForExactTokens(\\n uint256 amountInMaxMantissa,\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n ) internal returns (uint256 actualAmountIn, uint256 actualAmountOut) {\\n _checkPrivateConversion(tokenAddressIn, tokenAddressOut);\\n (, uint256 amountInMantissa) = getUpdatedAmountIn(amountOutMantissa, tokenAddressIn, tokenAddressOut);\\n\\n actualAmountIn = _doTransferIn(tokenAddressIn, amountInMantissa);\\n\\n if (actualAmountIn != amountInMantissa) {\\n revert DeflationaryTokenNotSupported();\\n }\\n\\n if (actualAmountIn > amountInMaxMantissa) {\\n revert AmountInHigherThanMax(amountInMantissa, amountInMaxMantissa);\\n }\\n\\n _doTransferOut(tokenAddressOut, to, amountOutMantissa);\\n actualAmountOut = amountOutMantissa;\\n }\\n\\n /// @dev Converts tokens for tokenAddressIn for the amount of tokenAddressOut used for deflationary tokens\\n /// it is called by convertForExactTokensSupportingFeeOnTransferTokens function\\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @param to Address of the tokenAddressOut receiver\\n /// @return actualAmountIn Actual amount of tokenAddressIn transferred\\n /// @return actualAmountOut Actual amount of tokenAddressOut transferred\\n /// @custom:error AmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissa\\n function _convertForExactTokensSupportingFeeOnTransferTokens(\\n uint256 amountInMaxMantissa,\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n ) internal returns (uint256 actualAmountIn, uint256 actualAmountOut) {\\n _checkPrivateConversion(tokenAddressIn, tokenAddressOut);\\n (, uint256 amountInMantissa) = getUpdatedAmountIn(amountOutMantissa, tokenAddressIn, tokenAddressOut);\\n\\n if (amountInMantissa > amountInMaxMantissa) {\\n revert AmountInHigherThanMax(amountInMantissa, amountInMaxMantissa);\\n }\\n\\n actualAmountIn = _doTransferIn(tokenAddressIn, amountInMantissa);\\n\\n (, actualAmountOut) = getUpdatedAmountOut(actualAmountIn, tokenAddressIn, tokenAddressOut);\\n\\n _doTransferOut(tokenAddressOut, to, actualAmountOut);\\n }\\n\\n /// @dev return actualAmountOut from reserves for tokenAddressOut\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @param to Address of the tokenAddressOut receiver\\n /// @param amountConvertedMantissa Amount of tokenAddressOut supposed to get transferred\\n /// @custom:error InsufficientPoolLiquidity If contract has less liquidity for tokenAddressOut than amountOutMantissa\\n function _doTransferOut(\\n address tokenAddressOut,\\n address to,\\n uint256 amountConvertedMantissa\\n ) internal {\\n uint256 maxTokenOutReserve = balanceOf(tokenAddressOut);\\n\\n /// If contract has less liquidity for tokenAddressOut than amountOutMantissa\\n if (maxTokenOutReserve < amountConvertedMantissa) {\\n revert InsufficientPoolLiquidity();\\n }\\n\\n _preTransferHook(tokenAddressOut, amountConvertedMantissa);\\n\\n IERC20Upgradeable tokenOut = IERC20Upgradeable(tokenAddressOut);\\n tokenOut.safeTransfer(to, amountConvertedMantissa);\\n }\\n\\n /// @notice Transfer tokenAddressIn from user to destination\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @return actualAmountIn Actual amount transferred to destination\\n function _doTransferIn(address tokenAddressIn, uint256 amountInMantissa) internal returns (uint256 actualAmountIn) {\\n IERC20Upgradeable tokenIn = IERC20Upgradeable(tokenAddressIn);\\n uint256 balanceBeforeDestination = tokenIn.balanceOf(destinationAddress);\\n tokenIn.safeTransferFrom(msg.sender, destinationAddress, amountInMantissa);\\n uint256 balanceAfterDestination = tokenIn.balanceOf(destinationAddress);\\n actualAmountIn = balanceAfterDestination - balanceBeforeDestination;\\n }\\n\\n /// @dev Sets a new price oracle\\n /// @param priceOracle_ Address of the new price oracle to set\\n /// @custom:event Emits PriceOracleUpdated event on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when price oracle address is zero\\n function _setPriceOracle(ResilientOracle priceOracle_) internal {\\n ensureNonzeroAddress(address(priceOracle_));\\n emit PriceOracleUpdated(priceOracle, priceOracle_);\\n priceOracle = priceOracle_;\\n }\\n\\n /// @dev Sets a new destination address\\n /// @param destinationAddress_ The new destination address to be set\\n /// @custom:event Emits DestinationAddressUpdated event on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when destination address is zero\\n function _setDestination(address destinationAddress_) internal {\\n ensureNonzeroAddress(destinationAddress_);\\n emit DestinationAddressUpdated(destinationAddress, destinationAddress_);\\n destinationAddress = destinationAddress_;\\n }\\n\\n /// @notice Sets a converter network contract address\\n /// @param converterNetwork_ The converterNetwork address to be set\\n /// @custom:event Emits ConverterNetworkAddressUpdated event on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when address is zero\\n function _setConverterNetwork(IConverterNetwork converterNetwork_) internal {\\n ensureNonzeroAddress(address(converterNetwork_));\\n emit ConverterNetworkAddressUpdated(address(converterNetwork), address(converterNetwork_));\\n converterNetwork = converterNetwork_;\\n }\\n\\n /// @notice Min amount to convert setter\\n /// @param minAmountToConvert_ Min amount to convert\\n /// @custom:event MinAmountToConvertUpdated is emitted in success\\n /// @custom:error ZeroValueNotAllowed is thrown if the provided value is 0\\n function _setMinAmountToConvert(uint256 minAmountToConvert_) internal {\\n ensureNonzeroValue(minAmountToConvert_);\\n emit MinAmountToConvertUpdated(minAmountToConvert, minAmountToConvert_);\\n minAmountToConvert = minAmountToConvert_;\\n }\\n\\n /// @dev Hook to perform after converting tokens\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @param amountIn Amount of tokenIn converted\\n /// @param amountOut Amount of tokenOut converted\\n function _postConversionHook(\\n address tokenAddressIn,\\n address tokenAddressOut,\\n uint256 amountIn,\\n uint256 amountOut\\n ) internal virtual {}\\n\\n /// @param accessControlManager_ Access control manager contract address\\n /// @param priceOracle_ Resilient oracle address\\n /// @param destinationAddress_ Address at all incoming tokens will transferred to\\n /// @param minAmountToConvert_ minimum amount to convert\\n function __AbstractTokenConverter_init(\\n address accessControlManager_,\\n ResilientOracle priceOracle_,\\n address destinationAddress_,\\n uint256 minAmountToConvert_\\n ) internal onlyInitializing {\\n __AccessControlled_init(accessControlManager_);\\n __ReentrancyGuard_init();\\n __AbstractTokenConverter_init_unchained(priceOracle_, destinationAddress_, minAmountToConvert_);\\n }\\n\\n /// @param priceOracle_ Resilient oracle address\\n /// @param destinationAddress_ Address at all incoming tokens will transferred to\\n /// @param minAmountToConvert_ minimum amount to convert\\n function __AbstractTokenConverter_init_unchained(\\n ResilientOracle priceOracle_,\\n address destinationAddress_,\\n uint256 minAmountToConvert_\\n ) internal onlyInitializing {\\n _setPriceOracle(priceOracle_);\\n _setDestination(destinationAddress_);\\n _setMinAmountToConvert(minAmountToConvert_);\\n conversionPaused = false;\\n }\\n\\n /// @dev _updateAssetsState hook to update the states of reserves transferred for the specific comptroller\\n /// @param comptroller Comptroller address (pool)\\n /// @param asset Asset address\\n /// @return Amount of asset, for _privateConversion\\n function _updateAssetsState(address comptroller, address asset) internal virtual returns (uint256) {}\\n\\n /// @dev This method is used to convert asset into base asset by converting them with other converters which supports the pair and transfer the funds to\\n /// destination contract as destination's base asset\\n /// @param comptroller Comptroller address (pool)\\n /// @param tokenAddressOut Address of the token transferred to converter, and through _privateConversion it will be converted into base asset\\n /// @param amountToConvert Amount of the tokenAddressOut transferred to converter\\n function _privateConversion(\\n address comptroller,\\n address tokenAddressOut,\\n uint256 amountToConvert\\n ) internal {\\n address tokenAddressIn = _getDestinationBaseAsset();\\n address _destinationAddress = destinationAddress;\\n uint256 convertedTokenInBalance;\\n if (address(converterNetwork) != address(0)) {\\n (address[] memory converterAddresses, uint256[] memory converterBalances) = converterNetwork\\n .findTokenConvertersForConverters(tokenAddressOut, tokenAddressIn);\\n uint256 convertersLength = converterAddresses.length;\\n for (uint256 i; i < convertersLength; ) {\\n if (converterBalances[i] == 0) break;\\n (, uint256 amountIn) = IAbstractTokenConverter(converterAddresses[i]).getUpdatedAmountIn(\\n converterBalances[i],\\n tokenAddressOut,\\n tokenAddressIn\\n );\\n if (amountIn > amountToConvert) {\\n amountIn = amountToConvert;\\n }\\n\\n if (!_validateMinAmountToConvert(amountIn, tokenAddressOut)) {\\n break;\\n }\\n\\n uint256 balanceBefore = IERC20Upgradeable(tokenAddressIn).balanceOf(_destinationAddress);\\n\\n IERC20Upgradeable(tokenAddressOut).approve(converterAddresses[i], amountIn);\\n IAbstractTokenConverter(converterAddresses[i]).convertExactTokens(\\n amountIn,\\n 0,\\n tokenAddressOut,\\n tokenAddressIn,\\n _destinationAddress\\n );\\n\\n uint256 balanceAfter = IERC20Upgradeable(tokenAddressIn).balanceOf(_destinationAddress);\\n amountToConvert -= amountIn;\\n convertedTokenInBalance += (balanceAfter - balanceBefore);\\n\\n if (amountToConvert == 0) break;\\n unchecked {\\n ++i;\\n }\\n }\\n }\\n\\n _postPrivateConversionHook(\\n comptroller,\\n tokenAddressIn,\\n convertedTokenInBalance,\\n tokenAddressOut,\\n amountToConvert\\n );\\n }\\n\\n /// @dev This hook is used to update states for the converter after the privateConversion\\n /// @param comptroller Comptroller address (pool)\\n /// @param tokenAddressIn Address of the destination's base asset\\n /// @param convertedTokenInBalance Amount of the base asset received after the conversion\\n /// @param tokenAddressOut Address of the asset transferred to other converter in exchange of base asset\\n /// @param convertedTokenOutBalance Amount of tokenAddressOut transferred from this converter\\n function _postPrivateConversionHook(\\n address comptroller,\\n address tokenAddressIn,\\n uint256 convertedTokenInBalance,\\n address tokenAddressOut,\\n uint256 convertedTokenOutBalance\\n ) internal virtual {}\\n\\n /// @notice This hook is used to update the state for asset reserves before transferring tokenOut to user\\n /// @param tokenOutAddress Address of the asset to be transferred to the user\\n /// @param amountOut Amount of tokenAddressOut transferred from this converter\\n function _preTransferHook(address tokenOutAddress, uint256 amountOut) internal virtual {}\\n\\n /// @dev Checks if amount to convert is greater than minimum amount to convert or not\\n /// @param amountIn The amount to convert\\n /// @param tokenAddress Address of the token\\n /// @return isValid true if amount to convert is greater than minimum amount to convert\\n function _validateMinAmountToConvert(uint256 amountIn, address tokenAddress) internal returns (bool isValid) {\\n priceOracle.updateAssetPrice(tokenAddress);\\n uint256 amountInInUsd = (priceOracle.getPrice(tokenAddress) * amountIn) / EXP_SCALE;\\n\\n if (amountInInUsd >= minAmountToConvert) {\\n isValid = true;\\n }\\n }\\n\\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn\\n /// @dev This function retrieves values without altering token prices.\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\\n /// @return tokenInToOutConversion Ratio of tokenIn price and incentive for conversion with tokenOut price\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n function _getAmountOut(\\n uint256 amountInMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) internal view returns (uint256 amountOutMantissa, uint256 tokenInToOutConversion) {\\n if (amountInMantissa == 0) {\\n revert InsufficientInputAmount();\\n }\\n\\n ConversionConfig memory configuration = conversionConfigurations[tokenAddressIn][tokenAddressOut];\\n\\n if (configuration.conversionAccess == ConversionAccessibility.NONE) {\\n revert ConversionConfigNotEnabled();\\n }\\n\\n uint256 tokenInUnderlyingPrice = priceOracle.getPrice(tokenAddressIn);\\n uint256 tokenOutUnderlyingPrice = priceOracle.getPrice(tokenAddressOut);\\n\\n uint256 incentive = configuration.incentive;\\n if (address(converterNetwork) != address(0) && (converterNetwork.isTokenConverter(msg.sender))) {\\n incentive = 0;\\n }\\n\\n /// conversion rate after considering incentive(conversionWithIncentive)\\n uint256 conversionWithIncentive = MANTISSA_ONE + incentive;\\n\\n /// amount of tokenAddressOut after including incentive as amountOutMantissa will be greater than actual as it gets\\n /// multiplied by conversionWithIncentive which will be >= 1\\n amountOutMantissa =\\n (amountInMantissa * tokenInUnderlyingPrice * conversionWithIncentive) /\\n (tokenOutUnderlyingPrice * EXP_SCALE);\\n\\n tokenInToOutConversion = (tokenInUnderlyingPrice * conversionWithIncentive) / tokenOutUnderlyingPrice;\\n }\\n\\n /// @dev To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut\\n /// @dev This function retrieves values without altering token prices.\\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\\n /// @return tokenInToOutConversion Ratio of tokenIn price and incentive for conversion with tokenOut price\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n function _getAmountIn(\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) internal view returns (uint256 amountInMantissa, uint256 tokenInToOutConversion) {\\n if (amountOutMantissa == 0) {\\n revert InsufficientOutputAmount();\\n }\\n\\n ConversionConfig memory configuration = conversionConfigurations[tokenAddressIn][tokenAddressOut];\\n\\n if (configuration.conversionAccess == ConversionAccessibility.NONE) {\\n revert ConversionConfigNotEnabled();\\n }\\n\\n uint256 tokenInUnderlyingPrice = priceOracle.getPrice(tokenAddressIn);\\n uint256 tokenOutUnderlyingPrice = priceOracle.getPrice(tokenAddressOut);\\n\\n uint256 incentive = configuration.incentive;\\n if ((address(converterNetwork) != address(0)) && (converterNetwork.isTokenConverter(msg.sender))) {\\n incentive = 0;\\n }\\n\\n /// conversion rate after considering incentive(conversionWithIncentive)\\n uint256 conversionWithIncentive = MANTISSA_ONE + incentive;\\n tokenInToOutConversion = (tokenInUnderlyingPrice * conversionWithIncentive) / tokenOutUnderlyingPrice;\\n\\n /// amount of tokenAddressIn after considering incentive(i.e. amountInMantissa will be less than actual amountInMantissa if incentive > 0)\\n amountInMantissa = ((amountOutMantissa * EXP_SCALE) + tokenInToOutConversion - 1) / tokenInToOutConversion; //round-up\\n }\\n\\n /// @dev Check if msg.sender is allowed to convert as per onlyForPrivateConversions flag\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @custom:error ConversionEnabledOnlyForPrivateConversions is thrown when conversion is only enabled for private conversion\\n function _checkPrivateConversion(address tokenAddressIn, address tokenAddressOut) internal view {\\n bool isConverter = (address(converterNetwork) != address(0)) && converterNetwork.isTokenConverter(msg.sender);\\n if (\\n (!(isConverter) &&\\n (conversionConfigurations[tokenAddressIn][tokenAddressOut].conversionAccess ==\\n ConversionAccessibility.ONLY_FOR_CONVERTERS))\\n ) {\\n revert ConversionEnabledOnlyForPrivateConversions();\\n }\\n }\\n\\n /// @dev To check, is conversion paused\\n /// @custom:error ConversionTokensPaused is thrown when token conversion is paused\\n function _checkConversionPaused() internal view {\\n if (conversionPaused) {\\n revert ConversionTokensPaused();\\n }\\n }\\n\\n /// @dev Get base asset address of the destination contract\\n /// @return Address of the base asset\\n function _getDestinationBaseAsset() internal view virtual returns (address) {}\\n}\\n\",\"keccak256\":\"0xe10a4505a941511a1e57e162dc5b7d6e4874e40ad421828bc4d6366b51b5608c\",\"license\":\"BSD-3-Clause\"},\"contracts/TokenConverter/IAbstractTokenConverter.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\nimport { ResilientOracle } from \\\"@venusprotocol/oracle/contracts/ResilientOracle.sol\\\";\\nimport { IConverterNetwork } from \\\"../Interfaces/IConverterNetwork.sol\\\";\\n\\n/// @notice Interface for AbstractTokenConverter\\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\\ninterface IAbstractTokenConverter {\\n /// @notice This enum define the all possible ways of conversion can happen\\n enum ConversionAccessibility {\\n NONE, // Conversion is disable for the pair\\n ALL, // Conversion is enable for private conversion and users\\n ONLY_FOR_CONVERTERS, // Conversion is enable only for private conversion\\n ONLY_FOR_USERS // Conversion is enable only for users\\n }\\n\\n /// @notice This struct represents the configuration for a token conversion.\\n struct ConversionConfig {\\n /// incentive on conversion of tokens in mantissa i.e 10% incentive would be 0.1 * 1e18\\n uint256 incentive;\\n /// enable or disable conversion for users or converters or both or none\\n ConversionAccessibility conversionAccess;\\n }\\n\\n /// @notice Pause conversion of tokens\\n function pauseConversion() external;\\n\\n /// @notice Resume conversion of tokens.\\n function resumeConversion() external;\\n\\n /// @notice Sets a new price oracle\\n /// @param priceOracle_ Address of the new price oracle to set\\n function setPriceOracle(ResilientOracle priceOracle_) external;\\n\\n /// @notice Set the configuration for new or existing convert pair\\n /// @param tokenAddressIn Address of tokenIn\\n /// @param tokenAddressOut Address of tokenOut\\n /// @param conversionConfig ConversionConfig config details to update\\n function setConversionConfig(\\n address tokenAddressIn,\\n address tokenAddressOut,\\n ConversionConfig calldata conversionConfig\\n ) external;\\n\\n /// @notice Convert exact amount of tokenAddressIn for tokenAddressOut\\n /// @dev Method does not support deflationary tokens transfer\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after convert\\n /// @param to Address of the tokenAddressOut receiver\\n function convertExactTokens(\\n uint256 amountInMantissa,\\n uint256 amountOutMinMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n ) external returns (uint256 actualAmountIn, uint256 actualAmountOut);\\n\\n /// @notice Convert tokens for tokenAddressIn for exact amount of tokenAddressOut\\n /// @dev Method does not support deflationary tokens transfer\\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after convert\\n /// @param to Address of the tokenAddressOut receiver\\n function convertForExactTokens(\\n uint256 amountInMaxMantissa,\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n ) external returns (uint256 actualAmountIn, uint256 actualAmountOut);\\n\\n /// @notice Convert exact amount of tokenAddressIn for tokenAddressOut\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after convert\\n /// @param to Address of the tokenAddressOut receiver\\n function convertExactTokensSupportingFeeOnTransferTokens(\\n uint256 amountInMantissa,\\n uint256 amountOutMinMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n ) external returns (uint256 actualAmountIn, uint256 actualAmountOut);\\n\\n /// @notice Convert tokens for tokenAddressIn for exact amount of tokenAddressOut\\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after convert\\n /// @param to Address of the tokenAddressOut receiver\\n function convertForExactTokensSupportingFeeOnTransferTokens(\\n uint256 amountInMaxMantissa,\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n ) external returns (uint256 actualAmountIn, uint256 actualAmountOut);\\n\\n /// @notice Get the configuration for the pair of the tokens\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return incentives Percentage of incentives to be distributed for the pair of tokens\\n /// @return conversionAccess Accessibility for the pair of tokens\\n function conversionConfigurations(address tokenAddressIn, address tokenAddressOut)\\n external\\n returns (uint256 incentives, ConversionAccessibility conversionAccess);\\n\\n /// @notice Get the address of the converterNetwork\\n function converterNetwork() external returns (IConverterNetwork converterNetwork);\\n\\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountConvertedMantissa Amount of tokenAddressIn should be transferred after conversion\\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n function getUpdatedAmountOut(\\n uint256 amountInMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) external returns (uint256 amountConvertedMantissa, uint256 amountOutMantissa);\\n\\n /// @notice To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut\\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountConvertedMantissa Amount of tokenAddressOut should be transferred after conversion\\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n function getUpdatedAmountIn(\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) external returns (uint256 amountConvertedMantissa, uint256 amountInMantissa);\\n\\n /// @notice To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut\\n /// @dev This function retrieves values without altering token prices.\\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountConvertedMantissa Amount of tokenAddressOut should be transferred after conversion\\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n function getAmountIn(\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) external view returns (uint256 amountConvertedMantissa, uint256 amountInMantissa);\\n\\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn\\n /// @dev This function retrieves values without altering token prices.\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountConvertedMantissa Amount of tokenAddressIn should be transferred after conversion\\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n function getAmountOut(\\n uint256 amountInMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) external view returns (uint256 amountConvertedMantissa, uint256 amountOutMantissa);\\n\\n /// @notice Get the balance for specific token\\n /// @param token Address of the token\\n /// @return tokenBalance Balance of the token the contract has\\n function balanceOf(address token) external view returns (uint256 tokenBalance);\\n}\\n\",\"keccak256\":\"0xc677c12e2f04e520fb1fa02a1f06ad37d821cfebb5aa8f4bd7a22410648a0aae\",\"license\":\"BSD-3-Clause\"},\"contracts/TokenConverter/RiskFundConverter.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\nimport { SafeERC20Upgradeable } from \\\"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\\\";\\nimport { IERC20Upgradeable } from \\\"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\\\";\\nimport { ResilientOracle } from \\\"@venusprotocol/oracle/contracts/ResilientOracle.sol\\\";\\nimport { ensureNonzeroAddress, ensureNonzeroValue } from \\\"@venusprotocol/solidity-utilities/contracts/validators.sol\\\";\\n\\nimport { AbstractTokenConverter } from \\\"./AbstractTokenConverter.sol\\\";\\nimport { IPoolRegistry } from \\\"../Interfaces/IPoolRegistry.sol\\\";\\nimport { IComptroller } from \\\"../Interfaces/IComptroller.sol\\\";\\nimport { IRiskFund, IRiskFundGetters } from \\\"../Interfaces/IRiskFund.sol\\\";\\nimport { IVToken } from \\\"../Interfaces/IVToken.sol\\\";\\n\\n/// @title RiskFundConverter\\n/// @author Venus\\n/// @notice RiskFundConverter used for token conversions and sends received token to RiskFund\\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\\ncontract RiskFundConverter is AbstractTokenConverter {\\n using SafeERC20Upgradeable for IERC20Upgradeable;\\n\\n /// @notice Address of the core pool comptroller\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address public immutable CORE_POOL_COMPTROLLER;\\n\\n ///@notice Address of the vBNB\\n ///@dev This address is used to include the BNB market while in getPools method\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address public immutable VBNB;\\n\\n ///@notice Address of the native wrapped currency\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address public immutable NATIVE_WRAPPED;\\n\\n /// @notice Store the previous state for the asset transferred to ProtocolShareReserve combined(for all pools)\\n mapping(address => uint256) internal assetsReserves;\\n\\n /// @notice Store the asset's reserve per pool in the ProtocolShareReserve\\n /// @dev Comptroller(pool) -> Asset -> amount\\n mapping(address => mapping(address => uint256)) internal poolsAssetsReserves;\\n\\n /// @notice Address of pool registry contract\\n address public poolRegistry;\\n\\n /// @notice The mapping contains the assets for each pool which are sent to RiskFund directly\\n /// @dev Comptroller(pool) -> Asset -> bool(should transfer directly on true)\\n mapping(address => mapping(address => bool)) public poolsAssetsDirectTransfer;\\n\\n /// @notice Emitted when pool registry address is updated\\n event PoolRegistryUpdated(address indexed oldPoolRegistry, address indexed newPoolRegistry);\\n\\n /// @notice Emitted after updating of the assets reserves\\n /// amount -> reserve increased by amount\\n event AssetsReservesUpdated(address indexed comptroller, address indexed asset, uint256 amount);\\n\\n /// @notice Emmitted after the funds transferred to the destination address\\n event AssetTransferredToDestination(\\n address indexed receiver,\\n address indexed comptroller,\\n address indexed asset,\\n uint256 amount\\n );\\n\\n /// @notice Emitted after the poolsAssetsDirectTransfer mapping is updated\\n event PoolAssetsDirectTransferUpdated(address indexed comptroller, address indexed asset, bool value);\\n\\n // Error thrown when comptrollers array length is not equal to assets array length\\n error InvalidArguments();\\n\\n /// @notice thrown when amount entered is greater than balance\\n error InsufficientBalance();\\n\\n /// @notice thrown when asset does not exist in the pool\\n error MarketNotExistInPool(address comptroller, address asset);\\n\\n /// @notice thrown to prevent reentrancy\\n /// @dev This error is used to safeguard against reentrancy attacks, ensuring that a certain operation\\n /// cannot be called recursively within the same transaction.\\n error ReentrancyGuardError();\\n\\n /// @param corePoolComptroller_ Address of the Comptroller pool\\n /// @param vBNB_ Address of the vBNB\\n /// @param nativeWrapped_ Address of the wrapped native currency\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(\\n address corePoolComptroller_,\\n address vBNB_,\\n address nativeWrapped_\\n ) {\\n ensureNonzeroAddress(corePoolComptroller_);\\n ensureNonzeroAddress(vBNB_);\\n ensureNonzeroAddress(nativeWrapped_);\\n\\n CORE_POOL_COMPTROLLER = corePoolComptroller_;\\n VBNB = vBNB_;\\n NATIVE_WRAPPED = nativeWrapped_;\\n\\n // Note that the contract is upgradeable. Use initialize() or reinitializers\\n // to set the state variables.\\n _disableInitializers();\\n }\\n\\n /// @param accessControlManager_ Access control manager contract address\\n /// @param priceOracle_ Resilient oracle address\\n /// @param destinationAddress_ Address at all incoming tokens will transferred to\\n /// @param poolRegistry_ Address of the pool registry\\n /// @param minAmountToConvert_ minimum amount to convert\\n /// @param comptrollers Addresses of the pools\\n /// @param assets Addresses of the assets need to be added for direct transfer\\n /// @param values Boolean value to indicate whether direct transfer is allowed for each asset.\\n /// @custom:event PoolAssetsDirectTransferUpdated emits on success\\n function initialize(\\n address accessControlManager_,\\n ResilientOracle priceOracle_,\\n address destinationAddress_,\\n address poolRegistry_,\\n uint256 minAmountToConvert_,\\n address[] calldata comptrollers,\\n address[][] calldata assets,\\n bool[][] calldata values\\n ) public initializer {\\n // Initialize AbstractTokenConverter\\n __AbstractTokenConverter_init(accessControlManager_, priceOracle_, destinationAddress_, minAmountToConvert_);\\n ensureNonzeroAddress(poolRegistry_);\\n poolRegistry = poolRegistry_;\\n _setPoolsAssetsDirectTransfer(comptrollers, assets, values);\\n }\\n\\n /// @dev Pool registry setter\\n /// @param poolRegistry_ Address of the pool registry\\n /// @custom:event PoolRegistryUpdated emits on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when pool registry address is zero\\n /// @custom:access Only Governance\\n function setPoolRegistry(address poolRegistry_) external onlyOwner {\\n ensureNonzeroAddress(poolRegistry_);\\n emit PoolRegistryUpdated(poolRegistry, poolRegistry_);\\n poolRegistry = poolRegistry_;\\n }\\n\\n /// @notice Update the poolsAssetsDirectTransfer mapping\\n /// @param comptrollers Addresses of the pools\\n /// @param assets Addresses of the assets need to be added for direct transfer\\n /// @param values Boolean value to indicate whether direct transfer is allowed for each asset.\\n /// @custom:event PoolAssetsDirectTransferUpdated emits on success\\n /// @custom:access Restricted by ACM\\n function setPoolsAssetsDirectTransfer(\\n address[] calldata comptrollers,\\n address[][] calldata assets,\\n bool[][] calldata values\\n ) external {\\n _checkAccessAllowed(\\\"setPoolsAssetsDirectTransfer(address[],address[][],bool[][])\\\");\\n _setPoolsAssetsDirectTransfer(comptrollers, assets, values);\\n }\\n\\n /// @dev Get the Amount of the asset in the risk fund for the specific pool\\n /// @param comptroller Comptroller address (pool)\\n /// @param asset Asset address\\n /// @return reserves Asset's reserve in risk fund\\n /// @custom:error MarketNotExistInPool When asset does not exist in the pool(comptroller)\\n /// @custom:error ReentrancyGuardError thrown to prevent reentrancy during the function execution\\n function getPoolAssetReserve(address comptroller, address asset) external view returns (uint256 reserves) {\\n if (_reentrancyGuardEntered()) revert ReentrancyGuardError();\\n if (!ensureAssetListed(comptroller, asset)) revert MarketNotExistInPool(comptroller, asset);\\n\\n reserves = poolsAssetsReserves[comptroller][asset];\\n }\\n\\n /// @notice Get the balance for specific token\\n /// @param tokenAddress Address of the token\\n /// @return tokenBalance Reserves of the token the contract has\\n function balanceOf(address tokenAddress) public view override returns (uint256 tokenBalance) {\\n tokenBalance = assetsReserves[tokenAddress];\\n }\\n\\n /// @notice Get the array of all pools addresses\\n /// @param tokenAddress Address of the token\\n /// @return poolsWithCore Array of the pools addresses in which token is available\\n function getPools(address tokenAddress) public view returns (address[] memory poolsWithCore) {\\n poolsWithCore = IPoolRegistry(poolRegistry).getPoolsSupportedByAsset(tokenAddress);\\n\\n if (isAssetListedInCore(tokenAddress)) {\\n uint256 poolsLength = poolsWithCore.length;\\n address[] memory extendedPools = new address[](poolsLength + 1);\\n\\n for (uint256 i; i < poolsLength; ) {\\n extendedPools[i] = poolsWithCore[i];\\n unchecked {\\n ++i;\\n }\\n }\\n\\n extendedPools[poolsLength] = CORE_POOL_COMPTROLLER;\\n poolsWithCore = extendedPools;\\n }\\n }\\n\\n /// @dev This hook is used to update the state for asset reserves before transferring tokenOut to user\\n /// @param tokenOutAddress Address of the asset to be transferred to the user\\n /// @param amountOut Amount of tokenAddressOut transferred from this converter\\n function _preTransferHook(address tokenOutAddress, uint256 amountOut) internal override {\\n assetsReserves[tokenOutAddress] -= amountOut;\\n }\\n\\n /// @notice Hook to perform after converting tokens\\n /// @dev After transformation poolsAssetsReserves are settled by pool's reserves fraction\\n /// @param tokenInAddress Address of the tokenIn\\n /// @param tokenOutAddress Address of the tokenOut\\n /// @param amountIn Amount of tokenIn transferred\\n /// @param amountOut Amount of tokenOut transferred\\n /// @custom:event AssetTransferredToDestination emits on success for each pool which has share\\n function _postConversionHook(\\n address tokenInAddress,\\n address tokenOutAddress,\\n uint256 amountIn,\\n uint256 amountOut\\n ) internal override {\\n address[] memory pools = getPools(tokenOutAddress);\\n uint256 assetReserve = assetsReserves[tokenOutAddress] + amountOut;\\n ensureNonzeroValue(assetReserve);\\n\\n uint256 poolsLength = pools.length;\\n uint256 distributedOutShare;\\n uint256 poolAmountInShare;\\n uint256 distributedInShare;\\n\\n for (uint256 i; i < poolsLength; ) {\\n uint256 currentPoolsAssetsReserves = poolsAssetsReserves[pools[i]][tokenOutAddress];\\n if (currentPoolsAssetsReserves != 0) {\\n if (i < (poolsLength - 1)) {\\n distributedOutShare += updatePoolAssetsReserve(pools[i], tokenOutAddress, amountOut, assetReserve);\\n poolAmountInShare = (amountIn * currentPoolsAssetsReserves) / assetReserve;\\n distributedInShare += poolAmountInShare;\\n } else {\\n uint256 distributedDiff = amountOut - distributedOutShare;\\n poolsAssetsReserves[pools[i]][tokenOutAddress] -= distributedDiff;\\n emit AssetsReservesUpdated(pools[i], tokenOutAddress, distributedDiff);\\n poolAmountInShare = amountIn - distributedInShare;\\n }\\n emit AssetTransferredToDestination(destinationAddress, pools[i], tokenInAddress, poolAmountInShare);\\n IRiskFund(destinationAddress).updatePoolState(pools[i], tokenInAddress, poolAmountInShare);\\n }\\n unchecked {\\n ++i;\\n }\\n }\\n }\\n\\n /// @dev Operations to perform before sweeping tokens\\n /// @param tokenAddress Address of the token\\n /// @param amount Amount transferred to address(to)\\n /// @custom:error InsufficientBalance is thrown when amount entered is greater than balance of token\\n function preSweepToken(address tokenAddress, uint256 amount) internal override {\\n uint256 balance = IERC20Upgradeable(tokenAddress).balanceOf(address(this));\\n if (amount > balance) revert InsufficientBalance();\\n uint256 balanceDiff = balance - assetsReserves[tokenAddress];\\n\\n if (balanceDiff < amount) {\\n uint256 amountDiff;\\n unchecked {\\n amountDiff = amount - balanceDiff;\\n }\\n\\n address[] memory pools = getPools(tokenAddress);\\n uint256 assetReserve = assetsReserves[tokenAddress];\\n uint256 poolsLength = pools.length;\\n uint256 distributedShare;\\n\\n for (uint256 i; i < poolsLength; ) {\\n if (poolsAssetsReserves[pools[i]][tokenAddress] != 0) {\\n if (i < (poolsLength - 1)) {\\n distributedShare += updatePoolAssetsReserve(pools[i], tokenAddress, amountDiff, assetReserve);\\n } else {\\n uint256 distributedDiff = amountDiff - distributedShare;\\n poolsAssetsReserves[pools[i]][tokenAddress] -= distributedDiff;\\n emit AssetsReservesUpdated(pools[i], tokenAddress, distributedDiff);\\n }\\n }\\n unchecked {\\n ++i;\\n }\\n }\\n assetsReserves[tokenAddress] -= amountDiff;\\n }\\n }\\n\\n /// @dev Update the poolAssetsReserves upon transferring the tokens\\n /// @param pool Address of the pool\\n /// @param tokenAddress Address of the token\\n /// @param amount Amount transferred to address(to)\\n /// @param assetReserve Asset's reserve for the pool\\n /// @return poolAmountShare Share of the pool as per it's reserve in compare to total reserves for the asset\\n /// @custom:event AssetsReservesUpdated emits on success\\n function updatePoolAssetsReserve(\\n address pool,\\n address tokenAddress,\\n uint256 amount,\\n uint256 assetReserve\\n ) internal returns (uint256 poolAmountShare) {\\n poolAmountShare = (poolsAssetsReserves[pool][tokenAddress] * amount) / assetReserve;\\n poolsAssetsReserves[pool][tokenAddress] -= poolAmountShare;\\n emit AssetsReservesUpdated(pool, tokenAddress, poolAmountShare);\\n }\\n\\n /// @dev Update the poolsAssetsDirectTransfer mapping\\n /// @param comptrollers Addresses of the pools\\n /// @param assets Addresses of the assets need to be added for direct transfer\\n /// @param values Boolean value to indicate whether direct transfer is allowed for each asset.\\n /// @custom:event PoolAssetsDirectTransferUpdated emits on success\\n /// @custom:error InvalidArguments thrown when comptrollers array length is not equal to assets array length\\n function _setPoolsAssetsDirectTransfer(\\n address[] calldata comptrollers,\\n address[][] calldata assets,\\n bool[][] calldata values\\n ) internal {\\n uint256 comptrollersLength = comptrollers.length;\\n\\n if ((comptrollersLength != assets.length) || (comptrollersLength != values.length)) {\\n revert InvalidArguments();\\n }\\n\\n for (uint256 i; i < comptrollersLength; ) {\\n address[] memory poolAssets = assets[i];\\n bool[] memory assetsValues = values[i];\\n uint256 poolAssetsLength = poolAssets.length;\\n\\n if (poolAssetsLength != assetsValues.length) {\\n revert InvalidArguments();\\n }\\n\\n for (uint256 j; j < poolAssetsLength; ) {\\n poolsAssetsDirectTransfer[comptrollers[i]][poolAssets[j]] = assetsValues[j];\\n emit PoolAssetsDirectTransferUpdated(comptrollers[i], poolAssets[j], assetsValues[j]);\\n unchecked {\\n ++j;\\n }\\n }\\n\\n unchecked {\\n ++i;\\n }\\n }\\n }\\n\\n /// @dev Update the reserve of the asset for the specific pool after transferring to risk fund\\n /// and transferring funds to the protocol share reserve\\n /// @param comptroller Comptroller address (pool)\\n /// @param asset Asset address\\n /// @return balanceDifference Amount of asset, for _privateConversion\\n /// @custom:event AssetTransferredToDestination emits when poolsAssetsDirectTransfer is enabled for entered comptroller and asset\\n /// @custom:error MarketNotExistInPool When asset does not exist in the pool(comptroller)\\n function _updateAssetsState(address comptroller, address asset)\\n internal\\n override\\n returns (uint256 balanceDifference)\\n {\\n if (!ensureAssetListed(comptroller, asset)) revert MarketNotExistInPool(comptroller, asset);\\n\\n IERC20Upgradeable token = IERC20Upgradeable(asset);\\n uint256 currentBalance = token.balanceOf(address(this));\\n uint256 assetReserve = assetsReserves[asset];\\n if (currentBalance > assetReserve) {\\n unchecked {\\n balanceDifference = currentBalance - assetReserve;\\n }\\n if (poolsAssetsDirectTransfer[comptroller][asset]) {\\n uint256 previousDestinationBalance = token.balanceOf(destinationAddress);\\n token.safeTransfer(destinationAddress, balanceDifference);\\n uint256 newDestinationBalance = token.balanceOf(destinationAddress);\\n\\n emit AssetTransferredToDestination(destinationAddress, comptroller, asset, balanceDifference);\\n IRiskFund(destinationAddress).updatePoolState(\\n comptroller,\\n asset,\\n newDestinationBalance - previousDestinationBalance\\n );\\n balanceDifference = 0;\\n }\\n }\\n }\\n\\n /// @dev This hook is used to update states for the converter after the privateConversion\\n /// @param comptroller Comptroller address (pool)\\n /// @param tokenAddressIn Address of the destination's base asset\\n /// @param convertedTokenInBalance Amount of the base asset received after the conversion\\n /// @param tokenAddressOut Address of the asset transferred to other converter in exchange of base asset\\n /// @param convertedTokenOutBalance Amount of tokenAddressOut transferred from this converter\\n function _postPrivateConversionHook(\\n address comptroller,\\n address tokenAddressIn,\\n uint256 convertedTokenInBalance,\\n address tokenAddressOut,\\n uint256 convertedTokenOutBalance\\n ) internal override {\\n if (convertedTokenInBalance > 0) {\\n emit AssetTransferredToDestination(\\n destinationAddress,\\n comptroller,\\n tokenAddressIn,\\n convertedTokenInBalance\\n );\\n IRiskFund(destinationAddress).updatePoolState(comptroller, tokenAddressIn, convertedTokenInBalance);\\n }\\n if (convertedTokenOutBalance > 0) {\\n assetsReserves[tokenAddressOut] += convertedTokenOutBalance;\\n poolsAssetsReserves[comptroller][tokenAddressOut] += convertedTokenOutBalance;\\n emit AssetsReservesUpdated(comptroller, tokenAddressOut, convertedTokenOutBalance);\\n }\\n }\\n\\n /// @dev This function checks for the given asset is listed in core pool or not\\n /// @param tokenAddress Address of the asset\\n /// @return isAssetListed true if the asset is listed\\n function isAssetListedInCore(address tokenAddress) internal view returns (bool isAssetListed) {\\n address[] memory coreMarkets = IComptroller(CORE_POOL_COMPTROLLER).getAllMarkets();\\n\\n uint256 coreMarketsLength = coreMarkets.length;\\n for (uint256 i; i < coreMarketsLength; ) {\\n isAssetListed = (VBNB == coreMarkets[i])\\n ? (tokenAddress == NATIVE_WRAPPED)\\n : (IVToken(coreMarkets[i]).underlying() == tokenAddress);\\n\\n if (isAssetListed) {\\n break;\\n }\\n\\n unchecked {\\n ++i;\\n }\\n }\\n }\\n\\n /// @dev This function checks for the given asset is listed or not\\n /// @param comptroller Address of the comptroller\\n /// @param asset Address of the asset\\n /// @return isListed true if the asset is listed\\n function ensureAssetListed(address comptroller, address asset) internal view returns (bool isListed) {\\n if (comptroller == CORE_POOL_COMPTROLLER) {\\n isListed = isAssetListedInCore(asset);\\n } else {\\n isListed = IPoolRegistry(poolRegistry).getVTokenForAsset(comptroller, asset) != address(0);\\n }\\n }\\n\\n /// @dev Get base asset address of the RiskFund\\n /// @return destinationBaseAsset Address of the base asset(RiskFund)\\n function _getDestinationBaseAsset() internal view override returns (address destinationBaseAsset) {\\n destinationBaseAsset = IRiskFundGetters(destinationAddress).convertibleBaseAsset();\\n }\\n}\\n\",\"keccak256\":\"0xa9fda55440f25049f1946980b801723cf2111584253a1c11ac1bb7d773cbe39e\",\"license\":\"BSD-3-Clause\"}},\"version\":1}", - "bytecode": "0x60e06040523480156200001157600080fd5b5060405162005a8738038062005a8783398101604081905262000034916200018a565b6200003f8362000081565b6200004a8262000081565b620000558162000081565b6001600160a01b0380841660805282811660a052811660c05262000078620000ac565b505050620001d4565b6001600160a01b038116620000a9576040516342bcdf7f60e11b815260040160405180910390fd5b50565b600054610100900460ff1615620001195760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff908116146200016b576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b80516001600160a01b03811681146200018557600080fd5b919050565b600080600060608486031215620001a057600080fd5b620001ab846200016d565b9250620001bb602085016200016d565b9150620001cb604085016200016d565b90509250925092565b60805160a05160c05161586062000227600039600081816103e20152612d080152600081816103bb0152612c450152600081816106c501528181610d7a01528181612b8c015261346501526158606000f3fe608060405234801561001057600080fd5b50600436106102e95760003560e01c806370a0823111610191578063b6828c57116100e3578063e30c397811610097578063f2fde38b11610071578063f2fde38b146106ad578063fa7b81a0146106c0578063fe3da984146106e757600080fd5b8063e30c397814610676578063f04c318714610687578063f0dc7e9d1461069a57600080fd5b8063c0654646116100c8578063c065464614610641578063ca32546914610654578063e2ff7ea21461066757600080fd5b8063b6828c5714610626578063bc368b041461063957600080fd5b80638da5cb5b11610145578063afcff50f1161011f578063afcff50f146105be578063b491ddf7146105d2578063b4a0bdf31461061557600080fd5b80638da5cb5b1461058757806390fa7b5414610598578063aac59a75146105ab57600080fd5b8063746460a911610176578063746460a91461055957806379ba50971461056c5780637b77cd6a1461057457600080fd5b806370a0823114610527578063715018a61461055157600080fd5b806352e21a181161024a5780635c39f467116101fe5780636daa463b116101d85780636daa463b146104e05780636f1a30a8146104f35780636fb052751461050657600080fd5b80635c39f4671461049a5780635e1e6325146104ba57806364aff9ec146104cd57600080fd5b8063553745221161022f578063553745221461046c578063556bbd8a1461047f57806358b904df1461049257600080fd5b806352e21a1814610446578063530e784f1461045957600080fd5b80632630c12f116102a1578063362b679511610286578063362b6795146103dd578063439727a514610404578063454900fe1461041757600080fd5b80632630c12f146103a35780633421fc52146103b657600080fd5b80630a0a05e6116102d25780630a0a05e6146103535780630a9a2b72146103685780630e32cb861461039057600080fd5b806301e20178146102ee57806307aa239e1461031e575b600080fd5b60ff54610301906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b60fe546103439074010000000000000000000000000000000000000000900460ff1681565b6040519015158152602001610315565b610366610361366004614db1565b6106f0565b005b61037b610376366004614dce565b610704565b60408051928352602083019190915201610315565b61036661039e366004614db1565b6107bf565b60fc54610301906001600160a01b031681565b6103017f000000000000000000000000000000000000000000000000000000000000000081565b6103017f000000000000000000000000000000000000000000000000000000000000000081565b61037b610412366004614e10565b6107d0565b610343610425366004614e6f565b61013060209081526000928352604080842090915290825290205460ff1681565b610366610454366004614db1565b61091a565b610366610467366004614db1565b61092b565b61036661047a366004614ef4565b61093c565b61036661048d366004614f8e565b610973565b610366610b4a565b6104ad6104a8366004614db1565b610c30565b604051610315919061507b565b61037b6104c8366004614dce565b610dcc565b6103666104db3660046150c8565b610eca565b61037b6104ee366004614dce565b610f71565b61037b610501366004614dce565b61107a565b610519610514366004614e6f565b611179565b604051908152602001610315565b610519610535366004614db1565b6001600160a01b0316600090815261012d602052604090205490565b61036661123e565b610366610567366004615109565b611252565b610366611299565b610366610582366004614db1565b611324565b6033546001600160a01b0316610301565b61037b6105a6366004614e10565b6113ab565b6103666105b9366004614e6f565b6114a1565b61012f54610301906001600160a01b031681565b6106076105e0366004614e6f565b60fd6020908152600092835260408084209091529082529020805460019091015460ff1682565b60405161031592919061518c565b6097546001600160a01b0316610301565b61037b610634366004614e10565b6114d7565b6103666115cd565b61036661064f3660046151a0565b61167f565b60fe54610301906001600160a01b031681565b6105196706f05b59d3b2000081565b6065546001600160a01b0316610301565b61037b610695366004614e10565b61171d565b6103666106a8366004615250565b61184c565b6103666106bb366004614db1565b611bf5565b6103017f000000000000000000000000000000000000000000000000000000000000000081565b61051960fb5481565b6106f8611c7e565b61070181611cd8565b50565b60008060026001600160a01b03808616600090815260fd602090815260408083209388168352929052206001015460ff16600381111561074657610746615122565b0361077d576040517f03410cd100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038316600090815261012d6020526040902054858110156107a3578095505b8592506107b1868686611d55565b508092505050935093915050565b6107c7611c7e565b61070181612079565b6000808285856107de61216e565b6107e7836121c3565b816001600160a01b0316836001600160a01b031614806108185750806001600160a01b0316836001600160a01b0316145b1561084f576040517f8aa3a72f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610857612203565b6108648a8a8a8a8a61225c565b90955093508985146108a2576040517fc214279600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6108ae888887876122dc565b604080516001600160a01b038a81168252602082018890529181018690528189169188169033907f795a235be939acb902ac69562805f86e1341a9b019c351b996e2aa2dfc34c67c906060015b60405180910390a461090d600160c955565b5050509550959350505050565b610922611c7e565b61070181612657565b610933611c7e565b610701816126d4565b61095d6040518060600160405280603c81526020016157ef603c9139612751565b61096b86868686868661281d565b505050505050565b600054610100900460ff16158080156109935750600054600160ff909116105b806109ad5750303b1580156109ad575060005460ff166001145b610a245760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084015b60405180910390fd5b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558015610a8257600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b610a8e8c8c8c8b612aee565b610a97896121c3565b61012f80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b038b16179055610ad987878787878761281d565b8015610b3c57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050505050505050565b610b886040518060400160405280601281526020017f726573756d65436f6e76657273696f6e28290000000000000000000000000000815250612751565b60fe5474010000000000000000000000000000000000000000900460ff16610bdb576040517e6d8dbb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fe80547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16905560405133907f89b79206f08dadd78502cff5075d2b094fa0abea0b063cfafe4475e2a380c51f90600090a2565b61012f546040517ff36dba380000000000000000000000000000000000000000000000000000000081526001600160a01b038381166004830152606092169063f36dba3890602401600060405180830381865afa158015610c95573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610cbd91908101906153b9565b9050610cc882612b87565b15610dc75780516000610cdc82600161541d565b67ffffffffffffffff811115610cf457610cf46152c1565b604051908082528060200260200182016040528015610d1d578160200160208202803683370190505b50905060005b82811015610d7757838181518110610d3d57610d3d615435565b6020026020010151828281518110610d5757610d57615435565b6001600160a01b0390921660209283029190910190910152600101610d23565b507f0000000000000000000000000000000000000000000000000000000000000000818381518110610dab57610dab615435565b6001600160a01b03909216602092830291909101909101529150505b919050565b60008060026001600160a01b03808616600090815260fd602090815260408083209388168352929052206001015460ff166003811115610e0e57610e0e615122565b03610e45576040517f03410cd100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8491506000610e55868686612d53565b90925090506000610e7c856001600160a01b0316600090815261012d602052604090205490565b905082811015610ec05781600181610e9c670de0b6b3a764000085615464565b610ea6919061541d565b610eb091906154a1565b610eba91906154b8565b93508092505b5050935093915050565b610ed2611c7e565b610eda612203565b610ee3836121c3565b610eec826121c3565b610ef581613074565b82610f0081836130ae565b610f146001600160a01b03821684846133b8565b826001600160a01b0316846001600160a01b03167f6d25be279134f4ecaa4770aff0c3d916d9e7c5ef37b65ed95dbdba411f5d54d584604051610f5991815260200190565b60405180910390a350610f6c600160c955565b505050565b60fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038481166004830152600092839291169063b62cad6990602401600060405180830381600087803b158015610fd557600080fd5b505af1158015610fe9573d6000803e3d6000fd5b505060fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038781166004830152909116925063b62cad699150602401600060405180830381600087803b15801561104d57600080fd5b505af1158015611061573d6000803e3d6000fd5b50505050611070858585612d53565b5094959350505050565b60fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038481166004830152600092839291169063b62cad6990602401600060405180830381600087803b1580156110de57600080fd5b505af11580156110f2573d6000803e3d6000fd5b505060fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038781166004830152909116925063b62cad699150602401600060405180830381600087803b15801561115657600080fd5b505af115801561116a573d6000803e3d6000fd5b50505050611070858585611d55565b600061118760c95460021490565b156111be576040517f9a050fe700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6111c88383613461565b611211576040517f983f1fb50000000000000000000000000000000000000000000000000000000081526001600160a01b03808516600483015283166024820152604401610a1b565b506001600160a01b03918216600090815261012e6020908152604080832093909416825291909152205490565b611246611c7e565b6112506000613551565b565b6112906040518060400160405280601e81526020017f7365744d696e416d6f756e74546f436f6e766572742875696e74323536290000815250612751565b61070181613582565b60655433906001600160a01b0316811461131b5760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f74207468652060448201527f6e6577206f776e657200000000000000000000000000000000000000000000006064820152608401610a1b565b61070181613551565b61132c611c7e565b611335816121c3565b61012f546040516001600160a01b038084169216907fa87b964d321035d2165e484ff4b722dd6eae30606c0b98887d2ed1a34e594bfe90600090a361012f80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6000808285856113b961216e565b6113c2836121c3565b816001600160a01b0316836001600160a01b031614806113f35750806001600160a01b0316836001600160a01b0316145b1561142a576040517f8aa3a72f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611432612203565b61143f8a8a8a8a8a61225c565b9095509350611450888887876122dc565b604080516001600160a01b038a81168252602082018890529181018690528189169188169033907f93b7ba2a2b0e36320375853d7466af5685c07567804b871b4fdfd31e3bb77154906060016108fb565b6114a9612203565b60006114b583836135cc565b905080156114c8576114c8838383613929565b506114d3600160c955565b5050565b6000808285856114e561216e565b6114ee836121c3565b816001600160a01b0316836001600160a01b0316148061151f5750806001600160a01b0316836001600160a01b0316145b15611556576040517f8aa3a72f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61155e612203565b61156b8a8a8a8a8a613dc5565b909550935061157c888887876122dc565b604080516001600160a01b038a81168252602082018890529181018690528189169188169033907f9b7dc1d7d2974d015b4fc39889a09f3a3923add808f5863158f3162d997d4e82906060016108fb565b61160b6040518060400160405280601181526020017f7061757365436f6e76657273696f6e2829000000000000000000000000000000815250612751565b61161361216e565b60fe80547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000017905560405133907f490bc639fd0d96f19c8adf77bc98d17fbefdee2e1e1864d21f041360d0ee065a90600090a2565b828181146116b9576040517f4d5590f300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b818110156117145761170c878787848181106116da576116da615435565b90506020020160208101906116ef9190614db1565b86868581811061170157611701615435565b90506040020161184c565b6001016116bc565b50505050505050565b60008082858561172b61216e565b611734836121c3565b816001600160a01b0316836001600160a01b031614806117655750806001600160a01b0316836001600160a01b0316145b1561179c576040517f8aa3a72f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6117a4612203565b6117b18a8a8a8a8a613e57565b90955093508884146117ef576040517fa8dc653c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6117fb888887876122dc565b604080516001600160a01b038a81168252602082018890529181018690528189169188169033907fcb4ea7de8d069b0f443b792cba6c6df5096508951bbc75c04ac42c9251efe076906060016108fb565b61186d6040518060600160405280603581526020016157ba60359139612751565b611876836121c3565b61187f826121c3565b6706f05b59d3b20000813511156118d3576040517f9770caee000000000000000000000000000000000000000000000000000000008152813560048201526706f05b59d3b200006024820152604401610a1b565b816001600160a01b0316836001600160a01b0316148061190c57506118f6613f14565b6001600160a01b0316836001600160a01b031614155b80611954575060006001600160a01b03808416600090815260fd602090815260408083209388168352929052206001015460ff16600381111561195157611951615122565b14155b1561198b576040517feebb5ac600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600261199d60408301602084016154f3565b60038111156119ae576119ae615122565b1480156119bb5750803515155b156119f2576040517fd0d4aabe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002611a0460408301602084016154f3565b6003811115611a1557611a15615122565b1480611a4157506001611a2e60408301602084016154f3565b6003811115611a3f57611a3f615122565b145b8015611a56575060ff546001600160a01b0316155b15611a8d576040517fe7c2c99400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03808416600081815260fd602090815260408083209487168084529482529182902080546001820154919594937f39fbfdd5da133303ed31b1b65e30a0ddf7a9236573368c66c859dceccc1dd12a93919288359260ff90911691611afd91908a01908a016154f3565b604051611b0d9493929190615514565b60405180910390a36000611b2760408401602085016154f3565b6003811115611b3857611b38615122565b03611b95576001600160a01b03808516600090815260fd60209081526040808320938716835292905290812090815560010180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055611bef565b81358155611ba960408301602084016154f3565b6001808301805490917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0090911690836003811115611be957611be9615122565b02179055505b50505050565b611bfd611c7e565b606580546001600160a01b0383167fffffffffffffffffffffffff00000000000000000000000000000000000000009091168117909155611c466033546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b6033546001600160a01b031633146112505760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a1b565b611ce1816121c3565b60fe546040516001600160a01b038084169216907f9be3097b5c8b276786be52a244ee90d66efd34805d9eb16f168fb2b4aaae9a2b90600090a360fe80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b60008084600003611d92576040517f42301c2300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03808516600090815260fd6020908152604080832093871683529281528282208351808501909452805484526001810154929392909183019060ff166003811115611de657611de6615122565b6003811115611df757611df7615122565b9052509050600081602001516003811115611e1457611e14615122565b03611e4b576040517f618ce59700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b03878116600483015260009216906341976e0990602401602060405180830381865afa158015611eaf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ed39190615545565b60fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b038881166004830152929350600092909116906341976e0990602401602060405180830381865afa158015611f3c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f609190615545565b835160ff54919250906001600160a01b031615801590612000575060ff546040517f6c059fb10000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b0390911690636c059fb190602401602060405180830381865afa158015611fdc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612000919061555e565b15612009575060005b600061201d82670de0b6b3a764000061541d565b90508261202a8286615464565b61203491906154b8565b95508560018161204c670de0b6b3a76400008e615464565b612056919061541d565b61206091906154a1565b61206a91906154b8565b96505050505050935093915050565b6001600160a01b0381166120f55760405162461bcd60e51b815260206004820152602560248201527f696e76616c696420616365737320636f6e74726f6c206d616e6167657220616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610a1b565b609780546001600160a01b038381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa0910160405180910390a15050565b60fe5474010000000000000000000000000000000000000000900460ff1615611250576040517f952bcf7f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038116610701576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600260c954036122555760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610a1b565b600260c955565b6000806122698585613fa0565b61227385886140c0565b9150612280828686610f71565b915050858110156122c7576040517f228f8c110000000000000000000000000000000000000000000000000000000081526004810182905260248101879052604401610a1b565b6122d284848361420b565b9550959350505050565b60006122e784610c30565b6001600160a01b038516600090815261012d60205260408120549192509061231090849061541d565b905061231b81613074565b815160008080805b8481101561264357600061012e600089848151811061234457612344615435565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060008c6001600160a01b03166001600160a01b031681526020019081526020016000205490508060001461263a576123a56001876154a1565b821015612405576123d18883815181106123c1576123c1615435565b60200260200101518c8b8a614285565b6123db908661541d565b9450866123e8828c615464565b6123f291906154b8565b93506123fe848461541d565b9250612500565b6000612411868b6154a1565b90508061012e60008b868151811061242b5761242b615435565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060008e6001600160a01b03166001600160a01b03168152602001908152602001600020600082825461248591906154a1565b925050819055508b6001600160a01b03168984815181106124a8576124a8615435565b60200260200101516001600160a01b03167fc39e3e80c0219fde334a8cb5d8468b628482e23388b6e809c90cb00c63c8ce38836040516124ea91815260200190565b60405180910390a36124fc848c6154a1565b9450505b8b6001600160a01b031688838151811061251c5761251c615435565b60200260200101516001600160a01b031660fe60009054906101000a90046001600160a01b03166001600160a01b03167fadc20ad416881f76b4304665c35f5be8592297bcdfe4f0bb087b9d254222af558760405161257d91815260200190565b60405180910390a460fe5488516001600160a01b03909116906353ac3537908a90859081106125ae576125ae615435565b60209081029190910101516040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b1681526001600160a01b039182166004820152908f16602482015260448101879052606401600060405180830381600087803b15801561262157600080fd5b505af1158015612635573d6000803e3d6000fd5b505050505b50600101612323565b5050505050505050505050565b600160c955565b612660816121c3565b60ff546040516001600160a01b038084169216907f50f1a16bf24734355b14ff800d132cc0a934808b8621d5623b41bc67f204881790600090a360ff80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6126dd816121c3565b60fc546040516001600160a01b038084169216907f56b5f80d8cac1479698aa7d01605fd6111e90b15fc4d2b377417f46034876cbd90600090a360fc80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6097546040517f18c5e8ab0000000000000000000000000000000000000000000000000000000081526000916001600160a01b0316906318c5e8ab9061279d90339086906004016155d8565b602060405180830381865afa1580156127ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127de919061555e565b9050806114d3573330836040517f4a3fa293000000000000000000000000000000000000000000000000000000008152600401610a1b939291906155fa565b84838114158061282d5750808214155b15612864576040517f5f6f132c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b81811015612ae457600086868381811061288357612883615435565b90506020028101906128959190615626565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509394508892508791508590508181106128dd576128dd615435565b90506020028101906128ef9190615626565b80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250508451835193945092831491506129629050576040517f5f6f132c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b81811015612ad55782818151811061297f5761297f615435565b602002602001015161013060008e8e8981811061299e5761299e615435565b90506020020160208101906129b39190614db1565b6001600160a01b03166001600160a01b0316815260200190815260200160002060008684815181106129e7576129e7615435565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff021916908315150217905550838181518110612a3857612a38615435565b60200260200101516001600160a01b03168c8c87818110612a5b57612a5b615435565b9050602002016020810190612a709190614db1565b6001600160a01b03167f6333c55c3657aafc9b39e2586076d198ed0250804559126489c852f28d51280c858481518110612aac57612aac615435565b6020026020010151604051612ac5911515815260200190565b60405180910390a3600101612965565b50836001019350505050612867565b5050505050505050565b600054610100900460ff16612b6b5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a1b565b612b748461435e565b612b7c6143ec565b611bef838383614471565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b0772d0b6040518163ffffffff1660e01b8152600401600060405180830381865afa158015612be8573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612c1091908101906153b9565b805190915060005b81811015612d4b57828181518110612c3257612c32615435565b60200260200101516001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031614612d0657846001600160a01b0316838281518110612c8e57612c8e615435565b60200260200101516001600160a01b0316636f307dc36040518163ffffffff1660e01b8152600401602060405180830381865afa158015612cd3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612cf7919061568e565b6001600160a01b031614612d3c565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316856001600160a01b0316145b935083612d4b57600101612c18565b505050919050565b60008084600003612d90576040517f098fb56100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03808516600090815260fd6020908152604080832093871683529281528282208351808501909452805484526001810154929392909183019060ff166003811115612de457612de4615122565b6003811115612df557612df5615122565b9052509050600081602001516003811115612e1257612e12615122565b03612e49576040517f618ce59700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b03878116600483015260009216906341976e0990602401602060405180830381865afa158015612ead573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ed19190615545565b60fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b038881166004830152929350600092909116906341976e0990602401602060405180830381865afa158015612f3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f5e9190615545565b835160ff54919250906001600160a01b031615801590612ffe575060ff546040517f6c059fb10000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b0390911690636c059fb190602401602060405180830381865afa158015612fda573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ffe919061555e565b15613007575060005b600061301b82670de0b6b3a764000061541d565b905061302f670de0b6b3a764000084615464565b8161303a868d615464565b6130449190615464565b61304e91906154b8565b96508261305b8286615464565b61306591906154b8565b95505050505050935093915050565b80600003610701576040517f9cf8540c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000906001600160a01b038416906370a0823190602401602060405180830381865afa15801561310e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131329190615545565b90508082111561316e576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038316600090815261012d602052604081205461319290836154a1565b905082811015611bef5780830360006131aa86610c30565b6001600160a01b038716600090815261012d602052604081205482519293509190805b8281101561337e5761012e60008683815181106131ec576131ec615435565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060008b6001600160a01b03166001600160a01b03168152602001908152602001600020546000146133765761324a6001846154a1565b8110156132875761327685828151811061326657613266615435565b60200260200101518b8887614285565b613280908361541d565b9150613376565b600061329383886154a1565b90508061012e60008885815181106132ad576132ad615435565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060008d6001600160a01b03166001600160a01b03168152602001908152602001600020600082825461330791906154a1565b925050819055508a6001600160a01b031686838151811061332a5761332a615435565b60200260200101516001600160a01b03167fc39e3e80c0219fde334a8cb5d8468b628482e23388b6e809c90cb00c63c8ce388360405161336c91815260200190565b60405180910390a3505b6001016131cd565b506001600160a01b038916600090815261012d6020526040812080548792906133a89084906154a1565b9091555050505050505050505050565b6040516001600160a01b038316602482015260448101829052610f6c9084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152614536565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b0316036134ac576134a582612b87565b905061354b565b61012f546040517f266e0a7f0000000000000000000000000000000000000000000000000000000081526001600160a01b0385811660048301528481166024830152600092169063266e0a7f90604401602060405180830381865afa158015613519573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061353d919061568e565b6001600160a01b0316141590505b92915050565b606580547fffffffffffffffffffffffff00000000000000000000000000000000000000001690556107018161461e565b61358b81613074565b60fb5460408051918252602082018390527fada67d0d38fa20c8ae6a5c17cb9d60b0fe7f2d4e4f27ac9ee55e54ac88de9d8d910160405180910390a160fb55565b60006135d88383613461565b613621576040517f983f1fb50000000000000000000000000000000000000000000000000000000081526001600160a01b03808516600483015283166024820152604401610a1b565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015282906000906001600160a01b038316906370a0823190602401602060405180830381865afa158015613683573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136a79190615545565b6001600160a01b038516600090815261012d602052604090205490915080821115613920576001600160a01b0380871660009081526101306020908152604080832093891683529290522054818303945060ff16156139205760fe546040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0391821660048201526000918516906370a0823190602401602060405180830381865afa158015613765573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137899190615545565b60fe549091506137a6906001600160a01b038681169116876133b8565b60fe546040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0391821660048201526000918616906370a0823190602401602060405180830381865afa15801561380b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061382f9190615545565b60fe546040518881529192506001600160a01b03898116928b82169291909116907fadc20ad416881f76b4304665c35f5be8592297bcdfe4f0bb087b9d254222af559060200160405180910390a460fe546001600160a01b03166353ac3537898961389a86866154a1565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b1681526001600160a01b0393841660048201529290911660248301526044820152606401600060405180830381600087803b15801561390157600080fd5b505af1158015613915573d6000803e3d6000fd5b505050506000955050505b50505092915050565b6000613933613f14565b60fe5460ff549192506001600160a01b03908116916000911615613db85760ff546040517f4e9f8f390000000000000000000000000000000000000000000000000000000081526001600160a01b03878116600483015285811660248301526000928392911690634e9f8f39906044016000604051808303816000875af11580156139c2573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526139ea91908101906156ab565b8151919350915060005b81811015613db357828181518110613a0e57613a0e615435565b602002602001015160000315613db3576000848281518110613a3257613a32615435565b60200260200101516001600160a01b0316636f1a30a8858481518110613a5a57613a5a615435565b60200260200101518c8b6040518463ffffffff1660e01b8152600401613a9c939291909283526001600160a01b03918216602084015216604082015260600190565b60408051808303816000875af1158015613aba573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ade9190615766565b91505088811115613aec5750875b613af6818b614688565b613b005750613db3565b6040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b038881166004830152600091908a16906370a0823190602401602060405180830381865afa158015613b63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b879190615545565b90508a6001600160a01b031663095ea7b3878581518110613baa57613baa615435565b6020026020010151846040518363ffffffff1660e01b8152600401613be49291906001600160a01b03929092168252602082015260400190565b6020604051808303816000875af1158015613c03573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613c27919061555e565b50858381518110613c3a57613c3a615435565b60209081029190910101516040517f439727a500000000000000000000000000000000000000000000000000000000815260048101849052600060248201526001600160a01b038d811660448301528b811660648301528a811660848301529091169063439727a59060a40160408051808303816000875af1158015613cc4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ce89190615766565b50506040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b038981166004830152600091908b16906370a0823190602401602060405180830381865afa158015613d4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d719190615545565b9050613d7d838c6154a1565b9a50613d8982826154a1565b613d93908961541d565b97508a600003613da557505050613db3565b8360010193505050506139f4565b505050505b61096b86848388886147c0565b600080613dd28585613fa0565b6000613ddf87878761107a565b91505087811115613e26576040517f71b5f0c10000000000000000000000000000000000000000000000000000000081526004810182905260248101899052604401610a1b565b613e3086826140c0565b9250613e3d838787610f71565b9250613e4c905085858461420b565b509550959350505050565b600080613e648585613fa0565b6000613e7187878761107a565b915050613e7e86826140c0565b9250808314613eb9576040517f0c5c1c2000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b87831115613efd576040517f71b5f0c10000000000000000000000000000000000000000000000000000000081526004810182905260248101899052604401610a1b565b613f0885858961420b565b50909694955050505050565b60fe54604080517fc8ecc0d300000000000000000000000000000000000000000000000000000000815290516000926001600160a01b03169163c8ecc0d39160048083019260209291908290030181865afa158015613f77573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f9b919061568e565b905090565b60ff546000906001600160a01b03161580159061403d575060ff546040517f6c059fb10000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b0390911690636c059fb190602401602060405180830381865afa158015614019573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061403d919061555e565b905080158015614089575060026001600160a01b03808516600090815260fd602090815260408083209387168352929052206001015460ff16600381111561408757614087615122565b145b15610f6c576040517f03410cd100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fe546040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b039182166004820152600091849183918316906370a0823190602401602060405180830381865afa158015614129573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061414d9190615545565b60fe5490915061416c906001600160a01b03848116913391168761495e565b60fe546040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0391821660048201526000918416906370a0823190602401602060405180830381865afa1580156141d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906141f59190615545565b905061420182826154a1565b9695505050505050565b6001600160a01b038316600090815261012d60205260409020548181101561425f576040517f6bb2792900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61426984836149af565b8361427e6001600160a01b03821685856133b8565b5050505050565b6001600160a01b03808516600090815261012e6020908152604080832093871683529290529081205482906142bb908590615464565b6142c591906154b8565b6001600160a01b03808716600090815261012e602090815260408083209389168352929052908120805492935083929091906143029084906154a1565b92505081905550836001600160a01b0316856001600160a01b03167fc39e3e80c0219fde334a8cb5d8468b628482e23388b6e809c90cb00c63c8ce388360405161434e91815260200190565b60405180910390a3949350505050565b600054610100900460ff166143db5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a1b565b6143e36149e1565b61070181614a66565b600054610100900460ff166144695760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a1b565b611250614ae3565b600054610100900460ff166144ee5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a1b565b6144f7836126d4565b61450082611cd8565b61450981613582565b505060fe80547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16905550565b600061458b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316614b609092919063ffffffff16565b90508051600014806145ac5750808060200190518101906145ac919061555e565b610f6c5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610a1b565b603380546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038381166004830152600092169063b62cad6990602401600060405180830381600087803b1580156146e957600080fd5b505af11580156146fd573d6000803e3d6000fd5b505060fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b03868116600483015260009450670de0b6b3a76400009350879216906341976e0990602401602060405180830381865afa158015614771573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906147959190615545565b61479f9190615464565b6147a991906154b8565b905060fb5481106147b957600191505b5092915050565b82156148975760fe546040518481526001600160a01b0386811692888216929116907fadc20ad416881f76b4304665c35f5be8592297bcdfe4f0bb087b9d254222af559060200160405180910390a460fe546040517f53ac35370000000000000000000000000000000000000000000000000000000081526001600160a01b038781166004830152868116602483015260448201869052909116906353ac353790606401600060405180830381600087803b15801561487e57600080fd5b505af1158015614892573d6000803e3d6000fd5b505050505b801561427e576001600160a01b038216600090815261012d6020526040812080548392906148c690849061541d565b90915550506001600160a01b03808616600090815261012e602090815260408083209386168352929052908120805483929061490390849061541d565b92505081905550816001600160a01b0316856001600160a01b03167fc39e3e80c0219fde334a8cb5d8468b628482e23388b6e809c90cb00c63c8ce388360405161494f91815260200190565b60405180910390a35050505050565b6040516001600160a01b0380851660248301528316604482015260648101829052611bef9085907f23b872dd00000000000000000000000000000000000000000000000000000000906084016133fd565b6001600160a01b038216600090815261012d6020526040812080548392906149d89084906154a1565b90915550505050565b600054610100900460ff16614a5e5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a1b565b611250614b79565b600054610100900460ff166107c75760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a1b565b600054610100900460ff166126505760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a1b565b6060614b6f8484600085614bff565b90505b9392505050565b600054610100900460ff16614bf65760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a1b565b61125033613551565b606082471015614c775760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610a1b565b600080866001600160a01b03168587604051614c93919061578a565b60006040518083038185875af1925050503d8060008114614cd0576040519150601f19603f3d011682016040523d82523d6000602084013e614cd5565b606091505b5091509150614ce687838387614cf3565b925050505b949350505050565b60608315614d62578251600003614d5b576001600160a01b0385163b614d5b5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610a1b565b5081614ceb565b614ceb8383815115614d775781518083602001fd5b8060405162461bcd60e51b8152600401610a1b91906157a6565b6001600160a01b038116811461070157600080fd5b8035610dc781614d91565b600060208284031215614dc357600080fd5b8135614b7281614d91565b600080600060608486031215614de357600080fd5b833592506020840135614df581614d91565b91506040840135614e0581614d91565b809150509250925092565b600080600080600060a08688031215614e2857600080fd5b85359450602086013593506040860135614e4181614d91565b92506060860135614e5181614d91565b91506080860135614e6181614d91565b809150509295509295909350565b60008060408385031215614e8257600080fd5b8235614e8d81614d91565b91506020830135614e9d81614d91565b809150509250929050565b60008083601f840112614eba57600080fd5b50813567ffffffffffffffff811115614ed257600080fd5b6020830191508360208260051b8501011115614eed57600080fd5b9250929050565b60008060008060008060608789031215614f0d57600080fd5b863567ffffffffffffffff80821115614f2557600080fd5b614f318a838b01614ea8565b90985096506020890135915080821115614f4a57600080fd5b614f568a838b01614ea8565b90965094506040890135915080821115614f6f57600080fd5b50614f7c89828a01614ea8565b979a9699509497509295939492505050565b60008060008060008060008060008060006101008c8e031215614fb057600080fd5b614fb98c614da6565b9a50614fc760208d01614da6565b9950614fd560408d01614da6565b9850614fe360608d01614da6565b975060808c0135965067ffffffffffffffff8060a08e0135111561500657600080fd5b6150168e60a08f01358f01614ea8565b909750955060c08d013581101561502c57600080fd5b61503c8e60c08f01358f01614ea8565b909550935060e08d013581101561505257600080fd5b506150638d60e08e01358e01614ea8565b81935080925050509295989b509295989b9093969950565b6020808252825182820181905260009190848201906040850190845b818110156150bc5783516001600160a01b031683529284019291840191600101615097565b50909695505050505050565b6000806000606084860312156150dd57600080fd5b83356150e881614d91565b925060208401356150f881614d91565b929592945050506040919091013590565b60006020828403121561511b57600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60048110615188577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b9052565b82815260408101614b726020830184615151565b6000806000806000606086880312156151b857600080fd5b85356151c381614d91565b9450602086013567ffffffffffffffff808211156151e057600080fd5b6151ec89838a01614ea8565b9096509450604088013591508082111561520557600080fd5b818801915088601f83011261521957600080fd5b81358181111561522857600080fd5b8960208260061b850101111561523d57600080fd5b9699959850939650602001949392505050565b6000806000838503608081121561526657600080fd5b843561527181614d91565b9350602085013561528181614d91565b925060407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0820112156152b357600080fd5b506040840190509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715615319576153196152c1565b604052919050565b600067ffffffffffffffff82111561533b5761533b6152c1565b5060051b60200190565b600082601f83011261535657600080fd5b8151602061536b61536683615321565b6152f0565b82815260059290921b8401810191818101908684111561538a57600080fd5b8286015b848110156153ae5780516153a181614d91565b835291830191830161538e565b509695505050505050565b6000602082840312156153cb57600080fd5b815167ffffffffffffffff8111156153e257600080fd5b614ceb84828501615345565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008219821115615430576154306153ee565b500190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561549c5761549c6153ee565b500290565b6000828210156154b3576154b36153ee565b500390565b6000826154ee577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60006020828403121561550557600080fd5b813560048110614b7257600080fd5b848152602081018490526080810161552f6040830185615151565b61553c6060830184615151565b95945050505050565b60006020828403121561555757600080fd5b5051919050565b60006020828403121561557057600080fd5b81518015158114614b7257600080fd5b60005b8381101561559b578181015183820152602001615583565b83811115611bef5750506000910152565b600081518084526155c4816020860160208601615580565b601f01601f19169290920160200192915050565b6001600160a01b0383168152604060208201526000614b6f60408301846155ac565b60006001600160a01b0380861683528085166020840152506060604083015261553c60608301846155ac565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261565b57600080fd5b83018035915067ffffffffffffffff82111561567657600080fd5b6020019150600581901b3603821315614eed57600080fd5b6000602082840312156156a057600080fd5b8151614b7281614d91565b600080604083850312156156be57600080fd5b825167ffffffffffffffff808211156156d657600080fd5b6156e286838701615345565b93506020915081850151818111156156f957600080fd5b85019050601f8101861361570c57600080fd5b805161571a61536682615321565b81815260059190911b8201830190838101908883111561573957600080fd5b928401925b828410156157575783518252928401929084019061573e565b80955050505050509250929050565b6000806040838503121561577957600080fd5b505080516020909101519092909150565b6000825161579c818460208701615580565b9190910192915050565b602081526000614b7260208301846155ac56fe736574436f6e76657273696f6e436f6e66696728616464726573732c616464726573732c436f6e76657273696f6e436f6e66696729736574506f6f6c734173736574734469726563745472616e7366657228616464726573735b5d2c616464726573735b5d5b5d2c626f6f6c5b5d5b5d29a26469706673582212200c4c1be8186609d8812933be8513b877d4d7456c543e250549bac4e27cafee1364736f6c634300080d0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106102e95760003560e01c806370a0823111610191578063b6828c57116100e3578063e30c397811610097578063f2fde38b11610071578063f2fde38b146106ad578063fa7b81a0146106c0578063fe3da984146106e757600080fd5b8063e30c397814610676578063f04c318714610687578063f0dc7e9d1461069a57600080fd5b8063c0654646116100c8578063c065464614610641578063ca32546914610654578063e2ff7ea21461066757600080fd5b8063b6828c5714610626578063bc368b041461063957600080fd5b80638da5cb5b11610145578063afcff50f1161011f578063afcff50f146105be578063b491ddf7146105d2578063b4a0bdf31461061557600080fd5b80638da5cb5b1461058757806390fa7b5414610598578063aac59a75146105ab57600080fd5b8063746460a911610176578063746460a91461055957806379ba50971461056c5780637b77cd6a1461057457600080fd5b806370a0823114610527578063715018a61461055157600080fd5b806352e21a181161024a5780635c39f467116101fe5780636daa463b116101d85780636daa463b146104e05780636f1a30a8146104f35780636fb052751461050657600080fd5b80635c39f4671461049a5780635e1e6325146104ba57806364aff9ec146104cd57600080fd5b8063553745221161022f578063553745221461046c578063556bbd8a1461047f57806358b904df1461049257600080fd5b806352e21a1814610446578063530e784f1461045957600080fd5b80632630c12f116102a1578063362b679511610286578063362b6795146103dd578063439727a514610404578063454900fe1461041757600080fd5b80632630c12f146103a35780633421fc52146103b657600080fd5b80630a0a05e6116102d25780630a0a05e6146103535780630a9a2b72146103685780630e32cb861461039057600080fd5b806301e20178146102ee57806307aa239e1461031e575b600080fd5b60ff54610301906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b60fe546103439074010000000000000000000000000000000000000000900460ff1681565b6040519015158152602001610315565b610366610361366004614db1565b6106f0565b005b61037b610376366004614dce565b610704565b60408051928352602083019190915201610315565b61036661039e366004614db1565b6107bf565b60fc54610301906001600160a01b031681565b6103017f000000000000000000000000000000000000000000000000000000000000000081565b6103017f000000000000000000000000000000000000000000000000000000000000000081565b61037b610412366004614e10565b6107d0565b610343610425366004614e6f565b61013060209081526000928352604080842090915290825290205460ff1681565b610366610454366004614db1565b61091a565b610366610467366004614db1565b61092b565b61036661047a366004614ef4565b61093c565b61036661048d366004614f8e565b610973565b610366610b4a565b6104ad6104a8366004614db1565b610c30565b604051610315919061507b565b61037b6104c8366004614dce565b610dcc565b6103666104db3660046150c8565b610eca565b61037b6104ee366004614dce565b610f71565b61037b610501366004614dce565b61107a565b610519610514366004614e6f565b611179565b604051908152602001610315565b610519610535366004614db1565b6001600160a01b0316600090815261012d602052604090205490565b61036661123e565b610366610567366004615109565b611252565b610366611299565b610366610582366004614db1565b611324565b6033546001600160a01b0316610301565b61037b6105a6366004614e10565b6113ab565b6103666105b9366004614e6f565b6114a1565b61012f54610301906001600160a01b031681565b6106076105e0366004614e6f565b60fd6020908152600092835260408084209091529082529020805460019091015460ff1682565b60405161031592919061518c565b6097546001600160a01b0316610301565b61037b610634366004614e10565b6114d7565b6103666115cd565b61036661064f3660046151a0565b61167f565b60fe54610301906001600160a01b031681565b6105196706f05b59d3b2000081565b6065546001600160a01b0316610301565b61037b610695366004614e10565b61171d565b6103666106a8366004615250565b61184c565b6103666106bb366004614db1565b611bf5565b6103017f000000000000000000000000000000000000000000000000000000000000000081565b61051960fb5481565b6106f8611c7e565b61070181611cd8565b50565b60008060026001600160a01b03808616600090815260fd602090815260408083209388168352929052206001015460ff16600381111561074657610746615122565b0361077d576040517f03410cd100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038316600090815261012d6020526040902054858110156107a3578095505b8592506107b1868686611d55565b508092505050935093915050565b6107c7611c7e565b61070181612079565b6000808285856107de61216e565b6107e7836121c3565b816001600160a01b0316836001600160a01b031614806108185750806001600160a01b0316836001600160a01b0316145b1561084f576040517f8aa3a72f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610857612203565b6108648a8a8a8a8a61225c565b90955093508985146108a2576040517fc214279600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6108ae888887876122dc565b604080516001600160a01b038a81168252602082018890529181018690528189169188169033907f795a235be939acb902ac69562805f86e1341a9b019c351b996e2aa2dfc34c67c906060015b60405180910390a461090d600160c955565b5050509550959350505050565b610922611c7e565b61070181612657565b610933611c7e565b610701816126d4565b61095d6040518060600160405280603c81526020016157ef603c9139612751565b61096b86868686868661281d565b505050505050565b600054610100900460ff16158080156109935750600054600160ff909116105b806109ad5750303b1580156109ad575060005460ff166001145b610a245760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084015b60405180910390fd5b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558015610a8257600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b610a8e8c8c8c8b612aee565b610a97896121c3565b61012f80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b038b16179055610ad987878787878761281d565b8015610b3c57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050505050505050565b610b886040518060400160405280601281526020017f726573756d65436f6e76657273696f6e28290000000000000000000000000000815250612751565b60fe5474010000000000000000000000000000000000000000900460ff16610bdb576040517e6d8dbb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fe80547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16905560405133907f89b79206f08dadd78502cff5075d2b094fa0abea0b063cfafe4475e2a380c51f90600090a2565b61012f546040517ff36dba380000000000000000000000000000000000000000000000000000000081526001600160a01b038381166004830152606092169063f36dba3890602401600060405180830381865afa158015610c95573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610cbd91908101906153b9565b9050610cc882612b87565b15610dc75780516000610cdc82600161541d565b67ffffffffffffffff811115610cf457610cf46152c1565b604051908082528060200260200182016040528015610d1d578160200160208202803683370190505b50905060005b82811015610d7757838181518110610d3d57610d3d615435565b6020026020010151828281518110610d5757610d57615435565b6001600160a01b0390921660209283029190910190910152600101610d23565b507f0000000000000000000000000000000000000000000000000000000000000000818381518110610dab57610dab615435565b6001600160a01b03909216602092830291909101909101529150505b919050565b60008060026001600160a01b03808616600090815260fd602090815260408083209388168352929052206001015460ff166003811115610e0e57610e0e615122565b03610e45576040517f03410cd100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8491506000610e55868686612d53565b90925090506000610e7c856001600160a01b0316600090815261012d602052604090205490565b905082811015610ec05781600181610e9c670de0b6b3a764000085615464565b610ea6919061541d565b610eb091906154a1565b610eba91906154b8565b93508092505b5050935093915050565b610ed2611c7e565b610eda612203565b610ee3836121c3565b610eec826121c3565b610ef581613074565b82610f0081836130ae565b610f146001600160a01b03821684846133b8565b826001600160a01b0316846001600160a01b03167f6d25be279134f4ecaa4770aff0c3d916d9e7c5ef37b65ed95dbdba411f5d54d584604051610f5991815260200190565b60405180910390a350610f6c600160c955565b505050565b60fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038481166004830152600092839291169063b62cad6990602401600060405180830381600087803b158015610fd557600080fd5b505af1158015610fe9573d6000803e3d6000fd5b505060fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038781166004830152909116925063b62cad699150602401600060405180830381600087803b15801561104d57600080fd5b505af1158015611061573d6000803e3d6000fd5b50505050611070858585612d53565b5094959350505050565b60fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038481166004830152600092839291169063b62cad6990602401600060405180830381600087803b1580156110de57600080fd5b505af11580156110f2573d6000803e3d6000fd5b505060fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038781166004830152909116925063b62cad699150602401600060405180830381600087803b15801561115657600080fd5b505af115801561116a573d6000803e3d6000fd5b50505050611070858585611d55565b600061118760c95460021490565b156111be576040517f9a050fe700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6111c88383613461565b611211576040517f983f1fb50000000000000000000000000000000000000000000000000000000081526001600160a01b03808516600483015283166024820152604401610a1b565b506001600160a01b03918216600090815261012e6020908152604080832093909416825291909152205490565b611246611c7e565b6112506000613551565b565b6112906040518060400160405280601e81526020017f7365744d696e416d6f756e74546f436f6e766572742875696e74323536290000815250612751565b61070181613582565b60655433906001600160a01b0316811461131b5760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f74207468652060448201527f6e6577206f776e657200000000000000000000000000000000000000000000006064820152608401610a1b565b61070181613551565b61132c611c7e565b611335816121c3565b61012f546040516001600160a01b038084169216907fa87b964d321035d2165e484ff4b722dd6eae30606c0b98887d2ed1a34e594bfe90600090a361012f80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6000808285856113b961216e565b6113c2836121c3565b816001600160a01b0316836001600160a01b031614806113f35750806001600160a01b0316836001600160a01b0316145b1561142a576040517f8aa3a72f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611432612203565b61143f8a8a8a8a8a61225c565b9095509350611450888887876122dc565b604080516001600160a01b038a81168252602082018890529181018690528189169188169033907f93b7ba2a2b0e36320375853d7466af5685c07567804b871b4fdfd31e3bb77154906060016108fb565b6114a9612203565b60006114b583836135cc565b905080156114c8576114c8838383613929565b506114d3600160c955565b5050565b6000808285856114e561216e565b6114ee836121c3565b816001600160a01b0316836001600160a01b0316148061151f5750806001600160a01b0316836001600160a01b0316145b15611556576040517f8aa3a72f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61155e612203565b61156b8a8a8a8a8a613dc5565b909550935061157c888887876122dc565b604080516001600160a01b038a81168252602082018890529181018690528189169188169033907f9b7dc1d7d2974d015b4fc39889a09f3a3923add808f5863158f3162d997d4e82906060016108fb565b61160b6040518060400160405280601181526020017f7061757365436f6e76657273696f6e2829000000000000000000000000000000815250612751565b61161361216e565b60fe80547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000017905560405133907f490bc639fd0d96f19c8adf77bc98d17fbefdee2e1e1864d21f041360d0ee065a90600090a2565b828181146116b9576040517f4d5590f300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b818110156117145761170c878787848181106116da576116da615435565b90506020020160208101906116ef9190614db1565b86868581811061170157611701615435565b90506040020161184c565b6001016116bc565b50505050505050565b60008082858561172b61216e565b611734836121c3565b816001600160a01b0316836001600160a01b031614806117655750806001600160a01b0316836001600160a01b0316145b1561179c576040517f8aa3a72f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6117a4612203565b6117b18a8a8a8a8a613e57565b90955093508884146117ef576040517fa8dc653c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6117fb888887876122dc565b604080516001600160a01b038a81168252602082018890529181018690528189169188169033907fcb4ea7de8d069b0f443b792cba6c6df5096508951bbc75c04ac42c9251efe076906060016108fb565b61186d6040518060600160405280603581526020016157ba60359139612751565b611876836121c3565b61187f826121c3565b6706f05b59d3b20000813511156118d3576040517f9770caee000000000000000000000000000000000000000000000000000000008152813560048201526706f05b59d3b200006024820152604401610a1b565b816001600160a01b0316836001600160a01b0316148061190c57506118f6613f14565b6001600160a01b0316836001600160a01b031614155b80611954575060006001600160a01b03808416600090815260fd602090815260408083209388168352929052206001015460ff16600381111561195157611951615122565b14155b1561198b576040517feebb5ac600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600261199d60408301602084016154f3565b60038111156119ae576119ae615122565b1480156119bb5750803515155b156119f2576040517fd0d4aabe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002611a0460408301602084016154f3565b6003811115611a1557611a15615122565b1480611a4157506001611a2e60408301602084016154f3565b6003811115611a3f57611a3f615122565b145b8015611a56575060ff546001600160a01b0316155b15611a8d576040517fe7c2c99400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03808416600081815260fd602090815260408083209487168084529482529182902080546001820154919594937f39fbfdd5da133303ed31b1b65e30a0ddf7a9236573368c66c859dceccc1dd12a93919288359260ff90911691611afd91908a01908a016154f3565b604051611b0d9493929190615514565b60405180910390a36000611b2760408401602085016154f3565b6003811115611b3857611b38615122565b03611b95576001600160a01b03808516600090815260fd60209081526040808320938716835292905290812090815560010180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055611bef565b81358155611ba960408301602084016154f3565b6001808301805490917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0090911690836003811115611be957611be9615122565b02179055505b50505050565b611bfd611c7e565b606580546001600160a01b0383167fffffffffffffffffffffffff00000000000000000000000000000000000000009091168117909155611c466033546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b6033546001600160a01b031633146112505760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a1b565b611ce1816121c3565b60fe546040516001600160a01b038084169216907f9be3097b5c8b276786be52a244ee90d66efd34805d9eb16f168fb2b4aaae9a2b90600090a360fe80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b60008084600003611d92576040517f42301c2300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03808516600090815260fd6020908152604080832093871683529281528282208351808501909452805484526001810154929392909183019060ff166003811115611de657611de6615122565b6003811115611df757611df7615122565b9052509050600081602001516003811115611e1457611e14615122565b03611e4b576040517f618ce59700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b03878116600483015260009216906341976e0990602401602060405180830381865afa158015611eaf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ed39190615545565b60fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b038881166004830152929350600092909116906341976e0990602401602060405180830381865afa158015611f3c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f609190615545565b835160ff54919250906001600160a01b031615801590612000575060ff546040517f6c059fb10000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b0390911690636c059fb190602401602060405180830381865afa158015611fdc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612000919061555e565b15612009575060005b600061201d82670de0b6b3a764000061541d565b90508261202a8286615464565b61203491906154b8565b95508560018161204c670de0b6b3a76400008e615464565b612056919061541d565b61206091906154a1565b61206a91906154b8565b96505050505050935093915050565b6001600160a01b0381166120f55760405162461bcd60e51b815260206004820152602560248201527f696e76616c696420616365737320636f6e74726f6c206d616e6167657220616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610a1b565b609780546001600160a01b038381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa0910160405180910390a15050565b60fe5474010000000000000000000000000000000000000000900460ff1615611250576040517f952bcf7f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038116610701576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600260c954036122555760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610a1b565b600260c955565b6000806122698585613fa0565b61227385886140c0565b9150612280828686610f71565b915050858110156122c7576040517f228f8c110000000000000000000000000000000000000000000000000000000081526004810182905260248101879052604401610a1b565b6122d284848361420b565b9550959350505050565b60006122e784610c30565b6001600160a01b038516600090815261012d60205260408120549192509061231090849061541d565b905061231b81613074565b815160008080805b8481101561264357600061012e600089848151811061234457612344615435565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060008c6001600160a01b03166001600160a01b031681526020019081526020016000205490508060001461263a576123a56001876154a1565b821015612405576123d18883815181106123c1576123c1615435565b60200260200101518c8b8a614285565b6123db908661541d565b9450866123e8828c615464565b6123f291906154b8565b93506123fe848461541d565b9250612500565b6000612411868b6154a1565b90508061012e60008b868151811061242b5761242b615435565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060008e6001600160a01b03166001600160a01b03168152602001908152602001600020600082825461248591906154a1565b925050819055508b6001600160a01b03168984815181106124a8576124a8615435565b60200260200101516001600160a01b03167fc39e3e80c0219fde334a8cb5d8468b628482e23388b6e809c90cb00c63c8ce38836040516124ea91815260200190565b60405180910390a36124fc848c6154a1565b9450505b8b6001600160a01b031688838151811061251c5761251c615435565b60200260200101516001600160a01b031660fe60009054906101000a90046001600160a01b03166001600160a01b03167fadc20ad416881f76b4304665c35f5be8592297bcdfe4f0bb087b9d254222af558760405161257d91815260200190565b60405180910390a460fe5488516001600160a01b03909116906353ac3537908a90859081106125ae576125ae615435565b60209081029190910101516040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b1681526001600160a01b039182166004820152908f16602482015260448101879052606401600060405180830381600087803b15801561262157600080fd5b505af1158015612635573d6000803e3d6000fd5b505050505b50600101612323565b5050505050505050505050565b600160c955565b612660816121c3565b60ff546040516001600160a01b038084169216907f50f1a16bf24734355b14ff800d132cc0a934808b8621d5623b41bc67f204881790600090a360ff80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6126dd816121c3565b60fc546040516001600160a01b038084169216907f56b5f80d8cac1479698aa7d01605fd6111e90b15fc4d2b377417f46034876cbd90600090a360fc80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6097546040517f18c5e8ab0000000000000000000000000000000000000000000000000000000081526000916001600160a01b0316906318c5e8ab9061279d90339086906004016155d8565b602060405180830381865afa1580156127ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127de919061555e565b9050806114d3573330836040517f4a3fa293000000000000000000000000000000000000000000000000000000008152600401610a1b939291906155fa565b84838114158061282d5750808214155b15612864576040517f5f6f132c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b81811015612ae457600086868381811061288357612883615435565b90506020028101906128959190615626565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201829052509394508892508791508590508181106128dd576128dd615435565b90506020028101906128ef9190615626565b80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250508451835193945092831491506129629050576040517f5f6f132c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b81811015612ad55782818151811061297f5761297f615435565b602002602001015161013060008e8e8981811061299e5761299e615435565b90506020020160208101906129b39190614db1565b6001600160a01b03166001600160a01b0316815260200190815260200160002060008684815181106129e7576129e7615435565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff021916908315150217905550838181518110612a3857612a38615435565b60200260200101516001600160a01b03168c8c87818110612a5b57612a5b615435565b9050602002016020810190612a709190614db1565b6001600160a01b03167f6333c55c3657aafc9b39e2586076d198ed0250804559126489c852f28d51280c858481518110612aac57612aac615435565b6020026020010151604051612ac5911515815260200190565b60405180910390a3600101612965565b50836001019350505050612867565b5050505050505050565b600054610100900460ff16612b6b5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a1b565b612b748461435e565b612b7c6143ec565b611bef838383614471565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b0772d0b6040518163ffffffff1660e01b8152600401600060405180830381865afa158015612be8573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612c1091908101906153b9565b805190915060005b81811015612d4b57828181518110612c3257612c32615435565b60200260200101516001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031614612d0657846001600160a01b0316838281518110612c8e57612c8e615435565b60200260200101516001600160a01b0316636f307dc36040518163ffffffff1660e01b8152600401602060405180830381865afa158015612cd3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612cf7919061568e565b6001600160a01b031614612d3c565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316856001600160a01b0316145b935083612d4b57600101612c18565b505050919050565b60008084600003612d90576040517f098fb56100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03808516600090815260fd6020908152604080832093871683529281528282208351808501909452805484526001810154929392909183019060ff166003811115612de457612de4615122565b6003811115612df557612df5615122565b9052509050600081602001516003811115612e1257612e12615122565b03612e49576040517f618ce59700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b03878116600483015260009216906341976e0990602401602060405180830381865afa158015612ead573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ed19190615545565b60fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b038881166004830152929350600092909116906341976e0990602401602060405180830381865afa158015612f3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f5e9190615545565b835160ff54919250906001600160a01b031615801590612ffe575060ff546040517f6c059fb10000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b0390911690636c059fb190602401602060405180830381865afa158015612fda573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ffe919061555e565b15613007575060005b600061301b82670de0b6b3a764000061541d565b905061302f670de0b6b3a764000084615464565b8161303a868d615464565b6130449190615464565b61304e91906154b8565b96508261305b8286615464565b61306591906154b8565b95505050505050935093915050565b80600003610701576040517f9cf8540c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000906001600160a01b038416906370a0823190602401602060405180830381865afa15801561310e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131329190615545565b90508082111561316e576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038316600090815261012d602052604081205461319290836154a1565b905082811015611bef5780830360006131aa86610c30565b6001600160a01b038716600090815261012d602052604081205482519293509190805b8281101561337e5761012e60008683815181106131ec576131ec615435565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060008b6001600160a01b03166001600160a01b03168152602001908152602001600020546000146133765761324a6001846154a1565b8110156132875761327685828151811061326657613266615435565b60200260200101518b8887614285565b613280908361541d565b9150613376565b600061329383886154a1565b90508061012e60008885815181106132ad576132ad615435565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060008d6001600160a01b03166001600160a01b03168152602001908152602001600020600082825461330791906154a1565b925050819055508a6001600160a01b031686838151811061332a5761332a615435565b60200260200101516001600160a01b03167fc39e3e80c0219fde334a8cb5d8468b628482e23388b6e809c90cb00c63c8ce388360405161336c91815260200190565b60405180910390a3505b6001016131cd565b506001600160a01b038916600090815261012d6020526040812080548792906133a89084906154a1565b9091555050505050505050505050565b6040516001600160a01b038316602482015260448101829052610f6c9084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152614536565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b0316036134ac576134a582612b87565b905061354b565b61012f546040517f266e0a7f0000000000000000000000000000000000000000000000000000000081526001600160a01b0385811660048301528481166024830152600092169063266e0a7f90604401602060405180830381865afa158015613519573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061353d919061568e565b6001600160a01b0316141590505b92915050565b606580547fffffffffffffffffffffffff00000000000000000000000000000000000000001690556107018161461e565b61358b81613074565b60fb5460408051918252602082018390527fada67d0d38fa20c8ae6a5c17cb9d60b0fe7f2d4e4f27ac9ee55e54ac88de9d8d910160405180910390a160fb55565b60006135d88383613461565b613621576040517f983f1fb50000000000000000000000000000000000000000000000000000000081526001600160a01b03808516600483015283166024820152604401610a1b565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015282906000906001600160a01b038316906370a0823190602401602060405180830381865afa158015613683573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136a79190615545565b6001600160a01b038516600090815261012d602052604090205490915080821115613920576001600160a01b0380871660009081526101306020908152604080832093891683529290522054818303945060ff16156139205760fe546040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0391821660048201526000918516906370a0823190602401602060405180830381865afa158015613765573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137899190615545565b60fe549091506137a6906001600160a01b038681169116876133b8565b60fe546040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0391821660048201526000918616906370a0823190602401602060405180830381865afa15801561380b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061382f9190615545565b60fe546040518881529192506001600160a01b03898116928b82169291909116907fadc20ad416881f76b4304665c35f5be8592297bcdfe4f0bb087b9d254222af559060200160405180910390a460fe546001600160a01b03166353ac3537898961389a86866154a1565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b1681526001600160a01b0393841660048201529290911660248301526044820152606401600060405180830381600087803b15801561390157600080fd5b505af1158015613915573d6000803e3d6000fd5b505050506000955050505b50505092915050565b6000613933613f14565b60fe5460ff549192506001600160a01b03908116916000911615613db85760ff546040517f4e9f8f390000000000000000000000000000000000000000000000000000000081526001600160a01b03878116600483015285811660248301526000928392911690634e9f8f39906044016000604051808303816000875af11580156139c2573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526139ea91908101906156ab565b8151919350915060005b81811015613db357828181518110613a0e57613a0e615435565b602002602001015160000315613db3576000848281518110613a3257613a32615435565b60200260200101516001600160a01b0316636f1a30a8858481518110613a5a57613a5a615435565b60200260200101518c8b6040518463ffffffff1660e01b8152600401613a9c939291909283526001600160a01b03918216602084015216604082015260600190565b60408051808303816000875af1158015613aba573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ade9190615766565b91505088811115613aec5750875b613af6818b614688565b613b005750613db3565b6040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b038881166004830152600091908a16906370a0823190602401602060405180830381865afa158015613b63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b879190615545565b90508a6001600160a01b031663095ea7b3878581518110613baa57613baa615435565b6020026020010151846040518363ffffffff1660e01b8152600401613be49291906001600160a01b03929092168252602082015260400190565b6020604051808303816000875af1158015613c03573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613c27919061555e565b50858381518110613c3a57613c3a615435565b60209081029190910101516040517f439727a500000000000000000000000000000000000000000000000000000000815260048101849052600060248201526001600160a01b038d811660448301528b811660648301528a811660848301529091169063439727a59060a40160408051808303816000875af1158015613cc4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ce89190615766565b50506040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b038981166004830152600091908b16906370a0823190602401602060405180830381865afa158015613d4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d719190615545565b9050613d7d838c6154a1565b9a50613d8982826154a1565b613d93908961541d565b97508a600003613da557505050613db3565b8360010193505050506139f4565b505050505b61096b86848388886147c0565b600080613dd28585613fa0565b6000613ddf87878761107a565b91505087811115613e26576040517f71b5f0c10000000000000000000000000000000000000000000000000000000081526004810182905260248101899052604401610a1b565b613e3086826140c0565b9250613e3d838787610f71565b9250613e4c905085858461420b565b509550959350505050565b600080613e648585613fa0565b6000613e7187878761107a565b915050613e7e86826140c0565b9250808314613eb9576040517f0c5c1c2000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b87831115613efd576040517f71b5f0c10000000000000000000000000000000000000000000000000000000081526004810182905260248101899052604401610a1b565b613f0885858961420b565b50909694955050505050565b60fe54604080517fc8ecc0d300000000000000000000000000000000000000000000000000000000815290516000926001600160a01b03169163c8ecc0d39160048083019260209291908290030181865afa158015613f77573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f9b919061568e565b905090565b60ff546000906001600160a01b03161580159061403d575060ff546040517f6c059fb10000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b0390911690636c059fb190602401602060405180830381865afa158015614019573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061403d919061555e565b905080158015614089575060026001600160a01b03808516600090815260fd602090815260408083209387168352929052206001015460ff16600381111561408757614087615122565b145b15610f6c576040517f03410cd100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fe546040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b039182166004820152600091849183918316906370a0823190602401602060405180830381865afa158015614129573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061414d9190615545565b60fe5490915061416c906001600160a01b03848116913391168761495e565b60fe546040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0391821660048201526000918416906370a0823190602401602060405180830381865afa1580156141d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906141f59190615545565b905061420182826154a1565b9695505050505050565b6001600160a01b038316600090815261012d60205260409020548181101561425f576040517f6bb2792900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61426984836149af565b8361427e6001600160a01b03821685856133b8565b5050505050565b6001600160a01b03808516600090815261012e6020908152604080832093871683529290529081205482906142bb908590615464565b6142c591906154b8565b6001600160a01b03808716600090815261012e602090815260408083209389168352929052908120805492935083929091906143029084906154a1565b92505081905550836001600160a01b0316856001600160a01b03167fc39e3e80c0219fde334a8cb5d8468b628482e23388b6e809c90cb00c63c8ce388360405161434e91815260200190565b60405180910390a3949350505050565b600054610100900460ff166143db5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a1b565b6143e36149e1565b61070181614a66565b600054610100900460ff166144695760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a1b565b611250614ae3565b600054610100900460ff166144ee5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a1b565b6144f7836126d4565b61450082611cd8565b61450981613582565b505060fe80547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16905550565b600061458b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316614b609092919063ffffffff16565b90508051600014806145ac5750808060200190518101906145ac919061555e565b610f6c5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610a1b565b603380546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038381166004830152600092169063b62cad6990602401600060405180830381600087803b1580156146e957600080fd5b505af11580156146fd573d6000803e3d6000fd5b505060fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b03868116600483015260009450670de0b6b3a76400009350879216906341976e0990602401602060405180830381865afa158015614771573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906147959190615545565b61479f9190615464565b6147a991906154b8565b905060fb5481106147b957600191505b5092915050565b82156148975760fe546040518481526001600160a01b0386811692888216929116907fadc20ad416881f76b4304665c35f5be8592297bcdfe4f0bb087b9d254222af559060200160405180910390a460fe546040517f53ac35370000000000000000000000000000000000000000000000000000000081526001600160a01b038781166004830152868116602483015260448201869052909116906353ac353790606401600060405180830381600087803b15801561487e57600080fd5b505af1158015614892573d6000803e3d6000fd5b505050505b801561427e576001600160a01b038216600090815261012d6020526040812080548392906148c690849061541d565b90915550506001600160a01b03808616600090815261012e602090815260408083209386168352929052908120805483929061490390849061541d565b92505081905550816001600160a01b0316856001600160a01b03167fc39e3e80c0219fde334a8cb5d8468b628482e23388b6e809c90cb00c63c8ce388360405161494f91815260200190565b60405180910390a35050505050565b6040516001600160a01b0380851660248301528316604482015260648101829052611bef9085907f23b872dd00000000000000000000000000000000000000000000000000000000906084016133fd565b6001600160a01b038216600090815261012d6020526040812080548392906149d89084906154a1565b90915550505050565b600054610100900460ff16614a5e5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a1b565b611250614b79565b600054610100900460ff166107c75760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a1b565b600054610100900460ff166126505760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a1b565b6060614b6f8484600085614bff565b90505b9392505050565b600054610100900460ff16614bf65760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a1b565b61125033613551565b606082471015614c775760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610a1b565b600080866001600160a01b03168587604051614c93919061578a565b60006040518083038185875af1925050503d8060008114614cd0576040519150601f19603f3d011682016040523d82523d6000602084013e614cd5565b606091505b5091509150614ce687838387614cf3565b925050505b949350505050565b60608315614d62578251600003614d5b576001600160a01b0385163b614d5b5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610a1b565b5081614ceb565b614ceb8383815115614d775781518083602001fd5b8060405162461bcd60e51b8152600401610a1b91906157a6565b6001600160a01b038116811461070157600080fd5b8035610dc781614d91565b600060208284031215614dc357600080fd5b8135614b7281614d91565b600080600060608486031215614de357600080fd5b833592506020840135614df581614d91565b91506040840135614e0581614d91565b809150509250925092565b600080600080600060a08688031215614e2857600080fd5b85359450602086013593506040860135614e4181614d91565b92506060860135614e5181614d91565b91506080860135614e6181614d91565b809150509295509295909350565b60008060408385031215614e8257600080fd5b8235614e8d81614d91565b91506020830135614e9d81614d91565b809150509250929050565b60008083601f840112614eba57600080fd5b50813567ffffffffffffffff811115614ed257600080fd5b6020830191508360208260051b8501011115614eed57600080fd5b9250929050565b60008060008060008060608789031215614f0d57600080fd5b863567ffffffffffffffff80821115614f2557600080fd5b614f318a838b01614ea8565b90985096506020890135915080821115614f4a57600080fd5b614f568a838b01614ea8565b90965094506040890135915080821115614f6f57600080fd5b50614f7c89828a01614ea8565b979a9699509497509295939492505050565b60008060008060008060008060008060006101008c8e031215614fb057600080fd5b614fb98c614da6565b9a50614fc760208d01614da6565b9950614fd560408d01614da6565b9850614fe360608d01614da6565b975060808c0135965067ffffffffffffffff8060a08e0135111561500657600080fd5b6150168e60a08f01358f01614ea8565b909750955060c08d013581101561502c57600080fd5b61503c8e60c08f01358f01614ea8565b909550935060e08d013581101561505257600080fd5b506150638d60e08e01358e01614ea8565b81935080925050509295989b509295989b9093969950565b6020808252825182820181905260009190848201906040850190845b818110156150bc5783516001600160a01b031683529284019291840191600101615097565b50909695505050505050565b6000806000606084860312156150dd57600080fd5b83356150e881614d91565b925060208401356150f881614d91565b929592945050506040919091013590565b60006020828403121561511b57600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60048110615188577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b9052565b82815260408101614b726020830184615151565b6000806000806000606086880312156151b857600080fd5b85356151c381614d91565b9450602086013567ffffffffffffffff808211156151e057600080fd5b6151ec89838a01614ea8565b9096509450604088013591508082111561520557600080fd5b818801915088601f83011261521957600080fd5b81358181111561522857600080fd5b8960208260061b850101111561523d57600080fd5b9699959850939650602001949392505050565b6000806000838503608081121561526657600080fd5b843561527181614d91565b9350602085013561528181614d91565b925060407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0820112156152b357600080fd5b506040840190509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715615319576153196152c1565b604052919050565b600067ffffffffffffffff82111561533b5761533b6152c1565b5060051b60200190565b600082601f83011261535657600080fd5b8151602061536b61536683615321565b6152f0565b82815260059290921b8401810191818101908684111561538a57600080fd5b8286015b848110156153ae5780516153a181614d91565b835291830191830161538e565b509695505050505050565b6000602082840312156153cb57600080fd5b815167ffffffffffffffff8111156153e257600080fd5b614ceb84828501615345565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008219821115615430576154306153ee565b500190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561549c5761549c6153ee565b500290565b6000828210156154b3576154b36153ee565b500390565b6000826154ee577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60006020828403121561550557600080fd5b813560048110614b7257600080fd5b848152602081018490526080810161552f6040830185615151565b61553c6060830184615151565b95945050505050565b60006020828403121561555757600080fd5b5051919050565b60006020828403121561557057600080fd5b81518015158114614b7257600080fd5b60005b8381101561559b578181015183820152602001615583565b83811115611bef5750506000910152565b600081518084526155c4816020860160208601615580565b601f01601f19169290920160200192915050565b6001600160a01b0383168152604060208201526000614b6f60408301846155ac565b60006001600160a01b0380861683528085166020840152506060604083015261553c60608301846155ac565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261565b57600080fd5b83018035915067ffffffffffffffff82111561567657600080fd5b6020019150600581901b3603821315614eed57600080fd5b6000602082840312156156a057600080fd5b8151614b7281614d91565b600080604083850312156156be57600080fd5b825167ffffffffffffffff808211156156d657600080fd5b6156e286838701615345565b93506020915081850151818111156156f957600080fd5b85019050601f8101861361570c57600080fd5b805161571a61536682615321565b81815260059190911b8201830190838101908883111561573957600080fd5b928401925b828410156157575783518252928401929084019061573e565b80955050505050509250929050565b6000806040838503121561577957600080fd5b505080516020909101519092909150565b6000825161579c818460208701615580565b9190910192915050565b602081526000614b7260208301846155ac56fe736574436f6e76657273696f6e436f6e66696728616464726573732c616464726573732c436f6e76657273696f6e436f6e66696729736574506f6f6c734173736574734469726563745472616e7366657228616464726573735b5d2c616464726573735b5d5b5d2c626f6f6c5b5d5b5d29a26469706673582212200c4c1be8186609d8812933be8513b877d4d7456c543e250549bac4e27cafee1364736f6c634300080d0033", + "numDeployments": 2, + "solcInputHash": "e9f683aad829bf9574e4eef6b067ab3e", + "metadata": "{\"compiler\":{\"version\":\"0.8.13+commit.abaa5c0e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"corePoolComptroller_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"vBNB_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"nativeWrapped_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountInMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountInMaxMantissa\",\"type\":\"uint256\"}],\"name\":\"AmountInHigherThanMax\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AmountInMismatched\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOutMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMinMantissa\",\"type\":\"uint256\"}],\"name\":\"AmountOutLowerThanMinRequired\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AmountOutMismatched\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ConversionConfigNotEnabled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ConversionEnabledOnlyForPrivateConversions\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ConversionTokensActive\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ConversionTokensPaused\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DeflationaryTokenNotSupported\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"incentive\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxIncentive\",\"type\":\"uint256\"}],\"name\":\"IncentiveTooHigh\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InputLengthMisMatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientBalance\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientInputAmount\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientOutputAmount\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientPoolLiquidity\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidArguments\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidConverterNetwork\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidMinimumAmountToConvert\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidToAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidTokenConfigAddresses\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"comptroller\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"}],\"name\":\"MarketNotExistInPool\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NonZeroIncentiveForPrivateConversion\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ReentrancyGuardError\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"calledContract\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"methodSignature\",\"type\":\"string\"}],\"name\":\"Unauthorized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddressNotAllowed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroValueNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"comptroller\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"AssetTransferredToDestination\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"comptroller\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"AssetsReservesUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldIncentive\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newIncentive\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"enum IAbstractTokenConverter.ConversionAccessibility\",\"name\":\"oldAccess\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"enum IAbstractTokenConverter.ConversionAccessibility\",\"name\":\"newAccess\",\"type\":\"uint8\"}],\"name\":\"ConversionConfigUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"ConversionPaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"ConversionResumed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"name\":\"ConvertedExactTokens\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"name\":\"ConvertedExactTokensSupportingFeeOnTransferTokens\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"name\":\"ConvertedForExactTokens\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"name\":\"ConvertedForExactTokensSupportingFeeOnTransferTokens\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldConverterNetwork\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"converterNetwork\",\"type\":\"address\"}],\"name\":\"ConverterNetworkAddressUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldDestinationAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"destinationAddress\",\"type\":\"address\"}],\"name\":\"DestinationAddressUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldMinAmountToConvert\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newMinAmountToConvert\",\"type\":\"uint256\"}],\"name\":\"MinAmountToConvertUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldAccessControlManager\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAccessControlManager\",\"type\":\"address\"}],\"name\":\"NewAccessControlManager\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"comptroller\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"value\",\"type\":\"bool\"}],\"name\":\"PoolAssetsDirectTransferUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldPoolRegistry\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newPoolRegistry\",\"type\":\"address\"}],\"name\":\"PoolRegistryUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract ResilientOracle\",\"name\":\"oldPriceOracle\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"contract ResilientOracle\",\"name\":\"priceOracle\",\"type\":\"address\"}],\"name\":\"PriceOracleUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"SweepToken\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"CORE_POOL_COMPTROLLER\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_INCENTIVE\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"NATIVE_WRAPPED\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"VBNB\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"accessControlManager\",\"outputs\":[{\"internalType\":\"contract IAccessControlManagerV8\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenBalance\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"conversionConfigurations\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"incentive\",\"type\":\"uint256\"},{\"internalType\":\"enum IAbstractTokenConverter.ConversionAccessibility\",\"name\":\"conversionAccess\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"conversionPaused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountInMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMinMantissa\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"convertExactTokens\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"actualAmountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actualAmountOut\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountInMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMinMantissa\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"convertExactTokensSupportingFeeOnTransferTokens\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"actualAmountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actualAmountOut\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountInMaxMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMantissa\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"convertForExactTokens\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"actualAmountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actualAmountOut\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountInMaxMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMantissa\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"convertForExactTokensSupportingFeeOnTransferTokens\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"actualAmountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actualAmountOut\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"converterNetwork\",\"outputs\":[{\"internalType\":\"contract IConverterNetwork\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"destinationAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOutMantissa\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"}],\"name\":\"getAmountIn\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountConvertedMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountInMantissa\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountInMantissa\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"}],\"name\":\"getAmountOut\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountConvertedMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMantissa\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"comptroller\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"}],\"name\":\"getPoolAssetReserve\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"reserves\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"getPools\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"poolsWithCore\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOutMantissa\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"}],\"name\":\"getUpdatedAmountIn\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountConvertedMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountInMantissa\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountInMantissa\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"}],\"name\":\"getUpdatedAmountOut\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountConvertedMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMantissa\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"accessControlManager_\",\"type\":\"address\"},{\"internalType\":\"contract ResilientOracle\",\"name\":\"priceOracle_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"destinationAddress_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"poolRegistry_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"minAmountToConvert_\",\"type\":\"uint256\"},{\"internalType\":\"address[]\",\"name\":\"comptrollers\",\"type\":\"address[]\"},{\"internalType\":\"address[][]\",\"name\":\"assets\",\"type\":\"address[][]\"},{\"internalType\":\"bool[][]\",\"name\":\"values\",\"type\":\"bool[][]\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"minAmountToConvert\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pauseConversion\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pendingOwner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"poolRegistry\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"poolsAssetsDirectTransfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"priceOracle\",\"outputs\":[{\"internalType\":\"contract ResilientOracle\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"resumeConversion\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"accessControlManager_\",\"type\":\"address\"}],\"name\":\"setAccessControlManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"incentive\",\"type\":\"uint256\"},{\"internalType\":\"enum IAbstractTokenConverter.ConversionAccessibility\",\"name\":\"conversionAccess\",\"type\":\"uint8\"}],\"internalType\":\"struct IAbstractTokenConverter.ConversionConfig\",\"name\":\"conversionConfig\",\"type\":\"tuple\"}],\"name\":\"setConversionConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"tokenAddressesOut\",\"type\":\"address[]\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"incentive\",\"type\":\"uint256\"},{\"internalType\":\"enum IAbstractTokenConverter.ConversionAccessibility\",\"name\":\"conversionAccess\",\"type\":\"uint8\"}],\"internalType\":\"struct IAbstractTokenConverter.ConversionConfig[]\",\"name\":\"conversionConfigs\",\"type\":\"tuple[]\"}],\"name\":\"setConversionConfigs\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IConverterNetwork\",\"name\":\"converterNetwork_\",\"type\":\"address\"}],\"name\":\"setConverterNetwork\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"destinationAddress_\",\"type\":\"address\"}],\"name\":\"setDestination\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minAmountToConvert_\",\"type\":\"uint256\"}],\"name\":\"setMinAmountToConvert\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"poolRegistry_\",\"type\":\"address\"}],\"name\":\"setPoolRegistry\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"comptrollers\",\"type\":\"address[]\"},{\"internalType\":\"address[][]\",\"name\":\"assets\",\"type\":\"address[][]\"},{\"internalType\":\"bool[][]\",\"name\":\"values\",\"type\":\"bool[][]\"}],\"name\":\"setPoolsAssetsDirectTransfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ResilientOracle\",\"name\":\"priceOracle_\",\"type\":\"address\"}],\"name\":\"setPriceOracle\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"sweepToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"comptroller\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"}],\"name\":\"updateAssetsState\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Venus\",\"custom:security-contact\":\"https://github.com/VenusProtocol/protocol-reserve#discussion\",\"errors\":{\"ReentrancyGuardError()\":[{\"details\":\"This error is used to safeguard against reentrancy attacks, ensuring that a certain operation cannot be called recursively within the same transaction.\"}]},\"kind\":\"dev\",\"methods\":{\"acceptOwnership()\":{\"details\":\"The new owner accepts the ownership transfer.\"},\"balanceOf(address)\":{\"params\":{\"tokenAddress\":\"Address of the token\"},\"returns\":{\"tokenBalance\":\"Reserves of the token the contract has\"}},\"constructor\":{\"custom:oz-upgrades-unsafe-allow\":\"constructor\",\"params\":{\"corePoolComptroller_\":\"Address of the Comptroller pool\",\"nativeWrapped_\":\"Address of the wrapped native currency\",\"vBNB_\":\"Address of the vBNB\"}},\"convertExactTokens(uint256,uint256,address,address,address)\":{\"custom:error\":\"ZeroAddressNotAllowed is thrown when to address is zeroInvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOutAmountOutLowerThanMinRequired error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissaAmountInMismatched error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa\",\"custom:event\":\"Emits ConvertedExactTokens event on success\",\"details\":\"Method does not support deflationary tokens transfer\",\"params\":{\"amountInMantissa\":\"Amount of tokenAddressIn\",\"amountOutMinMantissa\":\"Min amount of tokenAddressOut required as output\",\"to\":\"Address of the tokenAddressOut receiver\",\"tokenAddressIn\":\"Address of the token to convert\",\"tokenAddressOut\":\"Address of the token to get after conversion\"},\"returns\":{\"actualAmountIn\":\"Actual amount transferred to destination\",\"actualAmountOut\":\"Actual amount transferred to user\"}},\"convertExactTokensSupportingFeeOnTransferTokens(uint256,uint256,address,address,address)\":{\"custom:error\":\"ZeroAddressNotAllowed is thrown when to address is zeroInvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOutAmountOutLowerThanMinRequired error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa\",\"custom:event\":\"Emits ConvertedExactTokensSupportingFeeOnTransferTokens event on success\",\"params\":{\"amountInMantissa\":\"Amount of tokenAddressIn\",\"amountOutMinMantissa\":\"Min amount of tokenAddressOut required as output\",\"to\":\"Address of the tokenAddressOut receiver\",\"tokenAddressIn\":\"Address of the token to convert\",\"tokenAddressOut\":\"Address of the token to get after conversion\"},\"returns\":{\"actualAmountIn\":\"Actual amount transferred to destination\",\"actualAmountOut\":\"Actual amount transferred to user\"}},\"convertForExactTokens(uint256,uint256,address,address,address)\":{\"custom:error\":\"ZeroAddressNotAllowed is thrown when to address is zeroInvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOutAmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissaAmountOutMismatched error is thrown when actualAmountOut is does not match amountOutMantissa\",\"custom:event\":\"Emits ConvertedForExactTokens event on success\",\"details\":\"Method does not support deflationary tokens transfer\",\"params\":{\"amountInMaxMantissa\":\"Max amount of tokenAddressIn\",\"amountOutMantissa\":\"Amount of tokenAddressOut required as output\",\"to\":\"Address of the tokenAddressOut receiver\",\"tokenAddressIn\":\"Address of the token to convert\",\"tokenAddressOut\":\"Address of the token to get after conversion\"},\"returns\":{\"actualAmountIn\":\"Actual amount transferred to destination\",\"actualAmountOut\":\"Actual amount transferred to user\"}},\"convertForExactTokensSupportingFeeOnTransferTokens(uint256,uint256,address,address,address)\":{\"custom:error\":\"ZeroAddressNotAllowed is thrown when to address is zeroInvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOutAmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissa\",\"custom:event\":\"Emits ConvertedForExactTokensSupportingFeeOnTransferTokens event on success\",\"params\":{\"amountInMaxMantissa\":\"Max amount of tokenAddressIn\",\"amountOutMantissa\":\"Amount of tokenAddressOut required as output\",\"to\":\"Address of the tokenAddressOut receiver\",\"tokenAddressIn\":\"Address of the token to convert\",\"tokenAddressOut\":\"Address of the token to get after conversion\"},\"returns\":{\"actualAmountIn\":\"Actual amount transferred to destination\",\"actualAmountOut\":\"Actual amount transferred to user\"}},\"getAmountIn(uint256,address,address)\":{\"custom:error\":\"InsufficientInputAmount error is thrown when given input amount is zeroConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pairConversionEnabledOnlyForPrivateConversions is thrown when conversion is only enabled for private conversion\",\"details\":\"This function retrieves values without altering token prices\",\"params\":{\"amountOutMantissa\":\"Amount of tokenAddressOut user wants to receive\",\"tokenAddressIn\":\"Address of the token to convert\",\"tokenAddressOut\":\"Address of the token to get after conversion\"},\"returns\":{\"amountConvertedMantissa\":\"Amount of tokenAddressOut should be transferred after conversion\",\"amountInMantissa\":\"Amount of the tokenAddressIn sender would send to contract before conversion\"}},\"getAmountOut(uint256,address,address)\":{\"custom:error\":\"InsufficientInputAmount error is thrown when given input amount is zeroConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pairConversionEnabledOnlyForPrivateConversions is thrown when conversion is only enabled for private conversion\",\"details\":\"This function retrieves values without altering token prices\",\"params\":{\"amountInMantissa\":\"Amount of tokenAddressIn\",\"tokenAddressIn\":\"Address of the token to convert\",\"tokenAddressOut\":\"Address of the token to get after conversion\"},\"returns\":{\"amountConvertedMantissa\":\"Amount of tokenAddressIn should be transferred after conversion\",\"amountOutMantissa\":\"Amount of the tokenAddressOut sender should receive after conversion\"}},\"getPoolAssetReserve(address,address)\":{\"custom:error\":\"MarketNotExistInPool When asset does not exist in the pool(comptroller)ReentrancyGuardError thrown to prevent reentrancy during the function execution\",\"details\":\"Get the Amount of the asset in the risk fund for the specific pool\",\"params\":{\"asset\":\"Asset address\",\"comptroller\":\"Comptroller address (pool)\"},\"returns\":{\"reserves\":\"Asset's reserve in risk fund\"}},\"getPools(address)\":{\"params\":{\"tokenAddress\":\"Address of the token\"},\"returns\":{\"poolsWithCore\":\"Array of the pools addresses in which token is available\"}},\"getUpdatedAmountIn(uint256,address,address)\":{\"custom:error\":\"InsufficientInputAmount error is thrown when given input amount is zeroConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\",\"params\":{\"amountOutMantissa\":\"Amount of tokenAddressOut user wants to receive\",\"tokenAddressIn\":\"Address of the token to convert\",\"tokenAddressOut\":\"Address of the token to get after conversion\"},\"returns\":{\"amountConvertedMantissa\":\"Amount of tokenAddressOut should be transferred after conversion\",\"amountInMantissa\":\"Amount of the tokenAddressIn sender would send to contract before conversion\"}},\"getUpdatedAmountOut(uint256,address,address)\":{\"custom:error\":\"InsufficientInputAmount error is thrown when given input amount is zeroConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\",\"params\":{\"amountInMantissa\":\"Amount of tokenAddressIn\",\"tokenAddressIn\":\"Address of the token to convert\",\"tokenAddressOut\":\"Address of the token to get after conversion\"},\"returns\":{\"amountConvertedMantissa\":\"Amount of tokenAddressIn should be transferred after conversion\",\"amountOutMantissa\":\"Amount of the tokenAddressOut sender should receive after conversion\"}},\"initialize(address,address,address,address,uint256,address[],address[][],bool[][])\":{\"custom:event\":\"PoolAssetsDirectTransferUpdated emits on success\",\"params\":{\"accessControlManager_\":\"Access control manager contract address\",\"assets\":\"Addresses of the assets need to be added for direct transfer\",\"comptrollers\":\"Addresses of the pools\",\"destinationAddress_\":\"Address at all incoming tokens will transferred to\",\"minAmountToConvert_\":\"minimum amount to convert\",\"poolRegistry_\":\"Address of the pool registry\",\"priceOracle_\":\"Resilient oracle address\",\"values\":\"Boolean value to indicate whether direct transfer is allowed for each asset.\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"pauseConversion()\":{\"custom:access\":\"Restricted by ACM\",\"custom:error\":\"ConversionTokensPaused thrown when conversion is already paused\",\"custom:event\":\"Emits ConversionPaused on success\"},\"pendingOwner()\":{\"details\":\"Returns the address of the pending owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.\"},\"resumeConversion()\":{\"custom:access\":\"Restricted by ACM\",\"custom:error\":\"ConversionTokensActive thrown when conversion is already active\",\"custom:event\":\"Emits ConversionResumed on success\"},\"setAccessControlManager(address)\":{\"custom:access\":\"Only Governance\",\"custom:event\":\"Emits NewAccessControlManager event\",\"details\":\"Admin function to set address of AccessControlManager\",\"params\":{\"accessControlManager_\":\"The new address of the AccessControlManager\"}},\"setConversionConfig(address,address,(uint256,uint8))\":{\"custom:access\":\"Controlled by AccessControlManager\",\"custom:error\":\"Unauthorized error is thrown when the call is not authorized by AccessControlManagerZeroAddressNotAllowed is thrown when pool registry address is zeroNonZeroIncentiveForPrivateConversion is thrown when incentive is non zero for private conversion\",\"custom:event\":\"Emits ConversionConfigUpdated event on success\",\"params\":{\"conversionConfig\":\"ConversionConfig config details to update\",\"tokenAddressIn\":\"Address of tokenIn\",\"tokenAddressOut\":\"Address of tokenOut\"}},\"setConversionConfigs(address,address[],(uint256,uint8)[])\":{\"custom:error\":\"InputLengthMisMatch is thrown when tokenAddressesOut and conversionConfigs array length mismatches\",\"params\":{\"conversionConfigs\":\"Array of conversionConfig config details to update\",\"tokenAddressIn\":\"Address of tokenIn\",\"tokenAddressesOut\":\"Array of addresses of tokenOut\"}},\"setConverterNetwork(address)\":{\"custom:access\":\"Only Governance\",\"params\":{\"converterNetwork_\":\"The converterNetwork address to be set\"}},\"setDestination(address)\":{\"custom:access\":\"Only Governance\",\"params\":{\"destinationAddress_\":\"The new destination address to be set\"}},\"setMinAmountToConvert(uint256)\":{\"custom:access\":\"Only Governance\",\"params\":{\"minAmountToConvert_\":\"Min amount to convert\"}},\"setPoolRegistry(address)\":{\"custom:access\":\"Only Governance\",\"custom:error\":\"ZeroAddressNotAllowed is thrown when pool registry address is zero\",\"custom:event\":\"PoolRegistryUpdated emits on success\",\"details\":\"Pool registry setter\",\"params\":{\"poolRegistry_\":\"Address of the pool registry\"}},\"setPoolsAssetsDirectTransfer(address[],address[][],bool[][])\":{\"custom:access\":\"Restricted by ACM\",\"custom:event\":\"PoolAssetsDirectTransferUpdated emits on success\",\"params\":{\"assets\":\"Addresses of the assets need to be added for direct transfer\",\"comptrollers\":\"Addresses of the pools\",\"values\":\"Boolean value to indicate whether direct transfer is allowed for each asset.\"}},\"setPriceOracle(address)\":{\"custom:access\":\"Only Governance\",\"params\":{\"priceOracle_\":\"Address of the new price oracle to set\"}},\"sweepToken(address,address,uint256)\":{\"custom:access\":\"Only Governance\",\"custom:error\":\"ZeroAddressNotAllowed is thrown when tokenAddress/to address is zero\",\"custom:event\":\"Emits SweepToken event on success\",\"params\":{\"amount\":\"The amount to transfer\",\"to\":\"The address to which tokens will be transferred\",\"tokenAddress\":\"The address of the ERC-20 token to sweep\"}},\"transferOwnership(address)\":{\"details\":\"Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. Can only be called by the current owner.\"},\"updateAssetsState(address,address)\":{\"details\":\"This function is called by protocolShareReservecall _updateAssetsState to update the states related to the comptroller and asset transfer to the specific converter then it calls the _privateConversion which will convert the asset into destination's base asset and transfer it to destination address\",\"params\":{\"asset\":\"Asset address\",\"comptroller\":\"Comptroller address (pool)\"}}},\"stateVariables\":{\"CORE_POOL_COMPTROLLER\":{\"custom:oz-upgrades-unsafe-allow\":\"state-variable-immutable\"},\"NATIVE_WRAPPED\":{\"custom:oz-upgrades-unsafe-allow\":\"state-variable-immutable\"},\"VBNB\":{\"custom:oz-upgrades-unsafe-allow\":\"state-variable-immutable\",\"details\":\"This address is used to include the BNB market while in getPools method\"},\"poolsAssetsDirectTransfer\":{\"details\":\"Comptroller(pool) -> Asset -> bool(should transfer directly on true)\"},\"poolsAssetsReserves\":{\"details\":\"Comptroller(pool) -> Asset -> amount\"}},\"title\":\"RiskFundConverter\",\"version\":1},\"userdoc\":{\"errors\":{\"AmountInHigherThanMax(uint256,uint256)\":[{\"notice\":\"Thrown when amountIn is higher than amountInMax\"}],\"AmountInMismatched()\":[{\"notice\":\"Thrown when actualAmountIn does not match with amountInMantissa for convertForExactTokens\"}],\"AmountOutLowerThanMinRequired(uint256,uint256)\":[{\"notice\":\"Thrown when amountOut is lower than amountOutMin\"}],\"AmountOutMismatched()\":[{\"notice\":\"Thrown when actualAmountOut does not match with amountOutMantissa for convertForExactTokens\"}],\"ConversionConfigNotEnabled()\":[{\"notice\":\"Thrown when conversion is disabled or config does not exist for given pair\"}],\"ConversionEnabledOnlyForPrivateConversions()\":[{\"notice\":\"Thrown when conversion is enabled only for private conversions\"}],\"ConversionTokensActive()\":[{\"notice\":\"Thrown when conversion is Active\"}],\"ConversionTokensPaused()\":[{\"notice\":\"Thrown when conversion is paused\"}],\"DeflationaryTokenNotSupported()\":[{\"notice\":\"Thrown when using convertForExactTokens deflationary tokens\"}],\"IncentiveTooHigh(uint256,uint256)\":[{\"notice\":\"Thrown when incentive is higher than the MAX_INCENTIVE\"}],\"InputLengthMisMatch()\":[{\"notice\":\"Thrown when there is a mismatch in the length of input arrays\"}],\"InsufficientBalance()\":[{\"notice\":\"thrown when amount entered is greater than balance\"}],\"InsufficientInputAmount()\":[{\"notice\":\"Thrown when given input amount is zero\"}],\"InsufficientOutputAmount()\":[{\"notice\":\"Thrown when given output amount is zero\"}],\"InsufficientPoolLiquidity()\":[{\"notice\":\"Thrown when contract has less liquidity for tokenAddressOut than amountOutMantissa\"}],\"InvalidConverterNetwork()\":[{\"notice\":\"When address of the ConverterNetwork is not set or Zero address\"}],\"InvalidMinimumAmountToConvert()\":[{\"notice\":\"Thrown when minimum amount to convert is zero\"}],\"InvalidToAddress()\":[{\"notice\":\"Thrown when address(to) is same as tokenAddressIn or tokenAddressOut\"}],\"InvalidTokenConfigAddresses()\":[{\"notice\":\"Thrown when tokenInAddress is same as tokeOutAdress OR tokeInAddress is not the base asset of the destination\"}],\"MarketNotExistInPool(address,address)\":[{\"notice\":\"thrown when asset does not exist in the pool\"}],\"NonZeroIncentiveForPrivateConversion()\":[{\"notice\":\"Thrown when trying to set non zero incentive for private conversion\"}],\"ReentrancyGuardError()\":[{\"notice\":\"thrown to prevent reentrancy\"}],\"Unauthorized(address,address,string)\":[{\"notice\":\"Thrown when the action is prohibited by AccessControlManager\"}],\"ZeroAddressNotAllowed()\":[{\"notice\":\"Thrown if the supplied address is a zero address where it is not allowed\"}],\"ZeroValueNotAllowed()\":[{\"notice\":\"Thrown if the supplied value is 0 where it is not allowed\"}]},\"events\":{\"AssetTransferredToDestination(address,address,address,uint256)\":{\"notice\":\"Emmitted after the funds transferred to the destination address\"},\"AssetsReservesUpdated(address,address,uint256)\":{\"notice\":\"Emitted after updating of the assets reserves amount -> reserve increased by amount\"},\"ConversionConfigUpdated(address,address,uint256,uint256,uint8,uint8)\":{\"notice\":\"Emitted when config is updated for tokens pair\"},\"ConversionPaused(address)\":{\"notice\":\"Emitted when conversion is paused\"},\"ConversionResumed(address)\":{\"notice\":\"Emitted when conversion is unpaused\"},\"ConvertedExactTokens(address,address,address,address,uint256,uint256)\":{\"notice\":\"Emitted when exact amount of tokens are converted for tokens\"},\"ConvertedExactTokensSupportingFeeOnTransferTokens(address,address,address,address,uint256,uint256)\":{\"notice\":\"Emitted when exact amount of tokens are converted for tokens, for deflationary tokens\"},\"ConvertedForExactTokens(address,address,address,address,uint256,uint256)\":{\"notice\":\"Emitted when tokens are converted for exact amount of tokens\"},\"ConvertedForExactTokensSupportingFeeOnTransferTokens(address,address,address,address,uint256,uint256)\":{\"notice\":\"Emitted when tokens are converted for exact amount of tokens, for deflationary tokens\"},\"ConverterNetworkAddressUpdated(address,address)\":{\"notice\":\"Emitted when converterNetwork address is updated\"},\"DestinationAddressUpdated(address,address)\":{\"notice\":\"Emitted when destination address is updated\"},\"MinAmountToConvertUpdated(uint256,uint256)\":{\"notice\":\"Emitted when minimum amount to convert is updated\"},\"NewAccessControlManager(address,address)\":{\"notice\":\"Emitted when access control manager contract address is changed\"},\"PoolAssetsDirectTransferUpdated(address,address,bool)\":{\"notice\":\"Emitted after the poolsAssetsDirectTransfer mapping is updated\"},\"PoolRegistryUpdated(address,address)\":{\"notice\":\"Emitted when pool registry address is updated\"},\"PriceOracleUpdated(address,address)\":{\"notice\":\"Emitted when price oracle address is updated\"},\"SweepToken(address,address,uint256)\":{\"notice\":\"Event emitted when tokens are swept\"}},\"kind\":\"user\",\"methods\":{\"CORE_POOL_COMPTROLLER()\":{\"notice\":\"Address of the core pool comptroller\"},\"MAX_INCENTIVE()\":{\"notice\":\"Maximum incentive could be\"},\"NATIVE_WRAPPED()\":{\"notice\":\"Address of the native wrapped currency\"},\"VBNB()\":{\"notice\":\"Address of the vBNB\"},\"accessControlManager()\":{\"notice\":\"Returns the address of the access control manager contract\"},\"balanceOf(address)\":{\"notice\":\"Get the balance for specific token\"},\"conversionConfigurations(address,address)\":{\"notice\":\"conversion configurations for the existing pairs\"},\"conversionPaused()\":{\"notice\":\"Boolean for if conversion is paused\"},\"convertExactTokens(uint256,uint256,address,address,address)\":{\"notice\":\"Converts exact amount of tokenAddressIn for tokenAddressOut if there is enough tokens held by the contract\"},\"convertExactTokensSupportingFeeOnTransferTokens(uint256,uint256,address,address,address)\":{\"notice\":\"Converts exact amount of tokenAddressIn for tokenAddressOut if there is enough tokens held by the contract\"},\"convertForExactTokens(uint256,uint256,address,address,address)\":{\"notice\":\"Converts tokens for tokenAddressIn for exact amount of tokenAddressOut if there is enough tokens held by the contract, otherwise the amount is adjusted\"},\"convertForExactTokensSupportingFeeOnTransferTokens(uint256,uint256,address,address,address)\":{\"notice\":\"Converts tokens for tokenAddressIn for amount of tokenAddressOut calculated on the basis of amount of tokenAddressIn received by the contract, if there is enough tokens held by the contract, otherwise the amount is adjusted. The user will be responsible for bearing any fees associated with token transfers, whether pulling in or pushing out tokens\"},\"converterNetwork()\":{\"notice\":\"Address of the converterNetwork contract\"},\"destinationAddress()\":{\"notice\":\"Address that all incoming tokens are transferred to\"},\"getAmountIn(uint256,address,address)\":{\"notice\":\"To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut. This function does not account for potential token transfer fees(in case of deflationary tokens)\"},\"getAmountOut(uint256,address,address)\":{\"notice\":\"To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn. This function does not account for potential token transfer fees(in case of deflationary tokens)The amountInMantissa might be adjusted if amountOutMantissa is greater than the balance of the contract for tokenAddressOut\"},\"getPools(address)\":{\"notice\":\"Get the array of all pools addresses\"},\"getUpdatedAmountIn(uint256,address,address)\":{\"notice\":\"To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut\"},\"getUpdatedAmountOut(uint256,address,address)\":{\"notice\":\"To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn\"},\"minAmountToConvert()\":{\"notice\":\"Min amount to convert for private conversions. Defined in USD, with 18 decimals\"},\"pauseConversion()\":{\"notice\":\"Pause conversion of tokens\"},\"poolRegistry()\":{\"notice\":\"Address of pool registry contract\"},\"poolsAssetsDirectTransfer(address,address)\":{\"notice\":\"The mapping contains the assets for each pool which are sent to RiskFund directly\"},\"priceOracle()\":{\"notice\":\"Venus price oracle contract\"},\"resumeConversion()\":{\"notice\":\"Resume conversion of tokens.\"},\"setAccessControlManager(address)\":{\"notice\":\"Sets the address of AccessControlManager\"},\"setConversionConfig(address,address,(uint256,uint8))\":{\"notice\":\"Set the configuration for new or existing conversion pair\"},\"setConversionConfigs(address,address[],(uint256,uint8)[])\":{\"notice\":\"Batch sets the conversion configurations\"},\"setConverterNetwork(address)\":{\"notice\":\"Sets a converter network contract address\"},\"setDestination(address)\":{\"notice\":\"Sets a new destination address\"},\"setMinAmountToConvert(uint256)\":{\"notice\":\"Min amount to convert setter\"},\"setPoolsAssetsDirectTransfer(address[],address[][],bool[][])\":{\"notice\":\"Update the poolsAssetsDirectTransfer mapping\"},\"setPriceOracle(address)\":{\"notice\":\"Sets a new price oracle\"},\"sweepToken(address,address,uint256)\":{\"notice\":\"To sweep ERC20 tokens and transfer them to user(to address)\"},\"updateAssetsState(address,address)\":{\"notice\":\"This method updated the states of this contract after getting funds from PSR after settling the amount(if any) through privateConversion between converters\"}},\"notice\":\"RiskFundConverter used for token conversions and sends received token to RiskFund\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/TokenConverter/RiskFundConverter.sol\":\"RiskFundConverter\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable2Step.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./OwnableUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership} and {acceptOwnership}.\\n *\\n * This module is used through inheritance. It will make available all functions\\n * from parent (Ownable).\\n */\\nabstract contract Ownable2StepUpgradeable is Initializable, OwnableUpgradeable {\\n function __Ownable2Step_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable2Step_init_unchained() internal onlyInitializing {\\n }\\n address private _pendingOwner;\\n\\n event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Returns the address of the pending owner.\\n */\\n function pendingOwner() public view virtual returns (address) {\\n return _pendingOwner;\\n }\\n\\n /**\\n * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual override onlyOwner {\\n _pendingOwner = newOwner;\\n emit OwnershipTransferStarted(owner(), newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual override {\\n delete _pendingOwner;\\n super._transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev The new owner accepts the ownership transfer.\\n */\\n function acceptOwnership() public virtual {\\n address sender = _msgSender();\\n require(pendingOwner() == sender, \\\"Ownable2Step: caller is not the new owner\\\");\\n _transferOwnership(sender);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x84efb8889801b0ac817324aff6acc691d07bbee816b671817132911d287a8c63\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function __Ownable_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable_init_unchained() internal onlyInitializing {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby disabling any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x4075622496acc77fd6d4de4cc30a8577a744d5c75afad33fdeacf1704d6eda98\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```solidity\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n *\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized != type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0x89be10e757d242e9b18d5a32c9fbe2019f6d63052bbe46397a430a1d60d7f794\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which allows children to implement an emergency stop\\n * mechanism that can be triggered by an authorized account.\\n *\\n * This module is used through inheritance. It will make available the\\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\\n * the functions of your contract. Note that they will not be pausable by\\n * simply including this module, only once the modifiers are put in place.\\n */\\nabstract contract PausableUpgradeable is Initializable, ContextUpgradeable {\\n /**\\n * @dev Emitted when the pause is triggered by `account`.\\n */\\n event Paused(address account);\\n\\n /**\\n * @dev Emitted when the pause is lifted by `account`.\\n */\\n event Unpaused(address account);\\n\\n bool private _paused;\\n\\n /**\\n * @dev Initializes the contract in unpaused state.\\n */\\n function __Pausable_init() internal onlyInitializing {\\n __Pausable_init_unchained();\\n }\\n\\n function __Pausable_init_unchained() internal onlyInitializing {\\n _paused = false;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is not paused.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n modifier whenNotPaused() {\\n _requireNotPaused();\\n _;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is paused.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n modifier whenPaused() {\\n _requirePaused();\\n _;\\n }\\n\\n /**\\n * @dev Returns true if the contract is paused, and false otherwise.\\n */\\n function paused() public view virtual returns (bool) {\\n return _paused;\\n }\\n\\n /**\\n * @dev Throws if the contract is paused.\\n */\\n function _requireNotPaused() internal view virtual {\\n require(!paused(), \\\"Pausable: paused\\\");\\n }\\n\\n /**\\n * @dev Throws if the contract is not paused.\\n */\\n function _requirePaused() internal view virtual {\\n require(paused(), \\\"Pausable: not paused\\\");\\n }\\n\\n /**\\n * @dev Triggers stopped state.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n function _pause() internal virtual whenNotPaused {\\n _paused = true;\\n emit Paused(_msgSender());\\n }\\n\\n /**\\n * @dev Returns to normal state.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n function _unpause() internal virtual whenPaused {\\n _paused = false;\\n emit Unpaused(_msgSender());\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x40c636b4572ff5f1dc50cf22097e93c0723ee14eff87e99ac2b02636eeca1250\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module that helps prevent reentrant calls to a function.\\n *\\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\\n * available, which can be applied to functions to make sure there are no nested\\n * (reentrant) calls to them.\\n *\\n * Note that because there is a single `nonReentrant` guard, functions marked as\\n * `nonReentrant` may not call one another. This can be worked around by making\\n * those functions `private`, and then adding `external` `nonReentrant` entry\\n * points to them.\\n *\\n * TIP: If you would like to learn more about reentrancy and alternative ways\\n * to protect against it, check out our blog post\\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\\n */\\nabstract contract ReentrancyGuardUpgradeable is Initializable {\\n // Booleans are more expensive than uint256 or any type that takes up a full\\n // word because each write operation emits an extra SLOAD to first read the\\n // slot's contents, replace the bits taken up by the boolean, and then write\\n // back. This is the compiler's defense against contract upgrades and\\n // pointer aliasing, and it cannot be disabled.\\n\\n // The values being non-zero value makes deployment a bit more expensive,\\n // but in exchange the refund on every call to nonReentrant will be lower in\\n // amount. Since refunds are capped to a percentage of the total\\n // transaction's gas, it is best to keep them low in cases like this one, to\\n // increase the likelihood of the full refund coming into effect.\\n uint256 private constant _NOT_ENTERED = 1;\\n uint256 private constant _ENTERED = 2;\\n\\n uint256 private _status;\\n\\n function __ReentrancyGuard_init() internal onlyInitializing {\\n __ReentrancyGuard_init_unchained();\\n }\\n\\n function __ReentrancyGuard_init_unchained() internal onlyInitializing {\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Prevents a contract from calling itself, directly or indirectly.\\n * Calling a `nonReentrant` function from another `nonReentrant`\\n * function is not supported. It is possible to prevent this from happening\\n * by making the `nonReentrant` function external, and making it call a\\n * `private` function that does the actual work.\\n */\\n modifier nonReentrant() {\\n _nonReentrantBefore();\\n _;\\n _nonReentrantAfter();\\n }\\n\\n function _nonReentrantBefore() private {\\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\\n require(_status != _ENTERED, \\\"ReentrancyGuard: reentrant call\\\");\\n\\n // Any calls to nonReentrant after this point will fail\\n _status = _ENTERED;\\n }\\n\\n function _nonReentrantAfter() private {\\n // By storing the original value once again, a refund is triggered (see\\n // https://eips.ethereum.org/EIPS/eip-2200)\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Returns true if the reentrancy guard is currently set to \\\"entered\\\", which indicates there is a\\n * `nonReentrant` function in the call stack.\\n */\\n function _reentrancyGuardEntered() internal view returns (bool) {\\n return _status == _ENTERED;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0xb82ef33f43b6b96109687d91b39c94573fdccaaa423fe28e8ba0977b31c023e0\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20Upgradeable {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x0e1f0f5f62f67a881cd1a9597acbc0a5e4071f3c2c10449a183b922ae7272e3f\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20PermitUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\\n *\\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\\n * need to send a transaction, and thus is not required to hold Ether at all.\\n */\\ninterface IERC20PermitUpgradeable {\\n /**\\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\\n * given ``owner``'s signed approval.\\n *\\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\\n * ordering also apply here.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `deadline` must be a timestamp in the future.\\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\\n * over the EIP712-formatted function arguments.\\n * - the signature must use ``owner``'s current nonce (see {nonces}).\\n *\\n * For more information on the signature format, see the\\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\\n * section].\\n */\\n function permit(\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external;\\n\\n /**\\n * @dev Returns the current nonce for `owner`. This value must be\\n * included whenever a signature is generated for {permit}.\\n *\\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\\n * prevents a signature from being used multiple times.\\n */\\n function nonces(address owner) external view returns (uint256);\\n\\n /**\\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0xd60f939a3ca0199014d079b4dd66aa757954334947d81eb5c1d35d7a83061ab3\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20Upgradeable.sol\\\";\\nimport \\\"../extensions/IERC20PermitUpgradeable.sol\\\";\\nimport \\\"../../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20Upgradeable {\\n using AddressUpgradeable for address;\\n\\n /**\\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeTransfer(IERC20Upgradeable token, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n /**\\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\\n */\\n function safeTransferFrom(IERC20Upgradeable token, address from, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\\n }\\n\\n /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\n */\\n function safeApprove(IERC20Upgradeable token, address spender, uint256 value) internal {\\n // safeApprove should only be called when setting an initial allowance,\\n // or when resetting it to zero. To increase and decrease it, use\\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\\n require(\\n (value == 0) || (token.allowance(address(this), spender) == 0),\\n \\\"SafeERC20: approve from non-zero to non-zero allowance\\\"\\n );\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\\n }\\n\\n /**\\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeIncreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));\\n }\\n\\n /**\\n * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeDecreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {\\n unchecked {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n require(oldAllowance >= value, \\\"SafeERC20: decreased allowance below zero\\\");\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));\\n }\\n }\\n\\n /**\\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\\n * to be set to zero before setting it to a non-zero value, such as USDT.\\n */\\n function forceApprove(IERC20Upgradeable token, address spender, uint256 value) internal {\\n bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);\\n\\n if (!_callOptionalReturnBool(token, approvalCall)) {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));\\n _callOptionalReturn(token, approvalCall);\\n }\\n }\\n\\n /**\\n * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.\\n * Revert on invalid signature.\\n */\\n function safePermit(\\n IERC20PermitUpgradeable token,\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal {\\n uint256 nonceBefore = token.nonces(owner);\\n token.permit(owner, spender, value, deadline, v, r, s);\\n uint256 nonceAfter = token.nonces(owner);\\n require(nonceAfter == nonceBefore + 1, \\\"SafeERC20: permit did not succeed\\\");\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20Upgradeable token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\n require(returndata.length == 0 || abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n *\\n * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\\n */\\n function _callOptionalReturnBool(IERC20Upgradeable token, bytes memory data) private returns (bool) {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\\n // and not revert is the subcall reverts.\\n\\n (bool success, bytes memory returndata) = address(token).call(data);\\n return\\n success && (returndata.length == 0 || abi.decode(returndata, (bool))) && AddressUpgradeable.isContract(address(token));\\n }\\n}\\n\",\"keccak256\":\"0x23b997be73d3dd46885262704f0f8cfc7273fdadfe303d37969a9561373972b5\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary AddressUpgradeable {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n *\\n * Furthermore, `isContract` will also return true if the target contract within\\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\\n * which only has an effect at the end of a transaction.\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x9c80f545915582e63fe206c6ce27cbe85a86fc10b9cd2a0e8c9488fb7c2ee422\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract ContextUpgradeable is Initializable {\\n function __Context_init() internal onlyInitializing {\\n }\\n\\n function __Context_init_unchained() internal onlyInitializing {\\n }\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/IAccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev External interface of AccessControl declared to support ERC165 detection.\\n */\\ninterface IAccessControl {\\n /**\\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\\n *\\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\\n * {RoleAdminChanged} not being emitted signaling this.\\n *\\n * _Available since v3.1._\\n */\\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\\n\\n /**\\n * @dev Emitted when `account` is granted `role`.\\n *\\n * `sender` is the account that originated the contract call, an admin role\\n * bearer except when using {AccessControl-_setupRole}.\\n */\\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Emitted when `account` is revoked `role`.\\n *\\n * `sender` is the account that originated the contract call:\\n * - if using `revokeRole`, it is the admin role bearer\\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\\n */\\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) external view returns (bool);\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function grantRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function revokeRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been granted `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n */\\n function renounceRole(bytes32 role, address account) external;\\n}\\n\",\"keccak256\":\"0x59ce320a585d7e1f163cd70390a0ef2ff9cec832e2aa544293a00692465a7a57\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x8de418a5503946cabe331f35fe242d3201a73f67f77aaeb7110acb1f30423aca\",\"license\":\"MIT\"},\"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol\\\";\\n\\nimport \\\"./IAccessControlManagerV8.sol\\\";\\n\\n/**\\n * @title AccessControlledV8\\n * @author Venus\\n * @notice This contract is helper between access control manager and actual contract. This contract further inherited by other contract (using solidity 0.8.13)\\n * to integrate access controlled mechanism. It provides initialise methods and verifying access methods.\\n */\\nabstract contract AccessControlledV8 is Initializable, Ownable2StepUpgradeable {\\n /// @notice Access control manager contract\\n IAccessControlManagerV8 private _accessControlManager;\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n\\n /// @notice Emitted when access control manager contract address is changed\\n event NewAccessControlManager(address oldAccessControlManager, address newAccessControlManager);\\n\\n /// @notice Thrown when the action is prohibited by AccessControlManager\\n error Unauthorized(address sender, address calledContract, string methodSignature);\\n\\n function __AccessControlled_init(address accessControlManager_) internal onlyInitializing {\\n __Ownable2Step_init();\\n __AccessControlled_init_unchained(accessControlManager_);\\n }\\n\\n function __AccessControlled_init_unchained(address accessControlManager_) internal onlyInitializing {\\n _setAccessControlManager(accessControlManager_);\\n }\\n\\n /**\\n * @notice Sets the address of AccessControlManager\\n * @dev Admin function to set address of AccessControlManager\\n * @param accessControlManager_ The new address of the AccessControlManager\\n * @custom:event Emits NewAccessControlManager event\\n * @custom:access Only Governance\\n */\\n function setAccessControlManager(address accessControlManager_) external onlyOwner {\\n _setAccessControlManager(accessControlManager_);\\n }\\n\\n /**\\n * @notice Returns the address of the access control manager contract\\n */\\n function accessControlManager() external view returns (IAccessControlManagerV8) {\\n return _accessControlManager;\\n }\\n\\n /**\\n * @dev Internal function to set address of AccessControlManager\\n * @param accessControlManager_ The new address of the AccessControlManager\\n */\\n function _setAccessControlManager(address accessControlManager_) internal {\\n require(address(accessControlManager_) != address(0), \\\"invalid acess control manager address\\\");\\n address oldAccessControlManager = address(_accessControlManager);\\n _accessControlManager = IAccessControlManagerV8(accessControlManager_);\\n emit NewAccessControlManager(oldAccessControlManager, accessControlManager_);\\n }\\n\\n /**\\n * @notice Reverts if the call is not allowed by AccessControlManager\\n * @param signature Method signature\\n */\\n function _checkAccessAllowed(string memory signature) internal view {\\n bool isAllowedToCall = _accessControlManager.isAllowedToCall(msg.sender, signature);\\n\\n if (!isAllowedToCall) {\\n revert Unauthorized(msg.sender, address(this), signature);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x1b805a5d09990e2c4f7839afe7726a02f8452261eb3d0d488e24129ec0a7736d\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/governance-contracts/contracts/Governance/IAccessControlManagerV8.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\nimport \\\"@openzeppelin/contracts/access/IAccessControl.sol\\\";\\n\\n/**\\n * @title IAccessControlManagerV8\\n * @author Venus\\n * @notice Interface implemented by the `AccessControlManagerV8` contract.\\n */\\ninterface IAccessControlManagerV8 is IAccessControl {\\n function giveCallPermission(address contractAddress, string calldata functionSig, address accountToPermit) external;\\n\\n function revokeCallPermission(\\n address contractAddress,\\n string calldata functionSig,\\n address accountToRevoke\\n ) external;\\n\\n function isAllowedToCall(address account, string calldata functionSig) external view returns (bool);\\n\\n function hasPermission(\\n address account,\\n address contractAddress,\\n string calldata functionSig\\n ) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x8adbe291d659987faf4de606736227ad9d8e1a0e284a33a6ca12b30ab2a504b2\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/oracle/contracts/ResilientOracle.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\n// SPDX-FileCopyrightText: 2022 Venus\\npragma solidity 0.8.13;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol\\\";\\nimport \\\"./interfaces/VBep20Interface.sol\\\";\\nimport \\\"./interfaces/OracleInterface.sol\\\";\\nimport \\\"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\\\";\\n\\n/**\\n * @title ResilientOracle\\n * @author Venus\\n * @notice The Resilient Oracle is the main contract that the protocol uses to fetch prices of assets.\\n * \\n * DeFi protocols are vulnerable to price oracle failures including oracle manipulation and incorrectly\\n * reported prices. If only one oracle is used, this creates a single point of failure and opens a vector\\n * for attacking the protocol.\\n * \\n * The Resilient Oracle uses multiple sources and fallback mechanisms to provide accurate prices and protect\\n * the protocol from oracle attacks. Currently it includes integrations with Chainlink, Pyth, Binance Oracle\\n * and TWAP (Time-Weighted Average Price) oracles. TWAP uses PancakeSwap as the on-chain price source.\\n * \\n * For every market (vToken) we configure the main, pivot and fallback oracles. The oracles are configured per \\n * vToken's underlying asset address. The main oracle oracle is the most trustworthy price source, the pivot \\n * oracle is used as a loose sanity checker and the fallback oracle is used as a backup price source. \\n * \\n * To validate prices returned from two oracles, we use an upper and lower bound ratio that is set for every\\n * market. The upper bound ratio represents the deviation between reported price (the price that\\u2019s being\\n * validated) and the anchor price (the price we are validating against) above which the reported price will\\n * be invalidated. The lower bound ratio presents the deviation between reported price and anchor price below\\n * which the reported price will be invalidated. So for oracle price to be considered valid the below statement\\n * should be true:\\n\\n```\\nanchorRatio = anchorPrice/reporterPrice\\nisValid = anchorRatio <= upperBoundAnchorRatio && anchorRatio >= lowerBoundAnchorRatio\\n```\\n\\n * In most cases, Chainlink is used as the main oracle, TWAP or Pyth oracles are used as the pivot oracle depending\\n * on which supports the given market and Binance oracle is used as the fallback oracle. For some markets we may\\n * use Pyth or TWAP as the main oracle if the token price is not supported by Chainlink or Binance oracles. \\n * \\n * For a fetched price to be valid it must be positive and not stagnant. If the price is invalid then we consider the\\n * oracle to be stagnant and treat it like it's disabled.\\n */\\ncontract ResilientOracle is PausableUpgradeable, AccessControlledV8, ResilientOracleInterface {\\n /**\\n * @dev Oracle roles:\\n * **main**: The most trustworthy price source\\n * **pivot**: Price oracle used as a loose sanity checker\\n * **fallback**: The backup source when main oracle price is invalidated\\n */\\n enum OracleRole {\\n MAIN,\\n PIVOT,\\n FALLBACK\\n }\\n\\n struct TokenConfig {\\n /// @notice asset address\\n address asset;\\n /// @notice `oracles` stores the oracles based on their role in the following order:\\n /// [main, pivot, fallback],\\n /// It can be indexed with the corresponding enum OracleRole value\\n address[3] oracles;\\n /// @notice `enableFlagsForOracles` stores the enabled state\\n /// for each oracle in the same order as `oracles`\\n bool[3] enableFlagsForOracles;\\n }\\n\\n uint256 public constant INVALID_PRICE = 0;\\n\\n /// @notice Native market address\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address public immutable nativeMarket;\\n\\n /// @notice VAI address\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address public immutable vai;\\n\\n /// @notice Set this as asset address for Native token on each chain.This is the underlying for vBNB (on bsc)\\n /// and can serve as any underlying asset of a market that supports native tokens\\n address public constant NATIVE_TOKEN_ADDR = 0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB;\\n\\n /// @notice Bound validator contract address\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n BoundValidatorInterface public immutable boundValidator;\\n\\n mapping(address => TokenConfig) private tokenConfigs;\\n\\n event TokenConfigAdded(\\n address indexed asset,\\n address indexed mainOracle,\\n address indexed pivotOracle,\\n address fallbackOracle\\n );\\n\\n /// Event emitted when an oracle is set\\n event OracleSet(address indexed asset, address indexed oracle, uint256 indexed role);\\n\\n /// Event emitted when an oracle is enabled or disabled\\n event OracleEnabled(address indexed asset, uint256 indexed role, bool indexed enable);\\n\\n /**\\n * @notice Checks whether an address is null or not\\n */\\n modifier notNullAddress(address someone) {\\n if (someone == address(0)) revert(\\\"can't be zero address\\\");\\n _;\\n }\\n\\n /**\\n * @notice Checks whether token config exists by checking whether asset is null address\\n * @dev address can't be null, so it's suitable to be used to check the validity of the config\\n * @param asset asset address\\n */\\n modifier checkTokenConfigExistence(address asset) {\\n if (tokenConfigs[asset].asset == address(0)) revert(\\\"token config must exist\\\");\\n _;\\n }\\n\\n /// @notice Constructor for the implementation contract. Sets immutable variables.\\n /// @dev nativeMarketAddress can be address(0) if on the chain we do not support native market\\n /// (e.g vETH on ethereum would not be supported, only vWETH)\\n /// @param nativeMarketAddress The address of a native market (for bsc it would be vBNB address)\\n /// @param vaiAddress The address of the VAI token (if there is VAI on the deployed chain).\\n /// Set to address(0) of VAI is not existent.\\n /// @param _boundValidator Address of the bound validator contract\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(\\n address nativeMarketAddress,\\n address vaiAddress,\\n BoundValidatorInterface _boundValidator\\n ) notNullAddress(address(_boundValidator)) {\\n nativeMarket = nativeMarketAddress;\\n vai = vaiAddress;\\n boundValidator = _boundValidator;\\n\\n _disableInitializers();\\n }\\n\\n /**\\n * @notice Initializes the contract admin and sets the BoundValidator contract address\\n * @param accessControlManager_ Address of the access control manager contract\\n */\\n function initialize(address accessControlManager_) external initializer {\\n __AccessControlled_init(accessControlManager_);\\n __Pausable_init();\\n }\\n\\n /**\\n * @notice Pauses oracle\\n * @custom:access Only Governance\\n */\\n function pause() external {\\n _checkAccessAllowed(\\\"pause()\\\");\\n _pause();\\n }\\n\\n /**\\n * @notice Unpauses oracle\\n * @custom:access Only Governance\\n */\\n function unpause() external {\\n _checkAccessAllowed(\\\"unpause()\\\");\\n _unpause();\\n }\\n\\n /**\\n * @notice Batch sets token configs\\n * @param tokenConfigs_ Token config array\\n * @custom:access Only Governance\\n * @custom:error Throws a length error if the length of the token configs array is 0\\n */\\n function setTokenConfigs(TokenConfig[] memory tokenConfigs_) external {\\n if (tokenConfigs_.length == 0) revert(\\\"length can't be 0\\\");\\n uint256 numTokenConfigs = tokenConfigs_.length;\\n for (uint256 i; i < numTokenConfigs; ) {\\n setTokenConfig(tokenConfigs_[i]);\\n unchecked {\\n ++i;\\n }\\n }\\n }\\n\\n /**\\n * @notice Sets oracle for a given asset and role.\\n * @dev Supplied asset **must** exist and main oracle may not be null\\n * @param asset Asset address\\n * @param oracle Oracle address\\n * @param role Oracle role\\n * @custom:access Only Governance\\n * @custom:error Null address error if main-role oracle address is null\\n * @custom:error NotNullAddress error is thrown if asset address is null\\n * @custom:error TokenConfigExistance error is thrown if token config is not set\\n * @custom:event Emits OracleSet event with asset address, oracle address and role of the oracle for the asset\\n */\\n function setOracle(\\n address asset,\\n address oracle,\\n OracleRole role\\n ) external notNullAddress(asset) checkTokenConfigExistence(asset) {\\n _checkAccessAllowed(\\\"setOracle(address,address,uint8)\\\");\\n if (oracle == address(0) && role == OracleRole.MAIN) revert(\\\"can't set zero address to main oracle\\\");\\n tokenConfigs[asset].oracles[uint256(role)] = oracle;\\n emit OracleSet(asset, oracle, uint256(role));\\n }\\n\\n /**\\n * @notice Enables/ disables oracle for the input asset. Token config for the input asset **must** exist\\n * @dev Configuration for the asset **must** already exist and the asset cannot be 0 address\\n * @param asset Asset address\\n * @param role Oracle role\\n * @param enable Enabled boolean of the oracle\\n * @custom:access Only Governance\\n * @custom:error NotNullAddress error is thrown if asset address is null\\n * @custom:error TokenConfigExistance error is thrown if token config is not set\\n */\\n function enableOracle(\\n address asset,\\n OracleRole role,\\n bool enable\\n ) external notNullAddress(asset) checkTokenConfigExistence(asset) {\\n _checkAccessAllowed(\\\"enableOracle(address,uint8,bool)\\\");\\n tokenConfigs[asset].enableFlagsForOracles[uint256(role)] = enable;\\n emit OracleEnabled(asset, uint256(role), enable);\\n }\\n\\n /**\\n * @notice Updates the TWAP pivot oracle price.\\n * @dev This function should always be called before calling getUnderlyingPrice\\n * @param vToken vToken address\\n */\\n function updatePrice(address vToken) external override {\\n address asset = _getUnderlyingAsset(vToken);\\n (address pivotOracle, bool pivotOracleEnabled) = getOracle(asset, OracleRole.PIVOT);\\n if (pivotOracle != address(0) && pivotOracleEnabled) {\\n //if pivot oracle is not TwapOracle it will revert so we need to catch the revert\\n try TwapInterface(pivotOracle).updateTwap(asset) {} catch {}\\n }\\n }\\n\\n /**\\n * @notice Updates the pivot oracle price. Currently using TWAP\\n * @dev This function should always be called before calling getPrice\\n * @param asset asset address\\n */\\n function updateAssetPrice(address asset) external {\\n (address pivotOracle, bool pivotOracleEnabled) = getOracle(asset, OracleRole.PIVOT);\\n if (pivotOracle != address(0) && pivotOracleEnabled) {\\n //if pivot oracle is not TwapOracle it will revert so we need to catch the revert\\n try TwapInterface(pivotOracle).updateTwap(asset) {} catch {}\\n }\\n }\\n\\n /**\\n * @dev Gets token config by asset address\\n * @param asset asset address\\n * @return tokenConfig Config for the asset\\n */\\n function getTokenConfig(address asset) external view returns (TokenConfig memory) {\\n return tokenConfigs[asset];\\n }\\n\\n /**\\n * @notice Gets price of the underlying asset for a given vToken. Validation flow:\\n * - Check if the oracle is paused globally\\n * - Validate price from main oracle against pivot oracle\\n * - Validate price from fallback oracle against pivot oracle if the first validation failed\\n * - Validate price from main oracle against fallback oracle if the second validation failed\\n * In the case that the pivot oracle is not available but main price is available and validation is successful,\\n * main oracle price is returned.\\n * @param vToken vToken address\\n * @return price USD price in scaled decimal places.\\n * @custom:error Paused error is thrown when resilent oracle is paused\\n * @custom:error Invalid resilient oracle price error is thrown if fetched prices from oracle is invalid\\n */\\n function getUnderlyingPrice(address vToken) external view override returns (uint256) {\\n if (paused()) revert(\\\"resilient oracle is paused\\\");\\n\\n address asset = _getUnderlyingAsset(vToken);\\n return _getPrice(asset);\\n }\\n\\n /**\\n * @notice Gets price of the asset\\n * @param asset asset address\\n * @return price USD price in scaled decimal places.\\n * @custom:error Paused error is thrown when resilent oracle is paused\\n * @custom:error Invalid resilient oracle price error is thrown if fetched prices from oracle is invalid\\n */\\n function getPrice(address asset) external view override returns (uint256) {\\n if (paused()) revert(\\\"resilient oracle is paused\\\");\\n return _getPrice(asset);\\n }\\n\\n /**\\n * @notice Sets/resets single token configs.\\n * @dev main oracle **must not** be a null address\\n * @param tokenConfig Token config struct\\n * @custom:access Only Governance\\n * @custom:error NotNullAddress is thrown if asset address is null\\n * @custom:error NotNullAddress is thrown if main-role oracle address for asset is null\\n * @custom:event Emits TokenConfigAdded event when the asset config is set successfully by the authorized account\\n */\\n function setTokenConfig(\\n TokenConfig memory tokenConfig\\n ) public notNullAddress(tokenConfig.asset) notNullAddress(tokenConfig.oracles[uint256(OracleRole.MAIN)]) {\\n _checkAccessAllowed(\\\"setTokenConfig(TokenConfig)\\\");\\n\\n tokenConfigs[tokenConfig.asset] = tokenConfig;\\n emit TokenConfigAdded(\\n tokenConfig.asset,\\n tokenConfig.oracles[uint256(OracleRole.MAIN)],\\n tokenConfig.oracles[uint256(OracleRole.PIVOT)],\\n tokenConfig.oracles[uint256(OracleRole.FALLBACK)]\\n );\\n }\\n\\n /**\\n * @notice Gets oracle and enabled status by asset address\\n * @param asset asset address\\n * @param role Oracle role\\n * @return oracle Oracle address based on role\\n * @return enabled Enabled flag of the oracle based on token config\\n */\\n function getOracle(address asset, OracleRole role) public view returns (address oracle, bool enabled) {\\n oracle = tokenConfigs[asset].oracles[uint256(role)];\\n enabled = tokenConfigs[asset].enableFlagsForOracles[uint256(role)];\\n }\\n\\n function _getPrice(address asset) internal view returns (uint256) {\\n uint256 pivotPrice = INVALID_PRICE;\\n\\n // Get pivot oracle price, Invalid price if not available or error\\n (address pivotOracle, bool pivotOracleEnabled) = getOracle(asset, OracleRole.PIVOT);\\n if (pivotOracleEnabled && pivotOracle != address(0)) {\\n try OracleInterface(pivotOracle).getPrice(asset) returns (uint256 pricePivot) {\\n pivotPrice = pricePivot;\\n } catch {}\\n }\\n\\n // Compare main price and pivot price, return main price and if validation was successful\\n // note: In case pivot oracle is not available but main price is available and\\n // validation is successful, the main oracle price is returned.\\n (uint256 mainPrice, bool validatedPivotMain) = _getMainOraclePrice(\\n asset,\\n pivotPrice,\\n pivotOracleEnabled && pivotOracle != address(0)\\n );\\n if (mainPrice != INVALID_PRICE && validatedPivotMain) return mainPrice;\\n\\n // Compare fallback and pivot if main oracle comparision fails with pivot\\n // Return fallback price when fallback price is validated successfully with pivot oracle\\n (uint256 fallbackPrice, bool validatedPivotFallback) = _getFallbackOraclePrice(asset, pivotPrice);\\n if (fallbackPrice != INVALID_PRICE && validatedPivotFallback) return fallbackPrice;\\n\\n // Lastly compare main price and fallback price\\n if (\\n mainPrice != INVALID_PRICE &&\\n fallbackPrice != INVALID_PRICE &&\\n boundValidator.validatePriceWithAnchorPrice(asset, mainPrice, fallbackPrice)\\n ) {\\n return mainPrice;\\n }\\n\\n revert(\\\"invalid resilient oracle price\\\");\\n }\\n\\n /**\\n * @notice Gets a price for the provided asset\\n * @dev This function won't revert when price is 0, because the fallback oracle may still be\\n * able to fetch a correct price\\n * @param asset asset address\\n * @param pivotPrice Pivot oracle price\\n * @param pivotEnabled If pivot oracle is not empty and enabled\\n * @return price USD price in scaled decimals\\n * e.g. asset decimals is 8 then price is returned as 10**18 * 10**(18-8) = 10**28 decimals\\n * @return pivotValidated Boolean representing if the validation of main oracle price\\n * and pivot oracle price were successful\\n * @custom:error Invalid price error is thrown if main oracle fails to fetch price of the asset\\n * @custom:error Invalid price error is thrown if main oracle is not enabled or main oracle\\n * address is null\\n */\\n function _getMainOraclePrice(\\n address asset,\\n uint256 pivotPrice,\\n bool pivotEnabled\\n ) internal view returns (uint256, bool) {\\n (address mainOracle, bool mainOracleEnabled) = getOracle(asset, OracleRole.MAIN);\\n if (mainOracleEnabled && mainOracle != address(0)) {\\n try OracleInterface(mainOracle).getPrice(asset) returns (uint256 mainOraclePrice) {\\n if (!pivotEnabled) {\\n return (mainOraclePrice, true);\\n }\\n if (pivotPrice == INVALID_PRICE) {\\n return (mainOraclePrice, false);\\n }\\n return (\\n mainOraclePrice,\\n boundValidator.validatePriceWithAnchorPrice(asset, mainOraclePrice, pivotPrice)\\n );\\n } catch {\\n return (INVALID_PRICE, false);\\n }\\n }\\n\\n return (INVALID_PRICE, false);\\n }\\n\\n /**\\n * @dev This function won't revert when the price is 0 because getPrice checks if price is > 0\\n * @param asset asset address\\n * @return price USD price in 18 decimals\\n * @return pivotValidated Boolean representing if the validation of fallback oracle price\\n * and pivot oracle price were successfull\\n * @custom:error Invalid price error is thrown if fallback oracle fails to fetch price of the asset\\n * @custom:error Invalid price error is thrown if fallback oracle is not enabled or fallback oracle\\n * address is null\\n */\\n function _getFallbackOraclePrice(address asset, uint256 pivotPrice) private view returns (uint256, bool) {\\n (address fallbackOracle, bool fallbackEnabled) = getOracle(asset, OracleRole.FALLBACK);\\n if (fallbackEnabled && fallbackOracle != address(0)) {\\n try OracleInterface(fallbackOracle).getPrice(asset) returns (uint256 fallbackOraclePrice) {\\n if (pivotPrice == INVALID_PRICE) {\\n return (fallbackOraclePrice, false);\\n }\\n return (\\n fallbackOraclePrice,\\n boundValidator.validatePriceWithAnchorPrice(asset, fallbackOraclePrice, pivotPrice)\\n );\\n } catch {\\n return (INVALID_PRICE, false);\\n }\\n }\\n\\n return (INVALID_PRICE, false);\\n }\\n\\n /**\\n * @dev This function returns the underlying asset of a vToken\\n * @param vToken vToken address\\n * @return asset underlying asset address\\n */\\n function _getUnderlyingAsset(address vToken) private view notNullAddress(vToken) returns (address asset) {\\n if (vToken == nativeMarket) {\\n asset = NATIVE_TOKEN_ADDR;\\n } else if (vToken == vai) {\\n asset = vai;\\n } else {\\n asset = VBep20Interface(vToken).underlying();\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3bead63c5f2aca7e1ea5e9a075816e9e3551ce3a886f5f3707040262ad6d2c35\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/oracle/contracts/interfaces/OracleInterface.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\ninterface OracleInterface {\\n function getPrice(address asset) external view returns (uint256);\\n}\\n\\ninterface ResilientOracleInterface is OracleInterface {\\n function updatePrice(address vToken) external;\\n\\n function updateAssetPrice(address asset) external;\\n\\n function getUnderlyingPrice(address vToken) external view returns (uint256);\\n}\\n\\ninterface TwapInterface is OracleInterface {\\n function updateTwap(address asset) external returns (uint256);\\n}\\n\\ninterface BoundValidatorInterface {\\n function validatePriceWithAnchorPrice(\\n address asset,\\n uint256 reporterPrice,\\n uint256 anchorPrice\\n ) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x40031b19684ca0c912e794d08c2c0b0d8be77d3c1bdc937830a0658eff899650\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/oracle/contracts/interfaces/VBep20Interface.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\\\";\\n\\ninterface VBep20Interface is IERC20Metadata {\\n /**\\n * @notice Underlying asset for this VToken\\n */\\n function underlying() external view returns (address);\\n}\\n\",\"keccak256\":\"0x3f845cd51b2d82f7932ac6c0ab714df97f733b01ce50f6fb0adb4c28447d4618\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/solidity-utilities/contracts/constants.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\n/// @dev Base unit for computations, usually used in scaling (multiplications, divisions)\\nuint256 constant EXP_SCALE = 1e18;\\n\\n/// @dev A unit (literal one) in EXP_SCALE, usually used in additions/subtractions\\nuint256 constant MANTISSA_ONE = EXP_SCALE;\\n\\n/// @dev The approximate number of seconds per year\\nuint256 constant SECONDS_PER_YEAR = 31_536_000;\\n\",\"keccak256\":\"0x0464dd1b882ea2925e06e967c025a232c824e9e4c7aee7b97cc255d040594a59\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/solidity-utilities/contracts/validators.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\n/// @notice Thrown if the supplied address is a zero address where it is not allowed\\nerror ZeroAddressNotAllowed();\\n\\n/// @notice Thrown if the supplied value is 0 where it is not allowed\\nerror ZeroValueNotAllowed();\\n\\n/// @notice Checks if the provided address is nonzero, reverts otherwise\\n/// @param address_ Address to check\\n/// @custom:error ZeroAddressNotAllowed is thrown if the provided address is a zero address\\nfunction ensureNonzeroAddress(address address_) pure {\\n if (address_ == address(0)) {\\n revert ZeroAddressNotAllowed();\\n }\\n}\\n\\n/// @notice Checks if the provided value is nonzero, reverts otherwise\\n/// @param value_ Value to check\\n/// @custom:error ZeroValueNotAllowed is thrown if the provided value is 0\\nfunction ensureNonzeroValue(uint256 value_) pure {\\n if (value_ == 0) {\\n revert ZeroValueNotAllowed();\\n }\\n}\\n\",\"keccak256\":\"0xd55726634a83a862a9cef9d34c41694d3d0fea86cdbc57d6674af066792194b1\",\"license\":\"BSD-3-Clause\"},\"contracts/Interfaces/IComptroller.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\ninterface IComptroller {\\n function isComptroller() external view returns (bool);\\n\\n function markets(address) external view returns (bool);\\n\\n function getAllMarkets() external view returns (address[] memory);\\n}\\n\",\"keccak256\":\"0x7d85db8d34103352b25f29f591c1e45159222f0d2bbafaa3fcd42f42bf9a523d\",\"license\":\"BSD-3-Clause\"},\"contracts/Interfaces/IConverterNetwork.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\nimport { IAbstractTokenConverter } from \\\"../TokenConverter/IAbstractTokenConverter.sol\\\";\\n\\n/**\\n * @title IConverterNetwork\\n * @author Venus\\n * @notice Interface implemented by `ConverterNetwork`.\\n */\\ninterface IConverterNetwork {\\n /// @notice Adds new converter to the array\\n /// @param _tokenConverter Address of the token converter\\n function addTokenConverter(IAbstractTokenConverter _tokenConverter) external;\\n\\n /// @notice Removes converter from the array\\n /// @param _tokenConverter Address of the token converter\\n function removeTokenConverter(IAbstractTokenConverter _tokenConverter) external;\\n\\n /// @notice Used to get the array of converters supporting conversions, arranged in descending order based on token balances\\n /// @param _tokenAddressIn Address of tokenIn\\n /// @param _tokenAddressOut Address of tokenOut\\n /// @return converters Array of the conveters on the basis of the tokens pair\\n /// @return convertersBalance Array of balances with respect to token out\\n function findTokenConverters(address _tokenAddressIn, address _tokenAddressOut)\\n external\\n returns (address[] memory converters, uint256[] memory convertersBalance);\\n\\n /// @notice Used to get the array of converters supporting conversions, arranged in descending order based on token balances\\n /// @param _tokenAddressIn Address of tokenIn\\n /// @param _tokenAddressOut Address of tokenOut\\n /// @return converters Array of the conveters on the basis of the tokens pair\\n /// @return convertersBalance Array of balances with respect to token out\\n function findTokenConvertersForConverters(address _tokenAddressIn, address _tokenAddressOut)\\n external\\n returns (address[] memory converters, uint256[] memory convertersBalance);\\n\\n /// @notice This function returns the array containing all the converters addresses\\n /// @return Array containing all the converters addresses\\n function getAllConverters() external view returns (IAbstractTokenConverter[] memory);\\n\\n /// @notice This function checks for given address is converter or not\\n /// @param _tokenConverter Address of the token converter\\n /// @return boolean true if given address is converter otherwise false\\n function isTokenConverter(address _tokenConverter) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x185dac944af690a34378319c568454fb7ce917c2ab6acdb514eec02e00965107\",\"license\":\"BSD-3-Clause\"},\"contracts/Interfaces/IPoolRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\ninterface IPoolRegistry {\\n /// @notice Get VToken in the Pool for an Asset\\n function getVTokenForAsset(address comptroller, address asset) external view returns (address);\\n\\n /// @notice Get the addresss of the Pools supported that include a market for the provided asset\\n function getPoolsSupportedByAsset(address asset) external view returns (address[] memory);\\n}\\n\",\"keccak256\":\"0xb38a3b61926e55588096e0657b758b178130386143a5658030d659038ec7075c\",\"license\":\"BSD-3-Clause\"},\"contracts/Interfaces/IRiskFund.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\n/**\\n * @title IRiskFund\\n * @author Venus\\n * @notice Interface implemented by `RiskFund`.\\n */\\ninterface IRiskFund {\\n function transferReserveForAuction(address comptroller, uint256 amount) external returns (uint256);\\n\\n function updatePoolState(\\n address comptroller,\\n address asset,\\n uint256 amount\\n ) external;\\n\\n function getPoolsBaseAssetReserves(address comptroller) external view returns (uint256);\\n}\\n\\n/**\\n * @title IRiskFundGetters\\n * @author Venus\\n * @notice Interface implemented by `RiskFund` for getter methods.\\n */\\ninterface IRiskFundGetters {\\n function convertibleBaseAsset() external view returns (address);\\n}\\n\",\"keccak256\":\"0x5f2a65443264433c222053b317aa489aad17311f8d5def1975221073176dbc0f\",\"license\":\"BSD-3-Clause\"},\"contracts/Interfaces/IVToken.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\ninterface IVToken {\\n function underlying() external view returns (address);\\n}\\n\",\"keccak256\":\"0x0718e50835da441b2dddcf6d52a671c43d386b96dbcc9eb41d68c3647b82c117\",\"license\":\"BSD-3-Clause\"},\"contracts/TokenConverter/AbstractTokenConverter.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\nimport { ReentrancyGuardUpgradeable } from \\\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\\\";\\nimport { SafeERC20Upgradeable } from \\\"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\\\";\\nimport { AccessControlledV8 } from \\\"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\\\";\\nimport { IERC20Upgradeable } from \\\"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\\\";\\nimport { ResilientOracle } from \\\"@venusprotocol/oracle/contracts/ResilientOracle.sol\\\";\\nimport { ensureNonzeroAddress, ensureNonzeroValue } from \\\"@venusprotocol/solidity-utilities/contracts/validators.sol\\\";\\nimport { MANTISSA_ONE, EXP_SCALE } from \\\"@venusprotocol/solidity-utilities/contracts/constants.sol\\\";\\n\\nimport { IAbstractTokenConverter } from \\\"./IAbstractTokenConverter.sol\\\";\\nimport { IConverterNetwork } from \\\"../Interfaces/IConverterNetwork.sol\\\";\\n\\n/// @title AbstractTokenConverter\\n/// @author Venus\\n/// @notice Abstract contract will be extended by SingleTokenConverter and RiskFundConverter\\n/*\\n * This contract specifies four functions for converting tokens, each applicable under following circumstances:\\n *\\n * Case I: TokenIn -> deflationary token, TokenOut -> deflationary token\\n * In this scenario, functions supporting fees can only be utilized to convert tokens which are:\\n * a. convertExactTokensSupportingFeeOnTransferTokens\\n * b. convertForExactTokensSupportingFeeOnTransferTokens\\n *\\n * Case II: TokenIn -> deflationary token, TokenOut -> non-deflationary token\\n * In this scenario, functions supporting fee can only be utilized to convert tokens which are:\\n * similar to Case I.\\n *\\n * Case III: TokenIn -> non-deflationary token, TokenOut -> deflationary token\\n * In this scenario, functions with or without supporting fee can be utilized to convert tokens which are:\\n * a. convertExactTokens\\n * b. convertForExactTokens\\n * c. convertExactTokensSupportingFeeOnTransferTokens\\n * d. convertForExactTokensSupportingFeeOnTransferTokens\\n *\\n * Case IV: TokenIn -> non-deflationary token, TokenOut -> non-deflationary token\\n * In this scenario, functions with or without supporting fee can be utilized to convert tokens which are:\\n * similar to Case III.\\n *\\n * ------------------------------------------------------------------------------------------------------------------------------------\\n * Example 1:-\\n * tokenInAddress - 0xaaaa.....\\n * tokenOutAddress - 0xbbbb.....\\n * tokenInAmount - 100\\n * tokenOutMinAmount - minimum amount desired by the user(let's say 70)\\n * Here user can use `convertExactTokens` or `convertExactTokensSupportingFeeOnTransferTokens`, if tokenIn is deflationary\\n * then `convertExactTokensSupportingFeeOnTransferTokens` should be used(let's suppose `convertExactTokens` is used).\\n * Now first tokenInAddress tokens will be transferred from the user to the contract, on the basis of amount\\n * received(as tokenInAddress can be deflationary token) tokenAmountOut will be calculated and will be transferred\\n * to the user and if amount sent is less than tokenOutMinAmount, tx will revert. If amount sent is satisfied(let's say\\n * 80 or even 70) then at last the actual amount received and the amount that was supposed to be received by the contract will\\n * be compared, if they differ then the whole tx will revert as user was supposed to use `convertExactTokensSupportingFeeOnTransferTokens`\\n * function for tokenIn as deflationary token.\\n *\\n * Example 2:-\\n * tokenInAddress - 0xaaaa.....\\n * tokenOutAddress - 0xbbbb.....\\n * tokenInMaxAmount - maximum amount user is willing to provide(let's say 100)\\n * tokenOutAmount - 70\\n * Here user can use `convertForExactTokens` or `convertForExactTokensSupportingFeeOnTransferTokens`, if tokenIn is deflationary\\n * then `convertForExactTokensSupportingFeeOnTransferTokens` should be used(let's suppose `convertForExactTokens` is used),\\n * which on the basis of tokenOutAmount provided will calculate tokenInAmount based on the tokens prices and will transfer\\n * tokens from the user to the contract, now the actual amount received(as tokenInAddress can be deflationary token) will be\\n * compared with tokenInMaxAmount if it is greater, tx will revert. If In amount is satisfied(let's say 90 or even 100) then\\n * new tokenOutAmount will be calculated, and tokenOutAddress tokens will be transferred to the user, but at last the\\n * old tokenOutAmount and new tokenOutAmount will be compared and if they differ whole tx will revert, because user was\\n * supposed to use `convertForExactTokensSupportingFeeOnTransferTokens` function for tokenIn as deflationary token.\\n * ------------------------------------------------------------------------------------------------------------------------------------\\n *\\n * This contract also supports private conversion between the converters:\\n * Private conversions:\\n * Private conversions is designed in order to convert the maximum amount of tokens received from PSR(to any converter) between\\n * existing converters to save incentive and lower the dependency of users for conversion. So Private Conversion will be executed\\n * by converters on it's own whenever funds are received from PSR. No incentive will be offered during private conversion.\\n *\\n * It will execute on updateAssetsState() function call in Converter Contracts. After this function call, converter will first\\n * check for the amount received. If base asset is received then it will be directly sent to the destination address and no private\\n * conversion will happen otherwise converter will interact with ConverterNetwork contract to find other valid converters who are providing the conversion for:\\n *\\n * tokenAddressIn: As asset received by that converter on updateAssetsState() function call.\\n * tokenAddressOut: As base asset of that converter.\\n *\\n * ConverterNetwork:\\n * This contract will contain all the converters, and will provide valid converters which can perform the execution according to tokenAddressIn\\n * and tokenAddressOut provided.\\n *\\n * findTokenConverters():\\n * It will return an array of converter addresses along with their corresponding balances, sorted in descending order based on the converter's balances\\n * relative to tokenAddressOut. This function filter the converter addresses on the basis of the conversionAccess(for users).\\n *\\n * findTokenConvertersForConverters():\\n * It will return an array of converter addresses along with their corresponding balances, sorted in descending order based on the converter's balances\\n * relative to tokenAddressOut. This function filter the converter addresses on the basis of the conversionAccess(for converters).\\n */\\n\\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\\nabstract contract AbstractTokenConverter is AccessControlledV8, IAbstractTokenConverter, ReentrancyGuardUpgradeable {\\n using SafeERC20Upgradeable for IERC20Upgradeable;\\n\\n /// @notice Maximum incentive could be\\n uint256 public constant MAX_INCENTIVE = 0.5e18;\\n\\n /// @notice Min amount to convert for private conversions. Defined in USD, with 18 decimals\\n uint256 public minAmountToConvert;\\n\\n /// @notice Venus price oracle contract\\n ResilientOracle public priceOracle;\\n\\n /// @notice conversion configurations for the existing pairs\\n /// @dev tokenAddressIn => tokenAddressOut => ConversionConfig\\n mapping(address => mapping(address => ConversionConfig)) public conversionConfigurations;\\n\\n /// @notice Address that all incoming tokens are transferred to\\n address public destinationAddress;\\n\\n /// @notice Boolean for if conversion is paused\\n bool public conversionPaused;\\n\\n /// @notice Address of the converterNetwork contract\\n IConverterNetwork public converterNetwork;\\n\\n /// @dev This empty reserved space is put in place to allow future versions to add new\\n /// variables without shifting down storage in the inheritance chain.\\n /// See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n uint256[45] private __gap;\\n\\n /// @notice Emitted when config is updated for tokens pair\\n event ConversionConfigUpdated(\\n address indexed tokenAddressIn,\\n address indexed tokenAddressOut,\\n uint256 oldIncentive,\\n uint256 newIncentive,\\n ConversionAccessibility oldAccess,\\n ConversionAccessibility newAccess\\n );\\n /// @notice Emitted when price oracle address is updated\\n event PriceOracleUpdated(ResilientOracle indexed oldPriceOracle, ResilientOracle indexed priceOracle);\\n\\n /// @notice Emitted when destination address is updated\\n event DestinationAddressUpdated(address indexed oldDestinationAddress, address indexed destinationAddress);\\n\\n /// @notice Emitted when converterNetwork address is updated\\n event ConverterNetworkAddressUpdated(address indexed oldConverterNetwork, address indexed converterNetwork);\\n\\n /// @notice Emitted when exact amount of tokens are converted for tokens\\n event ConvertedExactTokens(\\n address indexed sender,\\n address indexed receiver,\\n address tokenAddressIn,\\n address indexed tokenAddressOut,\\n uint256 amountIn,\\n uint256 amountOut\\n );\\n\\n /// @notice Emitted when tokens are converted for exact amount of tokens\\n event ConvertedForExactTokens(\\n address indexed sender,\\n address indexed receiver,\\n address tokenAddressIn,\\n address indexed tokenAddressOut,\\n uint256 amountIn,\\n uint256 amountOut\\n );\\n\\n /// @notice Emitted when exact amount of tokens are converted for tokens, for deflationary tokens\\n event ConvertedExactTokensSupportingFeeOnTransferTokens(\\n address indexed sender,\\n address indexed receiver,\\n address tokenAddressIn,\\n address indexed tokenAddressOut,\\n uint256 amountIn,\\n uint256 amountOut\\n );\\n\\n /// @notice Emitted when tokens are converted for exact amount of tokens, for deflationary tokens\\n event ConvertedForExactTokensSupportingFeeOnTransferTokens(\\n address indexed sender,\\n address indexed receiver,\\n address tokenAddressIn,\\n address indexed tokenAddressOut,\\n uint256 amountIn,\\n uint256 amountOut\\n );\\n\\n /// @notice Emitted when conversion is paused\\n event ConversionPaused(address indexed sender);\\n\\n /// @notice Emitted when conversion is unpaused\\n event ConversionResumed(address indexed sender);\\n\\n /// @notice Event emitted when tokens are swept\\n event SweepToken(address indexed token, address indexed to, uint256 amount);\\n\\n /// @notice Emitted when minimum amount to convert is updated\\n event MinAmountToConvertUpdated(uint256 oldMinAmountToConvert, uint256 newMinAmountToConvert);\\n\\n /// @notice Thrown when actualAmountOut does not match with amountOutMantissa for convertForExactTokens\\n error AmountOutMismatched();\\n\\n /// @notice Thrown when actualAmountIn does not match with amountInMantissa for convertForExactTokens\\n error AmountInMismatched();\\n\\n /// @notice Thrown when given input amount is zero\\n error InsufficientInputAmount();\\n\\n /// @notice Thrown when given output amount is zero\\n error InsufficientOutputAmount();\\n\\n /// @notice Thrown when conversion is disabled or config does not exist for given pair\\n error ConversionConfigNotEnabled();\\n\\n /// @notice Thrown when conversion is enabled only for private conversions\\n error ConversionEnabledOnlyForPrivateConversions();\\n\\n /// @notice Thrown when address(to) is same as tokenAddressIn or tokenAddressOut\\n error InvalidToAddress();\\n\\n /// @notice Thrown when incentive is higher than the MAX_INCENTIVE\\n error IncentiveTooHigh(uint256 incentive, uint256 maxIncentive);\\n\\n /// @notice Thrown when amountOut is lower than amountOutMin\\n error AmountOutLowerThanMinRequired(uint256 amountOutMantissa, uint256 amountOutMinMantissa);\\n\\n /// @notice Thrown when amountIn is higher than amountInMax\\n error AmountInHigherThanMax(uint256 amountInMantissa, uint256 amountInMaxMantissa);\\n\\n /// @notice Thrown when conversion is paused\\n error ConversionTokensPaused();\\n\\n /// @notice Thrown when conversion is Active\\n error ConversionTokensActive();\\n\\n /// @notice Thrown when tokenInAddress is same as tokeOutAdress OR tokeInAddress is not the base asset of the destination\\n error InvalidTokenConfigAddresses();\\n\\n /// @notice Thrown when contract has less liquidity for tokenAddressOut than amountOutMantissa\\n error InsufficientPoolLiquidity();\\n\\n /// @notice When address of the ConverterNetwork is not set or Zero address\\n error InvalidConverterNetwork();\\n\\n /// @notice Thrown when trying to set non zero incentive for private conversion\\n error NonZeroIncentiveForPrivateConversion();\\n\\n /// @notice Thrown when using convertForExactTokens deflationary tokens\\n error DeflationaryTokenNotSupported();\\n\\n /// @notice Thrown when minimum amount to convert is zero\\n error InvalidMinimumAmountToConvert();\\n\\n /// @notice Thrown when there is a mismatch in the length of input arrays\\n error InputLengthMisMatch();\\n\\n /**\\n * @notice Modifier to ensure valid conversion parameters for a token conversion\\n * and check if conversion is paused or not\\n * @param to The recipient address for the converted tokens\\n * @param tokenAddressIn The input token address for the conversion\\n * @param tokenAddressOut The output token address for the conversion\\n */\\n modifier validConversionParameters(\\n address to,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) {\\n _checkConversionPaused();\\n ensureNonzeroAddress(to);\\n if (to == tokenAddressIn || to == tokenAddressOut) {\\n revert InvalidToAddress();\\n }\\n _;\\n }\\n\\n /// @notice Pause conversion of tokens\\n /// @custom:event Emits ConversionPaused on success\\n /// @custom:error ConversionTokensPaused thrown when conversion is already paused\\n /// @custom:access Restricted by ACM\\n function pauseConversion() external {\\n _checkAccessAllowed(\\\"pauseConversion()\\\");\\n _checkConversionPaused();\\n conversionPaused = true;\\n emit ConversionPaused(msg.sender);\\n }\\n\\n /// @notice Resume conversion of tokens.\\n /// @custom:event Emits ConversionResumed on success\\n /// @custom:error ConversionTokensActive thrown when conversion is already active\\n /// @custom:access Restricted by ACM\\n function resumeConversion() external {\\n _checkAccessAllowed(\\\"resumeConversion()\\\");\\n if (!conversionPaused) {\\n revert ConversionTokensActive();\\n }\\n\\n conversionPaused = false;\\n emit ConversionResumed(msg.sender);\\n }\\n\\n /// @notice Sets a new price oracle\\n /// @param priceOracle_ Address of the new price oracle to set\\n /// @custom:access Only Governance\\n function setPriceOracle(ResilientOracle priceOracle_) external onlyOwner {\\n _setPriceOracle(priceOracle_);\\n }\\n\\n /// @notice Sets a new destination address\\n /// @param destinationAddress_ The new destination address to be set\\n /// @custom:access Only Governance\\n function setDestination(address destinationAddress_) external onlyOwner {\\n _setDestination(destinationAddress_);\\n }\\n\\n /// @notice Sets a converter network contract address\\n /// @param converterNetwork_ The converterNetwork address to be set\\n /// @custom:access Only Governance\\n function setConverterNetwork(IConverterNetwork converterNetwork_) external onlyOwner {\\n _setConverterNetwork(converterNetwork_);\\n }\\n\\n /// @notice Min amount to convert setter\\n /// @param minAmountToConvert_ Min amount to convert\\n /// @custom:access Only Governance\\n function setMinAmountToConvert(uint256 minAmountToConvert_) external {\\n _checkAccessAllowed(\\\"setMinAmountToConvert(uint256)\\\");\\n _setMinAmountToConvert(minAmountToConvert_);\\n }\\n\\n /// @notice Batch sets the conversion configurations\\n /// @param tokenAddressIn Address of tokenIn\\n /// @param tokenAddressesOut Array of addresses of tokenOut\\n /// @param conversionConfigs Array of conversionConfig config details to update\\n /// @custom:error InputLengthMisMatch is thrown when tokenAddressesOut and conversionConfigs array length mismatches\\n function setConversionConfigs(\\n address tokenAddressIn,\\n address[] calldata tokenAddressesOut,\\n ConversionConfig[] calldata conversionConfigs\\n ) external {\\n uint256 tokenOutArrayLength = tokenAddressesOut.length;\\n if (tokenOutArrayLength != conversionConfigs.length) revert InputLengthMisMatch();\\n\\n for (uint256 i; i < tokenOutArrayLength; ) {\\n setConversionConfig(tokenAddressIn, tokenAddressesOut[i], conversionConfigs[i]);\\n unchecked {\\n ++i;\\n }\\n }\\n }\\n\\n /// @notice Converts exact amount of tokenAddressIn for tokenAddressOut if there is enough tokens held by the contract\\n /// @dev Method does not support deflationary tokens transfer\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @param to Address of the tokenAddressOut receiver\\n /// @return actualAmountIn Actual amount transferred to destination\\n /// @return actualAmountOut Actual amount transferred to user\\n /// @custom:event Emits ConvertedExactTokens event on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when to address is zero\\n /// @custom:error InvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOut\\n /// @custom:error AmountOutLowerThanMinRequired error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa\\n /// @custom:error AmountInMismatched error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa\\n function convertExactTokens(\\n uint256 amountInMantissa,\\n uint256 amountOutMinMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n )\\n external\\n validConversionParameters(to, tokenAddressIn, tokenAddressOut)\\n nonReentrant\\n returns (uint256 actualAmountIn, uint256 actualAmountOut)\\n {\\n (actualAmountIn, actualAmountOut) = _convertExactTokens(\\n amountInMantissa,\\n amountOutMinMantissa,\\n tokenAddressIn,\\n tokenAddressOut,\\n to\\n );\\n\\n if (actualAmountIn != amountInMantissa) {\\n revert AmountInMismatched();\\n }\\n\\n _postConversionHook(tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\\n emit ConvertedExactTokens(msg.sender, to, tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\\n }\\n\\n /// @notice Converts tokens for tokenAddressIn for exact amount of tokenAddressOut if there is enough tokens held by the contract,\\n /// otherwise the amount is adjusted\\n /// @dev Method does not support deflationary tokens transfer\\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @param to Address of the tokenAddressOut receiver\\n /// @return actualAmountIn Actual amount transferred to destination\\n /// @return actualAmountOut Actual amount transferred to user\\n /// @custom:event Emits ConvertedForExactTokens event on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when to address is zero\\n /// @custom:error InvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOut\\n /// @custom:error AmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissa\\n /// @custom:error AmountOutMismatched error is thrown when actualAmountOut is does not match amountOutMantissa\\n function convertForExactTokens(\\n uint256 amountInMaxMantissa,\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n )\\n external\\n validConversionParameters(to, tokenAddressIn, tokenAddressOut)\\n nonReentrant\\n returns (uint256 actualAmountIn, uint256 actualAmountOut)\\n {\\n (actualAmountIn, actualAmountOut) = _convertForExactTokens(\\n amountInMaxMantissa,\\n amountOutMantissa,\\n tokenAddressIn,\\n tokenAddressOut,\\n to\\n );\\n\\n if (actualAmountOut != amountOutMantissa) {\\n revert AmountOutMismatched();\\n }\\n\\n _postConversionHook(tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\\n emit ConvertedForExactTokens(msg.sender, to, tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\\n }\\n\\n /// @notice Converts exact amount of tokenAddressIn for tokenAddressOut if there is enough tokens held by the contract\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @param to Address of the tokenAddressOut receiver\\n /// @return actualAmountIn Actual amount transferred to destination\\n /// @return actualAmountOut Actual amount transferred to user\\n /// @custom:event Emits ConvertedExactTokensSupportingFeeOnTransferTokens event on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when to address is zero\\n /// @custom:error InvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOut\\n /// @custom:error AmountOutLowerThanMinRequired error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa\\n function convertExactTokensSupportingFeeOnTransferTokens(\\n uint256 amountInMantissa,\\n uint256 amountOutMinMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n )\\n external\\n validConversionParameters(to, tokenAddressIn, tokenAddressOut)\\n nonReentrant\\n returns (uint256 actualAmountIn, uint256 actualAmountOut)\\n {\\n (actualAmountIn, actualAmountOut) = _convertExactTokens(\\n amountInMantissa,\\n amountOutMinMantissa,\\n tokenAddressIn,\\n tokenAddressOut,\\n to\\n );\\n\\n _postConversionHook(tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\\n emit ConvertedExactTokensSupportingFeeOnTransferTokens(\\n msg.sender,\\n to,\\n tokenAddressIn,\\n tokenAddressOut,\\n actualAmountIn,\\n actualAmountOut\\n );\\n }\\n\\n /// @notice Converts tokens for tokenAddressIn for amount of tokenAddressOut calculated on the basis of amount of\\n /// tokenAddressIn received by the contract, if there is enough tokens held by the contract, otherwise the amount is adjusted.\\n /// The user will be responsible for bearing any fees associated with token transfers, whether pulling in or pushing out tokens\\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @param to Address of the tokenAddressOut receiver\\n /// @return actualAmountIn Actual amount transferred to destination\\n /// @return actualAmountOut Actual amount transferred to user\\n /// @custom:event Emits ConvertedForExactTokensSupportingFeeOnTransferTokens event on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when to address is zero\\n /// @custom:error InvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOut\\n /// @custom:error AmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissa\\n function convertForExactTokensSupportingFeeOnTransferTokens(\\n uint256 amountInMaxMantissa,\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n )\\n external\\n validConversionParameters(to, tokenAddressIn, tokenAddressOut)\\n nonReentrant\\n returns (uint256 actualAmountIn, uint256 actualAmountOut)\\n {\\n (actualAmountIn, actualAmountOut) = _convertForExactTokensSupportingFeeOnTransferTokens(\\n amountInMaxMantissa,\\n amountOutMantissa,\\n tokenAddressIn,\\n tokenAddressOut,\\n to\\n );\\n\\n _postConversionHook(tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\\n emit ConvertedForExactTokensSupportingFeeOnTransferTokens(\\n msg.sender,\\n to,\\n tokenAddressIn,\\n tokenAddressOut,\\n actualAmountIn,\\n actualAmountOut\\n );\\n }\\n\\n /// @notice To sweep ERC20 tokens and transfer them to user(to address)\\n /// @param tokenAddress The address of the ERC-20 token to sweep\\n /// @param to The address to which tokens will be transferred\\n /// @param amount The amount to transfer\\n /// @custom:event Emits SweepToken event on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when tokenAddress/to address is zero\\n /// @custom:access Only Governance\\n function sweepToken(\\n address tokenAddress,\\n address to,\\n uint256 amount\\n ) external onlyOwner nonReentrant {\\n ensureNonzeroAddress(tokenAddress);\\n ensureNonzeroAddress(to);\\n ensureNonzeroValue(amount);\\n\\n IERC20Upgradeable token = IERC20Upgradeable(tokenAddress);\\n preSweepToken(tokenAddress, amount);\\n token.safeTransfer(to, amount);\\n\\n emit SweepToken(tokenAddress, to, amount);\\n }\\n\\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn.\\n /// This function does not account for potential token transfer fees(in case of deflationary tokens)\\n /// @notice The amountInMantissa might be adjusted if amountOutMantissa is greater than the balance of the contract for tokenAddressOut\\n /// @dev This function retrieves values without altering token prices\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountConvertedMantissa Amount of tokenAddressIn should be transferred after conversion\\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n /// @custom:error ConversionEnabledOnlyForPrivateConversions is thrown when conversion is only enabled for private conversion\\n function getAmountOut(\\n uint256 amountInMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) external view returns (uint256 amountConvertedMantissa, uint256 amountOutMantissa) {\\n if (\\n conversionConfigurations[tokenAddressIn][tokenAddressOut].conversionAccess ==\\n ConversionAccessibility.ONLY_FOR_CONVERTERS\\n ) {\\n revert ConversionEnabledOnlyForPrivateConversions();\\n }\\n\\n amountConvertedMantissa = amountInMantissa;\\n uint256 tokenInToOutConversion;\\n (amountOutMantissa, tokenInToOutConversion) = _getAmountOut(amountInMantissa, tokenAddressIn, tokenAddressOut);\\n\\n uint256 maxTokenOutReserve = balanceOf(tokenAddressOut);\\n\\n /// If contract has less liquidity for tokenAddressOut than amountOutMantissa\\n if (maxTokenOutReserve < amountOutMantissa) {\\n amountConvertedMantissa =\\n ((maxTokenOutReserve * EXP_SCALE) + tokenInToOutConversion - 1) /\\n tokenInToOutConversion; //round-up\\n amountOutMantissa = maxTokenOutReserve;\\n }\\n }\\n\\n /// @notice To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut.\\n /// This function does not account for potential token transfer fees(in case of deflationary tokens)\\n /// @dev This function retrieves values without altering token prices\\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountConvertedMantissa Amount of tokenAddressOut should be transferred after conversion\\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n /// @custom:error ConversionEnabledOnlyForPrivateConversions is thrown when conversion is only enabled for private conversion\\n function getAmountIn(\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) external view returns (uint256 amountConvertedMantissa, uint256 amountInMantissa) {\\n if (\\n conversionConfigurations[tokenAddressIn][tokenAddressOut].conversionAccess ==\\n ConversionAccessibility.ONLY_FOR_CONVERTERS\\n ) {\\n revert ConversionEnabledOnlyForPrivateConversions();\\n }\\n\\n uint256 maxTokenOutReserve = balanceOf(tokenAddressOut);\\n\\n /// If contract has less liquidity for tokenAddressOut than amountOutMantissa\\n if (maxTokenOutReserve < amountOutMantissa) {\\n amountOutMantissa = maxTokenOutReserve;\\n }\\n\\n amountConvertedMantissa = amountOutMantissa;\\n (amountInMantissa, ) = _getAmountIn(amountOutMantissa, tokenAddressIn, tokenAddressOut);\\n }\\n\\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountConvertedMantissa Amount of tokenAddressIn should be transferred after conversion\\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n function getUpdatedAmountOut(\\n uint256 amountInMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) public returns (uint256 amountConvertedMantissa, uint256 amountOutMantissa) {\\n priceOracle.updateAssetPrice(tokenAddressIn);\\n priceOracle.updateAssetPrice(tokenAddressOut);\\n\\n (amountOutMantissa, ) = _getAmountOut(amountInMantissa, tokenAddressIn, tokenAddressOut);\\n amountConvertedMantissa = amountInMantissa;\\n }\\n\\n /// @notice To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut\\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountConvertedMantissa Amount of tokenAddressOut should be transferred after conversion\\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n function getUpdatedAmountIn(\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) public returns (uint256 amountConvertedMantissa, uint256 amountInMantissa) {\\n priceOracle.updateAssetPrice(tokenAddressIn);\\n priceOracle.updateAssetPrice(tokenAddressOut);\\n\\n (amountInMantissa, ) = _getAmountIn(amountOutMantissa, tokenAddressIn, tokenAddressOut);\\n amountConvertedMantissa = amountOutMantissa;\\n }\\n\\n /// @notice This method updated the states of this contract after getting funds from PSR\\n /// after settling the amount(if any) through privateConversion between converters\\n /// @dev This function is called by protocolShareReserve\\n /// @dev call _updateAssetsState to update the states related to the comptroller and asset transfer to the specific converter then\\n /// it calls the _privateConversion which will convert the asset into destination's base asset and transfer it to destination address\\n /// @param comptroller Comptroller address (pool)\\n /// @param asset Asset address\\n function updateAssetsState(address comptroller, address asset) public nonReentrant {\\n uint256 balanceDiff = _updateAssetsState(comptroller, asset);\\n if (balanceDiff > 0) {\\n _privateConversion(comptroller, asset, balanceDiff);\\n }\\n }\\n\\n /// @notice Set the configuration for new or existing conversion pair\\n /// @param tokenAddressIn Address of tokenIn\\n /// @param tokenAddressOut Address of tokenOut\\n /// @param conversionConfig ConversionConfig config details to update\\n /// @custom:event Emits ConversionConfigUpdated event on success\\n /// @custom:error Unauthorized error is thrown when the call is not authorized by AccessControlManager\\n /// @custom:error ZeroAddressNotAllowed is thrown when pool registry address is zero\\n /// @custom:error NonZeroIncentiveForPrivateConversion is thrown when incentive is non zero for private conversion\\n /// @custom:access Controlled by AccessControlManager\\n function setConversionConfig(\\n address tokenAddressIn,\\n address tokenAddressOut,\\n ConversionConfig calldata conversionConfig\\n ) public {\\n _checkAccessAllowed(\\\"setConversionConfig(address,address,ConversionConfig)\\\");\\n ensureNonzeroAddress(tokenAddressIn);\\n ensureNonzeroAddress(tokenAddressOut);\\n\\n if (conversionConfig.incentive > MAX_INCENTIVE) {\\n revert IncentiveTooHigh(conversionConfig.incentive, MAX_INCENTIVE);\\n }\\n\\n if (\\n (tokenAddressIn == tokenAddressOut) ||\\n (tokenAddressIn != _getDestinationBaseAsset()) ||\\n conversionConfigurations[tokenAddressOut][tokenAddressIn].conversionAccess != ConversionAccessibility.NONE\\n ) {\\n revert InvalidTokenConfigAddresses();\\n }\\n\\n if (\\n (conversionConfig.conversionAccess == ConversionAccessibility.ONLY_FOR_CONVERTERS) &&\\n conversionConfig.incentive != 0\\n ) {\\n revert NonZeroIncentiveForPrivateConversion();\\n }\\n\\n if (\\n ((conversionConfig.conversionAccess == ConversionAccessibility.ONLY_FOR_CONVERTERS) ||\\n (conversionConfig.conversionAccess == ConversionAccessibility.ALL)) &&\\n (address(converterNetwork) == address(0))\\n ) {\\n revert InvalidConverterNetwork();\\n }\\n\\n ConversionConfig storage configuration = conversionConfigurations[tokenAddressIn][tokenAddressOut];\\n\\n emit ConversionConfigUpdated(\\n tokenAddressIn,\\n tokenAddressOut,\\n configuration.incentive,\\n conversionConfig.incentive,\\n configuration.conversionAccess,\\n conversionConfig.conversionAccess\\n );\\n\\n if (conversionConfig.conversionAccess == ConversionAccessibility.NONE) {\\n delete conversionConfigurations[tokenAddressIn][tokenAddressOut];\\n } else {\\n configuration.incentive = conversionConfig.incentive;\\n configuration.conversionAccess = conversionConfig.conversionAccess;\\n }\\n }\\n\\n /// @notice Get the balance for specific token\\n /// @param token Address of the token\\n /// @return tokenBalance Balance of the token the contract has\\n function balanceOf(address token) public view virtual returns (uint256 tokenBalance);\\n\\n /// @dev Operations to perform before sweeping tokens\\n /// @param token Address of the token\\n /// @param amount Amount transferred to address(to)\\n function preSweepToken(address token, uint256 amount) internal virtual {}\\n\\n /// @dev Converts exact amount of tokenAddressIn for tokenAddressOut\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @param to Address of the tokenAddressOut receiver\\n /// @return actualAmountIn Actual amount of tokenAddressIn transferred\\n /// @return amountOutMantissa Actual amount of tokenAddressOut transferred\\n /// @custom:error AmountOutLowerThanMinRequired error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa\\n function _convertExactTokens(\\n uint256 amountInMantissa,\\n uint256 amountOutMinMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n ) internal returns (uint256 actualAmountIn, uint256 amountOutMantissa) {\\n _checkPrivateConversion(tokenAddressIn, tokenAddressOut);\\n actualAmountIn = _doTransferIn(tokenAddressIn, amountInMantissa);\\n\\n (, amountOutMantissa) = getUpdatedAmountOut(actualAmountIn, tokenAddressIn, tokenAddressOut);\\n\\n if (amountOutMantissa < amountOutMinMantissa) {\\n revert AmountOutLowerThanMinRequired(amountOutMantissa, amountOutMinMantissa);\\n }\\n\\n _doTransferOut(tokenAddressOut, to, amountOutMantissa);\\n }\\n\\n /// @dev Converts tokens for tokenAddressIn for exact amount of tokenAddressOut used for non deflationry tokens\\n /// it is called by convertForExactTokens function\\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @param to Address of the tokenAddressOut receiver\\n /// @return actualAmountIn Actual amount of tokenAddressIn transferred\\n /// @return actualAmountOut Actual amount of tokenAddressOut transferred\\n /// @custom:error DeflationaryTokenNotSupported is thrown if tokenAddressIn is deflationary token\\n /// @custom:error AmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissa\\n function _convertForExactTokens(\\n uint256 amountInMaxMantissa,\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n ) internal returns (uint256 actualAmountIn, uint256 actualAmountOut) {\\n _checkPrivateConversion(tokenAddressIn, tokenAddressOut);\\n (, uint256 amountInMantissa) = getUpdatedAmountIn(amountOutMantissa, tokenAddressIn, tokenAddressOut);\\n\\n actualAmountIn = _doTransferIn(tokenAddressIn, amountInMantissa);\\n\\n if (actualAmountIn != amountInMantissa) {\\n revert DeflationaryTokenNotSupported();\\n }\\n\\n if (actualAmountIn > amountInMaxMantissa) {\\n revert AmountInHigherThanMax(amountInMantissa, amountInMaxMantissa);\\n }\\n\\n _doTransferOut(tokenAddressOut, to, amountOutMantissa);\\n actualAmountOut = amountOutMantissa;\\n }\\n\\n /// @dev Converts tokens for tokenAddressIn for the amount of tokenAddressOut used for deflationary tokens\\n /// it is called by convertForExactTokensSupportingFeeOnTransferTokens function\\n /// @notice Advising users to input a smaller amountOutMantissa to avoid potential transaction revert\\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @param to Address of the tokenAddressOut receiver\\n /// @return actualAmountIn Actual amount of tokenAddressIn transferred\\n /// @return actualAmountOut Actual amount of tokenAddressOut transferred\\n /// @custom:error AmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissa\\n function _convertForExactTokensSupportingFeeOnTransferTokens(\\n uint256 amountInMaxMantissa,\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n ) internal returns (uint256 actualAmountIn, uint256 actualAmountOut) {\\n _checkPrivateConversion(tokenAddressIn, tokenAddressOut);\\n (, uint256 amountInMantissa) = getUpdatedAmountIn(amountOutMantissa, tokenAddressIn, tokenAddressOut);\\n\\n if (amountInMantissa > amountInMaxMantissa) {\\n revert AmountInHigherThanMax(amountInMantissa, amountInMaxMantissa);\\n }\\n\\n actualAmountIn = _doTransferIn(tokenAddressIn, amountInMantissa);\\n\\n (, actualAmountOut) = getUpdatedAmountOut(actualAmountIn, tokenAddressIn, tokenAddressOut);\\n\\n _doTransferOut(tokenAddressOut, to, actualAmountOut);\\n }\\n\\n /// @dev return actualAmountOut from reserves for tokenAddressOut\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @param to Address of the tokenAddressOut receiver\\n /// @param amountConvertedMantissa Amount of tokenAddressOut supposed to get transferred\\n /// @custom:error InsufficientPoolLiquidity If contract has less liquidity for tokenAddressOut than amountOutMantissa\\n function _doTransferOut(\\n address tokenAddressOut,\\n address to,\\n uint256 amountConvertedMantissa\\n ) internal {\\n uint256 maxTokenOutReserve = balanceOf(tokenAddressOut);\\n\\n /// If contract has less liquidity for tokenAddressOut than amountOutMantissa\\n if (maxTokenOutReserve < amountConvertedMantissa) {\\n revert InsufficientPoolLiquidity();\\n }\\n\\n _preTransferHook(tokenAddressOut, amountConvertedMantissa);\\n\\n IERC20Upgradeable tokenOut = IERC20Upgradeable(tokenAddressOut);\\n tokenOut.safeTransfer(to, amountConvertedMantissa);\\n }\\n\\n /// @notice Transfer tokenAddressIn from user to destination\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @return actualAmountIn Actual amount transferred to destination\\n function _doTransferIn(address tokenAddressIn, uint256 amountInMantissa) internal returns (uint256 actualAmountIn) {\\n IERC20Upgradeable tokenIn = IERC20Upgradeable(tokenAddressIn);\\n uint256 balanceBeforeDestination = tokenIn.balanceOf(destinationAddress);\\n tokenIn.safeTransferFrom(msg.sender, destinationAddress, amountInMantissa);\\n uint256 balanceAfterDestination = tokenIn.balanceOf(destinationAddress);\\n actualAmountIn = balanceAfterDestination - balanceBeforeDestination;\\n }\\n\\n /// @dev Sets a new price oracle\\n /// @param priceOracle_ Address of the new price oracle to set\\n /// @custom:event Emits PriceOracleUpdated event on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when price oracle address is zero\\n function _setPriceOracle(ResilientOracle priceOracle_) internal {\\n ensureNonzeroAddress(address(priceOracle_));\\n emit PriceOracleUpdated(priceOracle, priceOracle_);\\n priceOracle = priceOracle_;\\n }\\n\\n /// @dev Sets a new destination address\\n /// @param destinationAddress_ The new destination address to be set\\n /// @custom:event Emits DestinationAddressUpdated event on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when destination address is zero\\n function _setDestination(address destinationAddress_) internal {\\n ensureNonzeroAddress(destinationAddress_);\\n emit DestinationAddressUpdated(destinationAddress, destinationAddress_);\\n destinationAddress = destinationAddress_;\\n }\\n\\n /// @notice Sets a converter network contract address\\n /// @param converterNetwork_ The converterNetwork address to be set\\n /// @custom:event Emits ConverterNetworkAddressUpdated event on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when address is zero\\n function _setConverterNetwork(IConverterNetwork converterNetwork_) internal {\\n ensureNonzeroAddress(address(converterNetwork_));\\n emit ConverterNetworkAddressUpdated(address(converterNetwork), address(converterNetwork_));\\n converterNetwork = converterNetwork_;\\n }\\n\\n /// @notice Min amount to convert setter\\n /// @param minAmountToConvert_ Min amount to convert\\n /// @custom:event MinAmountToConvertUpdated is emitted in success\\n /// @custom:error ZeroValueNotAllowed is thrown if the provided value is 0\\n function _setMinAmountToConvert(uint256 minAmountToConvert_) internal {\\n ensureNonzeroValue(minAmountToConvert_);\\n emit MinAmountToConvertUpdated(minAmountToConvert, minAmountToConvert_);\\n minAmountToConvert = minAmountToConvert_;\\n }\\n\\n /// @dev Hook to perform after converting tokens\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @param amountIn Amount of tokenIn converted\\n /// @param amountOut Amount of tokenOut converted\\n function _postConversionHook(\\n address tokenAddressIn,\\n address tokenAddressOut,\\n uint256 amountIn,\\n uint256 amountOut\\n ) internal virtual {}\\n\\n /// @param accessControlManager_ Access control manager contract address\\n /// @param priceOracle_ Resilient oracle address\\n /// @param destinationAddress_ Address at all incoming tokens will transferred to\\n /// @param minAmountToConvert_ minimum amount to convert\\n function __AbstractTokenConverter_init(\\n address accessControlManager_,\\n ResilientOracle priceOracle_,\\n address destinationAddress_,\\n uint256 minAmountToConvert_\\n ) internal onlyInitializing {\\n __AccessControlled_init(accessControlManager_);\\n __ReentrancyGuard_init();\\n __AbstractTokenConverter_init_unchained(priceOracle_, destinationAddress_, minAmountToConvert_);\\n }\\n\\n /// @param priceOracle_ Resilient oracle address\\n /// @param destinationAddress_ Address at all incoming tokens will transferred to\\n /// @param minAmountToConvert_ minimum amount to convert\\n function __AbstractTokenConverter_init_unchained(\\n ResilientOracle priceOracle_,\\n address destinationAddress_,\\n uint256 minAmountToConvert_\\n ) internal onlyInitializing {\\n _setPriceOracle(priceOracle_);\\n _setDestination(destinationAddress_);\\n _setMinAmountToConvert(minAmountToConvert_);\\n conversionPaused = false;\\n }\\n\\n /// @dev _updateAssetsState hook to update the states of reserves transferred for the specific comptroller\\n /// @param comptroller Comptroller address (pool)\\n /// @param asset Asset address\\n /// @return Amount of asset, for _privateConversion\\n function _updateAssetsState(address comptroller, address asset) internal virtual returns (uint256) {}\\n\\n /// @dev This method is used to convert asset into base asset by converting them with other converters which supports the pair and transfer the funds to\\n /// destination contract as destination's base asset\\n /// @param comptroller Comptroller address (pool)\\n /// @param tokenAddressOut Address of the token transferred to converter, and through _privateConversion it will be converted into base asset\\n /// @param amountToConvert Amount of the tokenAddressOut transferred to converter\\n function _privateConversion(\\n address comptroller,\\n address tokenAddressOut,\\n uint256 amountToConvert\\n ) internal {\\n address tokenAddressIn = _getDestinationBaseAsset();\\n address _destinationAddress = destinationAddress;\\n uint256 convertedTokenInBalance;\\n if (address(converterNetwork) != address(0)) {\\n (address[] memory converterAddresses, uint256[] memory converterBalances) = converterNetwork\\n .findTokenConvertersForConverters(tokenAddressOut, tokenAddressIn);\\n uint256 convertersLength = converterAddresses.length;\\n for (uint256 i; i < convertersLength; ) {\\n if (converterBalances[i] == 0) break;\\n (, uint256 amountIn) = IAbstractTokenConverter(converterAddresses[i]).getUpdatedAmountIn(\\n converterBalances[i],\\n tokenAddressOut,\\n tokenAddressIn\\n );\\n if (amountIn > amountToConvert) {\\n amountIn = amountToConvert;\\n }\\n\\n if (!_validateMinAmountToConvert(amountIn, tokenAddressOut)) {\\n break;\\n }\\n\\n uint256 balanceBefore = IERC20Upgradeable(tokenAddressIn).balanceOf(_destinationAddress);\\n\\n IERC20Upgradeable(tokenAddressOut).approve(converterAddresses[i], amountIn);\\n IAbstractTokenConverter(converterAddresses[i]).convertExactTokens(\\n amountIn,\\n 0,\\n tokenAddressOut,\\n tokenAddressIn,\\n _destinationAddress\\n );\\n\\n uint256 balanceAfter = IERC20Upgradeable(tokenAddressIn).balanceOf(_destinationAddress);\\n amountToConvert -= amountIn;\\n convertedTokenInBalance += (balanceAfter - balanceBefore);\\n\\n if (amountToConvert == 0) break;\\n unchecked {\\n ++i;\\n }\\n }\\n }\\n\\n _postPrivateConversionHook(\\n comptroller,\\n tokenAddressIn,\\n convertedTokenInBalance,\\n tokenAddressOut,\\n amountToConvert\\n );\\n }\\n\\n /// @dev This hook is used to update states for the converter after the privateConversion\\n /// @param comptroller Comptroller address (pool)\\n /// @param tokenAddressIn Address of the destination's base asset\\n /// @param convertedTokenInBalance Amount of the base asset received after the conversion\\n /// @param tokenAddressOut Address of the asset transferred to other converter in exchange of base asset\\n /// @param convertedTokenOutBalance Amount of tokenAddressOut transferred from this converter\\n function _postPrivateConversionHook(\\n address comptroller,\\n address tokenAddressIn,\\n uint256 convertedTokenInBalance,\\n address tokenAddressOut,\\n uint256 convertedTokenOutBalance\\n ) internal virtual {}\\n\\n /// @notice This hook is used to update the state for asset reserves before transferring tokenOut to user\\n /// @param tokenOutAddress Address of the asset to be transferred to the user\\n /// @param amountOut Amount of tokenAddressOut transferred from this converter\\n function _preTransferHook(address tokenOutAddress, uint256 amountOut) internal virtual {}\\n\\n /// @dev Checks if amount to convert is greater than minimum amount to convert or not\\n /// @param amountIn The amount to convert\\n /// @param tokenAddress Address of the token\\n /// @return isValid true if amount to convert is greater than minimum amount to convert\\n function _validateMinAmountToConvert(uint256 amountIn, address tokenAddress) internal returns (bool isValid) {\\n priceOracle.updateAssetPrice(tokenAddress);\\n uint256 amountInInUsd = (priceOracle.getPrice(tokenAddress) * amountIn) / EXP_SCALE;\\n\\n if (amountInInUsd >= minAmountToConvert) {\\n isValid = true;\\n }\\n }\\n\\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn\\n /// @dev This function retrieves values without altering token prices.\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\\n /// @return tokenInToOutConversion Ratio of tokenIn price and incentive for conversion with tokenOut price\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n function _getAmountOut(\\n uint256 amountInMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) internal view returns (uint256 amountOutMantissa, uint256 tokenInToOutConversion) {\\n if (amountInMantissa == 0) {\\n revert InsufficientInputAmount();\\n }\\n\\n ConversionConfig memory configuration = conversionConfigurations[tokenAddressIn][tokenAddressOut];\\n\\n if (configuration.conversionAccess == ConversionAccessibility.NONE) {\\n revert ConversionConfigNotEnabled();\\n }\\n\\n uint256 tokenInUnderlyingPrice = priceOracle.getPrice(tokenAddressIn);\\n uint256 tokenOutUnderlyingPrice = priceOracle.getPrice(tokenAddressOut);\\n\\n uint256 incentive = configuration.incentive;\\n if (address(converterNetwork) != address(0) && (converterNetwork.isTokenConverter(msg.sender))) {\\n incentive = 0;\\n }\\n\\n /// conversion rate after considering incentive(conversionWithIncentive)\\n uint256 conversionWithIncentive = MANTISSA_ONE + incentive;\\n\\n /// amount of tokenAddressOut after including incentive as amountOutMantissa will be greater than actual as it gets\\n /// multiplied by conversionWithIncentive which will be >= 1\\n amountOutMantissa =\\n (amountInMantissa * tokenInUnderlyingPrice * conversionWithIncentive) /\\n (tokenOutUnderlyingPrice * EXP_SCALE);\\n\\n tokenInToOutConversion = (tokenInUnderlyingPrice * conversionWithIncentive) / tokenOutUnderlyingPrice;\\n }\\n\\n /// @dev To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut\\n /// @dev This function retrieves values without altering token prices.\\n /// @dev For user conversions, the function returns an amountInMantissa that is rounded up, ensuring that the equivalent amountInMantissa\\n /// is obtained from users for corresponding amountOutMantissa, preventing any losses to the protocol. However, no rounding up is required for private conversions\\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\\n /// @return tokenInToOutConversion Ratio of tokenIn price and incentive for conversion with tokenOut price\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n function _getAmountIn(\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) internal view returns (uint256 amountInMantissa, uint256 tokenInToOutConversion) {\\n if (amountOutMantissa == 0) {\\n revert InsufficientOutputAmount();\\n }\\n\\n ConversionConfig memory configuration = conversionConfigurations[tokenAddressIn][tokenAddressOut];\\n\\n if (configuration.conversionAccess == ConversionAccessibility.NONE) {\\n revert ConversionConfigNotEnabled();\\n }\\n\\n uint256 tokenInUnderlyingPrice = priceOracle.getPrice(tokenAddressIn);\\n uint256 tokenOutUnderlyingPrice = priceOracle.getPrice(tokenAddressOut);\\n\\n uint256 incentive = configuration.incentive;\\n\\n bool isPrivateConversion = address(converterNetwork) != address(0) &&\\n converterNetwork.isTokenConverter(msg.sender);\\n if (isPrivateConversion) {\\n incentive = 0;\\n }\\n\\n /// conversion rate after considering incentive(conversionWithIncentive)\\n uint256 conversionWithIncentive = MANTISSA_ONE + incentive;\\n tokenInToOutConversion = (tokenInUnderlyingPrice * conversionWithIncentive) / tokenOutUnderlyingPrice;\\n\\n /// amount of tokenAddressIn after considering incentive(i.e. amountInMantissa will be less than actual amountInMantissa if incentive > 0)\\n if (isPrivateConversion) {\\n amountInMantissa = (amountOutMantissa * EXP_SCALE) / tokenInToOutConversion;\\n } else {\\n amountInMantissa = ((amountOutMantissa * EXP_SCALE) + tokenInToOutConversion - 1) / tokenInToOutConversion; //round-up\\n }\\n }\\n\\n /// @dev Check if msg.sender is allowed to convert as per onlyForPrivateConversions flag\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @custom:error ConversionEnabledOnlyForPrivateConversions is thrown when conversion is only enabled for private conversion\\n function _checkPrivateConversion(address tokenAddressIn, address tokenAddressOut) internal view {\\n bool isConverter = (address(converterNetwork) != address(0)) && converterNetwork.isTokenConverter(msg.sender);\\n if (\\n (!(isConverter) &&\\n (conversionConfigurations[tokenAddressIn][tokenAddressOut].conversionAccess ==\\n ConversionAccessibility.ONLY_FOR_CONVERTERS))\\n ) {\\n revert ConversionEnabledOnlyForPrivateConversions();\\n }\\n }\\n\\n /// @dev To check, is conversion paused\\n /// @custom:error ConversionTokensPaused is thrown when token conversion is paused\\n function _checkConversionPaused() internal view {\\n if (conversionPaused) {\\n revert ConversionTokensPaused();\\n }\\n }\\n\\n /// @dev Get base asset address of the destination contract\\n /// @return Address of the base asset\\n function _getDestinationBaseAsset() internal view virtual returns (address) {}\\n}\\n\",\"keccak256\":\"0xdecdaf378a5af7744557fc29495d6db49c6900be1b03bcb6faa2b3a23c9a5c59\",\"license\":\"BSD-3-Clause\"},\"contracts/TokenConverter/IAbstractTokenConverter.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\nimport { ResilientOracle } from \\\"@venusprotocol/oracle/contracts/ResilientOracle.sol\\\";\\nimport { IConverterNetwork } from \\\"../Interfaces/IConverterNetwork.sol\\\";\\n\\n/// @notice Interface for AbstractTokenConverter\\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\\ninterface IAbstractTokenConverter {\\n /// @notice This enum define the all possible ways of conversion can happen\\n enum ConversionAccessibility {\\n NONE, // Conversion is disable for the pair\\n ALL, // Conversion is enable for private conversion and users\\n ONLY_FOR_CONVERTERS, // Conversion is enable only for private conversion\\n ONLY_FOR_USERS // Conversion is enable only for users\\n }\\n\\n /// @notice This struct represents the configuration for a token conversion.\\n struct ConversionConfig {\\n /// incentive on conversion of tokens in mantissa i.e 10% incentive would be 0.1 * 1e18\\n uint256 incentive;\\n /// enable or disable conversion for users or converters or both or none\\n ConversionAccessibility conversionAccess;\\n }\\n\\n /// @notice Pause conversion of tokens\\n function pauseConversion() external;\\n\\n /// @notice Resume conversion of tokens.\\n function resumeConversion() external;\\n\\n /// @notice Sets a new price oracle\\n /// @param priceOracle_ Address of the new price oracle to set\\n function setPriceOracle(ResilientOracle priceOracle_) external;\\n\\n /// @notice Set the configuration for new or existing convert pair\\n /// @param tokenAddressIn Address of tokenIn\\n /// @param tokenAddressOut Address of tokenOut\\n /// @param conversionConfig ConversionConfig config details to update\\n function setConversionConfig(\\n address tokenAddressIn,\\n address tokenAddressOut,\\n ConversionConfig calldata conversionConfig\\n ) external;\\n\\n /// @notice Convert exact amount of tokenAddressIn for tokenAddressOut\\n /// @dev Method does not support deflationary tokens transfer\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after convert\\n /// @param to Address of the tokenAddressOut receiver\\n function convertExactTokens(\\n uint256 amountInMantissa,\\n uint256 amountOutMinMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n ) external returns (uint256 actualAmountIn, uint256 actualAmountOut);\\n\\n /// @notice Convert tokens for tokenAddressIn for exact amount of tokenAddressOut\\n /// @dev Method does not support deflationary tokens transfer\\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after convert\\n /// @param to Address of the tokenAddressOut receiver\\n function convertForExactTokens(\\n uint256 amountInMaxMantissa,\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n ) external returns (uint256 actualAmountIn, uint256 actualAmountOut);\\n\\n /// @notice Convert exact amount of tokenAddressIn for tokenAddressOut\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after convert\\n /// @param to Address of the tokenAddressOut receiver\\n function convertExactTokensSupportingFeeOnTransferTokens(\\n uint256 amountInMantissa,\\n uint256 amountOutMinMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n ) external returns (uint256 actualAmountIn, uint256 actualAmountOut);\\n\\n /// @notice Convert tokens for tokenAddressIn for exact amount of tokenAddressOut\\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after convert\\n /// @param to Address of the tokenAddressOut receiver\\n function convertForExactTokensSupportingFeeOnTransferTokens(\\n uint256 amountInMaxMantissa,\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n ) external returns (uint256 actualAmountIn, uint256 actualAmountOut);\\n\\n /// @notice Get the configuration for the pair of the tokens\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return incentives Percentage of incentives to be distributed for the pair of tokens\\n /// @return conversionAccess Accessibility for the pair of tokens\\n function conversionConfigurations(address tokenAddressIn, address tokenAddressOut)\\n external\\n returns (uint256 incentives, ConversionAccessibility conversionAccess);\\n\\n /// @notice Get the address of the converterNetwork\\n function converterNetwork() external returns (IConverterNetwork converterNetwork);\\n\\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountConvertedMantissa Amount of tokenAddressIn should be transferred after conversion\\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n function getUpdatedAmountOut(\\n uint256 amountInMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) external returns (uint256 amountConvertedMantissa, uint256 amountOutMantissa);\\n\\n /// @notice To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut\\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountConvertedMantissa Amount of tokenAddressOut should be transferred after conversion\\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n function getUpdatedAmountIn(\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) external returns (uint256 amountConvertedMantissa, uint256 amountInMantissa);\\n\\n /// @notice To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut\\n /// @dev This function retrieves values without altering token prices.\\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountConvertedMantissa Amount of tokenAddressOut should be transferred after conversion\\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n function getAmountIn(\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) external view returns (uint256 amountConvertedMantissa, uint256 amountInMantissa);\\n\\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn\\n /// @dev This function retrieves values without altering token prices.\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountConvertedMantissa Amount of tokenAddressIn should be transferred after conversion\\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n function getAmountOut(\\n uint256 amountInMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) external view returns (uint256 amountConvertedMantissa, uint256 amountOutMantissa);\\n\\n /// @notice Get the balance for specific token\\n /// @param token Address of the token\\n /// @return tokenBalance Balance of the token the contract has\\n function balanceOf(address token) external view returns (uint256 tokenBalance);\\n}\\n\",\"keccak256\":\"0xc677c12e2f04e520fb1fa02a1f06ad37d821cfebb5aa8f4bd7a22410648a0aae\",\"license\":\"BSD-3-Clause\"},\"contracts/TokenConverter/RiskFundConverter.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\nimport { SafeERC20Upgradeable } from \\\"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\\\";\\nimport { IERC20Upgradeable } from \\\"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\\\";\\nimport { ResilientOracle } from \\\"@venusprotocol/oracle/contracts/ResilientOracle.sol\\\";\\nimport { ensureNonzeroAddress, ensureNonzeroValue } from \\\"@venusprotocol/solidity-utilities/contracts/validators.sol\\\";\\n\\nimport { AbstractTokenConverter } from \\\"./AbstractTokenConverter.sol\\\";\\nimport { IPoolRegistry } from \\\"../Interfaces/IPoolRegistry.sol\\\";\\nimport { IComptroller } from \\\"../Interfaces/IComptroller.sol\\\";\\nimport { IRiskFund, IRiskFundGetters } from \\\"../Interfaces/IRiskFund.sol\\\";\\nimport { IVToken } from \\\"../Interfaces/IVToken.sol\\\";\\n\\n/// @title RiskFundConverter\\n/// @author Venus\\n/// @notice RiskFundConverter used for token conversions and sends received token to RiskFund\\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\\ncontract RiskFundConverter is AbstractTokenConverter {\\n using SafeERC20Upgradeable for IERC20Upgradeable;\\n\\n /// @notice Address of the core pool comptroller\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address public immutable CORE_POOL_COMPTROLLER;\\n\\n ///@notice Address of the vBNB\\n ///@dev This address is used to include the BNB market while in getPools method\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address public immutable VBNB;\\n\\n ///@notice Address of the native wrapped currency\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address public immutable NATIVE_WRAPPED;\\n\\n /// @notice Store the previous state for the asset transferred to ProtocolShareReserve combined(for all pools)\\n mapping(address => uint256) internal assetsReserves;\\n\\n /// @notice Store the asset's reserve per pool in the ProtocolShareReserve\\n /// @dev Comptroller(pool) -> Asset -> amount\\n mapping(address => mapping(address => uint256)) internal poolsAssetsReserves;\\n\\n /// @notice Address of pool registry contract\\n address public poolRegistry;\\n\\n /// @notice The mapping contains the assets for each pool which are sent to RiskFund directly\\n /// @dev Comptroller(pool) -> Asset -> bool(should transfer directly on true)\\n mapping(address => mapping(address => bool)) public poolsAssetsDirectTransfer;\\n\\n /// @notice Emitted when pool registry address is updated\\n event PoolRegistryUpdated(address indexed oldPoolRegistry, address indexed newPoolRegistry);\\n\\n /// @notice Emitted after updating of the assets reserves\\n /// amount -> reserve increased by amount\\n event AssetsReservesUpdated(address indexed comptroller, address indexed asset, uint256 amount);\\n\\n /// @notice Emmitted after the funds transferred to the destination address\\n event AssetTransferredToDestination(\\n address indexed receiver,\\n address indexed comptroller,\\n address indexed asset,\\n uint256 amount\\n );\\n\\n /// @notice Emitted after the poolsAssetsDirectTransfer mapping is updated\\n event PoolAssetsDirectTransferUpdated(address indexed comptroller, address indexed asset, bool value);\\n\\n // Error thrown when comptrollers array length is not equal to assets array length\\n error InvalidArguments();\\n\\n /// @notice thrown when amount entered is greater than balance\\n error InsufficientBalance();\\n\\n /// @notice thrown when asset does not exist in the pool\\n error MarketNotExistInPool(address comptroller, address asset);\\n\\n /// @notice thrown to prevent reentrancy\\n /// @dev This error is used to safeguard against reentrancy attacks, ensuring that a certain operation\\n /// cannot be called recursively within the same transaction.\\n error ReentrancyGuardError();\\n\\n /// @param corePoolComptroller_ Address of the Comptroller pool\\n /// @param vBNB_ Address of the vBNB\\n /// @param nativeWrapped_ Address of the wrapped native currency\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(\\n address corePoolComptroller_,\\n address vBNB_,\\n address nativeWrapped_\\n ) {\\n ensureNonzeroAddress(corePoolComptroller_);\\n ensureNonzeroAddress(vBNB_);\\n ensureNonzeroAddress(nativeWrapped_);\\n\\n CORE_POOL_COMPTROLLER = corePoolComptroller_;\\n VBNB = vBNB_;\\n NATIVE_WRAPPED = nativeWrapped_;\\n\\n // Note that the contract is upgradeable. Use initialize() or reinitializers\\n // to set the state variables.\\n _disableInitializers();\\n }\\n\\n /// @param accessControlManager_ Access control manager contract address\\n /// @param priceOracle_ Resilient oracle address\\n /// @param destinationAddress_ Address at all incoming tokens will transferred to\\n /// @param poolRegistry_ Address of the pool registry\\n /// @param minAmountToConvert_ minimum amount to convert\\n /// @param comptrollers Addresses of the pools\\n /// @param assets Addresses of the assets need to be added for direct transfer\\n /// @param values Boolean value to indicate whether direct transfer is allowed for each asset.\\n /// @custom:event PoolAssetsDirectTransferUpdated emits on success\\n function initialize(\\n address accessControlManager_,\\n ResilientOracle priceOracle_,\\n address destinationAddress_,\\n address poolRegistry_,\\n uint256 minAmountToConvert_,\\n address[] calldata comptrollers,\\n address[][] calldata assets,\\n bool[][] calldata values\\n ) public initializer {\\n // Initialize AbstractTokenConverter\\n __AbstractTokenConverter_init(accessControlManager_, priceOracle_, destinationAddress_, minAmountToConvert_);\\n ensureNonzeroAddress(poolRegistry_);\\n poolRegistry = poolRegistry_;\\n _setPoolsAssetsDirectTransfer(comptrollers, assets, values);\\n }\\n\\n /// @dev Pool registry setter\\n /// @param poolRegistry_ Address of the pool registry\\n /// @custom:event PoolRegistryUpdated emits on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when pool registry address is zero\\n /// @custom:access Only Governance\\n function setPoolRegistry(address poolRegistry_) external onlyOwner {\\n ensureNonzeroAddress(poolRegistry_);\\n emit PoolRegistryUpdated(poolRegistry, poolRegistry_);\\n poolRegistry = poolRegistry_;\\n }\\n\\n /// @notice Update the poolsAssetsDirectTransfer mapping\\n /// @param comptrollers Addresses of the pools\\n /// @param assets Addresses of the assets need to be added for direct transfer\\n /// @param values Boolean value to indicate whether direct transfer is allowed for each asset.\\n /// @custom:event PoolAssetsDirectTransferUpdated emits on success\\n /// @custom:access Restricted by ACM\\n function setPoolsAssetsDirectTransfer(\\n address[] calldata comptrollers,\\n address[][] calldata assets,\\n bool[][] calldata values\\n ) external {\\n _checkAccessAllowed(\\\"setPoolsAssetsDirectTransfer(address[],address[][],bool[][])\\\");\\n _setPoolsAssetsDirectTransfer(comptrollers, assets, values);\\n }\\n\\n /// @dev Get the Amount of the asset in the risk fund for the specific pool\\n /// @param comptroller Comptroller address (pool)\\n /// @param asset Asset address\\n /// @return reserves Asset's reserve in risk fund\\n /// @custom:error MarketNotExistInPool When asset does not exist in the pool(comptroller)\\n /// @custom:error ReentrancyGuardError thrown to prevent reentrancy during the function execution\\n function getPoolAssetReserve(address comptroller, address asset) external view returns (uint256 reserves) {\\n if (_reentrancyGuardEntered()) revert ReentrancyGuardError();\\n if (!ensureAssetListed(comptroller, asset)) revert MarketNotExistInPool(comptroller, asset);\\n\\n reserves = poolsAssetsReserves[comptroller][asset];\\n }\\n\\n /// @notice Get the balance for specific token\\n /// @param tokenAddress Address of the token\\n /// @return tokenBalance Reserves of the token the contract has\\n function balanceOf(address tokenAddress) public view override returns (uint256 tokenBalance) {\\n tokenBalance = assetsReserves[tokenAddress];\\n }\\n\\n /// @notice Get the array of all pools addresses\\n /// @param tokenAddress Address of the token\\n /// @return poolsWithCore Array of the pools addresses in which token is available\\n function getPools(address tokenAddress) public view returns (address[] memory poolsWithCore) {\\n poolsWithCore = IPoolRegistry(poolRegistry).getPoolsSupportedByAsset(tokenAddress);\\n\\n if (isAssetListedInCore(tokenAddress)) {\\n uint256 poolsLength = poolsWithCore.length;\\n address[] memory extendedPools = new address[](poolsLength + 1);\\n\\n for (uint256 i; i < poolsLength; ) {\\n extendedPools[i] = poolsWithCore[i];\\n unchecked {\\n ++i;\\n }\\n }\\n\\n extendedPools[poolsLength] = CORE_POOL_COMPTROLLER;\\n poolsWithCore = extendedPools;\\n }\\n }\\n\\n /// @dev This hook is used to update the state for asset reserves before transferring tokenOut to user\\n /// @param tokenOutAddress Address of the asset to be transferred to the user\\n /// @param amountOut Amount of tokenAddressOut transferred from this converter\\n function _preTransferHook(address tokenOutAddress, uint256 amountOut) internal override {\\n assetsReserves[tokenOutAddress] -= amountOut;\\n }\\n\\n /// @notice Hook to perform after converting tokens\\n /// @dev After transformation poolsAssetsReserves are settled by pool's reserves fraction\\n /// @param tokenInAddress Address of the tokenIn\\n /// @param tokenOutAddress Address of the tokenOut\\n /// @param amountIn Amount of tokenIn transferred\\n /// @param amountOut Amount of tokenOut transferred\\n /// @custom:event AssetTransferredToDestination emits on success for each pool which has share\\n function _postConversionHook(\\n address tokenInAddress,\\n address tokenOutAddress,\\n uint256 amountIn,\\n uint256 amountOut\\n ) internal override {\\n address[] memory pools = getPools(tokenOutAddress);\\n uint256 assetReserve = assetsReserves[tokenOutAddress] + amountOut;\\n ensureNonzeroValue(assetReserve);\\n\\n uint256 poolsLength = pools.length;\\n uint256 distributedOutShare;\\n uint256 poolAmountInShare;\\n uint256 distributedInShare;\\n\\n for (uint256 i; i < poolsLength; ) {\\n uint256 currentPoolsAssetsReserves = poolsAssetsReserves[pools[i]][tokenOutAddress];\\n if (currentPoolsAssetsReserves != 0) {\\n if (i < (poolsLength - 1)) {\\n distributedOutShare += updatePoolAssetsReserve(pools[i], tokenOutAddress, amountOut, assetReserve);\\n poolAmountInShare = (amountIn * currentPoolsAssetsReserves) / assetReserve;\\n distributedInShare += poolAmountInShare;\\n } else {\\n uint256 distributedDiff = amountOut - distributedOutShare;\\n poolsAssetsReserves[pools[i]][tokenOutAddress] -= distributedDiff;\\n emit AssetsReservesUpdated(pools[i], tokenOutAddress, distributedDiff);\\n poolAmountInShare = amountIn - distributedInShare;\\n }\\n emit AssetTransferredToDestination(destinationAddress, pools[i], tokenInAddress, poolAmountInShare);\\n IRiskFund(destinationAddress).updatePoolState(pools[i], tokenInAddress, poolAmountInShare);\\n }\\n unchecked {\\n ++i;\\n }\\n }\\n }\\n\\n /// @dev Operations to perform before sweeping tokens\\n /// @param tokenAddress Address of the token\\n /// @param amount Amount transferred to address(to)\\n /// @custom:error InsufficientBalance is thrown when amount entered is greater than balance of token\\n function preSweepToken(address tokenAddress, uint256 amount) internal override {\\n uint256 balance = IERC20Upgradeable(tokenAddress).balanceOf(address(this));\\n if (amount > balance) revert InsufficientBalance();\\n uint256 balanceDiff = balance - assetsReserves[tokenAddress];\\n\\n if (balanceDiff < amount) {\\n uint256 amountDiff;\\n unchecked {\\n amountDiff = amount - balanceDiff;\\n }\\n\\n address[] memory pools = getPools(tokenAddress);\\n uint256 assetReserve = assetsReserves[tokenAddress];\\n uint256 poolsLength = pools.length;\\n uint256 distributedShare;\\n\\n for (uint256 i; i < poolsLength; ) {\\n if (poolsAssetsReserves[pools[i]][tokenAddress] != 0) {\\n if (i < (poolsLength - 1)) {\\n distributedShare += updatePoolAssetsReserve(pools[i], tokenAddress, amountDiff, assetReserve);\\n } else {\\n uint256 distributedDiff = amountDiff - distributedShare;\\n poolsAssetsReserves[pools[i]][tokenAddress] -= distributedDiff;\\n emit AssetsReservesUpdated(pools[i], tokenAddress, distributedDiff);\\n }\\n }\\n unchecked {\\n ++i;\\n }\\n }\\n assetsReserves[tokenAddress] -= amountDiff;\\n }\\n }\\n\\n /// @dev Update the poolAssetsReserves upon transferring the tokens\\n /// @param pool Address of the pool\\n /// @param tokenAddress Address of the token\\n /// @param amount Amount transferred to address(to)\\n /// @param assetReserve Asset's reserve for the pool\\n /// @return poolAmountShare Share of the pool as per it's reserve in compare to total reserves for the asset\\n /// @custom:event AssetsReservesUpdated emits on success\\n function updatePoolAssetsReserve(\\n address pool,\\n address tokenAddress,\\n uint256 amount,\\n uint256 assetReserve\\n ) internal returns (uint256 poolAmountShare) {\\n poolAmountShare = (poolsAssetsReserves[pool][tokenAddress] * amount) / assetReserve;\\n poolsAssetsReserves[pool][tokenAddress] -= poolAmountShare;\\n emit AssetsReservesUpdated(pool, tokenAddress, poolAmountShare);\\n }\\n\\n /// @dev Update the poolsAssetsDirectTransfer mapping\\n /// @param comptrollers Addresses of the pools\\n /// @param assets Addresses of the assets need to be added for direct transfer\\n /// @param values Boolean value to indicate whether direct transfer is allowed for each asset.\\n /// @custom:event PoolAssetsDirectTransferUpdated emits on success\\n /// @custom:error InvalidArguments thrown when comptrollers array length is not equal to assets array length\\n function _setPoolsAssetsDirectTransfer(\\n address[] calldata comptrollers,\\n address[][] calldata assets,\\n bool[][] calldata values\\n ) internal {\\n uint256 comptrollersLength = comptrollers.length;\\n\\n if ((comptrollersLength != assets.length) || (comptrollersLength != values.length)) {\\n revert InvalidArguments();\\n }\\n\\n for (uint256 i; i < comptrollersLength; ) {\\n address[] memory poolAssets = assets[i];\\n bool[] memory assetsValues = values[i];\\n uint256 poolAssetsLength = poolAssets.length;\\n\\n if (poolAssetsLength != assetsValues.length) {\\n revert InvalidArguments();\\n }\\n\\n for (uint256 j; j < poolAssetsLength; ) {\\n poolsAssetsDirectTransfer[comptrollers[i]][poolAssets[j]] = assetsValues[j];\\n emit PoolAssetsDirectTransferUpdated(comptrollers[i], poolAssets[j], assetsValues[j]);\\n unchecked {\\n ++j;\\n }\\n }\\n\\n unchecked {\\n ++i;\\n }\\n }\\n }\\n\\n /// @dev Update the reserve of the asset for the specific pool after transferring to risk fund\\n /// and transferring funds to the protocol share reserve\\n /// @param comptroller Comptroller address (pool)\\n /// @param asset Asset address\\n /// @return balanceDifference Amount of asset, for _privateConversion\\n /// @custom:event AssetTransferredToDestination emits when poolsAssetsDirectTransfer is enabled for entered comptroller and asset\\n /// @custom:error MarketNotExistInPool When asset does not exist in the pool(comptroller)\\n function _updateAssetsState(address comptroller, address asset)\\n internal\\n override\\n returns (uint256 balanceDifference)\\n {\\n if (!ensureAssetListed(comptroller, asset)) revert MarketNotExistInPool(comptroller, asset);\\n\\n IERC20Upgradeable token = IERC20Upgradeable(asset);\\n uint256 currentBalance = token.balanceOf(address(this));\\n uint256 assetReserve = assetsReserves[asset];\\n if (currentBalance > assetReserve) {\\n unchecked {\\n balanceDifference = currentBalance - assetReserve;\\n }\\n if (poolsAssetsDirectTransfer[comptroller][asset]) {\\n uint256 previousDestinationBalance = token.balanceOf(destinationAddress);\\n token.safeTransfer(destinationAddress, balanceDifference);\\n uint256 newDestinationBalance = token.balanceOf(destinationAddress);\\n\\n emit AssetTransferredToDestination(destinationAddress, comptroller, asset, balanceDifference);\\n IRiskFund(destinationAddress).updatePoolState(\\n comptroller,\\n asset,\\n newDestinationBalance - previousDestinationBalance\\n );\\n balanceDifference = 0;\\n }\\n }\\n }\\n\\n /// @dev This hook is used to update states for the converter after the privateConversion\\n /// @param comptroller Comptroller address (pool)\\n /// @param tokenAddressIn Address of the destination's base asset\\n /// @param convertedTokenInBalance Amount of the base asset received after the conversion\\n /// @param tokenAddressOut Address of the asset transferred to other converter in exchange of base asset\\n /// @param convertedTokenOutBalance Amount of tokenAddressOut transferred from this converter\\n function _postPrivateConversionHook(\\n address comptroller,\\n address tokenAddressIn,\\n uint256 convertedTokenInBalance,\\n address tokenAddressOut,\\n uint256 convertedTokenOutBalance\\n ) internal override {\\n if (convertedTokenInBalance > 0) {\\n emit AssetTransferredToDestination(\\n destinationAddress,\\n comptroller,\\n tokenAddressIn,\\n convertedTokenInBalance\\n );\\n IRiskFund(destinationAddress).updatePoolState(comptroller, tokenAddressIn, convertedTokenInBalance);\\n }\\n if (convertedTokenOutBalance > 0) {\\n assetsReserves[tokenAddressOut] += convertedTokenOutBalance;\\n poolsAssetsReserves[comptroller][tokenAddressOut] += convertedTokenOutBalance;\\n emit AssetsReservesUpdated(comptroller, tokenAddressOut, convertedTokenOutBalance);\\n }\\n }\\n\\n /// @dev This function checks for the given asset is listed in core pool or not\\n /// @param tokenAddress Address of the asset\\n /// @return isAssetListed true if the asset is listed\\n function isAssetListedInCore(address tokenAddress) internal view returns (bool isAssetListed) {\\n address[] memory coreMarkets = IComptroller(CORE_POOL_COMPTROLLER).getAllMarkets();\\n\\n uint256 coreMarketsLength = coreMarkets.length;\\n for (uint256 i; i < coreMarketsLength; ) {\\n isAssetListed = (VBNB == coreMarkets[i])\\n ? (tokenAddress == NATIVE_WRAPPED)\\n : (IVToken(coreMarkets[i]).underlying() == tokenAddress);\\n\\n if (isAssetListed) {\\n break;\\n }\\n\\n unchecked {\\n ++i;\\n }\\n }\\n }\\n\\n /// @dev This function checks for the given asset is listed or not\\n /// @param comptroller Address of the comptroller\\n /// @param asset Address of the asset\\n /// @return isListed true if the asset is listed\\n function ensureAssetListed(address comptroller, address asset) internal view returns (bool isListed) {\\n if (comptroller == CORE_POOL_COMPTROLLER) {\\n isListed = isAssetListedInCore(asset);\\n } else {\\n isListed = IPoolRegistry(poolRegistry).getVTokenForAsset(comptroller, asset) != address(0);\\n }\\n }\\n\\n /// @dev Get base asset address of the RiskFund\\n /// @return destinationBaseAsset Address of the base asset(RiskFund)\\n function _getDestinationBaseAsset() internal view override returns (address destinationBaseAsset) {\\n destinationBaseAsset = IRiskFundGetters(destinationAddress).convertibleBaseAsset();\\n }\\n}\\n\",\"keccak256\":\"0xa9fda55440f25049f1946980b801723cf2111584253a1c11ac1bb7d773cbe39e\",\"license\":\"BSD-3-Clause\"}},\"version\":1}", + "bytecode": "0x60e06040523480156200001157600080fd5b5060405162005aba38038062005aba83398101604081905262000034916200018a565b6200003f8362000081565b6200004a8262000081565b620000558162000081565b6001600160a01b0380841660805282811660a052811660c05262000078620000ac565b505050620001d4565b6001600160a01b038116620000a9576040516342bcdf7f60e11b815260040160405180910390fd5b50565b600054610100900460ff1615620001195760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff908116146200016b576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b80516001600160a01b03811681146200018557600080fd5b919050565b600080600060608486031215620001a057600080fd5b620001ab846200016d565b9250620001bb602085016200016d565b9150620001cb604085016200016d565b90509250925092565b60805160a05160c05161589362000227600039600081816103e20152612d3b0152600081816103bb0152612c780152600081816106c501528181610d7a01528181612bbf015261349801526158936000f3fe608060405234801561001057600080fd5b50600436106102e95760003560e01c806370a0823111610191578063b6828c57116100e3578063e30c397811610097578063f2fde38b11610071578063f2fde38b146106ad578063fa7b81a0146106c0578063fe3da984146106e757600080fd5b8063e30c397814610676578063f04c318714610687578063f0dc7e9d1461069a57600080fd5b8063c0654646116100c8578063c065464614610641578063ca32546914610654578063e2ff7ea21461066757600080fd5b8063b6828c5714610626578063bc368b041461063957600080fd5b80638da5cb5b11610145578063afcff50f1161011f578063afcff50f146105be578063b491ddf7146105d2578063b4a0bdf31461061557600080fd5b80638da5cb5b1461058757806390fa7b5414610598578063aac59a75146105ab57600080fd5b8063746460a911610176578063746460a91461055957806379ba50971461056c5780637b77cd6a1461057457600080fd5b806370a0823114610527578063715018a61461055157600080fd5b806352e21a181161024a5780635c39f467116101fe5780636daa463b116101d85780636daa463b146104e05780636f1a30a8146104f35780636fb052751461050657600080fd5b80635c39f4671461049a5780635e1e6325146104ba57806364aff9ec146104cd57600080fd5b8063553745221161022f578063553745221461046c578063556bbd8a1461047f57806358b904df1461049257600080fd5b806352e21a1814610446578063530e784f1461045957600080fd5b80632630c12f116102a1578063362b679511610286578063362b6795146103dd578063439727a514610404578063454900fe1461041757600080fd5b80632630c12f146103a35780633421fc52146103b657600080fd5b80630a0a05e6116102d25780630a0a05e6146103535780630a9a2b72146103685780630e32cb861461039057600080fd5b806301e20178146102ee57806307aa239e1461031e575b600080fd5b60ff54610301906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b60fe546103439074010000000000000000000000000000000000000000900460ff1681565b6040519015158152602001610315565b610366610361366004614de4565b6106f0565b005b61037b610376366004614e01565b610704565b60408051928352602083019190915201610315565b61036661039e366004614de4565b6107bf565b60fc54610301906001600160a01b031681565b6103017f000000000000000000000000000000000000000000000000000000000000000081565b6103017f000000000000000000000000000000000000000000000000000000000000000081565b61037b610412366004614e43565b6107d0565b610343610425366004614ea2565b61013060209081526000928352604080842090915290825290205460ff1681565b610366610454366004614de4565b61091a565b610366610467366004614de4565b61092b565b61036661047a366004614f27565b61093c565b61036661048d366004614fc1565b610973565b610366610b4a565b6104ad6104a8366004614de4565b610c30565b60405161031591906150ae565b61037b6104c8366004614e01565b610dcc565b6103666104db3660046150fb565b610eca565b61037b6104ee366004614e01565b610f71565b61037b610501366004614e01565b61107a565b610519610514366004614ea2565b611179565b604051908152602001610315565b610519610535366004614de4565b6001600160a01b0316600090815261012d602052604090205490565b61036661123e565b61036661056736600461513c565b611252565b610366611299565b610366610582366004614de4565b611324565b6033546001600160a01b0316610301565b61037b6105a6366004614e43565b6113ab565b6103666105b9366004614ea2565b6114a1565b61012f54610301906001600160a01b031681565b6106076105e0366004614ea2565b60fd6020908152600092835260408084209091529082529020805460019091015460ff1682565b6040516103159291906151bf565b6097546001600160a01b0316610301565b61037b610634366004614e43565b6114d7565b6103666115cd565b61036661064f3660046151d3565b61167f565b60fe54610301906001600160a01b031681565b6105196706f05b59d3b2000081565b6065546001600160a01b0316610301565b61037b610695366004614e43565b61171d565b6103666106a8366004615283565b61184c565b6103666106bb366004614de4565b611bf5565b6103017f000000000000000000000000000000000000000000000000000000000000000081565b61051960fb5481565b6106f8611c7e565b61070181611cd8565b50565b60008060026001600160a01b03808616600090815260fd602090815260408083209388168352929052206001015460ff16600381111561074657610746615155565b0361077d576040517f03410cd100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038316600090815261012d6020526040902054858110156107a3578095505b8592506107b1868686611d55565b508092505050935093915050565b6107c7611c7e565b610701816120ac565b6000808285856107de6121a1565b6107e7836121f6565b816001600160a01b0316836001600160a01b031614806108185750806001600160a01b0316836001600160a01b0316145b1561084f576040517f8aa3a72f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610857612236565b6108648a8a8a8a8a61228f565b90955093508985146108a2576040517fc214279600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6108ae8888878761230f565b604080516001600160a01b038a81168252602082018890529181018690528189169188169033907f795a235be939acb902ac69562805f86e1341a9b019c351b996e2aa2dfc34c67c906060015b60405180910390a461090d600160c955565b5050509550959350505050565b610922611c7e565b6107018161268a565b610933611c7e565b61070181612707565b61095d6040518060600160405280603c8152602001615822603c9139612784565b61096b868686868686612850565b505050505050565b600054610100900460ff16158080156109935750600054600160ff909116105b806109ad5750303b1580156109ad575060005460ff166001145b610a245760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084015b60405180910390fd5b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558015610a8257600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b610a8e8c8c8c8b612b21565b610a97896121f6565b61012f80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b038b16179055610ad9878787878787612850565b8015610b3c57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050505050505050565b610b886040518060400160405280601281526020017f726573756d65436f6e76657273696f6e28290000000000000000000000000000815250612784565b60fe5474010000000000000000000000000000000000000000900460ff16610bdb576040517e6d8dbb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fe80547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16905560405133907f89b79206f08dadd78502cff5075d2b094fa0abea0b063cfafe4475e2a380c51f90600090a2565b61012f546040517ff36dba380000000000000000000000000000000000000000000000000000000081526001600160a01b038381166004830152606092169063f36dba3890602401600060405180830381865afa158015610c95573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610cbd91908101906153ec565b9050610cc882612bba565b15610dc75780516000610cdc826001615450565b67ffffffffffffffff811115610cf457610cf46152f4565b604051908082528060200260200182016040528015610d1d578160200160208202803683370190505b50905060005b82811015610d7757838181518110610d3d57610d3d615468565b6020026020010151828281518110610d5757610d57615468565b6001600160a01b0390921660209283029190910190910152600101610d23565b507f0000000000000000000000000000000000000000000000000000000000000000818381518110610dab57610dab615468565b6001600160a01b03909216602092830291909101909101529150505b919050565b60008060026001600160a01b03808616600090815260fd602090815260408083209388168352929052206001015460ff166003811115610e0e57610e0e615155565b03610e45576040517f03410cd100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8491506000610e55868686612d86565b90925090506000610e7c856001600160a01b0316600090815261012d602052604090205490565b905082811015610ec05781600181610e9c670de0b6b3a764000085615497565b610ea69190615450565b610eb091906154d4565b610eba91906154eb565b93508092505b5050935093915050565b610ed2611c7e565b610eda612236565b610ee3836121f6565b610eec826121f6565b610ef5816130a7565b82610f0081836130e1565b610f146001600160a01b03821684846133eb565b826001600160a01b0316846001600160a01b03167f6d25be279134f4ecaa4770aff0c3d916d9e7c5ef37b65ed95dbdba411f5d54d584604051610f5991815260200190565b60405180910390a350610f6c600160c955565b505050565b60fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038481166004830152600092839291169063b62cad6990602401600060405180830381600087803b158015610fd557600080fd5b505af1158015610fe9573d6000803e3d6000fd5b505060fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038781166004830152909116925063b62cad699150602401600060405180830381600087803b15801561104d57600080fd5b505af1158015611061573d6000803e3d6000fd5b50505050611070858585612d86565b5094959350505050565b60fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038481166004830152600092839291169063b62cad6990602401600060405180830381600087803b1580156110de57600080fd5b505af11580156110f2573d6000803e3d6000fd5b505060fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038781166004830152909116925063b62cad699150602401600060405180830381600087803b15801561115657600080fd5b505af115801561116a573d6000803e3d6000fd5b50505050611070858585611d55565b600061118760c95460021490565b156111be576040517f9a050fe700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6111c88383613494565b611211576040517f983f1fb50000000000000000000000000000000000000000000000000000000081526001600160a01b03808516600483015283166024820152604401610a1b565b506001600160a01b03918216600090815261012e6020908152604080832093909416825291909152205490565b611246611c7e565b6112506000613584565b565b6112906040518060400160405280601e81526020017f7365744d696e416d6f756e74546f436f6e766572742875696e74323536290000815250612784565b610701816135b5565b60655433906001600160a01b0316811461131b5760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f74207468652060448201527f6e6577206f776e657200000000000000000000000000000000000000000000006064820152608401610a1b565b61070181613584565b61132c611c7e565b611335816121f6565b61012f546040516001600160a01b038084169216907fa87b964d321035d2165e484ff4b722dd6eae30606c0b98887d2ed1a34e594bfe90600090a361012f80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6000808285856113b96121a1565b6113c2836121f6565b816001600160a01b0316836001600160a01b031614806113f35750806001600160a01b0316836001600160a01b0316145b1561142a576040517f8aa3a72f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611432612236565b61143f8a8a8a8a8a61228f565b90955093506114508888878761230f565b604080516001600160a01b038a81168252602082018890529181018690528189169188169033907f93b7ba2a2b0e36320375853d7466af5685c07567804b871b4fdfd31e3bb77154906060016108fb565b6114a9612236565b60006114b583836135ff565b905080156114c8576114c883838361395c565b506114d3600160c955565b5050565b6000808285856114e56121a1565b6114ee836121f6565b816001600160a01b0316836001600160a01b0316148061151f5750806001600160a01b0316836001600160a01b0316145b15611556576040517f8aa3a72f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61155e612236565b61156b8a8a8a8a8a613df8565b909550935061157c8888878761230f565b604080516001600160a01b038a81168252602082018890529181018690528189169188169033907f9b7dc1d7d2974d015b4fc39889a09f3a3923add808f5863158f3162d997d4e82906060016108fb565b61160b6040518060400160405280601181526020017f7061757365436f6e76657273696f6e2829000000000000000000000000000000815250612784565b6116136121a1565b60fe80547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000017905560405133907f490bc639fd0d96f19c8adf77bc98d17fbefdee2e1e1864d21f041360d0ee065a90600090a2565b828181146116b9576040517f4d5590f300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b818110156117145761170c878787848181106116da576116da615468565b90506020020160208101906116ef9190614de4565b86868581811061170157611701615468565b90506040020161184c565b6001016116bc565b50505050505050565b60008082858561172b6121a1565b611734836121f6565b816001600160a01b0316836001600160a01b031614806117655750806001600160a01b0316836001600160a01b0316145b1561179c576040517f8aa3a72f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6117a4612236565b6117b18a8a8a8a8a613e8a565b90955093508884146117ef576040517fa8dc653c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6117fb8888878761230f565b604080516001600160a01b038a81168252602082018890529181018690528189169188169033907fcb4ea7de8d069b0f443b792cba6c6df5096508951bbc75c04ac42c9251efe076906060016108fb565b61186d6040518060600160405280603581526020016157ed60359139612784565b611876836121f6565b61187f826121f6565b6706f05b59d3b20000813511156118d3576040517f9770caee000000000000000000000000000000000000000000000000000000008152813560048201526706f05b59d3b200006024820152604401610a1b565b816001600160a01b0316836001600160a01b0316148061190c57506118f6613f47565b6001600160a01b0316836001600160a01b031614155b80611954575060006001600160a01b03808416600090815260fd602090815260408083209388168352929052206001015460ff16600381111561195157611951615155565b14155b1561198b576040517feebb5ac600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600261199d6040830160208401615526565b60038111156119ae576119ae615155565b1480156119bb5750803515155b156119f2576040517fd0d4aabe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002611a046040830160208401615526565b6003811115611a1557611a15615155565b1480611a4157506001611a2e6040830160208401615526565b6003811115611a3f57611a3f615155565b145b8015611a56575060ff546001600160a01b0316155b15611a8d576040517fe7c2c99400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03808416600081815260fd602090815260408083209487168084529482529182902080546001820154919594937f39fbfdd5da133303ed31b1b65e30a0ddf7a9236573368c66c859dceccc1dd12a93919288359260ff90911691611afd91908a01908a01615526565b604051611b0d9493929190615547565b60405180910390a36000611b276040840160208501615526565b6003811115611b3857611b38615155565b03611b95576001600160a01b03808516600090815260fd60209081526040808320938716835292905290812090815560010180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055611bef565b81358155611ba96040830160208401615526565b6001808301805490917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0090911690836003811115611be957611be9615155565b02179055505b50505050565b611bfd611c7e565b606580546001600160a01b0383167fffffffffffffffffffffffff00000000000000000000000000000000000000009091168117909155611c466033546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b6033546001600160a01b031633146112505760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a1b565b611ce1816121f6565b60fe546040516001600160a01b038084169216907f9be3097b5c8b276786be52a244ee90d66efd34805d9eb16f168fb2b4aaae9a2b90600090a360fe80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b60008084600003611d92576040517f42301c2300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03808516600090815260fd6020908152604080832093871683529281528282208351808501909452805484526001810154929392909183019060ff166003811115611de657611de6615155565b6003811115611df757611df7615155565b9052509050600081602001516003811115611e1457611e14615155565b03611e4b576040517f618ce59700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b03878116600483015260009216906341976e0990602401602060405180830381865afa158015611eaf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ed39190615578565b60fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b038881166004830152929350600092909116906341976e0990602401602060405180830381865afa158015611f3c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f609190615578565b835160ff54919250906000906001600160a01b031615801590612003575060ff546040517f6c059fb10000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b0390911690636c059fb190602401602060405180830381865afa158015611fdf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120039190615591565b9050801561201057600091505b600061202483670de0b6b3a7640000615450565b9050836120318287615497565b61203b91906154eb565b965081156120675786612056670de0b6b3a76400008d615497565b61206091906154eb565b975061209e565b8660018161207d670de0b6b3a76400008f615497565b6120879190615450565b61209191906154d4565b61209b91906154eb565b97505b505050505050935093915050565b6001600160a01b0381166121285760405162461bcd60e51b815260206004820152602560248201527f696e76616c696420616365737320636f6e74726f6c206d616e6167657220616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610a1b565b609780546001600160a01b038381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa0910160405180910390a15050565b60fe5474010000000000000000000000000000000000000000900460ff1615611250576040517f952bcf7f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038116610701576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600260c954036122885760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610a1b565b600260c955565b60008061229c8585613fd3565b6122a685886140f3565b91506122b3828686610f71565b915050858110156122fa576040517f228f8c110000000000000000000000000000000000000000000000000000000081526004810182905260248101879052604401610a1b565b61230584848361423e565b9550959350505050565b600061231a84610c30565b6001600160a01b038516600090815261012d602052604081205491925090612343908490615450565b905061234e816130a7565b815160008080805b8481101561267657600061012e600089848151811061237757612377615468565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060008c6001600160a01b03166001600160a01b031681526020019081526020016000205490508060001461266d576123d86001876154d4565b821015612438576124048883815181106123f4576123f4615468565b60200260200101518c8b8a6142b8565b61240e9086615450565b94508661241b828c615497565b61242591906154eb565b93506124318484615450565b9250612533565b6000612444868b6154d4565b90508061012e60008b868151811061245e5761245e615468565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060008e6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546124b891906154d4565b925050819055508b6001600160a01b03168984815181106124db576124db615468565b60200260200101516001600160a01b03167fc39e3e80c0219fde334a8cb5d8468b628482e23388b6e809c90cb00c63c8ce388360405161251d91815260200190565b60405180910390a361252f848c6154d4565b9450505b8b6001600160a01b031688838151811061254f5761254f615468565b60200260200101516001600160a01b031660fe60009054906101000a90046001600160a01b03166001600160a01b03167fadc20ad416881f76b4304665c35f5be8592297bcdfe4f0bb087b9d254222af55876040516125b091815260200190565b60405180910390a460fe5488516001600160a01b03909116906353ac3537908a90859081106125e1576125e1615468565b60209081029190910101516040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b1681526001600160a01b039182166004820152908f16602482015260448101879052606401600060405180830381600087803b15801561265457600080fd5b505af1158015612668573d6000803e3d6000fd5b505050505b50600101612356565b5050505050505050505050565b600160c955565b612693816121f6565b60ff546040516001600160a01b038084169216907f50f1a16bf24734355b14ff800d132cc0a934808b8621d5623b41bc67f204881790600090a360ff80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b612710816121f6565b60fc546040516001600160a01b038084169216907f56b5f80d8cac1479698aa7d01605fd6111e90b15fc4d2b377417f46034876cbd90600090a360fc80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6097546040517f18c5e8ab0000000000000000000000000000000000000000000000000000000081526000916001600160a01b0316906318c5e8ab906127d0903390869060040161560b565b602060405180830381865afa1580156127ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128119190615591565b9050806114d3573330836040517f4a3fa293000000000000000000000000000000000000000000000000000000008152600401610a1b9392919061562d565b8483811415806128605750808214155b15612897576040517f5f6f132c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b81811015612b175760008686838181106128b6576128b6615468565b90506020028101906128c89190615659565b80806020026020016040519081016040528093929190818152602001838360200280828437600092018290525093945088925087915085905081811061291057612910615468565b90506020028101906129229190615659565b80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250508451835193945092831491506129959050576040517f5f6f132c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b81811015612b08578281815181106129b2576129b2615468565b602002602001015161013060008e8e898181106129d1576129d1615468565b90506020020160208101906129e69190614de4565b6001600160a01b03166001600160a01b031681526020019081526020016000206000868481518110612a1a57612a1a615468565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff021916908315150217905550838181518110612a6b57612a6b615468565b60200260200101516001600160a01b03168c8c87818110612a8e57612a8e615468565b9050602002016020810190612aa39190614de4565b6001600160a01b03167f6333c55c3657aafc9b39e2586076d198ed0250804559126489c852f28d51280c858481518110612adf57612adf615468565b6020026020010151604051612af8911515815260200190565b60405180910390a3600101612998565b5083600101935050505061289a565b5050505050505050565b600054610100900460ff16612b9e5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a1b565b612ba784614391565b612baf61441f565b611bef8383836144a4565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b0772d0b6040518163ffffffff1660e01b8152600401600060405180830381865afa158015612c1b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612c4391908101906153ec565b805190915060005b81811015612d7e57828181518110612c6557612c65615468565b60200260200101516001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031614612d3957846001600160a01b0316838281518110612cc157612cc1615468565b60200260200101516001600160a01b0316636f307dc36040518163ffffffff1660e01b8152600401602060405180830381865afa158015612d06573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d2a91906156c1565b6001600160a01b031614612d6f565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316856001600160a01b0316145b935083612d7e57600101612c4b565b505050919050565b60008084600003612dc3576040517f098fb56100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03808516600090815260fd6020908152604080832093871683529281528282208351808501909452805484526001810154929392909183019060ff166003811115612e1757612e17615155565b6003811115612e2857612e28615155565b9052509050600081602001516003811115612e4557612e45615155565b03612e7c576040517f618ce59700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b03878116600483015260009216906341976e0990602401602060405180830381865afa158015612ee0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f049190615578565b60fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b038881166004830152929350600092909116906341976e0990602401602060405180830381865afa158015612f6d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f919190615578565b835160ff54919250906001600160a01b031615801590613031575060ff546040517f6c059fb10000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b0390911690636c059fb190602401602060405180830381865afa15801561300d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130319190615591565b1561303a575060005b600061304e82670de0b6b3a7640000615450565b9050613062670de0b6b3a764000084615497565b8161306d868d615497565b6130779190615497565b61308191906154eb565b96508261308e8286615497565b61309891906154eb565b95505050505050935093915050565b80600003610701576040517f9cf8540c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000906001600160a01b038416906370a0823190602401602060405180830381865afa158015613141573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131659190615578565b9050808211156131a1576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038316600090815261012d60205260408120546131c590836154d4565b905082811015611bef5780830360006131dd86610c30565b6001600160a01b038716600090815261012d602052604081205482519293509190805b828110156133b15761012e600086838151811061321f5761321f615468565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060008b6001600160a01b03166001600160a01b03168152602001908152602001600020546000146133a95761327d6001846154d4565b8110156132ba576132a985828151811061329957613299615468565b60200260200101518b88876142b8565b6132b39083615450565b91506133a9565b60006132c683886154d4565b90508061012e60008885815181106132e0576132e0615468565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060008d6001600160a01b03166001600160a01b03168152602001908152602001600020600082825461333a91906154d4565b925050819055508a6001600160a01b031686838151811061335d5761335d615468565b60200260200101516001600160a01b03167fc39e3e80c0219fde334a8cb5d8468b628482e23388b6e809c90cb00c63c8ce388360405161339f91815260200190565b60405180910390a3505b600101613200565b506001600160a01b038916600090815261012d6020526040812080548792906133db9084906154d4565b9091555050505050505050505050565b6040516001600160a01b038316602482015260448101829052610f6c9084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152614569565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b0316036134df576134d882612bba565b905061357e565b61012f546040517f266e0a7f0000000000000000000000000000000000000000000000000000000081526001600160a01b0385811660048301528481166024830152600092169063266e0a7f90604401602060405180830381865afa15801561354c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061357091906156c1565b6001600160a01b0316141590505b92915050565b606580547fffffffffffffffffffffffff000000000000000000000000000000000000000016905561070181614651565b6135be816130a7565b60fb5460408051918252602082018390527fada67d0d38fa20c8ae6a5c17cb9d60b0fe7f2d4e4f27ac9ee55e54ac88de9d8d910160405180910390a160fb55565b600061360b8383613494565b613654576040517f983f1fb50000000000000000000000000000000000000000000000000000000081526001600160a01b03808516600483015283166024820152604401610a1b565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015282906000906001600160a01b038316906370a0823190602401602060405180830381865afa1580156136b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136da9190615578565b6001600160a01b038516600090815261012d602052604090205490915080821115613953576001600160a01b0380871660009081526101306020908152604080832093891683529290522054818303945060ff16156139535760fe546040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0391821660048201526000918516906370a0823190602401602060405180830381865afa158015613798573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137bc9190615578565b60fe549091506137d9906001600160a01b038681169116876133eb565b60fe546040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0391821660048201526000918616906370a0823190602401602060405180830381865afa15801561383e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906138629190615578565b60fe546040518881529192506001600160a01b03898116928b82169291909116907fadc20ad416881f76b4304665c35f5be8592297bcdfe4f0bb087b9d254222af559060200160405180910390a460fe546001600160a01b03166353ac353789896138cd86866154d4565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b1681526001600160a01b0393841660048201529290911660248301526044820152606401600060405180830381600087803b15801561393457600080fd5b505af1158015613948573d6000803e3d6000fd5b505050506000955050505b50505092915050565b6000613966613f47565b60fe5460ff549192506001600160a01b03908116916000911615613deb5760ff546040517f4e9f8f390000000000000000000000000000000000000000000000000000000081526001600160a01b03878116600483015285811660248301526000928392911690634e9f8f39906044016000604051808303816000875af11580156139f5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052613a1d91908101906156de565b8151919350915060005b81811015613de657828181518110613a4157613a41615468565b602002602001015160000315613de6576000848281518110613a6557613a65615468565b60200260200101516001600160a01b0316636f1a30a8858481518110613a8d57613a8d615468565b60200260200101518c8b6040518463ffffffff1660e01b8152600401613acf939291909283526001600160a01b03918216602084015216604082015260600190565b60408051808303816000875af1158015613aed573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b119190615799565b91505088811115613b1f5750875b613b29818b6146bb565b613b335750613de6565b6040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b038881166004830152600091908a16906370a0823190602401602060405180830381865afa158015613b96573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613bba9190615578565b90508a6001600160a01b031663095ea7b3878581518110613bdd57613bdd615468565b6020026020010151846040518363ffffffff1660e01b8152600401613c179291906001600160a01b03929092168252602082015260400190565b6020604051808303816000875af1158015613c36573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613c5a9190615591565b50858381518110613c6d57613c6d615468565b60209081029190910101516040517f439727a500000000000000000000000000000000000000000000000000000000815260048101849052600060248201526001600160a01b038d811660448301528b811660648301528a811660848301529091169063439727a59060a40160408051808303816000875af1158015613cf7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d1b9190615799565b50506040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b038981166004830152600091908b16906370a0823190602401602060405180830381865afa158015613d80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613da49190615578565b9050613db0838c6154d4565b9a50613dbc82826154d4565b613dc69089615450565b97508a600003613dd857505050613de6565b836001019350505050613a27565b505050505b61096b86848388886147f3565b600080613e058585613fd3565b6000613e1287878761107a565b91505087811115613e59576040517f71b5f0c10000000000000000000000000000000000000000000000000000000081526004810182905260248101899052604401610a1b565b613e6386826140f3565b9250613e70838787610f71565b9250613e7f905085858461423e565b509550959350505050565b600080613e978585613fd3565b6000613ea487878761107a565b915050613eb186826140f3565b9250808314613eec576040517f0c5c1c2000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b87831115613f30576040517f71b5f0c10000000000000000000000000000000000000000000000000000000081526004810182905260248101899052604401610a1b565b613f3b85858961423e565b50909694955050505050565b60fe54604080517fc8ecc0d300000000000000000000000000000000000000000000000000000000815290516000926001600160a01b03169163c8ecc0d39160048083019260209291908290030181865afa158015613faa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613fce91906156c1565b905090565b60ff546000906001600160a01b031615801590614070575060ff546040517f6c059fb10000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b0390911690636c059fb190602401602060405180830381865afa15801561404c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906140709190615591565b9050801580156140bc575060026001600160a01b03808516600090815260fd602090815260408083209387168352929052206001015460ff1660038111156140ba576140ba615155565b145b15610f6c576040517f03410cd100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fe546040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b039182166004820152600091849183918316906370a0823190602401602060405180830381865afa15801561415c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906141809190615578565b60fe5490915061419f906001600160a01b038481169133911687614991565b60fe546040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0391821660048201526000918416906370a0823190602401602060405180830381865afa158015614204573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906142289190615578565b905061423482826154d4565b9695505050505050565b6001600160a01b038316600090815261012d602052604090205481811015614292576040517f6bb2792900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61429c84836149e2565b836142b16001600160a01b03821685856133eb565b5050505050565b6001600160a01b03808516600090815261012e6020908152604080832093871683529290529081205482906142ee908590615497565b6142f891906154eb565b6001600160a01b03808716600090815261012e602090815260408083209389168352929052908120805492935083929091906143359084906154d4565b92505081905550836001600160a01b0316856001600160a01b03167fc39e3e80c0219fde334a8cb5d8468b628482e23388b6e809c90cb00c63c8ce388360405161438191815260200190565b60405180910390a3949350505050565b600054610100900460ff1661440e5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a1b565b614416614a14565b61070181614a99565b600054610100900460ff1661449c5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a1b565b611250614b16565b600054610100900460ff166145215760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a1b565b61452a83612707565b61453382611cd8565b61453c816135b5565b505060fe80547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16905550565b60006145be826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316614b939092919063ffffffff16565b90508051600014806145df5750808060200190518101906145df9190615591565b610f6c5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610a1b565b603380546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038381166004830152600092169063b62cad6990602401600060405180830381600087803b15801561471c57600080fd5b505af1158015614730573d6000803e3d6000fd5b505060fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b03868116600483015260009450670de0b6b3a76400009350879216906341976e0990602401602060405180830381865afa1580156147a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906147c89190615578565b6147d29190615497565b6147dc91906154eb565b905060fb5481106147ec57600191505b5092915050565b82156148ca5760fe546040518481526001600160a01b0386811692888216929116907fadc20ad416881f76b4304665c35f5be8592297bcdfe4f0bb087b9d254222af559060200160405180910390a460fe546040517f53ac35370000000000000000000000000000000000000000000000000000000081526001600160a01b038781166004830152868116602483015260448201869052909116906353ac353790606401600060405180830381600087803b1580156148b157600080fd5b505af11580156148c5573d6000803e3d6000fd5b505050505b80156142b1576001600160a01b038216600090815261012d6020526040812080548392906148f9908490615450565b90915550506001600160a01b03808616600090815261012e6020908152604080832093861683529290529081208054839290614936908490615450565b92505081905550816001600160a01b0316856001600160a01b03167fc39e3e80c0219fde334a8cb5d8468b628482e23388b6e809c90cb00c63c8ce388360405161498291815260200190565b60405180910390a35050505050565b6040516001600160a01b0380851660248301528316604482015260648101829052611bef9085907f23b872dd0000000000000000000000000000000000000000000000000000000090608401613430565b6001600160a01b038216600090815261012d602052604081208054839290614a0b9084906154d4565b90915550505050565b600054610100900460ff16614a915760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a1b565b611250614bac565b600054610100900460ff166107c75760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a1b565b600054610100900460ff166126835760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a1b565b6060614ba28484600085614c32565b90505b9392505050565b600054610100900460ff16614c295760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a1b565b61125033613584565b606082471015614caa5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610a1b565b600080866001600160a01b03168587604051614cc691906157bd565b60006040518083038185875af1925050503d8060008114614d03576040519150601f19603f3d011682016040523d82523d6000602084013e614d08565b606091505b5091509150614d1987838387614d26565b925050505b949350505050565b60608315614d95578251600003614d8e576001600160a01b0385163b614d8e5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610a1b565b5081614d1e565b614d1e8383815115614daa5781518083602001fd5b8060405162461bcd60e51b8152600401610a1b91906157d9565b6001600160a01b038116811461070157600080fd5b8035610dc781614dc4565b600060208284031215614df657600080fd5b8135614ba581614dc4565b600080600060608486031215614e1657600080fd5b833592506020840135614e2881614dc4565b91506040840135614e3881614dc4565b809150509250925092565b600080600080600060a08688031215614e5b57600080fd5b85359450602086013593506040860135614e7481614dc4565b92506060860135614e8481614dc4565b91506080860135614e9481614dc4565b809150509295509295909350565b60008060408385031215614eb557600080fd5b8235614ec081614dc4565b91506020830135614ed081614dc4565b809150509250929050565b60008083601f840112614eed57600080fd5b50813567ffffffffffffffff811115614f0557600080fd5b6020830191508360208260051b8501011115614f2057600080fd5b9250929050565b60008060008060008060608789031215614f4057600080fd5b863567ffffffffffffffff80821115614f5857600080fd5b614f648a838b01614edb565b90985096506020890135915080821115614f7d57600080fd5b614f898a838b01614edb565b90965094506040890135915080821115614fa257600080fd5b50614faf89828a01614edb565b979a9699509497509295939492505050565b60008060008060008060008060008060006101008c8e031215614fe357600080fd5b614fec8c614dd9565b9a50614ffa60208d01614dd9565b995061500860408d01614dd9565b985061501660608d01614dd9565b975060808c0135965067ffffffffffffffff8060a08e0135111561503957600080fd5b6150498e60a08f01358f01614edb565b909750955060c08d013581101561505f57600080fd5b61506f8e60c08f01358f01614edb565b909550935060e08d013581101561508557600080fd5b506150968d60e08e01358e01614edb565b81935080925050509295989b509295989b9093969950565b6020808252825182820181905260009190848201906040850190845b818110156150ef5783516001600160a01b0316835292840192918401916001016150ca565b50909695505050505050565b60008060006060848603121561511057600080fd5b833561511b81614dc4565b9250602084013561512b81614dc4565b929592945050506040919091013590565b60006020828403121561514e57600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600481106151bb577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b9052565b82815260408101614ba56020830184615184565b6000806000806000606086880312156151eb57600080fd5b85356151f681614dc4565b9450602086013567ffffffffffffffff8082111561521357600080fd5b61521f89838a01614edb565b9096509450604088013591508082111561523857600080fd5b818801915088601f83011261524c57600080fd5b81358181111561525b57600080fd5b8960208260061b850101111561527057600080fd5b9699959850939650602001949392505050565b6000806000838503608081121561529957600080fd5b84356152a481614dc4565b935060208501356152b481614dc4565b925060407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0820112156152e657600080fd5b506040840190509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561534c5761534c6152f4565b604052919050565b600067ffffffffffffffff82111561536e5761536e6152f4565b5060051b60200190565b600082601f83011261538957600080fd5b8151602061539e61539983615354565b615323565b82815260059290921b840181019181810190868411156153bd57600080fd5b8286015b848110156153e15780516153d481614dc4565b83529183019183016153c1565b509695505050505050565b6000602082840312156153fe57600080fd5b815167ffffffffffffffff81111561541557600080fd5b614d1e84828501615378565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000821982111561546357615463615421565b500190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156154cf576154cf615421565b500290565b6000828210156154e6576154e6615421565b500390565b600082615521577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60006020828403121561553857600080fd5b813560048110614ba557600080fd5b84815260208101849052608081016155626040830185615184565b61556f6060830184615184565b95945050505050565b60006020828403121561558a57600080fd5b5051919050565b6000602082840312156155a357600080fd5b81518015158114614ba557600080fd5b60005b838110156155ce5781810151838201526020016155b6565b83811115611bef5750506000910152565b600081518084526155f78160208601602086016155b3565b601f01601f19169290920160200192915050565b6001600160a01b0383168152604060208201526000614ba260408301846155df565b60006001600160a01b0380861683528085166020840152506060604083015261556f60608301846155df565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261568e57600080fd5b83018035915067ffffffffffffffff8211156156a957600080fd5b6020019150600581901b3603821315614f2057600080fd5b6000602082840312156156d357600080fd5b8151614ba581614dc4565b600080604083850312156156f157600080fd5b825167ffffffffffffffff8082111561570957600080fd5b61571586838701615378565b935060209150818501518181111561572c57600080fd5b85019050601f8101861361573f57600080fd5b805161574d61539982615354565b81815260059190911b8201830190838101908883111561576c57600080fd5b928401925b8284101561578a57835182529284019290840190615771565b80955050505050509250929050565b600080604083850312156157ac57600080fd5b505080516020909101519092909150565b600082516157cf8184602087016155b3565b9190910192915050565b602081526000614ba560208301846155df56fe736574436f6e76657273696f6e436f6e66696728616464726573732c616464726573732c436f6e76657273696f6e436f6e66696729736574506f6f6c734173736574734469726563745472616e7366657228616464726573735b5d2c616464726573735b5d5b5d2c626f6f6c5b5d5b5d29a2646970667358221220e9d437e5c5c1c0182f6a30b0ea44454a90e7075c47dc98b514a6b238801ce2d364736f6c634300080d0033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106102e95760003560e01c806370a0823111610191578063b6828c57116100e3578063e30c397811610097578063f2fde38b11610071578063f2fde38b146106ad578063fa7b81a0146106c0578063fe3da984146106e757600080fd5b8063e30c397814610676578063f04c318714610687578063f0dc7e9d1461069a57600080fd5b8063c0654646116100c8578063c065464614610641578063ca32546914610654578063e2ff7ea21461066757600080fd5b8063b6828c5714610626578063bc368b041461063957600080fd5b80638da5cb5b11610145578063afcff50f1161011f578063afcff50f146105be578063b491ddf7146105d2578063b4a0bdf31461061557600080fd5b80638da5cb5b1461058757806390fa7b5414610598578063aac59a75146105ab57600080fd5b8063746460a911610176578063746460a91461055957806379ba50971461056c5780637b77cd6a1461057457600080fd5b806370a0823114610527578063715018a61461055157600080fd5b806352e21a181161024a5780635c39f467116101fe5780636daa463b116101d85780636daa463b146104e05780636f1a30a8146104f35780636fb052751461050657600080fd5b80635c39f4671461049a5780635e1e6325146104ba57806364aff9ec146104cd57600080fd5b8063553745221161022f578063553745221461046c578063556bbd8a1461047f57806358b904df1461049257600080fd5b806352e21a1814610446578063530e784f1461045957600080fd5b80632630c12f116102a1578063362b679511610286578063362b6795146103dd578063439727a514610404578063454900fe1461041757600080fd5b80632630c12f146103a35780633421fc52146103b657600080fd5b80630a0a05e6116102d25780630a0a05e6146103535780630a9a2b72146103685780630e32cb861461039057600080fd5b806301e20178146102ee57806307aa239e1461031e575b600080fd5b60ff54610301906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b60fe546103439074010000000000000000000000000000000000000000900460ff1681565b6040519015158152602001610315565b610366610361366004614de4565b6106f0565b005b61037b610376366004614e01565b610704565b60408051928352602083019190915201610315565b61036661039e366004614de4565b6107bf565b60fc54610301906001600160a01b031681565b6103017f000000000000000000000000000000000000000000000000000000000000000081565b6103017f000000000000000000000000000000000000000000000000000000000000000081565b61037b610412366004614e43565b6107d0565b610343610425366004614ea2565b61013060209081526000928352604080842090915290825290205460ff1681565b610366610454366004614de4565b61091a565b610366610467366004614de4565b61092b565b61036661047a366004614f27565b61093c565b61036661048d366004614fc1565b610973565b610366610b4a565b6104ad6104a8366004614de4565b610c30565b60405161031591906150ae565b61037b6104c8366004614e01565b610dcc565b6103666104db3660046150fb565b610eca565b61037b6104ee366004614e01565b610f71565b61037b610501366004614e01565b61107a565b610519610514366004614ea2565b611179565b604051908152602001610315565b610519610535366004614de4565b6001600160a01b0316600090815261012d602052604090205490565b61036661123e565b61036661056736600461513c565b611252565b610366611299565b610366610582366004614de4565b611324565b6033546001600160a01b0316610301565b61037b6105a6366004614e43565b6113ab565b6103666105b9366004614ea2565b6114a1565b61012f54610301906001600160a01b031681565b6106076105e0366004614ea2565b60fd6020908152600092835260408084209091529082529020805460019091015460ff1682565b6040516103159291906151bf565b6097546001600160a01b0316610301565b61037b610634366004614e43565b6114d7565b6103666115cd565b61036661064f3660046151d3565b61167f565b60fe54610301906001600160a01b031681565b6105196706f05b59d3b2000081565b6065546001600160a01b0316610301565b61037b610695366004614e43565b61171d565b6103666106a8366004615283565b61184c565b6103666106bb366004614de4565b611bf5565b6103017f000000000000000000000000000000000000000000000000000000000000000081565b61051960fb5481565b6106f8611c7e565b61070181611cd8565b50565b60008060026001600160a01b03808616600090815260fd602090815260408083209388168352929052206001015460ff16600381111561074657610746615155565b0361077d576040517f03410cd100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038316600090815261012d6020526040902054858110156107a3578095505b8592506107b1868686611d55565b508092505050935093915050565b6107c7611c7e565b610701816120ac565b6000808285856107de6121a1565b6107e7836121f6565b816001600160a01b0316836001600160a01b031614806108185750806001600160a01b0316836001600160a01b0316145b1561084f576040517f8aa3a72f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610857612236565b6108648a8a8a8a8a61228f565b90955093508985146108a2576040517fc214279600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6108ae8888878761230f565b604080516001600160a01b038a81168252602082018890529181018690528189169188169033907f795a235be939acb902ac69562805f86e1341a9b019c351b996e2aa2dfc34c67c906060015b60405180910390a461090d600160c955565b5050509550959350505050565b610922611c7e565b6107018161268a565b610933611c7e565b61070181612707565b61095d6040518060600160405280603c8152602001615822603c9139612784565b61096b868686868686612850565b505050505050565b600054610100900460ff16158080156109935750600054600160ff909116105b806109ad5750303b1580156109ad575060005460ff166001145b610a245760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084015b60405180910390fd5b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558015610a8257600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b610a8e8c8c8c8b612b21565b610a97896121f6565b61012f80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b038b16179055610ad9878787878787612850565b8015610b3c57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050505050505050565b610b886040518060400160405280601281526020017f726573756d65436f6e76657273696f6e28290000000000000000000000000000815250612784565b60fe5474010000000000000000000000000000000000000000900460ff16610bdb576040517e6d8dbb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fe80547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16905560405133907f89b79206f08dadd78502cff5075d2b094fa0abea0b063cfafe4475e2a380c51f90600090a2565b61012f546040517ff36dba380000000000000000000000000000000000000000000000000000000081526001600160a01b038381166004830152606092169063f36dba3890602401600060405180830381865afa158015610c95573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610cbd91908101906153ec565b9050610cc882612bba565b15610dc75780516000610cdc826001615450565b67ffffffffffffffff811115610cf457610cf46152f4565b604051908082528060200260200182016040528015610d1d578160200160208202803683370190505b50905060005b82811015610d7757838181518110610d3d57610d3d615468565b6020026020010151828281518110610d5757610d57615468565b6001600160a01b0390921660209283029190910190910152600101610d23565b507f0000000000000000000000000000000000000000000000000000000000000000818381518110610dab57610dab615468565b6001600160a01b03909216602092830291909101909101529150505b919050565b60008060026001600160a01b03808616600090815260fd602090815260408083209388168352929052206001015460ff166003811115610e0e57610e0e615155565b03610e45576040517f03410cd100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8491506000610e55868686612d86565b90925090506000610e7c856001600160a01b0316600090815261012d602052604090205490565b905082811015610ec05781600181610e9c670de0b6b3a764000085615497565b610ea69190615450565b610eb091906154d4565b610eba91906154eb565b93508092505b5050935093915050565b610ed2611c7e565b610eda612236565b610ee3836121f6565b610eec826121f6565b610ef5816130a7565b82610f0081836130e1565b610f146001600160a01b03821684846133eb565b826001600160a01b0316846001600160a01b03167f6d25be279134f4ecaa4770aff0c3d916d9e7c5ef37b65ed95dbdba411f5d54d584604051610f5991815260200190565b60405180910390a350610f6c600160c955565b505050565b60fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038481166004830152600092839291169063b62cad6990602401600060405180830381600087803b158015610fd557600080fd5b505af1158015610fe9573d6000803e3d6000fd5b505060fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038781166004830152909116925063b62cad699150602401600060405180830381600087803b15801561104d57600080fd5b505af1158015611061573d6000803e3d6000fd5b50505050611070858585612d86565b5094959350505050565b60fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038481166004830152600092839291169063b62cad6990602401600060405180830381600087803b1580156110de57600080fd5b505af11580156110f2573d6000803e3d6000fd5b505060fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038781166004830152909116925063b62cad699150602401600060405180830381600087803b15801561115657600080fd5b505af115801561116a573d6000803e3d6000fd5b50505050611070858585611d55565b600061118760c95460021490565b156111be576040517f9a050fe700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6111c88383613494565b611211576040517f983f1fb50000000000000000000000000000000000000000000000000000000081526001600160a01b03808516600483015283166024820152604401610a1b565b506001600160a01b03918216600090815261012e6020908152604080832093909416825291909152205490565b611246611c7e565b6112506000613584565b565b6112906040518060400160405280601e81526020017f7365744d696e416d6f756e74546f436f6e766572742875696e74323536290000815250612784565b610701816135b5565b60655433906001600160a01b0316811461131b5760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f74207468652060448201527f6e6577206f776e657200000000000000000000000000000000000000000000006064820152608401610a1b565b61070181613584565b61132c611c7e565b611335816121f6565b61012f546040516001600160a01b038084169216907fa87b964d321035d2165e484ff4b722dd6eae30606c0b98887d2ed1a34e594bfe90600090a361012f80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6000808285856113b96121a1565b6113c2836121f6565b816001600160a01b0316836001600160a01b031614806113f35750806001600160a01b0316836001600160a01b0316145b1561142a576040517f8aa3a72f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611432612236565b61143f8a8a8a8a8a61228f565b90955093506114508888878761230f565b604080516001600160a01b038a81168252602082018890529181018690528189169188169033907f93b7ba2a2b0e36320375853d7466af5685c07567804b871b4fdfd31e3bb77154906060016108fb565b6114a9612236565b60006114b583836135ff565b905080156114c8576114c883838361395c565b506114d3600160c955565b5050565b6000808285856114e56121a1565b6114ee836121f6565b816001600160a01b0316836001600160a01b0316148061151f5750806001600160a01b0316836001600160a01b0316145b15611556576040517f8aa3a72f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61155e612236565b61156b8a8a8a8a8a613df8565b909550935061157c8888878761230f565b604080516001600160a01b038a81168252602082018890529181018690528189169188169033907f9b7dc1d7d2974d015b4fc39889a09f3a3923add808f5863158f3162d997d4e82906060016108fb565b61160b6040518060400160405280601181526020017f7061757365436f6e76657273696f6e2829000000000000000000000000000000815250612784565b6116136121a1565b60fe80547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000017905560405133907f490bc639fd0d96f19c8adf77bc98d17fbefdee2e1e1864d21f041360d0ee065a90600090a2565b828181146116b9576040517f4d5590f300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b818110156117145761170c878787848181106116da576116da615468565b90506020020160208101906116ef9190614de4565b86868581811061170157611701615468565b90506040020161184c565b6001016116bc565b50505050505050565b60008082858561172b6121a1565b611734836121f6565b816001600160a01b0316836001600160a01b031614806117655750806001600160a01b0316836001600160a01b0316145b1561179c576040517f8aa3a72f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6117a4612236565b6117b18a8a8a8a8a613e8a565b90955093508884146117ef576040517fa8dc653c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6117fb8888878761230f565b604080516001600160a01b038a81168252602082018890529181018690528189169188169033907fcb4ea7de8d069b0f443b792cba6c6df5096508951bbc75c04ac42c9251efe076906060016108fb565b61186d6040518060600160405280603581526020016157ed60359139612784565b611876836121f6565b61187f826121f6565b6706f05b59d3b20000813511156118d3576040517f9770caee000000000000000000000000000000000000000000000000000000008152813560048201526706f05b59d3b200006024820152604401610a1b565b816001600160a01b0316836001600160a01b0316148061190c57506118f6613f47565b6001600160a01b0316836001600160a01b031614155b80611954575060006001600160a01b03808416600090815260fd602090815260408083209388168352929052206001015460ff16600381111561195157611951615155565b14155b1561198b576040517feebb5ac600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600261199d6040830160208401615526565b60038111156119ae576119ae615155565b1480156119bb5750803515155b156119f2576040517fd0d4aabe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002611a046040830160208401615526565b6003811115611a1557611a15615155565b1480611a4157506001611a2e6040830160208401615526565b6003811115611a3f57611a3f615155565b145b8015611a56575060ff546001600160a01b0316155b15611a8d576040517fe7c2c99400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03808416600081815260fd602090815260408083209487168084529482529182902080546001820154919594937f39fbfdd5da133303ed31b1b65e30a0ddf7a9236573368c66c859dceccc1dd12a93919288359260ff90911691611afd91908a01908a01615526565b604051611b0d9493929190615547565b60405180910390a36000611b276040840160208501615526565b6003811115611b3857611b38615155565b03611b95576001600160a01b03808516600090815260fd60209081526040808320938716835292905290812090815560010180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055611bef565b81358155611ba96040830160208401615526565b6001808301805490917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0090911690836003811115611be957611be9615155565b02179055505b50505050565b611bfd611c7e565b606580546001600160a01b0383167fffffffffffffffffffffffff00000000000000000000000000000000000000009091168117909155611c466033546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b6033546001600160a01b031633146112505760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a1b565b611ce1816121f6565b60fe546040516001600160a01b038084169216907f9be3097b5c8b276786be52a244ee90d66efd34805d9eb16f168fb2b4aaae9a2b90600090a360fe80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b60008084600003611d92576040517f42301c2300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03808516600090815260fd6020908152604080832093871683529281528282208351808501909452805484526001810154929392909183019060ff166003811115611de657611de6615155565b6003811115611df757611df7615155565b9052509050600081602001516003811115611e1457611e14615155565b03611e4b576040517f618ce59700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b03878116600483015260009216906341976e0990602401602060405180830381865afa158015611eaf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ed39190615578565b60fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b038881166004830152929350600092909116906341976e0990602401602060405180830381865afa158015611f3c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f609190615578565b835160ff54919250906000906001600160a01b031615801590612003575060ff546040517f6c059fb10000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b0390911690636c059fb190602401602060405180830381865afa158015611fdf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120039190615591565b9050801561201057600091505b600061202483670de0b6b3a7640000615450565b9050836120318287615497565b61203b91906154eb565b965081156120675786612056670de0b6b3a76400008d615497565b61206091906154eb565b975061209e565b8660018161207d670de0b6b3a76400008f615497565b6120879190615450565b61209191906154d4565b61209b91906154eb565b97505b505050505050935093915050565b6001600160a01b0381166121285760405162461bcd60e51b815260206004820152602560248201527f696e76616c696420616365737320636f6e74726f6c206d616e6167657220616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610a1b565b609780546001600160a01b038381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa0910160405180910390a15050565b60fe5474010000000000000000000000000000000000000000900460ff1615611250576040517f952bcf7f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038116610701576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600260c954036122885760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610a1b565b600260c955565b60008061229c8585613fd3565b6122a685886140f3565b91506122b3828686610f71565b915050858110156122fa576040517f228f8c110000000000000000000000000000000000000000000000000000000081526004810182905260248101879052604401610a1b565b61230584848361423e565b9550959350505050565b600061231a84610c30565b6001600160a01b038516600090815261012d602052604081205491925090612343908490615450565b905061234e816130a7565b815160008080805b8481101561267657600061012e600089848151811061237757612377615468565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060008c6001600160a01b03166001600160a01b031681526020019081526020016000205490508060001461266d576123d86001876154d4565b821015612438576124048883815181106123f4576123f4615468565b60200260200101518c8b8a6142b8565b61240e9086615450565b94508661241b828c615497565b61242591906154eb565b93506124318484615450565b9250612533565b6000612444868b6154d4565b90508061012e60008b868151811061245e5761245e615468565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060008e6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546124b891906154d4565b925050819055508b6001600160a01b03168984815181106124db576124db615468565b60200260200101516001600160a01b03167fc39e3e80c0219fde334a8cb5d8468b628482e23388b6e809c90cb00c63c8ce388360405161251d91815260200190565b60405180910390a361252f848c6154d4565b9450505b8b6001600160a01b031688838151811061254f5761254f615468565b60200260200101516001600160a01b031660fe60009054906101000a90046001600160a01b03166001600160a01b03167fadc20ad416881f76b4304665c35f5be8592297bcdfe4f0bb087b9d254222af55876040516125b091815260200190565b60405180910390a460fe5488516001600160a01b03909116906353ac3537908a90859081106125e1576125e1615468565b60209081029190910101516040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b1681526001600160a01b039182166004820152908f16602482015260448101879052606401600060405180830381600087803b15801561265457600080fd5b505af1158015612668573d6000803e3d6000fd5b505050505b50600101612356565b5050505050505050505050565b600160c955565b612693816121f6565b60ff546040516001600160a01b038084169216907f50f1a16bf24734355b14ff800d132cc0a934808b8621d5623b41bc67f204881790600090a360ff80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b612710816121f6565b60fc546040516001600160a01b038084169216907f56b5f80d8cac1479698aa7d01605fd6111e90b15fc4d2b377417f46034876cbd90600090a360fc80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6097546040517f18c5e8ab0000000000000000000000000000000000000000000000000000000081526000916001600160a01b0316906318c5e8ab906127d0903390869060040161560b565b602060405180830381865afa1580156127ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128119190615591565b9050806114d3573330836040517f4a3fa293000000000000000000000000000000000000000000000000000000008152600401610a1b9392919061562d565b8483811415806128605750808214155b15612897576040517f5f6f132c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b81811015612b175760008686838181106128b6576128b6615468565b90506020028101906128c89190615659565b80806020026020016040519081016040528093929190818152602001838360200280828437600092018290525093945088925087915085905081811061291057612910615468565b90506020028101906129229190615659565b80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250508451835193945092831491506129959050576040517f5f6f132c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b81811015612b08578281815181106129b2576129b2615468565b602002602001015161013060008e8e898181106129d1576129d1615468565b90506020020160208101906129e69190614de4565b6001600160a01b03166001600160a01b031681526020019081526020016000206000868481518110612a1a57612a1a615468565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff021916908315150217905550838181518110612a6b57612a6b615468565b60200260200101516001600160a01b03168c8c87818110612a8e57612a8e615468565b9050602002016020810190612aa39190614de4565b6001600160a01b03167f6333c55c3657aafc9b39e2586076d198ed0250804559126489c852f28d51280c858481518110612adf57612adf615468565b6020026020010151604051612af8911515815260200190565b60405180910390a3600101612998565b5083600101935050505061289a565b5050505050505050565b600054610100900460ff16612b9e5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a1b565b612ba784614391565b612baf61441f565b611bef8383836144a4565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b0772d0b6040518163ffffffff1660e01b8152600401600060405180830381865afa158015612c1b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612c4391908101906153ec565b805190915060005b81811015612d7e57828181518110612c6557612c65615468565b60200260200101516001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031614612d3957846001600160a01b0316838281518110612cc157612cc1615468565b60200260200101516001600160a01b0316636f307dc36040518163ffffffff1660e01b8152600401602060405180830381865afa158015612d06573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d2a91906156c1565b6001600160a01b031614612d6f565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316856001600160a01b0316145b935083612d7e57600101612c4b565b505050919050565b60008084600003612dc3576040517f098fb56100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03808516600090815260fd6020908152604080832093871683529281528282208351808501909452805484526001810154929392909183019060ff166003811115612e1757612e17615155565b6003811115612e2857612e28615155565b9052509050600081602001516003811115612e4557612e45615155565b03612e7c576040517f618ce59700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b03878116600483015260009216906341976e0990602401602060405180830381865afa158015612ee0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f049190615578565b60fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b038881166004830152929350600092909116906341976e0990602401602060405180830381865afa158015612f6d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f919190615578565b835160ff54919250906001600160a01b031615801590613031575060ff546040517f6c059fb10000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b0390911690636c059fb190602401602060405180830381865afa15801561300d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130319190615591565b1561303a575060005b600061304e82670de0b6b3a7640000615450565b9050613062670de0b6b3a764000084615497565b8161306d868d615497565b6130779190615497565b61308191906154eb565b96508261308e8286615497565b61309891906154eb565b95505050505050935093915050565b80600003610701576040517f9cf8540c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000906001600160a01b038416906370a0823190602401602060405180830381865afa158015613141573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131659190615578565b9050808211156131a1576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038316600090815261012d60205260408120546131c590836154d4565b905082811015611bef5780830360006131dd86610c30565b6001600160a01b038716600090815261012d602052604081205482519293509190805b828110156133b15761012e600086838151811061321f5761321f615468565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060008b6001600160a01b03166001600160a01b03168152602001908152602001600020546000146133a95761327d6001846154d4565b8110156132ba576132a985828151811061329957613299615468565b60200260200101518b88876142b8565b6132b39083615450565b91506133a9565b60006132c683886154d4565b90508061012e60008885815181106132e0576132e0615468565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060008d6001600160a01b03166001600160a01b03168152602001908152602001600020600082825461333a91906154d4565b925050819055508a6001600160a01b031686838151811061335d5761335d615468565b60200260200101516001600160a01b03167fc39e3e80c0219fde334a8cb5d8468b628482e23388b6e809c90cb00c63c8ce388360405161339f91815260200190565b60405180910390a3505b600101613200565b506001600160a01b038916600090815261012d6020526040812080548792906133db9084906154d4565b9091555050505050505050505050565b6040516001600160a01b038316602482015260448101829052610f6c9084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152614569565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b0316036134df576134d882612bba565b905061357e565b61012f546040517f266e0a7f0000000000000000000000000000000000000000000000000000000081526001600160a01b0385811660048301528481166024830152600092169063266e0a7f90604401602060405180830381865afa15801561354c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061357091906156c1565b6001600160a01b0316141590505b92915050565b606580547fffffffffffffffffffffffff000000000000000000000000000000000000000016905561070181614651565b6135be816130a7565b60fb5460408051918252602082018390527fada67d0d38fa20c8ae6a5c17cb9d60b0fe7f2d4e4f27ac9ee55e54ac88de9d8d910160405180910390a160fb55565b600061360b8383613494565b613654576040517f983f1fb50000000000000000000000000000000000000000000000000000000081526001600160a01b03808516600483015283166024820152604401610a1b565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015282906000906001600160a01b038316906370a0823190602401602060405180830381865afa1580156136b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136da9190615578565b6001600160a01b038516600090815261012d602052604090205490915080821115613953576001600160a01b0380871660009081526101306020908152604080832093891683529290522054818303945060ff16156139535760fe546040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0391821660048201526000918516906370a0823190602401602060405180830381865afa158015613798573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137bc9190615578565b60fe549091506137d9906001600160a01b038681169116876133eb565b60fe546040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0391821660048201526000918616906370a0823190602401602060405180830381865afa15801561383e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906138629190615578565b60fe546040518881529192506001600160a01b03898116928b82169291909116907fadc20ad416881f76b4304665c35f5be8592297bcdfe4f0bb087b9d254222af559060200160405180910390a460fe546001600160a01b03166353ac353789896138cd86866154d4565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b1681526001600160a01b0393841660048201529290911660248301526044820152606401600060405180830381600087803b15801561393457600080fd5b505af1158015613948573d6000803e3d6000fd5b505050506000955050505b50505092915050565b6000613966613f47565b60fe5460ff549192506001600160a01b03908116916000911615613deb5760ff546040517f4e9f8f390000000000000000000000000000000000000000000000000000000081526001600160a01b03878116600483015285811660248301526000928392911690634e9f8f39906044016000604051808303816000875af11580156139f5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052613a1d91908101906156de565b8151919350915060005b81811015613de657828181518110613a4157613a41615468565b602002602001015160000315613de6576000848281518110613a6557613a65615468565b60200260200101516001600160a01b0316636f1a30a8858481518110613a8d57613a8d615468565b60200260200101518c8b6040518463ffffffff1660e01b8152600401613acf939291909283526001600160a01b03918216602084015216604082015260600190565b60408051808303816000875af1158015613aed573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b119190615799565b91505088811115613b1f5750875b613b29818b6146bb565b613b335750613de6565b6040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b038881166004830152600091908a16906370a0823190602401602060405180830381865afa158015613b96573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613bba9190615578565b90508a6001600160a01b031663095ea7b3878581518110613bdd57613bdd615468565b6020026020010151846040518363ffffffff1660e01b8152600401613c179291906001600160a01b03929092168252602082015260400190565b6020604051808303816000875af1158015613c36573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613c5a9190615591565b50858381518110613c6d57613c6d615468565b60209081029190910101516040517f439727a500000000000000000000000000000000000000000000000000000000815260048101849052600060248201526001600160a01b038d811660448301528b811660648301528a811660848301529091169063439727a59060a40160408051808303816000875af1158015613cf7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d1b9190615799565b50506040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b038981166004830152600091908b16906370a0823190602401602060405180830381865afa158015613d80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613da49190615578565b9050613db0838c6154d4565b9a50613dbc82826154d4565b613dc69089615450565b97508a600003613dd857505050613de6565b836001019350505050613a27565b505050505b61096b86848388886147f3565b600080613e058585613fd3565b6000613e1287878761107a565b91505087811115613e59576040517f71b5f0c10000000000000000000000000000000000000000000000000000000081526004810182905260248101899052604401610a1b565b613e6386826140f3565b9250613e70838787610f71565b9250613e7f905085858461423e565b509550959350505050565b600080613e978585613fd3565b6000613ea487878761107a565b915050613eb186826140f3565b9250808314613eec576040517f0c5c1c2000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b87831115613f30576040517f71b5f0c10000000000000000000000000000000000000000000000000000000081526004810182905260248101899052604401610a1b565b613f3b85858961423e565b50909694955050505050565b60fe54604080517fc8ecc0d300000000000000000000000000000000000000000000000000000000815290516000926001600160a01b03169163c8ecc0d39160048083019260209291908290030181865afa158015613faa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613fce91906156c1565b905090565b60ff546000906001600160a01b031615801590614070575060ff546040517f6c059fb10000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b0390911690636c059fb190602401602060405180830381865afa15801561404c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906140709190615591565b9050801580156140bc575060026001600160a01b03808516600090815260fd602090815260408083209387168352929052206001015460ff1660038111156140ba576140ba615155565b145b15610f6c576040517f03410cd100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fe546040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b039182166004820152600091849183918316906370a0823190602401602060405180830381865afa15801561415c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906141809190615578565b60fe5490915061419f906001600160a01b038481169133911687614991565b60fe546040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0391821660048201526000918416906370a0823190602401602060405180830381865afa158015614204573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906142289190615578565b905061423482826154d4565b9695505050505050565b6001600160a01b038316600090815261012d602052604090205481811015614292576040517f6bb2792900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61429c84836149e2565b836142b16001600160a01b03821685856133eb565b5050505050565b6001600160a01b03808516600090815261012e6020908152604080832093871683529290529081205482906142ee908590615497565b6142f891906154eb565b6001600160a01b03808716600090815261012e602090815260408083209389168352929052908120805492935083929091906143359084906154d4565b92505081905550836001600160a01b0316856001600160a01b03167fc39e3e80c0219fde334a8cb5d8468b628482e23388b6e809c90cb00c63c8ce388360405161438191815260200190565b60405180910390a3949350505050565b600054610100900460ff1661440e5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a1b565b614416614a14565b61070181614a99565b600054610100900460ff1661449c5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a1b565b611250614b16565b600054610100900460ff166145215760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a1b565b61452a83612707565b61453382611cd8565b61453c816135b5565b505060fe80547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16905550565b60006145be826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316614b939092919063ffffffff16565b90508051600014806145df5750808060200190518101906145df9190615591565b610f6c5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610a1b565b603380546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038381166004830152600092169063b62cad6990602401600060405180830381600087803b15801561471c57600080fd5b505af1158015614730573d6000803e3d6000fd5b505060fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b03868116600483015260009450670de0b6b3a76400009350879216906341976e0990602401602060405180830381865afa1580156147a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906147c89190615578565b6147d29190615497565b6147dc91906154eb565b905060fb5481106147ec57600191505b5092915050565b82156148ca5760fe546040518481526001600160a01b0386811692888216929116907fadc20ad416881f76b4304665c35f5be8592297bcdfe4f0bb087b9d254222af559060200160405180910390a460fe546040517f53ac35370000000000000000000000000000000000000000000000000000000081526001600160a01b038781166004830152868116602483015260448201869052909116906353ac353790606401600060405180830381600087803b1580156148b157600080fd5b505af11580156148c5573d6000803e3d6000fd5b505050505b80156142b1576001600160a01b038216600090815261012d6020526040812080548392906148f9908490615450565b90915550506001600160a01b03808616600090815261012e6020908152604080832093861683529290529081208054839290614936908490615450565b92505081905550816001600160a01b0316856001600160a01b03167fc39e3e80c0219fde334a8cb5d8468b628482e23388b6e809c90cb00c63c8ce388360405161498291815260200190565b60405180910390a35050505050565b6040516001600160a01b0380851660248301528316604482015260648101829052611bef9085907f23b872dd0000000000000000000000000000000000000000000000000000000090608401613430565b6001600160a01b038216600090815261012d602052604081208054839290614a0b9084906154d4565b90915550505050565b600054610100900460ff16614a915760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a1b565b611250614bac565b600054610100900460ff166107c75760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a1b565b600054610100900460ff166126835760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a1b565b6060614ba28484600085614c32565b90505b9392505050565b600054610100900460ff16614c295760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610a1b565b61125033613584565b606082471015614caa5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610a1b565b600080866001600160a01b03168587604051614cc691906157bd565b60006040518083038185875af1925050503d8060008114614d03576040519150601f19603f3d011682016040523d82523d6000602084013e614d08565b606091505b5091509150614d1987838387614d26565b925050505b949350505050565b60608315614d95578251600003614d8e576001600160a01b0385163b614d8e5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610a1b565b5081614d1e565b614d1e8383815115614daa5781518083602001fd5b8060405162461bcd60e51b8152600401610a1b91906157d9565b6001600160a01b038116811461070157600080fd5b8035610dc781614dc4565b600060208284031215614df657600080fd5b8135614ba581614dc4565b600080600060608486031215614e1657600080fd5b833592506020840135614e2881614dc4565b91506040840135614e3881614dc4565b809150509250925092565b600080600080600060a08688031215614e5b57600080fd5b85359450602086013593506040860135614e7481614dc4565b92506060860135614e8481614dc4565b91506080860135614e9481614dc4565b809150509295509295909350565b60008060408385031215614eb557600080fd5b8235614ec081614dc4565b91506020830135614ed081614dc4565b809150509250929050565b60008083601f840112614eed57600080fd5b50813567ffffffffffffffff811115614f0557600080fd5b6020830191508360208260051b8501011115614f2057600080fd5b9250929050565b60008060008060008060608789031215614f4057600080fd5b863567ffffffffffffffff80821115614f5857600080fd5b614f648a838b01614edb565b90985096506020890135915080821115614f7d57600080fd5b614f898a838b01614edb565b90965094506040890135915080821115614fa257600080fd5b50614faf89828a01614edb565b979a9699509497509295939492505050565b60008060008060008060008060008060006101008c8e031215614fe357600080fd5b614fec8c614dd9565b9a50614ffa60208d01614dd9565b995061500860408d01614dd9565b985061501660608d01614dd9565b975060808c0135965067ffffffffffffffff8060a08e0135111561503957600080fd5b6150498e60a08f01358f01614edb565b909750955060c08d013581101561505f57600080fd5b61506f8e60c08f01358f01614edb565b909550935060e08d013581101561508557600080fd5b506150968d60e08e01358e01614edb565b81935080925050509295989b509295989b9093969950565b6020808252825182820181905260009190848201906040850190845b818110156150ef5783516001600160a01b0316835292840192918401916001016150ca565b50909695505050505050565b60008060006060848603121561511057600080fd5b833561511b81614dc4565b9250602084013561512b81614dc4565b929592945050506040919091013590565b60006020828403121561514e57600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600481106151bb577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b9052565b82815260408101614ba56020830184615184565b6000806000806000606086880312156151eb57600080fd5b85356151f681614dc4565b9450602086013567ffffffffffffffff8082111561521357600080fd5b61521f89838a01614edb565b9096509450604088013591508082111561523857600080fd5b818801915088601f83011261524c57600080fd5b81358181111561525b57600080fd5b8960208260061b850101111561527057600080fd5b9699959850939650602001949392505050565b6000806000838503608081121561529957600080fd5b84356152a481614dc4565b935060208501356152b481614dc4565b925060407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0820112156152e657600080fd5b506040840190509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561534c5761534c6152f4565b604052919050565b600067ffffffffffffffff82111561536e5761536e6152f4565b5060051b60200190565b600082601f83011261538957600080fd5b8151602061539e61539983615354565b615323565b82815260059290921b840181019181810190868411156153bd57600080fd5b8286015b848110156153e15780516153d481614dc4565b83529183019183016153c1565b509695505050505050565b6000602082840312156153fe57600080fd5b815167ffffffffffffffff81111561541557600080fd5b614d1e84828501615378565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000821982111561546357615463615421565b500190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156154cf576154cf615421565b500290565b6000828210156154e6576154e6615421565b500390565b600082615521577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60006020828403121561553857600080fd5b813560048110614ba557600080fd5b84815260208101849052608081016155626040830185615184565b61556f6060830184615184565b95945050505050565b60006020828403121561558a57600080fd5b5051919050565b6000602082840312156155a357600080fd5b81518015158114614ba557600080fd5b60005b838110156155ce5781810151838201526020016155b6565b83811115611bef5750506000910152565b600081518084526155f78160208601602086016155b3565b601f01601f19169290920160200192915050565b6001600160a01b0383168152604060208201526000614ba260408301846155df565b60006001600160a01b0380861683528085166020840152506060604083015261556f60608301846155df565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261568e57600080fd5b83018035915067ffffffffffffffff8211156156a957600080fd5b6020019150600581901b3603821315614f2057600080fd5b6000602082840312156156d357600080fd5b8151614ba581614dc4565b600080604083850312156156f157600080fd5b825167ffffffffffffffff8082111561570957600080fd5b61571586838701615378565b935060209150818501518181111561572c57600080fd5b85019050601f8101861361573f57600080fd5b805161574d61539982615354565b81815260059190911b8201830190838101908883111561576c57600080fd5b928401925b8284101561578a57835182529284019290840190615771565b80955050505050509250929050565b600080604083850312156157ac57600080fd5b505080516020909101519092909150565b600082516157cf8184602087016155b3565b9190910192915050565b602081526000614ba560208301846155df56fe736574436f6e76657273696f6e436f6e66696728616464726573732c616464726573732c436f6e76657273696f6e436f6e66696729736574506f6f6c734173736574734469726563745472616e7366657228616464726573735b5d2c616464726573735b5d5b5d2c626f6f6c5b5d5b5d29a2646970667358221220e9d437e5c5c1c0182f6a30b0ea44454a90e7075c47dc98b514a6b238801ce2d364736f6c634300080d0033", "devdoc": { "author": "Venus", "custom:security-contact": "https://github.com/VenusProtocol/protocol-reserve#discussion", @@ -2192,7 +2192,7 @@ "notice": "To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut. This function does not account for potential token transfer fees(in case of deflationary tokens)" }, "getAmountOut(uint256,address,address)": { - "notice": "To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn. This function does not account for potential token transfer fees(in case of deflationary tokens)" + "notice": "To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn. This function does not account for potential token transfer fees(in case of deflationary tokens)The amountInMantissa might be adjusted if amountOutMantissa is greater than the balance of the contract for tokenAddressOut" }, "getPools(address)": { "notice": "Get the array of all pools addresses" @@ -2367,7 +2367,7 @@ "label": "conversionConfigurations", "offset": 0, "slot": "253", - "type": "t_mapping(t_address,t_mapping(t_address,t_struct(ConversionConfig)5463_storage))" + "type": "t_mapping(t_address,t_mapping(t_address,t_struct(ConversionConfig)5478_storage))" }, { "astId": 3371, @@ -2402,7 +2402,7 @@ "type": "t_array(t_uint256)45_storage" }, { - "astId": 5689, + "astId": 5704, "contract": "contracts/TokenConverter/RiskFundConverter.sol:RiskFundConverter", "label": "assetsReserves", "offset": 0, @@ -2410,7 +2410,7 @@ "type": "t_mapping(t_address,t_uint256)" }, { - "astId": 5696, + "astId": 5711, "contract": "contracts/TokenConverter/RiskFundConverter.sol:RiskFundConverter", "label": "poolsAssetsReserves", "offset": 0, @@ -2418,7 +2418,7 @@ "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))" }, { - "astId": 5699, + "astId": 5714, "contract": "contracts/TokenConverter/RiskFundConverter.sol:RiskFundConverter", "label": "poolRegistry", "offset": 0, @@ -2426,7 +2426,7 @@ "type": "t_address" }, { - "astId": 5706, + "astId": 5721, "contract": "contracts/TokenConverter/RiskFundConverter.sol:RiskFundConverter", "label": "poolsAssetsDirectTransfer", "offset": 0, @@ -2478,7 +2478,7 @@ "label": "contract ResilientOracle", "numberOfBytes": "20" }, - "t_enum(ConversionAccessibility)5455": { + "t_enum(ConversionAccessibility)5470": { "encoding": "inplace", "label": "enum IAbstractTokenConverter.ConversionAccessibility", "numberOfBytes": "1" @@ -2497,12 +2497,12 @@ "numberOfBytes": "32", "value": "t_mapping(t_address,t_bool)" }, - "t_mapping(t_address,t_mapping(t_address,t_struct(ConversionConfig)5463_storage))": { + "t_mapping(t_address,t_mapping(t_address,t_struct(ConversionConfig)5478_storage))": { "encoding": "mapping", "key": "t_address", "label": "mapping(address => mapping(address => struct IAbstractTokenConverter.ConversionConfig))", "numberOfBytes": "32", - "value": "t_mapping(t_address,t_struct(ConversionConfig)5463_storage)" + "value": "t_mapping(t_address,t_struct(ConversionConfig)5478_storage)" }, "t_mapping(t_address,t_mapping(t_address,t_uint256))": { "encoding": "mapping", @@ -2511,12 +2511,12 @@ "numberOfBytes": "32", "value": "t_mapping(t_address,t_uint256)" }, - "t_mapping(t_address,t_struct(ConversionConfig)5463_storage)": { + "t_mapping(t_address,t_struct(ConversionConfig)5478_storage)": { "encoding": "mapping", "key": "t_address", "label": "mapping(address => struct IAbstractTokenConverter.ConversionConfig)", "numberOfBytes": "32", - "value": "t_struct(ConversionConfig)5463_storage" + "value": "t_struct(ConversionConfig)5478_storage" }, "t_mapping(t_address,t_uint256)": { "encoding": "mapping", @@ -2525,12 +2525,12 @@ "numberOfBytes": "32", "value": "t_uint256" }, - "t_struct(ConversionConfig)5463_storage": { + "t_struct(ConversionConfig)5478_storage": { "encoding": "inplace", "label": "struct IAbstractTokenConverter.ConversionConfig", "members": [ { - "astId": 5458, + "astId": 5473, "contract": "contracts/TokenConverter/RiskFundConverter.sol:RiskFundConverter", "label": "incentive", "offset": 0, @@ -2538,12 +2538,12 @@ "type": "t_uint256" }, { - "astId": 5462, + "astId": 5477, "contract": "contracts/TokenConverter/RiskFundConverter.sol:RiskFundConverter", "label": "conversionAccess", "offset": 0, "slot": "1", - "type": "t_enum(ConversionAccessibility)5455" + "type": "t_enum(ConversionAccessibility)5470" } ], "numberOfBytes": "64" diff --git a/deployments/bsctestnet/SingleTokenConverterImp.json b/deployments/bsctestnet/SingleTokenConverterImp.json index 5337bd95..1d5aa382 100644 --- a/deployments/bsctestnet/SingleTokenConverterImp.json +++ b/deployments/bsctestnet/SingleTokenConverterImp.json @@ -1,5 +1,5 @@ { - "address": "0xf014C86b6071cfFB8fE39306F802770C70733a23", + "address": "0x46BED43b29D73835fF075bBa1A0002A1eD1E4de8", "abi": [ { "inputs": [], @@ -1381,39 +1381,39 @@ "type": "function" } ], - "transactionHash": "0xcf729c527b28bfdfaba00d98555c4a4d8e62d27dae23532a37fa81ff5fd4ee4c", + "transactionHash": "0xba9a92fb7e9385bbebc2d54c39b4d53d3511b3e443abb0158ab09a03342c6f79", "receipt": { "to": null, - "from": "0x02EB950C215D12d723b44a18CfF098C6E166C531", - "contractAddress": "0xf014C86b6071cfFB8fE39306F802770C70733a23", - "transactionIndex": 4, - "gasUsed": "3623804", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000080000000000000000000000000000000000000000000000400000000000000200000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x5aebee3f25eaf1a91eab717c280f51ca89a3d6b272c6fa6e367fde46c7e0c41b", - "transactionHash": "0xcf729c527b28bfdfaba00d98555c4a4d8e62d27dae23532a37fa81ff5fd4ee4c", + "from": "0x7Bf1Fe2C42E79dbA813Bf5026B7720935a55ec5f", + "contractAddress": "0x46BED43b29D73835fF075bBa1A0002A1eD1E4de8", + "transactionIndex": 0, + "gasUsed": "3634796", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000080000000000000000000010000000000000000000000000400000000000000000000000000000000000800000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x446e0df3da06877fbeded838f80f30a728834ebdba83c4fd0140eb7b87ace215", + "transactionHash": "0xba9a92fb7e9385bbebc2d54c39b4d53d3511b3e443abb0158ab09a03342c6f79", "logs": [ { - "transactionIndex": 4, - "blockNumber": 36750636, - "transactionHash": "0xcf729c527b28bfdfaba00d98555c4a4d8e62d27dae23532a37fa81ff5fd4ee4c", - "address": "0xf014C86b6071cfFB8fE39306F802770C70733a23", + "transactionIndex": 0, + "blockNumber": 37698228, + "transactionHash": "0xba9a92fb7e9385bbebc2d54c39b4d53d3511b3e443abb0158ab09a03342c6f79", + "address": "0x46BED43b29D73835fF075bBa1A0002A1eD1E4de8", "topics": ["0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498"], "data": "0x00000000000000000000000000000000000000000000000000000000000000ff", - "logIndex": 4, - "blockHash": "0x5aebee3f25eaf1a91eab717c280f51ca89a3d6b272c6fa6e367fde46c7e0c41b" + "logIndex": 0, + "blockHash": "0x446e0df3da06877fbeded838f80f30a728834ebdba83c4fd0140eb7b87ace215" } ], - "blockNumber": 36750636, - "cumulativeGasUsed": "4621429", + "blockNumber": 37698228, + "cumulativeGasUsed": "3634796", "status": 1, "byzantium": true }, "args": [], - "numDeployments": 1, - "solcInputHash": "d02e743d886d63634298edb2c3d7a019", - "metadata": "{\"compiler\":{\"version\":\"0.8.13+commit.abaa5c0e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountInMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountInMaxMantissa\",\"type\":\"uint256\"}],\"name\":\"AmountInHigherThanMax\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AmountInMismatched\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOutMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMinMantissa\",\"type\":\"uint256\"}],\"name\":\"AmountOutLowerThanMinRequired\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AmountOutMismatched\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ConversionConfigNotEnabled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ConversionEnabledOnlyForPrivateConversions\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ConversionTokensActive\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ConversionTokensPaused\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DeflationaryTokenNotSupported\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"incentive\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxIncentive\",\"type\":\"uint256\"}],\"name\":\"IncentiveTooHigh\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InputLengthMisMatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientInputAmount\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientOutputAmount\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientPoolLiquidity\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidConverterNetwork\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidMinimumAmountToConvert\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidToAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidTokenConfigAddresses\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NonZeroIncentiveForPrivateConversion\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"calledContract\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"methodSignature\",\"type\":\"string\"}],\"name\":\"Unauthorized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddressNotAllowed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroValueNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"comptroller\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"AssetTransferredToDestination\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldBaseAsset\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newBaseAsset\",\"type\":\"address\"}],\"name\":\"BaseAssetUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldIncentive\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newIncentive\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"enum IAbstractTokenConverter.ConversionAccessibility\",\"name\":\"oldAccess\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"enum IAbstractTokenConverter.ConversionAccessibility\",\"name\":\"newAccess\",\"type\":\"uint8\"}],\"name\":\"ConversionConfigUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"ConversionPaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"ConversionResumed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"name\":\"ConvertedExactTokens\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"name\":\"ConvertedExactTokensSupportingFeeOnTransferTokens\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"name\":\"ConvertedForExactTokens\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"name\":\"ConvertedForExactTokensSupportingFeeOnTransferTokens\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldConverterNetwork\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"converterNetwork\",\"type\":\"address\"}],\"name\":\"ConverterNetworkAddressUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldDestinationAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"destinationAddress\",\"type\":\"address\"}],\"name\":\"DestinationAddressUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldMinAmountToConvert\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newMinAmountToConvert\",\"type\":\"uint256\"}],\"name\":\"MinAmountToConvertUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldAccessControlManager\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAccessControlManager\",\"type\":\"address\"}],\"name\":\"NewAccessControlManager\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract ResilientOracle\",\"name\":\"oldPriceOracle\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"contract ResilientOracle\",\"name\":\"priceOracle\",\"type\":\"address\"}],\"name\":\"PriceOracleUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"SweepToken\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"MAX_INCENTIVE\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"accessControlManager\",\"outputs\":[{\"internalType\":\"contract IAccessControlManagerV8\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenBalance\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"baseAsset\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"conversionConfigurations\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"incentive\",\"type\":\"uint256\"},{\"internalType\":\"enum IAbstractTokenConverter.ConversionAccessibility\",\"name\":\"conversionAccess\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"conversionPaused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountInMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMinMantissa\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"convertExactTokens\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"actualAmountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actualAmountOut\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountInMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMinMantissa\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"convertExactTokensSupportingFeeOnTransferTokens\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"actualAmountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actualAmountOut\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountInMaxMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMantissa\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"convertForExactTokens\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"actualAmountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actualAmountOut\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountInMaxMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMantissa\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"convertForExactTokensSupportingFeeOnTransferTokens\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"actualAmountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actualAmountOut\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"converterNetwork\",\"outputs\":[{\"internalType\":\"contract IConverterNetwork\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"destinationAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOutMantissa\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"}],\"name\":\"getAmountIn\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountConvertedMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountInMantissa\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountInMantissa\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"}],\"name\":\"getAmountOut\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountConvertedMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMantissa\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOutMantissa\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"}],\"name\":\"getUpdatedAmountIn\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountConvertedMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountInMantissa\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountInMantissa\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"}],\"name\":\"getUpdatedAmountOut\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountConvertedMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMantissa\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"accessControlManager_\",\"type\":\"address\"},{\"internalType\":\"contract ResilientOracle\",\"name\":\"priceOracle_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"destinationAddress_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"baseAsset_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"minAmountToConvert_\",\"type\":\"uint256\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"minAmountToConvert\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pauseConversion\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pendingOwner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"priceOracle\",\"outputs\":[{\"internalType\":\"contract ResilientOracle\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"resumeConversion\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"accessControlManager_\",\"type\":\"address\"}],\"name\":\"setAccessControlManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"baseAsset_\",\"type\":\"address\"}],\"name\":\"setBaseAsset\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"incentive\",\"type\":\"uint256\"},{\"internalType\":\"enum IAbstractTokenConverter.ConversionAccessibility\",\"name\":\"conversionAccess\",\"type\":\"uint8\"}],\"internalType\":\"struct IAbstractTokenConverter.ConversionConfig\",\"name\":\"conversionConfig\",\"type\":\"tuple\"}],\"name\":\"setConversionConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"tokenAddressesOut\",\"type\":\"address[]\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"incentive\",\"type\":\"uint256\"},{\"internalType\":\"enum IAbstractTokenConverter.ConversionAccessibility\",\"name\":\"conversionAccess\",\"type\":\"uint8\"}],\"internalType\":\"struct IAbstractTokenConverter.ConversionConfig[]\",\"name\":\"conversionConfigs\",\"type\":\"tuple[]\"}],\"name\":\"setConversionConfigs\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IConverterNetwork\",\"name\":\"converterNetwork_\",\"type\":\"address\"}],\"name\":\"setConverterNetwork\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"destinationAddress_\",\"type\":\"address\"}],\"name\":\"setDestination\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minAmountToConvert_\",\"type\":\"uint256\"}],\"name\":\"setMinAmountToConvert\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ResilientOracle\",\"name\":\"priceOracle_\",\"type\":\"address\"}],\"name\":\"setPriceOracle\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"sweepToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"comptroller\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"}],\"name\":\"updateAssetsState\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Venus\",\"custom:security-contact\":\"https://github.com/VenusProtocol/protocol-reserve#discussion\",\"kind\":\"dev\",\"methods\":{\"acceptOwnership()\":{\"details\":\"The new owner accepts the ownership transfer.\"},\"balanceOf(address)\":{\"params\":{\"tokenAddress\":\"Address of the token\"},\"returns\":{\"tokenBalance\":\"Balance of the token the contract has\"}},\"constructor\":{\"custom:oz-upgrades-unsafe-allow\":\"constructor\"},\"convertExactTokens(uint256,uint256,address,address,address)\":{\"custom:error\":\"ZeroAddressNotAllowed is thrown when to address is zeroInvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOutAmountOutLowerThanMinRequired error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissaAmountInMismatched error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa\",\"custom:event\":\"Emits ConvertedExactTokens event on success\",\"details\":\"Method does not support deflationary tokens transfer\",\"params\":{\"amountInMantissa\":\"Amount of tokenAddressIn\",\"amountOutMinMantissa\":\"Min amount of tokenAddressOut required as output\",\"to\":\"Address of the tokenAddressOut receiver\",\"tokenAddressIn\":\"Address of the token to convert\",\"tokenAddressOut\":\"Address of the token to get after conversion\"},\"returns\":{\"actualAmountIn\":\"Actual amount transferred to destination\",\"actualAmountOut\":\"Actual amount transferred to user\"}},\"convertExactTokensSupportingFeeOnTransferTokens(uint256,uint256,address,address,address)\":{\"custom:error\":\"ZeroAddressNotAllowed is thrown when to address is zeroInvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOutAmountOutLowerThanMinRequired error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa\",\"custom:event\":\"Emits ConvertedExactTokensSupportingFeeOnTransferTokens event on success\",\"params\":{\"amountInMantissa\":\"Amount of tokenAddressIn\",\"amountOutMinMantissa\":\"Min amount of tokenAddressOut required as output\",\"to\":\"Address of the tokenAddressOut receiver\",\"tokenAddressIn\":\"Address of the token to convert\",\"tokenAddressOut\":\"Address of the token to get after conversion\"},\"returns\":{\"actualAmountIn\":\"Actual amount transferred to destination\",\"actualAmountOut\":\"Actual amount transferred to user\"}},\"convertForExactTokens(uint256,uint256,address,address,address)\":{\"custom:error\":\"ZeroAddressNotAllowed is thrown when to address is zeroInvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOutAmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissaAmountOutMismatched error is thrown when actualAmountOut is does not match amountOutMantissa\",\"custom:event\":\"Emits ConvertedForExactTokens event on success\",\"details\":\"Method does not support deflationary tokens transfer\",\"params\":{\"amountInMaxMantissa\":\"Max amount of tokenAddressIn\",\"amountOutMantissa\":\"Amount of tokenAddressOut required as output\",\"to\":\"Address of the tokenAddressOut receiver\",\"tokenAddressIn\":\"Address of the token to convert\",\"tokenAddressOut\":\"Address of the token to get after conversion\"},\"returns\":{\"actualAmountIn\":\"Actual amount transferred to destination\",\"actualAmountOut\":\"Actual amount transferred to user\"}},\"convertForExactTokensSupportingFeeOnTransferTokens(uint256,uint256,address,address,address)\":{\"custom:error\":\"ZeroAddressNotAllowed is thrown when to address is zeroInvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOutAmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissa\",\"custom:event\":\"Emits ConvertedForExactTokensSupportingFeeOnTransferTokens event on success\",\"params\":{\"amountInMaxMantissa\":\"Max amount of tokenAddressIn\",\"amountOutMantissa\":\"Amount of tokenAddressOut required as output\",\"to\":\"Address of the tokenAddressOut receiver\",\"tokenAddressIn\":\"Address of the token to convert\",\"tokenAddressOut\":\"Address of the token to get after conversion\"},\"returns\":{\"actualAmountIn\":\"Actual amount transferred to destination\",\"actualAmountOut\":\"Actual amount transferred to user\"}},\"getAmountIn(uint256,address,address)\":{\"custom:error\":\"InsufficientInputAmount error is thrown when given input amount is zeroConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pairConversionEnabledOnlyForPrivateConversions is thrown when conversion is only enabled for private conversion\",\"details\":\"This function retrieves values without altering token prices\",\"params\":{\"amountOutMantissa\":\"Amount of tokenAddressOut user wants to receive\",\"tokenAddressIn\":\"Address of the token to convert\",\"tokenAddressOut\":\"Address of the token to get after conversion\"},\"returns\":{\"amountConvertedMantissa\":\"Amount of tokenAddressOut should be transferred after conversion\",\"amountInMantissa\":\"Amount of the tokenAddressIn sender would send to contract before conversion\"}},\"getAmountOut(uint256,address,address)\":{\"custom:error\":\"InsufficientInputAmount error is thrown when given input amount is zeroConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pairConversionEnabledOnlyForPrivateConversions is thrown when conversion is only enabled for private conversion\",\"details\":\"This function retrieves values without altering token prices\",\"params\":{\"amountInMantissa\":\"Amount of tokenAddressIn\",\"tokenAddressIn\":\"Address of the token to convert\",\"tokenAddressOut\":\"Address of the token to get after conversion\"},\"returns\":{\"amountConvertedMantissa\":\"Amount of tokenAddressIn should be transferred after conversion\",\"amountOutMantissa\":\"Amount of the tokenAddressOut sender should receive after conversion\"}},\"getUpdatedAmountIn(uint256,address,address)\":{\"custom:error\":\"InsufficientInputAmount error is thrown when given input amount is zeroConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\",\"params\":{\"amountOutMantissa\":\"Amount of tokenAddressOut user wants to receive\",\"tokenAddressIn\":\"Address of the token to convert\",\"tokenAddressOut\":\"Address of the token to get after conversion\"},\"returns\":{\"amountConvertedMantissa\":\"Amount of tokenAddressOut should be transferred after conversion\",\"amountInMantissa\":\"Amount of the tokenAddressIn sender would send to contract before conversion\"}},\"getUpdatedAmountOut(uint256,address,address)\":{\"custom:error\":\"InsufficientInputAmount error is thrown when given input amount is zeroConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\",\"params\":{\"amountInMantissa\":\"Amount of tokenAddressIn\",\"tokenAddressIn\":\"Address of the token to convert\",\"tokenAddressOut\":\"Address of the token to get after conversion\"},\"returns\":{\"amountConvertedMantissa\":\"Amount of tokenAddressIn should be transferred after conversion\",\"amountOutMantissa\":\"Amount of the tokenAddressOut sender should receive after conversion\"}},\"initialize(address,address,address,address,uint256)\":{\"params\":{\"accessControlManager_\":\"Access control manager contract address\",\"destinationAddress_\":\"Address at all incoming tokens will transferred to\",\"minAmountToConvert_\":\"Minimum amount to convert\",\"priceOracle_\":\"Resilient oracle address\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"pauseConversion()\":{\"custom:access\":\"Restricted by ACM\",\"custom:error\":\"ConversionTokensPaused thrown when conversion is already paused\",\"custom:event\":\"Emits ConversionPaused on success\"},\"pendingOwner()\":{\"details\":\"Returns the address of the pending owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.\"},\"resumeConversion()\":{\"custom:access\":\"Restricted by ACM\",\"custom:error\":\"ConversionTokensActive thrown when conversion is already active\",\"custom:event\":\"Emits ConversionResumed on success\"},\"setAccessControlManager(address)\":{\"custom:access\":\"Only Governance\",\"custom:event\":\"Emits NewAccessControlManager event\",\"details\":\"Admin function to set address of AccessControlManager\",\"params\":{\"accessControlManager_\":\"The new address of the AccessControlManager\"}},\"setBaseAsset(address)\":{\"custom:access\":\"Only Governance\",\"params\":{\"baseAsset_\":\"The new address of the base asset\"}},\"setConversionConfig(address,address,(uint256,uint8))\":{\"custom:access\":\"Controlled by AccessControlManager\",\"custom:error\":\"Unauthorized error is thrown when the call is not authorized by AccessControlManagerZeroAddressNotAllowed is thrown when pool registry address is zeroNonZeroIncentiveForPrivateConversion is thrown when incentive is non zero for private conversion\",\"custom:event\":\"Emits ConversionConfigUpdated event on success\",\"params\":{\"conversionConfig\":\"ConversionConfig config details to update\",\"tokenAddressIn\":\"Address of tokenIn\",\"tokenAddressOut\":\"Address of tokenOut\"}},\"setConversionConfigs(address,address[],(uint256,uint8)[])\":{\"custom:error\":\"InputLengthMisMatch is thrown when tokenAddressesOut and conversionConfigs array length mismatches\",\"params\":{\"conversionConfigs\":\"Array of conversionConfig config details to update\",\"tokenAddressIn\":\"Address of tokenIn\",\"tokenAddressesOut\":\"Array of addresses of tokenOut\"}},\"setConverterNetwork(address)\":{\"custom:access\":\"Only Governance\",\"params\":{\"converterNetwork_\":\"The converterNetwork address to be set\"}},\"setDestination(address)\":{\"custom:access\":\"Only Governance\",\"params\":{\"destinationAddress_\":\"The new destination address to be set\"}},\"setMinAmountToConvert(uint256)\":{\"custom:access\":\"Only Governance\",\"params\":{\"minAmountToConvert_\":\"Min amount to convert\"}},\"setPriceOracle(address)\":{\"custom:access\":\"Only Governance\",\"params\":{\"priceOracle_\":\"Address of the new price oracle to set\"}},\"sweepToken(address,address,uint256)\":{\"custom:access\":\"Only Governance\",\"custom:error\":\"ZeroAddressNotAllowed is thrown when tokenAddress/to address is zero\",\"custom:event\":\"Emits SweepToken event on success\",\"params\":{\"amount\":\"The amount to transfer\",\"to\":\"The address to which tokens will be transferred\",\"tokenAddress\":\"The address of the ERC-20 token to sweep\"}},\"transferOwnership(address)\":{\"details\":\"Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. Can only be called by the current owner.\"},\"updateAssetsState(address,address)\":{\"details\":\"This function is called by protocolShareReservecall _updateAssetsState to update the states related to the comptroller and asset transfer to the specific converter then it calls the _privateConversion which will convert the asset into destination's base asset and transfer it to destination address\",\"params\":{\"asset\":\"Asset address\",\"comptroller\":\"Comptroller address (pool)\"}}},\"title\":\"SingleTokenConverter\",\"version\":1},\"userdoc\":{\"errors\":{\"AmountInHigherThanMax(uint256,uint256)\":[{\"notice\":\"Thrown when amountIn is higher than amountInMax\"}],\"AmountInMismatched()\":[{\"notice\":\"Thrown when actualAmountIn does not match with amountInMantissa for convertForExactTokens\"}],\"AmountOutLowerThanMinRequired(uint256,uint256)\":[{\"notice\":\"Thrown when amountOut is lower than amountOutMin\"}],\"AmountOutMismatched()\":[{\"notice\":\"Thrown when actualAmountOut does not match with amountOutMantissa for convertForExactTokens\"}],\"ConversionConfigNotEnabled()\":[{\"notice\":\"Thrown when conversion is disabled or config does not exist for given pair\"}],\"ConversionEnabledOnlyForPrivateConversions()\":[{\"notice\":\"Thrown when conversion is enabled only for private conversions\"}],\"ConversionTokensActive()\":[{\"notice\":\"Thrown when conversion is Active\"}],\"ConversionTokensPaused()\":[{\"notice\":\"Thrown when conversion is paused\"}],\"DeflationaryTokenNotSupported()\":[{\"notice\":\"Thrown when using convertForExactTokens deflationary tokens\"}],\"IncentiveTooHigh(uint256,uint256)\":[{\"notice\":\"Thrown when incentive is higher than the MAX_INCENTIVE\"}],\"InputLengthMisMatch()\":[{\"notice\":\"Thrown when there is a mismatch in the length of input arrays\"}],\"InsufficientInputAmount()\":[{\"notice\":\"Thrown when given input amount is zero\"}],\"InsufficientOutputAmount()\":[{\"notice\":\"Thrown when given output amount is zero\"}],\"InsufficientPoolLiquidity()\":[{\"notice\":\"Thrown when contract has less liquidity for tokenAddressOut than amountOutMantissa\"}],\"InvalidConverterNetwork()\":[{\"notice\":\"When address of the ConverterNetwork is not set or Zero address\"}],\"InvalidMinimumAmountToConvert()\":[{\"notice\":\"Thrown when minimum amount to convert is zero\"}],\"InvalidToAddress()\":[{\"notice\":\"Thrown when address(to) is same as tokenAddressIn or tokenAddressOut\"}],\"InvalidTokenConfigAddresses()\":[{\"notice\":\"Thrown when tokenInAddress is same as tokeOutAdress OR tokeInAddress is not the base asset of the destination\"}],\"NonZeroIncentiveForPrivateConversion()\":[{\"notice\":\"Thrown when trying to set non zero incentive for private conversion\"}],\"Unauthorized(address,address,string)\":[{\"notice\":\"Thrown when the action is prohibited by AccessControlManager\"}],\"ZeroAddressNotAllowed()\":[{\"notice\":\"Thrown if the supplied address is a zero address where it is not allowed\"}],\"ZeroValueNotAllowed()\":[{\"notice\":\"Thrown if the supplied value is 0 where it is not allowed\"}]},\"events\":{\"AssetTransferredToDestination(address,address,address,uint256)\":{\"notice\":\"Emmitted after the funds transferred to the destination address\"},\"BaseAssetUpdated(address,address)\":{\"notice\":\"Emitted when base asset is updated\"},\"ConversionConfigUpdated(address,address,uint256,uint256,uint8,uint8)\":{\"notice\":\"Emitted when config is updated for tokens pair\"},\"ConversionPaused(address)\":{\"notice\":\"Emitted when conversion is paused\"},\"ConversionResumed(address)\":{\"notice\":\"Emitted when conversion is unpaused\"},\"ConvertedExactTokens(address,address,address,address,uint256,uint256)\":{\"notice\":\"Emitted when exact amount of tokens are converted for tokens\"},\"ConvertedExactTokensSupportingFeeOnTransferTokens(address,address,address,address,uint256,uint256)\":{\"notice\":\"Emitted when exact amount of tokens are converted for tokens, for deflationary tokens\"},\"ConvertedForExactTokens(address,address,address,address,uint256,uint256)\":{\"notice\":\"Emitted when tokens are converted for exact amount of tokens\"},\"ConvertedForExactTokensSupportingFeeOnTransferTokens(address,address,address,address,uint256,uint256)\":{\"notice\":\"Emitted when tokens are converted for exact amount of tokens, for deflationary tokens\"},\"ConverterNetworkAddressUpdated(address,address)\":{\"notice\":\"Emitted when converterNetwork address is updated\"},\"DestinationAddressUpdated(address,address)\":{\"notice\":\"Emitted when destination address is updated\"},\"MinAmountToConvertUpdated(uint256,uint256)\":{\"notice\":\"Emitted when minimum amount to convert is updated\"},\"NewAccessControlManager(address,address)\":{\"notice\":\"Emitted when access control manager contract address is changed\"},\"PriceOracleUpdated(address,address)\":{\"notice\":\"Emitted when price oracle address is updated\"},\"SweepToken(address,address,uint256)\":{\"notice\":\"Event emitted when tokens are swept\"}},\"kind\":\"user\",\"methods\":{\"MAX_INCENTIVE()\":{\"notice\":\"Maximum incentive could be\"},\"accessControlManager()\":{\"notice\":\"Returns the address of the access control manager contract\"},\"balanceOf(address)\":{\"notice\":\"Get the balance for specific token\"},\"baseAsset()\":{\"notice\":\"Address of the base asset token\"},\"conversionConfigurations(address,address)\":{\"notice\":\"conversion configurations for the existing pairs\"},\"conversionPaused()\":{\"notice\":\"Boolean for if conversion is paused\"},\"convertExactTokens(uint256,uint256,address,address,address)\":{\"notice\":\"Converts exact amount of tokenAddressIn for tokenAddressOut if there is enough tokens held by the contract\"},\"convertExactTokensSupportingFeeOnTransferTokens(uint256,uint256,address,address,address)\":{\"notice\":\"Converts exact amount of tokenAddressIn for tokenAddressOut if there is enough tokens held by the contract\"},\"convertForExactTokens(uint256,uint256,address,address,address)\":{\"notice\":\"Converts tokens for tokenAddressIn for exact amount of tokenAddressOut if there is enough tokens held by the contract, otherwise the amount is adjusted\"},\"convertForExactTokensSupportingFeeOnTransferTokens(uint256,uint256,address,address,address)\":{\"notice\":\"Converts tokens for tokenAddressIn for amount of tokenAddressOut calculated on the basis of amount of tokenAddressIn received by the contract, if there is enough tokens held by the contract, otherwise the amount is adjusted. The user will be responsible for bearing any fees associated with token transfers, whether pulling in or pushing out tokens\"},\"converterNetwork()\":{\"notice\":\"Address of the converterNetwork contract\"},\"destinationAddress()\":{\"notice\":\"Address that all incoming tokens are transferred to\"},\"getAmountIn(uint256,address,address)\":{\"notice\":\"To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut. This function does not account for potential token transfer fees(in case of deflationary tokens)\"},\"getAmountOut(uint256,address,address)\":{\"notice\":\"To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn. This function does not account for potential token transfer fees(in case of deflationary tokens)\"},\"getUpdatedAmountIn(uint256,address,address)\":{\"notice\":\"To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut\"},\"getUpdatedAmountOut(uint256,address,address)\":{\"notice\":\"To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn\"},\"minAmountToConvert()\":{\"notice\":\"Min amount to convert for private conversions. Defined in USD, with 18 decimals\"},\"pauseConversion()\":{\"notice\":\"Pause conversion of tokens\"},\"priceOracle()\":{\"notice\":\"Venus price oracle contract\"},\"resumeConversion()\":{\"notice\":\"Resume conversion of tokens.\"},\"setAccessControlManager(address)\":{\"notice\":\"Sets the address of AccessControlManager\"},\"setBaseAsset(address)\":{\"notice\":\"Sets the base asset for the contract\"},\"setConversionConfig(address,address,(uint256,uint8))\":{\"notice\":\"Set the configuration for new or existing conversion pair\"},\"setConversionConfigs(address,address[],(uint256,uint8)[])\":{\"notice\":\"Batch sets the conversion configurations\"},\"setConverterNetwork(address)\":{\"notice\":\"Sets a converter network contract address\"},\"setDestination(address)\":{\"notice\":\"Sets a new destination address\"},\"setMinAmountToConvert(uint256)\":{\"notice\":\"Min amount to convert setter\"},\"setPriceOracle(address)\":{\"notice\":\"Sets a new price oracle\"},\"sweepToken(address,address,uint256)\":{\"notice\":\"To sweep ERC20 tokens and transfer them to user(to address)\"},\"updateAssetsState(address,address)\":{\"notice\":\"This method updated the states of this contract after getting funds from PSR after settling the amount(if any) through privateConversion between converters\"}},\"notice\":\"SingleTokenConverter used for token conversions and sends received tokens\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/TokenConverter/SingleTokenConverter.sol\":\"SingleTokenConverter\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable2Step.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./OwnableUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership} and {acceptOwnership}.\\n *\\n * This module is used through inheritance. It will make available all functions\\n * from parent (Ownable).\\n */\\nabstract contract Ownable2StepUpgradeable is Initializable, OwnableUpgradeable {\\n function __Ownable2Step_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable2Step_init_unchained() internal onlyInitializing {\\n }\\n address private _pendingOwner;\\n\\n event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Returns the address of the pending owner.\\n */\\n function pendingOwner() public view virtual returns (address) {\\n return _pendingOwner;\\n }\\n\\n /**\\n * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual override onlyOwner {\\n _pendingOwner = newOwner;\\n emit OwnershipTransferStarted(owner(), newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual override {\\n delete _pendingOwner;\\n super._transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev The new owner accepts the ownership transfer.\\n */\\n function acceptOwnership() public virtual {\\n address sender = _msgSender();\\n require(pendingOwner() == sender, \\\"Ownable2Step: caller is not the new owner\\\");\\n _transferOwnership(sender);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x84efb8889801b0ac817324aff6acc691d07bbee816b671817132911d287a8c63\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function __Ownable_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable_init_unchained() internal onlyInitializing {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby disabling any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x4075622496acc77fd6d4de4cc30a8577a744d5c75afad33fdeacf1704d6eda98\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```solidity\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n *\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized != type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0x89be10e757d242e9b18d5a32c9fbe2019f6d63052bbe46397a430a1d60d7f794\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which allows children to implement an emergency stop\\n * mechanism that can be triggered by an authorized account.\\n *\\n * This module is used through inheritance. It will make available the\\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\\n * the functions of your contract. Note that they will not be pausable by\\n * simply including this module, only once the modifiers are put in place.\\n */\\nabstract contract PausableUpgradeable is Initializable, ContextUpgradeable {\\n /**\\n * @dev Emitted when the pause is triggered by `account`.\\n */\\n event Paused(address account);\\n\\n /**\\n * @dev Emitted when the pause is lifted by `account`.\\n */\\n event Unpaused(address account);\\n\\n bool private _paused;\\n\\n /**\\n * @dev Initializes the contract in unpaused state.\\n */\\n function __Pausable_init() internal onlyInitializing {\\n __Pausable_init_unchained();\\n }\\n\\n function __Pausable_init_unchained() internal onlyInitializing {\\n _paused = false;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is not paused.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n modifier whenNotPaused() {\\n _requireNotPaused();\\n _;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is paused.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n modifier whenPaused() {\\n _requirePaused();\\n _;\\n }\\n\\n /**\\n * @dev Returns true if the contract is paused, and false otherwise.\\n */\\n function paused() public view virtual returns (bool) {\\n return _paused;\\n }\\n\\n /**\\n * @dev Throws if the contract is paused.\\n */\\n function _requireNotPaused() internal view virtual {\\n require(!paused(), \\\"Pausable: paused\\\");\\n }\\n\\n /**\\n * @dev Throws if the contract is not paused.\\n */\\n function _requirePaused() internal view virtual {\\n require(paused(), \\\"Pausable: not paused\\\");\\n }\\n\\n /**\\n * @dev Triggers stopped state.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n function _pause() internal virtual whenNotPaused {\\n _paused = true;\\n emit Paused(_msgSender());\\n }\\n\\n /**\\n * @dev Returns to normal state.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n function _unpause() internal virtual whenPaused {\\n _paused = false;\\n emit Unpaused(_msgSender());\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x40c636b4572ff5f1dc50cf22097e93c0723ee14eff87e99ac2b02636eeca1250\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module that helps prevent reentrant calls to a function.\\n *\\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\\n * available, which can be applied to functions to make sure there are no nested\\n * (reentrant) calls to them.\\n *\\n * Note that because there is a single `nonReentrant` guard, functions marked as\\n * `nonReentrant` may not call one another. This can be worked around by making\\n * those functions `private`, and then adding `external` `nonReentrant` entry\\n * points to them.\\n *\\n * TIP: If you would like to learn more about reentrancy and alternative ways\\n * to protect against it, check out our blog post\\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\\n */\\nabstract contract ReentrancyGuardUpgradeable is Initializable {\\n // Booleans are more expensive than uint256 or any type that takes up a full\\n // word because each write operation emits an extra SLOAD to first read the\\n // slot's contents, replace the bits taken up by the boolean, and then write\\n // back. This is the compiler's defense against contract upgrades and\\n // pointer aliasing, and it cannot be disabled.\\n\\n // The values being non-zero value makes deployment a bit more expensive,\\n // but in exchange the refund on every call to nonReentrant will be lower in\\n // amount. Since refunds are capped to a percentage of the total\\n // transaction's gas, it is best to keep them low in cases like this one, to\\n // increase the likelihood of the full refund coming into effect.\\n uint256 private constant _NOT_ENTERED = 1;\\n uint256 private constant _ENTERED = 2;\\n\\n uint256 private _status;\\n\\n function __ReentrancyGuard_init() internal onlyInitializing {\\n __ReentrancyGuard_init_unchained();\\n }\\n\\n function __ReentrancyGuard_init_unchained() internal onlyInitializing {\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Prevents a contract from calling itself, directly or indirectly.\\n * Calling a `nonReentrant` function from another `nonReentrant`\\n * function is not supported. It is possible to prevent this from happening\\n * by making the `nonReentrant` function external, and making it call a\\n * `private` function that does the actual work.\\n */\\n modifier nonReentrant() {\\n _nonReentrantBefore();\\n _;\\n _nonReentrantAfter();\\n }\\n\\n function _nonReentrantBefore() private {\\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\\n require(_status != _ENTERED, \\\"ReentrancyGuard: reentrant call\\\");\\n\\n // Any calls to nonReentrant after this point will fail\\n _status = _ENTERED;\\n }\\n\\n function _nonReentrantAfter() private {\\n // By storing the original value once again, a refund is triggered (see\\n // https://eips.ethereum.org/EIPS/eip-2200)\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Returns true if the reentrancy guard is currently set to \\\"entered\\\", which indicates there is a\\n * `nonReentrant` function in the call stack.\\n */\\n function _reentrancyGuardEntered() internal view returns (bool) {\\n return _status == _ENTERED;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0xb82ef33f43b6b96109687d91b39c94573fdccaaa423fe28e8ba0977b31c023e0\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20Upgradeable {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x0e1f0f5f62f67a881cd1a9597acbc0a5e4071f3c2c10449a183b922ae7272e3f\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20PermitUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\\n *\\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\\n * need to send a transaction, and thus is not required to hold Ether at all.\\n */\\ninterface IERC20PermitUpgradeable {\\n /**\\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\\n * given ``owner``'s signed approval.\\n *\\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\\n * ordering also apply here.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `deadline` must be a timestamp in the future.\\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\\n * over the EIP712-formatted function arguments.\\n * - the signature must use ``owner``'s current nonce (see {nonces}).\\n *\\n * For more information on the signature format, see the\\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\\n * section].\\n */\\n function permit(\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external;\\n\\n /**\\n * @dev Returns the current nonce for `owner`. This value must be\\n * included whenever a signature is generated for {permit}.\\n *\\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\\n * prevents a signature from being used multiple times.\\n */\\n function nonces(address owner) external view returns (uint256);\\n\\n /**\\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0xd60f939a3ca0199014d079b4dd66aa757954334947d81eb5c1d35d7a83061ab3\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20Upgradeable.sol\\\";\\nimport \\\"../extensions/IERC20PermitUpgradeable.sol\\\";\\nimport \\\"../../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20Upgradeable {\\n using AddressUpgradeable for address;\\n\\n /**\\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeTransfer(IERC20Upgradeable token, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n /**\\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\\n */\\n function safeTransferFrom(IERC20Upgradeable token, address from, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\\n }\\n\\n /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\n */\\n function safeApprove(IERC20Upgradeable token, address spender, uint256 value) internal {\\n // safeApprove should only be called when setting an initial allowance,\\n // or when resetting it to zero. To increase and decrease it, use\\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\\n require(\\n (value == 0) || (token.allowance(address(this), spender) == 0),\\n \\\"SafeERC20: approve from non-zero to non-zero allowance\\\"\\n );\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\\n }\\n\\n /**\\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeIncreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));\\n }\\n\\n /**\\n * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeDecreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {\\n unchecked {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n require(oldAllowance >= value, \\\"SafeERC20: decreased allowance below zero\\\");\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));\\n }\\n }\\n\\n /**\\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\\n * to be set to zero before setting it to a non-zero value, such as USDT.\\n */\\n function forceApprove(IERC20Upgradeable token, address spender, uint256 value) internal {\\n bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);\\n\\n if (!_callOptionalReturnBool(token, approvalCall)) {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));\\n _callOptionalReturn(token, approvalCall);\\n }\\n }\\n\\n /**\\n * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.\\n * Revert on invalid signature.\\n */\\n function safePermit(\\n IERC20PermitUpgradeable token,\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal {\\n uint256 nonceBefore = token.nonces(owner);\\n token.permit(owner, spender, value, deadline, v, r, s);\\n uint256 nonceAfter = token.nonces(owner);\\n require(nonceAfter == nonceBefore + 1, \\\"SafeERC20: permit did not succeed\\\");\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20Upgradeable token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\n require(returndata.length == 0 || abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n *\\n * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\\n */\\n function _callOptionalReturnBool(IERC20Upgradeable token, bytes memory data) private returns (bool) {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\\n // and not revert is the subcall reverts.\\n\\n (bool success, bytes memory returndata) = address(token).call(data);\\n return\\n success && (returndata.length == 0 || abi.decode(returndata, (bool))) && AddressUpgradeable.isContract(address(token));\\n }\\n}\\n\",\"keccak256\":\"0x23b997be73d3dd46885262704f0f8cfc7273fdadfe303d37969a9561373972b5\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary AddressUpgradeable {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n *\\n * Furthermore, `isContract` will also return true if the target contract within\\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\\n * which only has an effect at the end of a transaction.\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x9c80f545915582e63fe206c6ce27cbe85a86fc10b9cd2a0e8c9488fb7c2ee422\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract ContextUpgradeable is Initializable {\\n function __Context_init() internal onlyInitializing {\\n }\\n\\n function __Context_init_unchained() internal onlyInitializing {\\n }\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/IAccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev External interface of AccessControl declared to support ERC165 detection.\\n */\\ninterface IAccessControl {\\n /**\\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\\n *\\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\\n * {RoleAdminChanged} not being emitted signaling this.\\n *\\n * _Available since v3.1._\\n */\\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\\n\\n /**\\n * @dev Emitted when `account` is granted `role`.\\n *\\n * `sender` is the account that originated the contract call, an admin role\\n * bearer except when using {AccessControl-_setupRole}.\\n */\\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Emitted when `account` is revoked `role`.\\n *\\n * `sender` is the account that originated the contract call:\\n * - if using `revokeRole`, it is the admin role bearer\\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\\n */\\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) external view returns (bool);\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function grantRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function revokeRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been granted `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n */\\n function renounceRole(bytes32 role, address account) external;\\n}\\n\",\"keccak256\":\"0x59ce320a585d7e1f163cd70390a0ef2ff9cec832e2aa544293a00692465a7a57\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x8de418a5503946cabe331f35fe242d3201a73f67f77aaeb7110acb1f30423aca\",\"license\":\"MIT\"},\"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol\\\";\\n\\nimport \\\"./IAccessControlManagerV8.sol\\\";\\n\\n/**\\n * @title AccessControlledV8\\n * @author Venus\\n * @notice This contract is helper between access control manager and actual contract. This contract further inherited by other contract (using solidity 0.8.13)\\n * to integrate access controlled mechanism. It provides initialise methods and verifying access methods.\\n */\\nabstract contract AccessControlledV8 is Initializable, Ownable2StepUpgradeable {\\n /// @notice Access control manager contract\\n IAccessControlManagerV8 private _accessControlManager;\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n\\n /// @notice Emitted when access control manager contract address is changed\\n event NewAccessControlManager(address oldAccessControlManager, address newAccessControlManager);\\n\\n /// @notice Thrown when the action is prohibited by AccessControlManager\\n error Unauthorized(address sender, address calledContract, string methodSignature);\\n\\n function __AccessControlled_init(address accessControlManager_) internal onlyInitializing {\\n __Ownable2Step_init();\\n __AccessControlled_init_unchained(accessControlManager_);\\n }\\n\\n function __AccessControlled_init_unchained(address accessControlManager_) internal onlyInitializing {\\n _setAccessControlManager(accessControlManager_);\\n }\\n\\n /**\\n * @notice Sets the address of AccessControlManager\\n * @dev Admin function to set address of AccessControlManager\\n * @param accessControlManager_ The new address of the AccessControlManager\\n * @custom:event Emits NewAccessControlManager event\\n * @custom:access Only Governance\\n */\\n function setAccessControlManager(address accessControlManager_) external onlyOwner {\\n _setAccessControlManager(accessControlManager_);\\n }\\n\\n /**\\n * @notice Returns the address of the access control manager contract\\n */\\n function accessControlManager() external view returns (IAccessControlManagerV8) {\\n return _accessControlManager;\\n }\\n\\n /**\\n * @dev Internal function to set address of AccessControlManager\\n * @param accessControlManager_ The new address of the AccessControlManager\\n */\\n function _setAccessControlManager(address accessControlManager_) internal {\\n require(address(accessControlManager_) != address(0), \\\"invalid acess control manager address\\\");\\n address oldAccessControlManager = address(_accessControlManager);\\n _accessControlManager = IAccessControlManagerV8(accessControlManager_);\\n emit NewAccessControlManager(oldAccessControlManager, accessControlManager_);\\n }\\n\\n /**\\n * @notice Reverts if the call is not allowed by AccessControlManager\\n * @param signature Method signature\\n */\\n function _checkAccessAllowed(string memory signature) internal view {\\n bool isAllowedToCall = _accessControlManager.isAllowedToCall(msg.sender, signature);\\n\\n if (!isAllowedToCall) {\\n revert Unauthorized(msg.sender, address(this), signature);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x1b805a5d09990e2c4f7839afe7726a02f8452261eb3d0d488e24129ec0a7736d\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/governance-contracts/contracts/Governance/IAccessControlManagerV8.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\nimport \\\"@openzeppelin/contracts/access/IAccessControl.sol\\\";\\n\\n/**\\n * @title IAccessControlManagerV8\\n * @author Venus\\n * @notice Interface implemented by the `AccessControlManagerV8` contract.\\n */\\ninterface IAccessControlManagerV8 is IAccessControl {\\n function giveCallPermission(address contractAddress, string calldata functionSig, address accountToPermit) external;\\n\\n function revokeCallPermission(\\n address contractAddress,\\n string calldata functionSig,\\n address accountToRevoke\\n ) external;\\n\\n function isAllowedToCall(address account, string calldata functionSig) external view returns (bool);\\n\\n function hasPermission(\\n address account,\\n address contractAddress,\\n string calldata functionSig\\n ) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x8adbe291d659987faf4de606736227ad9d8e1a0e284a33a6ca12b30ab2a504b2\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/oracle/contracts/ResilientOracle.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\n// SPDX-FileCopyrightText: 2022 Venus\\npragma solidity 0.8.13;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol\\\";\\nimport \\\"./interfaces/VBep20Interface.sol\\\";\\nimport \\\"./interfaces/OracleInterface.sol\\\";\\nimport \\\"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\\\";\\n\\n/**\\n * @title ResilientOracle\\n * @author Venus\\n * @notice The Resilient Oracle is the main contract that the protocol uses to fetch prices of assets.\\n * \\n * DeFi protocols are vulnerable to price oracle failures including oracle manipulation and incorrectly\\n * reported prices. If only one oracle is used, this creates a single point of failure and opens a vector\\n * for attacking the protocol.\\n * \\n * The Resilient Oracle uses multiple sources and fallback mechanisms to provide accurate prices and protect\\n * the protocol from oracle attacks. Currently it includes integrations with Chainlink, Pyth, Binance Oracle\\n * and TWAP (Time-Weighted Average Price) oracles. TWAP uses PancakeSwap as the on-chain price source.\\n * \\n * For every market (vToken) we configure the main, pivot and fallback oracles. The oracles are configured per \\n * vToken's underlying asset address. The main oracle oracle is the most trustworthy price source, the pivot \\n * oracle is used as a loose sanity checker and the fallback oracle is used as a backup price source. \\n * \\n * To validate prices returned from two oracles, we use an upper and lower bound ratio that is set for every\\n * market. The upper bound ratio represents the deviation between reported price (the price that\\u2019s being\\n * validated) and the anchor price (the price we are validating against) above which the reported price will\\n * be invalidated. The lower bound ratio presents the deviation between reported price and anchor price below\\n * which the reported price will be invalidated. So for oracle price to be considered valid the below statement\\n * should be true:\\n\\n```\\nanchorRatio = anchorPrice/reporterPrice\\nisValid = anchorRatio <= upperBoundAnchorRatio && anchorRatio >= lowerBoundAnchorRatio\\n```\\n\\n * In most cases, Chainlink is used as the main oracle, TWAP or Pyth oracles are used as the pivot oracle depending\\n * on which supports the given market and Binance oracle is used as the fallback oracle. For some markets we may\\n * use Pyth or TWAP as the main oracle if the token price is not supported by Chainlink or Binance oracles. \\n * \\n * For a fetched price to be valid it must be positive and not stagnant. If the price is invalid then we consider the\\n * oracle to be stagnant and treat it like it's disabled.\\n */\\ncontract ResilientOracle is PausableUpgradeable, AccessControlledV8, ResilientOracleInterface {\\n /**\\n * @dev Oracle roles:\\n * **main**: The most trustworthy price source\\n * **pivot**: Price oracle used as a loose sanity checker\\n * **fallback**: The backup source when main oracle price is invalidated\\n */\\n enum OracleRole {\\n MAIN,\\n PIVOT,\\n FALLBACK\\n }\\n\\n struct TokenConfig {\\n /// @notice asset address\\n address asset;\\n /// @notice `oracles` stores the oracles based on their role in the following order:\\n /// [main, pivot, fallback],\\n /// It can be indexed with the corresponding enum OracleRole value\\n address[3] oracles;\\n /// @notice `enableFlagsForOracles` stores the enabled state\\n /// for each oracle in the same order as `oracles`\\n bool[3] enableFlagsForOracles;\\n }\\n\\n uint256 public constant INVALID_PRICE = 0;\\n\\n /// @notice Native market address\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address public immutable nativeMarket;\\n\\n /// @notice VAI address\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address public immutable vai;\\n\\n /// @notice Set this as asset address for Native token on each chain.This is the underlying for vBNB (on bsc)\\n /// and can serve as any underlying asset of a market that supports native tokens\\n address public constant NATIVE_TOKEN_ADDR = 0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB;\\n\\n /// @notice Bound validator contract address\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n BoundValidatorInterface public immutable boundValidator;\\n\\n mapping(address => TokenConfig) private tokenConfigs;\\n\\n event TokenConfigAdded(\\n address indexed asset,\\n address indexed mainOracle,\\n address indexed pivotOracle,\\n address fallbackOracle\\n );\\n\\n /// Event emitted when an oracle is set\\n event OracleSet(address indexed asset, address indexed oracle, uint256 indexed role);\\n\\n /// Event emitted when an oracle is enabled or disabled\\n event OracleEnabled(address indexed asset, uint256 indexed role, bool indexed enable);\\n\\n /**\\n * @notice Checks whether an address is null or not\\n */\\n modifier notNullAddress(address someone) {\\n if (someone == address(0)) revert(\\\"can't be zero address\\\");\\n _;\\n }\\n\\n /**\\n * @notice Checks whether token config exists by checking whether asset is null address\\n * @dev address can't be null, so it's suitable to be used to check the validity of the config\\n * @param asset asset address\\n */\\n modifier checkTokenConfigExistence(address asset) {\\n if (tokenConfigs[asset].asset == address(0)) revert(\\\"token config must exist\\\");\\n _;\\n }\\n\\n /// @notice Constructor for the implementation contract. Sets immutable variables.\\n /// @dev nativeMarketAddress can be address(0) if on the chain we do not support native market\\n /// (e.g vETH on ethereum would not be supported, only vWETH)\\n /// @param nativeMarketAddress The address of a native market (for bsc it would be vBNB address)\\n /// @param vaiAddress The address of the VAI token (if there is VAI on the deployed chain).\\n /// Set to address(0) of VAI is not existent.\\n /// @param _boundValidator Address of the bound validator contract\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(\\n address nativeMarketAddress,\\n address vaiAddress,\\n BoundValidatorInterface _boundValidator\\n ) notNullAddress(address(_boundValidator)) {\\n nativeMarket = nativeMarketAddress;\\n vai = vaiAddress;\\n boundValidator = _boundValidator;\\n\\n _disableInitializers();\\n }\\n\\n /**\\n * @notice Initializes the contract admin and sets the BoundValidator contract address\\n * @param accessControlManager_ Address of the access control manager contract\\n */\\n function initialize(address accessControlManager_) external initializer {\\n __AccessControlled_init(accessControlManager_);\\n __Pausable_init();\\n }\\n\\n /**\\n * @notice Pauses oracle\\n * @custom:access Only Governance\\n */\\n function pause() external {\\n _checkAccessAllowed(\\\"pause()\\\");\\n _pause();\\n }\\n\\n /**\\n * @notice Unpauses oracle\\n * @custom:access Only Governance\\n */\\n function unpause() external {\\n _checkAccessAllowed(\\\"unpause()\\\");\\n _unpause();\\n }\\n\\n /**\\n * @notice Batch sets token configs\\n * @param tokenConfigs_ Token config array\\n * @custom:access Only Governance\\n * @custom:error Throws a length error if the length of the token configs array is 0\\n */\\n function setTokenConfigs(TokenConfig[] memory tokenConfigs_) external {\\n if (tokenConfigs_.length == 0) revert(\\\"length can't be 0\\\");\\n uint256 numTokenConfigs = tokenConfigs_.length;\\n for (uint256 i; i < numTokenConfigs; ) {\\n setTokenConfig(tokenConfigs_[i]);\\n unchecked {\\n ++i;\\n }\\n }\\n }\\n\\n /**\\n * @notice Sets oracle for a given asset and role.\\n * @dev Supplied asset **must** exist and main oracle may not be null\\n * @param asset Asset address\\n * @param oracle Oracle address\\n * @param role Oracle role\\n * @custom:access Only Governance\\n * @custom:error Null address error if main-role oracle address is null\\n * @custom:error NotNullAddress error is thrown if asset address is null\\n * @custom:error TokenConfigExistance error is thrown if token config is not set\\n * @custom:event Emits OracleSet event with asset address, oracle address and role of the oracle for the asset\\n */\\n function setOracle(\\n address asset,\\n address oracle,\\n OracleRole role\\n ) external notNullAddress(asset) checkTokenConfigExistence(asset) {\\n _checkAccessAllowed(\\\"setOracle(address,address,uint8)\\\");\\n if (oracle == address(0) && role == OracleRole.MAIN) revert(\\\"can't set zero address to main oracle\\\");\\n tokenConfigs[asset].oracles[uint256(role)] = oracle;\\n emit OracleSet(asset, oracle, uint256(role));\\n }\\n\\n /**\\n * @notice Enables/ disables oracle for the input asset. Token config for the input asset **must** exist\\n * @dev Configuration for the asset **must** already exist and the asset cannot be 0 address\\n * @param asset Asset address\\n * @param role Oracle role\\n * @param enable Enabled boolean of the oracle\\n * @custom:access Only Governance\\n * @custom:error NotNullAddress error is thrown if asset address is null\\n * @custom:error TokenConfigExistance error is thrown if token config is not set\\n */\\n function enableOracle(\\n address asset,\\n OracleRole role,\\n bool enable\\n ) external notNullAddress(asset) checkTokenConfigExistence(asset) {\\n _checkAccessAllowed(\\\"enableOracle(address,uint8,bool)\\\");\\n tokenConfigs[asset].enableFlagsForOracles[uint256(role)] = enable;\\n emit OracleEnabled(asset, uint256(role), enable);\\n }\\n\\n /**\\n * @notice Updates the TWAP pivot oracle price.\\n * @dev This function should always be called before calling getUnderlyingPrice\\n * @param vToken vToken address\\n */\\n function updatePrice(address vToken) external override {\\n address asset = _getUnderlyingAsset(vToken);\\n (address pivotOracle, bool pivotOracleEnabled) = getOracle(asset, OracleRole.PIVOT);\\n if (pivotOracle != address(0) && pivotOracleEnabled) {\\n //if pivot oracle is not TwapOracle it will revert so we need to catch the revert\\n try TwapInterface(pivotOracle).updateTwap(asset) {} catch {}\\n }\\n }\\n\\n /**\\n * @notice Updates the pivot oracle price. Currently using TWAP\\n * @dev This function should always be called before calling getPrice\\n * @param asset asset address\\n */\\n function updateAssetPrice(address asset) external {\\n (address pivotOracle, bool pivotOracleEnabled) = getOracle(asset, OracleRole.PIVOT);\\n if (pivotOracle != address(0) && pivotOracleEnabled) {\\n //if pivot oracle is not TwapOracle it will revert so we need to catch the revert\\n try TwapInterface(pivotOracle).updateTwap(asset) {} catch {}\\n }\\n }\\n\\n /**\\n * @dev Gets token config by asset address\\n * @param asset asset address\\n * @return tokenConfig Config for the asset\\n */\\n function getTokenConfig(address asset) external view returns (TokenConfig memory) {\\n return tokenConfigs[asset];\\n }\\n\\n /**\\n * @notice Gets price of the underlying asset for a given vToken. Validation flow:\\n * - Check if the oracle is paused globally\\n * - Validate price from main oracle against pivot oracle\\n * - Validate price from fallback oracle against pivot oracle if the first validation failed\\n * - Validate price from main oracle against fallback oracle if the second validation failed\\n * In the case that the pivot oracle is not available but main price is available and validation is successful,\\n * main oracle price is returned.\\n * @param vToken vToken address\\n * @return price USD price in scaled decimal places.\\n * @custom:error Paused error is thrown when resilent oracle is paused\\n * @custom:error Invalid resilient oracle price error is thrown if fetched prices from oracle is invalid\\n */\\n function getUnderlyingPrice(address vToken) external view override returns (uint256) {\\n if (paused()) revert(\\\"resilient oracle is paused\\\");\\n\\n address asset = _getUnderlyingAsset(vToken);\\n return _getPrice(asset);\\n }\\n\\n /**\\n * @notice Gets price of the asset\\n * @param asset asset address\\n * @return price USD price in scaled decimal places.\\n * @custom:error Paused error is thrown when resilent oracle is paused\\n * @custom:error Invalid resilient oracle price error is thrown if fetched prices from oracle is invalid\\n */\\n function getPrice(address asset) external view override returns (uint256) {\\n if (paused()) revert(\\\"resilient oracle is paused\\\");\\n return _getPrice(asset);\\n }\\n\\n /**\\n * @notice Sets/resets single token configs.\\n * @dev main oracle **must not** be a null address\\n * @param tokenConfig Token config struct\\n * @custom:access Only Governance\\n * @custom:error NotNullAddress is thrown if asset address is null\\n * @custom:error NotNullAddress is thrown if main-role oracle address for asset is null\\n * @custom:event Emits TokenConfigAdded event when the asset config is set successfully by the authorized account\\n */\\n function setTokenConfig(\\n TokenConfig memory tokenConfig\\n ) public notNullAddress(tokenConfig.asset) notNullAddress(tokenConfig.oracles[uint256(OracleRole.MAIN)]) {\\n _checkAccessAllowed(\\\"setTokenConfig(TokenConfig)\\\");\\n\\n tokenConfigs[tokenConfig.asset] = tokenConfig;\\n emit TokenConfigAdded(\\n tokenConfig.asset,\\n tokenConfig.oracles[uint256(OracleRole.MAIN)],\\n tokenConfig.oracles[uint256(OracleRole.PIVOT)],\\n tokenConfig.oracles[uint256(OracleRole.FALLBACK)]\\n );\\n }\\n\\n /**\\n * @notice Gets oracle and enabled status by asset address\\n * @param asset asset address\\n * @param role Oracle role\\n * @return oracle Oracle address based on role\\n * @return enabled Enabled flag of the oracle based on token config\\n */\\n function getOracle(address asset, OracleRole role) public view returns (address oracle, bool enabled) {\\n oracle = tokenConfigs[asset].oracles[uint256(role)];\\n enabled = tokenConfigs[asset].enableFlagsForOracles[uint256(role)];\\n }\\n\\n function _getPrice(address asset) internal view returns (uint256) {\\n uint256 pivotPrice = INVALID_PRICE;\\n\\n // Get pivot oracle price, Invalid price if not available or error\\n (address pivotOracle, bool pivotOracleEnabled) = getOracle(asset, OracleRole.PIVOT);\\n if (pivotOracleEnabled && pivotOracle != address(0)) {\\n try OracleInterface(pivotOracle).getPrice(asset) returns (uint256 pricePivot) {\\n pivotPrice = pricePivot;\\n } catch {}\\n }\\n\\n // Compare main price and pivot price, return main price and if validation was successful\\n // note: In case pivot oracle is not available but main price is available and\\n // validation is successful, the main oracle price is returned.\\n (uint256 mainPrice, bool validatedPivotMain) = _getMainOraclePrice(\\n asset,\\n pivotPrice,\\n pivotOracleEnabled && pivotOracle != address(0)\\n );\\n if (mainPrice != INVALID_PRICE && validatedPivotMain) return mainPrice;\\n\\n // Compare fallback and pivot if main oracle comparision fails with pivot\\n // Return fallback price when fallback price is validated successfully with pivot oracle\\n (uint256 fallbackPrice, bool validatedPivotFallback) = _getFallbackOraclePrice(asset, pivotPrice);\\n if (fallbackPrice != INVALID_PRICE && validatedPivotFallback) return fallbackPrice;\\n\\n // Lastly compare main price and fallback price\\n if (\\n mainPrice != INVALID_PRICE &&\\n fallbackPrice != INVALID_PRICE &&\\n boundValidator.validatePriceWithAnchorPrice(asset, mainPrice, fallbackPrice)\\n ) {\\n return mainPrice;\\n }\\n\\n revert(\\\"invalid resilient oracle price\\\");\\n }\\n\\n /**\\n * @notice Gets a price for the provided asset\\n * @dev This function won't revert when price is 0, because the fallback oracle may still be\\n * able to fetch a correct price\\n * @param asset asset address\\n * @param pivotPrice Pivot oracle price\\n * @param pivotEnabled If pivot oracle is not empty and enabled\\n * @return price USD price in scaled decimals\\n * e.g. asset decimals is 8 then price is returned as 10**18 * 10**(18-8) = 10**28 decimals\\n * @return pivotValidated Boolean representing if the validation of main oracle price\\n * and pivot oracle price were successful\\n * @custom:error Invalid price error is thrown if main oracle fails to fetch price of the asset\\n * @custom:error Invalid price error is thrown if main oracle is not enabled or main oracle\\n * address is null\\n */\\n function _getMainOraclePrice(\\n address asset,\\n uint256 pivotPrice,\\n bool pivotEnabled\\n ) internal view returns (uint256, bool) {\\n (address mainOracle, bool mainOracleEnabled) = getOracle(asset, OracleRole.MAIN);\\n if (mainOracleEnabled && mainOracle != address(0)) {\\n try OracleInterface(mainOracle).getPrice(asset) returns (uint256 mainOraclePrice) {\\n if (!pivotEnabled) {\\n return (mainOraclePrice, true);\\n }\\n if (pivotPrice == INVALID_PRICE) {\\n return (mainOraclePrice, false);\\n }\\n return (\\n mainOraclePrice,\\n boundValidator.validatePriceWithAnchorPrice(asset, mainOraclePrice, pivotPrice)\\n );\\n } catch {\\n return (INVALID_PRICE, false);\\n }\\n }\\n\\n return (INVALID_PRICE, false);\\n }\\n\\n /**\\n * @dev This function won't revert when the price is 0 because getPrice checks if price is > 0\\n * @param asset asset address\\n * @return price USD price in 18 decimals\\n * @return pivotValidated Boolean representing if the validation of fallback oracle price\\n * and pivot oracle price were successfull\\n * @custom:error Invalid price error is thrown if fallback oracle fails to fetch price of the asset\\n * @custom:error Invalid price error is thrown if fallback oracle is not enabled or fallback oracle\\n * address is null\\n */\\n function _getFallbackOraclePrice(address asset, uint256 pivotPrice) private view returns (uint256, bool) {\\n (address fallbackOracle, bool fallbackEnabled) = getOracle(asset, OracleRole.FALLBACK);\\n if (fallbackEnabled && fallbackOracle != address(0)) {\\n try OracleInterface(fallbackOracle).getPrice(asset) returns (uint256 fallbackOraclePrice) {\\n if (pivotPrice == INVALID_PRICE) {\\n return (fallbackOraclePrice, false);\\n }\\n return (\\n fallbackOraclePrice,\\n boundValidator.validatePriceWithAnchorPrice(asset, fallbackOraclePrice, pivotPrice)\\n );\\n } catch {\\n return (INVALID_PRICE, false);\\n }\\n }\\n\\n return (INVALID_PRICE, false);\\n }\\n\\n /**\\n * @dev This function returns the underlying asset of a vToken\\n * @param vToken vToken address\\n * @return asset underlying asset address\\n */\\n function _getUnderlyingAsset(address vToken) private view notNullAddress(vToken) returns (address asset) {\\n if (vToken == nativeMarket) {\\n asset = NATIVE_TOKEN_ADDR;\\n } else if (vToken == vai) {\\n asset = vai;\\n } else {\\n asset = VBep20Interface(vToken).underlying();\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3bead63c5f2aca7e1ea5e9a075816e9e3551ce3a886f5f3707040262ad6d2c35\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/oracle/contracts/interfaces/OracleInterface.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\ninterface OracleInterface {\\n function getPrice(address asset) external view returns (uint256);\\n}\\n\\ninterface ResilientOracleInterface is OracleInterface {\\n function updatePrice(address vToken) external;\\n\\n function updateAssetPrice(address asset) external;\\n\\n function getUnderlyingPrice(address vToken) external view returns (uint256);\\n}\\n\\ninterface TwapInterface is OracleInterface {\\n function updateTwap(address asset) external returns (uint256);\\n}\\n\\ninterface BoundValidatorInterface {\\n function validatePriceWithAnchorPrice(\\n address asset,\\n uint256 reporterPrice,\\n uint256 anchorPrice\\n ) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x40031b19684ca0c912e794d08c2c0b0d8be77d3c1bdc937830a0658eff899650\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/oracle/contracts/interfaces/VBep20Interface.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\\\";\\n\\ninterface VBep20Interface is IERC20Metadata {\\n /**\\n * @notice Underlying asset for this VToken\\n */\\n function underlying() external view returns (address);\\n}\\n\",\"keccak256\":\"0x3f845cd51b2d82f7932ac6c0ab714df97f733b01ce50f6fb0adb4c28447d4618\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/solidity-utilities/contracts/constants.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\n/// @dev Base unit for computations, usually used in scaling (multiplications, divisions)\\nuint256 constant EXP_SCALE = 1e18;\\n\\n/// @dev A unit (literal one) in EXP_SCALE, usually used in additions/subtractions\\nuint256 constant MANTISSA_ONE = EXP_SCALE;\\n\\n/// @dev The approximate number of seconds per year\\nuint256 constant SECONDS_PER_YEAR = 31_536_000;\\n\",\"keccak256\":\"0x0464dd1b882ea2925e06e967c025a232c824e9e4c7aee7b97cc255d040594a59\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/solidity-utilities/contracts/validators.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\n/// @notice Thrown if the supplied address is a zero address where it is not allowed\\nerror ZeroAddressNotAllowed();\\n\\n/// @notice Thrown if the supplied value is 0 where it is not allowed\\nerror ZeroValueNotAllowed();\\n\\n/// @notice Checks if the provided address is nonzero, reverts otherwise\\n/// @param address_ Address to check\\n/// @custom:error ZeroAddressNotAllowed is thrown if the provided address is a zero address\\nfunction ensureNonzeroAddress(address address_) pure {\\n if (address_ == address(0)) {\\n revert ZeroAddressNotAllowed();\\n }\\n}\\n\\n/// @notice Checks if the provided value is nonzero, reverts otherwise\\n/// @param value_ Value to check\\n/// @custom:error ZeroValueNotAllowed is thrown if the provided value is 0\\nfunction ensureNonzeroValue(uint256 value_) pure {\\n if (value_ == 0) {\\n revert ZeroValueNotAllowed();\\n }\\n}\\n\",\"keccak256\":\"0xd55726634a83a862a9cef9d34c41694d3d0fea86cdbc57d6674af066792194b1\",\"license\":\"BSD-3-Clause\"},\"contracts/Interfaces/IConverterNetwork.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\nimport { IAbstractTokenConverter } from \\\"../TokenConverter/IAbstractTokenConverter.sol\\\";\\n\\n/**\\n * @title IConverterNetwork\\n * @author Venus\\n * @notice Interface implemented by `ConverterNetwork`.\\n */\\ninterface IConverterNetwork {\\n /// @notice Adds new converter to the array\\n /// @param _tokenConverter Address of the token converter\\n function addTokenConverter(IAbstractTokenConverter _tokenConverter) external;\\n\\n /// @notice Removes converter from the array\\n /// @param _tokenConverter Address of the token converter\\n function removeTokenConverter(IAbstractTokenConverter _tokenConverter) external;\\n\\n /// @notice Used to get the array of converters supporting conversions, arranged in descending order based on token balances\\n /// @param _tokenAddressIn Address of tokenIn\\n /// @param _tokenAddressOut Address of tokenOut\\n /// @return converters Array of the conveters on the basis of the tokens pair\\n /// @return convertersBalance Array of balances with respect to token out\\n function findTokenConverters(address _tokenAddressIn, address _tokenAddressOut)\\n external\\n returns (address[] memory converters, uint256[] memory convertersBalance);\\n\\n /// @notice Used to get the array of converters supporting conversions, arranged in descending order based on token balances\\n /// @param _tokenAddressIn Address of tokenIn\\n /// @param _tokenAddressOut Address of tokenOut\\n /// @return converters Array of the conveters on the basis of the tokens pair\\n /// @return convertersBalance Array of balances with respect to token out\\n function findTokenConvertersForConverters(address _tokenAddressIn, address _tokenAddressOut)\\n external\\n returns (address[] memory converters, uint256[] memory convertersBalance);\\n\\n /// @notice This function returns the array containing all the converters addresses\\n /// @return Array containing all the converters addresses\\n function getAllConverters() external view returns (IAbstractTokenConverter[] memory);\\n\\n /// @notice This function checks for given address is converter or not\\n /// @param _tokenConverter Address of the token converter\\n /// @return boolean true if given address is converter otherwise false\\n function isTokenConverter(address _tokenConverter) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x185dac944af690a34378319c568454fb7ce917c2ab6acdb514eec02e00965107\",\"license\":\"BSD-3-Clause\"},\"contracts/TokenConverter/AbstractTokenConverter.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\nimport { ReentrancyGuardUpgradeable } from \\\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\\\";\\nimport { SafeERC20Upgradeable } from \\\"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\\\";\\nimport { AccessControlledV8 } from \\\"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\\\";\\nimport { IERC20Upgradeable } from \\\"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\\\";\\nimport { ResilientOracle } from \\\"@venusprotocol/oracle/contracts/ResilientOracle.sol\\\";\\nimport { ensureNonzeroAddress, ensureNonzeroValue } from \\\"@venusprotocol/solidity-utilities/contracts/validators.sol\\\";\\nimport { MANTISSA_ONE, EXP_SCALE } from \\\"@venusprotocol/solidity-utilities/contracts/constants.sol\\\";\\n\\nimport { IAbstractTokenConverter } from \\\"./IAbstractTokenConverter.sol\\\";\\nimport { IConverterNetwork } from \\\"../Interfaces/IConverterNetwork.sol\\\";\\n\\n/// @title AbstractTokenConverter\\n/// @author Venus\\n/// @notice Abstract contract will be extended by SingleTokenConverter and RiskFundConverter\\n/*\\n * This contract specifies four functions for converting tokens, each applicable under following circumstances:\\n *\\n * Case I: TokenIn -> deflationary token, TokenOut -> deflationary token\\n * In this scenario, functions supporting fees can only be utilized to convert tokens which are:\\n * a. convertExactTokensSupportingFeeOnTransferTokens\\n * b. convertForExactTokensSupportingFeeOnTransferTokens\\n *\\n * Case II: TokenIn -> deflationary token, TokenOut -> non-deflationary token\\n * In this scenario, functions supporting fee can only be utilized to convert tokens which are:\\n * similar to Case I.\\n *\\n * Case III: TokenIn -> non-deflationary token, TokenOut -> deflationary token\\n * In this scenario, functions with or without supporting fee can be utilized to convert tokens which are:\\n * a. convertExactTokens\\n * b. convertForExactTokens\\n * c. convertExactTokensSupportingFeeOnTransferTokens\\n * d. convertForExactTokensSupportingFeeOnTransferTokens\\n *\\n * Case IV: TokenIn -> non-deflationary token, TokenOut -> non-deflationary token\\n * In this scenario, functions with or without supporting fee can be utilized to convert tokens which are:\\n * similar to Case III.\\n *\\n * ------------------------------------------------------------------------------------------------------------------------------------\\n * Example 1:-\\n * tokenInAddress - 0xaaaa.....\\n * tokenOutAddress - 0xbbbb.....\\n * tokenInAmount - 100\\n * tokenOutMinAmount - minimum amount desired by the user(let's say 70)\\n * Here user can use `convertExactTokens` or `convertExactTokensSupportingFeeOnTransferTokens`, if tokenIn is deflationary\\n * then `convertExactTokensSupportingFeeOnTransferTokens` should be used(let's suppose `convertExactTokens` is used).\\n * Now first tokenInAddress tokens will be transferred from the user to the contract, on the basis of amount\\n * received(as tokenInAddress can be deflationary token) tokenAmountOut will be calculated and will be transferred\\n * to the user and if amount sent is less than tokenOutMinAmount, tx will revert. If amount sent is satisfied(let's say\\n * 80 or even 70) then at last the actual amount received and the amount that was supposed to be received by the contract will\\n * be compared, if they differ then the whole tx will revert as user was supposed to use `convertExactTokensSupportingFeeOnTransferTokens`\\n * function for tokenIn as deflationary token.\\n *\\n * Example 2:-\\n * tokenInAddress - 0xaaaa.....\\n * tokenOutAddress - 0xbbbb.....\\n * tokenInMaxAmount - maximum amount user is willing to provide(let's say 100)\\n * tokenOutAmount - 70\\n * Here user can use `convertForExactTokens` or `convertForExactTokensSupportingFeeOnTransferTokens`, if tokenIn is deflationary\\n * then `convertForExactTokensSupportingFeeOnTransferTokens` should be used(let's suppose `convertForExactTokens` is used),\\n * which on the basis of tokenOutAmount provided will calculate tokenInAmount based on the tokens prices and will transfer\\n * tokens from the user to the contract, now the actual amount received(as tokenInAddress can be deflationary token) will be\\n * compared with tokenInMaxAmount if it is greater, tx will revert. If In amount is satisfied(let's say 90 or even 100) then\\n * new tokenOutAmount will be calculated, and tokenOutAddress tokens will be transferred to the user, but at last the\\n * old tokenOutAmount and new tokenOutAmount will be compared and if they differ whole tx will revert, because user was\\n * supposed to use `convertForExactTokensSupportingFeeOnTransferTokens` function for tokenIn as deflationary token.\\n * ------------------------------------------------------------------------------------------------------------------------------------\\n *\\n * This contract also supports private conversion between the converters:\\n * Private conversions:\\n * Private conversions is designed in order to convert the maximum amount of tokens received from PSR(to any converter) between\\n * existing converters to save incentive and lower the dependency of users for conversion. So Private Conversion will be executed\\n * by converters on it's own whenever funds are received from PSR. No incentive will be offered during private conversion.\\n *\\n * It will execute on updateAssetsState() function call in Converter Contracts. After this function call, converter will first\\n * check for the amount received. If base asset is received then it will be directly sent to the destination address and no private\\n * conversion will happen otherwise converter will interact with ConverterNetwork contract to find other valid converters who are providing the conversion for:\\n *\\n * tokenAddressIn: As asset received by that converter on updateAssetsState() function call.\\n * tokenAddressOut: As base asset of that converter.\\n *\\n * ConverterNetwork:\\n * This contract will contain all the converters, and will provide valid converters which can perform the execution according to tokenAddressIn\\n * and tokenAddressOut provided.\\n *\\n * findTokenConverters():\\n * It will return an array of converter addresses along with their corresponding balances, sorted in descending order based on the converter's balances\\n * relative to tokenAddressOut. This function filter the converter addresses on the basis of the conversionAccess(for users).\\n *\\n * findTokenConvertersForConverters():\\n * It will return an array of converter addresses along with their corresponding balances, sorted in descending order based on the converter's balances\\n * relative to tokenAddressOut. This function filter the converter addresses on the basis of the conversionAccess(for converters).\\n */\\n\\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\\nabstract contract AbstractTokenConverter is AccessControlledV8, IAbstractTokenConverter, ReentrancyGuardUpgradeable {\\n using SafeERC20Upgradeable for IERC20Upgradeable;\\n\\n /// @notice Maximum incentive could be\\n uint256 public constant MAX_INCENTIVE = 0.5e18;\\n\\n /// @notice Min amount to convert for private conversions. Defined in USD, with 18 decimals\\n uint256 public minAmountToConvert;\\n\\n /// @notice Venus price oracle contract\\n ResilientOracle public priceOracle;\\n\\n /// @notice conversion configurations for the existing pairs\\n /// @dev tokenAddressIn => tokenAddressOut => ConversionConfig\\n mapping(address => mapping(address => ConversionConfig)) public conversionConfigurations;\\n\\n /// @notice Address that all incoming tokens are transferred to\\n address public destinationAddress;\\n\\n /// @notice Boolean for if conversion is paused\\n bool public conversionPaused;\\n\\n /// @notice Address of the converterNetwork contract\\n IConverterNetwork public converterNetwork;\\n\\n /// @dev This empty reserved space is put in place to allow future versions to add new\\n /// variables without shifting down storage in the inheritance chain.\\n /// See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n uint256[45] private __gap;\\n\\n /// @notice Emitted when config is updated for tokens pair\\n event ConversionConfigUpdated(\\n address indexed tokenAddressIn,\\n address indexed tokenAddressOut,\\n uint256 oldIncentive,\\n uint256 newIncentive,\\n ConversionAccessibility oldAccess,\\n ConversionAccessibility newAccess\\n );\\n /// @notice Emitted when price oracle address is updated\\n event PriceOracleUpdated(ResilientOracle indexed oldPriceOracle, ResilientOracle indexed priceOracle);\\n\\n /// @notice Emitted when destination address is updated\\n event DestinationAddressUpdated(address indexed oldDestinationAddress, address indexed destinationAddress);\\n\\n /// @notice Emitted when converterNetwork address is updated\\n event ConverterNetworkAddressUpdated(address indexed oldConverterNetwork, address indexed converterNetwork);\\n\\n /// @notice Emitted when exact amount of tokens are converted for tokens\\n event ConvertedExactTokens(\\n address indexed sender,\\n address indexed receiver,\\n address tokenAddressIn,\\n address indexed tokenAddressOut,\\n uint256 amountIn,\\n uint256 amountOut\\n );\\n\\n /// @notice Emitted when tokens are converted for exact amount of tokens\\n event ConvertedForExactTokens(\\n address indexed sender,\\n address indexed receiver,\\n address tokenAddressIn,\\n address indexed tokenAddressOut,\\n uint256 amountIn,\\n uint256 amountOut\\n );\\n\\n /// @notice Emitted when exact amount of tokens are converted for tokens, for deflationary tokens\\n event ConvertedExactTokensSupportingFeeOnTransferTokens(\\n address indexed sender,\\n address indexed receiver,\\n address tokenAddressIn,\\n address indexed tokenAddressOut,\\n uint256 amountIn,\\n uint256 amountOut\\n );\\n\\n /// @notice Emitted when tokens are converted for exact amount of tokens, for deflationary tokens\\n event ConvertedForExactTokensSupportingFeeOnTransferTokens(\\n address indexed sender,\\n address indexed receiver,\\n address tokenAddressIn,\\n address indexed tokenAddressOut,\\n uint256 amountIn,\\n uint256 amountOut\\n );\\n\\n /// @notice Emitted when conversion is paused\\n event ConversionPaused(address indexed sender);\\n\\n /// @notice Emitted when conversion is unpaused\\n event ConversionResumed(address indexed sender);\\n\\n /// @notice Event emitted when tokens are swept\\n event SweepToken(address indexed token, address indexed to, uint256 amount);\\n\\n /// @notice Emitted when minimum amount to convert is updated\\n event MinAmountToConvertUpdated(uint256 oldMinAmountToConvert, uint256 newMinAmountToConvert);\\n\\n /// @notice Thrown when actualAmountOut does not match with amountOutMantissa for convertForExactTokens\\n error AmountOutMismatched();\\n\\n /// @notice Thrown when actualAmountIn does not match with amountInMantissa for convertForExactTokens\\n error AmountInMismatched();\\n\\n /// @notice Thrown when given input amount is zero\\n error InsufficientInputAmount();\\n\\n /// @notice Thrown when given output amount is zero\\n error InsufficientOutputAmount();\\n\\n /// @notice Thrown when conversion is disabled or config does not exist for given pair\\n error ConversionConfigNotEnabled();\\n\\n /// @notice Thrown when conversion is enabled only for private conversions\\n error ConversionEnabledOnlyForPrivateConversions();\\n\\n /// @notice Thrown when address(to) is same as tokenAddressIn or tokenAddressOut\\n error InvalidToAddress();\\n\\n /// @notice Thrown when incentive is higher than the MAX_INCENTIVE\\n error IncentiveTooHigh(uint256 incentive, uint256 maxIncentive);\\n\\n /// @notice Thrown when amountOut is lower than amountOutMin\\n error AmountOutLowerThanMinRequired(uint256 amountOutMantissa, uint256 amountOutMinMantissa);\\n\\n /// @notice Thrown when amountIn is higher than amountInMax\\n error AmountInHigherThanMax(uint256 amountInMantissa, uint256 amountInMaxMantissa);\\n\\n /// @notice Thrown when conversion is paused\\n error ConversionTokensPaused();\\n\\n /// @notice Thrown when conversion is Active\\n error ConversionTokensActive();\\n\\n /// @notice Thrown when tokenInAddress is same as tokeOutAdress OR tokeInAddress is not the base asset of the destination\\n error InvalidTokenConfigAddresses();\\n\\n /// @notice Thrown when contract has less liquidity for tokenAddressOut than amountOutMantissa\\n error InsufficientPoolLiquidity();\\n\\n /// @notice When address of the ConverterNetwork is not set or Zero address\\n error InvalidConverterNetwork();\\n\\n /// @notice Thrown when trying to set non zero incentive for private conversion\\n error NonZeroIncentiveForPrivateConversion();\\n\\n /// @notice Thrown when using convertForExactTokens deflationary tokens\\n error DeflationaryTokenNotSupported();\\n\\n /// @notice Thrown when minimum amount to convert is zero\\n error InvalidMinimumAmountToConvert();\\n\\n /// @notice Thrown when there is a mismatch in the length of input arrays\\n error InputLengthMisMatch();\\n\\n /**\\n * @notice Modifier to ensure valid conversion parameters for a token conversion\\n * and check if conversion is paused or not\\n * @param to The recipient address for the converted tokens\\n * @param tokenAddressIn The input token address for the conversion\\n * @param tokenAddressOut The output token address for the conversion\\n */\\n modifier validConversionParameters(\\n address to,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) {\\n _checkConversionPaused();\\n ensureNonzeroAddress(to);\\n if (to == tokenAddressIn || to == tokenAddressOut) {\\n revert InvalidToAddress();\\n }\\n _;\\n }\\n\\n /// @notice Pause conversion of tokens\\n /// @custom:event Emits ConversionPaused on success\\n /// @custom:error ConversionTokensPaused thrown when conversion is already paused\\n /// @custom:access Restricted by ACM\\n function pauseConversion() external {\\n _checkAccessAllowed(\\\"pauseConversion()\\\");\\n _checkConversionPaused();\\n conversionPaused = true;\\n emit ConversionPaused(msg.sender);\\n }\\n\\n /// @notice Resume conversion of tokens.\\n /// @custom:event Emits ConversionResumed on success\\n /// @custom:error ConversionTokensActive thrown when conversion is already active\\n /// @custom:access Restricted by ACM\\n function resumeConversion() external {\\n _checkAccessAllowed(\\\"resumeConversion()\\\");\\n if (!conversionPaused) {\\n revert ConversionTokensActive();\\n }\\n\\n conversionPaused = false;\\n emit ConversionResumed(msg.sender);\\n }\\n\\n /// @notice Sets a new price oracle\\n /// @param priceOracle_ Address of the new price oracle to set\\n /// @custom:access Only Governance\\n function setPriceOracle(ResilientOracle priceOracle_) external onlyOwner {\\n _setPriceOracle(priceOracle_);\\n }\\n\\n /// @notice Sets a new destination address\\n /// @param destinationAddress_ The new destination address to be set\\n /// @custom:access Only Governance\\n function setDestination(address destinationAddress_) external onlyOwner {\\n _setDestination(destinationAddress_);\\n }\\n\\n /// @notice Sets a converter network contract address\\n /// @param converterNetwork_ The converterNetwork address to be set\\n /// @custom:access Only Governance\\n function setConverterNetwork(IConverterNetwork converterNetwork_) external onlyOwner {\\n _setConverterNetwork(converterNetwork_);\\n }\\n\\n /// @notice Min amount to convert setter\\n /// @param minAmountToConvert_ Min amount to convert\\n /// @custom:access Only Governance\\n function setMinAmountToConvert(uint256 minAmountToConvert_) external {\\n _checkAccessAllowed(\\\"setMinAmountToConvert(uint256)\\\");\\n _setMinAmountToConvert(minAmountToConvert_);\\n }\\n\\n /// @notice Batch sets the conversion configurations\\n /// @param tokenAddressIn Address of tokenIn\\n /// @param tokenAddressesOut Array of addresses of tokenOut\\n /// @param conversionConfigs Array of conversionConfig config details to update\\n /// @custom:error InputLengthMisMatch is thrown when tokenAddressesOut and conversionConfigs array length mismatches\\n function setConversionConfigs(\\n address tokenAddressIn,\\n address[] calldata tokenAddressesOut,\\n ConversionConfig[] calldata conversionConfigs\\n ) external {\\n uint256 tokenOutArrayLength = tokenAddressesOut.length;\\n if (tokenOutArrayLength != conversionConfigs.length) revert InputLengthMisMatch();\\n\\n for (uint256 i; i < tokenOutArrayLength; ) {\\n setConversionConfig(tokenAddressIn, tokenAddressesOut[i], conversionConfigs[i]);\\n unchecked {\\n ++i;\\n }\\n }\\n }\\n\\n /// @notice Converts exact amount of tokenAddressIn for tokenAddressOut if there is enough tokens held by the contract\\n /// @dev Method does not support deflationary tokens transfer\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @param to Address of the tokenAddressOut receiver\\n /// @return actualAmountIn Actual amount transferred to destination\\n /// @return actualAmountOut Actual amount transferred to user\\n /// @custom:event Emits ConvertedExactTokens event on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when to address is zero\\n /// @custom:error InvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOut\\n /// @custom:error AmountOutLowerThanMinRequired error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa\\n /// @custom:error AmountInMismatched error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa\\n function convertExactTokens(\\n uint256 amountInMantissa,\\n uint256 amountOutMinMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n )\\n external\\n validConversionParameters(to, tokenAddressIn, tokenAddressOut)\\n nonReentrant\\n returns (uint256 actualAmountIn, uint256 actualAmountOut)\\n {\\n (actualAmountIn, actualAmountOut) = _convertExactTokens(\\n amountInMantissa,\\n amountOutMinMantissa,\\n tokenAddressIn,\\n tokenAddressOut,\\n to\\n );\\n\\n if (actualAmountIn != amountInMantissa) {\\n revert AmountInMismatched();\\n }\\n\\n _postConversionHook(tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\\n emit ConvertedExactTokens(msg.sender, to, tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\\n }\\n\\n /// @notice Converts tokens for tokenAddressIn for exact amount of tokenAddressOut if there is enough tokens held by the contract,\\n /// otherwise the amount is adjusted\\n /// @dev Method does not support deflationary tokens transfer\\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @param to Address of the tokenAddressOut receiver\\n /// @return actualAmountIn Actual amount transferred to destination\\n /// @return actualAmountOut Actual amount transferred to user\\n /// @custom:event Emits ConvertedForExactTokens event on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when to address is zero\\n /// @custom:error InvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOut\\n /// @custom:error AmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissa\\n /// @custom:error AmountOutMismatched error is thrown when actualAmountOut is does not match amountOutMantissa\\n function convertForExactTokens(\\n uint256 amountInMaxMantissa,\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n )\\n external\\n validConversionParameters(to, tokenAddressIn, tokenAddressOut)\\n nonReentrant\\n returns (uint256 actualAmountIn, uint256 actualAmountOut)\\n {\\n (actualAmountIn, actualAmountOut) = _convertForExactTokens(\\n amountInMaxMantissa,\\n amountOutMantissa,\\n tokenAddressIn,\\n tokenAddressOut,\\n to\\n );\\n\\n if (actualAmountOut != amountOutMantissa) {\\n revert AmountOutMismatched();\\n }\\n\\n _postConversionHook(tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\\n emit ConvertedForExactTokens(msg.sender, to, tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\\n }\\n\\n /// @notice Converts exact amount of tokenAddressIn for tokenAddressOut if there is enough tokens held by the contract\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @param to Address of the tokenAddressOut receiver\\n /// @return actualAmountIn Actual amount transferred to destination\\n /// @return actualAmountOut Actual amount transferred to user\\n /// @custom:event Emits ConvertedExactTokensSupportingFeeOnTransferTokens event on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when to address is zero\\n /// @custom:error InvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOut\\n /// @custom:error AmountOutLowerThanMinRequired error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa\\n function convertExactTokensSupportingFeeOnTransferTokens(\\n uint256 amountInMantissa,\\n uint256 amountOutMinMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n )\\n external\\n validConversionParameters(to, tokenAddressIn, tokenAddressOut)\\n nonReentrant\\n returns (uint256 actualAmountIn, uint256 actualAmountOut)\\n {\\n (actualAmountIn, actualAmountOut) = _convertExactTokens(\\n amountInMantissa,\\n amountOutMinMantissa,\\n tokenAddressIn,\\n tokenAddressOut,\\n to\\n );\\n\\n _postConversionHook(tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\\n emit ConvertedExactTokensSupportingFeeOnTransferTokens(\\n msg.sender,\\n to,\\n tokenAddressIn,\\n tokenAddressOut,\\n actualAmountIn,\\n actualAmountOut\\n );\\n }\\n\\n /// @notice Converts tokens for tokenAddressIn for amount of tokenAddressOut calculated on the basis of amount of\\n /// tokenAddressIn received by the contract, if there is enough tokens held by the contract, otherwise the amount is adjusted.\\n /// The user will be responsible for bearing any fees associated with token transfers, whether pulling in or pushing out tokens\\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @param to Address of the tokenAddressOut receiver\\n /// @return actualAmountIn Actual amount transferred to destination\\n /// @return actualAmountOut Actual amount transferred to user\\n /// @custom:event Emits ConvertedForExactTokensSupportingFeeOnTransferTokens event on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when to address is zero\\n /// @custom:error InvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOut\\n /// @custom:error AmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissa\\n function convertForExactTokensSupportingFeeOnTransferTokens(\\n uint256 amountInMaxMantissa,\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n )\\n external\\n validConversionParameters(to, tokenAddressIn, tokenAddressOut)\\n nonReentrant\\n returns (uint256 actualAmountIn, uint256 actualAmountOut)\\n {\\n (actualAmountIn, actualAmountOut) = _convertForExactTokensSupportingFeeOnTransferTokens(\\n amountInMaxMantissa,\\n amountOutMantissa,\\n tokenAddressIn,\\n tokenAddressOut,\\n to\\n );\\n\\n _postConversionHook(tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\\n emit ConvertedForExactTokensSupportingFeeOnTransferTokens(\\n msg.sender,\\n to,\\n tokenAddressIn,\\n tokenAddressOut,\\n actualAmountIn,\\n actualAmountOut\\n );\\n }\\n\\n /// @notice To sweep ERC20 tokens and transfer them to user(to address)\\n /// @param tokenAddress The address of the ERC-20 token to sweep\\n /// @param to The address to which tokens will be transferred\\n /// @param amount The amount to transfer\\n /// @custom:event Emits SweepToken event on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when tokenAddress/to address is zero\\n /// @custom:access Only Governance\\n function sweepToken(\\n address tokenAddress,\\n address to,\\n uint256 amount\\n ) external onlyOwner nonReentrant {\\n ensureNonzeroAddress(tokenAddress);\\n ensureNonzeroAddress(to);\\n ensureNonzeroValue(amount);\\n\\n IERC20Upgradeable token = IERC20Upgradeable(tokenAddress);\\n preSweepToken(tokenAddress, amount);\\n token.safeTransfer(to, amount);\\n\\n emit SweepToken(tokenAddress, to, amount);\\n }\\n\\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn.\\n /// This function does not account for potential token transfer fees(in case of deflationary tokens)\\n /// @dev This function retrieves values without altering token prices\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountConvertedMantissa Amount of tokenAddressIn should be transferred after conversion\\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n /// @custom:error ConversionEnabledOnlyForPrivateConversions is thrown when conversion is only enabled for private conversion\\n function getAmountOut(\\n uint256 amountInMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) external view returns (uint256 amountConvertedMantissa, uint256 amountOutMantissa) {\\n if (\\n conversionConfigurations[tokenAddressIn][tokenAddressOut].conversionAccess ==\\n ConversionAccessibility.ONLY_FOR_CONVERTERS\\n ) {\\n revert ConversionEnabledOnlyForPrivateConversions();\\n }\\n\\n amountConvertedMantissa = amountInMantissa;\\n uint256 tokenInToOutConversion;\\n (amountOutMantissa, tokenInToOutConversion) = _getAmountOut(amountInMantissa, tokenAddressIn, tokenAddressOut);\\n\\n uint256 maxTokenOutReserve = balanceOf(tokenAddressOut);\\n\\n /// If contract has less liquidity for tokenAddressOut than amountOutMantissa\\n if (maxTokenOutReserve < amountOutMantissa) {\\n amountConvertedMantissa =\\n ((maxTokenOutReserve * EXP_SCALE) + tokenInToOutConversion - 1) /\\n tokenInToOutConversion; //round-up\\n amountOutMantissa = maxTokenOutReserve;\\n }\\n }\\n\\n /// @notice To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut.\\n /// This function does not account for potential token transfer fees(in case of deflationary tokens)\\n /// @dev This function retrieves values without altering token prices\\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountConvertedMantissa Amount of tokenAddressOut should be transferred after conversion\\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n /// @custom:error ConversionEnabledOnlyForPrivateConversions is thrown when conversion is only enabled for private conversion\\n function getAmountIn(\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) external view returns (uint256 amountConvertedMantissa, uint256 amountInMantissa) {\\n if (\\n conversionConfigurations[tokenAddressIn][tokenAddressOut].conversionAccess ==\\n ConversionAccessibility.ONLY_FOR_CONVERTERS\\n ) {\\n revert ConversionEnabledOnlyForPrivateConversions();\\n }\\n\\n uint256 maxTokenOutReserve = balanceOf(tokenAddressOut);\\n\\n /// If contract has less liquidity for tokenAddressOut than amountOutMantissa\\n if (maxTokenOutReserve < amountOutMantissa) {\\n amountOutMantissa = maxTokenOutReserve;\\n }\\n\\n amountConvertedMantissa = amountOutMantissa;\\n (amountInMantissa, ) = _getAmountIn(amountOutMantissa, tokenAddressIn, tokenAddressOut);\\n }\\n\\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountConvertedMantissa Amount of tokenAddressIn should be transferred after conversion\\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n function getUpdatedAmountOut(\\n uint256 amountInMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) public returns (uint256 amountConvertedMantissa, uint256 amountOutMantissa) {\\n priceOracle.updateAssetPrice(tokenAddressIn);\\n priceOracle.updateAssetPrice(tokenAddressOut);\\n\\n (amountOutMantissa, ) = _getAmountOut(amountInMantissa, tokenAddressIn, tokenAddressOut);\\n amountConvertedMantissa = amountInMantissa;\\n }\\n\\n /// @notice To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut\\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountConvertedMantissa Amount of tokenAddressOut should be transferred after conversion\\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n function getUpdatedAmountIn(\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) public returns (uint256 amountConvertedMantissa, uint256 amountInMantissa) {\\n priceOracle.updateAssetPrice(tokenAddressIn);\\n priceOracle.updateAssetPrice(tokenAddressOut);\\n\\n (amountInMantissa, ) = _getAmountIn(amountOutMantissa, tokenAddressIn, tokenAddressOut);\\n amountConvertedMantissa = amountOutMantissa;\\n }\\n\\n /// @notice This method updated the states of this contract after getting funds from PSR\\n /// after settling the amount(if any) through privateConversion between converters\\n /// @dev This function is called by protocolShareReserve\\n /// @dev call _updateAssetsState to update the states related to the comptroller and asset transfer to the specific converter then\\n /// it calls the _privateConversion which will convert the asset into destination's base asset and transfer it to destination address\\n /// @param comptroller Comptroller address (pool)\\n /// @param asset Asset address\\n function updateAssetsState(address comptroller, address asset) public nonReentrant {\\n uint256 balanceDiff = _updateAssetsState(comptroller, asset);\\n if (balanceDiff > 0) {\\n _privateConversion(comptroller, asset, balanceDiff);\\n }\\n }\\n\\n /// @notice Set the configuration for new or existing conversion pair\\n /// @param tokenAddressIn Address of tokenIn\\n /// @param tokenAddressOut Address of tokenOut\\n /// @param conversionConfig ConversionConfig config details to update\\n /// @custom:event Emits ConversionConfigUpdated event on success\\n /// @custom:error Unauthorized error is thrown when the call is not authorized by AccessControlManager\\n /// @custom:error ZeroAddressNotAllowed is thrown when pool registry address is zero\\n /// @custom:error NonZeroIncentiveForPrivateConversion is thrown when incentive is non zero for private conversion\\n /// @custom:access Controlled by AccessControlManager\\n function setConversionConfig(\\n address tokenAddressIn,\\n address tokenAddressOut,\\n ConversionConfig calldata conversionConfig\\n ) public {\\n _checkAccessAllowed(\\\"setConversionConfig(address,address,ConversionConfig)\\\");\\n ensureNonzeroAddress(tokenAddressIn);\\n ensureNonzeroAddress(tokenAddressOut);\\n\\n if (conversionConfig.incentive > MAX_INCENTIVE) {\\n revert IncentiveTooHigh(conversionConfig.incentive, MAX_INCENTIVE);\\n }\\n\\n if (\\n (tokenAddressIn == tokenAddressOut) ||\\n (tokenAddressIn != _getDestinationBaseAsset()) ||\\n conversionConfigurations[tokenAddressOut][tokenAddressIn].conversionAccess != ConversionAccessibility.NONE\\n ) {\\n revert InvalidTokenConfigAddresses();\\n }\\n\\n if (\\n (conversionConfig.conversionAccess == ConversionAccessibility.ONLY_FOR_CONVERTERS) &&\\n conversionConfig.incentive != 0\\n ) {\\n revert NonZeroIncentiveForPrivateConversion();\\n }\\n\\n if (\\n ((conversionConfig.conversionAccess == ConversionAccessibility.ONLY_FOR_CONVERTERS) ||\\n (conversionConfig.conversionAccess == ConversionAccessibility.ALL)) &&\\n (address(converterNetwork) == address(0))\\n ) {\\n revert InvalidConverterNetwork();\\n }\\n\\n ConversionConfig storage configuration = conversionConfigurations[tokenAddressIn][tokenAddressOut];\\n\\n emit ConversionConfigUpdated(\\n tokenAddressIn,\\n tokenAddressOut,\\n configuration.incentive,\\n conversionConfig.incentive,\\n configuration.conversionAccess,\\n conversionConfig.conversionAccess\\n );\\n\\n if (conversionConfig.conversionAccess == ConversionAccessibility.NONE) {\\n delete conversionConfigurations[tokenAddressIn][tokenAddressOut];\\n } else {\\n configuration.incentive = conversionConfig.incentive;\\n configuration.conversionAccess = conversionConfig.conversionAccess;\\n }\\n }\\n\\n /// @notice Get the balance for specific token\\n /// @param token Address of the token\\n /// @return tokenBalance Balance of the token the contract has\\n function balanceOf(address token) public view virtual returns (uint256 tokenBalance);\\n\\n /// @dev Operations to perform before sweeping tokens\\n /// @param token Address of the token\\n /// @param amount Amount transferred to address(to)\\n function preSweepToken(address token, uint256 amount) internal virtual {}\\n\\n /// @dev Converts exact amount of tokenAddressIn for tokenAddressOut\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @param to Address of the tokenAddressOut receiver\\n /// @return actualAmountIn Actual amount of tokenAddressIn transferred\\n /// @return amountOutMantissa Actual amount of tokenAddressOut transferred\\n /// @custom:error AmountOutLowerThanMinRequired error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa\\n function _convertExactTokens(\\n uint256 amountInMantissa,\\n uint256 amountOutMinMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n ) internal returns (uint256 actualAmountIn, uint256 amountOutMantissa) {\\n _checkPrivateConversion(tokenAddressIn, tokenAddressOut);\\n actualAmountIn = _doTransferIn(tokenAddressIn, amountInMantissa);\\n\\n (, amountOutMantissa) = getUpdatedAmountOut(actualAmountIn, tokenAddressIn, tokenAddressOut);\\n\\n if (amountOutMantissa < amountOutMinMantissa) {\\n revert AmountOutLowerThanMinRequired(amountOutMantissa, amountOutMinMantissa);\\n }\\n\\n _doTransferOut(tokenAddressOut, to, amountOutMantissa);\\n }\\n\\n /// @dev Converts tokens for tokenAddressIn for exact amount of tokenAddressOut used for non deflationry tokens\\n /// it is called by convertForExactTokens function\\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @param to Address of the tokenAddressOut receiver\\n /// @return actualAmountIn Actual amount of tokenAddressIn transferred\\n /// @return actualAmountOut Actual amount of tokenAddressOut transferred\\n /// @custom:error DeflationaryTokenNotSupported is thrown if tokenAddressIn is deflationary token\\n /// @custom:error AmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissa\\n function _convertForExactTokens(\\n uint256 amountInMaxMantissa,\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n ) internal returns (uint256 actualAmountIn, uint256 actualAmountOut) {\\n _checkPrivateConversion(tokenAddressIn, tokenAddressOut);\\n (, uint256 amountInMantissa) = getUpdatedAmountIn(amountOutMantissa, tokenAddressIn, tokenAddressOut);\\n\\n actualAmountIn = _doTransferIn(tokenAddressIn, amountInMantissa);\\n\\n if (actualAmountIn != amountInMantissa) {\\n revert DeflationaryTokenNotSupported();\\n }\\n\\n if (actualAmountIn > amountInMaxMantissa) {\\n revert AmountInHigherThanMax(amountInMantissa, amountInMaxMantissa);\\n }\\n\\n _doTransferOut(tokenAddressOut, to, amountOutMantissa);\\n actualAmountOut = amountOutMantissa;\\n }\\n\\n /// @dev Converts tokens for tokenAddressIn for the amount of tokenAddressOut used for deflationary tokens\\n /// it is called by convertForExactTokensSupportingFeeOnTransferTokens function\\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @param to Address of the tokenAddressOut receiver\\n /// @return actualAmountIn Actual amount of tokenAddressIn transferred\\n /// @return actualAmountOut Actual amount of tokenAddressOut transferred\\n /// @custom:error AmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissa\\n function _convertForExactTokensSupportingFeeOnTransferTokens(\\n uint256 amountInMaxMantissa,\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n ) internal returns (uint256 actualAmountIn, uint256 actualAmountOut) {\\n _checkPrivateConversion(tokenAddressIn, tokenAddressOut);\\n (, uint256 amountInMantissa) = getUpdatedAmountIn(amountOutMantissa, tokenAddressIn, tokenAddressOut);\\n\\n if (amountInMantissa > amountInMaxMantissa) {\\n revert AmountInHigherThanMax(amountInMantissa, amountInMaxMantissa);\\n }\\n\\n actualAmountIn = _doTransferIn(tokenAddressIn, amountInMantissa);\\n\\n (, actualAmountOut) = getUpdatedAmountOut(actualAmountIn, tokenAddressIn, tokenAddressOut);\\n\\n _doTransferOut(tokenAddressOut, to, actualAmountOut);\\n }\\n\\n /// @dev return actualAmountOut from reserves for tokenAddressOut\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @param to Address of the tokenAddressOut receiver\\n /// @param amountConvertedMantissa Amount of tokenAddressOut supposed to get transferred\\n /// @custom:error InsufficientPoolLiquidity If contract has less liquidity for tokenAddressOut than amountOutMantissa\\n function _doTransferOut(\\n address tokenAddressOut,\\n address to,\\n uint256 amountConvertedMantissa\\n ) internal {\\n uint256 maxTokenOutReserve = balanceOf(tokenAddressOut);\\n\\n /// If contract has less liquidity for tokenAddressOut than amountOutMantissa\\n if (maxTokenOutReserve < amountConvertedMantissa) {\\n revert InsufficientPoolLiquidity();\\n }\\n\\n _preTransferHook(tokenAddressOut, amountConvertedMantissa);\\n\\n IERC20Upgradeable tokenOut = IERC20Upgradeable(tokenAddressOut);\\n tokenOut.safeTransfer(to, amountConvertedMantissa);\\n }\\n\\n /// @notice Transfer tokenAddressIn from user to destination\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @return actualAmountIn Actual amount transferred to destination\\n function _doTransferIn(address tokenAddressIn, uint256 amountInMantissa) internal returns (uint256 actualAmountIn) {\\n IERC20Upgradeable tokenIn = IERC20Upgradeable(tokenAddressIn);\\n uint256 balanceBeforeDestination = tokenIn.balanceOf(destinationAddress);\\n tokenIn.safeTransferFrom(msg.sender, destinationAddress, amountInMantissa);\\n uint256 balanceAfterDestination = tokenIn.balanceOf(destinationAddress);\\n actualAmountIn = balanceAfterDestination - balanceBeforeDestination;\\n }\\n\\n /// @dev Sets a new price oracle\\n /// @param priceOracle_ Address of the new price oracle to set\\n /// @custom:event Emits PriceOracleUpdated event on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when price oracle address is zero\\n function _setPriceOracle(ResilientOracle priceOracle_) internal {\\n ensureNonzeroAddress(address(priceOracle_));\\n emit PriceOracleUpdated(priceOracle, priceOracle_);\\n priceOracle = priceOracle_;\\n }\\n\\n /// @dev Sets a new destination address\\n /// @param destinationAddress_ The new destination address to be set\\n /// @custom:event Emits DestinationAddressUpdated event on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when destination address is zero\\n function _setDestination(address destinationAddress_) internal {\\n ensureNonzeroAddress(destinationAddress_);\\n emit DestinationAddressUpdated(destinationAddress, destinationAddress_);\\n destinationAddress = destinationAddress_;\\n }\\n\\n /// @notice Sets a converter network contract address\\n /// @param converterNetwork_ The converterNetwork address to be set\\n /// @custom:event Emits ConverterNetworkAddressUpdated event on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when address is zero\\n function _setConverterNetwork(IConverterNetwork converterNetwork_) internal {\\n ensureNonzeroAddress(address(converterNetwork_));\\n emit ConverterNetworkAddressUpdated(address(converterNetwork), address(converterNetwork_));\\n converterNetwork = converterNetwork_;\\n }\\n\\n /// @notice Min amount to convert setter\\n /// @param minAmountToConvert_ Min amount to convert\\n /// @custom:event MinAmountToConvertUpdated is emitted in success\\n /// @custom:error ZeroValueNotAllowed is thrown if the provided value is 0\\n function _setMinAmountToConvert(uint256 minAmountToConvert_) internal {\\n ensureNonzeroValue(minAmountToConvert_);\\n emit MinAmountToConvertUpdated(minAmountToConvert, minAmountToConvert_);\\n minAmountToConvert = minAmountToConvert_;\\n }\\n\\n /// @dev Hook to perform after converting tokens\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @param amountIn Amount of tokenIn converted\\n /// @param amountOut Amount of tokenOut converted\\n function _postConversionHook(\\n address tokenAddressIn,\\n address tokenAddressOut,\\n uint256 amountIn,\\n uint256 amountOut\\n ) internal virtual {}\\n\\n /// @param accessControlManager_ Access control manager contract address\\n /// @param priceOracle_ Resilient oracle address\\n /// @param destinationAddress_ Address at all incoming tokens will transferred to\\n /// @param minAmountToConvert_ minimum amount to convert\\n function __AbstractTokenConverter_init(\\n address accessControlManager_,\\n ResilientOracle priceOracle_,\\n address destinationAddress_,\\n uint256 minAmountToConvert_\\n ) internal onlyInitializing {\\n __AccessControlled_init(accessControlManager_);\\n __ReentrancyGuard_init();\\n __AbstractTokenConverter_init_unchained(priceOracle_, destinationAddress_, minAmountToConvert_);\\n }\\n\\n /// @param priceOracle_ Resilient oracle address\\n /// @param destinationAddress_ Address at all incoming tokens will transferred to\\n /// @param minAmountToConvert_ minimum amount to convert\\n function __AbstractTokenConverter_init_unchained(\\n ResilientOracle priceOracle_,\\n address destinationAddress_,\\n uint256 minAmountToConvert_\\n ) internal onlyInitializing {\\n _setPriceOracle(priceOracle_);\\n _setDestination(destinationAddress_);\\n _setMinAmountToConvert(minAmountToConvert_);\\n conversionPaused = false;\\n }\\n\\n /// @dev _updateAssetsState hook to update the states of reserves transferred for the specific comptroller\\n /// @param comptroller Comptroller address (pool)\\n /// @param asset Asset address\\n /// @return Amount of asset, for _privateConversion\\n function _updateAssetsState(address comptroller, address asset) internal virtual returns (uint256) {}\\n\\n /// @dev This method is used to convert asset into base asset by converting them with other converters which supports the pair and transfer the funds to\\n /// destination contract as destination's base asset\\n /// @param comptroller Comptroller address (pool)\\n /// @param tokenAddressOut Address of the token transferred to converter, and through _privateConversion it will be converted into base asset\\n /// @param amountToConvert Amount of the tokenAddressOut transferred to converter\\n function _privateConversion(\\n address comptroller,\\n address tokenAddressOut,\\n uint256 amountToConvert\\n ) internal {\\n address tokenAddressIn = _getDestinationBaseAsset();\\n address _destinationAddress = destinationAddress;\\n uint256 convertedTokenInBalance;\\n if (address(converterNetwork) != address(0)) {\\n (address[] memory converterAddresses, uint256[] memory converterBalances) = converterNetwork\\n .findTokenConvertersForConverters(tokenAddressOut, tokenAddressIn);\\n uint256 convertersLength = converterAddresses.length;\\n for (uint256 i; i < convertersLength; ) {\\n if (converterBalances[i] == 0) break;\\n (, uint256 amountIn) = IAbstractTokenConverter(converterAddresses[i]).getUpdatedAmountIn(\\n converterBalances[i],\\n tokenAddressOut,\\n tokenAddressIn\\n );\\n if (amountIn > amountToConvert) {\\n amountIn = amountToConvert;\\n }\\n\\n if (!_validateMinAmountToConvert(amountIn, tokenAddressOut)) {\\n break;\\n }\\n\\n uint256 balanceBefore = IERC20Upgradeable(tokenAddressIn).balanceOf(_destinationAddress);\\n\\n IERC20Upgradeable(tokenAddressOut).approve(converterAddresses[i], amountIn);\\n IAbstractTokenConverter(converterAddresses[i]).convertExactTokens(\\n amountIn,\\n 0,\\n tokenAddressOut,\\n tokenAddressIn,\\n _destinationAddress\\n );\\n\\n uint256 balanceAfter = IERC20Upgradeable(tokenAddressIn).balanceOf(_destinationAddress);\\n amountToConvert -= amountIn;\\n convertedTokenInBalance += (balanceAfter - balanceBefore);\\n\\n if (amountToConvert == 0) break;\\n unchecked {\\n ++i;\\n }\\n }\\n }\\n\\n _postPrivateConversionHook(\\n comptroller,\\n tokenAddressIn,\\n convertedTokenInBalance,\\n tokenAddressOut,\\n amountToConvert\\n );\\n }\\n\\n /// @dev This hook is used to update states for the converter after the privateConversion\\n /// @param comptroller Comptroller address (pool)\\n /// @param tokenAddressIn Address of the destination's base asset\\n /// @param convertedTokenInBalance Amount of the base asset received after the conversion\\n /// @param tokenAddressOut Address of the asset transferred to other converter in exchange of base asset\\n /// @param convertedTokenOutBalance Amount of tokenAddressOut transferred from this converter\\n function _postPrivateConversionHook(\\n address comptroller,\\n address tokenAddressIn,\\n uint256 convertedTokenInBalance,\\n address tokenAddressOut,\\n uint256 convertedTokenOutBalance\\n ) internal virtual {}\\n\\n /// @notice This hook is used to update the state for asset reserves before transferring tokenOut to user\\n /// @param tokenOutAddress Address of the asset to be transferred to the user\\n /// @param amountOut Amount of tokenAddressOut transferred from this converter\\n function _preTransferHook(address tokenOutAddress, uint256 amountOut) internal virtual {}\\n\\n /// @dev Checks if amount to convert is greater than minimum amount to convert or not\\n /// @param amountIn The amount to convert\\n /// @param tokenAddress Address of the token\\n /// @return isValid true if amount to convert is greater than minimum amount to convert\\n function _validateMinAmountToConvert(uint256 amountIn, address tokenAddress) internal returns (bool isValid) {\\n priceOracle.updateAssetPrice(tokenAddress);\\n uint256 amountInInUsd = (priceOracle.getPrice(tokenAddress) * amountIn) / EXP_SCALE;\\n\\n if (amountInInUsd >= minAmountToConvert) {\\n isValid = true;\\n }\\n }\\n\\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn\\n /// @dev This function retrieves values without altering token prices.\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\\n /// @return tokenInToOutConversion Ratio of tokenIn price and incentive for conversion with tokenOut price\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n function _getAmountOut(\\n uint256 amountInMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) internal view returns (uint256 amountOutMantissa, uint256 tokenInToOutConversion) {\\n if (amountInMantissa == 0) {\\n revert InsufficientInputAmount();\\n }\\n\\n ConversionConfig memory configuration = conversionConfigurations[tokenAddressIn][tokenAddressOut];\\n\\n if (configuration.conversionAccess == ConversionAccessibility.NONE) {\\n revert ConversionConfigNotEnabled();\\n }\\n\\n uint256 tokenInUnderlyingPrice = priceOracle.getPrice(tokenAddressIn);\\n uint256 tokenOutUnderlyingPrice = priceOracle.getPrice(tokenAddressOut);\\n\\n uint256 incentive = configuration.incentive;\\n if (address(converterNetwork) != address(0) && (converterNetwork.isTokenConverter(msg.sender))) {\\n incentive = 0;\\n }\\n\\n /// conversion rate after considering incentive(conversionWithIncentive)\\n uint256 conversionWithIncentive = MANTISSA_ONE + incentive;\\n\\n /// amount of tokenAddressOut after including incentive as amountOutMantissa will be greater than actual as it gets\\n /// multiplied by conversionWithIncentive which will be >= 1\\n amountOutMantissa =\\n (amountInMantissa * tokenInUnderlyingPrice * conversionWithIncentive) /\\n (tokenOutUnderlyingPrice * EXP_SCALE);\\n\\n tokenInToOutConversion = (tokenInUnderlyingPrice * conversionWithIncentive) / tokenOutUnderlyingPrice;\\n }\\n\\n /// @dev To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut\\n /// @dev This function retrieves values without altering token prices.\\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\\n /// @return tokenInToOutConversion Ratio of tokenIn price and incentive for conversion with tokenOut price\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n function _getAmountIn(\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) internal view returns (uint256 amountInMantissa, uint256 tokenInToOutConversion) {\\n if (amountOutMantissa == 0) {\\n revert InsufficientOutputAmount();\\n }\\n\\n ConversionConfig memory configuration = conversionConfigurations[tokenAddressIn][tokenAddressOut];\\n\\n if (configuration.conversionAccess == ConversionAccessibility.NONE) {\\n revert ConversionConfigNotEnabled();\\n }\\n\\n uint256 tokenInUnderlyingPrice = priceOracle.getPrice(tokenAddressIn);\\n uint256 tokenOutUnderlyingPrice = priceOracle.getPrice(tokenAddressOut);\\n\\n uint256 incentive = configuration.incentive;\\n if ((address(converterNetwork) != address(0)) && (converterNetwork.isTokenConverter(msg.sender))) {\\n incentive = 0;\\n }\\n\\n /// conversion rate after considering incentive(conversionWithIncentive)\\n uint256 conversionWithIncentive = MANTISSA_ONE + incentive;\\n tokenInToOutConversion = (tokenInUnderlyingPrice * conversionWithIncentive) / tokenOutUnderlyingPrice;\\n\\n /// amount of tokenAddressIn after considering incentive(i.e. amountInMantissa will be less than actual amountInMantissa if incentive > 0)\\n amountInMantissa = ((amountOutMantissa * EXP_SCALE) + tokenInToOutConversion - 1) / tokenInToOutConversion; //round-up\\n }\\n\\n /// @dev Check if msg.sender is allowed to convert as per onlyForPrivateConversions flag\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @custom:error ConversionEnabledOnlyForPrivateConversions is thrown when conversion is only enabled for private conversion\\n function _checkPrivateConversion(address tokenAddressIn, address tokenAddressOut) internal view {\\n bool isConverter = (address(converterNetwork) != address(0)) && converterNetwork.isTokenConverter(msg.sender);\\n if (\\n (!(isConverter) &&\\n (conversionConfigurations[tokenAddressIn][tokenAddressOut].conversionAccess ==\\n ConversionAccessibility.ONLY_FOR_CONVERTERS))\\n ) {\\n revert ConversionEnabledOnlyForPrivateConversions();\\n }\\n }\\n\\n /// @dev To check, is conversion paused\\n /// @custom:error ConversionTokensPaused is thrown when token conversion is paused\\n function _checkConversionPaused() internal view {\\n if (conversionPaused) {\\n revert ConversionTokensPaused();\\n }\\n }\\n\\n /// @dev Get base asset address of the destination contract\\n /// @return Address of the base asset\\n function _getDestinationBaseAsset() internal view virtual returns (address) {}\\n}\\n\",\"keccak256\":\"0xe10a4505a941511a1e57e162dc5b7d6e4874e40ad421828bc4d6366b51b5608c\",\"license\":\"BSD-3-Clause\"},\"contracts/TokenConverter/IAbstractTokenConverter.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\nimport { ResilientOracle } from \\\"@venusprotocol/oracle/contracts/ResilientOracle.sol\\\";\\nimport { IConverterNetwork } from \\\"../Interfaces/IConverterNetwork.sol\\\";\\n\\n/// @notice Interface for AbstractTokenConverter\\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\\ninterface IAbstractTokenConverter {\\n /// @notice This enum define the all possible ways of conversion can happen\\n enum ConversionAccessibility {\\n NONE, // Conversion is disable for the pair\\n ALL, // Conversion is enable for private conversion and users\\n ONLY_FOR_CONVERTERS, // Conversion is enable only for private conversion\\n ONLY_FOR_USERS // Conversion is enable only for users\\n }\\n\\n /// @notice This struct represents the configuration for a token conversion.\\n struct ConversionConfig {\\n /// incentive on conversion of tokens in mantissa i.e 10% incentive would be 0.1 * 1e18\\n uint256 incentive;\\n /// enable or disable conversion for users or converters or both or none\\n ConversionAccessibility conversionAccess;\\n }\\n\\n /// @notice Pause conversion of tokens\\n function pauseConversion() external;\\n\\n /// @notice Resume conversion of tokens.\\n function resumeConversion() external;\\n\\n /// @notice Sets a new price oracle\\n /// @param priceOracle_ Address of the new price oracle to set\\n function setPriceOracle(ResilientOracle priceOracle_) external;\\n\\n /// @notice Set the configuration for new or existing convert pair\\n /// @param tokenAddressIn Address of tokenIn\\n /// @param tokenAddressOut Address of tokenOut\\n /// @param conversionConfig ConversionConfig config details to update\\n function setConversionConfig(\\n address tokenAddressIn,\\n address tokenAddressOut,\\n ConversionConfig calldata conversionConfig\\n ) external;\\n\\n /// @notice Convert exact amount of tokenAddressIn for tokenAddressOut\\n /// @dev Method does not support deflationary tokens transfer\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after convert\\n /// @param to Address of the tokenAddressOut receiver\\n function convertExactTokens(\\n uint256 amountInMantissa,\\n uint256 amountOutMinMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n ) external returns (uint256 actualAmountIn, uint256 actualAmountOut);\\n\\n /// @notice Convert tokens for tokenAddressIn for exact amount of tokenAddressOut\\n /// @dev Method does not support deflationary tokens transfer\\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after convert\\n /// @param to Address of the tokenAddressOut receiver\\n function convertForExactTokens(\\n uint256 amountInMaxMantissa,\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n ) external returns (uint256 actualAmountIn, uint256 actualAmountOut);\\n\\n /// @notice Convert exact amount of tokenAddressIn for tokenAddressOut\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after convert\\n /// @param to Address of the tokenAddressOut receiver\\n function convertExactTokensSupportingFeeOnTransferTokens(\\n uint256 amountInMantissa,\\n uint256 amountOutMinMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n ) external returns (uint256 actualAmountIn, uint256 actualAmountOut);\\n\\n /// @notice Convert tokens for tokenAddressIn for exact amount of tokenAddressOut\\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after convert\\n /// @param to Address of the tokenAddressOut receiver\\n function convertForExactTokensSupportingFeeOnTransferTokens(\\n uint256 amountInMaxMantissa,\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n ) external returns (uint256 actualAmountIn, uint256 actualAmountOut);\\n\\n /// @notice Get the configuration for the pair of the tokens\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return incentives Percentage of incentives to be distributed for the pair of tokens\\n /// @return conversionAccess Accessibility for the pair of tokens\\n function conversionConfigurations(address tokenAddressIn, address tokenAddressOut)\\n external\\n returns (uint256 incentives, ConversionAccessibility conversionAccess);\\n\\n /// @notice Get the address of the converterNetwork\\n function converterNetwork() external returns (IConverterNetwork converterNetwork);\\n\\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountConvertedMantissa Amount of tokenAddressIn should be transferred after conversion\\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n function getUpdatedAmountOut(\\n uint256 amountInMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) external returns (uint256 amountConvertedMantissa, uint256 amountOutMantissa);\\n\\n /// @notice To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut\\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountConvertedMantissa Amount of tokenAddressOut should be transferred after conversion\\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n function getUpdatedAmountIn(\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) external returns (uint256 amountConvertedMantissa, uint256 amountInMantissa);\\n\\n /// @notice To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut\\n /// @dev This function retrieves values without altering token prices.\\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountConvertedMantissa Amount of tokenAddressOut should be transferred after conversion\\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n function getAmountIn(\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) external view returns (uint256 amountConvertedMantissa, uint256 amountInMantissa);\\n\\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn\\n /// @dev This function retrieves values without altering token prices.\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountConvertedMantissa Amount of tokenAddressIn should be transferred after conversion\\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n function getAmountOut(\\n uint256 amountInMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) external view returns (uint256 amountConvertedMantissa, uint256 amountOutMantissa);\\n\\n /// @notice Get the balance for specific token\\n /// @param token Address of the token\\n /// @return tokenBalance Balance of the token the contract has\\n function balanceOf(address token) external view returns (uint256 tokenBalance);\\n}\\n\",\"keccak256\":\"0xc677c12e2f04e520fb1fa02a1f06ad37d821cfebb5aa8f4bd7a22410648a0aae\",\"license\":\"BSD-3-Clause\"},\"contracts/TokenConverter/SingleTokenConverter.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\nimport { SafeERC20Upgradeable } from \\\"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\\\";\\nimport { IERC20Upgradeable } from \\\"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\\\";\\nimport { ResilientOracle } from \\\"@venusprotocol/oracle/contracts/ResilientOracle.sol\\\";\\nimport { ensureNonzeroAddress } from \\\"@venusprotocol/solidity-utilities/contracts/validators.sol\\\";\\n\\nimport { AbstractTokenConverter } from \\\"./AbstractTokenConverter.sol\\\";\\n\\n/// @title SingleTokenConverter\\n/// @author Venus\\n/// @notice SingleTokenConverter used for token conversions and sends received tokens\\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\\ncontract SingleTokenConverter is AbstractTokenConverter {\\n using SafeERC20Upgradeable for IERC20Upgradeable;\\n\\n /// @notice Address of the base asset token\\n address public baseAsset;\\n\\n /// @notice Emitted when base asset is updated\\n event BaseAssetUpdated(address indexed oldBaseAsset, address indexed newBaseAsset);\\n\\n /// @notice Emmitted after the funds transferred to the destination address\\n event AssetTransferredToDestination(\\n address indexed receiver,\\n address indexed comptroller,\\n address indexed asset,\\n uint256 amount\\n );\\n\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor() {\\n // Note that the contract is upgradeable. Use initialize() or reinitializers\\n // to set the state variables.\\n _disableInitializers();\\n }\\n\\n /// @param accessControlManager_ Access control manager contract address\\n /// @param priceOracle_ Resilient oracle address\\n /// @param destinationAddress_ Address at all incoming tokens will transferred to\\n /// @param minAmountToConvert_ Minimum amount to convert\\n function initialize(\\n address accessControlManager_,\\n ResilientOracle priceOracle_,\\n address destinationAddress_,\\n address baseAsset_,\\n uint256 minAmountToConvert_\\n ) public initializer {\\n _setBaseAsset(baseAsset_);\\n\\n // Initialize AbstractTokenConverter\\n __AbstractTokenConverter_init(accessControlManager_, priceOracle_, destinationAddress_, minAmountToConvert_);\\n }\\n\\n /// @notice Sets the base asset for the contract\\n /// @param baseAsset_ The new address of the base asset\\n /// @custom:access Only Governance\\n function setBaseAsset(address baseAsset_) external onlyOwner {\\n _setBaseAsset(baseAsset_);\\n }\\n\\n /// @notice Get the balance for specific token\\n /// @param tokenAddress Address of the token\\n /// @return tokenBalance Balance of the token the contract has\\n function balanceOf(address tokenAddress) public view override returns (uint256 tokenBalance) {\\n IERC20Upgradeable token = IERC20Upgradeable(tokenAddress);\\n tokenBalance = token.balanceOf(address(this));\\n }\\n\\n /// @param comptroller Comptroller address (pool)\\n /// @param asset Asset address.\\n /// @return balanceLeft Amount of asset, for _privateConversion\\n // solhint-disable-next-line\\n function _updateAssetsState(address comptroller, address asset) internal override returns (uint256 balanceLeft) {\\n IERC20Upgradeable token = IERC20Upgradeable(asset);\\n uint256 balance = token.balanceOf(address(this));\\n balanceLeft = balance;\\n\\n if (asset == baseAsset) {\\n balanceLeft = 0;\\n token.safeTransfer(destinationAddress, balance);\\n emit AssetTransferredToDestination(destinationAddress, comptroller, asset, balance);\\n }\\n }\\n\\n /// @dev Sets the base asset for the contract\\n /// @param baseAsset_ The new address of the base asset\\n /// @custom:error ZeroAddressNotAllowed is thrown when address is zero\\n /// @custom:event BaseAssetUpdated is emitted on success\\n function _setBaseAsset(address baseAsset_) internal {\\n ensureNonzeroAddress(baseAsset_);\\n emit BaseAssetUpdated(baseAsset, baseAsset_);\\n baseAsset = baseAsset_;\\n }\\n\\n /// @dev Get base asset address\\n /// @return destinationBaseAsset Address of the base asset(baseAsset)\\n function _getDestinationBaseAsset() internal view override returns (address destinationBaseAsset) {\\n destinationBaseAsset = baseAsset;\\n }\\n}\\n\",\"keccak256\":\"0xde2e9d5ef380a06a222825b11ffa47edad9e7624e3e90b8b55c92562f9216e76\",\"license\":\"BSD-3-Clause\"}},\"version\":1}", - "bytecode": "0x60806040523480156200001157600080fd5b506200001c62000022565b620000e3565b600054610100900460ff16156200008f5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff90811614620000e1576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b61408c80620000f36000396000f3fe608060405234801561001057600080fd5b506004361061025c5760003560e01c806379ba509711610145578063ca325469116100bd578063f04c31871161008c578063f2fde38b11610071578063f2fde38b14610533578063f7013ef614610546578063fe3da9841461055957600080fd5b8063f04c31871461050d578063f0dc7e9d1461052057600080fd5b8063ca325469146104c6578063cdf456e1146104d9578063e2ff7ea2146104ed578063e30c3978146104fc57600080fd5b8063b491ddf711610114578063b6828c57116100f9578063b6828c5714610498578063bc368b04146104ab578063c0654646146104b357600080fd5b8063b491ddf714610444578063b4a0bdf31461048757600080fd5b806379ba5097146104055780638da5cb5b1461040d57806390fa7b541461041e578063aac59a751461043157600080fd5b8063530e784f116101d85780636daa463b116101a757806370a082311161018c57806370a08231146103c9578063715018a6146103ea578063746460a9146103f257600080fd5b80636daa463b146103a35780636f1a30a8146103b657600080fd5b8063530e784f1461036257806358b904df146103755780635e1e63251461037d57806364aff9ec1461039057600080fd5b80630e32cb861161022f5780633606b26c116102145780633606b26c14610329578063439727a51461033c57806352e21a181461034f57600080fd5b80630e32cb86146103035780632630c12f1461031657600080fd5b806301e201781461026157806307aa239e146102915780630a0a05e6146102c65780630a9a2b72146102db575b600080fd5b60ff54610274906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b60fe546102b69074010000000000000000000000000000000000000000900460ff1681565b6040519015158152602001610288565b6102d96102d4366004613802565b610562565b005b6102ee6102e936600461381f565b610576565b60408051928352602083019190915201610288565b6102d9610311366004613802565b610624565b60fc54610274906001600160a01b031681565b6102d9610337366004613802565b610635565b6102ee61034a366004613861565b610646565b6102d961035d366004613802565b610784565b6102d9610370366004613802565b610795565b6102d96107a6565b6102ee61038b36600461381f565b61088c565b6102d961039e3660046138c0565b610973565b6102ee6103b136600461381f565b610a10565b6102ee6103c436600461381f565b610b19565b6103dc6103d7366004613802565b610c18565b604051908152602001610288565b6102d9610ca5565b6102d9610400366004613901565b610cb9565b6102d9610d00565b6033546001600160a01b0316610274565b6102ee61042c366004613861565b610d90565b6102d961043f36600461391a565b610e7a565b61047961045236600461391a565b60fd6020908152600092835260408084209091529082529020805460019091015460ff1682565b6040516102889291906139bd565b6097546001600160a01b0316610274565b6102ee6104a6366004613861565b610eb0565b6102d9610f9a565b6102d96104c1366004613a1d565b61104c565b60fe54610274906001600160a01b031681565b61012d54610274906001600160a01b031681565b6103dc6706f05b59d3b2000081565b6065546001600160a01b0316610274565b6102ee61051b366004613861565b6110ea565b6102d961052e366004613ad1565b61120d565b6102d9610541366004613802565b6115ac565b6102d9610554366004613b42565b611635565b6103dc60fb5481565b61056a6117bf565b61057381611819565b50565b60008060026001600160a01b03808616600090815260fd602090815260408083209388168352929052206001015460ff1660038111156105b8576105b8613953565b036105ef576040517f03410cd100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006105fa84610c18565b905085811015610608578095505b859250610616868686611896565b508092505050935093915050565b61062c6117bf565b61057381611bba565b61063d6117bf565b61057381611caf565b600080828585610654611d2e565b61065d83611d83565b816001600160a01b0316836001600160a01b0316148061068e5750806001600160a01b0316836001600160a01b0316145b156106c5576040517f8aa3a72f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6106cd611dc3565b6106da8a8a8a8a8a611e1c565b9095509350898514610718576040517fc214279600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604080516001600160a01b038a81168252602082018890529181018690528189169188169033907f795a235be939acb902ac69562805f86e1341a9b019c351b996e2aa2dfc34c67c906060015b60405180910390a4610777600160c955565b5050509550959350505050565b61078c6117bf565b61057381611ea3565b61079d6117bf565b61057381611f20565b6107e46040518060400160405280601281526020017f726573756d65436f6e76657273696f6e28290000000000000000000000000000815250611f9d565b60fe5474010000000000000000000000000000000000000000900460ff16610837576040517e6d8dbb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fe80547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16905560405133907f89b79206f08dadd78502cff5075d2b094fa0abea0b063cfafe4475e2a380c51f90600090a2565b60008060026001600160a01b03808616600090815260fd602090815260408083209388168352929052206001015460ff1660038111156108ce576108ce613953565b03610905576040517f03410cd100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8491506000610915868686612069565b9092509050600061092585610c18565b9050828110156109695781600181610945670de0b6b3a764000085613bd5565b61094f9190613c12565b6109599190613c2a565b6109639190613c41565b93508092505b5050935093915050565b61097b6117bf565b610983611dc3565b61098c83611d83565b61099582611d83565b61099e8161238a565b826109b36001600160a01b03821684846123c4565b826001600160a01b0316846001600160a01b03167f6d25be279134f4ecaa4770aff0c3d916d9e7c5ef37b65ed95dbdba411f5d54d5846040516109f891815260200190565b60405180910390a350610a0b600160c955565b505050565b60fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038481166004830152600092839291169063b62cad6990602401600060405180830381600087803b158015610a7457600080fd5b505af1158015610a88573d6000803e3d6000fd5b505060fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038781166004830152909116925063b62cad699150602401600060405180830381600087803b158015610aec57600080fd5b505af1158015610b00573d6000803e3d6000fd5b50505050610b0f858585612069565b5094959350505050565b60fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038481166004830152600092839291169063b62cad6990602401600060405180830381600087803b158015610b7d57600080fd5b505af1158015610b91573d6000803e3d6000fd5b505060fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038781166004830152909116925063b62cad699150602401600060405180830381600087803b158015610bf557600080fd5b505af1158015610c09573d6000803e3d6000fd5b50505050610b0f858585611896565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009082906001600160a01b038216906370a0823190602401602060405180830381865afa158015610c7a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c9e9190613c7c565b9392505050565b610cad6117bf565b610cb7600061248b565b565b610cf76040518060400160405280601e81526020017f7365744d696e416d6f756e74546f436f6e766572742875696e74323536290000815250611f9d565b610573816124bc565b60655433906001600160a01b03168114610d875760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f74207468652060448201527f6e6577206f776e6572000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6105738161248b565b600080828585610d9e611d2e565b610da783611d83565b816001600160a01b0316836001600160a01b03161480610dd85750806001600160a01b0316836001600160a01b0316145b15610e0f576040517f8aa3a72f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610e17611dc3565b610e248a8a8a8a8a611e1c565b9095509350604080516001600160a01b038a81168252602082018890529181018690528189169188169033907f93b7ba2a2b0e36320375853d7466af5685c07567804b871b4fdfd31e3bb7715490606001610765565b610e82611dc3565b6000610e8e8383612506565b90508015610ea157610ea183838361261b565b50610eac600160c955565b5050565b600080828585610ebe611d2e565b610ec783611d83565b816001600160a01b0316836001600160a01b03161480610ef85750806001600160a01b0316836001600160a01b0316145b15610f2f576040517f8aa3a72f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610f37611dc3565b610f448a8a8a8a8a612ad8565b9095509350604080516001600160a01b038a81168252602082018890529181018690528189169188169033907f9b7dc1d7d2974d015b4fc39889a09f3a3923add808f5863158f3162d997d4e8290606001610765565b610fd86040518060400160405280601181526020017f7061757365436f6e76657273696f6e2829000000000000000000000000000000815250611f9d565b610fe0611d2e565b60fe80547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000017905560405133907f490bc639fd0d96f19c8adf77bc98d17fbefdee2e1e1864d21f041360d0ee065a90600090a2565b82818114611086576040517f4d5590f300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b818110156110e1576110d9878787848181106110a7576110a7613c95565b90506020020160208101906110bc9190613802565b8686858181106110ce576110ce613c95565b90506040020161120d565b600101611089565b50505050505050565b6000808285856110f8611d2e565b61110183611d83565b816001600160a01b0316836001600160a01b031614806111325750806001600160a01b0316836001600160a01b0316145b15611169576040517f8aa3a72f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611171611dc3565b61117e8a8a8a8a8a612b6a565b90955093508884146111bc576040517fa8dc653c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604080516001600160a01b038a81168252602082018890529181018690528189169188169033907fcb4ea7de8d069b0f443b792cba6c6df5096508951bbc75c04ac42c9251efe07690606001610765565b61122e60405180606001604052806035815260200161402260359139611f9d565b61123783611d83565b61124082611d83565b6706f05b59d3b2000081351115611294576040517f9770caee000000000000000000000000000000000000000000000000000000008152813560048201526706f05b59d3b200006024820152604401610d7e565b816001600160a01b0316836001600160a01b031614806112c3575061012d546001600160a01b03848116911614155b8061130b575060006001600160a01b03808416600090815260fd602090815260408083209388168352929052206001015460ff16600381111561130857611308613953565b14155b15611342576040517feebb5ac600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60026113546040830160208401613cc4565b600381111561136557611365613953565b1480156113725750803515155b156113a9576040517fd0d4aabe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60026113bb6040830160208401613cc4565b60038111156113cc576113cc613953565b14806113f8575060016113e56040830160208401613cc4565b60038111156113f6576113f6613953565b145b801561140d575060ff546001600160a01b0316155b15611444576040517fe7c2c99400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03808416600081815260fd602090815260408083209487168084529482529182902080546001820154919594937f39fbfdd5da133303ed31b1b65e30a0ddf7a9236573368c66c859dceccc1dd12a93919288359260ff909116916114b491908a01908a01613cc4565b6040516114c49493929190613ce5565b60405180910390a360006114de6040840160208501613cc4565b60038111156114ef576114ef613953565b0361154c576001600160a01b03808516600090815260fd60209081526040808320938716835292905290812090815560010180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690556115a6565b813581556115606040830160208401613cc4565b6001808301805490917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00909116908360038111156115a0576115a0613953565b02179055505b50505050565b6115b46117bf565b606580546001600160a01b0383167fffffffffffffffffffffffff000000000000000000000000000000000000000090911681179091556115fd6033546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b600054610100900460ff16158080156116555750600054600160ff909116105b8061166f5750303b15801561166f575060005460ff166001145b6116e15760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610d7e565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055801561173f57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b61174883611caf565b61175486868685612c27565b80156117b757600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b6033546001600160a01b03163314610cb75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610d7e565b61182281611d83565b60fe546040516001600160a01b038084169216907f9be3097b5c8b276786be52a244ee90d66efd34805d9eb16f168fb2b4aaae9a2b90600090a360fe80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b600080846000036118d3576040517f42301c2300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03808516600090815260fd6020908152604080832093871683529281528282208351808501909452805484526001810154929392909183019060ff16600381111561192757611927613953565b600381111561193857611938613953565b905250905060008160200151600381111561195557611955613953565b0361198c576040517f618ce59700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b03878116600483015260009216906341976e0990602401602060405180830381865afa1580156119f0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a149190613c7c565b60fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b038881166004830152929350600092909116906341976e0990602401602060405180830381865afa158015611a7d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611aa19190613c7c565b835160ff54919250906001600160a01b031615801590611b41575060ff546040517f6c059fb10000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b0390911690636c059fb190602401602060405180830381865afa158015611b1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b419190613d16565b15611b4a575060005b6000611b5e82670de0b6b3a7640000613c12565b905082611b6b8286613bd5565b611b759190613c41565b955085600181611b8d670de0b6b3a76400008e613bd5565b611b979190613c12565b611ba19190613c2a565b611bab9190613c41565b96505050505050935093915050565b6001600160a01b038116611c365760405162461bcd60e51b815260206004820152602560248201527f696e76616c696420616365737320636f6e74726f6c206d616e6167657220616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610d7e565b609780546001600160a01b038381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa0910160405180910390a15050565b611cb881611d83565b61012d546040516001600160a01b038084169216907f4fe44995ca2482562846e3c0413d9bd6147e9ce1881c66a8765e8542fef99f4290600090a361012d80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b60fe5474010000000000000000000000000000000000000000900460ff1615610cb7576040517f952bcf7f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038116610573576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600260c95403611e155760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610d7e565b600260c955565b600080611e298585612cc0565b611e338588612de0565b9150611e40828686610a10565b91505085811015611e87576040517f228f8c110000000000000000000000000000000000000000000000000000000081526004810182905260248101879052604401610d7e565b611e92848483612f2b565b9550959350505050565b600160c955565b611eac81611d83565b60ff546040516001600160a01b038084169216907f50f1a16bf24734355b14ff800d132cc0a934808b8621d5623b41bc67f204881790600090a360ff80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b611f2981611d83565b60fc546040516001600160a01b038084169216907f56b5f80d8cac1479698aa7d01605fd6111e90b15fc4d2b377417f46034876cbd90600090a360fc80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6097546040517f18c5e8ab0000000000000000000000000000000000000000000000000000000081526000916001600160a01b0316906318c5e8ab90611fe99033908690600401613dae565b602060405180830381865afa158015612006573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061202a9190613d16565b905080610eac573330836040517f4a3fa293000000000000000000000000000000000000000000000000000000008152600401610d7e93929190613dd0565b600080846000036120a6576040517f098fb56100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03808516600090815260fd6020908152604080832093871683529281528282208351808501909452805484526001810154929392909183019060ff1660038111156120fa576120fa613953565b600381111561210b5761210b613953565b905250905060008160200151600381111561212857612128613953565b0361215f576040517f618ce59700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b03878116600483015260009216906341976e0990602401602060405180830381865afa1580156121c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121e79190613c7c565b60fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b038881166004830152929350600092909116906341976e0990602401602060405180830381865afa158015612250573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122749190613c7c565b835160ff54919250906001600160a01b031615801590612314575060ff546040517f6c059fb10000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b0390911690636c059fb190602401602060405180830381865afa1580156122f0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123149190613d16565b1561231d575060005b600061233182670de0b6b3a7640000613c12565b9050612345670de0b6b3a764000084613bd5565b81612350868d613bd5565b61235a9190613bd5565b6123649190613c41565b9650826123718286613bd5565b61237b9190613c41565b95505050505050935093915050565b80600003610573576040517f9cf8540c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040516001600160a01b038316602482015260448101829052610a0b9084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152612f8e565b606580547fffffffffffffffffffffffff000000000000000000000000000000000000000016905561057381613076565b6124c58161238a565b60fb5460408051918252602082018390527fada67d0d38fa20c8ae6a5c17cb9d60b0fe7f2d4e4f27ac9ee55e54ac88de9d8d910160405180910390a160fb55565b6040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152600090829082906001600160a01b038316906370a0823190602401602060405180830381865afa15801561256a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061258e9190613c7c565b61012d549093508391506001600160a01b03908116908516036126135760fe54600093506125c9906001600160a01b038481169116836123c4565b60fe546040518281526001600160a01b0386811692888216929116907fadc20ad416881f76b4304665c35f5be8592297bcdfe4f0bb087b9d254222af559060200160405180910390a45b505092915050565b600061263061012d546001600160a01b031690565b60fe5460ff549192506001600160a01b03908116916000911615612ad35760ff546040517f4e9f8f390000000000000000000000000000000000000000000000000000000081526001600160a01b03878116600483015285811660248301526000928392911690634e9f8f39906044016000604051808303816000875af11580156126bf573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526127059190810190613f09565b8151919350915060005b81811015612ace5782818151811061272957612729613c95565b602002602001015160000315612ace57600084828151811061274d5761274d613c95565b60200260200101516001600160a01b0316636f1a30a885848151811061277557612775613c95565b60200260200101518c8b6040518463ffffffff1660e01b81526004016127b7939291909283526001600160a01b03918216602084015216604082015260600190565b60408051808303816000875af11580156127d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127f99190613fce565b915050888111156128075750875b612811818b6130e0565b61281b5750612ace565b6040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b038881166004830152600091908a16906370a0823190602401602060405180830381865afa15801561287e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128a29190613c7c565b90508a6001600160a01b031663095ea7b38785815181106128c5576128c5613c95565b6020026020010151846040518363ffffffff1660e01b81526004016128ff9291906001600160a01b03929092168252602082015260400190565b6020604051808303816000875af115801561291e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129429190613d16565b5085838151811061295557612955613c95565b60209081029190910101516040517f439727a500000000000000000000000000000000000000000000000000000000815260048101849052600060248201526001600160a01b038d811660448301528b811660648301528a811660848301529091169063439727a59060a40160408051808303816000875af11580156129df573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a039190613fce565b50506040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b038981166004830152600091908b16906370a0823190602401602060405180830381865afa158015612a68573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a8c9190613c7c565b9050612a98838c613c2a565b9a50612aa48282613c2a565b612aae9089613c12565b97508a600003612ac057505050612ace565b83600101935050505061270f565b505050505b6117b7565b600080612ae58585612cc0565b6000612af2878787610b19565b91505087811115612b39576040517f71b5f0c10000000000000000000000000000000000000000000000000000000081526004810182905260248101899052604401610d7e565b612b438682612de0565b9250612b50838787610a10565b9250612b5f9050858584612f2b565b509550959350505050565b600080612b778585612cc0565b6000612b84878787610b19565b915050612b918682612de0565b9250808314612bcc576040517f0c5c1c2000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b87831115612c10576040517f71b5f0c10000000000000000000000000000000000000000000000000000000081526004810182905260248101899052604401610d7e565b612c1b858589612f2b565b50909694955050505050565b600054610100900460ff16612ca45760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d7e565b612cad84613218565b612cb56132a6565b6115a683838361332b565b60ff546000906001600160a01b031615801590612d5d575060ff546040517f6c059fb10000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b0390911690636c059fb190602401602060405180830381865afa158015612d39573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d5d9190613d16565b905080158015612da9575060026001600160a01b03808516600090815260fd602090815260408083209387168352929052206001015460ff166003811115612da757612da7613953565b145b15610a0b576040517f03410cd100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fe546040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b039182166004820152600091849183918316906370a0823190602401602060405180830381865afa158015612e49573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e6d9190613c7c565b60fe54909150612e8c906001600160a01b0384811691339116876133f0565b60fe546040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0391821660048201526000918416906370a0823190602401602060405180830381865afa158015612ef1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f159190613c7c565b9050612f218282613c2a565b9695505050505050565b6000612f3684610c18565b905081811015612f72576040517f6bb2792900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b83612f876001600160a01b03821685856123c4565b5050505050565b6000612fe3826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166134419092919063ffffffff16565b90508051600014806130045750808060200190518101906130049190613d16565b610a0b5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610d7e565b603380546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038381166004830152600092169063b62cad6990602401600060405180830381600087803b15801561314157600080fd5b505af1158015613155573d6000803e3d6000fd5b505060fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b03868116600483015260009450670de0b6b3a76400009350879216906341976e0990602401602060405180830381865afa1580156131c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131ed9190613c7c565b6131f79190613bd5565b6132019190613c41565b905060fb54811061321157600191505b5092915050565b600054610100900460ff166132955760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d7e565b61329d613458565b610573816134dd565b600054610100900460ff166133235760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d7e565b610cb761355a565b600054610100900460ff166133a85760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d7e565b6133b183611f20565b6133ba82611819565b6133c3816124bc565b505060fe80547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16905550565b6040516001600160a01b03808516602483015283166044820152606481018290526115a69085907f23b872dd0000000000000000000000000000000000000000000000000000000090608401612409565b606061345084846000856135d7565b949350505050565b600054610100900460ff166134d55760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d7e565b610cb76136c9565b600054610100900460ff1661062c5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d7e565b600054610100900460ff16611e9c5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d7e565b60608247101561364f5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610d7e565b600080866001600160a01b0316858760405161366b9190613ff2565b60006040518083038185875af1925050503d80600081146136a8576040519150601f19603f3d011682016040523d82523d6000602084013e6136ad565b606091505b50915091506136be8783838761374f565b979650505050505050565b600054610100900460ff166137465760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d7e565b610cb73361248b565b606083156137be5782516000036137b7576001600160a01b0385163b6137b75760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610d7e565b5081613450565b61345083838151156137d35781518083602001fd5b8060405162461bcd60e51b8152600401610d7e919061400e565b6001600160a01b038116811461057357600080fd5b60006020828403121561381457600080fd5b8135610c9e816137ed565b60008060006060848603121561383457600080fd5b833592506020840135613846816137ed565b91506040840135613856816137ed565b809150509250925092565b600080600080600060a0868803121561387957600080fd5b85359450602086013593506040860135613892816137ed565b925060608601356138a2816137ed565b915060808601356138b2816137ed565b809150509295509295909350565b6000806000606084860312156138d557600080fd5b83356138e0816137ed565b925060208401356138f0816137ed565b929592945050506040919091013590565b60006020828403121561391357600080fd5b5035919050565b6000806040838503121561392d57600080fd5b8235613938816137ed565b91506020830135613948816137ed565b809150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600481106139b9577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b9052565b82815260408101610c9e6020830184613982565b60008083601f8401126139e357600080fd5b50813567ffffffffffffffff8111156139fb57600080fd5b6020830191508360208260061b8501011115613a1657600080fd5b9250929050565b600080600080600060608688031215613a3557600080fd5b8535613a40816137ed565b9450602086013567ffffffffffffffff80821115613a5d57600080fd5b818801915088601f830112613a7157600080fd5b813581811115613a8057600080fd5b8960208260051b8501011115613a9557600080fd5b602083019650809550506040880135915080821115613ab357600080fd5b50613ac0888289016139d1565b969995985093965092949392505050565b60008060008385036080811215613ae757600080fd5b8435613af2816137ed565b93506020850135613b02816137ed565b925060407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc082011215613b3457600080fd5b506040840190509250925092565b600080600080600060a08688031215613b5a57600080fd5b8535613b65816137ed565b94506020860135613b75816137ed565b93506040860135613b85816137ed565b92506060860135613b95816137ed565b949793965091946080013592915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613c0d57613c0d613ba6565b500290565b60008219821115613c2557613c25613ba6565b500190565b600082821015613c3c57613c3c613ba6565b500390565b600082613c77577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b600060208284031215613c8e57600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060208284031215613cd657600080fd5b813560048110610c9e57600080fd5b8481526020810184905260808101613d006040830185613982565b613d0d6060830184613982565b95945050505050565b600060208284031215613d2857600080fd5b81518015158114610c9e57600080fd5b60005b83811015613d53578181015183820152602001613d3b565b838111156115a65750506000910152565b60008151808452613d7c816020860160208601613d38565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6001600160a01b03831681526040602082015260006134506040830184613d64565b60006001600160a01b03808616835280851660208401525060606040830152613d0d6060830184613d64565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715613e7257613e72613dfc565b604052919050565b600067ffffffffffffffff821115613e9457613e94613dfc565b5060051b60200190565b600082601f830112613eaf57600080fd5b81516020613ec4613ebf83613e7a565b613e2b565b82815260059290921b84018101918181019086841115613ee357600080fd5b8286015b84811015613efe5780518352918301918301613ee7565b509695505050505050565b60008060408385031215613f1c57600080fd5b825167ffffffffffffffff80821115613f3457600080fd5b818501915085601f830112613f4857600080fd5b81516020613f58613ebf83613e7a565b82815260059290921b84018101918181019089841115613f7757600080fd5b948201945b83861015613f9e578551613f8f816137ed565b82529482019490820190613f7c565b91880151919650909350505080821115613fb757600080fd5b50613fc485828601613e9e565b9150509250929050565b60008060408385031215613fe157600080fd5b505080516020909101519092909150565b60008251614004818460208701613d38565b9190910192915050565b602081526000610c9e6020830184613d6456fe736574436f6e76657273696f6e436f6e66696728616464726573732c616464726573732c436f6e76657273696f6e436f6e66696729a2646970667358221220fbd82e06735677bc9d44b30a618a4cd1179b2083744b3d0aafc0351f632f937464736f6c634300080d0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061025c5760003560e01c806379ba509711610145578063ca325469116100bd578063f04c31871161008c578063f2fde38b11610071578063f2fde38b14610533578063f7013ef614610546578063fe3da9841461055957600080fd5b8063f04c31871461050d578063f0dc7e9d1461052057600080fd5b8063ca325469146104c6578063cdf456e1146104d9578063e2ff7ea2146104ed578063e30c3978146104fc57600080fd5b8063b491ddf711610114578063b6828c57116100f9578063b6828c5714610498578063bc368b04146104ab578063c0654646146104b357600080fd5b8063b491ddf714610444578063b4a0bdf31461048757600080fd5b806379ba5097146104055780638da5cb5b1461040d57806390fa7b541461041e578063aac59a751461043157600080fd5b8063530e784f116101d85780636daa463b116101a757806370a082311161018c57806370a08231146103c9578063715018a6146103ea578063746460a9146103f257600080fd5b80636daa463b146103a35780636f1a30a8146103b657600080fd5b8063530e784f1461036257806358b904df146103755780635e1e63251461037d57806364aff9ec1461039057600080fd5b80630e32cb861161022f5780633606b26c116102145780633606b26c14610329578063439727a51461033c57806352e21a181461034f57600080fd5b80630e32cb86146103035780632630c12f1461031657600080fd5b806301e201781461026157806307aa239e146102915780630a0a05e6146102c65780630a9a2b72146102db575b600080fd5b60ff54610274906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b60fe546102b69074010000000000000000000000000000000000000000900460ff1681565b6040519015158152602001610288565b6102d96102d4366004613802565b610562565b005b6102ee6102e936600461381f565b610576565b60408051928352602083019190915201610288565b6102d9610311366004613802565b610624565b60fc54610274906001600160a01b031681565b6102d9610337366004613802565b610635565b6102ee61034a366004613861565b610646565b6102d961035d366004613802565b610784565b6102d9610370366004613802565b610795565b6102d96107a6565b6102ee61038b36600461381f565b61088c565b6102d961039e3660046138c0565b610973565b6102ee6103b136600461381f565b610a10565b6102ee6103c436600461381f565b610b19565b6103dc6103d7366004613802565b610c18565b604051908152602001610288565b6102d9610ca5565b6102d9610400366004613901565b610cb9565b6102d9610d00565b6033546001600160a01b0316610274565b6102ee61042c366004613861565b610d90565b6102d961043f36600461391a565b610e7a565b61047961045236600461391a565b60fd6020908152600092835260408084209091529082529020805460019091015460ff1682565b6040516102889291906139bd565b6097546001600160a01b0316610274565b6102ee6104a6366004613861565b610eb0565b6102d9610f9a565b6102d96104c1366004613a1d565b61104c565b60fe54610274906001600160a01b031681565b61012d54610274906001600160a01b031681565b6103dc6706f05b59d3b2000081565b6065546001600160a01b0316610274565b6102ee61051b366004613861565b6110ea565b6102d961052e366004613ad1565b61120d565b6102d9610541366004613802565b6115ac565b6102d9610554366004613b42565b611635565b6103dc60fb5481565b61056a6117bf565b61057381611819565b50565b60008060026001600160a01b03808616600090815260fd602090815260408083209388168352929052206001015460ff1660038111156105b8576105b8613953565b036105ef576040517f03410cd100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006105fa84610c18565b905085811015610608578095505b859250610616868686611896565b508092505050935093915050565b61062c6117bf565b61057381611bba565b61063d6117bf565b61057381611caf565b600080828585610654611d2e565b61065d83611d83565b816001600160a01b0316836001600160a01b0316148061068e5750806001600160a01b0316836001600160a01b0316145b156106c5576040517f8aa3a72f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6106cd611dc3565b6106da8a8a8a8a8a611e1c565b9095509350898514610718576040517fc214279600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604080516001600160a01b038a81168252602082018890529181018690528189169188169033907f795a235be939acb902ac69562805f86e1341a9b019c351b996e2aa2dfc34c67c906060015b60405180910390a4610777600160c955565b5050509550959350505050565b61078c6117bf565b61057381611ea3565b61079d6117bf565b61057381611f20565b6107e46040518060400160405280601281526020017f726573756d65436f6e76657273696f6e28290000000000000000000000000000815250611f9d565b60fe5474010000000000000000000000000000000000000000900460ff16610837576040517e6d8dbb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fe80547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16905560405133907f89b79206f08dadd78502cff5075d2b094fa0abea0b063cfafe4475e2a380c51f90600090a2565b60008060026001600160a01b03808616600090815260fd602090815260408083209388168352929052206001015460ff1660038111156108ce576108ce613953565b03610905576040517f03410cd100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8491506000610915868686612069565b9092509050600061092585610c18565b9050828110156109695781600181610945670de0b6b3a764000085613bd5565b61094f9190613c12565b6109599190613c2a565b6109639190613c41565b93508092505b5050935093915050565b61097b6117bf565b610983611dc3565b61098c83611d83565b61099582611d83565b61099e8161238a565b826109b36001600160a01b03821684846123c4565b826001600160a01b0316846001600160a01b03167f6d25be279134f4ecaa4770aff0c3d916d9e7c5ef37b65ed95dbdba411f5d54d5846040516109f891815260200190565b60405180910390a350610a0b600160c955565b505050565b60fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038481166004830152600092839291169063b62cad6990602401600060405180830381600087803b158015610a7457600080fd5b505af1158015610a88573d6000803e3d6000fd5b505060fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038781166004830152909116925063b62cad699150602401600060405180830381600087803b158015610aec57600080fd5b505af1158015610b00573d6000803e3d6000fd5b50505050610b0f858585612069565b5094959350505050565b60fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038481166004830152600092839291169063b62cad6990602401600060405180830381600087803b158015610b7d57600080fd5b505af1158015610b91573d6000803e3d6000fd5b505060fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038781166004830152909116925063b62cad699150602401600060405180830381600087803b158015610bf557600080fd5b505af1158015610c09573d6000803e3d6000fd5b50505050610b0f858585611896565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009082906001600160a01b038216906370a0823190602401602060405180830381865afa158015610c7a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c9e9190613c7c565b9392505050565b610cad6117bf565b610cb7600061248b565b565b610cf76040518060400160405280601e81526020017f7365744d696e416d6f756e74546f436f6e766572742875696e74323536290000815250611f9d565b610573816124bc565b60655433906001600160a01b03168114610d875760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f74207468652060448201527f6e6577206f776e6572000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6105738161248b565b600080828585610d9e611d2e565b610da783611d83565b816001600160a01b0316836001600160a01b03161480610dd85750806001600160a01b0316836001600160a01b0316145b15610e0f576040517f8aa3a72f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610e17611dc3565b610e248a8a8a8a8a611e1c565b9095509350604080516001600160a01b038a81168252602082018890529181018690528189169188169033907f93b7ba2a2b0e36320375853d7466af5685c07567804b871b4fdfd31e3bb7715490606001610765565b610e82611dc3565b6000610e8e8383612506565b90508015610ea157610ea183838361261b565b50610eac600160c955565b5050565b600080828585610ebe611d2e565b610ec783611d83565b816001600160a01b0316836001600160a01b03161480610ef85750806001600160a01b0316836001600160a01b0316145b15610f2f576040517f8aa3a72f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610f37611dc3565b610f448a8a8a8a8a612ad8565b9095509350604080516001600160a01b038a81168252602082018890529181018690528189169188169033907f9b7dc1d7d2974d015b4fc39889a09f3a3923add808f5863158f3162d997d4e8290606001610765565b610fd86040518060400160405280601181526020017f7061757365436f6e76657273696f6e2829000000000000000000000000000000815250611f9d565b610fe0611d2e565b60fe80547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000017905560405133907f490bc639fd0d96f19c8adf77bc98d17fbefdee2e1e1864d21f041360d0ee065a90600090a2565b82818114611086576040517f4d5590f300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b818110156110e1576110d9878787848181106110a7576110a7613c95565b90506020020160208101906110bc9190613802565b8686858181106110ce576110ce613c95565b90506040020161120d565b600101611089565b50505050505050565b6000808285856110f8611d2e565b61110183611d83565b816001600160a01b0316836001600160a01b031614806111325750806001600160a01b0316836001600160a01b0316145b15611169576040517f8aa3a72f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611171611dc3565b61117e8a8a8a8a8a612b6a565b90955093508884146111bc576040517fa8dc653c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604080516001600160a01b038a81168252602082018890529181018690528189169188169033907fcb4ea7de8d069b0f443b792cba6c6df5096508951bbc75c04ac42c9251efe07690606001610765565b61122e60405180606001604052806035815260200161402260359139611f9d565b61123783611d83565b61124082611d83565b6706f05b59d3b2000081351115611294576040517f9770caee000000000000000000000000000000000000000000000000000000008152813560048201526706f05b59d3b200006024820152604401610d7e565b816001600160a01b0316836001600160a01b031614806112c3575061012d546001600160a01b03848116911614155b8061130b575060006001600160a01b03808416600090815260fd602090815260408083209388168352929052206001015460ff16600381111561130857611308613953565b14155b15611342576040517feebb5ac600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60026113546040830160208401613cc4565b600381111561136557611365613953565b1480156113725750803515155b156113a9576040517fd0d4aabe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60026113bb6040830160208401613cc4565b60038111156113cc576113cc613953565b14806113f8575060016113e56040830160208401613cc4565b60038111156113f6576113f6613953565b145b801561140d575060ff546001600160a01b0316155b15611444576040517fe7c2c99400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03808416600081815260fd602090815260408083209487168084529482529182902080546001820154919594937f39fbfdd5da133303ed31b1b65e30a0ddf7a9236573368c66c859dceccc1dd12a93919288359260ff909116916114b491908a01908a01613cc4565b6040516114c49493929190613ce5565b60405180910390a360006114de6040840160208501613cc4565b60038111156114ef576114ef613953565b0361154c576001600160a01b03808516600090815260fd60209081526040808320938716835292905290812090815560010180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690556115a6565b813581556115606040830160208401613cc4565b6001808301805490917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00909116908360038111156115a0576115a0613953565b02179055505b50505050565b6115b46117bf565b606580546001600160a01b0383167fffffffffffffffffffffffff000000000000000000000000000000000000000090911681179091556115fd6033546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b600054610100900460ff16158080156116555750600054600160ff909116105b8061166f5750303b15801561166f575060005460ff166001145b6116e15760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610d7e565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055801561173f57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b61174883611caf565b61175486868685612c27565b80156117b757600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b6033546001600160a01b03163314610cb75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610d7e565b61182281611d83565b60fe546040516001600160a01b038084169216907f9be3097b5c8b276786be52a244ee90d66efd34805d9eb16f168fb2b4aaae9a2b90600090a360fe80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b600080846000036118d3576040517f42301c2300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03808516600090815260fd6020908152604080832093871683529281528282208351808501909452805484526001810154929392909183019060ff16600381111561192757611927613953565b600381111561193857611938613953565b905250905060008160200151600381111561195557611955613953565b0361198c576040517f618ce59700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b03878116600483015260009216906341976e0990602401602060405180830381865afa1580156119f0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a149190613c7c565b60fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b038881166004830152929350600092909116906341976e0990602401602060405180830381865afa158015611a7d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611aa19190613c7c565b835160ff54919250906001600160a01b031615801590611b41575060ff546040517f6c059fb10000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b0390911690636c059fb190602401602060405180830381865afa158015611b1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b419190613d16565b15611b4a575060005b6000611b5e82670de0b6b3a7640000613c12565b905082611b6b8286613bd5565b611b759190613c41565b955085600181611b8d670de0b6b3a76400008e613bd5565b611b979190613c12565b611ba19190613c2a565b611bab9190613c41565b96505050505050935093915050565b6001600160a01b038116611c365760405162461bcd60e51b815260206004820152602560248201527f696e76616c696420616365737320636f6e74726f6c206d616e6167657220616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610d7e565b609780546001600160a01b038381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa0910160405180910390a15050565b611cb881611d83565b61012d546040516001600160a01b038084169216907f4fe44995ca2482562846e3c0413d9bd6147e9ce1881c66a8765e8542fef99f4290600090a361012d80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b60fe5474010000000000000000000000000000000000000000900460ff1615610cb7576040517f952bcf7f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038116610573576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600260c95403611e155760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610d7e565b600260c955565b600080611e298585612cc0565b611e338588612de0565b9150611e40828686610a10565b91505085811015611e87576040517f228f8c110000000000000000000000000000000000000000000000000000000081526004810182905260248101879052604401610d7e565b611e92848483612f2b565b9550959350505050565b600160c955565b611eac81611d83565b60ff546040516001600160a01b038084169216907f50f1a16bf24734355b14ff800d132cc0a934808b8621d5623b41bc67f204881790600090a360ff80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b611f2981611d83565b60fc546040516001600160a01b038084169216907f56b5f80d8cac1479698aa7d01605fd6111e90b15fc4d2b377417f46034876cbd90600090a360fc80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6097546040517f18c5e8ab0000000000000000000000000000000000000000000000000000000081526000916001600160a01b0316906318c5e8ab90611fe99033908690600401613dae565b602060405180830381865afa158015612006573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061202a9190613d16565b905080610eac573330836040517f4a3fa293000000000000000000000000000000000000000000000000000000008152600401610d7e93929190613dd0565b600080846000036120a6576040517f098fb56100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03808516600090815260fd6020908152604080832093871683529281528282208351808501909452805484526001810154929392909183019060ff1660038111156120fa576120fa613953565b600381111561210b5761210b613953565b905250905060008160200151600381111561212857612128613953565b0361215f576040517f618ce59700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b03878116600483015260009216906341976e0990602401602060405180830381865afa1580156121c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121e79190613c7c565b60fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b038881166004830152929350600092909116906341976e0990602401602060405180830381865afa158015612250573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122749190613c7c565b835160ff54919250906001600160a01b031615801590612314575060ff546040517f6c059fb10000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b0390911690636c059fb190602401602060405180830381865afa1580156122f0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123149190613d16565b1561231d575060005b600061233182670de0b6b3a7640000613c12565b9050612345670de0b6b3a764000084613bd5565b81612350868d613bd5565b61235a9190613bd5565b6123649190613c41565b9650826123718286613bd5565b61237b9190613c41565b95505050505050935093915050565b80600003610573576040517f9cf8540c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040516001600160a01b038316602482015260448101829052610a0b9084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152612f8e565b606580547fffffffffffffffffffffffff000000000000000000000000000000000000000016905561057381613076565b6124c58161238a565b60fb5460408051918252602082018390527fada67d0d38fa20c8ae6a5c17cb9d60b0fe7f2d4e4f27ac9ee55e54ac88de9d8d910160405180910390a160fb55565b6040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152600090829082906001600160a01b038316906370a0823190602401602060405180830381865afa15801561256a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061258e9190613c7c565b61012d549093508391506001600160a01b03908116908516036126135760fe54600093506125c9906001600160a01b038481169116836123c4565b60fe546040518281526001600160a01b0386811692888216929116907fadc20ad416881f76b4304665c35f5be8592297bcdfe4f0bb087b9d254222af559060200160405180910390a45b505092915050565b600061263061012d546001600160a01b031690565b60fe5460ff549192506001600160a01b03908116916000911615612ad35760ff546040517f4e9f8f390000000000000000000000000000000000000000000000000000000081526001600160a01b03878116600483015285811660248301526000928392911690634e9f8f39906044016000604051808303816000875af11580156126bf573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526127059190810190613f09565b8151919350915060005b81811015612ace5782818151811061272957612729613c95565b602002602001015160000315612ace57600084828151811061274d5761274d613c95565b60200260200101516001600160a01b0316636f1a30a885848151811061277557612775613c95565b60200260200101518c8b6040518463ffffffff1660e01b81526004016127b7939291909283526001600160a01b03918216602084015216604082015260600190565b60408051808303816000875af11580156127d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127f99190613fce565b915050888111156128075750875b612811818b6130e0565b61281b5750612ace565b6040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b038881166004830152600091908a16906370a0823190602401602060405180830381865afa15801561287e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128a29190613c7c565b90508a6001600160a01b031663095ea7b38785815181106128c5576128c5613c95565b6020026020010151846040518363ffffffff1660e01b81526004016128ff9291906001600160a01b03929092168252602082015260400190565b6020604051808303816000875af115801561291e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129429190613d16565b5085838151811061295557612955613c95565b60209081029190910101516040517f439727a500000000000000000000000000000000000000000000000000000000815260048101849052600060248201526001600160a01b038d811660448301528b811660648301528a811660848301529091169063439727a59060a40160408051808303816000875af11580156129df573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a039190613fce565b50506040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b038981166004830152600091908b16906370a0823190602401602060405180830381865afa158015612a68573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a8c9190613c7c565b9050612a98838c613c2a565b9a50612aa48282613c2a565b612aae9089613c12565b97508a600003612ac057505050612ace565b83600101935050505061270f565b505050505b6117b7565b600080612ae58585612cc0565b6000612af2878787610b19565b91505087811115612b39576040517f71b5f0c10000000000000000000000000000000000000000000000000000000081526004810182905260248101899052604401610d7e565b612b438682612de0565b9250612b50838787610a10565b9250612b5f9050858584612f2b565b509550959350505050565b600080612b778585612cc0565b6000612b84878787610b19565b915050612b918682612de0565b9250808314612bcc576040517f0c5c1c2000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b87831115612c10576040517f71b5f0c10000000000000000000000000000000000000000000000000000000081526004810182905260248101899052604401610d7e565b612c1b858589612f2b565b50909694955050505050565b600054610100900460ff16612ca45760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d7e565b612cad84613218565b612cb56132a6565b6115a683838361332b565b60ff546000906001600160a01b031615801590612d5d575060ff546040517f6c059fb10000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b0390911690636c059fb190602401602060405180830381865afa158015612d39573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d5d9190613d16565b905080158015612da9575060026001600160a01b03808516600090815260fd602090815260408083209387168352929052206001015460ff166003811115612da757612da7613953565b145b15610a0b576040517f03410cd100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fe546040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b039182166004820152600091849183918316906370a0823190602401602060405180830381865afa158015612e49573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e6d9190613c7c565b60fe54909150612e8c906001600160a01b0384811691339116876133f0565b60fe546040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0391821660048201526000918416906370a0823190602401602060405180830381865afa158015612ef1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f159190613c7c565b9050612f218282613c2a565b9695505050505050565b6000612f3684610c18565b905081811015612f72576040517f6bb2792900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b83612f876001600160a01b03821685856123c4565b5050505050565b6000612fe3826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166134419092919063ffffffff16565b90508051600014806130045750808060200190518101906130049190613d16565b610a0b5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610d7e565b603380546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038381166004830152600092169063b62cad6990602401600060405180830381600087803b15801561314157600080fd5b505af1158015613155573d6000803e3d6000fd5b505060fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b03868116600483015260009450670de0b6b3a76400009350879216906341976e0990602401602060405180830381865afa1580156131c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131ed9190613c7c565b6131f79190613bd5565b6132019190613c41565b905060fb54811061321157600191505b5092915050565b600054610100900460ff166132955760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d7e565b61329d613458565b610573816134dd565b600054610100900460ff166133235760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d7e565b610cb761355a565b600054610100900460ff166133a85760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d7e565b6133b183611f20565b6133ba82611819565b6133c3816124bc565b505060fe80547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16905550565b6040516001600160a01b03808516602483015283166044820152606481018290526115a69085907f23b872dd0000000000000000000000000000000000000000000000000000000090608401612409565b606061345084846000856135d7565b949350505050565b600054610100900460ff166134d55760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d7e565b610cb76136c9565b600054610100900460ff1661062c5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d7e565b600054610100900460ff16611e9c5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d7e565b60608247101561364f5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610d7e565b600080866001600160a01b0316858760405161366b9190613ff2565b60006040518083038185875af1925050503d80600081146136a8576040519150601f19603f3d011682016040523d82523d6000602084013e6136ad565b606091505b50915091506136be8783838761374f565b979650505050505050565b600054610100900460ff166137465760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d7e565b610cb73361248b565b606083156137be5782516000036137b7576001600160a01b0385163b6137b75760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610d7e565b5081613450565b61345083838151156137d35781518083602001fd5b8060405162461bcd60e51b8152600401610d7e919061400e565b6001600160a01b038116811461057357600080fd5b60006020828403121561381457600080fd5b8135610c9e816137ed565b60008060006060848603121561383457600080fd5b833592506020840135613846816137ed565b91506040840135613856816137ed565b809150509250925092565b600080600080600060a0868803121561387957600080fd5b85359450602086013593506040860135613892816137ed565b925060608601356138a2816137ed565b915060808601356138b2816137ed565b809150509295509295909350565b6000806000606084860312156138d557600080fd5b83356138e0816137ed565b925060208401356138f0816137ed565b929592945050506040919091013590565b60006020828403121561391357600080fd5b5035919050565b6000806040838503121561392d57600080fd5b8235613938816137ed565b91506020830135613948816137ed565b809150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600481106139b9577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b9052565b82815260408101610c9e6020830184613982565b60008083601f8401126139e357600080fd5b50813567ffffffffffffffff8111156139fb57600080fd5b6020830191508360208260061b8501011115613a1657600080fd5b9250929050565b600080600080600060608688031215613a3557600080fd5b8535613a40816137ed565b9450602086013567ffffffffffffffff80821115613a5d57600080fd5b818801915088601f830112613a7157600080fd5b813581811115613a8057600080fd5b8960208260051b8501011115613a9557600080fd5b602083019650809550506040880135915080821115613ab357600080fd5b50613ac0888289016139d1565b969995985093965092949392505050565b60008060008385036080811215613ae757600080fd5b8435613af2816137ed565b93506020850135613b02816137ed565b925060407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc082011215613b3457600080fd5b506040840190509250925092565b600080600080600060a08688031215613b5a57600080fd5b8535613b65816137ed565b94506020860135613b75816137ed565b93506040860135613b85816137ed565b92506060860135613b95816137ed565b949793965091946080013592915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613c0d57613c0d613ba6565b500290565b60008219821115613c2557613c25613ba6565b500190565b600082821015613c3c57613c3c613ba6565b500390565b600082613c77577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b600060208284031215613c8e57600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060208284031215613cd657600080fd5b813560048110610c9e57600080fd5b8481526020810184905260808101613d006040830185613982565b613d0d6060830184613982565b95945050505050565b600060208284031215613d2857600080fd5b81518015158114610c9e57600080fd5b60005b83811015613d53578181015183820152602001613d3b565b838111156115a65750506000910152565b60008151808452613d7c816020860160208601613d38565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6001600160a01b03831681526040602082015260006134506040830184613d64565b60006001600160a01b03808616835280851660208401525060606040830152613d0d6060830184613d64565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715613e7257613e72613dfc565b604052919050565b600067ffffffffffffffff821115613e9457613e94613dfc565b5060051b60200190565b600082601f830112613eaf57600080fd5b81516020613ec4613ebf83613e7a565b613e2b565b82815260059290921b84018101918181019086841115613ee357600080fd5b8286015b84811015613efe5780518352918301918301613ee7565b509695505050505050565b60008060408385031215613f1c57600080fd5b825167ffffffffffffffff80821115613f3457600080fd5b818501915085601f830112613f4857600080fd5b81516020613f58613ebf83613e7a565b82815260059290921b84018101918181019089841115613f7757600080fd5b948201945b83861015613f9e578551613f8f816137ed565b82529482019490820190613f7c565b91880151919650909350505080821115613fb757600080fd5b50613fc485828601613e9e565b9150509250929050565b60008060408385031215613fe157600080fd5b505080516020909101519092909150565b60008251614004818460208701613d38565b9190910192915050565b602081526000610c9e6020830184613d6456fe736574436f6e76657273696f6e436f6e66696728616464726573732c616464726573732c436f6e76657273696f6e436f6e66696729a2646970667358221220fbd82e06735677bc9d44b30a618a4cd1179b2083744b3d0aafc0351f632f937464736f6c634300080d0033", + "numDeployments": 2, + "solcInputHash": "e9f683aad829bf9574e4eef6b067ab3e", + "metadata": "{\"compiler\":{\"version\":\"0.8.13+commit.abaa5c0e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountInMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountInMaxMantissa\",\"type\":\"uint256\"}],\"name\":\"AmountInHigherThanMax\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AmountInMismatched\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOutMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMinMantissa\",\"type\":\"uint256\"}],\"name\":\"AmountOutLowerThanMinRequired\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AmountOutMismatched\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ConversionConfigNotEnabled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ConversionEnabledOnlyForPrivateConversions\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ConversionTokensActive\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ConversionTokensPaused\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DeflationaryTokenNotSupported\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"incentive\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxIncentive\",\"type\":\"uint256\"}],\"name\":\"IncentiveTooHigh\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InputLengthMisMatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientInputAmount\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientOutputAmount\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientPoolLiquidity\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidConverterNetwork\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidMinimumAmountToConvert\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidToAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidTokenConfigAddresses\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NonZeroIncentiveForPrivateConversion\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"calledContract\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"methodSignature\",\"type\":\"string\"}],\"name\":\"Unauthorized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddressNotAllowed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroValueNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"comptroller\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"AssetTransferredToDestination\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldBaseAsset\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newBaseAsset\",\"type\":\"address\"}],\"name\":\"BaseAssetUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldIncentive\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newIncentive\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"enum IAbstractTokenConverter.ConversionAccessibility\",\"name\":\"oldAccess\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"enum IAbstractTokenConverter.ConversionAccessibility\",\"name\":\"newAccess\",\"type\":\"uint8\"}],\"name\":\"ConversionConfigUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"ConversionPaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"ConversionResumed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"name\":\"ConvertedExactTokens\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"name\":\"ConvertedExactTokensSupportingFeeOnTransferTokens\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"name\":\"ConvertedForExactTokens\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"name\":\"ConvertedForExactTokensSupportingFeeOnTransferTokens\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldConverterNetwork\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"converterNetwork\",\"type\":\"address\"}],\"name\":\"ConverterNetworkAddressUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldDestinationAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"destinationAddress\",\"type\":\"address\"}],\"name\":\"DestinationAddressUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldMinAmountToConvert\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newMinAmountToConvert\",\"type\":\"uint256\"}],\"name\":\"MinAmountToConvertUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldAccessControlManager\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAccessControlManager\",\"type\":\"address\"}],\"name\":\"NewAccessControlManager\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract ResilientOracle\",\"name\":\"oldPriceOracle\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"contract ResilientOracle\",\"name\":\"priceOracle\",\"type\":\"address\"}],\"name\":\"PriceOracleUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"SweepToken\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"MAX_INCENTIVE\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"accessControlManager\",\"outputs\":[{\"internalType\":\"contract IAccessControlManagerV8\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenBalance\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"baseAsset\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"conversionConfigurations\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"incentive\",\"type\":\"uint256\"},{\"internalType\":\"enum IAbstractTokenConverter.ConversionAccessibility\",\"name\":\"conversionAccess\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"conversionPaused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountInMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMinMantissa\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"convertExactTokens\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"actualAmountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actualAmountOut\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountInMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMinMantissa\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"convertExactTokensSupportingFeeOnTransferTokens\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"actualAmountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actualAmountOut\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountInMaxMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMantissa\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"convertForExactTokens\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"actualAmountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actualAmountOut\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountInMaxMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMantissa\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"convertForExactTokensSupportingFeeOnTransferTokens\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"actualAmountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actualAmountOut\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"converterNetwork\",\"outputs\":[{\"internalType\":\"contract IConverterNetwork\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"destinationAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOutMantissa\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"}],\"name\":\"getAmountIn\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountConvertedMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountInMantissa\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountInMantissa\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"}],\"name\":\"getAmountOut\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountConvertedMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMantissa\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOutMantissa\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"}],\"name\":\"getUpdatedAmountIn\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountConvertedMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountInMantissa\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountInMantissa\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"}],\"name\":\"getUpdatedAmountOut\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountConvertedMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMantissa\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"accessControlManager_\",\"type\":\"address\"},{\"internalType\":\"contract ResilientOracle\",\"name\":\"priceOracle_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"destinationAddress_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"baseAsset_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"minAmountToConvert_\",\"type\":\"uint256\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"minAmountToConvert\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pauseConversion\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pendingOwner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"priceOracle\",\"outputs\":[{\"internalType\":\"contract ResilientOracle\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"resumeConversion\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"accessControlManager_\",\"type\":\"address\"}],\"name\":\"setAccessControlManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"baseAsset_\",\"type\":\"address\"}],\"name\":\"setBaseAsset\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"incentive\",\"type\":\"uint256\"},{\"internalType\":\"enum IAbstractTokenConverter.ConversionAccessibility\",\"name\":\"conversionAccess\",\"type\":\"uint8\"}],\"internalType\":\"struct IAbstractTokenConverter.ConversionConfig\",\"name\":\"conversionConfig\",\"type\":\"tuple\"}],\"name\":\"setConversionConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"tokenAddressesOut\",\"type\":\"address[]\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"incentive\",\"type\":\"uint256\"},{\"internalType\":\"enum IAbstractTokenConverter.ConversionAccessibility\",\"name\":\"conversionAccess\",\"type\":\"uint8\"}],\"internalType\":\"struct IAbstractTokenConverter.ConversionConfig[]\",\"name\":\"conversionConfigs\",\"type\":\"tuple[]\"}],\"name\":\"setConversionConfigs\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IConverterNetwork\",\"name\":\"converterNetwork_\",\"type\":\"address\"}],\"name\":\"setConverterNetwork\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"destinationAddress_\",\"type\":\"address\"}],\"name\":\"setDestination\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minAmountToConvert_\",\"type\":\"uint256\"}],\"name\":\"setMinAmountToConvert\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ResilientOracle\",\"name\":\"priceOracle_\",\"type\":\"address\"}],\"name\":\"setPriceOracle\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"sweepToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"comptroller\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"}],\"name\":\"updateAssetsState\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Venus\",\"custom:security-contact\":\"https://github.com/VenusProtocol/protocol-reserve#discussion\",\"kind\":\"dev\",\"methods\":{\"acceptOwnership()\":{\"details\":\"The new owner accepts the ownership transfer.\"},\"balanceOf(address)\":{\"params\":{\"tokenAddress\":\"Address of the token\"},\"returns\":{\"tokenBalance\":\"Balance of the token the contract has\"}},\"constructor\":{\"custom:oz-upgrades-unsafe-allow\":\"constructor\"},\"convertExactTokens(uint256,uint256,address,address,address)\":{\"custom:error\":\"ZeroAddressNotAllowed is thrown when to address is zeroInvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOutAmountOutLowerThanMinRequired error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissaAmountInMismatched error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa\",\"custom:event\":\"Emits ConvertedExactTokens event on success\",\"details\":\"Method does not support deflationary tokens transfer\",\"params\":{\"amountInMantissa\":\"Amount of tokenAddressIn\",\"amountOutMinMantissa\":\"Min amount of tokenAddressOut required as output\",\"to\":\"Address of the tokenAddressOut receiver\",\"tokenAddressIn\":\"Address of the token to convert\",\"tokenAddressOut\":\"Address of the token to get after conversion\"},\"returns\":{\"actualAmountIn\":\"Actual amount transferred to destination\",\"actualAmountOut\":\"Actual amount transferred to user\"}},\"convertExactTokensSupportingFeeOnTransferTokens(uint256,uint256,address,address,address)\":{\"custom:error\":\"ZeroAddressNotAllowed is thrown when to address is zeroInvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOutAmountOutLowerThanMinRequired error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa\",\"custom:event\":\"Emits ConvertedExactTokensSupportingFeeOnTransferTokens event on success\",\"params\":{\"amountInMantissa\":\"Amount of tokenAddressIn\",\"amountOutMinMantissa\":\"Min amount of tokenAddressOut required as output\",\"to\":\"Address of the tokenAddressOut receiver\",\"tokenAddressIn\":\"Address of the token to convert\",\"tokenAddressOut\":\"Address of the token to get after conversion\"},\"returns\":{\"actualAmountIn\":\"Actual amount transferred to destination\",\"actualAmountOut\":\"Actual amount transferred to user\"}},\"convertForExactTokens(uint256,uint256,address,address,address)\":{\"custom:error\":\"ZeroAddressNotAllowed is thrown when to address is zeroInvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOutAmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissaAmountOutMismatched error is thrown when actualAmountOut is does not match amountOutMantissa\",\"custom:event\":\"Emits ConvertedForExactTokens event on success\",\"details\":\"Method does not support deflationary tokens transfer\",\"params\":{\"amountInMaxMantissa\":\"Max amount of tokenAddressIn\",\"amountOutMantissa\":\"Amount of tokenAddressOut required as output\",\"to\":\"Address of the tokenAddressOut receiver\",\"tokenAddressIn\":\"Address of the token to convert\",\"tokenAddressOut\":\"Address of the token to get after conversion\"},\"returns\":{\"actualAmountIn\":\"Actual amount transferred to destination\",\"actualAmountOut\":\"Actual amount transferred to user\"}},\"convertForExactTokensSupportingFeeOnTransferTokens(uint256,uint256,address,address,address)\":{\"custom:error\":\"ZeroAddressNotAllowed is thrown when to address is zeroInvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOutAmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissa\",\"custom:event\":\"Emits ConvertedForExactTokensSupportingFeeOnTransferTokens event on success\",\"params\":{\"amountInMaxMantissa\":\"Max amount of tokenAddressIn\",\"amountOutMantissa\":\"Amount of tokenAddressOut required as output\",\"to\":\"Address of the tokenAddressOut receiver\",\"tokenAddressIn\":\"Address of the token to convert\",\"tokenAddressOut\":\"Address of the token to get after conversion\"},\"returns\":{\"actualAmountIn\":\"Actual amount transferred to destination\",\"actualAmountOut\":\"Actual amount transferred to user\"}},\"getAmountIn(uint256,address,address)\":{\"custom:error\":\"InsufficientInputAmount error is thrown when given input amount is zeroConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pairConversionEnabledOnlyForPrivateConversions is thrown when conversion is only enabled for private conversion\",\"details\":\"This function retrieves values without altering token prices\",\"params\":{\"amountOutMantissa\":\"Amount of tokenAddressOut user wants to receive\",\"tokenAddressIn\":\"Address of the token to convert\",\"tokenAddressOut\":\"Address of the token to get after conversion\"},\"returns\":{\"amountConvertedMantissa\":\"Amount of tokenAddressOut should be transferred after conversion\",\"amountInMantissa\":\"Amount of the tokenAddressIn sender would send to contract before conversion\"}},\"getAmountOut(uint256,address,address)\":{\"custom:error\":\"InsufficientInputAmount error is thrown when given input amount is zeroConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pairConversionEnabledOnlyForPrivateConversions is thrown when conversion is only enabled for private conversion\",\"details\":\"This function retrieves values without altering token prices\",\"params\":{\"amountInMantissa\":\"Amount of tokenAddressIn\",\"tokenAddressIn\":\"Address of the token to convert\",\"tokenAddressOut\":\"Address of the token to get after conversion\"},\"returns\":{\"amountConvertedMantissa\":\"Amount of tokenAddressIn should be transferred after conversion\",\"amountOutMantissa\":\"Amount of the tokenAddressOut sender should receive after conversion\"}},\"getUpdatedAmountIn(uint256,address,address)\":{\"custom:error\":\"InsufficientInputAmount error is thrown when given input amount is zeroConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\",\"params\":{\"amountOutMantissa\":\"Amount of tokenAddressOut user wants to receive\",\"tokenAddressIn\":\"Address of the token to convert\",\"tokenAddressOut\":\"Address of the token to get after conversion\"},\"returns\":{\"amountConvertedMantissa\":\"Amount of tokenAddressOut should be transferred after conversion\",\"amountInMantissa\":\"Amount of the tokenAddressIn sender would send to contract before conversion\"}},\"getUpdatedAmountOut(uint256,address,address)\":{\"custom:error\":\"InsufficientInputAmount error is thrown when given input amount is zeroConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\",\"params\":{\"amountInMantissa\":\"Amount of tokenAddressIn\",\"tokenAddressIn\":\"Address of the token to convert\",\"tokenAddressOut\":\"Address of the token to get after conversion\"},\"returns\":{\"amountConvertedMantissa\":\"Amount of tokenAddressIn should be transferred after conversion\",\"amountOutMantissa\":\"Amount of the tokenAddressOut sender should receive after conversion\"}},\"initialize(address,address,address,address,uint256)\":{\"params\":{\"accessControlManager_\":\"Access control manager contract address\",\"baseAsset_\":\"Address of the base asset\",\"destinationAddress_\":\"Address at all incoming tokens will transferred to\",\"minAmountToConvert_\":\"Minimum amount to convert\",\"priceOracle_\":\"Resilient oracle address\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"pauseConversion()\":{\"custom:access\":\"Restricted by ACM\",\"custom:error\":\"ConversionTokensPaused thrown when conversion is already paused\",\"custom:event\":\"Emits ConversionPaused on success\"},\"pendingOwner()\":{\"details\":\"Returns the address of the pending owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.\"},\"resumeConversion()\":{\"custom:access\":\"Restricted by ACM\",\"custom:error\":\"ConversionTokensActive thrown when conversion is already active\",\"custom:event\":\"Emits ConversionResumed on success\"},\"setAccessControlManager(address)\":{\"custom:access\":\"Only Governance\",\"custom:event\":\"Emits NewAccessControlManager event\",\"details\":\"Admin function to set address of AccessControlManager\",\"params\":{\"accessControlManager_\":\"The new address of the AccessControlManager\"}},\"setBaseAsset(address)\":{\"custom:access\":\"Only Governance\",\"params\":{\"baseAsset_\":\"The new address of the base asset\"}},\"setConversionConfig(address,address,(uint256,uint8))\":{\"custom:access\":\"Controlled by AccessControlManager\",\"custom:error\":\"Unauthorized error is thrown when the call is not authorized by AccessControlManagerZeroAddressNotAllowed is thrown when pool registry address is zeroNonZeroIncentiveForPrivateConversion is thrown when incentive is non zero for private conversion\",\"custom:event\":\"Emits ConversionConfigUpdated event on success\",\"params\":{\"conversionConfig\":\"ConversionConfig config details to update\",\"tokenAddressIn\":\"Address of tokenIn\",\"tokenAddressOut\":\"Address of tokenOut\"}},\"setConversionConfigs(address,address[],(uint256,uint8)[])\":{\"custom:error\":\"InputLengthMisMatch is thrown when tokenAddressesOut and conversionConfigs array length mismatches\",\"params\":{\"conversionConfigs\":\"Array of conversionConfig config details to update\",\"tokenAddressIn\":\"Address of tokenIn\",\"tokenAddressesOut\":\"Array of addresses of tokenOut\"}},\"setConverterNetwork(address)\":{\"custom:access\":\"Only Governance\",\"params\":{\"converterNetwork_\":\"The converterNetwork address to be set\"}},\"setDestination(address)\":{\"custom:access\":\"Only Governance\",\"params\":{\"destinationAddress_\":\"The new destination address to be set\"}},\"setMinAmountToConvert(uint256)\":{\"custom:access\":\"Only Governance\",\"params\":{\"minAmountToConvert_\":\"Min amount to convert\"}},\"setPriceOracle(address)\":{\"custom:access\":\"Only Governance\",\"params\":{\"priceOracle_\":\"Address of the new price oracle to set\"}},\"sweepToken(address,address,uint256)\":{\"custom:access\":\"Only Governance\",\"custom:error\":\"ZeroAddressNotAllowed is thrown when tokenAddress/to address is zero\",\"custom:event\":\"Emits SweepToken event on success\",\"params\":{\"amount\":\"The amount to transfer\",\"to\":\"The address to which tokens will be transferred\",\"tokenAddress\":\"The address of the ERC-20 token to sweep\"}},\"transferOwnership(address)\":{\"details\":\"Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. Can only be called by the current owner.\"},\"updateAssetsState(address,address)\":{\"details\":\"This function is called by protocolShareReservecall _updateAssetsState to update the states related to the comptroller and asset transfer to the specific converter then it calls the _privateConversion which will convert the asset into destination's base asset and transfer it to destination address\",\"params\":{\"asset\":\"Asset address\",\"comptroller\":\"Comptroller address (pool)\"}}},\"title\":\"SingleTokenConverter\",\"version\":1},\"userdoc\":{\"errors\":{\"AmountInHigherThanMax(uint256,uint256)\":[{\"notice\":\"Thrown when amountIn is higher than amountInMax\"}],\"AmountInMismatched()\":[{\"notice\":\"Thrown when actualAmountIn does not match with amountInMantissa for convertForExactTokens\"}],\"AmountOutLowerThanMinRequired(uint256,uint256)\":[{\"notice\":\"Thrown when amountOut is lower than amountOutMin\"}],\"AmountOutMismatched()\":[{\"notice\":\"Thrown when actualAmountOut does not match with amountOutMantissa for convertForExactTokens\"}],\"ConversionConfigNotEnabled()\":[{\"notice\":\"Thrown when conversion is disabled or config does not exist for given pair\"}],\"ConversionEnabledOnlyForPrivateConversions()\":[{\"notice\":\"Thrown when conversion is enabled only for private conversions\"}],\"ConversionTokensActive()\":[{\"notice\":\"Thrown when conversion is Active\"}],\"ConversionTokensPaused()\":[{\"notice\":\"Thrown when conversion is paused\"}],\"DeflationaryTokenNotSupported()\":[{\"notice\":\"Thrown when using convertForExactTokens deflationary tokens\"}],\"IncentiveTooHigh(uint256,uint256)\":[{\"notice\":\"Thrown when incentive is higher than the MAX_INCENTIVE\"}],\"InputLengthMisMatch()\":[{\"notice\":\"Thrown when there is a mismatch in the length of input arrays\"}],\"InsufficientInputAmount()\":[{\"notice\":\"Thrown when given input amount is zero\"}],\"InsufficientOutputAmount()\":[{\"notice\":\"Thrown when given output amount is zero\"}],\"InsufficientPoolLiquidity()\":[{\"notice\":\"Thrown when contract has less liquidity for tokenAddressOut than amountOutMantissa\"}],\"InvalidConverterNetwork()\":[{\"notice\":\"When address of the ConverterNetwork is not set or Zero address\"}],\"InvalidMinimumAmountToConvert()\":[{\"notice\":\"Thrown when minimum amount to convert is zero\"}],\"InvalidToAddress()\":[{\"notice\":\"Thrown when address(to) is same as tokenAddressIn or tokenAddressOut\"}],\"InvalidTokenConfigAddresses()\":[{\"notice\":\"Thrown when tokenInAddress is same as tokeOutAdress OR tokeInAddress is not the base asset of the destination\"}],\"NonZeroIncentiveForPrivateConversion()\":[{\"notice\":\"Thrown when trying to set non zero incentive for private conversion\"}],\"Unauthorized(address,address,string)\":[{\"notice\":\"Thrown when the action is prohibited by AccessControlManager\"}],\"ZeroAddressNotAllowed()\":[{\"notice\":\"Thrown if the supplied address is a zero address where it is not allowed\"}],\"ZeroValueNotAllowed()\":[{\"notice\":\"Thrown if the supplied value is 0 where it is not allowed\"}]},\"events\":{\"AssetTransferredToDestination(address,address,address,uint256)\":{\"notice\":\"Emmitted after the funds transferred to the destination address\"},\"BaseAssetUpdated(address,address)\":{\"notice\":\"Emitted when base asset is updated\"},\"ConversionConfigUpdated(address,address,uint256,uint256,uint8,uint8)\":{\"notice\":\"Emitted when config is updated for tokens pair\"},\"ConversionPaused(address)\":{\"notice\":\"Emitted when conversion is paused\"},\"ConversionResumed(address)\":{\"notice\":\"Emitted when conversion is unpaused\"},\"ConvertedExactTokens(address,address,address,address,uint256,uint256)\":{\"notice\":\"Emitted when exact amount of tokens are converted for tokens\"},\"ConvertedExactTokensSupportingFeeOnTransferTokens(address,address,address,address,uint256,uint256)\":{\"notice\":\"Emitted when exact amount of tokens are converted for tokens, for deflationary tokens\"},\"ConvertedForExactTokens(address,address,address,address,uint256,uint256)\":{\"notice\":\"Emitted when tokens are converted for exact amount of tokens\"},\"ConvertedForExactTokensSupportingFeeOnTransferTokens(address,address,address,address,uint256,uint256)\":{\"notice\":\"Emitted when tokens are converted for exact amount of tokens, for deflationary tokens\"},\"ConverterNetworkAddressUpdated(address,address)\":{\"notice\":\"Emitted when converterNetwork address is updated\"},\"DestinationAddressUpdated(address,address)\":{\"notice\":\"Emitted when destination address is updated\"},\"MinAmountToConvertUpdated(uint256,uint256)\":{\"notice\":\"Emitted when minimum amount to convert is updated\"},\"NewAccessControlManager(address,address)\":{\"notice\":\"Emitted when access control manager contract address is changed\"},\"PriceOracleUpdated(address,address)\":{\"notice\":\"Emitted when price oracle address is updated\"},\"SweepToken(address,address,uint256)\":{\"notice\":\"Event emitted when tokens are swept\"}},\"kind\":\"user\",\"methods\":{\"MAX_INCENTIVE()\":{\"notice\":\"Maximum incentive could be\"},\"accessControlManager()\":{\"notice\":\"Returns the address of the access control manager contract\"},\"balanceOf(address)\":{\"notice\":\"Get the balance for specific token\"},\"baseAsset()\":{\"notice\":\"Address of the base asset token\"},\"conversionConfigurations(address,address)\":{\"notice\":\"conversion configurations for the existing pairs\"},\"conversionPaused()\":{\"notice\":\"Boolean for if conversion is paused\"},\"convertExactTokens(uint256,uint256,address,address,address)\":{\"notice\":\"Converts exact amount of tokenAddressIn for tokenAddressOut if there is enough tokens held by the contract\"},\"convertExactTokensSupportingFeeOnTransferTokens(uint256,uint256,address,address,address)\":{\"notice\":\"Converts exact amount of tokenAddressIn for tokenAddressOut if there is enough tokens held by the contract\"},\"convertForExactTokens(uint256,uint256,address,address,address)\":{\"notice\":\"Converts tokens for tokenAddressIn for exact amount of tokenAddressOut if there is enough tokens held by the contract, otherwise the amount is adjusted\"},\"convertForExactTokensSupportingFeeOnTransferTokens(uint256,uint256,address,address,address)\":{\"notice\":\"Converts tokens for tokenAddressIn for amount of tokenAddressOut calculated on the basis of amount of tokenAddressIn received by the contract, if there is enough tokens held by the contract, otherwise the amount is adjusted. The user will be responsible for bearing any fees associated with token transfers, whether pulling in or pushing out tokens\"},\"converterNetwork()\":{\"notice\":\"Address of the converterNetwork contract\"},\"destinationAddress()\":{\"notice\":\"Address that all incoming tokens are transferred to\"},\"getAmountIn(uint256,address,address)\":{\"notice\":\"To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut. This function does not account for potential token transfer fees(in case of deflationary tokens)\"},\"getAmountOut(uint256,address,address)\":{\"notice\":\"To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn. This function does not account for potential token transfer fees(in case of deflationary tokens)The amountInMantissa might be adjusted if amountOutMantissa is greater than the balance of the contract for tokenAddressOut\"},\"getUpdatedAmountIn(uint256,address,address)\":{\"notice\":\"To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut\"},\"getUpdatedAmountOut(uint256,address,address)\":{\"notice\":\"To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn\"},\"minAmountToConvert()\":{\"notice\":\"Min amount to convert for private conversions. Defined in USD, with 18 decimals\"},\"pauseConversion()\":{\"notice\":\"Pause conversion of tokens\"},\"priceOracle()\":{\"notice\":\"Venus price oracle contract\"},\"resumeConversion()\":{\"notice\":\"Resume conversion of tokens.\"},\"setAccessControlManager(address)\":{\"notice\":\"Sets the address of AccessControlManager\"},\"setBaseAsset(address)\":{\"notice\":\"Sets the base asset for the contract\"},\"setConversionConfig(address,address,(uint256,uint8))\":{\"notice\":\"Set the configuration for new or existing conversion pair\"},\"setConversionConfigs(address,address[],(uint256,uint8)[])\":{\"notice\":\"Batch sets the conversion configurations\"},\"setConverterNetwork(address)\":{\"notice\":\"Sets a converter network contract address\"},\"setDestination(address)\":{\"notice\":\"Sets a new destination address\"},\"setMinAmountToConvert(uint256)\":{\"notice\":\"Min amount to convert setter\"},\"setPriceOracle(address)\":{\"notice\":\"Sets a new price oracle\"},\"sweepToken(address,address,uint256)\":{\"notice\":\"To sweep ERC20 tokens and transfer them to user(to address)\"},\"updateAssetsState(address,address)\":{\"notice\":\"This method updated the states of this contract after getting funds from PSR after settling the amount(if any) through privateConversion between converters\"}},\"notice\":\"SingleTokenConverter used for token conversions and sends received tokens\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/TokenConverter/SingleTokenConverter.sol\":\"SingleTokenConverter\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable2Step.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./OwnableUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership} and {acceptOwnership}.\\n *\\n * This module is used through inheritance. It will make available all functions\\n * from parent (Ownable).\\n */\\nabstract contract Ownable2StepUpgradeable is Initializable, OwnableUpgradeable {\\n function __Ownable2Step_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable2Step_init_unchained() internal onlyInitializing {\\n }\\n address private _pendingOwner;\\n\\n event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Returns the address of the pending owner.\\n */\\n function pendingOwner() public view virtual returns (address) {\\n return _pendingOwner;\\n }\\n\\n /**\\n * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual override onlyOwner {\\n _pendingOwner = newOwner;\\n emit OwnershipTransferStarted(owner(), newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual override {\\n delete _pendingOwner;\\n super._transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev The new owner accepts the ownership transfer.\\n */\\n function acceptOwnership() public virtual {\\n address sender = _msgSender();\\n require(pendingOwner() == sender, \\\"Ownable2Step: caller is not the new owner\\\");\\n _transferOwnership(sender);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x84efb8889801b0ac817324aff6acc691d07bbee816b671817132911d287a8c63\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function __Ownable_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable_init_unchained() internal onlyInitializing {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby disabling any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x4075622496acc77fd6d4de4cc30a8577a744d5c75afad33fdeacf1704d6eda98\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```solidity\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n *\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized != type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0x89be10e757d242e9b18d5a32c9fbe2019f6d63052bbe46397a430a1d60d7f794\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which allows children to implement an emergency stop\\n * mechanism that can be triggered by an authorized account.\\n *\\n * This module is used through inheritance. It will make available the\\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\\n * the functions of your contract. Note that they will not be pausable by\\n * simply including this module, only once the modifiers are put in place.\\n */\\nabstract contract PausableUpgradeable is Initializable, ContextUpgradeable {\\n /**\\n * @dev Emitted when the pause is triggered by `account`.\\n */\\n event Paused(address account);\\n\\n /**\\n * @dev Emitted when the pause is lifted by `account`.\\n */\\n event Unpaused(address account);\\n\\n bool private _paused;\\n\\n /**\\n * @dev Initializes the contract in unpaused state.\\n */\\n function __Pausable_init() internal onlyInitializing {\\n __Pausable_init_unchained();\\n }\\n\\n function __Pausable_init_unchained() internal onlyInitializing {\\n _paused = false;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is not paused.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n modifier whenNotPaused() {\\n _requireNotPaused();\\n _;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is paused.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n modifier whenPaused() {\\n _requirePaused();\\n _;\\n }\\n\\n /**\\n * @dev Returns true if the contract is paused, and false otherwise.\\n */\\n function paused() public view virtual returns (bool) {\\n return _paused;\\n }\\n\\n /**\\n * @dev Throws if the contract is paused.\\n */\\n function _requireNotPaused() internal view virtual {\\n require(!paused(), \\\"Pausable: paused\\\");\\n }\\n\\n /**\\n * @dev Throws if the contract is not paused.\\n */\\n function _requirePaused() internal view virtual {\\n require(paused(), \\\"Pausable: not paused\\\");\\n }\\n\\n /**\\n * @dev Triggers stopped state.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n function _pause() internal virtual whenNotPaused {\\n _paused = true;\\n emit Paused(_msgSender());\\n }\\n\\n /**\\n * @dev Returns to normal state.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n function _unpause() internal virtual whenPaused {\\n _paused = false;\\n emit Unpaused(_msgSender());\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x40c636b4572ff5f1dc50cf22097e93c0723ee14eff87e99ac2b02636eeca1250\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module that helps prevent reentrant calls to a function.\\n *\\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\\n * available, which can be applied to functions to make sure there are no nested\\n * (reentrant) calls to them.\\n *\\n * Note that because there is a single `nonReentrant` guard, functions marked as\\n * `nonReentrant` may not call one another. This can be worked around by making\\n * those functions `private`, and then adding `external` `nonReentrant` entry\\n * points to them.\\n *\\n * TIP: If you would like to learn more about reentrancy and alternative ways\\n * to protect against it, check out our blog post\\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\\n */\\nabstract contract ReentrancyGuardUpgradeable is Initializable {\\n // Booleans are more expensive than uint256 or any type that takes up a full\\n // word because each write operation emits an extra SLOAD to first read the\\n // slot's contents, replace the bits taken up by the boolean, and then write\\n // back. This is the compiler's defense against contract upgrades and\\n // pointer aliasing, and it cannot be disabled.\\n\\n // The values being non-zero value makes deployment a bit more expensive,\\n // but in exchange the refund on every call to nonReentrant will be lower in\\n // amount. Since refunds are capped to a percentage of the total\\n // transaction's gas, it is best to keep them low in cases like this one, to\\n // increase the likelihood of the full refund coming into effect.\\n uint256 private constant _NOT_ENTERED = 1;\\n uint256 private constant _ENTERED = 2;\\n\\n uint256 private _status;\\n\\n function __ReentrancyGuard_init() internal onlyInitializing {\\n __ReentrancyGuard_init_unchained();\\n }\\n\\n function __ReentrancyGuard_init_unchained() internal onlyInitializing {\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Prevents a contract from calling itself, directly or indirectly.\\n * Calling a `nonReentrant` function from another `nonReentrant`\\n * function is not supported. It is possible to prevent this from happening\\n * by making the `nonReentrant` function external, and making it call a\\n * `private` function that does the actual work.\\n */\\n modifier nonReentrant() {\\n _nonReentrantBefore();\\n _;\\n _nonReentrantAfter();\\n }\\n\\n function _nonReentrantBefore() private {\\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\\n require(_status != _ENTERED, \\\"ReentrancyGuard: reentrant call\\\");\\n\\n // Any calls to nonReentrant after this point will fail\\n _status = _ENTERED;\\n }\\n\\n function _nonReentrantAfter() private {\\n // By storing the original value once again, a refund is triggered (see\\n // https://eips.ethereum.org/EIPS/eip-2200)\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Returns true if the reentrancy guard is currently set to \\\"entered\\\", which indicates there is a\\n * `nonReentrant` function in the call stack.\\n */\\n function _reentrancyGuardEntered() internal view returns (bool) {\\n return _status == _ENTERED;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0xb82ef33f43b6b96109687d91b39c94573fdccaaa423fe28e8ba0977b31c023e0\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20Upgradeable {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x0e1f0f5f62f67a881cd1a9597acbc0a5e4071f3c2c10449a183b922ae7272e3f\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20PermitUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\\n *\\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\\n * need to send a transaction, and thus is not required to hold Ether at all.\\n */\\ninterface IERC20PermitUpgradeable {\\n /**\\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\\n * given ``owner``'s signed approval.\\n *\\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\\n * ordering also apply here.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `deadline` must be a timestamp in the future.\\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\\n * over the EIP712-formatted function arguments.\\n * - the signature must use ``owner``'s current nonce (see {nonces}).\\n *\\n * For more information on the signature format, see the\\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\\n * section].\\n */\\n function permit(\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external;\\n\\n /**\\n * @dev Returns the current nonce for `owner`. This value must be\\n * included whenever a signature is generated for {permit}.\\n *\\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\\n * prevents a signature from being used multiple times.\\n */\\n function nonces(address owner) external view returns (uint256);\\n\\n /**\\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0xd60f939a3ca0199014d079b4dd66aa757954334947d81eb5c1d35d7a83061ab3\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20Upgradeable.sol\\\";\\nimport \\\"../extensions/IERC20PermitUpgradeable.sol\\\";\\nimport \\\"../../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20Upgradeable {\\n using AddressUpgradeable for address;\\n\\n /**\\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeTransfer(IERC20Upgradeable token, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n /**\\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\\n */\\n function safeTransferFrom(IERC20Upgradeable token, address from, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\\n }\\n\\n /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\n */\\n function safeApprove(IERC20Upgradeable token, address spender, uint256 value) internal {\\n // safeApprove should only be called when setting an initial allowance,\\n // or when resetting it to zero. To increase and decrease it, use\\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\\n require(\\n (value == 0) || (token.allowance(address(this), spender) == 0),\\n \\\"SafeERC20: approve from non-zero to non-zero allowance\\\"\\n );\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\\n }\\n\\n /**\\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeIncreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));\\n }\\n\\n /**\\n * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeDecreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {\\n unchecked {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n require(oldAllowance >= value, \\\"SafeERC20: decreased allowance below zero\\\");\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));\\n }\\n }\\n\\n /**\\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\\n * to be set to zero before setting it to a non-zero value, such as USDT.\\n */\\n function forceApprove(IERC20Upgradeable token, address spender, uint256 value) internal {\\n bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);\\n\\n if (!_callOptionalReturnBool(token, approvalCall)) {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));\\n _callOptionalReturn(token, approvalCall);\\n }\\n }\\n\\n /**\\n * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.\\n * Revert on invalid signature.\\n */\\n function safePermit(\\n IERC20PermitUpgradeable token,\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal {\\n uint256 nonceBefore = token.nonces(owner);\\n token.permit(owner, spender, value, deadline, v, r, s);\\n uint256 nonceAfter = token.nonces(owner);\\n require(nonceAfter == nonceBefore + 1, \\\"SafeERC20: permit did not succeed\\\");\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20Upgradeable token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\n require(returndata.length == 0 || abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n *\\n * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\\n */\\n function _callOptionalReturnBool(IERC20Upgradeable token, bytes memory data) private returns (bool) {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\\n // and not revert is the subcall reverts.\\n\\n (bool success, bytes memory returndata) = address(token).call(data);\\n return\\n success && (returndata.length == 0 || abi.decode(returndata, (bool))) && AddressUpgradeable.isContract(address(token));\\n }\\n}\\n\",\"keccak256\":\"0x23b997be73d3dd46885262704f0f8cfc7273fdadfe303d37969a9561373972b5\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary AddressUpgradeable {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n *\\n * Furthermore, `isContract` will also return true if the target contract within\\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\\n * which only has an effect at the end of a transaction.\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x9c80f545915582e63fe206c6ce27cbe85a86fc10b9cd2a0e8c9488fb7c2ee422\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract ContextUpgradeable is Initializable {\\n function __Context_init() internal onlyInitializing {\\n }\\n\\n function __Context_init_unchained() internal onlyInitializing {\\n }\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/IAccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev External interface of AccessControl declared to support ERC165 detection.\\n */\\ninterface IAccessControl {\\n /**\\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\\n *\\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\\n * {RoleAdminChanged} not being emitted signaling this.\\n *\\n * _Available since v3.1._\\n */\\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\\n\\n /**\\n * @dev Emitted when `account` is granted `role`.\\n *\\n * `sender` is the account that originated the contract call, an admin role\\n * bearer except when using {AccessControl-_setupRole}.\\n */\\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Emitted when `account` is revoked `role`.\\n *\\n * `sender` is the account that originated the contract call:\\n * - if using `revokeRole`, it is the admin role bearer\\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\\n */\\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) external view returns (bool);\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function grantRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function revokeRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been granted `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n */\\n function renounceRole(bytes32 role, address account) external;\\n}\\n\",\"keccak256\":\"0x59ce320a585d7e1f163cd70390a0ef2ff9cec832e2aa544293a00692465a7a57\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x8de418a5503946cabe331f35fe242d3201a73f67f77aaeb7110acb1f30423aca\",\"license\":\"MIT\"},\"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol\\\";\\n\\nimport \\\"./IAccessControlManagerV8.sol\\\";\\n\\n/**\\n * @title AccessControlledV8\\n * @author Venus\\n * @notice This contract is helper between access control manager and actual contract. This contract further inherited by other contract (using solidity 0.8.13)\\n * to integrate access controlled mechanism. It provides initialise methods and verifying access methods.\\n */\\nabstract contract AccessControlledV8 is Initializable, Ownable2StepUpgradeable {\\n /// @notice Access control manager contract\\n IAccessControlManagerV8 private _accessControlManager;\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n\\n /// @notice Emitted when access control manager contract address is changed\\n event NewAccessControlManager(address oldAccessControlManager, address newAccessControlManager);\\n\\n /// @notice Thrown when the action is prohibited by AccessControlManager\\n error Unauthorized(address sender, address calledContract, string methodSignature);\\n\\n function __AccessControlled_init(address accessControlManager_) internal onlyInitializing {\\n __Ownable2Step_init();\\n __AccessControlled_init_unchained(accessControlManager_);\\n }\\n\\n function __AccessControlled_init_unchained(address accessControlManager_) internal onlyInitializing {\\n _setAccessControlManager(accessControlManager_);\\n }\\n\\n /**\\n * @notice Sets the address of AccessControlManager\\n * @dev Admin function to set address of AccessControlManager\\n * @param accessControlManager_ The new address of the AccessControlManager\\n * @custom:event Emits NewAccessControlManager event\\n * @custom:access Only Governance\\n */\\n function setAccessControlManager(address accessControlManager_) external onlyOwner {\\n _setAccessControlManager(accessControlManager_);\\n }\\n\\n /**\\n * @notice Returns the address of the access control manager contract\\n */\\n function accessControlManager() external view returns (IAccessControlManagerV8) {\\n return _accessControlManager;\\n }\\n\\n /**\\n * @dev Internal function to set address of AccessControlManager\\n * @param accessControlManager_ The new address of the AccessControlManager\\n */\\n function _setAccessControlManager(address accessControlManager_) internal {\\n require(address(accessControlManager_) != address(0), \\\"invalid acess control manager address\\\");\\n address oldAccessControlManager = address(_accessControlManager);\\n _accessControlManager = IAccessControlManagerV8(accessControlManager_);\\n emit NewAccessControlManager(oldAccessControlManager, accessControlManager_);\\n }\\n\\n /**\\n * @notice Reverts if the call is not allowed by AccessControlManager\\n * @param signature Method signature\\n */\\n function _checkAccessAllowed(string memory signature) internal view {\\n bool isAllowedToCall = _accessControlManager.isAllowedToCall(msg.sender, signature);\\n\\n if (!isAllowedToCall) {\\n revert Unauthorized(msg.sender, address(this), signature);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x1b805a5d09990e2c4f7839afe7726a02f8452261eb3d0d488e24129ec0a7736d\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/governance-contracts/contracts/Governance/IAccessControlManagerV8.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\nimport \\\"@openzeppelin/contracts/access/IAccessControl.sol\\\";\\n\\n/**\\n * @title IAccessControlManagerV8\\n * @author Venus\\n * @notice Interface implemented by the `AccessControlManagerV8` contract.\\n */\\ninterface IAccessControlManagerV8 is IAccessControl {\\n function giveCallPermission(address contractAddress, string calldata functionSig, address accountToPermit) external;\\n\\n function revokeCallPermission(\\n address contractAddress,\\n string calldata functionSig,\\n address accountToRevoke\\n ) external;\\n\\n function isAllowedToCall(address account, string calldata functionSig) external view returns (bool);\\n\\n function hasPermission(\\n address account,\\n address contractAddress,\\n string calldata functionSig\\n ) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x8adbe291d659987faf4de606736227ad9d8e1a0e284a33a6ca12b30ab2a504b2\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/oracle/contracts/ResilientOracle.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\n// SPDX-FileCopyrightText: 2022 Venus\\npragma solidity 0.8.13;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol\\\";\\nimport \\\"./interfaces/VBep20Interface.sol\\\";\\nimport \\\"./interfaces/OracleInterface.sol\\\";\\nimport \\\"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\\\";\\n\\n/**\\n * @title ResilientOracle\\n * @author Venus\\n * @notice The Resilient Oracle is the main contract that the protocol uses to fetch prices of assets.\\n * \\n * DeFi protocols are vulnerable to price oracle failures including oracle manipulation and incorrectly\\n * reported prices. If only one oracle is used, this creates a single point of failure and opens a vector\\n * for attacking the protocol.\\n * \\n * The Resilient Oracle uses multiple sources and fallback mechanisms to provide accurate prices and protect\\n * the protocol from oracle attacks. Currently it includes integrations with Chainlink, Pyth, Binance Oracle\\n * and TWAP (Time-Weighted Average Price) oracles. TWAP uses PancakeSwap as the on-chain price source.\\n * \\n * For every market (vToken) we configure the main, pivot and fallback oracles. The oracles are configured per \\n * vToken's underlying asset address. The main oracle oracle is the most trustworthy price source, the pivot \\n * oracle is used as a loose sanity checker and the fallback oracle is used as a backup price source. \\n * \\n * To validate prices returned from two oracles, we use an upper and lower bound ratio that is set for every\\n * market. The upper bound ratio represents the deviation between reported price (the price that\\u2019s being\\n * validated) and the anchor price (the price we are validating against) above which the reported price will\\n * be invalidated. The lower bound ratio presents the deviation between reported price and anchor price below\\n * which the reported price will be invalidated. So for oracle price to be considered valid the below statement\\n * should be true:\\n\\n```\\nanchorRatio = anchorPrice/reporterPrice\\nisValid = anchorRatio <= upperBoundAnchorRatio && anchorRatio >= lowerBoundAnchorRatio\\n```\\n\\n * In most cases, Chainlink is used as the main oracle, TWAP or Pyth oracles are used as the pivot oracle depending\\n * on which supports the given market and Binance oracle is used as the fallback oracle. For some markets we may\\n * use Pyth or TWAP as the main oracle if the token price is not supported by Chainlink or Binance oracles. \\n * \\n * For a fetched price to be valid it must be positive and not stagnant. If the price is invalid then we consider the\\n * oracle to be stagnant and treat it like it's disabled.\\n */\\ncontract ResilientOracle is PausableUpgradeable, AccessControlledV8, ResilientOracleInterface {\\n /**\\n * @dev Oracle roles:\\n * **main**: The most trustworthy price source\\n * **pivot**: Price oracle used as a loose sanity checker\\n * **fallback**: The backup source when main oracle price is invalidated\\n */\\n enum OracleRole {\\n MAIN,\\n PIVOT,\\n FALLBACK\\n }\\n\\n struct TokenConfig {\\n /// @notice asset address\\n address asset;\\n /// @notice `oracles` stores the oracles based on their role in the following order:\\n /// [main, pivot, fallback],\\n /// It can be indexed with the corresponding enum OracleRole value\\n address[3] oracles;\\n /// @notice `enableFlagsForOracles` stores the enabled state\\n /// for each oracle in the same order as `oracles`\\n bool[3] enableFlagsForOracles;\\n }\\n\\n uint256 public constant INVALID_PRICE = 0;\\n\\n /// @notice Native market address\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address public immutable nativeMarket;\\n\\n /// @notice VAI address\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address public immutable vai;\\n\\n /// @notice Set this as asset address for Native token on each chain.This is the underlying for vBNB (on bsc)\\n /// and can serve as any underlying asset of a market that supports native tokens\\n address public constant NATIVE_TOKEN_ADDR = 0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB;\\n\\n /// @notice Bound validator contract address\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n BoundValidatorInterface public immutable boundValidator;\\n\\n mapping(address => TokenConfig) private tokenConfigs;\\n\\n event TokenConfigAdded(\\n address indexed asset,\\n address indexed mainOracle,\\n address indexed pivotOracle,\\n address fallbackOracle\\n );\\n\\n /// Event emitted when an oracle is set\\n event OracleSet(address indexed asset, address indexed oracle, uint256 indexed role);\\n\\n /// Event emitted when an oracle is enabled or disabled\\n event OracleEnabled(address indexed asset, uint256 indexed role, bool indexed enable);\\n\\n /**\\n * @notice Checks whether an address is null or not\\n */\\n modifier notNullAddress(address someone) {\\n if (someone == address(0)) revert(\\\"can't be zero address\\\");\\n _;\\n }\\n\\n /**\\n * @notice Checks whether token config exists by checking whether asset is null address\\n * @dev address can't be null, so it's suitable to be used to check the validity of the config\\n * @param asset asset address\\n */\\n modifier checkTokenConfigExistence(address asset) {\\n if (tokenConfigs[asset].asset == address(0)) revert(\\\"token config must exist\\\");\\n _;\\n }\\n\\n /// @notice Constructor for the implementation contract. Sets immutable variables.\\n /// @dev nativeMarketAddress can be address(0) if on the chain we do not support native market\\n /// (e.g vETH on ethereum would not be supported, only vWETH)\\n /// @param nativeMarketAddress The address of a native market (for bsc it would be vBNB address)\\n /// @param vaiAddress The address of the VAI token (if there is VAI on the deployed chain).\\n /// Set to address(0) of VAI is not existent.\\n /// @param _boundValidator Address of the bound validator contract\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(\\n address nativeMarketAddress,\\n address vaiAddress,\\n BoundValidatorInterface _boundValidator\\n ) notNullAddress(address(_boundValidator)) {\\n nativeMarket = nativeMarketAddress;\\n vai = vaiAddress;\\n boundValidator = _boundValidator;\\n\\n _disableInitializers();\\n }\\n\\n /**\\n * @notice Initializes the contract admin and sets the BoundValidator contract address\\n * @param accessControlManager_ Address of the access control manager contract\\n */\\n function initialize(address accessControlManager_) external initializer {\\n __AccessControlled_init(accessControlManager_);\\n __Pausable_init();\\n }\\n\\n /**\\n * @notice Pauses oracle\\n * @custom:access Only Governance\\n */\\n function pause() external {\\n _checkAccessAllowed(\\\"pause()\\\");\\n _pause();\\n }\\n\\n /**\\n * @notice Unpauses oracle\\n * @custom:access Only Governance\\n */\\n function unpause() external {\\n _checkAccessAllowed(\\\"unpause()\\\");\\n _unpause();\\n }\\n\\n /**\\n * @notice Batch sets token configs\\n * @param tokenConfigs_ Token config array\\n * @custom:access Only Governance\\n * @custom:error Throws a length error if the length of the token configs array is 0\\n */\\n function setTokenConfigs(TokenConfig[] memory tokenConfigs_) external {\\n if (tokenConfigs_.length == 0) revert(\\\"length can't be 0\\\");\\n uint256 numTokenConfigs = tokenConfigs_.length;\\n for (uint256 i; i < numTokenConfigs; ) {\\n setTokenConfig(tokenConfigs_[i]);\\n unchecked {\\n ++i;\\n }\\n }\\n }\\n\\n /**\\n * @notice Sets oracle for a given asset and role.\\n * @dev Supplied asset **must** exist and main oracle may not be null\\n * @param asset Asset address\\n * @param oracle Oracle address\\n * @param role Oracle role\\n * @custom:access Only Governance\\n * @custom:error Null address error if main-role oracle address is null\\n * @custom:error NotNullAddress error is thrown if asset address is null\\n * @custom:error TokenConfigExistance error is thrown if token config is not set\\n * @custom:event Emits OracleSet event with asset address, oracle address and role of the oracle for the asset\\n */\\n function setOracle(\\n address asset,\\n address oracle,\\n OracleRole role\\n ) external notNullAddress(asset) checkTokenConfigExistence(asset) {\\n _checkAccessAllowed(\\\"setOracle(address,address,uint8)\\\");\\n if (oracle == address(0) && role == OracleRole.MAIN) revert(\\\"can't set zero address to main oracle\\\");\\n tokenConfigs[asset].oracles[uint256(role)] = oracle;\\n emit OracleSet(asset, oracle, uint256(role));\\n }\\n\\n /**\\n * @notice Enables/ disables oracle for the input asset. Token config for the input asset **must** exist\\n * @dev Configuration for the asset **must** already exist and the asset cannot be 0 address\\n * @param asset Asset address\\n * @param role Oracle role\\n * @param enable Enabled boolean of the oracle\\n * @custom:access Only Governance\\n * @custom:error NotNullAddress error is thrown if asset address is null\\n * @custom:error TokenConfigExistance error is thrown if token config is not set\\n */\\n function enableOracle(\\n address asset,\\n OracleRole role,\\n bool enable\\n ) external notNullAddress(asset) checkTokenConfigExistence(asset) {\\n _checkAccessAllowed(\\\"enableOracle(address,uint8,bool)\\\");\\n tokenConfigs[asset].enableFlagsForOracles[uint256(role)] = enable;\\n emit OracleEnabled(asset, uint256(role), enable);\\n }\\n\\n /**\\n * @notice Updates the TWAP pivot oracle price.\\n * @dev This function should always be called before calling getUnderlyingPrice\\n * @param vToken vToken address\\n */\\n function updatePrice(address vToken) external override {\\n address asset = _getUnderlyingAsset(vToken);\\n (address pivotOracle, bool pivotOracleEnabled) = getOracle(asset, OracleRole.PIVOT);\\n if (pivotOracle != address(0) && pivotOracleEnabled) {\\n //if pivot oracle is not TwapOracle it will revert so we need to catch the revert\\n try TwapInterface(pivotOracle).updateTwap(asset) {} catch {}\\n }\\n }\\n\\n /**\\n * @notice Updates the pivot oracle price. Currently using TWAP\\n * @dev This function should always be called before calling getPrice\\n * @param asset asset address\\n */\\n function updateAssetPrice(address asset) external {\\n (address pivotOracle, bool pivotOracleEnabled) = getOracle(asset, OracleRole.PIVOT);\\n if (pivotOracle != address(0) && pivotOracleEnabled) {\\n //if pivot oracle is not TwapOracle it will revert so we need to catch the revert\\n try TwapInterface(pivotOracle).updateTwap(asset) {} catch {}\\n }\\n }\\n\\n /**\\n * @dev Gets token config by asset address\\n * @param asset asset address\\n * @return tokenConfig Config for the asset\\n */\\n function getTokenConfig(address asset) external view returns (TokenConfig memory) {\\n return tokenConfigs[asset];\\n }\\n\\n /**\\n * @notice Gets price of the underlying asset for a given vToken. Validation flow:\\n * - Check if the oracle is paused globally\\n * - Validate price from main oracle against pivot oracle\\n * - Validate price from fallback oracle against pivot oracle if the first validation failed\\n * - Validate price from main oracle against fallback oracle if the second validation failed\\n * In the case that the pivot oracle is not available but main price is available and validation is successful,\\n * main oracle price is returned.\\n * @param vToken vToken address\\n * @return price USD price in scaled decimal places.\\n * @custom:error Paused error is thrown when resilent oracle is paused\\n * @custom:error Invalid resilient oracle price error is thrown if fetched prices from oracle is invalid\\n */\\n function getUnderlyingPrice(address vToken) external view override returns (uint256) {\\n if (paused()) revert(\\\"resilient oracle is paused\\\");\\n\\n address asset = _getUnderlyingAsset(vToken);\\n return _getPrice(asset);\\n }\\n\\n /**\\n * @notice Gets price of the asset\\n * @param asset asset address\\n * @return price USD price in scaled decimal places.\\n * @custom:error Paused error is thrown when resilent oracle is paused\\n * @custom:error Invalid resilient oracle price error is thrown if fetched prices from oracle is invalid\\n */\\n function getPrice(address asset) external view override returns (uint256) {\\n if (paused()) revert(\\\"resilient oracle is paused\\\");\\n return _getPrice(asset);\\n }\\n\\n /**\\n * @notice Sets/resets single token configs.\\n * @dev main oracle **must not** be a null address\\n * @param tokenConfig Token config struct\\n * @custom:access Only Governance\\n * @custom:error NotNullAddress is thrown if asset address is null\\n * @custom:error NotNullAddress is thrown if main-role oracle address for asset is null\\n * @custom:event Emits TokenConfigAdded event when the asset config is set successfully by the authorized account\\n */\\n function setTokenConfig(\\n TokenConfig memory tokenConfig\\n ) public notNullAddress(tokenConfig.asset) notNullAddress(tokenConfig.oracles[uint256(OracleRole.MAIN)]) {\\n _checkAccessAllowed(\\\"setTokenConfig(TokenConfig)\\\");\\n\\n tokenConfigs[tokenConfig.asset] = tokenConfig;\\n emit TokenConfigAdded(\\n tokenConfig.asset,\\n tokenConfig.oracles[uint256(OracleRole.MAIN)],\\n tokenConfig.oracles[uint256(OracleRole.PIVOT)],\\n tokenConfig.oracles[uint256(OracleRole.FALLBACK)]\\n );\\n }\\n\\n /**\\n * @notice Gets oracle and enabled status by asset address\\n * @param asset asset address\\n * @param role Oracle role\\n * @return oracle Oracle address based on role\\n * @return enabled Enabled flag of the oracle based on token config\\n */\\n function getOracle(address asset, OracleRole role) public view returns (address oracle, bool enabled) {\\n oracle = tokenConfigs[asset].oracles[uint256(role)];\\n enabled = tokenConfigs[asset].enableFlagsForOracles[uint256(role)];\\n }\\n\\n function _getPrice(address asset) internal view returns (uint256) {\\n uint256 pivotPrice = INVALID_PRICE;\\n\\n // Get pivot oracle price, Invalid price if not available or error\\n (address pivotOracle, bool pivotOracleEnabled) = getOracle(asset, OracleRole.PIVOT);\\n if (pivotOracleEnabled && pivotOracle != address(0)) {\\n try OracleInterface(pivotOracle).getPrice(asset) returns (uint256 pricePivot) {\\n pivotPrice = pricePivot;\\n } catch {}\\n }\\n\\n // Compare main price and pivot price, return main price and if validation was successful\\n // note: In case pivot oracle is not available but main price is available and\\n // validation is successful, the main oracle price is returned.\\n (uint256 mainPrice, bool validatedPivotMain) = _getMainOraclePrice(\\n asset,\\n pivotPrice,\\n pivotOracleEnabled && pivotOracle != address(0)\\n );\\n if (mainPrice != INVALID_PRICE && validatedPivotMain) return mainPrice;\\n\\n // Compare fallback and pivot if main oracle comparision fails with pivot\\n // Return fallback price when fallback price is validated successfully with pivot oracle\\n (uint256 fallbackPrice, bool validatedPivotFallback) = _getFallbackOraclePrice(asset, pivotPrice);\\n if (fallbackPrice != INVALID_PRICE && validatedPivotFallback) return fallbackPrice;\\n\\n // Lastly compare main price and fallback price\\n if (\\n mainPrice != INVALID_PRICE &&\\n fallbackPrice != INVALID_PRICE &&\\n boundValidator.validatePriceWithAnchorPrice(asset, mainPrice, fallbackPrice)\\n ) {\\n return mainPrice;\\n }\\n\\n revert(\\\"invalid resilient oracle price\\\");\\n }\\n\\n /**\\n * @notice Gets a price for the provided asset\\n * @dev This function won't revert when price is 0, because the fallback oracle may still be\\n * able to fetch a correct price\\n * @param asset asset address\\n * @param pivotPrice Pivot oracle price\\n * @param pivotEnabled If pivot oracle is not empty and enabled\\n * @return price USD price in scaled decimals\\n * e.g. asset decimals is 8 then price is returned as 10**18 * 10**(18-8) = 10**28 decimals\\n * @return pivotValidated Boolean representing if the validation of main oracle price\\n * and pivot oracle price were successful\\n * @custom:error Invalid price error is thrown if main oracle fails to fetch price of the asset\\n * @custom:error Invalid price error is thrown if main oracle is not enabled or main oracle\\n * address is null\\n */\\n function _getMainOraclePrice(\\n address asset,\\n uint256 pivotPrice,\\n bool pivotEnabled\\n ) internal view returns (uint256, bool) {\\n (address mainOracle, bool mainOracleEnabled) = getOracle(asset, OracleRole.MAIN);\\n if (mainOracleEnabled && mainOracle != address(0)) {\\n try OracleInterface(mainOracle).getPrice(asset) returns (uint256 mainOraclePrice) {\\n if (!pivotEnabled) {\\n return (mainOraclePrice, true);\\n }\\n if (pivotPrice == INVALID_PRICE) {\\n return (mainOraclePrice, false);\\n }\\n return (\\n mainOraclePrice,\\n boundValidator.validatePriceWithAnchorPrice(asset, mainOraclePrice, pivotPrice)\\n );\\n } catch {\\n return (INVALID_PRICE, false);\\n }\\n }\\n\\n return (INVALID_PRICE, false);\\n }\\n\\n /**\\n * @dev This function won't revert when the price is 0 because getPrice checks if price is > 0\\n * @param asset asset address\\n * @return price USD price in 18 decimals\\n * @return pivotValidated Boolean representing if the validation of fallback oracle price\\n * and pivot oracle price were successfull\\n * @custom:error Invalid price error is thrown if fallback oracle fails to fetch price of the asset\\n * @custom:error Invalid price error is thrown if fallback oracle is not enabled or fallback oracle\\n * address is null\\n */\\n function _getFallbackOraclePrice(address asset, uint256 pivotPrice) private view returns (uint256, bool) {\\n (address fallbackOracle, bool fallbackEnabled) = getOracle(asset, OracleRole.FALLBACK);\\n if (fallbackEnabled && fallbackOracle != address(0)) {\\n try OracleInterface(fallbackOracle).getPrice(asset) returns (uint256 fallbackOraclePrice) {\\n if (pivotPrice == INVALID_PRICE) {\\n return (fallbackOraclePrice, false);\\n }\\n return (\\n fallbackOraclePrice,\\n boundValidator.validatePriceWithAnchorPrice(asset, fallbackOraclePrice, pivotPrice)\\n );\\n } catch {\\n return (INVALID_PRICE, false);\\n }\\n }\\n\\n return (INVALID_PRICE, false);\\n }\\n\\n /**\\n * @dev This function returns the underlying asset of a vToken\\n * @param vToken vToken address\\n * @return asset underlying asset address\\n */\\n function _getUnderlyingAsset(address vToken) private view notNullAddress(vToken) returns (address asset) {\\n if (vToken == nativeMarket) {\\n asset = NATIVE_TOKEN_ADDR;\\n } else if (vToken == vai) {\\n asset = vai;\\n } else {\\n asset = VBep20Interface(vToken).underlying();\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3bead63c5f2aca7e1ea5e9a075816e9e3551ce3a886f5f3707040262ad6d2c35\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/oracle/contracts/interfaces/OracleInterface.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\ninterface OracleInterface {\\n function getPrice(address asset) external view returns (uint256);\\n}\\n\\ninterface ResilientOracleInterface is OracleInterface {\\n function updatePrice(address vToken) external;\\n\\n function updateAssetPrice(address asset) external;\\n\\n function getUnderlyingPrice(address vToken) external view returns (uint256);\\n}\\n\\ninterface TwapInterface is OracleInterface {\\n function updateTwap(address asset) external returns (uint256);\\n}\\n\\ninterface BoundValidatorInterface {\\n function validatePriceWithAnchorPrice(\\n address asset,\\n uint256 reporterPrice,\\n uint256 anchorPrice\\n ) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x40031b19684ca0c912e794d08c2c0b0d8be77d3c1bdc937830a0658eff899650\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/oracle/contracts/interfaces/VBep20Interface.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\\\";\\n\\ninterface VBep20Interface is IERC20Metadata {\\n /**\\n * @notice Underlying asset for this VToken\\n */\\n function underlying() external view returns (address);\\n}\\n\",\"keccak256\":\"0x3f845cd51b2d82f7932ac6c0ab714df97f733b01ce50f6fb0adb4c28447d4618\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/solidity-utilities/contracts/constants.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\n/// @dev Base unit for computations, usually used in scaling (multiplications, divisions)\\nuint256 constant EXP_SCALE = 1e18;\\n\\n/// @dev A unit (literal one) in EXP_SCALE, usually used in additions/subtractions\\nuint256 constant MANTISSA_ONE = EXP_SCALE;\\n\\n/// @dev The approximate number of seconds per year\\nuint256 constant SECONDS_PER_YEAR = 31_536_000;\\n\",\"keccak256\":\"0x0464dd1b882ea2925e06e967c025a232c824e9e4c7aee7b97cc255d040594a59\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/solidity-utilities/contracts/validators.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\n/// @notice Thrown if the supplied address is a zero address where it is not allowed\\nerror ZeroAddressNotAllowed();\\n\\n/// @notice Thrown if the supplied value is 0 where it is not allowed\\nerror ZeroValueNotAllowed();\\n\\n/// @notice Checks if the provided address is nonzero, reverts otherwise\\n/// @param address_ Address to check\\n/// @custom:error ZeroAddressNotAllowed is thrown if the provided address is a zero address\\nfunction ensureNonzeroAddress(address address_) pure {\\n if (address_ == address(0)) {\\n revert ZeroAddressNotAllowed();\\n }\\n}\\n\\n/// @notice Checks if the provided value is nonzero, reverts otherwise\\n/// @param value_ Value to check\\n/// @custom:error ZeroValueNotAllowed is thrown if the provided value is 0\\nfunction ensureNonzeroValue(uint256 value_) pure {\\n if (value_ == 0) {\\n revert ZeroValueNotAllowed();\\n }\\n}\\n\",\"keccak256\":\"0xd55726634a83a862a9cef9d34c41694d3d0fea86cdbc57d6674af066792194b1\",\"license\":\"BSD-3-Clause\"},\"contracts/Interfaces/IConverterNetwork.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\nimport { IAbstractTokenConverter } from \\\"../TokenConverter/IAbstractTokenConverter.sol\\\";\\n\\n/**\\n * @title IConverterNetwork\\n * @author Venus\\n * @notice Interface implemented by `ConverterNetwork`.\\n */\\ninterface IConverterNetwork {\\n /// @notice Adds new converter to the array\\n /// @param _tokenConverter Address of the token converter\\n function addTokenConverter(IAbstractTokenConverter _tokenConverter) external;\\n\\n /// @notice Removes converter from the array\\n /// @param _tokenConverter Address of the token converter\\n function removeTokenConverter(IAbstractTokenConverter _tokenConverter) external;\\n\\n /// @notice Used to get the array of converters supporting conversions, arranged in descending order based on token balances\\n /// @param _tokenAddressIn Address of tokenIn\\n /// @param _tokenAddressOut Address of tokenOut\\n /// @return converters Array of the conveters on the basis of the tokens pair\\n /// @return convertersBalance Array of balances with respect to token out\\n function findTokenConverters(address _tokenAddressIn, address _tokenAddressOut)\\n external\\n returns (address[] memory converters, uint256[] memory convertersBalance);\\n\\n /// @notice Used to get the array of converters supporting conversions, arranged in descending order based on token balances\\n /// @param _tokenAddressIn Address of tokenIn\\n /// @param _tokenAddressOut Address of tokenOut\\n /// @return converters Array of the conveters on the basis of the tokens pair\\n /// @return convertersBalance Array of balances with respect to token out\\n function findTokenConvertersForConverters(address _tokenAddressIn, address _tokenAddressOut)\\n external\\n returns (address[] memory converters, uint256[] memory convertersBalance);\\n\\n /// @notice This function returns the array containing all the converters addresses\\n /// @return Array containing all the converters addresses\\n function getAllConverters() external view returns (IAbstractTokenConverter[] memory);\\n\\n /// @notice This function checks for given address is converter or not\\n /// @param _tokenConverter Address of the token converter\\n /// @return boolean true if given address is converter otherwise false\\n function isTokenConverter(address _tokenConverter) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x185dac944af690a34378319c568454fb7ce917c2ab6acdb514eec02e00965107\",\"license\":\"BSD-3-Clause\"},\"contracts/TokenConverter/AbstractTokenConverter.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\nimport { ReentrancyGuardUpgradeable } from \\\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\\\";\\nimport { SafeERC20Upgradeable } from \\\"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\\\";\\nimport { AccessControlledV8 } from \\\"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\\\";\\nimport { IERC20Upgradeable } from \\\"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\\\";\\nimport { ResilientOracle } from \\\"@venusprotocol/oracle/contracts/ResilientOracle.sol\\\";\\nimport { ensureNonzeroAddress, ensureNonzeroValue } from \\\"@venusprotocol/solidity-utilities/contracts/validators.sol\\\";\\nimport { MANTISSA_ONE, EXP_SCALE } from \\\"@venusprotocol/solidity-utilities/contracts/constants.sol\\\";\\n\\nimport { IAbstractTokenConverter } from \\\"./IAbstractTokenConverter.sol\\\";\\nimport { IConverterNetwork } from \\\"../Interfaces/IConverterNetwork.sol\\\";\\n\\n/// @title AbstractTokenConverter\\n/// @author Venus\\n/// @notice Abstract contract will be extended by SingleTokenConverter and RiskFundConverter\\n/*\\n * This contract specifies four functions for converting tokens, each applicable under following circumstances:\\n *\\n * Case I: TokenIn -> deflationary token, TokenOut -> deflationary token\\n * In this scenario, functions supporting fees can only be utilized to convert tokens which are:\\n * a. convertExactTokensSupportingFeeOnTransferTokens\\n * b. convertForExactTokensSupportingFeeOnTransferTokens\\n *\\n * Case II: TokenIn -> deflationary token, TokenOut -> non-deflationary token\\n * In this scenario, functions supporting fee can only be utilized to convert tokens which are:\\n * similar to Case I.\\n *\\n * Case III: TokenIn -> non-deflationary token, TokenOut -> deflationary token\\n * In this scenario, functions with or without supporting fee can be utilized to convert tokens which are:\\n * a. convertExactTokens\\n * b. convertForExactTokens\\n * c. convertExactTokensSupportingFeeOnTransferTokens\\n * d. convertForExactTokensSupportingFeeOnTransferTokens\\n *\\n * Case IV: TokenIn -> non-deflationary token, TokenOut -> non-deflationary token\\n * In this scenario, functions with or without supporting fee can be utilized to convert tokens which are:\\n * similar to Case III.\\n *\\n * ------------------------------------------------------------------------------------------------------------------------------------\\n * Example 1:-\\n * tokenInAddress - 0xaaaa.....\\n * tokenOutAddress - 0xbbbb.....\\n * tokenInAmount - 100\\n * tokenOutMinAmount - minimum amount desired by the user(let's say 70)\\n * Here user can use `convertExactTokens` or `convertExactTokensSupportingFeeOnTransferTokens`, if tokenIn is deflationary\\n * then `convertExactTokensSupportingFeeOnTransferTokens` should be used(let's suppose `convertExactTokens` is used).\\n * Now first tokenInAddress tokens will be transferred from the user to the contract, on the basis of amount\\n * received(as tokenInAddress can be deflationary token) tokenAmountOut will be calculated and will be transferred\\n * to the user and if amount sent is less than tokenOutMinAmount, tx will revert. If amount sent is satisfied(let's say\\n * 80 or even 70) then at last the actual amount received and the amount that was supposed to be received by the contract will\\n * be compared, if they differ then the whole tx will revert as user was supposed to use `convertExactTokensSupportingFeeOnTransferTokens`\\n * function for tokenIn as deflationary token.\\n *\\n * Example 2:-\\n * tokenInAddress - 0xaaaa.....\\n * tokenOutAddress - 0xbbbb.....\\n * tokenInMaxAmount - maximum amount user is willing to provide(let's say 100)\\n * tokenOutAmount - 70\\n * Here user can use `convertForExactTokens` or `convertForExactTokensSupportingFeeOnTransferTokens`, if tokenIn is deflationary\\n * then `convertForExactTokensSupportingFeeOnTransferTokens` should be used(let's suppose `convertForExactTokens` is used),\\n * which on the basis of tokenOutAmount provided will calculate tokenInAmount based on the tokens prices and will transfer\\n * tokens from the user to the contract, now the actual amount received(as tokenInAddress can be deflationary token) will be\\n * compared with tokenInMaxAmount if it is greater, tx will revert. If In amount is satisfied(let's say 90 or even 100) then\\n * new tokenOutAmount will be calculated, and tokenOutAddress tokens will be transferred to the user, but at last the\\n * old tokenOutAmount and new tokenOutAmount will be compared and if they differ whole tx will revert, because user was\\n * supposed to use `convertForExactTokensSupportingFeeOnTransferTokens` function for tokenIn as deflationary token.\\n * ------------------------------------------------------------------------------------------------------------------------------------\\n *\\n * This contract also supports private conversion between the converters:\\n * Private conversions:\\n * Private conversions is designed in order to convert the maximum amount of tokens received from PSR(to any converter) between\\n * existing converters to save incentive and lower the dependency of users for conversion. So Private Conversion will be executed\\n * by converters on it's own whenever funds are received from PSR. No incentive will be offered during private conversion.\\n *\\n * It will execute on updateAssetsState() function call in Converter Contracts. After this function call, converter will first\\n * check for the amount received. If base asset is received then it will be directly sent to the destination address and no private\\n * conversion will happen otherwise converter will interact with ConverterNetwork contract to find other valid converters who are providing the conversion for:\\n *\\n * tokenAddressIn: As asset received by that converter on updateAssetsState() function call.\\n * tokenAddressOut: As base asset of that converter.\\n *\\n * ConverterNetwork:\\n * This contract will contain all the converters, and will provide valid converters which can perform the execution according to tokenAddressIn\\n * and tokenAddressOut provided.\\n *\\n * findTokenConverters():\\n * It will return an array of converter addresses along with their corresponding balances, sorted in descending order based on the converter's balances\\n * relative to tokenAddressOut. This function filter the converter addresses on the basis of the conversionAccess(for users).\\n *\\n * findTokenConvertersForConverters():\\n * It will return an array of converter addresses along with their corresponding balances, sorted in descending order based on the converter's balances\\n * relative to tokenAddressOut. This function filter the converter addresses on the basis of the conversionAccess(for converters).\\n */\\n\\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\\nabstract contract AbstractTokenConverter is AccessControlledV8, IAbstractTokenConverter, ReentrancyGuardUpgradeable {\\n using SafeERC20Upgradeable for IERC20Upgradeable;\\n\\n /// @notice Maximum incentive could be\\n uint256 public constant MAX_INCENTIVE = 0.5e18;\\n\\n /// @notice Min amount to convert for private conversions. Defined in USD, with 18 decimals\\n uint256 public minAmountToConvert;\\n\\n /// @notice Venus price oracle contract\\n ResilientOracle public priceOracle;\\n\\n /// @notice conversion configurations for the existing pairs\\n /// @dev tokenAddressIn => tokenAddressOut => ConversionConfig\\n mapping(address => mapping(address => ConversionConfig)) public conversionConfigurations;\\n\\n /// @notice Address that all incoming tokens are transferred to\\n address public destinationAddress;\\n\\n /// @notice Boolean for if conversion is paused\\n bool public conversionPaused;\\n\\n /// @notice Address of the converterNetwork contract\\n IConverterNetwork public converterNetwork;\\n\\n /// @dev This empty reserved space is put in place to allow future versions to add new\\n /// variables without shifting down storage in the inheritance chain.\\n /// See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n uint256[45] private __gap;\\n\\n /// @notice Emitted when config is updated for tokens pair\\n event ConversionConfigUpdated(\\n address indexed tokenAddressIn,\\n address indexed tokenAddressOut,\\n uint256 oldIncentive,\\n uint256 newIncentive,\\n ConversionAccessibility oldAccess,\\n ConversionAccessibility newAccess\\n );\\n /// @notice Emitted when price oracle address is updated\\n event PriceOracleUpdated(ResilientOracle indexed oldPriceOracle, ResilientOracle indexed priceOracle);\\n\\n /// @notice Emitted when destination address is updated\\n event DestinationAddressUpdated(address indexed oldDestinationAddress, address indexed destinationAddress);\\n\\n /// @notice Emitted when converterNetwork address is updated\\n event ConverterNetworkAddressUpdated(address indexed oldConverterNetwork, address indexed converterNetwork);\\n\\n /// @notice Emitted when exact amount of tokens are converted for tokens\\n event ConvertedExactTokens(\\n address indexed sender,\\n address indexed receiver,\\n address tokenAddressIn,\\n address indexed tokenAddressOut,\\n uint256 amountIn,\\n uint256 amountOut\\n );\\n\\n /// @notice Emitted when tokens are converted for exact amount of tokens\\n event ConvertedForExactTokens(\\n address indexed sender,\\n address indexed receiver,\\n address tokenAddressIn,\\n address indexed tokenAddressOut,\\n uint256 amountIn,\\n uint256 amountOut\\n );\\n\\n /// @notice Emitted when exact amount of tokens are converted for tokens, for deflationary tokens\\n event ConvertedExactTokensSupportingFeeOnTransferTokens(\\n address indexed sender,\\n address indexed receiver,\\n address tokenAddressIn,\\n address indexed tokenAddressOut,\\n uint256 amountIn,\\n uint256 amountOut\\n );\\n\\n /// @notice Emitted when tokens are converted for exact amount of tokens, for deflationary tokens\\n event ConvertedForExactTokensSupportingFeeOnTransferTokens(\\n address indexed sender,\\n address indexed receiver,\\n address tokenAddressIn,\\n address indexed tokenAddressOut,\\n uint256 amountIn,\\n uint256 amountOut\\n );\\n\\n /// @notice Emitted when conversion is paused\\n event ConversionPaused(address indexed sender);\\n\\n /// @notice Emitted when conversion is unpaused\\n event ConversionResumed(address indexed sender);\\n\\n /// @notice Event emitted when tokens are swept\\n event SweepToken(address indexed token, address indexed to, uint256 amount);\\n\\n /// @notice Emitted when minimum amount to convert is updated\\n event MinAmountToConvertUpdated(uint256 oldMinAmountToConvert, uint256 newMinAmountToConvert);\\n\\n /// @notice Thrown when actualAmountOut does not match with amountOutMantissa for convertForExactTokens\\n error AmountOutMismatched();\\n\\n /// @notice Thrown when actualAmountIn does not match with amountInMantissa for convertForExactTokens\\n error AmountInMismatched();\\n\\n /// @notice Thrown when given input amount is zero\\n error InsufficientInputAmount();\\n\\n /// @notice Thrown when given output amount is zero\\n error InsufficientOutputAmount();\\n\\n /// @notice Thrown when conversion is disabled or config does not exist for given pair\\n error ConversionConfigNotEnabled();\\n\\n /// @notice Thrown when conversion is enabled only for private conversions\\n error ConversionEnabledOnlyForPrivateConversions();\\n\\n /// @notice Thrown when address(to) is same as tokenAddressIn or tokenAddressOut\\n error InvalidToAddress();\\n\\n /// @notice Thrown when incentive is higher than the MAX_INCENTIVE\\n error IncentiveTooHigh(uint256 incentive, uint256 maxIncentive);\\n\\n /// @notice Thrown when amountOut is lower than amountOutMin\\n error AmountOutLowerThanMinRequired(uint256 amountOutMantissa, uint256 amountOutMinMantissa);\\n\\n /// @notice Thrown when amountIn is higher than amountInMax\\n error AmountInHigherThanMax(uint256 amountInMantissa, uint256 amountInMaxMantissa);\\n\\n /// @notice Thrown when conversion is paused\\n error ConversionTokensPaused();\\n\\n /// @notice Thrown when conversion is Active\\n error ConversionTokensActive();\\n\\n /// @notice Thrown when tokenInAddress is same as tokeOutAdress OR tokeInAddress is not the base asset of the destination\\n error InvalidTokenConfigAddresses();\\n\\n /// @notice Thrown when contract has less liquidity for tokenAddressOut than amountOutMantissa\\n error InsufficientPoolLiquidity();\\n\\n /// @notice When address of the ConverterNetwork is not set or Zero address\\n error InvalidConverterNetwork();\\n\\n /// @notice Thrown when trying to set non zero incentive for private conversion\\n error NonZeroIncentiveForPrivateConversion();\\n\\n /// @notice Thrown when using convertForExactTokens deflationary tokens\\n error DeflationaryTokenNotSupported();\\n\\n /// @notice Thrown when minimum amount to convert is zero\\n error InvalidMinimumAmountToConvert();\\n\\n /// @notice Thrown when there is a mismatch in the length of input arrays\\n error InputLengthMisMatch();\\n\\n /**\\n * @notice Modifier to ensure valid conversion parameters for a token conversion\\n * and check if conversion is paused or not\\n * @param to The recipient address for the converted tokens\\n * @param tokenAddressIn The input token address for the conversion\\n * @param tokenAddressOut The output token address for the conversion\\n */\\n modifier validConversionParameters(\\n address to,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) {\\n _checkConversionPaused();\\n ensureNonzeroAddress(to);\\n if (to == tokenAddressIn || to == tokenAddressOut) {\\n revert InvalidToAddress();\\n }\\n _;\\n }\\n\\n /// @notice Pause conversion of tokens\\n /// @custom:event Emits ConversionPaused on success\\n /// @custom:error ConversionTokensPaused thrown when conversion is already paused\\n /// @custom:access Restricted by ACM\\n function pauseConversion() external {\\n _checkAccessAllowed(\\\"pauseConversion()\\\");\\n _checkConversionPaused();\\n conversionPaused = true;\\n emit ConversionPaused(msg.sender);\\n }\\n\\n /// @notice Resume conversion of tokens.\\n /// @custom:event Emits ConversionResumed on success\\n /// @custom:error ConversionTokensActive thrown when conversion is already active\\n /// @custom:access Restricted by ACM\\n function resumeConversion() external {\\n _checkAccessAllowed(\\\"resumeConversion()\\\");\\n if (!conversionPaused) {\\n revert ConversionTokensActive();\\n }\\n\\n conversionPaused = false;\\n emit ConversionResumed(msg.sender);\\n }\\n\\n /// @notice Sets a new price oracle\\n /// @param priceOracle_ Address of the new price oracle to set\\n /// @custom:access Only Governance\\n function setPriceOracle(ResilientOracle priceOracle_) external onlyOwner {\\n _setPriceOracle(priceOracle_);\\n }\\n\\n /// @notice Sets a new destination address\\n /// @param destinationAddress_ The new destination address to be set\\n /// @custom:access Only Governance\\n function setDestination(address destinationAddress_) external onlyOwner {\\n _setDestination(destinationAddress_);\\n }\\n\\n /// @notice Sets a converter network contract address\\n /// @param converterNetwork_ The converterNetwork address to be set\\n /// @custom:access Only Governance\\n function setConverterNetwork(IConverterNetwork converterNetwork_) external onlyOwner {\\n _setConverterNetwork(converterNetwork_);\\n }\\n\\n /// @notice Min amount to convert setter\\n /// @param minAmountToConvert_ Min amount to convert\\n /// @custom:access Only Governance\\n function setMinAmountToConvert(uint256 minAmountToConvert_) external {\\n _checkAccessAllowed(\\\"setMinAmountToConvert(uint256)\\\");\\n _setMinAmountToConvert(minAmountToConvert_);\\n }\\n\\n /// @notice Batch sets the conversion configurations\\n /// @param tokenAddressIn Address of tokenIn\\n /// @param tokenAddressesOut Array of addresses of tokenOut\\n /// @param conversionConfigs Array of conversionConfig config details to update\\n /// @custom:error InputLengthMisMatch is thrown when tokenAddressesOut and conversionConfigs array length mismatches\\n function setConversionConfigs(\\n address tokenAddressIn,\\n address[] calldata tokenAddressesOut,\\n ConversionConfig[] calldata conversionConfigs\\n ) external {\\n uint256 tokenOutArrayLength = tokenAddressesOut.length;\\n if (tokenOutArrayLength != conversionConfigs.length) revert InputLengthMisMatch();\\n\\n for (uint256 i; i < tokenOutArrayLength; ) {\\n setConversionConfig(tokenAddressIn, tokenAddressesOut[i], conversionConfigs[i]);\\n unchecked {\\n ++i;\\n }\\n }\\n }\\n\\n /// @notice Converts exact amount of tokenAddressIn for tokenAddressOut if there is enough tokens held by the contract\\n /// @dev Method does not support deflationary tokens transfer\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @param to Address of the tokenAddressOut receiver\\n /// @return actualAmountIn Actual amount transferred to destination\\n /// @return actualAmountOut Actual amount transferred to user\\n /// @custom:event Emits ConvertedExactTokens event on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when to address is zero\\n /// @custom:error InvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOut\\n /// @custom:error AmountOutLowerThanMinRequired error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa\\n /// @custom:error AmountInMismatched error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa\\n function convertExactTokens(\\n uint256 amountInMantissa,\\n uint256 amountOutMinMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n )\\n external\\n validConversionParameters(to, tokenAddressIn, tokenAddressOut)\\n nonReentrant\\n returns (uint256 actualAmountIn, uint256 actualAmountOut)\\n {\\n (actualAmountIn, actualAmountOut) = _convertExactTokens(\\n amountInMantissa,\\n amountOutMinMantissa,\\n tokenAddressIn,\\n tokenAddressOut,\\n to\\n );\\n\\n if (actualAmountIn != amountInMantissa) {\\n revert AmountInMismatched();\\n }\\n\\n _postConversionHook(tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\\n emit ConvertedExactTokens(msg.sender, to, tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\\n }\\n\\n /// @notice Converts tokens for tokenAddressIn for exact amount of tokenAddressOut if there is enough tokens held by the contract,\\n /// otherwise the amount is adjusted\\n /// @dev Method does not support deflationary tokens transfer\\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @param to Address of the tokenAddressOut receiver\\n /// @return actualAmountIn Actual amount transferred to destination\\n /// @return actualAmountOut Actual amount transferred to user\\n /// @custom:event Emits ConvertedForExactTokens event on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when to address is zero\\n /// @custom:error InvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOut\\n /// @custom:error AmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissa\\n /// @custom:error AmountOutMismatched error is thrown when actualAmountOut is does not match amountOutMantissa\\n function convertForExactTokens(\\n uint256 amountInMaxMantissa,\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n )\\n external\\n validConversionParameters(to, tokenAddressIn, tokenAddressOut)\\n nonReentrant\\n returns (uint256 actualAmountIn, uint256 actualAmountOut)\\n {\\n (actualAmountIn, actualAmountOut) = _convertForExactTokens(\\n amountInMaxMantissa,\\n amountOutMantissa,\\n tokenAddressIn,\\n tokenAddressOut,\\n to\\n );\\n\\n if (actualAmountOut != amountOutMantissa) {\\n revert AmountOutMismatched();\\n }\\n\\n _postConversionHook(tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\\n emit ConvertedForExactTokens(msg.sender, to, tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\\n }\\n\\n /// @notice Converts exact amount of tokenAddressIn for tokenAddressOut if there is enough tokens held by the contract\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @param to Address of the tokenAddressOut receiver\\n /// @return actualAmountIn Actual amount transferred to destination\\n /// @return actualAmountOut Actual amount transferred to user\\n /// @custom:event Emits ConvertedExactTokensSupportingFeeOnTransferTokens event on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when to address is zero\\n /// @custom:error InvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOut\\n /// @custom:error AmountOutLowerThanMinRequired error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa\\n function convertExactTokensSupportingFeeOnTransferTokens(\\n uint256 amountInMantissa,\\n uint256 amountOutMinMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n )\\n external\\n validConversionParameters(to, tokenAddressIn, tokenAddressOut)\\n nonReentrant\\n returns (uint256 actualAmountIn, uint256 actualAmountOut)\\n {\\n (actualAmountIn, actualAmountOut) = _convertExactTokens(\\n amountInMantissa,\\n amountOutMinMantissa,\\n tokenAddressIn,\\n tokenAddressOut,\\n to\\n );\\n\\n _postConversionHook(tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\\n emit ConvertedExactTokensSupportingFeeOnTransferTokens(\\n msg.sender,\\n to,\\n tokenAddressIn,\\n tokenAddressOut,\\n actualAmountIn,\\n actualAmountOut\\n );\\n }\\n\\n /// @notice Converts tokens for tokenAddressIn for amount of tokenAddressOut calculated on the basis of amount of\\n /// tokenAddressIn received by the contract, if there is enough tokens held by the contract, otherwise the amount is adjusted.\\n /// The user will be responsible for bearing any fees associated with token transfers, whether pulling in or pushing out tokens\\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @param to Address of the tokenAddressOut receiver\\n /// @return actualAmountIn Actual amount transferred to destination\\n /// @return actualAmountOut Actual amount transferred to user\\n /// @custom:event Emits ConvertedForExactTokensSupportingFeeOnTransferTokens event on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when to address is zero\\n /// @custom:error InvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOut\\n /// @custom:error AmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissa\\n function convertForExactTokensSupportingFeeOnTransferTokens(\\n uint256 amountInMaxMantissa,\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n )\\n external\\n validConversionParameters(to, tokenAddressIn, tokenAddressOut)\\n nonReentrant\\n returns (uint256 actualAmountIn, uint256 actualAmountOut)\\n {\\n (actualAmountIn, actualAmountOut) = _convertForExactTokensSupportingFeeOnTransferTokens(\\n amountInMaxMantissa,\\n amountOutMantissa,\\n tokenAddressIn,\\n tokenAddressOut,\\n to\\n );\\n\\n _postConversionHook(tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\\n emit ConvertedForExactTokensSupportingFeeOnTransferTokens(\\n msg.sender,\\n to,\\n tokenAddressIn,\\n tokenAddressOut,\\n actualAmountIn,\\n actualAmountOut\\n );\\n }\\n\\n /// @notice To sweep ERC20 tokens and transfer them to user(to address)\\n /// @param tokenAddress The address of the ERC-20 token to sweep\\n /// @param to The address to which tokens will be transferred\\n /// @param amount The amount to transfer\\n /// @custom:event Emits SweepToken event on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when tokenAddress/to address is zero\\n /// @custom:access Only Governance\\n function sweepToken(\\n address tokenAddress,\\n address to,\\n uint256 amount\\n ) external onlyOwner nonReentrant {\\n ensureNonzeroAddress(tokenAddress);\\n ensureNonzeroAddress(to);\\n ensureNonzeroValue(amount);\\n\\n IERC20Upgradeable token = IERC20Upgradeable(tokenAddress);\\n preSweepToken(tokenAddress, amount);\\n token.safeTransfer(to, amount);\\n\\n emit SweepToken(tokenAddress, to, amount);\\n }\\n\\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn.\\n /// This function does not account for potential token transfer fees(in case of deflationary tokens)\\n /// @notice The amountInMantissa might be adjusted if amountOutMantissa is greater than the balance of the contract for tokenAddressOut\\n /// @dev This function retrieves values without altering token prices\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountConvertedMantissa Amount of tokenAddressIn should be transferred after conversion\\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n /// @custom:error ConversionEnabledOnlyForPrivateConversions is thrown when conversion is only enabled for private conversion\\n function getAmountOut(\\n uint256 amountInMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) external view returns (uint256 amountConvertedMantissa, uint256 amountOutMantissa) {\\n if (\\n conversionConfigurations[tokenAddressIn][tokenAddressOut].conversionAccess ==\\n ConversionAccessibility.ONLY_FOR_CONVERTERS\\n ) {\\n revert ConversionEnabledOnlyForPrivateConversions();\\n }\\n\\n amountConvertedMantissa = amountInMantissa;\\n uint256 tokenInToOutConversion;\\n (amountOutMantissa, tokenInToOutConversion) = _getAmountOut(amountInMantissa, tokenAddressIn, tokenAddressOut);\\n\\n uint256 maxTokenOutReserve = balanceOf(tokenAddressOut);\\n\\n /// If contract has less liquidity for tokenAddressOut than amountOutMantissa\\n if (maxTokenOutReserve < amountOutMantissa) {\\n amountConvertedMantissa =\\n ((maxTokenOutReserve * EXP_SCALE) + tokenInToOutConversion - 1) /\\n tokenInToOutConversion; //round-up\\n amountOutMantissa = maxTokenOutReserve;\\n }\\n }\\n\\n /// @notice To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut.\\n /// This function does not account for potential token transfer fees(in case of deflationary tokens)\\n /// @dev This function retrieves values without altering token prices\\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountConvertedMantissa Amount of tokenAddressOut should be transferred after conversion\\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n /// @custom:error ConversionEnabledOnlyForPrivateConversions is thrown when conversion is only enabled for private conversion\\n function getAmountIn(\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) external view returns (uint256 amountConvertedMantissa, uint256 amountInMantissa) {\\n if (\\n conversionConfigurations[tokenAddressIn][tokenAddressOut].conversionAccess ==\\n ConversionAccessibility.ONLY_FOR_CONVERTERS\\n ) {\\n revert ConversionEnabledOnlyForPrivateConversions();\\n }\\n\\n uint256 maxTokenOutReserve = balanceOf(tokenAddressOut);\\n\\n /// If contract has less liquidity for tokenAddressOut than amountOutMantissa\\n if (maxTokenOutReserve < amountOutMantissa) {\\n amountOutMantissa = maxTokenOutReserve;\\n }\\n\\n amountConvertedMantissa = amountOutMantissa;\\n (amountInMantissa, ) = _getAmountIn(amountOutMantissa, tokenAddressIn, tokenAddressOut);\\n }\\n\\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountConvertedMantissa Amount of tokenAddressIn should be transferred after conversion\\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n function getUpdatedAmountOut(\\n uint256 amountInMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) public returns (uint256 amountConvertedMantissa, uint256 amountOutMantissa) {\\n priceOracle.updateAssetPrice(tokenAddressIn);\\n priceOracle.updateAssetPrice(tokenAddressOut);\\n\\n (amountOutMantissa, ) = _getAmountOut(amountInMantissa, tokenAddressIn, tokenAddressOut);\\n amountConvertedMantissa = amountInMantissa;\\n }\\n\\n /// @notice To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut\\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountConvertedMantissa Amount of tokenAddressOut should be transferred after conversion\\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n function getUpdatedAmountIn(\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) public returns (uint256 amountConvertedMantissa, uint256 amountInMantissa) {\\n priceOracle.updateAssetPrice(tokenAddressIn);\\n priceOracle.updateAssetPrice(tokenAddressOut);\\n\\n (amountInMantissa, ) = _getAmountIn(amountOutMantissa, tokenAddressIn, tokenAddressOut);\\n amountConvertedMantissa = amountOutMantissa;\\n }\\n\\n /// @notice This method updated the states of this contract after getting funds from PSR\\n /// after settling the amount(if any) through privateConversion between converters\\n /// @dev This function is called by protocolShareReserve\\n /// @dev call _updateAssetsState to update the states related to the comptroller and asset transfer to the specific converter then\\n /// it calls the _privateConversion which will convert the asset into destination's base asset and transfer it to destination address\\n /// @param comptroller Comptroller address (pool)\\n /// @param asset Asset address\\n function updateAssetsState(address comptroller, address asset) public nonReentrant {\\n uint256 balanceDiff = _updateAssetsState(comptroller, asset);\\n if (balanceDiff > 0) {\\n _privateConversion(comptroller, asset, balanceDiff);\\n }\\n }\\n\\n /// @notice Set the configuration for new or existing conversion pair\\n /// @param tokenAddressIn Address of tokenIn\\n /// @param tokenAddressOut Address of tokenOut\\n /// @param conversionConfig ConversionConfig config details to update\\n /// @custom:event Emits ConversionConfigUpdated event on success\\n /// @custom:error Unauthorized error is thrown when the call is not authorized by AccessControlManager\\n /// @custom:error ZeroAddressNotAllowed is thrown when pool registry address is zero\\n /// @custom:error NonZeroIncentiveForPrivateConversion is thrown when incentive is non zero for private conversion\\n /// @custom:access Controlled by AccessControlManager\\n function setConversionConfig(\\n address tokenAddressIn,\\n address tokenAddressOut,\\n ConversionConfig calldata conversionConfig\\n ) public {\\n _checkAccessAllowed(\\\"setConversionConfig(address,address,ConversionConfig)\\\");\\n ensureNonzeroAddress(tokenAddressIn);\\n ensureNonzeroAddress(tokenAddressOut);\\n\\n if (conversionConfig.incentive > MAX_INCENTIVE) {\\n revert IncentiveTooHigh(conversionConfig.incentive, MAX_INCENTIVE);\\n }\\n\\n if (\\n (tokenAddressIn == tokenAddressOut) ||\\n (tokenAddressIn != _getDestinationBaseAsset()) ||\\n conversionConfigurations[tokenAddressOut][tokenAddressIn].conversionAccess != ConversionAccessibility.NONE\\n ) {\\n revert InvalidTokenConfigAddresses();\\n }\\n\\n if (\\n (conversionConfig.conversionAccess == ConversionAccessibility.ONLY_FOR_CONVERTERS) &&\\n conversionConfig.incentive != 0\\n ) {\\n revert NonZeroIncentiveForPrivateConversion();\\n }\\n\\n if (\\n ((conversionConfig.conversionAccess == ConversionAccessibility.ONLY_FOR_CONVERTERS) ||\\n (conversionConfig.conversionAccess == ConversionAccessibility.ALL)) &&\\n (address(converterNetwork) == address(0))\\n ) {\\n revert InvalidConverterNetwork();\\n }\\n\\n ConversionConfig storage configuration = conversionConfigurations[tokenAddressIn][tokenAddressOut];\\n\\n emit ConversionConfigUpdated(\\n tokenAddressIn,\\n tokenAddressOut,\\n configuration.incentive,\\n conversionConfig.incentive,\\n configuration.conversionAccess,\\n conversionConfig.conversionAccess\\n );\\n\\n if (conversionConfig.conversionAccess == ConversionAccessibility.NONE) {\\n delete conversionConfigurations[tokenAddressIn][tokenAddressOut];\\n } else {\\n configuration.incentive = conversionConfig.incentive;\\n configuration.conversionAccess = conversionConfig.conversionAccess;\\n }\\n }\\n\\n /// @notice Get the balance for specific token\\n /// @param token Address of the token\\n /// @return tokenBalance Balance of the token the contract has\\n function balanceOf(address token) public view virtual returns (uint256 tokenBalance);\\n\\n /// @dev Operations to perform before sweeping tokens\\n /// @param token Address of the token\\n /// @param amount Amount transferred to address(to)\\n function preSweepToken(address token, uint256 amount) internal virtual {}\\n\\n /// @dev Converts exact amount of tokenAddressIn for tokenAddressOut\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @param to Address of the tokenAddressOut receiver\\n /// @return actualAmountIn Actual amount of tokenAddressIn transferred\\n /// @return amountOutMantissa Actual amount of tokenAddressOut transferred\\n /// @custom:error AmountOutLowerThanMinRequired error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa\\n function _convertExactTokens(\\n uint256 amountInMantissa,\\n uint256 amountOutMinMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n ) internal returns (uint256 actualAmountIn, uint256 amountOutMantissa) {\\n _checkPrivateConversion(tokenAddressIn, tokenAddressOut);\\n actualAmountIn = _doTransferIn(tokenAddressIn, amountInMantissa);\\n\\n (, amountOutMantissa) = getUpdatedAmountOut(actualAmountIn, tokenAddressIn, tokenAddressOut);\\n\\n if (amountOutMantissa < amountOutMinMantissa) {\\n revert AmountOutLowerThanMinRequired(amountOutMantissa, amountOutMinMantissa);\\n }\\n\\n _doTransferOut(tokenAddressOut, to, amountOutMantissa);\\n }\\n\\n /// @dev Converts tokens for tokenAddressIn for exact amount of tokenAddressOut used for non deflationry tokens\\n /// it is called by convertForExactTokens function\\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @param to Address of the tokenAddressOut receiver\\n /// @return actualAmountIn Actual amount of tokenAddressIn transferred\\n /// @return actualAmountOut Actual amount of tokenAddressOut transferred\\n /// @custom:error DeflationaryTokenNotSupported is thrown if tokenAddressIn is deflationary token\\n /// @custom:error AmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissa\\n function _convertForExactTokens(\\n uint256 amountInMaxMantissa,\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n ) internal returns (uint256 actualAmountIn, uint256 actualAmountOut) {\\n _checkPrivateConversion(tokenAddressIn, tokenAddressOut);\\n (, uint256 amountInMantissa) = getUpdatedAmountIn(amountOutMantissa, tokenAddressIn, tokenAddressOut);\\n\\n actualAmountIn = _doTransferIn(tokenAddressIn, amountInMantissa);\\n\\n if (actualAmountIn != amountInMantissa) {\\n revert DeflationaryTokenNotSupported();\\n }\\n\\n if (actualAmountIn > amountInMaxMantissa) {\\n revert AmountInHigherThanMax(amountInMantissa, amountInMaxMantissa);\\n }\\n\\n _doTransferOut(tokenAddressOut, to, amountOutMantissa);\\n actualAmountOut = amountOutMantissa;\\n }\\n\\n /// @dev Converts tokens for tokenAddressIn for the amount of tokenAddressOut used for deflationary tokens\\n /// it is called by convertForExactTokensSupportingFeeOnTransferTokens function\\n /// @notice Advising users to input a smaller amountOutMantissa to avoid potential transaction revert\\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @param to Address of the tokenAddressOut receiver\\n /// @return actualAmountIn Actual amount of tokenAddressIn transferred\\n /// @return actualAmountOut Actual amount of tokenAddressOut transferred\\n /// @custom:error AmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissa\\n function _convertForExactTokensSupportingFeeOnTransferTokens(\\n uint256 amountInMaxMantissa,\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n ) internal returns (uint256 actualAmountIn, uint256 actualAmountOut) {\\n _checkPrivateConversion(tokenAddressIn, tokenAddressOut);\\n (, uint256 amountInMantissa) = getUpdatedAmountIn(amountOutMantissa, tokenAddressIn, tokenAddressOut);\\n\\n if (amountInMantissa > amountInMaxMantissa) {\\n revert AmountInHigherThanMax(amountInMantissa, amountInMaxMantissa);\\n }\\n\\n actualAmountIn = _doTransferIn(tokenAddressIn, amountInMantissa);\\n\\n (, actualAmountOut) = getUpdatedAmountOut(actualAmountIn, tokenAddressIn, tokenAddressOut);\\n\\n _doTransferOut(tokenAddressOut, to, actualAmountOut);\\n }\\n\\n /// @dev return actualAmountOut from reserves for tokenAddressOut\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @param to Address of the tokenAddressOut receiver\\n /// @param amountConvertedMantissa Amount of tokenAddressOut supposed to get transferred\\n /// @custom:error InsufficientPoolLiquidity If contract has less liquidity for tokenAddressOut than amountOutMantissa\\n function _doTransferOut(\\n address tokenAddressOut,\\n address to,\\n uint256 amountConvertedMantissa\\n ) internal {\\n uint256 maxTokenOutReserve = balanceOf(tokenAddressOut);\\n\\n /// If contract has less liquidity for tokenAddressOut than amountOutMantissa\\n if (maxTokenOutReserve < amountConvertedMantissa) {\\n revert InsufficientPoolLiquidity();\\n }\\n\\n _preTransferHook(tokenAddressOut, amountConvertedMantissa);\\n\\n IERC20Upgradeable tokenOut = IERC20Upgradeable(tokenAddressOut);\\n tokenOut.safeTransfer(to, amountConvertedMantissa);\\n }\\n\\n /// @notice Transfer tokenAddressIn from user to destination\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @return actualAmountIn Actual amount transferred to destination\\n function _doTransferIn(address tokenAddressIn, uint256 amountInMantissa) internal returns (uint256 actualAmountIn) {\\n IERC20Upgradeable tokenIn = IERC20Upgradeable(tokenAddressIn);\\n uint256 balanceBeforeDestination = tokenIn.balanceOf(destinationAddress);\\n tokenIn.safeTransferFrom(msg.sender, destinationAddress, amountInMantissa);\\n uint256 balanceAfterDestination = tokenIn.balanceOf(destinationAddress);\\n actualAmountIn = balanceAfterDestination - balanceBeforeDestination;\\n }\\n\\n /// @dev Sets a new price oracle\\n /// @param priceOracle_ Address of the new price oracle to set\\n /// @custom:event Emits PriceOracleUpdated event on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when price oracle address is zero\\n function _setPriceOracle(ResilientOracle priceOracle_) internal {\\n ensureNonzeroAddress(address(priceOracle_));\\n emit PriceOracleUpdated(priceOracle, priceOracle_);\\n priceOracle = priceOracle_;\\n }\\n\\n /// @dev Sets a new destination address\\n /// @param destinationAddress_ The new destination address to be set\\n /// @custom:event Emits DestinationAddressUpdated event on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when destination address is zero\\n function _setDestination(address destinationAddress_) internal {\\n ensureNonzeroAddress(destinationAddress_);\\n emit DestinationAddressUpdated(destinationAddress, destinationAddress_);\\n destinationAddress = destinationAddress_;\\n }\\n\\n /// @notice Sets a converter network contract address\\n /// @param converterNetwork_ The converterNetwork address to be set\\n /// @custom:event Emits ConverterNetworkAddressUpdated event on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when address is zero\\n function _setConverterNetwork(IConverterNetwork converterNetwork_) internal {\\n ensureNonzeroAddress(address(converterNetwork_));\\n emit ConverterNetworkAddressUpdated(address(converterNetwork), address(converterNetwork_));\\n converterNetwork = converterNetwork_;\\n }\\n\\n /// @notice Min amount to convert setter\\n /// @param minAmountToConvert_ Min amount to convert\\n /// @custom:event MinAmountToConvertUpdated is emitted in success\\n /// @custom:error ZeroValueNotAllowed is thrown if the provided value is 0\\n function _setMinAmountToConvert(uint256 minAmountToConvert_) internal {\\n ensureNonzeroValue(minAmountToConvert_);\\n emit MinAmountToConvertUpdated(minAmountToConvert, minAmountToConvert_);\\n minAmountToConvert = minAmountToConvert_;\\n }\\n\\n /// @dev Hook to perform after converting tokens\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @param amountIn Amount of tokenIn converted\\n /// @param amountOut Amount of tokenOut converted\\n function _postConversionHook(\\n address tokenAddressIn,\\n address tokenAddressOut,\\n uint256 amountIn,\\n uint256 amountOut\\n ) internal virtual {}\\n\\n /// @param accessControlManager_ Access control manager contract address\\n /// @param priceOracle_ Resilient oracle address\\n /// @param destinationAddress_ Address at all incoming tokens will transferred to\\n /// @param minAmountToConvert_ minimum amount to convert\\n function __AbstractTokenConverter_init(\\n address accessControlManager_,\\n ResilientOracle priceOracle_,\\n address destinationAddress_,\\n uint256 minAmountToConvert_\\n ) internal onlyInitializing {\\n __AccessControlled_init(accessControlManager_);\\n __ReentrancyGuard_init();\\n __AbstractTokenConverter_init_unchained(priceOracle_, destinationAddress_, minAmountToConvert_);\\n }\\n\\n /// @param priceOracle_ Resilient oracle address\\n /// @param destinationAddress_ Address at all incoming tokens will transferred to\\n /// @param minAmountToConvert_ minimum amount to convert\\n function __AbstractTokenConverter_init_unchained(\\n ResilientOracle priceOracle_,\\n address destinationAddress_,\\n uint256 minAmountToConvert_\\n ) internal onlyInitializing {\\n _setPriceOracle(priceOracle_);\\n _setDestination(destinationAddress_);\\n _setMinAmountToConvert(minAmountToConvert_);\\n conversionPaused = false;\\n }\\n\\n /// @dev _updateAssetsState hook to update the states of reserves transferred for the specific comptroller\\n /// @param comptroller Comptroller address (pool)\\n /// @param asset Asset address\\n /// @return Amount of asset, for _privateConversion\\n function _updateAssetsState(address comptroller, address asset) internal virtual returns (uint256) {}\\n\\n /// @dev This method is used to convert asset into base asset by converting them with other converters which supports the pair and transfer the funds to\\n /// destination contract as destination's base asset\\n /// @param comptroller Comptroller address (pool)\\n /// @param tokenAddressOut Address of the token transferred to converter, and through _privateConversion it will be converted into base asset\\n /// @param amountToConvert Amount of the tokenAddressOut transferred to converter\\n function _privateConversion(\\n address comptroller,\\n address tokenAddressOut,\\n uint256 amountToConvert\\n ) internal {\\n address tokenAddressIn = _getDestinationBaseAsset();\\n address _destinationAddress = destinationAddress;\\n uint256 convertedTokenInBalance;\\n if (address(converterNetwork) != address(0)) {\\n (address[] memory converterAddresses, uint256[] memory converterBalances) = converterNetwork\\n .findTokenConvertersForConverters(tokenAddressOut, tokenAddressIn);\\n uint256 convertersLength = converterAddresses.length;\\n for (uint256 i; i < convertersLength; ) {\\n if (converterBalances[i] == 0) break;\\n (, uint256 amountIn) = IAbstractTokenConverter(converterAddresses[i]).getUpdatedAmountIn(\\n converterBalances[i],\\n tokenAddressOut,\\n tokenAddressIn\\n );\\n if (amountIn > amountToConvert) {\\n amountIn = amountToConvert;\\n }\\n\\n if (!_validateMinAmountToConvert(amountIn, tokenAddressOut)) {\\n break;\\n }\\n\\n uint256 balanceBefore = IERC20Upgradeable(tokenAddressIn).balanceOf(_destinationAddress);\\n\\n IERC20Upgradeable(tokenAddressOut).approve(converterAddresses[i], amountIn);\\n IAbstractTokenConverter(converterAddresses[i]).convertExactTokens(\\n amountIn,\\n 0,\\n tokenAddressOut,\\n tokenAddressIn,\\n _destinationAddress\\n );\\n\\n uint256 balanceAfter = IERC20Upgradeable(tokenAddressIn).balanceOf(_destinationAddress);\\n amountToConvert -= amountIn;\\n convertedTokenInBalance += (balanceAfter - balanceBefore);\\n\\n if (amountToConvert == 0) break;\\n unchecked {\\n ++i;\\n }\\n }\\n }\\n\\n _postPrivateConversionHook(\\n comptroller,\\n tokenAddressIn,\\n convertedTokenInBalance,\\n tokenAddressOut,\\n amountToConvert\\n );\\n }\\n\\n /// @dev This hook is used to update states for the converter after the privateConversion\\n /// @param comptroller Comptroller address (pool)\\n /// @param tokenAddressIn Address of the destination's base asset\\n /// @param convertedTokenInBalance Amount of the base asset received after the conversion\\n /// @param tokenAddressOut Address of the asset transferred to other converter in exchange of base asset\\n /// @param convertedTokenOutBalance Amount of tokenAddressOut transferred from this converter\\n function _postPrivateConversionHook(\\n address comptroller,\\n address tokenAddressIn,\\n uint256 convertedTokenInBalance,\\n address tokenAddressOut,\\n uint256 convertedTokenOutBalance\\n ) internal virtual {}\\n\\n /// @notice This hook is used to update the state for asset reserves before transferring tokenOut to user\\n /// @param tokenOutAddress Address of the asset to be transferred to the user\\n /// @param amountOut Amount of tokenAddressOut transferred from this converter\\n function _preTransferHook(address tokenOutAddress, uint256 amountOut) internal virtual {}\\n\\n /// @dev Checks if amount to convert is greater than minimum amount to convert or not\\n /// @param amountIn The amount to convert\\n /// @param tokenAddress Address of the token\\n /// @return isValid true if amount to convert is greater than minimum amount to convert\\n function _validateMinAmountToConvert(uint256 amountIn, address tokenAddress) internal returns (bool isValid) {\\n priceOracle.updateAssetPrice(tokenAddress);\\n uint256 amountInInUsd = (priceOracle.getPrice(tokenAddress) * amountIn) / EXP_SCALE;\\n\\n if (amountInInUsd >= minAmountToConvert) {\\n isValid = true;\\n }\\n }\\n\\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn\\n /// @dev This function retrieves values without altering token prices.\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\\n /// @return tokenInToOutConversion Ratio of tokenIn price and incentive for conversion with tokenOut price\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n function _getAmountOut(\\n uint256 amountInMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) internal view returns (uint256 amountOutMantissa, uint256 tokenInToOutConversion) {\\n if (amountInMantissa == 0) {\\n revert InsufficientInputAmount();\\n }\\n\\n ConversionConfig memory configuration = conversionConfigurations[tokenAddressIn][tokenAddressOut];\\n\\n if (configuration.conversionAccess == ConversionAccessibility.NONE) {\\n revert ConversionConfigNotEnabled();\\n }\\n\\n uint256 tokenInUnderlyingPrice = priceOracle.getPrice(tokenAddressIn);\\n uint256 tokenOutUnderlyingPrice = priceOracle.getPrice(tokenAddressOut);\\n\\n uint256 incentive = configuration.incentive;\\n if (address(converterNetwork) != address(0) && (converterNetwork.isTokenConverter(msg.sender))) {\\n incentive = 0;\\n }\\n\\n /// conversion rate after considering incentive(conversionWithIncentive)\\n uint256 conversionWithIncentive = MANTISSA_ONE + incentive;\\n\\n /// amount of tokenAddressOut after including incentive as amountOutMantissa will be greater than actual as it gets\\n /// multiplied by conversionWithIncentive which will be >= 1\\n amountOutMantissa =\\n (amountInMantissa * tokenInUnderlyingPrice * conversionWithIncentive) /\\n (tokenOutUnderlyingPrice * EXP_SCALE);\\n\\n tokenInToOutConversion = (tokenInUnderlyingPrice * conversionWithIncentive) / tokenOutUnderlyingPrice;\\n }\\n\\n /// @dev To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut\\n /// @dev This function retrieves values without altering token prices.\\n /// @dev For user conversions, the function returns an amountInMantissa that is rounded up, ensuring that the equivalent amountInMantissa\\n /// is obtained from users for corresponding amountOutMantissa, preventing any losses to the protocol. However, no rounding up is required for private conversions\\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\\n /// @return tokenInToOutConversion Ratio of tokenIn price and incentive for conversion with tokenOut price\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n function _getAmountIn(\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) internal view returns (uint256 amountInMantissa, uint256 tokenInToOutConversion) {\\n if (amountOutMantissa == 0) {\\n revert InsufficientOutputAmount();\\n }\\n\\n ConversionConfig memory configuration = conversionConfigurations[tokenAddressIn][tokenAddressOut];\\n\\n if (configuration.conversionAccess == ConversionAccessibility.NONE) {\\n revert ConversionConfigNotEnabled();\\n }\\n\\n uint256 tokenInUnderlyingPrice = priceOracle.getPrice(tokenAddressIn);\\n uint256 tokenOutUnderlyingPrice = priceOracle.getPrice(tokenAddressOut);\\n\\n uint256 incentive = configuration.incentive;\\n\\n bool isPrivateConversion = address(converterNetwork) != address(0) &&\\n converterNetwork.isTokenConverter(msg.sender);\\n if (isPrivateConversion) {\\n incentive = 0;\\n }\\n\\n /// conversion rate after considering incentive(conversionWithIncentive)\\n uint256 conversionWithIncentive = MANTISSA_ONE + incentive;\\n tokenInToOutConversion = (tokenInUnderlyingPrice * conversionWithIncentive) / tokenOutUnderlyingPrice;\\n\\n /// amount of tokenAddressIn after considering incentive(i.e. amountInMantissa will be less than actual amountInMantissa if incentive > 0)\\n if (isPrivateConversion) {\\n amountInMantissa = (amountOutMantissa * EXP_SCALE) / tokenInToOutConversion;\\n } else {\\n amountInMantissa = ((amountOutMantissa * EXP_SCALE) + tokenInToOutConversion - 1) / tokenInToOutConversion; //round-up\\n }\\n }\\n\\n /// @dev Check if msg.sender is allowed to convert as per onlyForPrivateConversions flag\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @custom:error ConversionEnabledOnlyForPrivateConversions is thrown when conversion is only enabled for private conversion\\n function _checkPrivateConversion(address tokenAddressIn, address tokenAddressOut) internal view {\\n bool isConverter = (address(converterNetwork) != address(0)) && converterNetwork.isTokenConverter(msg.sender);\\n if (\\n (!(isConverter) &&\\n (conversionConfigurations[tokenAddressIn][tokenAddressOut].conversionAccess ==\\n ConversionAccessibility.ONLY_FOR_CONVERTERS))\\n ) {\\n revert ConversionEnabledOnlyForPrivateConversions();\\n }\\n }\\n\\n /// @dev To check, is conversion paused\\n /// @custom:error ConversionTokensPaused is thrown when token conversion is paused\\n function _checkConversionPaused() internal view {\\n if (conversionPaused) {\\n revert ConversionTokensPaused();\\n }\\n }\\n\\n /// @dev Get base asset address of the destination contract\\n /// @return Address of the base asset\\n function _getDestinationBaseAsset() internal view virtual returns (address) {}\\n}\\n\",\"keccak256\":\"0xdecdaf378a5af7744557fc29495d6db49c6900be1b03bcb6faa2b3a23c9a5c59\",\"license\":\"BSD-3-Clause\"},\"contracts/TokenConverter/IAbstractTokenConverter.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\nimport { ResilientOracle } from \\\"@venusprotocol/oracle/contracts/ResilientOracle.sol\\\";\\nimport { IConverterNetwork } from \\\"../Interfaces/IConverterNetwork.sol\\\";\\n\\n/// @notice Interface for AbstractTokenConverter\\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\\ninterface IAbstractTokenConverter {\\n /// @notice This enum define the all possible ways of conversion can happen\\n enum ConversionAccessibility {\\n NONE, // Conversion is disable for the pair\\n ALL, // Conversion is enable for private conversion and users\\n ONLY_FOR_CONVERTERS, // Conversion is enable only for private conversion\\n ONLY_FOR_USERS // Conversion is enable only for users\\n }\\n\\n /// @notice This struct represents the configuration for a token conversion.\\n struct ConversionConfig {\\n /// incentive on conversion of tokens in mantissa i.e 10% incentive would be 0.1 * 1e18\\n uint256 incentive;\\n /// enable or disable conversion for users or converters or both or none\\n ConversionAccessibility conversionAccess;\\n }\\n\\n /// @notice Pause conversion of tokens\\n function pauseConversion() external;\\n\\n /// @notice Resume conversion of tokens.\\n function resumeConversion() external;\\n\\n /// @notice Sets a new price oracle\\n /// @param priceOracle_ Address of the new price oracle to set\\n function setPriceOracle(ResilientOracle priceOracle_) external;\\n\\n /// @notice Set the configuration for new or existing convert pair\\n /// @param tokenAddressIn Address of tokenIn\\n /// @param tokenAddressOut Address of tokenOut\\n /// @param conversionConfig ConversionConfig config details to update\\n function setConversionConfig(\\n address tokenAddressIn,\\n address tokenAddressOut,\\n ConversionConfig calldata conversionConfig\\n ) external;\\n\\n /// @notice Convert exact amount of tokenAddressIn for tokenAddressOut\\n /// @dev Method does not support deflationary tokens transfer\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after convert\\n /// @param to Address of the tokenAddressOut receiver\\n function convertExactTokens(\\n uint256 amountInMantissa,\\n uint256 amountOutMinMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n ) external returns (uint256 actualAmountIn, uint256 actualAmountOut);\\n\\n /// @notice Convert tokens for tokenAddressIn for exact amount of tokenAddressOut\\n /// @dev Method does not support deflationary tokens transfer\\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after convert\\n /// @param to Address of the tokenAddressOut receiver\\n function convertForExactTokens(\\n uint256 amountInMaxMantissa,\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n ) external returns (uint256 actualAmountIn, uint256 actualAmountOut);\\n\\n /// @notice Convert exact amount of tokenAddressIn for tokenAddressOut\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after convert\\n /// @param to Address of the tokenAddressOut receiver\\n function convertExactTokensSupportingFeeOnTransferTokens(\\n uint256 amountInMantissa,\\n uint256 amountOutMinMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n ) external returns (uint256 actualAmountIn, uint256 actualAmountOut);\\n\\n /// @notice Convert tokens for tokenAddressIn for exact amount of tokenAddressOut\\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after convert\\n /// @param to Address of the tokenAddressOut receiver\\n function convertForExactTokensSupportingFeeOnTransferTokens(\\n uint256 amountInMaxMantissa,\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n ) external returns (uint256 actualAmountIn, uint256 actualAmountOut);\\n\\n /// @notice Get the configuration for the pair of the tokens\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return incentives Percentage of incentives to be distributed for the pair of tokens\\n /// @return conversionAccess Accessibility for the pair of tokens\\n function conversionConfigurations(address tokenAddressIn, address tokenAddressOut)\\n external\\n returns (uint256 incentives, ConversionAccessibility conversionAccess);\\n\\n /// @notice Get the address of the converterNetwork\\n function converterNetwork() external returns (IConverterNetwork converterNetwork);\\n\\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountConvertedMantissa Amount of tokenAddressIn should be transferred after conversion\\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n function getUpdatedAmountOut(\\n uint256 amountInMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) external returns (uint256 amountConvertedMantissa, uint256 amountOutMantissa);\\n\\n /// @notice To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut\\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountConvertedMantissa Amount of tokenAddressOut should be transferred after conversion\\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n function getUpdatedAmountIn(\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) external returns (uint256 amountConvertedMantissa, uint256 amountInMantissa);\\n\\n /// @notice To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut\\n /// @dev This function retrieves values without altering token prices.\\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountConvertedMantissa Amount of tokenAddressOut should be transferred after conversion\\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n function getAmountIn(\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) external view returns (uint256 amountConvertedMantissa, uint256 amountInMantissa);\\n\\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn\\n /// @dev This function retrieves values without altering token prices.\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountConvertedMantissa Amount of tokenAddressIn should be transferred after conversion\\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n function getAmountOut(\\n uint256 amountInMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) external view returns (uint256 amountConvertedMantissa, uint256 amountOutMantissa);\\n\\n /// @notice Get the balance for specific token\\n /// @param token Address of the token\\n /// @return tokenBalance Balance of the token the contract has\\n function balanceOf(address token) external view returns (uint256 tokenBalance);\\n}\\n\",\"keccak256\":\"0xc677c12e2f04e520fb1fa02a1f06ad37d821cfebb5aa8f4bd7a22410648a0aae\",\"license\":\"BSD-3-Clause\"},\"contracts/TokenConverter/SingleTokenConverter.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\nimport { SafeERC20Upgradeable } from \\\"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\\\";\\nimport { IERC20Upgradeable } from \\\"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\\\";\\nimport { ResilientOracle } from \\\"@venusprotocol/oracle/contracts/ResilientOracle.sol\\\";\\nimport { ensureNonzeroAddress } from \\\"@venusprotocol/solidity-utilities/contracts/validators.sol\\\";\\n\\nimport { AbstractTokenConverter } from \\\"./AbstractTokenConverter.sol\\\";\\n\\n/// @title SingleTokenConverter\\n/// @author Venus\\n/// @notice SingleTokenConverter used for token conversions and sends received tokens\\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\\ncontract SingleTokenConverter is AbstractTokenConverter {\\n using SafeERC20Upgradeable for IERC20Upgradeable;\\n\\n /// @notice Address of the base asset token\\n address public baseAsset;\\n\\n /// @notice Emitted when base asset is updated\\n event BaseAssetUpdated(address indexed oldBaseAsset, address indexed newBaseAsset);\\n\\n /// @notice Emmitted after the funds transferred to the destination address\\n event AssetTransferredToDestination(\\n address indexed receiver,\\n address indexed comptroller,\\n address indexed asset,\\n uint256 amount\\n );\\n\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor() {\\n // Note that the contract is upgradeable. Use initialize() or reinitializers\\n // to set the state variables.\\n _disableInitializers();\\n }\\n\\n /// @param accessControlManager_ Access control manager contract address\\n /// @param priceOracle_ Resilient oracle address\\n /// @param destinationAddress_ Address at all incoming tokens will transferred to\\n /// @param baseAsset_ Address of the base asset\\n /// @param minAmountToConvert_ Minimum amount to convert\\n function initialize(\\n address accessControlManager_,\\n ResilientOracle priceOracle_,\\n address destinationAddress_,\\n address baseAsset_,\\n uint256 minAmountToConvert_\\n ) public initializer {\\n _setBaseAsset(baseAsset_);\\n\\n // Initialize AbstractTokenConverter\\n __AbstractTokenConverter_init(accessControlManager_, priceOracle_, destinationAddress_, minAmountToConvert_);\\n }\\n\\n /// @notice Sets the base asset for the contract\\n /// @param baseAsset_ The new address of the base asset\\n /// @custom:access Only Governance\\n function setBaseAsset(address baseAsset_) external onlyOwner {\\n _setBaseAsset(baseAsset_);\\n }\\n\\n /// @notice Get the balance for specific token\\n /// @param tokenAddress Address of the token\\n /// @return tokenBalance Balance of the token the contract has\\n function balanceOf(address tokenAddress) public view override returns (uint256 tokenBalance) {\\n IERC20Upgradeable token = IERC20Upgradeable(tokenAddress);\\n tokenBalance = token.balanceOf(address(this));\\n }\\n\\n /// @param comptroller Comptroller address (pool)\\n /// @param asset Asset address.\\n /// @return balanceLeft Amount of asset, for _privateConversion\\n // solhint-disable-next-line\\n function _updateAssetsState(address comptroller, address asset) internal override returns (uint256 balanceLeft) {\\n IERC20Upgradeable token = IERC20Upgradeable(asset);\\n uint256 balance = token.balanceOf(address(this));\\n balanceLeft = balance;\\n\\n if (asset == baseAsset) {\\n balanceLeft = 0;\\n token.safeTransfer(destinationAddress, balance);\\n emit AssetTransferredToDestination(destinationAddress, comptroller, asset, balance);\\n }\\n }\\n\\n /// @dev Sets the base asset for the contract\\n /// @param baseAsset_ The new address of the base asset\\n /// @custom:error ZeroAddressNotAllowed is thrown when address is zero\\n /// @custom:event BaseAssetUpdated is emitted on success\\n function _setBaseAsset(address baseAsset_) internal {\\n ensureNonzeroAddress(baseAsset_);\\n emit BaseAssetUpdated(baseAsset, baseAsset_);\\n baseAsset = baseAsset_;\\n }\\n\\n /// @dev Get base asset address\\n /// @return destinationBaseAsset Address of the base asset(baseAsset)\\n function _getDestinationBaseAsset() internal view override returns (address destinationBaseAsset) {\\n destinationBaseAsset = baseAsset;\\n }\\n}\\n\",\"keccak256\":\"0x385804c4f8a1d5b0ed58da01f584c778e2a869b280ad6cb607b7fe8539c51897\",\"license\":\"BSD-3-Clause\"}},\"version\":1}", + "bytecode": "0x60806040523480156200001157600080fd5b506200001c62000022565b620000e3565b600054610100900460ff16156200008f5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff90811614620000e1576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6140bf80620000f36000396000f3fe608060405234801561001057600080fd5b506004361061025c5760003560e01c806379ba509711610145578063ca325469116100bd578063f04c31871161008c578063f2fde38b11610071578063f2fde38b14610533578063f7013ef614610546578063fe3da9841461055957600080fd5b8063f04c31871461050d578063f0dc7e9d1461052057600080fd5b8063ca325469146104c6578063cdf456e1146104d9578063e2ff7ea2146104ed578063e30c3978146104fc57600080fd5b8063b491ddf711610114578063b6828c57116100f9578063b6828c5714610498578063bc368b04146104ab578063c0654646146104b357600080fd5b8063b491ddf714610444578063b4a0bdf31461048757600080fd5b806379ba5097146104055780638da5cb5b1461040d57806390fa7b541461041e578063aac59a751461043157600080fd5b8063530e784f116101d85780636daa463b116101a757806370a082311161018c57806370a08231146103c9578063715018a6146103ea578063746460a9146103f257600080fd5b80636daa463b146103a35780636f1a30a8146103b657600080fd5b8063530e784f1461036257806358b904df146103755780635e1e63251461037d57806364aff9ec1461039057600080fd5b80630e32cb861161022f5780633606b26c116102145780633606b26c14610329578063439727a51461033c57806352e21a181461034f57600080fd5b80630e32cb86146103035780632630c12f1461031657600080fd5b806301e201781461026157806307aa239e146102915780630a0a05e6146102c65780630a9a2b72146102db575b600080fd5b60ff54610274906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b60fe546102b69074010000000000000000000000000000000000000000900460ff1681565b6040519015158152602001610288565b6102d96102d4366004613835565b610562565b005b6102ee6102e9366004613852565b610576565b60408051928352602083019190915201610288565b6102d9610311366004613835565b610624565b60fc54610274906001600160a01b031681565b6102d9610337366004613835565b610635565b6102ee61034a366004613894565b610646565b6102d961035d366004613835565b610784565b6102d9610370366004613835565b610795565b6102d96107a6565b6102ee61038b366004613852565b61088c565b6102d961039e3660046138f3565b610973565b6102ee6103b1366004613852565b610a10565b6102ee6103c4366004613852565b610b19565b6103dc6103d7366004613835565b610c18565b604051908152602001610288565b6102d9610ca5565b6102d9610400366004613934565b610cb9565b6102d9610d00565b6033546001600160a01b0316610274565b6102ee61042c366004613894565b610d90565b6102d961043f36600461394d565b610e7a565b61047961045236600461394d565b60fd6020908152600092835260408084209091529082529020805460019091015460ff1682565b6040516102889291906139f0565b6097546001600160a01b0316610274565b6102ee6104a6366004613894565b610eb0565b6102d9610f9a565b6102d96104c1366004613a50565b61104c565b60fe54610274906001600160a01b031681565b61012d54610274906001600160a01b031681565b6103dc6706f05b59d3b2000081565b6065546001600160a01b0316610274565b6102ee61051b366004613894565b6110ea565b6102d961052e366004613b04565b61120d565b6102d9610541366004613835565b6115ac565b6102d9610554366004613b75565b611635565b6103dc60fb5481565b61056a6117bf565b61057381611819565b50565b60008060026001600160a01b03808616600090815260fd602090815260408083209388168352929052206001015460ff1660038111156105b8576105b8613986565b036105ef576040517f03410cd100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006105fa84610c18565b905085811015610608578095505b859250610616868686611896565b508092505050935093915050565b61062c6117bf565b61057381611bed565b61063d6117bf565b61057381611ce2565b600080828585610654611d61565b61065d83611db6565b816001600160a01b0316836001600160a01b0316148061068e5750806001600160a01b0316836001600160a01b0316145b156106c5576040517f8aa3a72f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6106cd611df6565b6106da8a8a8a8a8a611e4f565b9095509350898514610718576040517fc214279600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604080516001600160a01b038a81168252602082018890529181018690528189169188169033907f795a235be939acb902ac69562805f86e1341a9b019c351b996e2aa2dfc34c67c906060015b60405180910390a4610777600160c955565b5050509550959350505050565b61078c6117bf565b61057381611ed6565b61079d6117bf565b61057381611f53565b6107e46040518060400160405280601281526020017f726573756d65436f6e76657273696f6e28290000000000000000000000000000815250611fd0565b60fe5474010000000000000000000000000000000000000000900460ff16610837576040517e6d8dbb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fe80547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16905560405133907f89b79206f08dadd78502cff5075d2b094fa0abea0b063cfafe4475e2a380c51f90600090a2565b60008060026001600160a01b03808616600090815260fd602090815260408083209388168352929052206001015460ff1660038111156108ce576108ce613986565b03610905576040517f03410cd100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b849150600061091586868661209c565b9092509050600061092585610c18565b9050828110156109695781600181610945670de0b6b3a764000085613c08565b61094f9190613c45565b6109599190613c5d565b6109639190613c74565b93508092505b5050935093915050565b61097b6117bf565b610983611df6565b61098c83611db6565b61099582611db6565b61099e816123bd565b826109b36001600160a01b03821684846123f7565b826001600160a01b0316846001600160a01b03167f6d25be279134f4ecaa4770aff0c3d916d9e7c5ef37b65ed95dbdba411f5d54d5846040516109f891815260200190565b60405180910390a350610a0b600160c955565b505050565b60fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038481166004830152600092839291169063b62cad6990602401600060405180830381600087803b158015610a7457600080fd5b505af1158015610a88573d6000803e3d6000fd5b505060fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038781166004830152909116925063b62cad699150602401600060405180830381600087803b158015610aec57600080fd5b505af1158015610b00573d6000803e3d6000fd5b50505050610b0f85858561209c565b5094959350505050565b60fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038481166004830152600092839291169063b62cad6990602401600060405180830381600087803b158015610b7d57600080fd5b505af1158015610b91573d6000803e3d6000fd5b505060fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038781166004830152909116925063b62cad699150602401600060405180830381600087803b158015610bf557600080fd5b505af1158015610c09573d6000803e3d6000fd5b50505050610b0f858585611896565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009082906001600160a01b038216906370a0823190602401602060405180830381865afa158015610c7a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c9e9190613caf565b9392505050565b610cad6117bf565b610cb760006124be565b565b610cf76040518060400160405280601e81526020017f7365744d696e416d6f756e74546f436f6e766572742875696e74323536290000815250611fd0565b610573816124ef565b60655433906001600160a01b03168114610d875760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f74207468652060448201527f6e6577206f776e6572000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b610573816124be565b600080828585610d9e611d61565b610da783611db6565b816001600160a01b0316836001600160a01b03161480610dd85750806001600160a01b0316836001600160a01b0316145b15610e0f576040517f8aa3a72f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610e17611df6565b610e248a8a8a8a8a611e4f565b9095509350604080516001600160a01b038a81168252602082018890529181018690528189169188169033907f93b7ba2a2b0e36320375853d7466af5685c07567804b871b4fdfd31e3bb7715490606001610765565b610e82611df6565b6000610e8e8383612539565b90508015610ea157610ea183838361264e565b50610eac600160c955565b5050565b600080828585610ebe611d61565b610ec783611db6565b816001600160a01b0316836001600160a01b03161480610ef85750806001600160a01b0316836001600160a01b0316145b15610f2f576040517f8aa3a72f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610f37611df6565b610f448a8a8a8a8a612b0b565b9095509350604080516001600160a01b038a81168252602082018890529181018690528189169188169033907f9b7dc1d7d2974d015b4fc39889a09f3a3923add808f5863158f3162d997d4e8290606001610765565b610fd86040518060400160405280601181526020017f7061757365436f6e76657273696f6e2829000000000000000000000000000000815250611fd0565b610fe0611d61565b60fe80547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000017905560405133907f490bc639fd0d96f19c8adf77bc98d17fbefdee2e1e1864d21f041360d0ee065a90600090a2565b82818114611086576040517f4d5590f300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b818110156110e1576110d9878787848181106110a7576110a7613cc8565b90506020020160208101906110bc9190613835565b8686858181106110ce576110ce613cc8565b90506040020161120d565b600101611089565b50505050505050565b6000808285856110f8611d61565b61110183611db6565b816001600160a01b0316836001600160a01b031614806111325750806001600160a01b0316836001600160a01b0316145b15611169576040517f8aa3a72f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611171611df6565b61117e8a8a8a8a8a612b9d565b90955093508884146111bc576040517fa8dc653c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604080516001600160a01b038a81168252602082018890529181018690528189169188169033907fcb4ea7de8d069b0f443b792cba6c6df5096508951bbc75c04ac42c9251efe07690606001610765565b61122e60405180606001604052806035815260200161405560359139611fd0565b61123783611db6565b61124082611db6565b6706f05b59d3b2000081351115611294576040517f9770caee000000000000000000000000000000000000000000000000000000008152813560048201526706f05b59d3b200006024820152604401610d7e565b816001600160a01b0316836001600160a01b031614806112c3575061012d546001600160a01b03848116911614155b8061130b575060006001600160a01b03808416600090815260fd602090815260408083209388168352929052206001015460ff16600381111561130857611308613986565b14155b15611342576040517feebb5ac600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60026113546040830160208401613cf7565b600381111561136557611365613986565b1480156113725750803515155b156113a9576040517fd0d4aabe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60026113bb6040830160208401613cf7565b60038111156113cc576113cc613986565b14806113f8575060016113e56040830160208401613cf7565b60038111156113f6576113f6613986565b145b801561140d575060ff546001600160a01b0316155b15611444576040517fe7c2c99400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03808416600081815260fd602090815260408083209487168084529482529182902080546001820154919594937f39fbfdd5da133303ed31b1b65e30a0ddf7a9236573368c66c859dceccc1dd12a93919288359260ff909116916114b491908a01908a01613cf7565b6040516114c49493929190613d18565b60405180910390a360006114de6040840160208501613cf7565b60038111156114ef576114ef613986565b0361154c576001600160a01b03808516600090815260fd60209081526040808320938716835292905290812090815560010180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690556115a6565b813581556115606040830160208401613cf7565b6001808301805490917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00909116908360038111156115a0576115a0613986565b02179055505b50505050565b6115b46117bf565b606580546001600160a01b0383167fffffffffffffffffffffffff000000000000000000000000000000000000000090911681179091556115fd6033546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b600054610100900460ff16158080156116555750600054600160ff909116105b8061166f5750303b15801561166f575060005460ff166001145b6116e15760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610d7e565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055801561173f57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b61174883611ce2565b61175486868685612c5a565b80156117b757600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b6033546001600160a01b03163314610cb75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610d7e565b61182281611db6565b60fe546040516001600160a01b038084169216907f9be3097b5c8b276786be52a244ee90d66efd34805d9eb16f168fb2b4aaae9a2b90600090a360fe80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b600080846000036118d3576040517f42301c2300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03808516600090815260fd6020908152604080832093871683529281528282208351808501909452805484526001810154929392909183019060ff16600381111561192757611927613986565b600381111561193857611938613986565b905250905060008160200151600381111561195557611955613986565b0361198c576040517f618ce59700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b03878116600483015260009216906341976e0990602401602060405180830381865afa1580156119f0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a149190613caf565b60fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b038881166004830152929350600092909116906341976e0990602401602060405180830381865afa158015611a7d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611aa19190613caf565b835160ff54919250906000906001600160a01b031615801590611b44575060ff546040517f6c059fb10000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b0390911690636c059fb190602401602060405180830381865afa158015611b20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b449190613d49565b90508015611b5157600091505b6000611b6583670de0b6b3a7640000613c45565b905083611b728287613c08565b611b7c9190613c74565b96508115611ba85786611b97670de0b6b3a76400008d613c08565b611ba19190613c74565b9750611bdf565b86600181611bbe670de0b6b3a76400008f613c08565b611bc89190613c45565b611bd29190613c5d565b611bdc9190613c74565b97505b505050505050935093915050565b6001600160a01b038116611c695760405162461bcd60e51b815260206004820152602560248201527f696e76616c696420616365737320636f6e74726f6c206d616e6167657220616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610d7e565b609780546001600160a01b038381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa0910160405180910390a15050565b611ceb81611db6565b61012d546040516001600160a01b038084169216907f4fe44995ca2482562846e3c0413d9bd6147e9ce1881c66a8765e8542fef99f4290600090a361012d80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b60fe5474010000000000000000000000000000000000000000900460ff1615610cb7576040517f952bcf7f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038116610573576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600260c95403611e485760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610d7e565b600260c955565b600080611e5c8585612cf3565b611e668588612e13565b9150611e73828686610a10565b91505085811015611eba576040517f228f8c110000000000000000000000000000000000000000000000000000000081526004810182905260248101879052604401610d7e565b611ec5848483612f5e565b9550959350505050565b600160c955565b611edf81611db6565b60ff546040516001600160a01b038084169216907f50f1a16bf24734355b14ff800d132cc0a934808b8621d5623b41bc67f204881790600090a360ff80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b611f5c81611db6565b60fc546040516001600160a01b038084169216907f56b5f80d8cac1479698aa7d01605fd6111e90b15fc4d2b377417f46034876cbd90600090a360fc80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6097546040517f18c5e8ab0000000000000000000000000000000000000000000000000000000081526000916001600160a01b0316906318c5e8ab9061201c9033908690600401613de1565b602060405180830381865afa158015612039573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061205d9190613d49565b905080610eac573330836040517f4a3fa293000000000000000000000000000000000000000000000000000000008152600401610d7e93929190613e03565b600080846000036120d9576040517f098fb56100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03808516600090815260fd6020908152604080832093871683529281528282208351808501909452805484526001810154929392909183019060ff16600381111561212d5761212d613986565b600381111561213e5761213e613986565b905250905060008160200151600381111561215b5761215b613986565b03612192576040517f618ce59700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b03878116600483015260009216906341976e0990602401602060405180830381865afa1580156121f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061221a9190613caf565b60fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b038881166004830152929350600092909116906341976e0990602401602060405180830381865afa158015612283573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122a79190613caf565b835160ff54919250906001600160a01b031615801590612347575060ff546040517f6c059fb10000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b0390911690636c059fb190602401602060405180830381865afa158015612323573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123479190613d49565b15612350575060005b600061236482670de0b6b3a7640000613c45565b9050612378670de0b6b3a764000084613c08565b81612383868d613c08565b61238d9190613c08565b6123979190613c74565b9650826123a48286613c08565b6123ae9190613c74565b95505050505050935093915050565b80600003610573576040517f9cf8540c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040516001600160a01b038316602482015260448101829052610a0b9084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152612fc1565b606580547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055610573816130a9565b6124f8816123bd565b60fb5460408051918252602082018390527fada67d0d38fa20c8ae6a5c17cb9d60b0fe7f2d4e4f27ac9ee55e54ac88de9d8d910160405180910390a160fb55565b6040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152600090829082906001600160a01b038316906370a0823190602401602060405180830381865afa15801561259d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125c19190613caf565b61012d549093508391506001600160a01b03908116908516036126465760fe54600093506125fc906001600160a01b038481169116836123f7565b60fe546040518281526001600160a01b0386811692888216929116907fadc20ad416881f76b4304665c35f5be8592297bcdfe4f0bb087b9d254222af559060200160405180910390a45b505092915050565b600061266361012d546001600160a01b031690565b60fe5460ff549192506001600160a01b03908116916000911615612b065760ff546040517f4e9f8f390000000000000000000000000000000000000000000000000000000081526001600160a01b03878116600483015285811660248301526000928392911690634e9f8f39906044016000604051808303816000875af11580156126f2573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526127389190810190613f3c565b8151919350915060005b81811015612b015782818151811061275c5761275c613cc8565b602002602001015160000315612b0157600084828151811061278057612780613cc8565b60200260200101516001600160a01b0316636f1a30a88584815181106127a8576127a8613cc8565b60200260200101518c8b6040518463ffffffff1660e01b81526004016127ea939291909283526001600160a01b03918216602084015216604082015260600190565b60408051808303816000875af1158015612808573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061282c9190614001565b9150508881111561283a5750875b612844818b613113565b61284e5750612b01565b6040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b038881166004830152600091908a16906370a0823190602401602060405180830381865afa1580156128b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128d59190613caf565b90508a6001600160a01b031663095ea7b38785815181106128f8576128f8613cc8565b6020026020010151846040518363ffffffff1660e01b81526004016129329291906001600160a01b03929092168252602082015260400190565b6020604051808303816000875af1158015612951573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129759190613d49565b5085838151811061298857612988613cc8565b60209081029190910101516040517f439727a500000000000000000000000000000000000000000000000000000000815260048101849052600060248201526001600160a01b038d811660448301528b811660648301528a811660848301529091169063439727a59060a40160408051808303816000875af1158015612a12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a369190614001565b50506040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b038981166004830152600091908b16906370a0823190602401602060405180830381865afa158015612a9b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612abf9190613caf565b9050612acb838c613c5d565b9a50612ad78282613c5d565b612ae19089613c45565b97508a600003612af357505050612b01565b836001019350505050612742565b505050505b6117b7565b600080612b188585612cf3565b6000612b25878787610b19565b91505087811115612b6c576040517f71b5f0c10000000000000000000000000000000000000000000000000000000081526004810182905260248101899052604401610d7e565b612b768682612e13565b9250612b83838787610a10565b9250612b929050858584612f5e565b509550959350505050565b600080612baa8585612cf3565b6000612bb7878787610b19565b915050612bc48682612e13565b9250808314612bff576040517f0c5c1c2000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b87831115612c43576040517f71b5f0c10000000000000000000000000000000000000000000000000000000081526004810182905260248101899052604401610d7e565b612c4e858589612f5e565b50909694955050505050565b600054610100900460ff16612cd75760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d7e565b612ce08461324b565b612ce86132d9565b6115a683838361335e565b60ff546000906001600160a01b031615801590612d90575060ff546040517f6c059fb10000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b0390911690636c059fb190602401602060405180830381865afa158015612d6c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d909190613d49565b905080158015612ddc575060026001600160a01b03808516600090815260fd602090815260408083209387168352929052206001015460ff166003811115612dda57612dda613986565b145b15610a0b576040517f03410cd100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fe546040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b039182166004820152600091849183918316906370a0823190602401602060405180830381865afa158015612e7c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ea09190613caf565b60fe54909150612ebf906001600160a01b038481169133911687613423565b60fe546040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0391821660048201526000918416906370a0823190602401602060405180830381865afa158015612f24573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f489190613caf565b9050612f548282613c5d565b9695505050505050565b6000612f6984610c18565b905081811015612fa5576040517f6bb2792900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b83612fba6001600160a01b03821685856123f7565b5050505050565b6000613016826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166134749092919063ffffffff16565b90508051600014806130375750808060200190518101906130379190613d49565b610a0b5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610d7e565b603380546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038381166004830152600092169063b62cad6990602401600060405180830381600087803b15801561317457600080fd5b505af1158015613188573d6000803e3d6000fd5b505060fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b03868116600483015260009450670de0b6b3a76400009350879216906341976e0990602401602060405180830381865afa1580156131fc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132209190613caf565b61322a9190613c08565b6132349190613c74565b905060fb54811061324457600191505b5092915050565b600054610100900460ff166132c85760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d7e565b6132d061348b565b61057381613510565b600054610100900460ff166133565760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d7e565b610cb761358d565b600054610100900460ff166133db5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d7e565b6133e483611f53565b6133ed82611819565b6133f6816124ef565b505060fe80547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16905550565b6040516001600160a01b03808516602483015283166044820152606481018290526115a69085907f23b872dd000000000000000000000000000000000000000000000000000000009060840161243c565b6060613483848460008561360a565b949350505050565b600054610100900460ff166135085760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d7e565b610cb76136fc565b600054610100900460ff1661062c5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d7e565b600054610100900460ff16611ecf5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d7e565b6060824710156136825760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610d7e565b600080866001600160a01b0316858760405161369e9190614025565b60006040518083038185875af1925050503d80600081146136db576040519150601f19603f3d011682016040523d82523d6000602084013e6136e0565b606091505b50915091506136f187838387613782565b979650505050505050565b600054610100900460ff166137795760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d7e565b610cb7336124be565b606083156137f15782516000036137ea576001600160a01b0385163b6137ea5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610d7e565b5081613483565b61348383838151156138065781518083602001fd5b8060405162461bcd60e51b8152600401610d7e9190614041565b6001600160a01b038116811461057357600080fd5b60006020828403121561384757600080fd5b8135610c9e81613820565b60008060006060848603121561386757600080fd5b83359250602084013561387981613820565b9150604084013561388981613820565b809150509250925092565b600080600080600060a086880312156138ac57600080fd5b853594506020860135935060408601356138c581613820565b925060608601356138d581613820565b915060808601356138e581613820565b809150509295509295909350565b60008060006060848603121561390857600080fd5b833561391381613820565b9250602084013561392381613820565b929592945050506040919091013590565b60006020828403121561394657600080fd5b5035919050565b6000806040838503121561396057600080fd5b823561396b81613820565b9150602083013561397b81613820565b809150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600481106139ec577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b9052565b82815260408101610c9e60208301846139b5565b60008083601f840112613a1657600080fd5b50813567ffffffffffffffff811115613a2e57600080fd5b6020830191508360208260061b8501011115613a4957600080fd5b9250929050565b600080600080600060608688031215613a6857600080fd5b8535613a7381613820565b9450602086013567ffffffffffffffff80821115613a9057600080fd5b818801915088601f830112613aa457600080fd5b813581811115613ab357600080fd5b8960208260051b8501011115613ac857600080fd5b602083019650809550506040880135915080821115613ae657600080fd5b50613af388828901613a04565b969995985093965092949392505050565b60008060008385036080811215613b1a57600080fd5b8435613b2581613820565b93506020850135613b3581613820565b925060407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc082011215613b6757600080fd5b506040840190509250925092565b600080600080600060a08688031215613b8d57600080fd5b8535613b9881613820565b94506020860135613ba881613820565b93506040860135613bb881613820565b92506060860135613bc881613820565b949793965091946080013592915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613c4057613c40613bd9565b500290565b60008219821115613c5857613c58613bd9565b500190565b600082821015613c6f57613c6f613bd9565b500390565b600082613caa577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b600060208284031215613cc157600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060208284031215613d0957600080fd5b813560048110610c9e57600080fd5b8481526020810184905260808101613d3360408301856139b5565b613d4060608301846139b5565b95945050505050565b600060208284031215613d5b57600080fd5b81518015158114610c9e57600080fd5b60005b83811015613d86578181015183820152602001613d6e565b838111156115a65750506000910152565b60008151808452613daf816020860160208601613d6b565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6001600160a01b03831681526040602082015260006134836040830184613d97565b60006001600160a01b03808616835280851660208401525060606040830152613d406060830184613d97565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715613ea557613ea5613e2f565b604052919050565b600067ffffffffffffffff821115613ec757613ec7613e2f565b5060051b60200190565b600082601f830112613ee257600080fd5b81516020613ef7613ef283613ead565b613e5e565b82815260059290921b84018101918181019086841115613f1657600080fd5b8286015b84811015613f315780518352918301918301613f1a565b509695505050505050565b60008060408385031215613f4f57600080fd5b825167ffffffffffffffff80821115613f6757600080fd5b818501915085601f830112613f7b57600080fd5b81516020613f8b613ef283613ead565b82815260059290921b84018101918181019089841115613faa57600080fd5b948201945b83861015613fd1578551613fc281613820565b82529482019490820190613faf565b91880151919650909350505080821115613fea57600080fd5b50613ff785828601613ed1565b9150509250929050565b6000806040838503121561401457600080fd5b505080516020909101519092909150565b60008251614037818460208701613d6b565b9190910192915050565b602081526000610c9e6020830184613d9756fe736574436f6e76657273696f6e436f6e66696728616464726573732c616464726573732c436f6e76657273696f6e436f6e66696729a2646970667358221220a04acd5d02eeb8911e2a4fe28bd53f1481291334e654b0618600b13dc59cea2f64736f6c634300080d0033", + "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061025c5760003560e01c806379ba509711610145578063ca325469116100bd578063f04c31871161008c578063f2fde38b11610071578063f2fde38b14610533578063f7013ef614610546578063fe3da9841461055957600080fd5b8063f04c31871461050d578063f0dc7e9d1461052057600080fd5b8063ca325469146104c6578063cdf456e1146104d9578063e2ff7ea2146104ed578063e30c3978146104fc57600080fd5b8063b491ddf711610114578063b6828c57116100f9578063b6828c5714610498578063bc368b04146104ab578063c0654646146104b357600080fd5b8063b491ddf714610444578063b4a0bdf31461048757600080fd5b806379ba5097146104055780638da5cb5b1461040d57806390fa7b541461041e578063aac59a751461043157600080fd5b8063530e784f116101d85780636daa463b116101a757806370a082311161018c57806370a08231146103c9578063715018a6146103ea578063746460a9146103f257600080fd5b80636daa463b146103a35780636f1a30a8146103b657600080fd5b8063530e784f1461036257806358b904df146103755780635e1e63251461037d57806364aff9ec1461039057600080fd5b80630e32cb861161022f5780633606b26c116102145780633606b26c14610329578063439727a51461033c57806352e21a181461034f57600080fd5b80630e32cb86146103035780632630c12f1461031657600080fd5b806301e201781461026157806307aa239e146102915780630a0a05e6146102c65780630a9a2b72146102db575b600080fd5b60ff54610274906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b60fe546102b69074010000000000000000000000000000000000000000900460ff1681565b6040519015158152602001610288565b6102d96102d4366004613835565b610562565b005b6102ee6102e9366004613852565b610576565b60408051928352602083019190915201610288565b6102d9610311366004613835565b610624565b60fc54610274906001600160a01b031681565b6102d9610337366004613835565b610635565b6102ee61034a366004613894565b610646565b6102d961035d366004613835565b610784565b6102d9610370366004613835565b610795565b6102d96107a6565b6102ee61038b366004613852565b61088c565b6102d961039e3660046138f3565b610973565b6102ee6103b1366004613852565b610a10565b6102ee6103c4366004613852565b610b19565b6103dc6103d7366004613835565b610c18565b604051908152602001610288565b6102d9610ca5565b6102d9610400366004613934565b610cb9565b6102d9610d00565b6033546001600160a01b0316610274565b6102ee61042c366004613894565b610d90565b6102d961043f36600461394d565b610e7a565b61047961045236600461394d565b60fd6020908152600092835260408084209091529082529020805460019091015460ff1682565b6040516102889291906139f0565b6097546001600160a01b0316610274565b6102ee6104a6366004613894565b610eb0565b6102d9610f9a565b6102d96104c1366004613a50565b61104c565b60fe54610274906001600160a01b031681565b61012d54610274906001600160a01b031681565b6103dc6706f05b59d3b2000081565b6065546001600160a01b0316610274565b6102ee61051b366004613894565b6110ea565b6102d961052e366004613b04565b61120d565b6102d9610541366004613835565b6115ac565b6102d9610554366004613b75565b611635565b6103dc60fb5481565b61056a6117bf565b61057381611819565b50565b60008060026001600160a01b03808616600090815260fd602090815260408083209388168352929052206001015460ff1660038111156105b8576105b8613986565b036105ef576040517f03410cd100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006105fa84610c18565b905085811015610608578095505b859250610616868686611896565b508092505050935093915050565b61062c6117bf565b61057381611bed565b61063d6117bf565b61057381611ce2565b600080828585610654611d61565b61065d83611db6565b816001600160a01b0316836001600160a01b0316148061068e5750806001600160a01b0316836001600160a01b0316145b156106c5576040517f8aa3a72f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6106cd611df6565b6106da8a8a8a8a8a611e4f565b9095509350898514610718576040517fc214279600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604080516001600160a01b038a81168252602082018890529181018690528189169188169033907f795a235be939acb902ac69562805f86e1341a9b019c351b996e2aa2dfc34c67c906060015b60405180910390a4610777600160c955565b5050509550959350505050565b61078c6117bf565b61057381611ed6565b61079d6117bf565b61057381611f53565b6107e46040518060400160405280601281526020017f726573756d65436f6e76657273696f6e28290000000000000000000000000000815250611fd0565b60fe5474010000000000000000000000000000000000000000900460ff16610837576040517e6d8dbb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fe80547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16905560405133907f89b79206f08dadd78502cff5075d2b094fa0abea0b063cfafe4475e2a380c51f90600090a2565b60008060026001600160a01b03808616600090815260fd602090815260408083209388168352929052206001015460ff1660038111156108ce576108ce613986565b03610905576040517f03410cd100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b849150600061091586868661209c565b9092509050600061092585610c18565b9050828110156109695781600181610945670de0b6b3a764000085613c08565b61094f9190613c45565b6109599190613c5d565b6109639190613c74565b93508092505b5050935093915050565b61097b6117bf565b610983611df6565b61098c83611db6565b61099582611db6565b61099e816123bd565b826109b36001600160a01b03821684846123f7565b826001600160a01b0316846001600160a01b03167f6d25be279134f4ecaa4770aff0c3d916d9e7c5ef37b65ed95dbdba411f5d54d5846040516109f891815260200190565b60405180910390a350610a0b600160c955565b505050565b60fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038481166004830152600092839291169063b62cad6990602401600060405180830381600087803b158015610a7457600080fd5b505af1158015610a88573d6000803e3d6000fd5b505060fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038781166004830152909116925063b62cad699150602401600060405180830381600087803b158015610aec57600080fd5b505af1158015610b00573d6000803e3d6000fd5b50505050610b0f85858561209c565b5094959350505050565b60fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038481166004830152600092839291169063b62cad6990602401600060405180830381600087803b158015610b7d57600080fd5b505af1158015610b91573d6000803e3d6000fd5b505060fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038781166004830152909116925063b62cad699150602401600060405180830381600087803b158015610bf557600080fd5b505af1158015610c09573d6000803e3d6000fd5b50505050610b0f858585611896565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009082906001600160a01b038216906370a0823190602401602060405180830381865afa158015610c7a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c9e9190613caf565b9392505050565b610cad6117bf565b610cb760006124be565b565b610cf76040518060400160405280601e81526020017f7365744d696e416d6f756e74546f436f6e766572742875696e74323536290000815250611fd0565b610573816124ef565b60655433906001600160a01b03168114610d875760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f74207468652060448201527f6e6577206f776e6572000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b610573816124be565b600080828585610d9e611d61565b610da783611db6565b816001600160a01b0316836001600160a01b03161480610dd85750806001600160a01b0316836001600160a01b0316145b15610e0f576040517f8aa3a72f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610e17611df6565b610e248a8a8a8a8a611e4f565b9095509350604080516001600160a01b038a81168252602082018890529181018690528189169188169033907f93b7ba2a2b0e36320375853d7466af5685c07567804b871b4fdfd31e3bb7715490606001610765565b610e82611df6565b6000610e8e8383612539565b90508015610ea157610ea183838361264e565b50610eac600160c955565b5050565b600080828585610ebe611d61565b610ec783611db6565b816001600160a01b0316836001600160a01b03161480610ef85750806001600160a01b0316836001600160a01b0316145b15610f2f576040517f8aa3a72f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610f37611df6565b610f448a8a8a8a8a612b0b565b9095509350604080516001600160a01b038a81168252602082018890529181018690528189169188169033907f9b7dc1d7d2974d015b4fc39889a09f3a3923add808f5863158f3162d997d4e8290606001610765565b610fd86040518060400160405280601181526020017f7061757365436f6e76657273696f6e2829000000000000000000000000000000815250611fd0565b610fe0611d61565b60fe80547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000017905560405133907f490bc639fd0d96f19c8adf77bc98d17fbefdee2e1e1864d21f041360d0ee065a90600090a2565b82818114611086576040517f4d5590f300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b818110156110e1576110d9878787848181106110a7576110a7613cc8565b90506020020160208101906110bc9190613835565b8686858181106110ce576110ce613cc8565b90506040020161120d565b600101611089565b50505050505050565b6000808285856110f8611d61565b61110183611db6565b816001600160a01b0316836001600160a01b031614806111325750806001600160a01b0316836001600160a01b0316145b15611169576040517f8aa3a72f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611171611df6565b61117e8a8a8a8a8a612b9d565b90955093508884146111bc576040517fa8dc653c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604080516001600160a01b038a81168252602082018890529181018690528189169188169033907fcb4ea7de8d069b0f443b792cba6c6df5096508951bbc75c04ac42c9251efe07690606001610765565b61122e60405180606001604052806035815260200161405560359139611fd0565b61123783611db6565b61124082611db6565b6706f05b59d3b2000081351115611294576040517f9770caee000000000000000000000000000000000000000000000000000000008152813560048201526706f05b59d3b200006024820152604401610d7e565b816001600160a01b0316836001600160a01b031614806112c3575061012d546001600160a01b03848116911614155b8061130b575060006001600160a01b03808416600090815260fd602090815260408083209388168352929052206001015460ff16600381111561130857611308613986565b14155b15611342576040517feebb5ac600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60026113546040830160208401613cf7565b600381111561136557611365613986565b1480156113725750803515155b156113a9576040517fd0d4aabe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60026113bb6040830160208401613cf7565b60038111156113cc576113cc613986565b14806113f8575060016113e56040830160208401613cf7565b60038111156113f6576113f6613986565b145b801561140d575060ff546001600160a01b0316155b15611444576040517fe7c2c99400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03808416600081815260fd602090815260408083209487168084529482529182902080546001820154919594937f39fbfdd5da133303ed31b1b65e30a0ddf7a9236573368c66c859dceccc1dd12a93919288359260ff909116916114b491908a01908a01613cf7565b6040516114c49493929190613d18565b60405180910390a360006114de6040840160208501613cf7565b60038111156114ef576114ef613986565b0361154c576001600160a01b03808516600090815260fd60209081526040808320938716835292905290812090815560010180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690556115a6565b813581556115606040830160208401613cf7565b6001808301805490917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00909116908360038111156115a0576115a0613986565b02179055505b50505050565b6115b46117bf565b606580546001600160a01b0383167fffffffffffffffffffffffff000000000000000000000000000000000000000090911681179091556115fd6033546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b600054610100900460ff16158080156116555750600054600160ff909116105b8061166f5750303b15801561166f575060005460ff166001145b6116e15760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610d7e565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055801561173f57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b61174883611ce2565b61175486868685612c5a565b80156117b757600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b6033546001600160a01b03163314610cb75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610d7e565b61182281611db6565b60fe546040516001600160a01b038084169216907f9be3097b5c8b276786be52a244ee90d66efd34805d9eb16f168fb2b4aaae9a2b90600090a360fe80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b600080846000036118d3576040517f42301c2300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03808516600090815260fd6020908152604080832093871683529281528282208351808501909452805484526001810154929392909183019060ff16600381111561192757611927613986565b600381111561193857611938613986565b905250905060008160200151600381111561195557611955613986565b0361198c576040517f618ce59700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b03878116600483015260009216906341976e0990602401602060405180830381865afa1580156119f0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a149190613caf565b60fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b038881166004830152929350600092909116906341976e0990602401602060405180830381865afa158015611a7d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611aa19190613caf565b835160ff54919250906000906001600160a01b031615801590611b44575060ff546040517f6c059fb10000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b0390911690636c059fb190602401602060405180830381865afa158015611b20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b449190613d49565b90508015611b5157600091505b6000611b6583670de0b6b3a7640000613c45565b905083611b728287613c08565b611b7c9190613c74565b96508115611ba85786611b97670de0b6b3a76400008d613c08565b611ba19190613c74565b9750611bdf565b86600181611bbe670de0b6b3a76400008f613c08565b611bc89190613c45565b611bd29190613c5d565b611bdc9190613c74565b97505b505050505050935093915050565b6001600160a01b038116611c695760405162461bcd60e51b815260206004820152602560248201527f696e76616c696420616365737320636f6e74726f6c206d616e6167657220616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610d7e565b609780546001600160a01b038381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa0910160405180910390a15050565b611ceb81611db6565b61012d546040516001600160a01b038084169216907f4fe44995ca2482562846e3c0413d9bd6147e9ce1881c66a8765e8542fef99f4290600090a361012d80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b60fe5474010000000000000000000000000000000000000000900460ff1615610cb7576040517f952bcf7f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038116610573576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600260c95403611e485760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610d7e565b600260c955565b600080611e5c8585612cf3565b611e668588612e13565b9150611e73828686610a10565b91505085811015611eba576040517f228f8c110000000000000000000000000000000000000000000000000000000081526004810182905260248101879052604401610d7e565b611ec5848483612f5e565b9550959350505050565b600160c955565b611edf81611db6565b60ff546040516001600160a01b038084169216907f50f1a16bf24734355b14ff800d132cc0a934808b8621d5623b41bc67f204881790600090a360ff80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b611f5c81611db6565b60fc546040516001600160a01b038084169216907f56b5f80d8cac1479698aa7d01605fd6111e90b15fc4d2b377417f46034876cbd90600090a360fc80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6097546040517f18c5e8ab0000000000000000000000000000000000000000000000000000000081526000916001600160a01b0316906318c5e8ab9061201c9033908690600401613de1565b602060405180830381865afa158015612039573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061205d9190613d49565b905080610eac573330836040517f4a3fa293000000000000000000000000000000000000000000000000000000008152600401610d7e93929190613e03565b600080846000036120d9576040517f098fb56100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03808516600090815260fd6020908152604080832093871683529281528282208351808501909452805484526001810154929392909183019060ff16600381111561212d5761212d613986565b600381111561213e5761213e613986565b905250905060008160200151600381111561215b5761215b613986565b03612192576040517f618ce59700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b03878116600483015260009216906341976e0990602401602060405180830381865afa1580156121f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061221a9190613caf565b60fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b038881166004830152929350600092909116906341976e0990602401602060405180830381865afa158015612283573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122a79190613caf565b835160ff54919250906001600160a01b031615801590612347575060ff546040517f6c059fb10000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b0390911690636c059fb190602401602060405180830381865afa158015612323573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123479190613d49565b15612350575060005b600061236482670de0b6b3a7640000613c45565b9050612378670de0b6b3a764000084613c08565b81612383868d613c08565b61238d9190613c08565b6123979190613c74565b9650826123a48286613c08565b6123ae9190613c74565b95505050505050935093915050565b80600003610573576040517f9cf8540c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040516001600160a01b038316602482015260448101829052610a0b9084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152612fc1565b606580547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055610573816130a9565b6124f8816123bd565b60fb5460408051918252602082018390527fada67d0d38fa20c8ae6a5c17cb9d60b0fe7f2d4e4f27ac9ee55e54ac88de9d8d910160405180910390a160fb55565b6040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152600090829082906001600160a01b038316906370a0823190602401602060405180830381865afa15801561259d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125c19190613caf565b61012d549093508391506001600160a01b03908116908516036126465760fe54600093506125fc906001600160a01b038481169116836123f7565b60fe546040518281526001600160a01b0386811692888216929116907fadc20ad416881f76b4304665c35f5be8592297bcdfe4f0bb087b9d254222af559060200160405180910390a45b505092915050565b600061266361012d546001600160a01b031690565b60fe5460ff549192506001600160a01b03908116916000911615612b065760ff546040517f4e9f8f390000000000000000000000000000000000000000000000000000000081526001600160a01b03878116600483015285811660248301526000928392911690634e9f8f39906044016000604051808303816000875af11580156126f2573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526127389190810190613f3c565b8151919350915060005b81811015612b015782818151811061275c5761275c613cc8565b602002602001015160000315612b0157600084828151811061278057612780613cc8565b60200260200101516001600160a01b0316636f1a30a88584815181106127a8576127a8613cc8565b60200260200101518c8b6040518463ffffffff1660e01b81526004016127ea939291909283526001600160a01b03918216602084015216604082015260600190565b60408051808303816000875af1158015612808573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061282c9190614001565b9150508881111561283a5750875b612844818b613113565b61284e5750612b01565b6040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b038881166004830152600091908a16906370a0823190602401602060405180830381865afa1580156128b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128d59190613caf565b90508a6001600160a01b031663095ea7b38785815181106128f8576128f8613cc8565b6020026020010151846040518363ffffffff1660e01b81526004016129329291906001600160a01b03929092168252602082015260400190565b6020604051808303816000875af1158015612951573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129759190613d49565b5085838151811061298857612988613cc8565b60209081029190910101516040517f439727a500000000000000000000000000000000000000000000000000000000815260048101849052600060248201526001600160a01b038d811660448301528b811660648301528a811660848301529091169063439727a59060a40160408051808303816000875af1158015612a12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a369190614001565b50506040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b038981166004830152600091908b16906370a0823190602401602060405180830381865afa158015612a9b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612abf9190613caf565b9050612acb838c613c5d565b9a50612ad78282613c5d565b612ae19089613c45565b97508a600003612af357505050612b01565b836001019350505050612742565b505050505b6117b7565b600080612b188585612cf3565b6000612b25878787610b19565b91505087811115612b6c576040517f71b5f0c10000000000000000000000000000000000000000000000000000000081526004810182905260248101899052604401610d7e565b612b768682612e13565b9250612b83838787610a10565b9250612b929050858584612f5e565b509550959350505050565b600080612baa8585612cf3565b6000612bb7878787610b19565b915050612bc48682612e13565b9250808314612bff576040517f0c5c1c2000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b87831115612c43576040517f71b5f0c10000000000000000000000000000000000000000000000000000000081526004810182905260248101899052604401610d7e565b612c4e858589612f5e565b50909694955050505050565b600054610100900460ff16612cd75760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d7e565b612ce08461324b565b612ce86132d9565b6115a683838361335e565b60ff546000906001600160a01b031615801590612d90575060ff546040517f6c059fb10000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b0390911690636c059fb190602401602060405180830381865afa158015612d6c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d909190613d49565b905080158015612ddc575060026001600160a01b03808516600090815260fd602090815260408083209387168352929052206001015460ff166003811115612dda57612dda613986565b145b15610a0b576040517f03410cd100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fe546040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b039182166004820152600091849183918316906370a0823190602401602060405180830381865afa158015612e7c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ea09190613caf565b60fe54909150612ebf906001600160a01b038481169133911687613423565b60fe546040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0391821660048201526000918416906370a0823190602401602060405180830381865afa158015612f24573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f489190613caf565b9050612f548282613c5d565b9695505050505050565b6000612f6984610c18565b905081811015612fa5576040517f6bb2792900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b83612fba6001600160a01b03821685856123f7565b5050505050565b6000613016826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166134749092919063ffffffff16565b90508051600014806130375750808060200190518101906130379190613d49565b610a0b5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610d7e565b603380546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038381166004830152600092169063b62cad6990602401600060405180830381600087803b15801561317457600080fd5b505af1158015613188573d6000803e3d6000fd5b505060fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b03868116600483015260009450670de0b6b3a76400009350879216906341976e0990602401602060405180830381865afa1580156131fc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132209190613caf565b61322a9190613c08565b6132349190613c74565b905060fb54811061324457600191505b5092915050565b600054610100900460ff166132c85760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d7e565b6132d061348b565b61057381613510565b600054610100900460ff166133565760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d7e565b610cb761358d565b600054610100900460ff166133db5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d7e565b6133e483611f53565b6133ed82611819565b6133f6816124ef565b505060fe80547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16905550565b6040516001600160a01b03808516602483015283166044820152606481018290526115a69085907f23b872dd000000000000000000000000000000000000000000000000000000009060840161243c565b6060613483848460008561360a565b949350505050565b600054610100900460ff166135085760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d7e565b610cb76136fc565b600054610100900460ff1661062c5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d7e565b600054610100900460ff16611ecf5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d7e565b6060824710156136825760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610d7e565b600080866001600160a01b0316858760405161369e9190614025565b60006040518083038185875af1925050503d80600081146136db576040519150601f19603f3d011682016040523d82523d6000602084013e6136e0565b606091505b50915091506136f187838387613782565b979650505050505050565b600054610100900460ff166137795760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d7e565b610cb7336124be565b606083156137f15782516000036137ea576001600160a01b0385163b6137ea5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610d7e565b5081613483565b61348383838151156138065781518083602001fd5b8060405162461bcd60e51b8152600401610d7e9190614041565b6001600160a01b038116811461057357600080fd5b60006020828403121561384757600080fd5b8135610c9e81613820565b60008060006060848603121561386757600080fd5b83359250602084013561387981613820565b9150604084013561388981613820565b809150509250925092565b600080600080600060a086880312156138ac57600080fd5b853594506020860135935060408601356138c581613820565b925060608601356138d581613820565b915060808601356138e581613820565b809150509295509295909350565b60008060006060848603121561390857600080fd5b833561391381613820565b9250602084013561392381613820565b929592945050506040919091013590565b60006020828403121561394657600080fd5b5035919050565b6000806040838503121561396057600080fd5b823561396b81613820565b9150602083013561397b81613820565b809150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600481106139ec577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b9052565b82815260408101610c9e60208301846139b5565b60008083601f840112613a1657600080fd5b50813567ffffffffffffffff811115613a2e57600080fd5b6020830191508360208260061b8501011115613a4957600080fd5b9250929050565b600080600080600060608688031215613a6857600080fd5b8535613a7381613820565b9450602086013567ffffffffffffffff80821115613a9057600080fd5b818801915088601f830112613aa457600080fd5b813581811115613ab357600080fd5b8960208260051b8501011115613ac857600080fd5b602083019650809550506040880135915080821115613ae657600080fd5b50613af388828901613a04565b969995985093965092949392505050565b60008060008385036080811215613b1a57600080fd5b8435613b2581613820565b93506020850135613b3581613820565b925060407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc082011215613b6757600080fd5b506040840190509250925092565b600080600080600060a08688031215613b8d57600080fd5b8535613b9881613820565b94506020860135613ba881613820565b93506040860135613bb881613820565b92506060860135613bc881613820565b949793965091946080013592915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613c4057613c40613bd9565b500290565b60008219821115613c5857613c58613bd9565b500190565b600082821015613c6f57613c6f613bd9565b500390565b600082613caa577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b600060208284031215613cc157600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060208284031215613d0957600080fd5b813560048110610c9e57600080fd5b8481526020810184905260808101613d3360408301856139b5565b613d4060608301846139b5565b95945050505050565b600060208284031215613d5b57600080fd5b81518015158114610c9e57600080fd5b60005b83811015613d86578181015183820152602001613d6e565b838111156115a65750506000910152565b60008151808452613daf816020860160208601613d6b565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6001600160a01b03831681526040602082015260006134836040830184613d97565b60006001600160a01b03808616835280851660208401525060606040830152613d406060830184613d97565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715613ea557613ea5613e2f565b604052919050565b600067ffffffffffffffff821115613ec757613ec7613e2f565b5060051b60200190565b600082601f830112613ee257600080fd5b81516020613ef7613ef283613ead565b613e5e565b82815260059290921b84018101918181019086841115613f1657600080fd5b8286015b84811015613f315780518352918301918301613f1a565b509695505050505050565b60008060408385031215613f4f57600080fd5b825167ffffffffffffffff80821115613f6757600080fd5b818501915085601f830112613f7b57600080fd5b81516020613f8b613ef283613ead565b82815260059290921b84018101918181019089841115613faa57600080fd5b948201945b83861015613fd1578551613fc281613820565b82529482019490820190613faf565b91880151919650909350505080821115613fea57600080fd5b50613ff785828601613ed1565b9150509250929050565b6000806040838503121561401457600080fd5b505080516020909101519092909150565b60008251614037818460208701613d6b565b9190910192915050565b602081526000610c9e6020830184613d9756fe736574436f6e76657273696f6e436f6e66696728616464726573732c616464726573732c436f6e76657273696f6e436f6e66696729a2646970667358221220a04acd5d02eeb8911e2a4fe28bd53f1481291334e654b0618600b13dc59cea2f64736f6c634300080d0033", "devdoc": { "author": "Venus", "custom:security-contact": "https://github.com/VenusProtocol/protocol-reserve#discussion", @@ -1548,6 +1548,7 @@ "initialize(address,address,address,address,uint256)": { "params": { "accessControlManager_": "Access control manager contract address", + "baseAsset_": "Address of the base asset", "destinationAddress_": "Address at all incoming tokens will transferred to", "minAmountToConvert_": "Minimum amount to convert", "priceOracle_": "Resilient oracle address" @@ -1854,7 +1855,7 @@ "notice": "To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut. This function does not account for potential token transfer fees(in case of deflationary tokens)" }, "getAmountOut(uint256,address,address)": { - "notice": "To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn. This function does not account for potential token transfer fees(in case of deflationary tokens)" + "notice": "To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn. This function does not account for potential token transfer fees(in case of deflationary tokens)The amountInMantissa might be adjusted if amountOutMantissa is greater than the balance of the contract for tokenAddressOut" }, "getUpdatedAmountIn(uint256,address,address)": { "notice": "To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut" @@ -2020,7 +2021,7 @@ "label": "conversionConfigurations", "offset": 0, "slot": "253", - "type": "t_mapping(t_address,t_mapping(t_address,t_struct(ConversionConfig)5463_storage))" + "type": "t_mapping(t_address,t_mapping(t_address,t_struct(ConversionConfig)5478_storage))" }, { "astId": 3371, @@ -2055,7 +2056,7 @@ "type": "t_array(t_uint256)45_storage" }, { - "astId": 6813, + "astId": 6828, "contract": "contracts/TokenConverter/SingleTokenConverter.sol:SingleTokenConverter", "label": "baseAsset", "offset": 0, @@ -2107,31 +2108,31 @@ "label": "contract ResilientOracle", "numberOfBytes": "20" }, - "t_enum(ConversionAccessibility)5455": { + "t_enum(ConversionAccessibility)5470": { "encoding": "inplace", "label": "enum IAbstractTokenConverter.ConversionAccessibility", "numberOfBytes": "1" }, - "t_mapping(t_address,t_mapping(t_address,t_struct(ConversionConfig)5463_storage))": { + "t_mapping(t_address,t_mapping(t_address,t_struct(ConversionConfig)5478_storage))": { "encoding": "mapping", "key": "t_address", "label": "mapping(address => mapping(address => struct IAbstractTokenConverter.ConversionConfig))", "numberOfBytes": "32", - "value": "t_mapping(t_address,t_struct(ConversionConfig)5463_storage)" + "value": "t_mapping(t_address,t_struct(ConversionConfig)5478_storage)" }, - "t_mapping(t_address,t_struct(ConversionConfig)5463_storage)": { + "t_mapping(t_address,t_struct(ConversionConfig)5478_storage)": { "encoding": "mapping", "key": "t_address", "label": "mapping(address => struct IAbstractTokenConverter.ConversionConfig)", "numberOfBytes": "32", - "value": "t_struct(ConversionConfig)5463_storage" + "value": "t_struct(ConversionConfig)5478_storage" }, - "t_struct(ConversionConfig)5463_storage": { + "t_struct(ConversionConfig)5478_storage": { "encoding": "inplace", "label": "struct IAbstractTokenConverter.ConversionConfig", "members": [ { - "astId": 5458, + "astId": 5473, "contract": "contracts/TokenConverter/SingleTokenConverter.sol:SingleTokenConverter", "label": "incentive", "offset": 0, @@ -2139,12 +2140,12 @@ "type": "t_uint256" }, { - "astId": 5462, + "astId": 5477, "contract": "contracts/TokenConverter/SingleTokenConverter.sol:SingleTokenConverter", "label": "conversionAccess", "offset": 0, "slot": "1", - "type": "t_enum(ConversionAccessibility)5455" + "type": "t_enum(ConversionAccessibility)5470" } ], "numberOfBytes": "64" diff --git a/deployments/bsctestnet/solcInputs/e9f683aad829bf9574e4eef6b067ab3e.json b/deployments/bsctestnet/solcInputs/e9f683aad829bf9574e4eef6b067ab3e.json new file mode 100644 index 00000000..46bd1909 --- /dev/null +++ b/deployments/bsctestnet/solcInputs/e9f683aad829bf9574e4eef6b067ab3e.json @@ -0,0 +1,123 @@ +{ + "language": "Solidity", + "sources": { + "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable2Step.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./OwnableUpgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which provides access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership} and {acceptOwnership}.\n *\n * This module is used through inheritance. It will make available all functions\n * from parent (Ownable).\n */\nabstract contract Ownable2StepUpgradeable is Initializable, OwnableUpgradeable {\n function __Ownable2Step_init() internal onlyInitializing {\n __Ownable_init_unchained();\n }\n\n function __Ownable2Step_init_unchained() internal onlyInitializing {\n }\n address private _pendingOwner;\n\n event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Returns the address of the pending owner.\n */\n function pendingOwner() public view virtual returns (address) {\n return _pendingOwner;\n }\n\n /**\n * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual override onlyOwner {\n _pendingOwner = newOwner;\n emit OwnershipTransferStarted(owner(), newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual override {\n delete _pendingOwner;\n super._transferOwnership(newOwner);\n }\n\n /**\n * @dev The new owner accepts the ownership transfer.\n */\n function acceptOwnership() public virtual {\n address sender = _msgSender();\n require(pendingOwner() == sender, \"Ownable2Step: caller is not the new owner\");\n _transferOwnership(sender);\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/ContextUpgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n function __Ownable_init() internal onlyInitializing {\n __Ownable_init_unchained();\n }\n\n function __Ownable_init_unchained() internal onlyInitializing {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby disabling any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../../utils/AddressUpgradeable.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```solidity\n * contract MyToken is ERC20Upgradeable {\n * function initialize() initializer public {\n * __ERC20_init(\"MyToken\", \"MTK\");\n * }\n * }\n *\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n * function initializeV2() reinitializer(2) public {\n * __ERC20Permit_init(\"MyToken\");\n * }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n * _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n /**\n * @dev Indicates that the contract has been initialized.\n * @custom:oz-retyped-from bool\n */\n uint8 private _initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private _initializing;\n\n /**\n * @dev Triggered when the contract has been initialized or reinitialized.\n */\n event Initialized(uint8 version);\n\n /**\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n * `onlyInitializing` functions can be used to initialize parent contracts.\n *\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\n * constructor.\n *\n * Emits an {Initialized} event.\n */\n modifier initializer() {\n bool isTopLevelCall = !_initializing;\n require(\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\n \"Initializable: contract is already initialized\"\n );\n _initialized = 1;\n if (isTopLevelCall) {\n _initializing = true;\n }\n _;\n if (isTopLevelCall) {\n _initializing = false;\n emit Initialized(1);\n }\n }\n\n /**\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n * used to initialize parent contracts.\n *\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n * are added through upgrades and that require initialization.\n *\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n * cannot be nested. If one is invoked in the context of another, execution will revert.\n *\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n * a contract, executing them in the right order is up to the developer or operator.\n *\n * WARNING: setting the version to 255 will prevent any future reinitialization.\n *\n * Emits an {Initialized} event.\n */\n modifier reinitializer(uint8 version) {\n require(!_initializing && _initialized < version, \"Initializable: contract is already initialized\");\n _initialized = version;\n _initializing = true;\n _;\n _initializing = false;\n emit Initialized(version);\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, \"Initializable: contract is not initializing\");\n _;\n }\n\n /**\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n * through proxies.\n *\n * Emits an {Initialized} event the first time it is successfully executed.\n */\n function _disableInitializers() internal virtual {\n require(!_initializing, \"Initializable: contract is initializing\");\n if (_initialized != type(uint8).max) {\n _initialized = type(uint8).max;\n emit Initialized(type(uint8).max);\n }\n }\n\n /**\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\n */\n function _getInitializedVersion() internal view returns (uint8) {\n return _initialized;\n }\n\n /**\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\n */\n function _isInitializing() internal view returns (bool) {\n return _initializing;\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/ContextUpgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract PausableUpgradeable is Initializable, ContextUpgradeable {\n /**\n * @dev Emitted when the pause is triggered by `account`.\n */\n event Paused(address account);\n\n /**\n * @dev Emitted when the pause is lifted by `account`.\n */\n event Unpaused(address account);\n\n bool private _paused;\n\n /**\n * @dev Initializes the contract in unpaused state.\n */\n function __Pausable_init() internal onlyInitializing {\n __Pausable_init_unchained();\n }\n\n function __Pausable_init_unchained() internal onlyInitializing {\n _paused = false;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is not paused.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n modifier whenNotPaused() {\n _requireNotPaused();\n _;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is paused.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n modifier whenPaused() {\n _requirePaused();\n _;\n }\n\n /**\n * @dev Returns true if the contract is paused, and false otherwise.\n */\n function paused() public view virtual returns (bool) {\n return _paused;\n }\n\n /**\n * @dev Throws if the contract is paused.\n */\n function _requireNotPaused() internal view virtual {\n require(!paused(), \"Pausable: paused\");\n }\n\n /**\n * @dev Throws if the contract is not paused.\n */\n function _requirePaused() internal view virtual {\n require(paused(), \"Pausable: not paused\");\n }\n\n /**\n * @dev Triggers stopped state.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n function _pause() internal virtual whenNotPaused {\n _paused = true;\n emit Paused(_msgSender());\n }\n\n /**\n * @dev Returns to normal state.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n function _unpause() internal virtual whenPaused {\n _paused = false;\n emit Unpaused(_msgSender());\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuardUpgradeable is Initializable {\n // Booleans are more expensive than uint256 or any type that takes up a full\n // word because each write operation emits an extra SLOAD to first read the\n // slot's contents, replace the bits taken up by the boolean, and then write\n // back. This is the compiler's defense against contract upgrades and\n // pointer aliasing, and it cannot be disabled.\n\n // The values being non-zero value makes deployment a bit more expensive,\n // but in exchange the refund on every call to nonReentrant will be lower in\n // amount. Since refunds are capped to a percentage of the total\n // transaction's gas, it is best to keep them low in cases like this one, to\n // increase the likelihood of the full refund coming into effect.\n uint256 private constant _NOT_ENTERED = 1;\n uint256 private constant _ENTERED = 2;\n\n uint256 private _status;\n\n function __ReentrancyGuard_init() internal onlyInitializing {\n __ReentrancyGuard_init_unchained();\n }\n\n function __ReentrancyGuard_init_unchained() internal onlyInitializing {\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Prevents a contract from calling itself, directly or indirectly.\n * Calling a `nonReentrant` function from another `nonReentrant`\n * function is not supported. It is possible to prevent this from happening\n * by making the `nonReentrant` function external, and making it call a\n * `private` function that does the actual work.\n */\n modifier nonReentrant() {\n _nonReentrantBefore();\n _;\n _nonReentrantAfter();\n }\n\n function _nonReentrantBefore() private {\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\n require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n // Any calls to nonReentrant after this point will fail\n _status = _ENTERED;\n }\n\n function _nonReentrantAfter() private {\n // By storing the original value once again, a refund is triggered (see\n // https://eips.ethereum.org/EIPS/eip-2200)\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Returns true if the reentrancy guard is currently set to \"entered\", which indicates there is a\n * `nonReentrant` function in the call stack.\n */\n function _reentrancyGuardEntered() internal view returns (bool) {\n return _status == _ENTERED;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20PermitUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20PermitUpgradeable {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20Upgradeable {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\n}\n" + }, + "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20Upgradeable.sol\";\nimport \"../extensions/IERC20PermitUpgradeable.sol\";\nimport \"../../../utils/AddressUpgradeable.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20Upgradeable {\n using AddressUpgradeable for address;\n\n /**\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeTransfer(IERC20Upgradeable token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n }\n\n /**\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n */\n function safeTransferFrom(IERC20Upgradeable token, address from, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\n }\n\n /**\n * @dev Deprecated. This function has issues similar to the ones found in\n * {IERC20-approve}, and its usage is discouraged.\n *\n * Whenever possible, use {safeIncreaseAllowance} and\n * {safeDecreaseAllowance} instead.\n */\n function safeApprove(IERC20Upgradeable token, address spender, uint256 value) internal {\n // safeApprove should only be called when setting an initial allowance,\n // or when resetting it to zero. To increase and decrease it, use\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\n require(\n (value == 0) || (token.allowance(address(this), spender) == 0),\n \"SafeERC20: approve from non-zero to non-zero allowance\"\n );\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\n }\n\n /**\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeIncreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {\n uint256 oldAllowance = token.allowance(address(this), spender);\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));\n }\n\n /**\n * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeDecreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {\n unchecked {\n uint256 oldAllowance = token.allowance(address(this), spender);\n require(oldAllowance >= value, \"SafeERC20: decreased allowance below zero\");\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));\n }\n }\n\n /**\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\n * to be set to zero before setting it to a non-zero value, such as USDT.\n */\n function forceApprove(IERC20Upgradeable token, address spender, uint256 value) internal {\n bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);\n\n if (!_callOptionalReturnBool(token, approvalCall)) {\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));\n _callOptionalReturn(token, approvalCall);\n }\n }\n\n /**\n * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.\n * Revert on invalid signature.\n */\n function safePermit(\n IERC20PermitUpgradeable token,\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal {\n uint256 nonceBefore = token.nonces(owner);\n token.permit(owner, spender, value, deadline, v, r, s);\n uint256 nonceAfter = token.nonces(owner);\n require(nonceAfter == nonceBefore + 1, \"SafeERC20: permit did not succeed\");\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20Upgradeable token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data, \"SafeERC20: low-level call failed\");\n require(returndata.length == 0 || abi.decode(returndata, (bool)), \"SafeERC20: ERC20 operation did not succeed\");\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n *\n * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\n */\n function _callOptionalReturnBool(IERC20Upgradeable token, bytes memory data) private returns (bool) {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\n // and not revert is the subcall reverts.\n\n (bool success, bytes memory returndata) = address(token).call(data);\n return\n success && (returndata.length == 0 || abi.decode(returndata, (bool))) && AddressUpgradeable.isContract(address(token));\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary AddressUpgradeable {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n *\n * Furthermore, `isContract` will also return true if the target contract within\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\n * which only has an effect at the end of a transaction.\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n *\n * _Available since v4.8._\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n if (success) {\n if (returndata.length == 0) {\n // only check isContract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n require(isContract(target), \"Address: call to non-contract\");\n }\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason or using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract ContextUpgradeable is Initializable {\n function __Context_init() internal onlyInitializing {\n }\n\n function __Context_init_unchained() internal onlyInitializing {\n }\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n" + }, + "@openzeppelin/contracts/access/IAccessControl.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n *\n * _Available since v3.1._\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n */\n function renounceRole(bytes32 role, address account) external;\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\n}\n" + }, + "@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.13;\n\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol\";\n\nimport \"./IAccessControlManagerV8.sol\";\n\n/**\n * @title AccessControlledV8\n * @author Venus\n * @notice This contract is helper between access control manager and actual contract. This contract further inherited by other contract (using solidity 0.8.13)\n * to integrate access controlled mechanism. It provides initialise methods and verifying access methods.\n */\nabstract contract AccessControlledV8 is Initializable, Ownable2StepUpgradeable {\n /// @notice Access control manager contract\n IAccessControlManagerV8 private _accessControlManager;\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n\n /// @notice Emitted when access control manager contract address is changed\n event NewAccessControlManager(address oldAccessControlManager, address newAccessControlManager);\n\n /// @notice Thrown when the action is prohibited by AccessControlManager\n error Unauthorized(address sender, address calledContract, string methodSignature);\n\n function __AccessControlled_init(address accessControlManager_) internal onlyInitializing {\n __Ownable2Step_init();\n __AccessControlled_init_unchained(accessControlManager_);\n }\n\n function __AccessControlled_init_unchained(address accessControlManager_) internal onlyInitializing {\n _setAccessControlManager(accessControlManager_);\n }\n\n /**\n * @notice Sets the address of AccessControlManager\n * @dev Admin function to set address of AccessControlManager\n * @param accessControlManager_ The new address of the AccessControlManager\n * @custom:event Emits NewAccessControlManager event\n * @custom:access Only Governance\n */\n function setAccessControlManager(address accessControlManager_) external onlyOwner {\n _setAccessControlManager(accessControlManager_);\n }\n\n /**\n * @notice Returns the address of the access control manager contract\n */\n function accessControlManager() external view returns (IAccessControlManagerV8) {\n return _accessControlManager;\n }\n\n /**\n * @dev Internal function to set address of AccessControlManager\n * @param accessControlManager_ The new address of the AccessControlManager\n */\n function _setAccessControlManager(address accessControlManager_) internal {\n require(address(accessControlManager_) != address(0), \"invalid acess control manager address\");\n address oldAccessControlManager = address(_accessControlManager);\n _accessControlManager = IAccessControlManagerV8(accessControlManager_);\n emit NewAccessControlManager(oldAccessControlManager, accessControlManager_);\n }\n\n /**\n * @notice Reverts if the call is not allowed by AccessControlManager\n * @param signature Method signature\n */\n function _checkAccessAllowed(string memory signature) internal view {\n bool isAllowedToCall = _accessControlManager.isAllowedToCall(msg.sender, signature);\n\n if (!isAllowedToCall) {\n revert Unauthorized(msg.sender, address(this), signature);\n }\n }\n}\n" + }, + "@venusprotocol/governance-contracts/contracts/Governance/IAccessControlManagerV8.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.13;\n\nimport \"@openzeppelin/contracts/access/IAccessControl.sol\";\n\n/**\n * @title IAccessControlManagerV8\n * @author Venus\n * @notice Interface implemented by the `AccessControlManagerV8` contract.\n */\ninterface IAccessControlManagerV8 is IAccessControl {\n function giveCallPermission(address contractAddress, string calldata functionSig, address accountToPermit) external;\n\n function revokeCallPermission(\n address contractAddress,\n string calldata functionSig,\n address accountToRevoke\n ) external;\n\n function isAllowedToCall(address account, string calldata functionSig) external view returns (bool);\n\n function hasPermission(\n address account,\n address contractAddress,\n string calldata functionSig\n ) external view returns (bool);\n}\n" + }, + "@venusprotocol/oracle/contracts/interfaces/OracleInterface.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.13;\n\ninterface OracleInterface {\n function getPrice(address asset) external view returns (uint256);\n}\n\ninterface ResilientOracleInterface is OracleInterface {\n function updatePrice(address vToken) external;\n\n function updateAssetPrice(address asset) external;\n\n function getUnderlyingPrice(address vToken) external view returns (uint256);\n}\n\ninterface TwapInterface is OracleInterface {\n function updateTwap(address asset) external returns (uint256);\n}\n\ninterface BoundValidatorInterface {\n function validatePriceWithAnchorPrice(\n address asset,\n uint256 reporterPrice,\n uint256 anchorPrice\n ) external view returns (bool);\n}\n" + }, + "@venusprotocol/oracle/contracts/interfaces/VBep20Interface.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.13;\n\nimport \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\";\n\ninterface VBep20Interface is IERC20Metadata {\n /**\n * @notice Underlying asset for this VToken\n */\n function underlying() external view returns (address);\n}\n" + }, + "@venusprotocol/oracle/contracts/ResilientOracle.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\n// SPDX-FileCopyrightText: 2022 Venus\npragma solidity 0.8.13;\n\nimport \"@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol\";\nimport \"./interfaces/VBep20Interface.sol\";\nimport \"./interfaces/OracleInterface.sol\";\nimport \"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\";\n\n/**\n * @title ResilientOracle\n * @author Venus\n * @notice The Resilient Oracle is the main contract that the protocol uses to fetch prices of assets.\n * \n * DeFi protocols are vulnerable to price oracle failures including oracle manipulation and incorrectly\n * reported prices. If only one oracle is used, this creates a single point of failure and opens a vector\n * for attacking the protocol.\n * \n * The Resilient Oracle uses multiple sources and fallback mechanisms to provide accurate prices and protect\n * the protocol from oracle attacks. Currently it includes integrations with Chainlink, Pyth, Binance Oracle\n * and TWAP (Time-Weighted Average Price) oracles. TWAP uses PancakeSwap as the on-chain price source.\n * \n * For every market (vToken) we configure the main, pivot and fallback oracles. The oracles are configured per \n * vToken's underlying asset address. The main oracle oracle is the most trustworthy price source, the pivot \n * oracle is used as a loose sanity checker and the fallback oracle is used as a backup price source. \n * \n * To validate prices returned from two oracles, we use an upper and lower bound ratio that is set for every\n * market. The upper bound ratio represents the deviation between reported price (the price that’s being\n * validated) and the anchor price (the price we are validating against) above which the reported price will\n * be invalidated. The lower bound ratio presents the deviation between reported price and anchor price below\n * which the reported price will be invalidated. So for oracle price to be considered valid the below statement\n * should be true:\n\n```\nanchorRatio = anchorPrice/reporterPrice\nisValid = anchorRatio <= upperBoundAnchorRatio && anchorRatio >= lowerBoundAnchorRatio\n```\n\n * In most cases, Chainlink is used as the main oracle, TWAP or Pyth oracles are used as the pivot oracle depending\n * on which supports the given market and Binance oracle is used as the fallback oracle. For some markets we may\n * use Pyth or TWAP as the main oracle if the token price is not supported by Chainlink or Binance oracles. \n * \n * For a fetched price to be valid it must be positive and not stagnant. If the price is invalid then we consider the\n * oracle to be stagnant and treat it like it's disabled.\n */\ncontract ResilientOracle is PausableUpgradeable, AccessControlledV8, ResilientOracleInterface {\n /**\n * @dev Oracle roles:\n * **main**: The most trustworthy price source\n * **pivot**: Price oracle used as a loose sanity checker\n * **fallback**: The backup source when main oracle price is invalidated\n */\n enum OracleRole {\n MAIN,\n PIVOT,\n FALLBACK\n }\n\n struct TokenConfig {\n /// @notice asset address\n address asset;\n /// @notice `oracles` stores the oracles based on their role in the following order:\n /// [main, pivot, fallback],\n /// It can be indexed with the corresponding enum OracleRole value\n address[3] oracles;\n /// @notice `enableFlagsForOracles` stores the enabled state\n /// for each oracle in the same order as `oracles`\n bool[3] enableFlagsForOracles;\n }\n\n uint256 public constant INVALID_PRICE = 0;\n\n /// @notice Native market address\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address public immutable nativeMarket;\n\n /// @notice VAI address\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address public immutable vai;\n\n /// @notice Set this as asset address for Native token on each chain.This is the underlying for vBNB (on bsc)\n /// and can serve as any underlying asset of a market that supports native tokens\n address public constant NATIVE_TOKEN_ADDR = 0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB;\n\n /// @notice Bound validator contract address\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n BoundValidatorInterface public immutable boundValidator;\n\n mapping(address => TokenConfig) private tokenConfigs;\n\n event TokenConfigAdded(\n address indexed asset,\n address indexed mainOracle,\n address indexed pivotOracle,\n address fallbackOracle\n );\n\n /// Event emitted when an oracle is set\n event OracleSet(address indexed asset, address indexed oracle, uint256 indexed role);\n\n /// Event emitted when an oracle is enabled or disabled\n event OracleEnabled(address indexed asset, uint256 indexed role, bool indexed enable);\n\n /**\n * @notice Checks whether an address is null or not\n */\n modifier notNullAddress(address someone) {\n if (someone == address(0)) revert(\"can't be zero address\");\n _;\n }\n\n /**\n * @notice Checks whether token config exists by checking whether asset is null address\n * @dev address can't be null, so it's suitable to be used to check the validity of the config\n * @param asset asset address\n */\n modifier checkTokenConfigExistence(address asset) {\n if (tokenConfigs[asset].asset == address(0)) revert(\"token config must exist\");\n _;\n }\n\n /// @notice Constructor for the implementation contract. Sets immutable variables.\n /// @dev nativeMarketAddress can be address(0) if on the chain we do not support native market\n /// (e.g vETH on ethereum would not be supported, only vWETH)\n /// @param nativeMarketAddress The address of a native market (for bsc it would be vBNB address)\n /// @param vaiAddress The address of the VAI token (if there is VAI on the deployed chain).\n /// Set to address(0) of VAI is not existent.\n /// @param _boundValidator Address of the bound validator contract\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor(\n address nativeMarketAddress,\n address vaiAddress,\n BoundValidatorInterface _boundValidator\n ) notNullAddress(address(_boundValidator)) {\n nativeMarket = nativeMarketAddress;\n vai = vaiAddress;\n boundValidator = _boundValidator;\n\n _disableInitializers();\n }\n\n /**\n * @notice Initializes the contract admin and sets the BoundValidator contract address\n * @param accessControlManager_ Address of the access control manager contract\n */\n function initialize(address accessControlManager_) external initializer {\n __AccessControlled_init(accessControlManager_);\n __Pausable_init();\n }\n\n /**\n * @notice Pauses oracle\n * @custom:access Only Governance\n */\n function pause() external {\n _checkAccessAllowed(\"pause()\");\n _pause();\n }\n\n /**\n * @notice Unpauses oracle\n * @custom:access Only Governance\n */\n function unpause() external {\n _checkAccessAllowed(\"unpause()\");\n _unpause();\n }\n\n /**\n * @notice Batch sets token configs\n * @param tokenConfigs_ Token config array\n * @custom:access Only Governance\n * @custom:error Throws a length error if the length of the token configs array is 0\n */\n function setTokenConfigs(TokenConfig[] memory tokenConfigs_) external {\n if (tokenConfigs_.length == 0) revert(\"length can't be 0\");\n uint256 numTokenConfigs = tokenConfigs_.length;\n for (uint256 i; i < numTokenConfigs; ) {\n setTokenConfig(tokenConfigs_[i]);\n unchecked {\n ++i;\n }\n }\n }\n\n /**\n * @notice Sets oracle for a given asset and role.\n * @dev Supplied asset **must** exist and main oracle may not be null\n * @param asset Asset address\n * @param oracle Oracle address\n * @param role Oracle role\n * @custom:access Only Governance\n * @custom:error Null address error if main-role oracle address is null\n * @custom:error NotNullAddress error is thrown if asset address is null\n * @custom:error TokenConfigExistance error is thrown if token config is not set\n * @custom:event Emits OracleSet event with asset address, oracle address and role of the oracle for the asset\n */\n function setOracle(\n address asset,\n address oracle,\n OracleRole role\n ) external notNullAddress(asset) checkTokenConfigExistence(asset) {\n _checkAccessAllowed(\"setOracle(address,address,uint8)\");\n if (oracle == address(0) && role == OracleRole.MAIN) revert(\"can't set zero address to main oracle\");\n tokenConfigs[asset].oracles[uint256(role)] = oracle;\n emit OracleSet(asset, oracle, uint256(role));\n }\n\n /**\n * @notice Enables/ disables oracle for the input asset. Token config for the input asset **must** exist\n * @dev Configuration for the asset **must** already exist and the asset cannot be 0 address\n * @param asset Asset address\n * @param role Oracle role\n * @param enable Enabled boolean of the oracle\n * @custom:access Only Governance\n * @custom:error NotNullAddress error is thrown if asset address is null\n * @custom:error TokenConfigExistance error is thrown if token config is not set\n */\n function enableOracle(\n address asset,\n OracleRole role,\n bool enable\n ) external notNullAddress(asset) checkTokenConfigExistence(asset) {\n _checkAccessAllowed(\"enableOracle(address,uint8,bool)\");\n tokenConfigs[asset].enableFlagsForOracles[uint256(role)] = enable;\n emit OracleEnabled(asset, uint256(role), enable);\n }\n\n /**\n * @notice Updates the TWAP pivot oracle price.\n * @dev This function should always be called before calling getUnderlyingPrice\n * @param vToken vToken address\n */\n function updatePrice(address vToken) external override {\n address asset = _getUnderlyingAsset(vToken);\n (address pivotOracle, bool pivotOracleEnabled) = getOracle(asset, OracleRole.PIVOT);\n if (pivotOracle != address(0) && pivotOracleEnabled) {\n //if pivot oracle is not TwapOracle it will revert so we need to catch the revert\n try TwapInterface(pivotOracle).updateTwap(asset) {} catch {}\n }\n }\n\n /**\n * @notice Updates the pivot oracle price. Currently using TWAP\n * @dev This function should always be called before calling getPrice\n * @param asset asset address\n */\n function updateAssetPrice(address asset) external {\n (address pivotOracle, bool pivotOracleEnabled) = getOracle(asset, OracleRole.PIVOT);\n if (pivotOracle != address(0) && pivotOracleEnabled) {\n //if pivot oracle is not TwapOracle it will revert so we need to catch the revert\n try TwapInterface(pivotOracle).updateTwap(asset) {} catch {}\n }\n }\n\n /**\n * @dev Gets token config by asset address\n * @param asset asset address\n * @return tokenConfig Config for the asset\n */\n function getTokenConfig(address asset) external view returns (TokenConfig memory) {\n return tokenConfigs[asset];\n }\n\n /**\n * @notice Gets price of the underlying asset for a given vToken. Validation flow:\n * - Check if the oracle is paused globally\n * - Validate price from main oracle against pivot oracle\n * - Validate price from fallback oracle against pivot oracle if the first validation failed\n * - Validate price from main oracle against fallback oracle if the second validation failed\n * In the case that the pivot oracle is not available but main price is available and validation is successful,\n * main oracle price is returned.\n * @param vToken vToken address\n * @return price USD price in scaled decimal places.\n * @custom:error Paused error is thrown when resilent oracle is paused\n * @custom:error Invalid resilient oracle price error is thrown if fetched prices from oracle is invalid\n */\n function getUnderlyingPrice(address vToken) external view override returns (uint256) {\n if (paused()) revert(\"resilient oracle is paused\");\n\n address asset = _getUnderlyingAsset(vToken);\n return _getPrice(asset);\n }\n\n /**\n * @notice Gets price of the asset\n * @param asset asset address\n * @return price USD price in scaled decimal places.\n * @custom:error Paused error is thrown when resilent oracle is paused\n * @custom:error Invalid resilient oracle price error is thrown if fetched prices from oracle is invalid\n */\n function getPrice(address asset) external view override returns (uint256) {\n if (paused()) revert(\"resilient oracle is paused\");\n return _getPrice(asset);\n }\n\n /**\n * @notice Sets/resets single token configs.\n * @dev main oracle **must not** be a null address\n * @param tokenConfig Token config struct\n * @custom:access Only Governance\n * @custom:error NotNullAddress is thrown if asset address is null\n * @custom:error NotNullAddress is thrown if main-role oracle address for asset is null\n * @custom:event Emits TokenConfigAdded event when the asset config is set successfully by the authorized account\n */\n function setTokenConfig(\n TokenConfig memory tokenConfig\n ) public notNullAddress(tokenConfig.asset) notNullAddress(tokenConfig.oracles[uint256(OracleRole.MAIN)]) {\n _checkAccessAllowed(\"setTokenConfig(TokenConfig)\");\n\n tokenConfigs[tokenConfig.asset] = tokenConfig;\n emit TokenConfigAdded(\n tokenConfig.asset,\n tokenConfig.oracles[uint256(OracleRole.MAIN)],\n tokenConfig.oracles[uint256(OracleRole.PIVOT)],\n tokenConfig.oracles[uint256(OracleRole.FALLBACK)]\n );\n }\n\n /**\n * @notice Gets oracle and enabled status by asset address\n * @param asset asset address\n * @param role Oracle role\n * @return oracle Oracle address based on role\n * @return enabled Enabled flag of the oracle based on token config\n */\n function getOracle(address asset, OracleRole role) public view returns (address oracle, bool enabled) {\n oracle = tokenConfigs[asset].oracles[uint256(role)];\n enabled = tokenConfigs[asset].enableFlagsForOracles[uint256(role)];\n }\n\n function _getPrice(address asset) internal view returns (uint256) {\n uint256 pivotPrice = INVALID_PRICE;\n\n // Get pivot oracle price, Invalid price if not available or error\n (address pivotOracle, bool pivotOracleEnabled) = getOracle(asset, OracleRole.PIVOT);\n if (pivotOracleEnabled && pivotOracle != address(0)) {\n try OracleInterface(pivotOracle).getPrice(asset) returns (uint256 pricePivot) {\n pivotPrice = pricePivot;\n } catch {}\n }\n\n // Compare main price and pivot price, return main price and if validation was successful\n // note: In case pivot oracle is not available but main price is available and\n // validation is successful, the main oracle price is returned.\n (uint256 mainPrice, bool validatedPivotMain) = _getMainOraclePrice(\n asset,\n pivotPrice,\n pivotOracleEnabled && pivotOracle != address(0)\n );\n if (mainPrice != INVALID_PRICE && validatedPivotMain) return mainPrice;\n\n // Compare fallback and pivot if main oracle comparision fails with pivot\n // Return fallback price when fallback price is validated successfully with pivot oracle\n (uint256 fallbackPrice, bool validatedPivotFallback) = _getFallbackOraclePrice(asset, pivotPrice);\n if (fallbackPrice != INVALID_PRICE && validatedPivotFallback) return fallbackPrice;\n\n // Lastly compare main price and fallback price\n if (\n mainPrice != INVALID_PRICE &&\n fallbackPrice != INVALID_PRICE &&\n boundValidator.validatePriceWithAnchorPrice(asset, mainPrice, fallbackPrice)\n ) {\n return mainPrice;\n }\n\n revert(\"invalid resilient oracle price\");\n }\n\n /**\n * @notice Gets a price for the provided asset\n * @dev This function won't revert when price is 0, because the fallback oracle may still be\n * able to fetch a correct price\n * @param asset asset address\n * @param pivotPrice Pivot oracle price\n * @param pivotEnabled If pivot oracle is not empty and enabled\n * @return price USD price in scaled decimals\n * e.g. asset decimals is 8 then price is returned as 10**18 * 10**(18-8) = 10**28 decimals\n * @return pivotValidated Boolean representing if the validation of main oracle price\n * and pivot oracle price were successful\n * @custom:error Invalid price error is thrown if main oracle fails to fetch price of the asset\n * @custom:error Invalid price error is thrown if main oracle is not enabled or main oracle\n * address is null\n */\n function _getMainOraclePrice(\n address asset,\n uint256 pivotPrice,\n bool pivotEnabled\n ) internal view returns (uint256, bool) {\n (address mainOracle, bool mainOracleEnabled) = getOracle(asset, OracleRole.MAIN);\n if (mainOracleEnabled && mainOracle != address(0)) {\n try OracleInterface(mainOracle).getPrice(asset) returns (uint256 mainOraclePrice) {\n if (!pivotEnabled) {\n return (mainOraclePrice, true);\n }\n if (pivotPrice == INVALID_PRICE) {\n return (mainOraclePrice, false);\n }\n return (\n mainOraclePrice,\n boundValidator.validatePriceWithAnchorPrice(asset, mainOraclePrice, pivotPrice)\n );\n } catch {\n return (INVALID_PRICE, false);\n }\n }\n\n return (INVALID_PRICE, false);\n }\n\n /**\n * @dev This function won't revert when the price is 0 because getPrice checks if price is > 0\n * @param asset asset address\n * @return price USD price in 18 decimals\n * @return pivotValidated Boolean representing if the validation of fallback oracle price\n * and pivot oracle price were successfull\n * @custom:error Invalid price error is thrown if fallback oracle fails to fetch price of the asset\n * @custom:error Invalid price error is thrown if fallback oracle is not enabled or fallback oracle\n * address is null\n */\n function _getFallbackOraclePrice(address asset, uint256 pivotPrice) private view returns (uint256, bool) {\n (address fallbackOracle, bool fallbackEnabled) = getOracle(asset, OracleRole.FALLBACK);\n if (fallbackEnabled && fallbackOracle != address(0)) {\n try OracleInterface(fallbackOracle).getPrice(asset) returns (uint256 fallbackOraclePrice) {\n if (pivotPrice == INVALID_PRICE) {\n return (fallbackOraclePrice, false);\n }\n return (\n fallbackOraclePrice,\n boundValidator.validatePriceWithAnchorPrice(asset, fallbackOraclePrice, pivotPrice)\n );\n } catch {\n return (INVALID_PRICE, false);\n }\n }\n\n return (INVALID_PRICE, false);\n }\n\n /**\n * @dev This function returns the underlying asset of a vToken\n * @param vToken vToken address\n * @return asset underlying asset address\n */\n function _getUnderlyingAsset(address vToken) private view notNullAddress(vToken) returns (address asset) {\n if (vToken == nativeMarket) {\n asset = NATIVE_TOKEN_ADDR;\n } else if (vToken == vai) {\n asset = vai;\n } else {\n asset = VBep20Interface(vToken).underlying();\n }\n }\n}\n" + }, + "@venusprotocol/solidity-utilities/contracts/constants.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.13;\n\n/// @dev Base unit for computations, usually used in scaling (multiplications, divisions)\nuint256 constant EXP_SCALE = 1e18;\n\n/// @dev A unit (literal one) in EXP_SCALE, usually used in additions/subtractions\nuint256 constant MANTISSA_ONE = EXP_SCALE;\n\n/// @dev The approximate number of seconds per year\nuint256 constant SECONDS_PER_YEAR = 31_536_000;\n" + }, + "@venusprotocol/solidity-utilities/contracts/validators.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.13;\n\n/// @notice Thrown if the supplied address is a zero address where it is not allowed\nerror ZeroAddressNotAllowed();\n\n/// @notice Thrown if the supplied value is 0 where it is not allowed\nerror ZeroValueNotAllowed();\n\n/// @notice Checks if the provided address is nonzero, reverts otherwise\n/// @param address_ Address to check\n/// @custom:error ZeroAddressNotAllowed is thrown if the provided address is a zero address\nfunction ensureNonzeroAddress(address address_) pure {\n if (address_ == address(0)) {\n revert ZeroAddressNotAllowed();\n }\n}\n\n/// @notice Checks if the provided value is nonzero, reverts otherwise\n/// @param value_ Value to check\n/// @custom:error ZeroValueNotAllowed is thrown if the provided value is 0\nfunction ensureNonzeroValue(uint256 value_) pure {\n if (value_ == 0) {\n revert ZeroValueNotAllowed();\n }\n}\n" + }, + "contracts/Interfaces/IComptroller.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.13;\n\ninterface IComptroller {\n function isComptroller() external view returns (bool);\n\n function markets(address) external view returns (bool);\n\n function getAllMarkets() external view returns (address[] memory);\n}\n" + }, + "contracts/Interfaces/IConverterNetwork.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.13;\n\nimport { IAbstractTokenConverter } from \"../TokenConverter/IAbstractTokenConverter.sol\";\n\n/**\n * @title IConverterNetwork\n * @author Venus\n * @notice Interface implemented by `ConverterNetwork`.\n */\ninterface IConverterNetwork {\n /// @notice Adds new converter to the array\n /// @param _tokenConverter Address of the token converter\n function addTokenConverter(IAbstractTokenConverter _tokenConverter) external;\n\n /// @notice Removes converter from the array\n /// @param _tokenConverter Address of the token converter\n function removeTokenConverter(IAbstractTokenConverter _tokenConverter) external;\n\n /// @notice Used to get the array of converters supporting conversions, arranged in descending order based on token balances\n /// @param _tokenAddressIn Address of tokenIn\n /// @param _tokenAddressOut Address of tokenOut\n /// @return converters Array of the conveters on the basis of the tokens pair\n /// @return convertersBalance Array of balances with respect to token out\n function findTokenConverters(address _tokenAddressIn, address _tokenAddressOut)\n external\n returns (address[] memory converters, uint256[] memory convertersBalance);\n\n /// @notice Used to get the array of converters supporting conversions, arranged in descending order based on token balances\n /// @param _tokenAddressIn Address of tokenIn\n /// @param _tokenAddressOut Address of tokenOut\n /// @return converters Array of the conveters on the basis of the tokens pair\n /// @return convertersBalance Array of balances with respect to token out\n function findTokenConvertersForConverters(address _tokenAddressIn, address _tokenAddressOut)\n external\n returns (address[] memory converters, uint256[] memory convertersBalance);\n\n /// @notice This function returns the array containing all the converters addresses\n /// @return Array containing all the converters addresses\n function getAllConverters() external view returns (IAbstractTokenConverter[] memory);\n\n /// @notice This function checks for given address is converter or not\n /// @param _tokenConverter Address of the token converter\n /// @return boolean true if given address is converter otherwise false\n function isTokenConverter(address _tokenConverter) external view returns (bool);\n}\n" + }, + "contracts/Interfaces/IPoolRegistry.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.13;\n\ninterface IPoolRegistry {\n /// @notice Get VToken in the Pool for an Asset\n function getVTokenForAsset(address comptroller, address asset) external view returns (address);\n\n /// @notice Get the addresss of the Pools supported that include a market for the provided asset\n function getPoolsSupportedByAsset(address asset) external view returns (address[] memory);\n}\n" + }, + "contracts/Interfaces/IRiskFund.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.13;\n\n/**\n * @title IRiskFund\n * @author Venus\n * @notice Interface implemented by `RiskFund`.\n */\ninterface IRiskFund {\n function transferReserveForAuction(address comptroller, uint256 amount) external returns (uint256);\n\n function updatePoolState(\n address comptroller,\n address asset,\n uint256 amount\n ) external;\n\n function getPoolsBaseAssetReserves(address comptroller) external view returns (uint256);\n}\n\n/**\n * @title IRiskFundGetters\n * @author Venus\n * @notice Interface implemented by `RiskFund` for getter methods.\n */\ninterface IRiskFundGetters {\n function convertibleBaseAsset() external view returns (address);\n}\n" + }, + "contracts/Interfaces/IVToken.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.13;\n\ninterface IVToken {\n function underlying() external view returns (address);\n}\n" + }, + "contracts/Test/Mocks/MockConverter.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.10;\n\nimport { SafeERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\";\nimport { IERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\";\nimport { ResilientOracle } from \"@venusprotocol/oracle/contracts/ResilientOracle.sol\";\n\nimport { AbstractTokenConverter } from \"../../TokenConverter/AbstractTokenConverter.sol\";\nimport { IRiskFundGetters } from \"../../Interfaces/IRiskFund.sol\";\n\ncontract MockConverter is AbstractTokenConverter {\n using SafeERC20Upgradeable for IERC20Upgradeable;\n\n /// @notice Store the previous state for the asset transferred to ProtocolShareReserve combined(for all pools)\n mapping(address => uint256) public assetsReserves;\n\n /// @notice Store the asset's reserve per pool in the ProtocolShareReserve\n /// @dev Comptroller(pool) -> Asset -> amount\n mapping(address => mapping(address => uint256)) public poolsAssetsReserves;\n\n /// @notice Emitted after updating of the assets reserves\n /// amount -> reserve increased by amount\n event AssetsReservesUpdated(address indexed comptroller, address indexed asset, uint256 amount);\n\n function mockPrivateConversion(\n address comptroller,\n address tokenAddressOut,\n uint256 balanceDiff\n ) external {\n _privateConversion(comptroller, tokenAddressOut, balanceDiff);\n }\n\n function AbstractTokenConverter_init(\n address accessControlManager_,\n ResilientOracle priceOracle_,\n address destinationAddress_,\n uint256 minAmountToConvert_\n ) public initializer {\n __AbstractTokenConverter_init(accessControlManager_, priceOracle_, destinationAddress_, minAmountToConvert_);\n }\n\n function balanceOf(address tokenAddress) public view override returns (uint256 tokenBalance) {\n IERC20Upgradeable token = IERC20Upgradeable(tokenAddress);\n tokenBalance = token.balanceOf(address(this));\n }\n\n function _postPrivateConversionHook(\n address comptroller,\n address tokenAddressIn,\n uint256 convertedTokenInBalance,\n address tokenAddressOut,\n uint256 convertedTokenOutBalance\n ) internal override {\n if (convertedTokenInBalance > 0) {\n assetsReserves[tokenAddressIn] += convertedTokenInBalance;\n poolsAssetsReserves[comptroller][tokenAddressIn] += convertedTokenInBalance;\n emit AssetsReservesUpdated(comptroller, tokenAddressIn, convertedTokenInBalance);\n }\n if (convertedTokenOutBalance > 0) {\n assetsReserves[tokenAddressOut] += convertedTokenOutBalance;\n poolsAssetsReserves[comptroller][tokenAddressOut] += convertedTokenOutBalance;\n emit AssetsReservesUpdated(comptroller, tokenAddressOut, convertedTokenOutBalance);\n }\n }\n\n /// @notice Get base asset address\n function _getDestinationBaseAsset() internal view override returns (address) {\n return IRiskFundGetters(destinationAddress).convertibleBaseAsset();\n }\n}\n" + }, + "contracts/Test/Mocks/MockRiskFundConverter.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.13;\n\nimport { RiskFundConverter } from \"../../TokenConverter/RiskFundConverter.sol\";\n\ncontract MockRiskFundConverter is RiskFundConverter {\n constructor(\n address corePoolComptroller_,\n address vBNB_,\n address nativeWrapped_\n ) RiskFundConverter(corePoolComptroller_, vBNB_, nativeWrapped_) {}\n\n function postConversionHookMock(\n address tokenInAddress,\n address tokenOutAddress,\n uint256 amountIn,\n uint256 amountOut\n ) external {\n super._postConversionHook(tokenInAddress, tokenOutAddress, amountIn, amountOut);\n }\n\n function preTransferHookMock(address tokenOutAddress, uint256 amountOut) external {\n super._preTransferHook(tokenOutAddress, amountOut);\n }\n\n function setAssetsReserves(address asset, uint256 amount) external {\n assetsReserves[asset] = amount;\n }\n\n function setPoolsAssetsReserves(\n address comptroller,\n address asset,\n uint256 amount\n ) external {\n poolsAssetsReserves[comptroller][asset] = amount;\n }\n\n function getPoolsAssetsReserves(address comptroller, address asset) external view returns (uint256) {\n return poolsAssetsReserves[comptroller][asset];\n }\n\n function getAssetsReserves(address asset) external view returns (uint256) {\n return assetsReserves[asset];\n }\n}\n" + }, + "contracts/TokenConverter/AbstractTokenConverter.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.13;\n\nimport { ReentrancyGuardUpgradeable } from \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\nimport { SafeERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\";\nimport { AccessControlledV8 } from \"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\";\nimport { IERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\";\nimport { ResilientOracle } from \"@venusprotocol/oracle/contracts/ResilientOracle.sol\";\nimport { ensureNonzeroAddress, ensureNonzeroValue } from \"@venusprotocol/solidity-utilities/contracts/validators.sol\";\nimport { MANTISSA_ONE, EXP_SCALE } from \"@venusprotocol/solidity-utilities/contracts/constants.sol\";\n\nimport { IAbstractTokenConverter } from \"./IAbstractTokenConverter.sol\";\nimport { IConverterNetwork } from \"../Interfaces/IConverterNetwork.sol\";\n\n/// @title AbstractTokenConverter\n/// @author Venus\n/// @notice Abstract contract will be extended by SingleTokenConverter and RiskFundConverter\n/*\n * This contract specifies four functions for converting tokens, each applicable under following circumstances:\n *\n * Case I: TokenIn -> deflationary token, TokenOut -> deflationary token\n * In this scenario, functions supporting fees can only be utilized to convert tokens which are:\n * a. convertExactTokensSupportingFeeOnTransferTokens\n * b. convertForExactTokensSupportingFeeOnTransferTokens\n *\n * Case II: TokenIn -> deflationary token, TokenOut -> non-deflationary token\n * In this scenario, functions supporting fee can only be utilized to convert tokens which are:\n * similar to Case I.\n *\n * Case III: TokenIn -> non-deflationary token, TokenOut -> deflationary token\n * In this scenario, functions with or without supporting fee can be utilized to convert tokens which are:\n * a. convertExactTokens\n * b. convertForExactTokens\n * c. convertExactTokensSupportingFeeOnTransferTokens\n * d. convertForExactTokensSupportingFeeOnTransferTokens\n *\n * Case IV: TokenIn -> non-deflationary token, TokenOut -> non-deflationary token\n * In this scenario, functions with or without supporting fee can be utilized to convert tokens which are:\n * similar to Case III.\n *\n * ------------------------------------------------------------------------------------------------------------------------------------\n * Example 1:-\n * tokenInAddress - 0xaaaa.....\n * tokenOutAddress - 0xbbbb.....\n * tokenInAmount - 100\n * tokenOutMinAmount - minimum amount desired by the user(let's say 70)\n * Here user can use `convertExactTokens` or `convertExactTokensSupportingFeeOnTransferTokens`, if tokenIn is deflationary\n * then `convertExactTokensSupportingFeeOnTransferTokens` should be used(let's suppose `convertExactTokens` is used).\n * Now first tokenInAddress tokens will be transferred from the user to the contract, on the basis of amount\n * received(as tokenInAddress can be deflationary token) tokenAmountOut will be calculated and will be transferred\n * to the user and if amount sent is less than tokenOutMinAmount, tx will revert. If amount sent is satisfied(let's say\n * 80 or even 70) then at last the actual amount received and the amount that was supposed to be received by the contract will\n * be compared, if they differ then the whole tx will revert as user was supposed to use `convertExactTokensSupportingFeeOnTransferTokens`\n * function for tokenIn as deflationary token.\n *\n * Example 2:-\n * tokenInAddress - 0xaaaa.....\n * tokenOutAddress - 0xbbbb.....\n * tokenInMaxAmount - maximum amount user is willing to provide(let's say 100)\n * tokenOutAmount - 70\n * Here user can use `convertForExactTokens` or `convertForExactTokensSupportingFeeOnTransferTokens`, if tokenIn is deflationary\n * then `convertForExactTokensSupportingFeeOnTransferTokens` should be used(let's suppose `convertForExactTokens` is used),\n * which on the basis of tokenOutAmount provided will calculate tokenInAmount based on the tokens prices and will transfer\n * tokens from the user to the contract, now the actual amount received(as tokenInAddress can be deflationary token) will be\n * compared with tokenInMaxAmount if it is greater, tx will revert. If In amount is satisfied(let's say 90 or even 100) then\n * new tokenOutAmount will be calculated, and tokenOutAddress tokens will be transferred to the user, but at last the\n * old tokenOutAmount and new tokenOutAmount will be compared and if they differ whole tx will revert, because user was\n * supposed to use `convertForExactTokensSupportingFeeOnTransferTokens` function for tokenIn as deflationary token.\n * ------------------------------------------------------------------------------------------------------------------------------------\n *\n * This contract also supports private conversion between the converters:\n * Private conversions:\n * Private conversions is designed in order to convert the maximum amount of tokens received from PSR(to any converter) between\n * existing converters to save incentive and lower the dependency of users for conversion. So Private Conversion will be executed\n * by converters on it's own whenever funds are received from PSR. No incentive will be offered during private conversion.\n *\n * It will execute on updateAssetsState() function call in Converter Contracts. After this function call, converter will first\n * check for the amount received. If base asset is received then it will be directly sent to the destination address and no private\n * conversion will happen otherwise converter will interact with ConverterNetwork contract to find other valid converters who are providing the conversion for:\n *\n * tokenAddressIn: As asset received by that converter on updateAssetsState() function call.\n * tokenAddressOut: As base asset of that converter.\n *\n * ConverterNetwork:\n * This contract will contain all the converters, and will provide valid converters which can perform the execution according to tokenAddressIn\n * and tokenAddressOut provided.\n *\n * findTokenConverters():\n * It will return an array of converter addresses along with their corresponding balances, sorted in descending order based on the converter's balances\n * relative to tokenAddressOut. This function filter the converter addresses on the basis of the conversionAccess(for users).\n *\n * findTokenConvertersForConverters():\n * It will return an array of converter addresses along with their corresponding balances, sorted in descending order based on the converter's balances\n * relative to tokenAddressOut. This function filter the converter addresses on the basis of the conversionAccess(for converters).\n */\n\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\nabstract contract AbstractTokenConverter is AccessControlledV8, IAbstractTokenConverter, ReentrancyGuardUpgradeable {\n using SafeERC20Upgradeable for IERC20Upgradeable;\n\n /// @notice Maximum incentive could be\n uint256 public constant MAX_INCENTIVE = 0.5e18;\n\n /// @notice Min amount to convert for private conversions. Defined in USD, with 18 decimals\n uint256 public minAmountToConvert;\n\n /// @notice Venus price oracle contract\n ResilientOracle public priceOracle;\n\n /// @notice conversion configurations for the existing pairs\n /// @dev tokenAddressIn => tokenAddressOut => ConversionConfig\n mapping(address => mapping(address => ConversionConfig)) public conversionConfigurations;\n\n /// @notice Address that all incoming tokens are transferred to\n address public destinationAddress;\n\n /// @notice Boolean for if conversion is paused\n bool public conversionPaused;\n\n /// @notice Address of the converterNetwork contract\n IConverterNetwork public converterNetwork;\n\n /// @dev This empty reserved space is put in place to allow future versions to add new\n /// variables without shifting down storage in the inheritance chain.\n /// See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n uint256[45] private __gap;\n\n /// @notice Emitted when config is updated for tokens pair\n event ConversionConfigUpdated(\n address indexed tokenAddressIn,\n address indexed tokenAddressOut,\n uint256 oldIncentive,\n uint256 newIncentive,\n ConversionAccessibility oldAccess,\n ConversionAccessibility newAccess\n );\n /// @notice Emitted when price oracle address is updated\n event PriceOracleUpdated(ResilientOracle indexed oldPriceOracle, ResilientOracle indexed priceOracle);\n\n /// @notice Emitted when destination address is updated\n event DestinationAddressUpdated(address indexed oldDestinationAddress, address indexed destinationAddress);\n\n /// @notice Emitted when converterNetwork address is updated\n event ConverterNetworkAddressUpdated(address indexed oldConverterNetwork, address indexed converterNetwork);\n\n /// @notice Emitted when exact amount of tokens are converted for tokens\n event ConvertedExactTokens(\n address indexed sender,\n address indexed receiver,\n address tokenAddressIn,\n address indexed tokenAddressOut,\n uint256 amountIn,\n uint256 amountOut\n );\n\n /// @notice Emitted when tokens are converted for exact amount of tokens\n event ConvertedForExactTokens(\n address indexed sender,\n address indexed receiver,\n address tokenAddressIn,\n address indexed tokenAddressOut,\n uint256 amountIn,\n uint256 amountOut\n );\n\n /// @notice Emitted when exact amount of tokens are converted for tokens, for deflationary tokens\n event ConvertedExactTokensSupportingFeeOnTransferTokens(\n address indexed sender,\n address indexed receiver,\n address tokenAddressIn,\n address indexed tokenAddressOut,\n uint256 amountIn,\n uint256 amountOut\n );\n\n /// @notice Emitted when tokens are converted for exact amount of tokens, for deflationary tokens\n event ConvertedForExactTokensSupportingFeeOnTransferTokens(\n address indexed sender,\n address indexed receiver,\n address tokenAddressIn,\n address indexed tokenAddressOut,\n uint256 amountIn,\n uint256 amountOut\n );\n\n /// @notice Emitted when conversion is paused\n event ConversionPaused(address indexed sender);\n\n /// @notice Emitted when conversion is unpaused\n event ConversionResumed(address indexed sender);\n\n /// @notice Event emitted when tokens are swept\n event SweepToken(address indexed token, address indexed to, uint256 amount);\n\n /// @notice Emitted when minimum amount to convert is updated\n event MinAmountToConvertUpdated(uint256 oldMinAmountToConvert, uint256 newMinAmountToConvert);\n\n /// @notice Thrown when actualAmountOut does not match with amountOutMantissa for convertForExactTokens\n error AmountOutMismatched();\n\n /// @notice Thrown when actualAmountIn does not match with amountInMantissa for convertForExactTokens\n error AmountInMismatched();\n\n /// @notice Thrown when given input amount is zero\n error InsufficientInputAmount();\n\n /// @notice Thrown when given output amount is zero\n error InsufficientOutputAmount();\n\n /// @notice Thrown when conversion is disabled or config does not exist for given pair\n error ConversionConfigNotEnabled();\n\n /// @notice Thrown when conversion is enabled only for private conversions\n error ConversionEnabledOnlyForPrivateConversions();\n\n /// @notice Thrown when address(to) is same as tokenAddressIn or tokenAddressOut\n error InvalidToAddress();\n\n /// @notice Thrown when incentive is higher than the MAX_INCENTIVE\n error IncentiveTooHigh(uint256 incentive, uint256 maxIncentive);\n\n /// @notice Thrown when amountOut is lower than amountOutMin\n error AmountOutLowerThanMinRequired(uint256 amountOutMantissa, uint256 amountOutMinMantissa);\n\n /// @notice Thrown when amountIn is higher than amountInMax\n error AmountInHigherThanMax(uint256 amountInMantissa, uint256 amountInMaxMantissa);\n\n /// @notice Thrown when conversion is paused\n error ConversionTokensPaused();\n\n /// @notice Thrown when conversion is Active\n error ConversionTokensActive();\n\n /// @notice Thrown when tokenInAddress is same as tokeOutAdress OR tokeInAddress is not the base asset of the destination\n error InvalidTokenConfigAddresses();\n\n /// @notice Thrown when contract has less liquidity for tokenAddressOut than amountOutMantissa\n error InsufficientPoolLiquidity();\n\n /// @notice When address of the ConverterNetwork is not set or Zero address\n error InvalidConverterNetwork();\n\n /// @notice Thrown when trying to set non zero incentive for private conversion\n error NonZeroIncentiveForPrivateConversion();\n\n /// @notice Thrown when using convertForExactTokens deflationary tokens\n error DeflationaryTokenNotSupported();\n\n /// @notice Thrown when minimum amount to convert is zero\n error InvalidMinimumAmountToConvert();\n\n /// @notice Thrown when there is a mismatch in the length of input arrays\n error InputLengthMisMatch();\n\n /**\n * @notice Modifier to ensure valid conversion parameters for a token conversion\n * and check if conversion is paused or not\n * @param to The recipient address for the converted tokens\n * @param tokenAddressIn The input token address for the conversion\n * @param tokenAddressOut The output token address for the conversion\n */\n modifier validConversionParameters(\n address to,\n address tokenAddressIn,\n address tokenAddressOut\n ) {\n _checkConversionPaused();\n ensureNonzeroAddress(to);\n if (to == tokenAddressIn || to == tokenAddressOut) {\n revert InvalidToAddress();\n }\n _;\n }\n\n /// @notice Pause conversion of tokens\n /// @custom:event Emits ConversionPaused on success\n /// @custom:error ConversionTokensPaused thrown when conversion is already paused\n /// @custom:access Restricted by ACM\n function pauseConversion() external {\n _checkAccessAllowed(\"pauseConversion()\");\n _checkConversionPaused();\n conversionPaused = true;\n emit ConversionPaused(msg.sender);\n }\n\n /// @notice Resume conversion of tokens.\n /// @custom:event Emits ConversionResumed on success\n /// @custom:error ConversionTokensActive thrown when conversion is already active\n /// @custom:access Restricted by ACM\n function resumeConversion() external {\n _checkAccessAllowed(\"resumeConversion()\");\n if (!conversionPaused) {\n revert ConversionTokensActive();\n }\n\n conversionPaused = false;\n emit ConversionResumed(msg.sender);\n }\n\n /// @notice Sets a new price oracle\n /// @param priceOracle_ Address of the new price oracle to set\n /// @custom:access Only Governance\n function setPriceOracle(ResilientOracle priceOracle_) external onlyOwner {\n _setPriceOracle(priceOracle_);\n }\n\n /// @notice Sets a new destination address\n /// @param destinationAddress_ The new destination address to be set\n /// @custom:access Only Governance\n function setDestination(address destinationAddress_) external onlyOwner {\n _setDestination(destinationAddress_);\n }\n\n /// @notice Sets a converter network contract address\n /// @param converterNetwork_ The converterNetwork address to be set\n /// @custom:access Only Governance\n function setConverterNetwork(IConverterNetwork converterNetwork_) external onlyOwner {\n _setConverterNetwork(converterNetwork_);\n }\n\n /// @notice Min amount to convert setter\n /// @param minAmountToConvert_ Min amount to convert\n /// @custom:access Only Governance\n function setMinAmountToConvert(uint256 minAmountToConvert_) external {\n _checkAccessAllowed(\"setMinAmountToConvert(uint256)\");\n _setMinAmountToConvert(minAmountToConvert_);\n }\n\n /// @notice Batch sets the conversion configurations\n /// @param tokenAddressIn Address of tokenIn\n /// @param tokenAddressesOut Array of addresses of tokenOut\n /// @param conversionConfigs Array of conversionConfig config details to update\n /// @custom:error InputLengthMisMatch is thrown when tokenAddressesOut and conversionConfigs array length mismatches\n function setConversionConfigs(\n address tokenAddressIn,\n address[] calldata tokenAddressesOut,\n ConversionConfig[] calldata conversionConfigs\n ) external {\n uint256 tokenOutArrayLength = tokenAddressesOut.length;\n if (tokenOutArrayLength != conversionConfigs.length) revert InputLengthMisMatch();\n\n for (uint256 i; i < tokenOutArrayLength; ) {\n setConversionConfig(tokenAddressIn, tokenAddressesOut[i], conversionConfigs[i]);\n unchecked {\n ++i;\n }\n }\n }\n\n /// @notice Converts exact amount of tokenAddressIn for tokenAddressOut if there is enough tokens held by the contract\n /// @dev Method does not support deflationary tokens transfer\n /// @param amountInMantissa Amount of tokenAddressIn\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @param to Address of the tokenAddressOut receiver\n /// @return actualAmountIn Actual amount transferred to destination\n /// @return actualAmountOut Actual amount transferred to user\n /// @custom:event Emits ConvertedExactTokens event on success\n /// @custom:error ZeroAddressNotAllowed is thrown when to address is zero\n /// @custom:error InvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOut\n /// @custom:error AmountOutLowerThanMinRequired error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa\n /// @custom:error AmountInMismatched error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa\n function convertExactTokens(\n uint256 amountInMantissa,\n uint256 amountOutMinMantissa,\n address tokenAddressIn,\n address tokenAddressOut,\n address to\n )\n external\n validConversionParameters(to, tokenAddressIn, tokenAddressOut)\n nonReentrant\n returns (uint256 actualAmountIn, uint256 actualAmountOut)\n {\n (actualAmountIn, actualAmountOut) = _convertExactTokens(\n amountInMantissa,\n amountOutMinMantissa,\n tokenAddressIn,\n tokenAddressOut,\n to\n );\n\n if (actualAmountIn != amountInMantissa) {\n revert AmountInMismatched();\n }\n\n _postConversionHook(tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\n emit ConvertedExactTokens(msg.sender, to, tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\n }\n\n /// @notice Converts tokens for tokenAddressIn for exact amount of tokenAddressOut if there is enough tokens held by the contract,\n /// otherwise the amount is adjusted\n /// @dev Method does not support deflationary tokens transfer\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @param to Address of the tokenAddressOut receiver\n /// @return actualAmountIn Actual amount transferred to destination\n /// @return actualAmountOut Actual amount transferred to user\n /// @custom:event Emits ConvertedForExactTokens event on success\n /// @custom:error ZeroAddressNotAllowed is thrown when to address is zero\n /// @custom:error InvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOut\n /// @custom:error AmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissa\n /// @custom:error AmountOutMismatched error is thrown when actualAmountOut is does not match amountOutMantissa\n function convertForExactTokens(\n uint256 amountInMaxMantissa,\n uint256 amountOutMantissa,\n address tokenAddressIn,\n address tokenAddressOut,\n address to\n )\n external\n validConversionParameters(to, tokenAddressIn, tokenAddressOut)\n nonReentrant\n returns (uint256 actualAmountIn, uint256 actualAmountOut)\n {\n (actualAmountIn, actualAmountOut) = _convertForExactTokens(\n amountInMaxMantissa,\n amountOutMantissa,\n tokenAddressIn,\n tokenAddressOut,\n to\n );\n\n if (actualAmountOut != amountOutMantissa) {\n revert AmountOutMismatched();\n }\n\n _postConversionHook(tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\n emit ConvertedForExactTokens(msg.sender, to, tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\n }\n\n /// @notice Converts exact amount of tokenAddressIn for tokenAddressOut if there is enough tokens held by the contract\n /// @param amountInMantissa Amount of tokenAddressIn\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @param to Address of the tokenAddressOut receiver\n /// @return actualAmountIn Actual amount transferred to destination\n /// @return actualAmountOut Actual amount transferred to user\n /// @custom:event Emits ConvertedExactTokensSupportingFeeOnTransferTokens event on success\n /// @custom:error ZeroAddressNotAllowed is thrown when to address is zero\n /// @custom:error InvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOut\n /// @custom:error AmountOutLowerThanMinRequired error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa\n function convertExactTokensSupportingFeeOnTransferTokens(\n uint256 amountInMantissa,\n uint256 amountOutMinMantissa,\n address tokenAddressIn,\n address tokenAddressOut,\n address to\n )\n external\n validConversionParameters(to, tokenAddressIn, tokenAddressOut)\n nonReentrant\n returns (uint256 actualAmountIn, uint256 actualAmountOut)\n {\n (actualAmountIn, actualAmountOut) = _convertExactTokens(\n amountInMantissa,\n amountOutMinMantissa,\n tokenAddressIn,\n tokenAddressOut,\n to\n );\n\n _postConversionHook(tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\n emit ConvertedExactTokensSupportingFeeOnTransferTokens(\n msg.sender,\n to,\n tokenAddressIn,\n tokenAddressOut,\n actualAmountIn,\n actualAmountOut\n );\n }\n\n /// @notice Converts tokens for tokenAddressIn for amount of tokenAddressOut calculated on the basis of amount of\n /// tokenAddressIn received by the contract, if there is enough tokens held by the contract, otherwise the amount is adjusted.\n /// The user will be responsible for bearing any fees associated with token transfers, whether pulling in or pushing out tokens\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @param to Address of the tokenAddressOut receiver\n /// @return actualAmountIn Actual amount transferred to destination\n /// @return actualAmountOut Actual amount transferred to user\n /// @custom:event Emits ConvertedForExactTokensSupportingFeeOnTransferTokens event on success\n /// @custom:error ZeroAddressNotAllowed is thrown when to address is zero\n /// @custom:error InvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOut\n /// @custom:error AmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissa\n function convertForExactTokensSupportingFeeOnTransferTokens(\n uint256 amountInMaxMantissa,\n uint256 amountOutMantissa,\n address tokenAddressIn,\n address tokenAddressOut,\n address to\n )\n external\n validConversionParameters(to, tokenAddressIn, tokenAddressOut)\n nonReentrant\n returns (uint256 actualAmountIn, uint256 actualAmountOut)\n {\n (actualAmountIn, actualAmountOut) = _convertForExactTokensSupportingFeeOnTransferTokens(\n amountInMaxMantissa,\n amountOutMantissa,\n tokenAddressIn,\n tokenAddressOut,\n to\n );\n\n _postConversionHook(tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\n emit ConvertedForExactTokensSupportingFeeOnTransferTokens(\n msg.sender,\n to,\n tokenAddressIn,\n tokenAddressOut,\n actualAmountIn,\n actualAmountOut\n );\n }\n\n /// @notice To sweep ERC20 tokens and transfer them to user(to address)\n /// @param tokenAddress The address of the ERC-20 token to sweep\n /// @param to The address to which tokens will be transferred\n /// @param amount The amount to transfer\n /// @custom:event Emits SweepToken event on success\n /// @custom:error ZeroAddressNotAllowed is thrown when tokenAddress/to address is zero\n /// @custom:access Only Governance\n function sweepToken(\n address tokenAddress,\n address to,\n uint256 amount\n ) external onlyOwner nonReentrant {\n ensureNonzeroAddress(tokenAddress);\n ensureNonzeroAddress(to);\n ensureNonzeroValue(amount);\n\n IERC20Upgradeable token = IERC20Upgradeable(tokenAddress);\n preSweepToken(tokenAddress, amount);\n token.safeTransfer(to, amount);\n\n emit SweepToken(tokenAddress, to, amount);\n }\n\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn.\n /// This function does not account for potential token transfer fees(in case of deflationary tokens)\n /// @notice The amountInMantissa might be adjusted if amountOutMantissa is greater than the balance of the contract for tokenAddressOut\n /// @dev This function retrieves values without altering token prices\n /// @param amountInMantissa Amount of tokenAddressIn\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @return amountConvertedMantissa Amount of tokenAddressIn should be transferred after conversion\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\n /// @custom:error ConversionEnabledOnlyForPrivateConversions is thrown when conversion is only enabled for private conversion\n function getAmountOut(\n uint256 amountInMantissa,\n address tokenAddressIn,\n address tokenAddressOut\n ) external view returns (uint256 amountConvertedMantissa, uint256 amountOutMantissa) {\n if (\n conversionConfigurations[tokenAddressIn][tokenAddressOut].conversionAccess ==\n ConversionAccessibility.ONLY_FOR_CONVERTERS\n ) {\n revert ConversionEnabledOnlyForPrivateConversions();\n }\n\n amountConvertedMantissa = amountInMantissa;\n uint256 tokenInToOutConversion;\n (amountOutMantissa, tokenInToOutConversion) = _getAmountOut(amountInMantissa, tokenAddressIn, tokenAddressOut);\n\n uint256 maxTokenOutReserve = balanceOf(tokenAddressOut);\n\n /// If contract has less liquidity for tokenAddressOut than amountOutMantissa\n if (maxTokenOutReserve < amountOutMantissa) {\n amountConvertedMantissa =\n ((maxTokenOutReserve * EXP_SCALE) + tokenInToOutConversion - 1) /\n tokenInToOutConversion; //round-up\n amountOutMantissa = maxTokenOutReserve;\n }\n }\n\n /// @notice To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut.\n /// This function does not account for potential token transfer fees(in case of deflationary tokens)\n /// @dev This function retrieves values without altering token prices\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @return amountConvertedMantissa Amount of tokenAddressOut should be transferred after conversion\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\n /// @custom:error ConversionEnabledOnlyForPrivateConversions is thrown when conversion is only enabled for private conversion\n function getAmountIn(\n uint256 amountOutMantissa,\n address tokenAddressIn,\n address tokenAddressOut\n ) external view returns (uint256 amountConvertedMantissa, uint256 amountInMantissa) {\n if (\n conversionConfigurations[tokenAddressIn][tokenAddressOut].conversionAccess ==\n ConversionAccessibility.ONLY_FOR_CONVERTERS\n ) {\n revert ConversionEnabledOnlyForPrivateConversions();\n }\n\n uint256 maxTokenOutReserve = balanceOf(tokenAddressOut);\n\n /// If contract has less liquidity for tokenAddressOut than amountOutMantissa\n if (maxTokenOutReserve < amountOutMantissa) {\n amountOutMantissa = maxTokenOutReserve;\n }\n\n amountConvertedMantissa = amountOutMantissa;\n (amountInMantissa, ) = _getAmountIn(amountOutMantissa, tokenAddressIn, tokenAddressOut);\n }\n\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn\n /// @param amountInMantissa Amount of tokenAddressIn\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @return amountConvertedMantissa Amount of tokenAddressIn should be transferred after conversion\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\n function getUpdatedAmountOut(\n uint256 amountInMantissa,\n address tokenAddressIn,\n address tokenAddressOut\n ) public returns (uint256 amountConvertedMantissa, uint256 amountOutMantissa) {\n priceOracle.updateAssetPrice(tokenAddressIn);\n priceOracle.updateAssetPrice(tokenAddressOut);\n\n (amountOutMantissa, ) = _getAmountOut(amountInMantissa, tokenAddressIn, tokenAddressOut);\n amountConvertedMantissa = amountInMantissa;\n }\n\n /// @notice To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @return amountConvertedMantissa Amount of tokenAddressOut should be transferred after conversion\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\n function getUpdatedAmountIn(\n uint256 amountOutMantissa,\n address tokenAddressIn,\n address tokenAddressOut\n ) public returns (uint256 amountConvertedMantissa, uint256 amountInMantissa) {\n priceOracle.updateAssetPrice(tokenAddressIn);\n priceOracle.updateAssetPrice(tokenAddressOut);\n\n (amountInMantissa, ) = _getAmountIn(amountOutMantissa, tokenAddressIn, tokenAddressOut);\n amountConvertedMantissa = amountOutMantissa;\n }\n\n /// @notice This method updated the states of this contract after getting funds from PSR\n /// after settling the amount(if any) through privateConversion between converters\n /// @dev This function is called by protocolShareReserve\n /// @dev call _updateAssetsState to update the states related to the comptroller and asset transfer to the specific converter then\n /// it calls the _privateConversion which will convert the asset into destination's base asset and transfer it to destination address\n /// @param comptroller Comptroller address (pool)\n /// @param asset Asset address\n function updateAssetsState(address comptroller, address asset) public nonReentrant {\n uint256 balanceDiff = _updateAssetsState(comptroller, asset);\n if (balanceDiff > 0) {\n _privateConversion(comptroller, asset, balanceDiff);\n }\n }\n\n /// @notice Set the configuration for new or existing conversion pair\n /// @param tokenAddressIn Address of tokenIn\n /// @param tokenAddressOut Address of tokenOut\n /// @param conversionConfig ConversionConfig config details to update\n /// @custom:event Emits ConversionConfigUpdated event on success\n /// @custom:error Unauthorized error is thrown when the call is not authorized by AccessControlManager\n /// @custom:error ZeroAddressNotAllowed is thrown when pool registry address is zero\n /// @custom:error NonZeroIncentiveForPrivateConversion is thrown when incentive is non zero for private conversion\n /// @custom:access Controlled by AccessControlManager\n function setConversionConfig(\n address tokenAddressIn,\n address tokenAddressOut,\n ConversionConfig calldata conversionConfig\n ) public {\n _checkAccessAllowed(\"setConversionConfig(address,address,ConversionConfig)\");\n ensureNonzeroAddress(tokenAddressIn);\n ensureNonzeroAddress(tokenAddressOut);\n\n if (conversionConfig.incentive > MAX_INCENTIVE) {\n revert IncentiveTooHigh(conversionConfig.incentive, MAX_INCENTIVE);\n }\n\n if (\n (tokenAddressIn == tokenAddressOut) ||\n (tokenAddressIn != _getDestinationBaseAsset()) ||\n conversionConfigurations[tokenAddressOut][tokenAddressIn].conversionAccess != ConversionAccessibility.NONE\n ) {\n revert InvalidTokenConfigAddresses();\n }\n\n if (\n (conversionConfig.conversionAccess == ConversionAccessibility.ONLY_FOR_CONVERTERS) &&\n conversionConfig.incentive != 0\n ) {\n revert NonZeroIncentiveForPrivateConversion();\n }\n\n if (\n ((conversionConfig.conversionAccess == ConversionAccessibility.ONLY_FOR_CONVERTERS) ||\n (conversionConfig.conversionAccess == ConversionAccessibility.ALL)) &&\n (address(converterNetwork) == address(0))\n ) {\n revert InvalidConverterNetwork();\n }\n\n ConversionConfig storage configuration = conversionConfigurations[tokenAddressIn][tokenAddressOut];\n\n emit ConversionConfigUpdated(\n tokenAddressIn,\n tokenAddressOut,\n configuration.incentive,\n conversionConfig.incentive,\n configuration.conversionAccess,\n conversionConfig.conversionAccess\n );\n\n if (conversionConfig.conversionAccess == ConversionAccessibility.NONE) {\n delete conversionConfigurations[tokenAddressIn][tokenAddressOut];\n } else {\n configuration.incentive = conversionConfig.incentive;\n configuration.conversionAccess = conversionConfig.conversionAccess;\n }\n }\n\n /// @notice Get the balance for specific token\n /// @param token Address of the token\n /// @return tokenBalance Balance of the token the contract has\n function balanceOf(address token) public view virtual returns (uint256 tokenBalance);\n\n /// @dev Operations to perform before sweeping tokens\n /// @param token Address of the token\n /// @param amount Amount transferred to address(to)\n function preSweepToken(address token, uint256 amount) internal virtual {}\n\n /// @dev Converts exact amount of tokenAddressIn for tokenAddressOut\n /// @param amountInMantissa Amount of tokenAddressIn\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @param to Address of the tokenAddressOut receiver\n /// @return actualAmountIn Actual amount of tokenAddressIn transferred\n /// @return amountOutMantissa Actual amount of tokenAddressOut transferred\n /// @custom:error AmountOutLowerThanMinRequired error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa\n function _convertExactTokens(\n uint256 amountInMantissa,\n uint256 amountOutMinMantissa,\n address tokenAddressIn,\n address tokenAddressOut,\n address to\n ) internal returns (uint256 actualAmountIn, uint256 amountOutMantissa) {\n _checkPrivateConversion(tokenAddressIn, tokenAddressOut);\n actualAmountIn = _doTransferIn(tokenAddressIn, amountInMantissa);\n\n (, amountOutMantissa) = getUpdatedAmountOut(actualAmountIn, tokenAddressIn, tokenAddressOut);\n\n if (amountOutMantissa < amountOutMinMantissa) {\n revert AmountOutLowerThanMinRequired(amountOutMantissa, amountOutMinMantissa);\n }\n\n _doTransferOut(tokenAddressOut, to, amountOutMantissa);\n }\n\n /// @dev Converts tokens for tokenAddressIn for exact amount of tokenAddressOut used for non deflationry tokens\n /// it is called by convertForExactTokens function\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @param to Address of the tokenAddressOut receiver\n /// @return actualAmountIn Actual amount of tokenAddressIn transferred\n /// @return actualAmountOut Actual amount of tokenAddressOut transferred\n /// @custom:error DeflationaryTokenNotSupported is thrown if tokenAddressIn is deflationary token\n /// @custom:error AmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissa\n function _convertForExactTokens(\n uint256 amountInMaxMantissa,\n uint256 amountOutMantissa,\n address tokenAddressIn,\n address tokenAddressOut,\n address to\n ) internal returns (uint256 actualAmountIn, uint256 actualAmountOut) {\n _checkPrivateConversion(tokenAddressIn, tokenAddressOut);\n (, uint256 amountInMantissa) = getUpdatedAmountIn(amountOutMantissa, tokenAddressIn, tokenAddressOut);\n\n actualAmountIn = _doTransferIn(tokenAddressIn, amountInMantissa);\n\n if (actualAmountIn != amountInMantissa) {\n revert DeflationaryTokenNotSupported();\n }\n\n if (actualAmountIn > amountInMaxMantissa) {\n revert AmountInHigherThanMax(amountInMantissa, amountInMaxMantissa);\n }\n\n _doTransferOut(tokenAddressOut, to, amountOutMantissa);\n actualAmountOut = amountOutMantissa;\n }\n\n /// @dev Converts tokens for tokenAddressIn for the amount of tokenAddressOut used for deflationary tokens\n /// it is called by convertForExactTokensSupportingFeeOnTransferTokens function\n /// @notice Advising users to input a smaller amountOutMantissa to avoid potential transaction revert\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @param to Address of the tokenAddressOut receiver\n /// @return actualAmountIn Actual amount of tokenAddressIn transferred\n /// @return actualAmountOut Actual amount of tokenAddressOut transferred\n /// @custom:error AmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissa\n function _convertForExactTokensSupportingFeeOnTransferTokens(\n uint256 amountInMaxMantissa,\n uint256 amountOutMantissa,\n address tokenAddressIn,\n address tokenAddressOut,\n address to\n ) internal returns (uint256 actualAmountIn, uint256 actualAmountOut) {\n _checkPrivateConversion(tokenAddressIn, tokenAddressOut);\n (, uint256 amountInMantissa) = getUpdatedAmountIn(amountOutMantissa, tokenAddressIn, tokenAddressOut);\n\n if (amountInMantissa > amountInMaxMantissa) {\n revert AmountInHigherThanMax(amountInMantissa, amountInMaxMantissa);\n }\n\n actualAmountIn = _doTransferIn(tokenAddressIn, amountInMantissa);\n\n (, actualAmountOut) = getUpdatedAmountOut(actualAmountIn, tokenAddressIn, tokenAddressOut);\n\n _doTransferOut(tokenAddressOut, to, actualAmountOut);\n }\n\n /// @dev return actualAmountOut from reserves for tokenAddressOut\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @param to Address of the tokenAddressOut receiver\n /// @param amountConvertedMantissa Amount of tokenAddressOut supposed to get transferred\n /// @custom:error InsufficientPoolLiquidity If contract has less liquidity for tokenAddressOut than amountOutMantissa\n function _doTransferOut(\n address tokenAddressOut,\n address to,\n uint256 amountConvertedMantissa\n ) internal {\n uint256 maxTokenOutReserve = balanceOf(tokenAddressOut);\n\n /// If contract has less liquidity for tokenAddressOut than amountOutMantissa\n if (maxTokenOutReserve < amountConvertedMantissa) {\n revert InsufficientPoolLiquidity();\n }\n\n _preTransferHook(tokenAddressOut, amountConvertedMantissa);\n\n IERC20Upgradeable tokenOut = IERC20Upgradeable(tokenAddressOut);\n tokenOut.safeTransfer(to, amountConvertedMantissa);\n }\n\n /// @notice Transfer tokenAddressIn from user to destination\n /// @param tokenAddressIn Address of the token to convert\n /// @param amountInMantissa Amount of tokenAddressIn\n /// @return actualAmountIn Actual amount transferred to destination\n function _doTransferIn(address tokenAddressIn, uint256 amountInMantissa) internal returns (uint256 actualAmountIn) {\n IERC20Upgradeable tokenIn = IERC20Upgradeable(tokenAddressIn);\n uint256 balanceBeforeDestination = tokenIn.balanceOf(destinationAddress);\n tokenIn.safeTransferFrom(msg.sender, destinationAddress, amountInMantissa);\n uint256 balanceAfterDestination = tokenIn.balanceOf(destinationAddress);\n actualAmountIn = balanceAfterDestination - balanceBeforeDestination;\n }\n\n /// @dev Sets a new price oracle\n /// @param priceOracle_ Address of the new price oracle to set\n /// @custom:event Emits PriceOracleUpdated event on success\n /// @custom:error ZeroAddressNotAllowed is thrown when price oracle address is zero\n function _setPriceOracle(ResilientOracle priceOracle_) internal {\n ensureNonzeroAddress(address(priceOracle_));\n emit PriceOracleUpdated(priceOracle, priceOracle_);\n priceOracle = priceOracle_;\n }\n\n /// @dev Sets a new destination address\n /// @param destinationAddress_ The new destination address to be set\n /// @custom:event Emits DestinationAddressUpdated event on success\n /// @custom:error ZeroAddressNotAllowed is thrown when destination address is zero\n function _setDestination(address destinationAddress_) internal {\n ensureNonzeroAddress(destinationAddress_);\n emit DestinationAddressUpdated(destinationAddress, destinationAddress_);\n destinationAddress = destinationAddress_;\n }\n\n /// @notice Sets a converter network contract address\n /// @param converterNetwork_ The converterNetwork address to be set\n /// @custom:event Emits ConverterNetworkAddressUpdated event on success\n /// @custom:error ZeroAddressNotAllowed is thrown when address is zero\n function _setConverterNetwork(IConverterNetwork converterNetwork_) internal {\n ensureNonzeroAddress(address(converterNetwork_));\n emit ConverterNetworkAddressUpdated(address(converterNetwork), address(converterNetwork_));\n converterNetwork = converterNetwork_;\n }\n\n /// @notice Min amount to convert setter\n /// @param minAmountToConvert_ Min amount to convert\n /// @custom:event MinAmountToConvertUpdated is emitted in success\n /// @custom:error ZeroValueNotAllowed is thrown if the provided value is 0\n function _setMinAmountToConvert(uint256 minAmountToConvert_) internal {\n ensureNonzeroValue(minAmountToConvert_);\n emit MinAmountToConvertUpdated(minAmountToConvert, minAmountToConvert_);\n minAmountToConvert = minAmountToConvert_;\n }\n\n /// @dev Hook to perform after converting tokens\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @param amountIn Amount of tokenIn converted\n /// @param amountOut Amount of tokenOut converted\n function _postConversionHook(\n address tokenAddressIn,\n address tokenAddressOut,\n uint256 amountIn,\n uint256 amountOut\n ) internal virtual {}\n\n /// @param accessControlManager_ Access control manager contract address\n /// @param priceOracle_ Resilient oracle address\n /// @param destinationAddress_ Address at all incoming tokens will transferred to\n /// @param minAmountToConvert_ minimum amount to convert\n function __AbstractTokenConverter_init(\n address accessControlManager_,\n ResilientOracle priceOracle_,\n address destinationAddress_,\n uint256 minAmountToConvert_\n ) internal onlyInitializing {\n __AccessControlled_init(accessControlManager_);\n __ReentrancyGuard_init();\n __AbstractTokenConverter_init_unchained(priceOracle_, destinationAddress_, minAmountToConvert_);\n }\n\n /// @param priceOracle_ Resilient oracle address\n /// @param destinationAddress_ Address at all incoming tokens will transferred to\n /// @param minAmountToConvert_ minimum amount to convert\n function __AbstractTokenConverter_init_unchained(\n ResilientOracle priceOracle_,\n address destinationAddress_,\n uint256 minAmountToConvert_\n ) internal onlyInitializing {\n _setPriceOracle(priceOracle_);\n _setDestination(destinationAddress_);\n _setMinAmountToConvert(minAmountToConvert_);\n conversionPaused = false;\n }\n\n /// @dev _updateAssetsState hook to update the states of reserves transferred for the specific comptroller\n /// @param comptroller Comptroller address (pool)\n /// @param asset Asset address\n /// @return Amount of asset, for _privateConversion\n function _updateAssetsState(address comptroller, address asset) internal virtual returns (uint256) {}\n\n /// @dev This method is used to convert asset into base asset by converting them with other converters which supports the pair and transfer the funds to\n /// destination contract as destination's base asset\n /// @param comptroller Comptroller address (pool)\n /// @param tokenAddressOut Address of the token transferred to converter, and through _privateConversion it will be converted into base asset\n /// @param amountToConvert Amount of the tokenAddressOut transferred to converter\n function _privateConversion(\n address comptroller,\n address tokenAddressOut,\n uint256 amountToConvert\n ) internal {\n address tokenAddressIn = _getDestinationBaseAsset();\n address _destinationAddress = destinationAddress;\n uint256 convertedTokenInBalance;\n if (address(converterNetwork) != address(0)) {\n (address[] memory converterAddresses, uint256[] memory converterBalances) = converterNetwork\n .findTokenConvertersForConverters(tokenAddressOut, tokenAddressIn);\n uint256 convertersLength = converterAddresses.length;\n for (uint256 i; i < convertersLength; ) {\n if (converterBalances[i] == 0) break;\n (, uint256 amountIn) = IAbstractTokenConverter(converterAddresses[i]).getUpdatedAmountIn(\n converterBalances[i],\n tokenAddressOut,\n tokenAddressIn\n );\n if (amountIn > amountToConvert) {\n amountIn = amountToConvert;\n }\n\n if (!_validateMinAmountToConvert(amountIn, tokenAddressOut)) {\n break;\n }\n\n uint256 balanceBefore = IERC20Upgradeable(tokenAddressIn).balanceOf(_destinationAddress);\n\n IERC20Upgradeable(tokenAddressOut).approve(converterAddresses[i], amountIn);\n IAbstractTokenConverter(converterAddresses[i]).convertExactTokens(\n amountIn,\n 0,\n tokenAddressOut,\n tokenAddressIn,\n _destinationAddress\n );\n\n uint256 balanceAfter = IERC20Upgradeable(tokenAddressIn).balanceOf(_destinationAddress);\n amountToConvert -= amountIn;\n convertedTokenInBalance += (balanceAfter - balanceBefore);\n\n if (amountToConvert == 0) break;\n unchecked {\n ++i;\n }\n }\n }\n\n _postPrivateConversionHook(\n comptroller,\n tokenAddressIn,\n convertedTokenInBalance,\n tokenAddressOut,\n amountToConvert\n );\n }\n\n /// @dev This hook is used to update states for the converter after the privateConversion\n /// @param comptroller Comptroller address (pool)\n /// @param tokenAddressIn Address of the destination's base asset\n /// @param convertedTokenInBalance Amount of the base asset received after the conversion\n /// @param tokenAddressOut Address of the asset transferred to other converter in exchange of base asset\n /// @param convertedTokenOutBalance Amount of tokenAddressOut transferred from this converter\n function _postPrivateConversionHook(\n address comptroller,\n address tokenAddressIn,\n uint256 convertedTokenInBalance,\n address tokenAddressOut,\n uint256 convertedTokenOutBalance\n ) internal virtual {}\n\n /// @notice This hook is used to update the state for asset reserves before transferring tokenOut to user\n /// @param tokenOutAddress Address of the asset to be transferred to the user\n /// @param amountOut Amount of tokenAddressOut transferred from this converter\n function _preTransferHook(address tokenOutAddress, uint256 amountOut) internal virtual {}\n\n /// @dev Checks if amount to convert is greater than minimum amount to convert or not\n /// @param amountIn The amount to convert\n /// @param tokenAddress Address of the token\n /// @return isValid true if amount to convert is greater than minimum amount to convert\n function _validateMinAmountToConvert(uint256 amountIn, address tokenAddress) internal returns (bool isValid) {\n priceOracle.updateAssetPrice(tokenAddress);\n uint256 amountInInUsd = (priceOracle.getPrice(tokenAddress) * amountIn) / EXP_SCALE;\n\n if (amountInInUsd >= minAmountToConvert) {\n isValid = true;\n }\n }\n\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn\n /// @dev This function retrieves values without altering token prices.\n /// @param amountInMantissa Amount of tokenAddressIn\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\n /// @return tokenInToOutConversion Ratio of tokenIn price and incentive for conversion with tokenOut price\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\n function _getAmountOut(\n uint256 amountInMantissa,\n address tokenAddressIn,\n address tokenAddressOut\n ) internal view returns (uint256 amountOutMantissa, uint256 tokenInToOutConversion) {\n if (amountInMantissa == 0) {\n revert InsufficientInputAmount();\n }\n\n ConversionConfig memory configuration = conversionConfigurations[tokenAddressIn][tokenAddressOut];\n\n if (configuration.conversionAccess == ConversionAccessibility.NONE) {\n revert ConversionConfigNotEnabled();\n }\n\n uint256 tokenInUnderlyingPrice = priceOracle.getPrice(tokenAddressIn);\n uint256 tokenOutUnderlyingPrice = priceOracle.getPrice(tokenAddressOut);\n\n uint256 incentive = configuration.incentive;\n if (address(converterNetwork) != address(0) && (converterNetwork.isTokenConverter(msg.sender))) {\n incentive = 0;\n }\n\n /// conversion rate after considering incentive(conversionWithIncentive)\n uint256 conversionWithIncentive = MANTISSA_ONE + incentive;\n\n /// amount of tokenAddressOut after including incentive as amountOutMantissa will be greater than actual as it gets\n /// multiplied by conversionWithIncentive which will be >= 1\n amountOutMantissa =\n (amountInMantissa * tokenInUnderlyingPrice * conversionWithIncentive) /\n (tokenOutUnderlyingPrice * EXP_SCALE);\n\n tokenInToOutConversion = (tokenInUnderlyingPrice * conversionWithIncentive) / tokenOutUnderlyingPrice;\n }\n\n /// @dev To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut\n /// @dev This function retrieves values without altering token prices.\n /// @dev For user conversions, the function returns an amountInMantissa that is rounded up, ensuring that the equivalent amountInMantissa\n /// is obtained from users for corresponding amountOutMantissa, preventing any losses to the protocol. However, no rounding up is required for private conversions\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\n /// @return tokenInToOutConversion Ratio of tokenIn price and incentive for conversion with tokenOut price\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\n function _getAmountIn(\n uint256 amountOutMantissa,\n address tokenAddressIn,\n address tokenAddressOut\n ) internal view returns (uint256 amountInMantissa, uint256 tokenInToOutConversion) {\n if (amountOutMantissa == 0) {\n revert InsufficientOutputAmount();\n }\n\n ConversionConfig memory configuration = conversionConfigurations[tokenAddressIn][tokenAddressOut];\n\n if (configuration.conversionAccess == ConversionAccessibility.NONE) {\n revert ConversionConfigNotEnabled();\n }\n\n uint256 tokenInUnderlyingPrice = priceOracle.getPrice(tokenAddressIn);\n uint256 tokenOutUnderlyingPrice = priceOracle.getPrice(tokenAddressOut);\n\n uint256 incentive = configuration.incentive;\n\n bool isPrivateConversion = address(converterNetwork) != address(0) &&\n converterNetwork.isTokenConverter(msg.sender);\n if (isPrivateConversion) {\n incentive = 0;\n }\n\n /// conversion rate after considering incentive(conversionWithIncentive)\n uint256 conversionWithIncentive = MANTISSA_ONE + incentive;\n tokenInToOutConversion = (tokenInUnderlyingPrice * conversionWithIncentive) / tokenOutUnderlyingPrice;\n\n /// amount of tokenAddressIn after considering incentive(i.e. amountInMantissa will be less than actual amountInMantissa if incentive > 0)\n if (isPrivateConversion) {\n amountInMantissa = (amountOutMantissa * EXP_SCALE) / tokenInToOutConversion;\n } else {\n amountInMantissa = ((amountOutMantissa * EXP_SCALE) + tokenInToOutConversion - 1) / tokenInToOutConversion; //round-up\n }\n }\n\n /// @dev Check if msg.sender is allowed to convert as per onlyForPrivateConversions flag\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @custom:error ConversionEnabledOnlyForPrivateConversions is thrown when conversion is only enabled for private conversion\n function _checkPrivateConversion(address tokenAddressIn, address tokenAddressOut) internal view {\n bool isConverter = (address(converterNetwork) != address(0)) && converterNetwork.isTokenConverter(msg.sender);\n if (\n (!(isConverter) &&\n (conversionConfigurations[tokenAddressIn][tokenAddressOut].conversionAccess ==\n ConversionAccessibility.ONLY_FOR_CONVERTERS))\n ) {\n revert ConversionEnabledOnlyForPrivateConversions();\n }\n }\n\n /// @dev To check, is conversion paused\n /// @custom:error ConversionTokensPaused is thrown when token conversion is paused\n function _checkConversionPaused() internal view {\n if (conversionPaused) {\n revert ConversionTokensPaused();\n }\n }\n\n /// @dev Get base asset address of the destination contract\n /// @return Address of the base asset\n function _getDestinationBaseAsset() internal view virtual returns (address) {}\n}\n" + }, + "contracts/TokenConverter/IAbstractTokenConverter.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.13;\n\nimport { ResilientOracle } from \"@venusprotocol/oracle/contracts/ResilientOracle.sol\";\nimport { IConverterNetwork } from \"../Interfaces/IConverterNetwork.sol\";\n\n/// @notice Interface for AbstractTokenConverter\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\ninterface IAbstractTokenConverter {\n /// @notice This enum define the all possible ways of conversion can happen\n enum ConversionAccessibility {\n NONE, // Conversion is disable for the pair\n ALL, // Conversion is enable for private conversion and users\n ONLY_FOR_CONVERTERS, // Conversion is enable only for private conversion\n ONLY_FOR_USERS // Conversion is enable only for users\n }\n\n /// @notice This struct represents the configuration for a token conversion.\n struct ConversionConfig {\n /// incentive on conversion of tokens in mantissa i.e 10% incentive would be 0.1 * 1e18\n uint256 incentive;\n /// enable or disable conversion for users or converters or both or none\n ConversionAccessibility conversionAccess;\n }\n\n /// @notice Pause conversion of tokens\n function pauseConversion() external;\n\n /// @notice Resume conversion of tokens.\n function resumeConversion() external;\n\n /// @notice Sets a new price oracle\n /// @param priceOracle_ Address of the new price oracle to set\n function setPriceOracle(ResilientOracle priceOracle_) external;\n\n /// @notice Set the configuration for new or existing convert pair\n /// @param tokenAddressIn Address of tokenIn\n /// @param tokenAddressOut Address of tokenOut\n /// @param conversionConfig ConversionConfig config details to update\n function setConversionConfig(\n address tokenAddressIn,\n address tokenAddressOut,\n ConversionConfig calldata conversionConfig\n ) external;\n\n /// @notice Convert exact amount of tokenAddressIn for tokenAddressOut\n /// @dev Method does not support deflationary tokens transfer\n /// @param amountInMantissa Amount of tokenAddressIn\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after convert\n /// @param to Address of the tokenAddressOut receiver\n function convertExactTokens(\n uint256 amountInMantissa,\n uint256 amountOutMinMantissa,\n address tokenAddressIn,\n address tokenAddressOut,\n address to\n ) external returns (uint256 actualAmountIn, uint256 actualAmountOut);\n\n /// @notice Convert tokens for tokenAddressIn for exact amount of tokenAddressOut\n /// @dev Method does not support deflationary tokens transfer\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after convert\n /// @param to Address of the tokenAddressOut receiver\n function convertForExactTokens(\n uint256 amountInMaxMantissa,\n uint256 amountOutMantissa,\n address tokenAddressIn,\n address tokenAddressOut,\n address to\n ) external returns (uint256 actualAmountIn, uint256 actualAmountOut);\n\n /// @notice Convert exact amount of tokenAddressIn for tokenAddressOut\n /// @param amountInMantissa Amount of tokenAddressIn\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after convert\n /// @param to Address of the tokenAddressOut receiver\n function convertExactTokensSupportingFeeOnTransferTokens(\n uint256 amountInMantissa,\n uint256 amountOutMinMantissa,\n address tokenAddressIn,\n address tokenAddressOut,\n address to\n ) external returns (uint256 actualAmountIn, uint256 actualAmountOut);\n\n /// @notice Convert tokens for tokenAddressIn for exact amount of tokenAddressOut\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after convert\n /// @param to Address of the tokenAddressOut receiver\n function convertForExactTokensSupportingFeeOnTransferTokens(\n uint256 amountInMaxMantissa,\n uint256 amountOutMantissa,\n address tokenAddressIn,\n address tokenAddressOut,\n address to\n ) external returns (uint256 actualAmountIn, uint256 actualAmountOut);\n\n /// @notice Get the configuration for the pair of the tokens\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @return incentives Percentage of incentives to be distributed for the pair of tokens\n /// @return conversionAccess Accessibility for the pair of tokens\n function conversionConfigurations(address tokenAddressIn, address tokenAddressOut)\n external\n returns (uint256 incentives, ConversionAccessibility conversionAccess);\n\n /// @notice Get the address of the converterNetwork\n function converterNetwork() external returns (IConverterNetwork converterNetwork);\n\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn\n /// @param amountInMantissa Amount of tokenAddressIn\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @return amountConvertedMantissa Amount of tokenAddressIn should be transferred after conversion\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\n function getUpdatedAmountOut(\n uint256 amountInMantissa,\n address tokenAddressIn,\n address tokenAddressOut\n ) external returns (uint256 amountConvertedMantissa, uint256 amountOutMantissa);\n\n /// @notice To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @return amountConvertedMantissa Amount of tokenAddressOut should be transferred after conversion\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\n function getUpdatedAmountIn(\n uint256 amountOutMantissa,\n address tokenAddressIn,\n address tokenAddressOut\n ) external returns (uint256 amountConvertedMantissa, uint256 amountInMantissa);\n\n /// @notice To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut\n /// @dev This function retrieves values without altering token prices.\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @return amountConvertedMantissa Amount of tokenAddressOut should be transferred after conversion\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\n function getAmountIn(\n uint256 amountOutMantissa,\n address tokenAddressIn,\n address tokenAddressOut\n ) external view returns (uint256 amountConvertedMantissa, uint256 amountInMantissa);\n\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn\n /// @dev This function retrieves values without altering token prices.\n /// @param amountInMantissa Amount of tokenAddressIn\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @return amountConvertedMantissa Amount of tokenAddressIn should be transferred after conversion\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\n function getAmountOut(\n uint256 amountInMantissa,\n address tokenAddressIn,\n address tokenAddressOut\n ) external view returns (uint256 amountConvertedMantissa, uint256 amountOutMantissa);\n\n /// @notice Get the balance for specific token\n /// @param token Address of the token\n /// @return tokenBalance Balance of the token the contract has\n function balanceOf(address token) external view returns (uint256 tokenBalance);\n}\n" + }, + "contracts/TokenConverter/RiskFundConverter.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.13;\n\nimport { SafeERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\";\nimport { IERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\";\nimport { ResilientOracle } from \"@venusprotocol/oracle/contracts/ResilientOracle.sol\";\nimport { ensureNonzeroAddress, ensureNonzeroValue } from \"@venusprotocol/solidity-utilities/contracts/validators.sol\";\n\nimport { AbstractTokenConverter } from \"./AbstractTokenConverter.sol\";\nimport { IPoolRegistry } from \"../Interfaces/IPoolRegistry.sol\";\nimport { IComptroller } from \"../Interfaces/IComptroller.sol\";\nimport { IRiskFund, IRiskFundGetters } from \"../Interfaces/IRiskFund.sol\";\nimport { IVToken } from \"../Interfaces/IVToken.sol\";\n\n/// @title RiskFundConverter\n/// @author Venus\n/// @notice RiskFundConverter used for token conversions and sends received token to RiskFund\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\ncontract RiskFundConverter is AbstractTokenConverter {\n using SafeERC20Upgradeable for IERC20Upgradeable;\n\n /// @notice Address of the core pool comptroller\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address public immutable CORE_POOL_COMPTROLLER;\n\n ///@notice Address of the vBNB\n ///@dev This address is used to include the BNB market while in getPools method\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address public immutable VBNB;\n\n ///@notice Address of the native wrapped currency\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address public immutable NATIVE_WRAPPED;\n\n /// @notice Store the previous state for the asset transferred to ProtocolShareReserve combined(for all pools)\n mapping(address => uint256) internal assetsReserves;\n\n /// @notice Store the asset's reserve per pool in the ProtocolShareReserve\n /// @dev Comptroller(pool) -> Asset -> amount\n mapping(address => mapping(address => uint256)) internal poolsAssetsReserves;\n\n /// @notice Address of pool registry contract\n address public poolRegistry;\n\n /// @notice The mapping contains the assets for each pool which are sent to RiskFund directly\n /// @dev Comptroller(pool) -> Asset -> bool(should transfer directly on true)\n mapping(address => mapping(address => bool)) public poolsAssetsDirectTransfer;\n\n /// @notice Emitted when pool registry address is updated\n event PoolRegistryUpdated(address indexed oldPoolRegistry, address indexed newPoolRegistry);\n\n /// @notice Emitted after updating of the assets reserves\n /// amount -> reserve increased by amount\n event AssetsReservesUpdated(address indexed comptroller, address indexed asset, uint256 amount);\n\n /// @notice Emmitted after the funds transferred to the destination address\n event AssetTransferredToDestination(\n address indexed receiver,\n address indexed comptroller,\n address indexed asset,\n uint256 amount\n );\n\n /// @notice Emitted after the poolsAssetsDirectTransfer mapping is updated\n event PoolAssetsDirectTransferUpdated(address indexed comptroller, address indexed asset, bool value);\n\n // Error thrown when comptrollers array length is not equal to assets array length\n error InvalidArguments();\n\n /// @notice thrown when amount entered is greater than balance\n error InsufficientBalance();\n\n /// @notice thrown when asset does not exist in the pool\n error MarketNotExistInPool(address comptroller, address asset);\n\n /// @notice thrown to prevent reentrancy\n /// @dev This error is used to safeguard against reentrancy attacks, ensuring that a certain operation\n /// cannot be called recursively within the same transaction.\n error ReentrancyGuardError();\n\n /// @param corePoolComptroller_ Address of the Comptroller pool\n /// @param vBNB_ Address of the vBNB\n /// @param nativeWrapped_ Address of the wrapped native currency\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor(\n address corePoolComptroller_,\n address vBNB_,\n address nativeWrapped_\n ) {\n ensureNonzeroAddress(corePoolComptroller_);\n ensureNonzeroAddress(vBNB_);\n ensureNonzeroAddress(nativeWrapped_);\n\n CORE_POOL_COMPTROLLER = corePoolComptroller_;\n VBNB = vBNB_;\n NATIVE_WRAPPED = nativeWrapped_;\n\n // Note that the contract is upgradeable. Use initialize() or reinitializers\n // to set the state variables.\n _disableInitializers();\n }\n\n /// @param accessControlManager_ Access control manager contract address\n /// @param priceOracle_ Resilient oracle address\n /// @param destinationAddress_ Address at all incoming tokens will transferred to\n /// @param poolRegistry_ Address of the pool registry\n /// @param minAmountToConvert_ minimum amount to convert\n /// @param comptrollers Addresses of the pools\n /// @param assets Addresses of the assets need to be added for direct transfer\n /// @param values Boolean value to indicate whether direct transfer is allowed for each asset.\n /// @custom:event PoolAssetsDirectTransferUpdated emits on success\n function initialize(\n address accessControlManager_,\n ResilientOracle priceOracle_,\n address destinationAddress_,\n address poolRegistry_,\n uint256 minAmountToConvert_,\n address[] calldata comptrollers,\n address[][] calldata assets,\n bool[][] calldata values\n ) public initializer {\n // Initialize AbstractTokenConverter\n __AbstractTokenConverter_init(accessControlManager_, priceOracle_, destinationAddress_, minAmountToConvert_);\n ensureNonzeroAddress(poolRegistry_);\n poolRegistry = poolRegistry_;\n _setPoolsAssetsDirectTransfer(comptrollers, assets, values);\n }\n\n /// @dev Pool registry setter\n /// @param poolRegistry_ Address of the pool registry\n /// @custom:event PoolRegistryUpdated emits on success\n /// @custom:error ZeroAddressNotAllowed is thrown when pool registry address is zero\n /// @custom:access Only Governance\n function setPoolRegistry(address poolRegistry_) external onlyOwner {\n ensureNonzeroAddress(poolRegistry_);\n emit PoolRegistryUpdated(poolRegistry, poolRegistry_);\n poolRegistry = poolRegistry_;\n }\n\n /// @notice Update the poolsAssetsDirectTransfer mapping\n /// @param comptrollers Addresses of the pools\n /// @param assets Addresses of the assets need to be added for direct transfer\n /// @param values Boolean value to indicate whether direct transfer is allowed for each asset.\n /// @custom:event PoolAssetsDirectTransferUpdated emits on success\n /// @custom:access Restricted by ACM\n function setPoolsAssetsDirectTransfer(\n address[] calldata comptrollers,\n address[][] calldata assets,\n bool[][] calldata values\n ) external {\n _checkAccessAllowed(\"setPoolsAssetsDirectTransfer(address[],address[][],bool[][])\");\n _setPoolsAssetsDirectTransfer(comptrollers, assets, values);\n }\n\n /// @dev Get the Amount of the asset in the risk fund for the specific pool\n /// @param comptroller Comptroller address (pool)\n /// @param asset Asset address\n /// @return reserves Asset's reserve in risk fund\n /// @custom:error MarketNotExistInPool When asset does not exist in the pool(comptroller)\n /// @custom:error ReentrancyGuardError thrown to prevent reentrancy during the function execution\n function getPoolAssetReserve(address comptroller, address asset) external view returns (uint256 reserves) {\n if (_reentrancyGuardEntered()) revert ReentrancyGuardError();\n if (!ensureAssetListed(comptroller, asset)) revert MarketNotExistInPool(comptroller, asset);\n\n reserves = poolsAssetsReserves[comptroller][asset];\n }\n\n /// @notice Get the balance for specific token\n /// @param tokenAddress Address of the token\n /// @return tokenBalance Reserves of the token the contract has\n function balanceOf(address tokenAddress) public view override returns (uint256 tokenBalance) {\n tokenBalance = assetsReserves[tokenAddress];\n }\n\n /// @notice Get the array of all pools addresses\n /// @param tokenAddress Address of the token\n /// @return poolsWithCore Array of the pools addresses in which token is available\n function getPools(address tokenAddress) public view returns (address[] memory poolsWithCore) {\n poolsWithCore = IPoolRegistry(poolRegistry).getPoolsSupportedByAsset(tokenAddress);\n\n if (isAssetListedInCore(tokenAddress)) {\n uint256 poolsLength = poolsWithCore.length;\n address[] memory extendedPools = new address[](poolsLength + 1);\n\n for (uint256 i; i < poolsLength; ) {\n extendedPools[i] = poolsWithCore[i];\n unchecked {\n ++i;\n }\n }\n\n extendedPools[poolsLength] = CORE_POOL_COMPTROLLER;\n poolsWithCore = extendedPools;\n }\n }\n\n /// @dev This hook is used to update the state for asset reserves before transferring tokenOut to user\n /// @param tokenOutAddress Address of the asset to be transferred to the user\n /// @param amountOut Amount of tokenAddressOut transferred from this converter\n function _preTransferHook(address tokenOutAddress, uint256 amountOut) internal override {\n assetsReserves[tokenOutAddress] -= amountOut;\n }\n\n /// @notice Hook to perform after converting tokens\n /// @dev After transformation poolsAssetsReserves are settled by pool's reserves fraction\n /// @param tokenInAddress Address of the tokenIn\n /// @param tokenOutAddress Address of the tokenOut\n /// @param amountIn Amount of tokenIn transferred\n /// @param amountOut Amount of tokenOut transferred\n /// @custom:event AssetTransferredToDestination emits on success for each pool which has share\n function _postConversionHook(\n address tokenInAddress,\n address tokenOutAddress,\n uint256 amountIn,\n uint256 amountOut\n ) internal override {\n address[] memory pools = getPools(tokenOutAddress);\n uint256 assetReserve = assetsReserves[tokenOutAddress] + amountOut;\n ensureNonzeroValue(assetReserve);\n\n uint256 poolsLength = pools.length;\n uint256 distributedOutShare;\n uint256 poolAmountInShare;\n uint256 distributedInShare;\n\n for (uint256 i; i < poolsLength; ) {\n uint256 currentPoolsAssetsReserves = poolsAssetsReserves[pools[i]][tokenOutAddress];\n if (currentPoolsAssetsReserves != 0) {\n if (i < (poolsLength - 1)) {\n distributedOutShare += updatePoolAssetsReserve(pools[i], tokenOutAddress, amountOut, assetReserve);\n poolAmountInShare = (amountIn * currentPoolsAssetsReserves) / assetReserve;\n distributedInShare += poolAmountInShare;\n } else {\n uint256 distributedDiff = amountOut - distributedOutShare;\n poolsAssetsReserves[pools[i]][tokenOutAddress] -= distributedDiff;\n emit AssetsReservesUpdated(pools[i], tokenOutAddress, distributedDiff);\n poolAmountInShare = amountIn - distributedInShare;\n }\n emit AssetTransferredToDestination(destinationAddress, pools[i], tokenInAddress, poolAmountInShare);\n IRiskFund(destinationAddress).updatePoolState(pools[i], tokenInAddress, poolAmountInShare);\n }\n unchecked {\n ++i;\n }\n }\n }\n\n /// @dev Operations to perform before sweeping tokens\n /// @param tokenAddress Address of the token\n /// @param amount Amount transferred to address(to)\n /// @custom:error InsufficientBalance is thrown when amount entered is greater than balance of token\n function preSweepToken(address tokenAddress, uint256 amount) internal override {\n uint256 balance = IERC20Upgradeable(tokenAddress).balanceOf(address(this));\n if (amount > balance) revert InsufficientBalance();\n uint256 balanceDiff = balance - assetsReserves[tokenAddress];\n\n if (balanceDiff < amount) {\n uint256 amountDiff;\n unchecked {\n amountDiff = amount - balanceDiff;\n }\n\n address[] memory pools = getPools(tokenAddress);\n uint256 assetReserve = assetsReserves[tokenAddress];\n uint256 poolsLength = pools.length;\n uint256 distributedShare;\n\n for (uint256 i; i < poolsLength; ) {\n if (poolsAssetsReserves[pools[i]][tokenAddress] != 0) {\n if (i < (poolsLength - 1)) {\n distributedShare += updatePoolAssetsReserve(pools[i], tokenAddress, amountDiff, assetReserve);\n } else {\n uint256 distributedDiff = amountDiff - distributedShare;\n poolsAssetsReserves[pools[i]][tokenAddress] -= distributedDiff;\n emit AssetsReservesUpdated(pools[i], tokenAddress, distributedDiff);\n }\n }\n unchecked {\n ++i;\n }\n }\n assetsReserves[tokenAddress] -= amountDiff;\n }\n }\n\n /// @dev Update the poolAssetsReserves upon transferring the tokens\n /// @param pool Address of the pool\n /// @param tokenAddress Address of the token\n /// @param amount Amount transferred to address(to)\n /// @param assetReserve Asset's reserve for the pool\n /// @return poolAmountShare Share of the pool as per it's reserve in compare to total reserves for the asset\n /// @custom:event AssetsReservesUpdated emits on success\n function updatePoolAssetsReserve(\n address pool,\n address tokenAddress,\n uint256 amount,\n uint256 assetReserve\n ) internal returns (uint256 poolAmountShare) {\n poolAmountShare = (poolsAssetsReserves[pool][tokenAddress] * amount) / assetReserve;\n poolsAssetsReserves[pool][tokenAddress] -= poolAmountShare;\n emit AssetsReservesUpdated(pool, tokenAddress, poolAmountShare);\n }\n\n /// @dev Update the poolsAssetsDirectTransfer mapping\n /// @param comptrollers Addresses of the pools\n /// @param assets Addresses of the assets need to be added for direct transfer\n /// @param values Boolean value to indicate whether direct transfer is allowed for each asset.\n /// @custom:event PoolAssetsDirectTransferUpdated emits on success\n /// @custom:error InvalidArguments thrown when comptrollers array length is not equal to assets array length\n function _setPoolsAssetsDirectTransfer(\n address[] calldata comptrollers,\n address[][] calldata assets,\n bool[][] calldata values\n ) internal {\n uint256 comptrollersLength = comptrollers.length;\n\n if ((comptrollersLength != assets.length) || (comptrollersLength != values.length)) {\n revert InvalidArguments();\n }\n\n for (uint256 i; i < comptrollersLength; ) {\n address[] memory poolAssets = assets[i];\n bool[] memory assetsValues = values[i];\n uint256 poolAssetsLength = poolAssets.length;\n\n if (poolAssetsLength != assetsValues.length) {\n revert InvalidArguments();\n }\n\n for (uint256 j; j < poolAssetsLength; ) {\n poolsAssetsDirectTransfer[comptrollers[i]][poolAssets[j]] = assetsValues[j];\n emit PoolAssetsDirectTransferUpdated(comptrollers[i], poolAssets[j], assetsValues[j]);\n unchecked {\n ++j;\n }\n }\n\n unchecked {\n ++i;\n }\n }\n }\n\n /// @dev Update the reserve of the asset for the specific pool after transferring to risk fund\n /// and transferring funds to the protocol share reserve\n /// @param comptroller Comptroller address (pool)\n /// @param asset Asset address\n /// @return balanceDifference Amount of asset, for _privateConversion\n /// @custom:event AssetTransferredToDestination emits when poolsAssetsDirectTransfer is enabled for entered comptroller and asset\n /// @custom:error MarketNotExistInPool When asset does not exist in the pool(comptroller)\n function _updateAssetsState(address comptroller, address asset)\n internal\n override\n returns (uint256 balanceDifference)\n {\n if (!ensureAssetListed(comptroller, asset)) revert MarketNotExistInPool(comptroller, asset);\n\n IERC20Upgradeable token = IERC20Upgradeable(asset);\n uint256 currentBalance = token.balanceOf(address(this));\n uint256 assetReserve = assetsReserves[asset];\n if (currentBalance > assetReserve) {\n unchecked {\n balanceDifference = currentBalance - assetReserve;\n }\n if (poolsAssetsDirectTransfer[comptroller][asset]) {\n uint256 previousDestinationBalance = token.balanceOf(destinationAddress);\n token.safeTransfer(destinationAddress, balanceDifference);\n uint256 newDestinationBalance = token.balanceOf(destinationAddress);\n\n emit AssetTransferredToDestination(destinationAddress, comptroller, asset, balanceDifference);\n IRiskFund(destinationAddress).updatePoolState(\n comptroller,\n asset,\n newDestinationBalance - previousDestinationBalance\n );\n balanceDifference = 0;\n }\n }\n }\n\n /// @dev This hook is used to update states for the converter after the privateConversion\n /// @param comptroller Comptroller address (pool)\n /// @param tokenAddressIn Address of the destination's base asset\n /// @param convertedTokenInBalance Amount of the base asset received after the conversion\n /// @param tokenAddressOut Address of the asset transferred to other converter in exchange of base asset\n /// @param convertedTokenOutBalance Amount of tokenAddressOut transferred from this converter\n function _postPrivateConversionHook(\n address comptroller,\n address tokenAddressIn,\n uint256 convertedTokenInBalance,\n address tokenAddressOut,\n uint256 convertedTokenOutBalance\n ) internal override {\n if (convertedTokenInBalance > 0) {\n emit AssetTransferredToDestination(\n destinationAddress,\n comptroller,\n tokenAddressIn,\n convertedTokenInBalance\n );\n IRiskFund(destinationAddress).updatePoolState(comptroller, tokenAddressIn, convertedTokenInBalance);\n }\n if (convertedTokenOutBalance > 0) {\n assetsReserves[tokenAddressOut] += convertedTokenOutBalance;\n poolsAssetsReserves[comptroller][tokenAddressOut] += convertedTokenOutBalance;\n emit AssetsReservesUpdated(comptroller, tokenAddressOut, convertedTokenOutBalance);\n }\n }\n\n /// @dev This function checks for the given asset is listed in core pool or not\n /// @param tokenAddress Address of the asset\n /// @return isAssetListed true if the asset is listed\n function isAssetListedInCore(address tokenAddress) internal view returns (bool isAssetListed) {\n address[] memory coreMarkets = IComptroller(CORE_POOL_COMPTROLLER).getAllMarkets();\n\n uint256 coreMarketsLength = coreMarkets.length;\n for (uint256 i; i < coreMarketsLength; ) {\n isAssetListed = (VBNB == coreMarkets[i])\n ? (tokenAddress == NATIVE_WRAPPED)\n : (IVToken(coreMarkets[i]).underlying() == tokenAddress);\n\n if (isAssetListed) {\n break;\n }\n\n unchecked {\n ++i;\n }\n }\n }\n\n /// @dev This function checks for the given asset is listed or not\n /// @param comptroller Address of the comptroller\n /// @param asset Address of the asset\n /// @return isListed true if the asset is listed\n function ensureAssetListed(address comptroller, address asset) internal view returns (bool isListed) {\n if (comptroller == CORE_POOL_COMPTROLLER) {\n isListed = isAssetListedInCore(asset);\n } else {\n isListed = IPoolRegistry(poolRegistry).getVTokenForAsset(comptroller, asset) != address(0);\n }\n }\n\n /// @dev Get base asset address of the RiskFund\n /// @return destinationBaseAsset Address of the base asset(RiskFund)\n function _getDestinationBaseAsset() internal view override returns (address destinationBaseAsset) {\n destinationBaseAsset = IRiskFundGetters(destinationAddress).convertibleBaseAsset();\n }\n}\n" + }, + "contracts/TokenConverter/SingleTokenConverter.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.13;\n\nimport { SafeERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\";\nimport { IERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\";\nimport { ResilientOracle } from \"@venusprotocol/oracle/contracts/ResilientOracle.sol\";\nimport { ensureNonzeroAddress } from \"@venusprotocol/solidity-utilities/contracts/validators.sol\";\n\nimport { AbstractTokenConverter } from \"./AbstractTokenConverter.sol\";\n\n/// @title SingleTokenConverter\n/// @author Venus\n/// @notice SingleTokenConverter used for token conversions and sends received tokens\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\ncontract SingleTokenConverter is AbstractTokenConverter {\n using SafeERC20Upgradeable for IERC20Upgradeable;\n\n /// @notice Address of the base asset token\n address public baseAsset;\n\n /// @notice Emitted when base asset is updated\n event BaseAssetUpdated(address indexed oldBaseAsset, address indexed newBaseAsset);\n\n /// @notice Emmitted after the funds transferred to the destination address\n event AssetTransferredToDestination(\n address indexed receiver,\n address indexed comptroller,\n address indexed asset,\n uint256 amount\n );\n\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor() {\n // Note that the contract is upgradeable. Use initialize() or reinitializers\n // to set the state variables.\n _disableInitializers();\n }\n\n /// @param accessControlManager_ Access control manager contract address\n /// @param priceOracle_ Resilient oracle address\n /// @param destinationAddress_ Address at all incoming tokens will transferred to\n /// @param baseAsset_ Address of the base asset\n /// @param minAmountToConvert_ Minimum amount to convert\n function initialize(\n address accessControlManager_,\n ResilientOracle priceOracle_,\n address destinationAddress_,\n address baseAsset_,\n uint256 minAmountToConvert_\n ) public initializer {\n _setBaseAsset(baseAsset_);\n\n // Initialize AbstractTokenConverter\n __AbstractTokenConverter_init(accessControlManager_, priceOracle_, destinationAddress_, minAmountToConvert_);\n }\n\n /// @notice Sets the base asset for the contract\n /// @param baseAsset_ The new address of the base asset\n /// @custom:access Only Governance\n function setBaseAsset(address baseAsset_) external onlyOwner {\n _setBaseAsset(baseAsset_);\n }\n\n /// @notice Get the balance for specific token\n /// @param tokenAddress Address of the token\n /// @return tokenBalance Balance of the token the contract has\n function balanceOf(address tokenAddress) public view override returns (uint256 tokenBalance) {\n IERC20Upgradeable token = IERC20Upgradeable(tokenAddress);\n tokenBalance = token.balanceOf(address(this));\n }\n\n /// @param comptroller Comptroller address (pool)\n /// @param asset Asset address.\n /// @return balanceLeft Amount of asset, for _privateConversion\n // solhint-disable-next-line\n function _updateAssetsState(address comptroller, address asset) internal override returns (uint256 balanceLeft) {\n IERC20Upgradeable token = IERC20Upgradeable(asset);\n uint256 balance = token.balanceOf(address(this));\n balanceLeft = balance;\n\n if (asset == baseAsset) {\n balanceLeft = 0;\n token.safeTransfer(destinationAddress, balance);\n emit AssetTransferredToDestination(destinationAddress, comptroller, asset, balance);\n }\n }\n\n /// @dev Sets the base asset for the contract\n /// @param baseAsset_ The new address of the base asset\n /// @custom:error ZeroAddressNotAllowed is thrown when address is zero\n /// @custom:event BaseAssetUpdated is emitted on success\n function _setBaseAsset(address baseAsset_) internal {\n ensureNonzeroAddress(baseAsset_);\n emit BaseAssetUpdated(baseAsset, baseAsset_);\n baseAsset = baseAsset_;\n }\n\n /// @dev Get base asset address\n /// @return destinationBaseAsset Address of the base asset(baseAsset)\n function _getDestinationBaseAsset() internal view override returns (address destinationBaseAsset) {\n destinationBaseAsset = baseAsset;\n }\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 10000 + }, + "outputSelection": { + "*": { + "*": [ + "storageLayout", + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "evm.gasEstimates" + ], + "": ["ast"] + } + }, + "metadata": { + "useLiteralContent": true + } + } +}