OmnichainERC20Transfers
Abstract contract that provides the transfer operations of the Omnichain ERC20 Data Manager
transfer
Transfers amount tokens from the caller's account to to
If the chain ID of to is the same as the current chain ID, the transfer is done on the single chain
otherwise, the transfer is done via Omnichain
Caller may receive native coin refund, so if it's a contract it MUST have receive() or payable fallback()
Parameters
| Name | Type | Description |
|---|---|---|
| to | OmnichainAddress | Omnichain address to transfer tokens to |
| amount | uint256 | Amount of tokens to transfer |
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | bool | True if the transfer was successful, reverts otherwise |
transfer
Transfers amount tokens from the caller's account to to
If the chain ID of to is the same as the current chain ID, the transfer is done on the single chain
otherwise, the transfer is done via Omnichain
Parameters
| Name | Type | Description |
|---|---|---|
| to | OmnichainAddress | Omnichain address to transfer tokens to |
| amount | uint256 | Amount of tokens to transfer |
| refundAddress | address payable | Address to send native coin refund to |
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | bool | True if the transfer was successful, reverts otherwise |
transfer
Transfers amount tokens from the caller's account to to
The transfer is done on the local chain
Parameters
| Name | Type | Description |
|---|---|---|
| to | address | Address to transfer tokens to |
| amount | uint256 | Amount of tokens to transfer |
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | bool | True if the transfer was successful, reverts otherwise |
transferFrom
Transfers amount tokens from from to to
The caller must have allowance for from's tokens of at least amount
The transfer is done on the local chain
Parameters
| Name | Type | Description |
|---|---|---|
| from | address | Address to transfer tokens from |
| to | address | Address to transfer tokens to |
| amount | uint256 | Amount of tokens to transfer |
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | bool | True if the transfer was successful, reverts otherwise |
transferFrom
Transfers amount tokens from from to to
The caller must have allowance for from's tokens of at least amount
If the chain ID of to is the same as the current chain ID, the transfer is done on the single chain
otherwise, the transfer is done via Omnichain
Caller may receive native coin refund, so if it's a contract it MUST have receive() or payable fallback()
Parameters
| Name | Type | Description |
|---|---|---|
| from | address | Address to transfer tokens from |
| to | OmnichainAddress | Address to transfer tokens to |
| amount | uint256 | Amount of tokens to transfer |
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | bool | True if the transfer was successful, reverts otherwise |
transferFrom
Transfers amount tokens from from to to
The caller must have allowance for from's tokens of at least amount
If the chain ID of to is the same as the current chain ID, the transfer is done on the single chain
otherwise, the transfer is done via Omnichain
Parameters
| Name | Type | Description |
|---|---|---|
| from | address | Address to transfer tokens from |
| to | OmnichainAddress | Address to transfer tokens to |
| amount | uint256 | Amount of tokens to transfer |
| refundAddress | address payable | Address to send native coin refund to |
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | bool | True if the transfer was successful, reverts otherwise |

