Working with Native Tokens
Now we have learned and implemented the liquidity management feature and token swapping feature of a decentralized exchange (DEX). These features only support ERC20 tokens or non-native tokens currently. However, the native token of Ethereum virtual machine (EVM)-based blockchain is not supported by these features yet. It means a user cannot swap ETH for other ERC20 tokens, or the other way around, as the native token ETH is not an ERC20 token.
To make native tokens work properly for the smart contracts designed for standardized tokens (such as ERC20 or BEP20), native tokens are converted into wrapped tokens. A wrapped token has the same value as its native token. In this chapter, we will elaborate more on this topic, and you will learn the following skills:
- Diving into the WETH smart contract
- Refactoring smart contracts to support the native token in a DEX
- Implement the DEX frontend to support the native token