Handle Native Tokens
Understanding Native Tokens
Native tokens are the base currencies of their blockchains—for example, ETH on Ethereum, BNB on BNB Chain, and POL on Polygon. Because native tokens do not have contract addresses like ERC-20 tokens, the placeholder address: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE is commonly used to represent native tokens in blockchain transactions.
Standard Native Token Representation
For most of the EVM-compatible chains that we support, the native token is represented using the placeholder address 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE. This convention exists because native assets (e.g., ETH on Ethereum) do not have contract addresses like ERC-20 tokens.
Chain-Specific Exceptions
Two chains we support do not follow this convention:
- Mantle uses a designated contract address for its native token, MNT.
- Arc uses USDC as its native gas token, exposed through two interfaces that use different decimals.
Before integrating on either, read Chain-Specific Native Tokens.
Additional Resources
For more context on native token addresses:
Steps for Handling Standard Native Tokens
See a full Swap API headless example that demonstrates how to handle native tokens.
Code example
Here’s a code snippet of how you can implement the above steps:
Wrapping and Unwrapping between ETH and WETH
Easily wrap and unwrap between ETH and WETH by requesting a swap quote by setting sellToken and buyToken as either the contract address for WETH or ETH. The swap quote returned will provide the calldata to directly interact with the WETH9 contract and not with 0x Settler contract.