question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Discussion: BigNumber library in ethers.js not as same as the one in Web3.js ?

See original GitHub issue

I got invalid bignumber when I was using getDeployTransaction

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ricmoocommented, Dec 2, 2017

Closing this now, but if you feel it hasn’t been resolved or want more clarification, please re-open.

1reaction
ricmoocommented, Nov 29, 2017

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)).

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found