Skip to main content
add answer
Source Link

You cannot exactly swap ETH for DAI, that's why the ERC-20 version of ETH, Wrapped ETH (WETH) comes in. The pools only consist of two ERC-20 tokens, and ETH is the native token in Ethereum network.

Update: it seems like you follow this tutorial link. I happened to find this tutorial. I tried and it worked. It is better to test the contract on a forked mainnet instead of on the testnets. You can use Foundry or Hardhat.

You cannot exactly swap ETH for DAI, that's why the ERC-20 version of ETH, Wrapped ETH (WETH) comes in.

You cannot exactly swap ETH for DAI, that's why the ERC-20 version of ETH, Wrapped ETH (WETH) comes in. The pools only consist of two ERC-20 tokens, and ETH is the native token in Ethereum network.

Update: it seems like you follow this tutorial link. I happened to find this tutorial. I tried and it worked. It is better to test the contract on a forked mainnet instead of on the testnets. You can use Foundry or Hardhat.

Source Link

You cannot exactly swap ETH for DAI, that's why the ERC-20 version of ETH, Wrapped ETH (WETH) comes in.