ConverterNetwork
ConverterNetwork
Keeps track of all the converters and is used to fetch valid converters which provide conversions according to token addresses provided
Solidity API
allConverters
Array holding all the converters
initialize
ConverterNetwork initializer
Parameters
_accessControlManager
address
The address of ACM contract
_loopsLimit
uint256
Limit for the loops in the contract to avoid DOS
📅 Events
ConverterAdded is emitted for each converter added on success
❌ Errors
InvalidMaxLoopsLimit is thrown when when loops limit is invalid
setMaxLoopsLimit
Set the limit for the loops can iterate to avoid the DOS
Parameters
limit
uint256
Limit for the max loops can execute at a time
⛔️ Access Requirements
Only owner
❌ Errors
InvalidMaxLoopsLimit is thrown when when loops limit is invalid
addTokenConverter
Adds new converter to the array
Parameters
_tokenConverter
contract IAbstractTokenConverter
Address of the token converter
📅 Events
ConverterAdded is emitted on success
⛔️ Access Requirements
Only Governance
removeTokenConverter
Removes converter from the array
Parameters
_tokenConverter
contract IAbstractTokenConverter
Address of the token converter
📅 Events
ConverterRemoved is emitted on success
⛔️ Access Requirements
Only Governance
❌ Errors
ConverterDoesNotExist is thrown when converter to remove does not exist
findTokenConverters
Used to get the array of converters supporting conversions, arranged in descending order based on token balances It will return the converters which are open to users for conversion
Parameters
_tokenAddressIn
address
Address of tokenIn
_tokenAddressOut
address
Address of tokenOut
Return Values
converters
address[]
Array of the conveters on the basis of the tokens pair
convertersBalance
uint256[]
Array of balances with respect to token out
findTokenConvertersForConverters
Used to get the array of converters supporting conversions, arranged in descending order based on token balances It will return the converters which are open to converters for conversion.
Parameters
_tokenAddressIn
address
Address of tokenIn
_tokenAddressOut
address
Address of tokenOut
Return Values
converters
address[]
Array of the conveters on the basis of the tokens pair
convertersBalance
uint256[]
Array of balances with respect to token out
getAllConverters
This function returns the array containing all the converters addresses
Return Values
converters
contract IAbstractTokenConverter[]
Array containing all the converters addresses
isTokenConverter
This function checks if the given address is a converter or not
Parameters
_tokenConverter
address
Address of the token converter
Return Values
isConverter
bool
true if given address is converter otherwise false
Last updated