SingleTokenConverter
The SingleTokenConverter is a concrete implementation of the AbstractTokenConverter that handles conversions from multiple input tokens into a single designated output token. It is the primary converter deployed within the Rheofi Protocol for aggregating diverse revenue tokens into a unified target asset.
Overview
Each SingleTokenConverter instance is configured with a specific destination token and receives accumulated protocol revenue tokens from the ProtocolShareReserve. External participants can then call conversion functions to swap the held tokens into the target asset, earning an incentive for facilitating the conversion. The converted assets are forwarded to the configured destination (e.g., Risk Fund, Treasury).
The SingleTokenConverter inherits all core conversion logic from AbstractTokenConverter, including oracle-based pricing and slippage protection.
Key Functions
All core conversion functions are inherited from AbstractTokenConverter:
function convertExactTokens(
uint256 amountInMantissa,
uint256 amountOutMinMantissa,
address tokenAddressIn,
address tokenAddressOut,
address to
) external returns (uint256 actualAmountIn, uint256 actualAmountOut);
function convertForExactTokens(
uint256 amountInMaxMantissa,
uint256 amountOutMantissa,
address tokenAddressIn,
address tokenAddressOut,
address to
) external returns (uint256 actualAmountIn, uint256 actualAmountOut);
balanceOf
Returns the converter's balance of a specific token available for conversion.
function balanceOf(address token) external view returns (uint256);