-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Serious Bug: BN.js incorrectly computes hexsting #3017
Comments
I believe this problem should not have affected most normal uses of the It is possible for arbitrary math operations to have been performed outside of this range, but that still leaves a buffer of 80 bits, and even this scenario seems unlikely. Any additional analysis or comments from others is welcome though. :) |
It's true that the smallest affected number is bigger than |
Yes, I 100% agree that accumulation could hit that limit, especially, things like averages over large numbers of values. But it is certainly rarer than my initial panic led me to believe. :) |
Fixes correctness bug for .toString(16): indutny/bn.js#295 ethers-io/ethers.js#3017
Fixes correctness bug for .toString(16): indutny/bn.js#295 ethers-io/ethers.js#3017
Ethers Version
5.6.7
Search Terms
No response
Describe the Problem
There was a serious bug identified in BN.js, which results in hex strings being incorrectly computed in some cases (analysis will be performed shortly, after I get the CI off and running).
The hexstring is used extensively in ethers v5 BigNumber library, to ensure immutability. This does not affect the v6-beta branch, as it does not use BN.js.
There is a fix published in that repository, so I just need to update the version, verify correctness, and lock the versions in the
package.json
files.h/t: @alexdupre
Code Snippet
Contract ABI
No response
Errors
No response
Environment
No response
Environment (Other)
No response
The text was updated successfully, but these errors were encountered: