Last updated
Last updated
This contract provides every feature to configure and convert the desired assets.
Maximum incentive allowed
Min amount to convert for private conversions. Defined in USD, with 18 decimals
Venus price oracle contract
Conversion configurations for the existing pairs
Address that all incoming tokens are transferred to
Boolean for if conversion is paused
Address of the converterNetwork contract
Pause conversion of tokens
📅 Events
Emits ConversionPaused on success
⛔️ Access Requirements
Restricted by ACM
❌ Errors
ConversionTokensPaused thrown when conversion is already paused
Resume conversion of tokens.
📅 Events
Emits ConversionResumed on success
⛔️ Access Requirements
Restricted by ACM
❌ Errors
ConversionTokensActive thrown when conversion is already active
Sets a new price oracle
Parameters
⛔️ Access Requirements
Only Governance
Sets a new destination address
Parameters
⛔️ Access Requirements
Only Governance
Sets a converter network contract address
Parameters
⛔️ Access Requirements
Only Governance
Min amount to convert setter
Parameters
⛔️ Access Requirements
Only Governance
Batch sets the conversion configurations
Parameters
❌ Errors
InputLengthMisMatch is thrown when tokenAddressesOut and conversionConfigs array length mismatches
Converts exact amount of tokenAddressIn for tokenAddressOut if there is enough tokens held by the contract
Parameters
Return Values
📅 Events
Emits ConvertedExactTokens event on success
❌ Errors
ZeroAddressNotAllowed is thrown when to address is zero
InvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOut
AmountOutLowerThanMinRequired error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa
AmountInMismatched error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa
Converts tokens for tokenAddressIn for exact amount of tokenAddressOut if there are enough tokens held by the contract. otherwise the amount is adjusted
Parameters
Return Values
📅 Events
Emits ConvertedForExactTokens event on success
❌ Errors
ZeroAddressNotAllowed is thrown when to address is zero
InvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOut
AmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissa
AmountOutMismatched error is thrown when actualAmountOut is does not match amountOutMantissa
Converts exact amount of tokenAddressIn for tokenAddressOut if there is enough tokens held by the contract
Parameters
Return Values
📅 Events
Emits ConvertedExactTokensSupportingFeeOnTransferTokens event on success
❌ Errors
ZeroAddressNotAllowed is thrown when to address is zero
InvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOut
AmountOutLowerThanMinRequired error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa
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
Parameters
Return Values
📅 Events
Emits ConvertedForExactTokensSupportingFeeOnTransferTokens event on success
❌ Errors
ZeroAddressNotAllowed is thrown when to address is zero
InvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOut
AmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissa
To sweep ERC20 tokens and transfer them to user(to address)
Parameters
📅 Events
Emits SweepToken event on success
⛔️ Access Requirements
Only Governance
❌ Errors
ZeroAddressNotAllowed is thrown when tokenAddress/to address is zero
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)
Parameters
Return Values
❌ Errors
InsufficientInputAmount error is thrown when given input amount is zero
ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair
ConversionEnabledOnlyForPrivateConversions is thrown when conversion is only enabled for private conversion
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)
Parameters
Return Values
❌ Errors
InsufficientInputAmount error is thrown when given input amount is zero
ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair
ConversionEnabledOnlyForPrivateConversions is thrown when conversion is only enabled for private conversion
To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn
Parameters
Return Values
❌ Errors
InsufficientInputAmount error is thrown when given input amount is zero
ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair
To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut
Parameters
Return Values
❌ Errors
InsufficientInputAmount error is thrown when given input amount is zero
ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair
This method updates the states of this contract after getting funds from PSR after settling the amount(if any) through privateConversion between converters
Parameters
Set the configuration for new or existing conversion pair
Parameters
📅 Events
Emits ConversionConfigUpdated event on success
⛔️ Access Requirements
Controlled by AccessControlManager
❌ Errors
Unauthorized error is thrown when the call is not authorized by AccessControlManager
ZeroAddressNotAllowed is thrown when pool registry address is zero
NonZeroIncentiveForPrivateConversion is thrown when incentive is non zero for private conversion
Get the balance for specific token
Parameters
Return Values
priceOracle_
contract ResilientOracle
Address of the new price oracle to set
destinationAddress_
address
The new destination address to be set
converterNetwork_
contract IConverterNetwork
The converterNetwork address to be set
minAmountToConvert_
uint256
Min amount to convert
tokenAddressIn
address
Address of tokenIn
tokenAddressesOut
address[]
Array of addresses of tokenOut
conversionConfigs
struct IAbstractTokenConverter.ConversionConfig[]
Array of conversionConfig config details to update
amountInMantissa
uint256
Amount of tokenAddressIn
amountOutMinMantissa
uint256
Min amount of tokenAddressOut required as output
tokenAddressIn
address
Address of the token to convert
tokenAddressOut
address
Address of the token to get after conversion
to
address
Address of the tokenAddressOut receiver
actualAmountIn
uint256
Actual amount transferred to destination
actualAmountOut
uint256
Actual amount transferred to user
amountInMaxMantissa
uint256
Max amount of tokenAddressIn
amountOutMantissa
uint256
Amount of tokenAddressOut required as output
tokenAddressIn
address
Address of the token to convert
tokenAddressOut
address
Address of the token to get after conversion
to
address
Address of the tokenAddressOut receiver
actualAmountIn
uint256
Actual amount transferred to destination
actualAmountOut
uint256
Actual amount transferred to user
amountInMantissa
uint256
Amount of tokenAddressIn
amountOutMinMantissa
uint256
Min amount of tokenAddressOut required as output
tokenAddressIn
address
Address of the token to convert
tokenAddressOut
address
Address of the token to get after conversion
to
address
Address of the tokenAddressOut receiver
actualAmountIn
uint256
Actual amount transferred to destination
actualAmountOut
uint256
Actual amount transferred to user
amountInMaxMantissa
uint256
Max amount of tokenAddressIn
amountOutMantissa
uint256
Amount of tokenAddressOut required as output
tokenAddressIn
address
Address of the token to convert
tokenAddressOut
address
Address of the token to get after conversion
to
address
Address of the tokenAddressOut receiver
actualAmountIn
uint256
Actual amount transferred to destination
actualAmountOut
uint256
Actual amount transferred to user
tokenAddress
address
The address of the ERC-20 token to sweep
to
address
The address to which tokens will be transferred
amount
uint256
The amount to transfer
amountInMantissa
uint256
Amount of tokenAddressIn
tokenAddressIn
address
Address of the token to convert
tokenAddressOut
address
Address of the token to get after conversion
amountConvertedMantissa
uint256
Amount of tokenAddressIn should be transferred after conversion
amountOutMantissa
uint256
Amount of the tokenAddressOut sender should receive after conversion
amountOutMantissa
uint256
Amount of tokenAddressOut user wants to receive
tokenAddressIn
address
Address of the token to convert
tokenAddressOut
address
Address of the token to get after conversion
amountConvertedMantissa
uint256
Amount of tokenAddressOut should be transferred after conversion
amountInMantissa
uint256
Amount of the tokenAddressIn sender would send to contract before conversion
amountInMantissa
uint256
Amount of tokenAddressIn
tokenAddressIn
address
Address of the token to convert
tokenAddressOut
address
Address of the token to get after conversion
amountConvertedMantissa
uint256
Amount of tokenAddressIn should be transferred after conversion
amountOutMantissa
uint256
Amount of the tokenAddressOut sender should receive after conversion
amountOutMantissa
uint256
Amount of tokenAddressOut user wants to receive
tokenAddressIn
address
Address of the token to convert
tokenAddressOut
address
Address of the token to get after conversion
amountConvertedMantissa
uint256
Amount of tokenAddressOut should be transferred after conversion
amountInMantissa
uint256
Amount of the tokenAddressIn sender would send to contract before conversion
comptroller
address
Comptroller address (pool)
asset
address
Asset address
tokenAddressIn
address
Address of tokenIn
tokenAddressOut
address
Address of tokenOut
conversionConfig
struct IAbstractTokenConverter.ConversionConfig
ConversionConfig config details to update
token
address
Address of the token
tokenBalance
uint256
Balance of the token the contract has