Discussion: BigNumber library in ethers.js not as same as the one in Web3.js ?
See original GitHub issueI got invalid bignumber when I was using getDeployTransaction
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Documentation - Ethers.js
The ethers.js library aims to be a complete and compact library for interacting with the Ethereum Blockchain and its ecosystem. It was originally...
Read more >web3js - How avoid rounding number incorrectly when using ...
I have the following function to get the token balance from a web3 contract with web3.js The contract has 18 decimal point and...
Read more >A comparison of BigNumber libraries in JavaScript
A comparison of the most popular libraries for performing arbitrary-precision arithmetic in JavaScript. Tagged with javascript, math, ...
Read more >Web3.js vs Ethers.js - The Full 2023 Guide to ETH JavaScript ...
Which one out of the two ETH JavaScript libraries is better, and which one steps out victorious after the Web3.js vs ethers.js battle?...
Read more >Reducing the Pain of Big Numbers, and Introducing ...
The common ones are BN.js, bigNumber.js, and big.js to name a handful. ... of web3.js, while others may prefer the ethers.js own 'BigNumber' ......
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
Closing this now, but if you feel it hasn’t been resolved or want more clarification, please re-open.
The Web3 BN class is incompatible with ethers.js.
If you have a Web3 Big Number (I believe Web3 still uses it’s own custom fork of the BigDecimal?) you will need to convert it first to Hex first. If you want a ethers.js BigNumber, you can use
ethers.utils.bigNumberify(web3Value.toString(10))
.