IAssetsRouter
Functions
route
Deposit tokens into the router and optionally forward them to the active recipient.
Pulls tokens from msg.sender into this contract.
If auto-route is enabled, immediately forwards them to _activeRecipient.
function route(address _token, uint256 _amount) external;
Parameters
| Name | Type | Description |
|---|---|---|
_token | address | The ERC20 token address being routed. |
_amount | uint256 | The amount of tokens to transfer. |
getRouteRecipients
Returns the list of approved route recipients.
Returns the full list of route recipients currently registered in the router.
function getRouteRecipients() external view returns (address[] memory routeRecipients_);
Returns
| Name | Type | Description |
|---|---|---|
routeRecipients_ | address[] | The array of all registered recipient addresses. |
isRouteRecipient
Checks if an address is a valid route recipient.
Checks if a given address is a registered route recipient.
function isRouteRecipient(address _addr) external view returns (bool);
Parameters
| Name | Type | Description |
|---|---|---|
_addr | address | The address to check. |
Returns
| Name | Type | Description |
|---|---|---|
<none> | bool | True if the address is a valid route recipient, otherwise false. |
getActiveRecipient
Returns the currently active route recipient.
Returns the currently active route recipient where assets are routed automatically.
function getActiveRecipient() external view returns (address activeRecipient_);
Returns
| Name | Type | Description |
|---|---|---|
activeRecipient_ | address | The address of the active route recipient. |
isAutoRouteEnabled
Returns whether auto-routing is enabled.
Indicates whether automatic routing is currently enabled.
function isAutoRouteEnabled() external view returns (bool enabled_);
Returns
| Name | Type | Description |
|---|---|---|
enabled_ | bool | Boolean flag, true if auto-routing is enabled, false otherwise. |
Events
RouteRecipientAdded
Emitted when a new route recipient is added
event RouteRecipientAdded(address indexed recipient);
Parameters
| Name | Type | Description |
|---|---|---|
recipient | address | The address of the recipient added |
RouteRecipientRemoved
Emitted when a route recipient is removed
event RouteRecipientRemoved(address indexed recipient);
Parameters
| Name | Type | Description |
|---|---|---|
recipient | address | The address of the recipient removed |
SetAutoRouteEnabled
Emitted when auto-routing is enabled or disabled
event SetAutoRouteEnabled(bool enabled);
Parameters
| Name | Type | Description |
|---|---|---|
enabled | bool | True if auto-routing is enabled, false otherwise |
SetActiveRecipient
Emitted when the active recipient is changed
event SetActiveRecipient(address indexed recipient);
Parameters
| Name | Type | Description |
|---|---|---|
recipient | address | The new active recipient address |
AssetsReceived
Emitted when assets are received by the contract
event AssetsReceived(address indexed token, address indexed recipient, uint256 amount);
Parameters
| Name | Type | Description |
|---|---|---|
token | address | The ERC20 token address received |
recipient | address | The address sending the assets |
amount | uint256 | The amount of tokens received |
AssetsRouted
Emitted when assets are routed to a recipient
event AssetsRouted(address indexed token, address indexed recipient, uint256 amount);
Parameters
| Name | Type | Description |
|---|---|---|
token | address | The ERC20 token address routed |
recipient | address | The address receiving the routed assets |
amount | uint256 | The amount of tokens routed |