-
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
Bignumber issue in web3 invalid number value (arg="_value", coderType="uint256", value=10000000000000000) #2077
Comments
Thanks for submitting this issue! |
@nivida . More details- I tested in old version of web3 . This is not in issue in beta.35 and beta.34 . Seems like breaking in beta.36 only. |
@patidarmanoj10 Yes this is because we use the new AbiCoder of ethers.js since beta36. This should be fixed quickly and released with the next build thanks for testing it. My plan is to write the AbiCoder by my self after the 1.0 stable release because it's dangerous to have such an important part of this lib as external dep. :-) |
@nivida what version of |
@gabmontes Hopefully the latest version has fixed it. (4.0.15) |
I was able to reproduce the bug in version 4.0.15:
|
This is also referenced in #1920 just fyi |
The same issue in beta.37. |
Any update on this issue?? @patidarmanoj10 , you mentioned
Does that mean a workaround for this issue?? If I convert my number to that format. Thanks! |
@yueawang yes. |
In addition to the BigNumber issue we are also getting an error with Bytes3: Workaround: We are using Any update on if/when this issue will be resolved? Many thanks! |
I'm using the following truffle version and this same issue is cropping up: once I allocate a value greater than 1e15 to uint256 (like 1e16, or 1e17), it breaks and throws an error during truffle deployment of contract (using constructor arguments):
|
I am facing the same issue for latest web3 1.0.0 version |
This should be solved in this git tag and will be released within the next week: Would be great if someone could quickly test it for me. |
@nivida It looks like I'm still getting the error:
I cloned Truffle, checked out v5.0.2, cloned web3 inside truffle/packages and checked out v1.0.0-beta.38-rc2, and then updated relevant package.json files to point everything in my project and in truffle to that version of web3. Not sure if that's the easiest way to do it, but the stack trace for the error above is pointing to Edit: I think the problem is just that it's still pointing to the wrong version of web3-eth-abi and ethers. I'll look for a better way to replace web3 in my local clone of truffle. |
I have the same error on Remix, after generating a smart contract from circom (0k knowledge proof). |
@markerdmann I will release a Web3.js version with the latest release of ethers.js. But as I saw are you already using the latest version of ethers.js |
The same issue on 1.0.0-beta.40 |
Same issue also on @nivida In beta.36 |
I had the same error when passing wei values in truffle tests and my temporary solution is using |
@chrsengel yeah it works cause it converts the bignumber to string, and It's actually may be a good idea to accepts less types to eliminate errors. I think it's ok to translate every number to a string. |
Web3.js does have currently two other issues with the abi coder of ethers.js the possible quick fixes are:
I will check all the possibilities tomorrow and will choose the fastest end best solution of all. |
I've tested it now and this is an issue of |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. If you believe this was a mistake, please comment. |
Issue still has not been fixed |
use web3.utils.toWei('1000000000') for workaround way |
|
Quick fixes: |
@crameur why must it be like that? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. If you believe this was a mistake, please comment. |
Rename the variable while importing |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. If you believe this was a mistake, please comment. |
Heads up 2021 still remains a issue. |
this quick fix solve my error. thank you sir! |
Fix function:
|
We are changing the amount type from BigNumber to string because it looks like it doesn't work well that way on Ropsten. More info: web3/web3.js#2077
…ction-send-big-number-to-string Change type of amount sent when depositing We are changing the amount type from BigNumber to string because it looks like it transactions doesn't work with the amount as BigNumber. More info: web3/web3.js#2077
I have the similar issue from MikeMcl/bignumber.js#305 |
just add toFixed() function.
|
Getting invalid number error when calling a method of a contract which take uint256 argument.
Example:
myContract.methods.transfer(accounts[1], 1e16).send({ from: accounts[0] })
web3 invalid number value (arg="_value", coderType="uint256", value=10000000000000000)
I am using web3 1.0.0-beta.36
The text was updated successfully, but these errors were encountered: