This utility abstracts away the differences between transferring native ETH and ERC20 tokens by introducing a unified interface for both sending and receiving assets. It also standardizes how native ETH is represented on-chain to simplify integration logic across different components.

ETH Representation

The constant ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE (**EIP-7528)** is used as a sentinel value to distinguish native ETH from ERC20 tokens.

Errors

Constants

Functions

sendAssets(address asset, address to, uint256 assets)

Sends the specified asset (assets amount) to the recipient to.

Parameters:

Reverts if: ETH transfer fails or ERC20 transfer fails via SafeERC20.

receiveAssets(address asset, address from, uint256 assets)

Receives assets from the caller (or a third-party) into the current contract.