Improve ethers.utils.parseUnits error message
See original GitHub issueGetting this error:
ethers-5.0.umd.min.js:1 Uncaught Error: invalid decimal value (argument="value", value=1, code=INVALID_ARGUMENT, version=bignumber/5.0.5)
in this statement
value: ethers.utils.parseUnits(amount, "gwei"),
};```
in amount variable the value is 1
In ethers 4.0 it works.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Ethers.js - Error: invalid BigNumber string
The problem is that the toString of the number will convert it to a scientific representation which cannot be interpreted by the BigNumber....
Read more >Error Codes - ethers
This error occurs when a call or transaction is used to interact with the blockchain reverts (via revert , require , et cetera)....
Read more >How to use the ethers.utils.parseUnits function in ethers - Snyk
Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues...
Read more >ethers js exits with this error=> invalid BigNumber value ...
Any help? Unhandled Rejection (Error): invalid BigNumber value (argument="value", value=undefined, code=INVALID_ARGUMENT, version=bignumber/5.5 ...
Read more >Documentation - Ethers.js
The main purpose of this is to increase the difficulty as time goes on and ... callStatic.transfer("ricmoo.eth", parseUnits("1.23")); // [Error: call revert ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks Ric. I believe it’s going to help some Devs.
This has been fixed in 5.0.17. If you have any problems, please let me know.
Thanks! 😃