ConverterNetwork
The ConverterNetwork contract serves as a registry for all deployed token converter instances within the Rheofi Protocol. It provides discovery and lookup capabilities, enabling other protocol components and external integrators to find the appropriate converter for a given token pair.
Overview
As the protocol deploys multiple SingleTokenConverter instances — each targeting a different destination asset — the ConverterNetwork maintains a centralized registry of all active converters. This allows programmatic discovery of available conversion routes, facilitating automated workflows and integration by bots, frontends, and other protocol contracts.
Key Functions
addTokenConverter
Registers a new token converter in the network. Restricted to governance.
function addTokenConverter(IAbstractTokenConverter tokenConverter) external;
removeTokenConverter
Removes a converter from the registry. Restricted to governance.
function removeTokenConverter(IAbstractTokenConverter tokenConverter) external;
findTokenConverters
Returns all registered converters that support a conversion from the specified input token to the specified output token.
function findTokenConverters(
address tokenAddressIn,
address tokenAddressOut
) external view returns (address[] memory converters, uint256[] memory amounts);
getAllConverters
Returns the complete list of registered converter addresses.
function getAllConverters() external view returns (IAbstractTokenConverter[] memory);