-
When transferring ERC20 fund with the code below,
here is an error:
What is the right way to use >MAX_SAFE_NUMBER integer in |
Beta Was this translation helpful? Give feedback.
Answered by
ricmoo
Jun 26, 2021
Replies: 1 comment 1 reply
-
You must use a safe way to create a BigNumber instance. For example, all these produce the same value: BigNumber.from("1000000000000000")
BigNumber.from(10).pow(18)
// the best way is to use the parseEther and parseUnits method
parseEther("1.0")
parseUnits("1.0", 18) I recommend taking a quick look through the docs. The getting started document covers this and many other useful examples. :) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
emclab
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You must use a safe way to create a BigNumber instance. For example, all these produce the same value:
I recommend taking a quick look through the docs. The getting started document covers this and many other useful examples. :)