Skip to content

Difference #2731

Answered by othaime-en
OmarWaqar123 asked this question in Q&A
Sep 20, 2022 · 2 comments · 2 replies
Discussion options

You must be logged in to vote

Hey @OmarWaqar123 from the documentation, we see that ethers.utils.parseEther() provides the string representation of a BigNumber instance in wei. This means we convert whatever ETH we pass in into the string representation in wei (18 decimals). This is just a fancy way of saying that it is a unit conversion functionality. So we simply multiply by 18 decimals places (1e18). technically, it doesn't work on ETH explicitly, it works on anything that has the a unit representation same as wei. So whatever unit you have if it is equal to 1e18, ethers.utils.parseEther() can work just fine.
Back to our scenario, if you look at LINK token documentation, you can see that its smallest unit called JUELS

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@OmarWaqar123
Comment options

Answer selected by OmarWaqar123
Comment options

You must be logged in to vote
1 reply
@OmarWaqar123
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants