jklepatch / eattheblocks

Source code for Eat The Blocks, a screencast for Ethereum Dapp Developers

Home Page:https://eattheblocks.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ethers.utils.parseUnits('0.1', 'ether') = 100000000000000000 (wETH or WEI?)

iamasoliddev opened this issue · comments

Hey,

can someone explain how should it work,

ethers.utils.parseUnits('0.1', 'ether');

So then we have:

tokenIn: 100000000000000000 (WETH)

I don't get it.

I mean:

Shouldn't it say 100000000000000000 WEI instead of wETH?

1 ETH = 1 wETH
100000000000000000 wETH is a lot of money :)

so it is 100000000000000000 WEI of WETH which makes sense. ETH is always in the unit of WEI