-
Notifications
You must be signed in to change notification settings - Fork 5k
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
web3.utils.toWei(amount, ether)
fix required when decimals in input are overflown.
#7044
Comments
|
web3.utils.toWei(amount, ether)
giving incorrect and dangerously large value when decimals in input are overflown.web3.utils.toWei(amount, ether)
fix required when decimals in input are overflown.
Thanks @hammersharkfish. We are currently working on this. |
* fix(#7044): fix too many decimals passed to toWei * add test case * add tests and fix fromWei * add changelog and update tests * update test --------- Co-authored-by: Alex Luu <[email protected]>
MRE :
Output:
1123456789123456789123 string
.This output is equivalent to
1123.456789123456789123 ether
while we provided1.123456789123456789123
as input .The text was updated successfully, but these errors were encountered: