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

contract IAbstractTokenConverter[] allConverters

initialize

ConverterNetwork initializer

function initialize(address _accessControlManager, uint256 _loopsLimit) external

Parameters

📅 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

function setMaxLoopsLimit(uint256 limit) external

Parameters

⛔️ Access Requirements

  • Only owner

❌ Errors

  • InvalidMaxLoopsLimit is thrown when when loops limit is invalid


addTokenConverter

Adds new converter to the array

function addTokenConverter(contract IAbstractTokenConverter _tokenConverter) external

Parameters

📅 Events

  • ConverterAdded is emitted on success

⛔️ Access Requirements

  • Only Governance


removeTokenConverter

Removes converter from the array

function removeTokenConverter(contract IAbstractTokenConverter _tokenConverter) external

Parameters

📅 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

function findTokenConverters(address _tokenAddressIn, address _tokenAddressOut) external returns (address[] converters, uint256[] convertersBalance)

Parameters

Return Values


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.

function findTokenConvertersForConverters(address _tokenAddressIn, address _tokenAddressOut) external returns (address[] converters, uint256[] convertersBalance)

Parameters

Return Values


getAllConverters

This function returns the array containing all the converters addresses

function getAllConverters() external view returns (contract IAbstractTokenConverter[] converters)

Return Values


isTokenConverter

This function checks if the given address is a converter or not

function isTokenConverter(address _tokenConverter) external view returns (bool isConverter)

Parameters

Return Values


Last updated