-
Notifications
You must be signed in to change notification settings - Fork 756
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
Error: Number can only safely store up to 53 bits #114
Comments
Getting the same error with no clue on how to fix it. Does anybody have a fix for this or an explanation as to why this happens? |
This happened to me when I tried to index |
I actually figured it out and it is REALLY stupid... It occurred to me when I actually used a value for the |
This actually seems to be a bug in ethereumjs-block. |
@axic recently I submitted a new PR to the tests repository, the tests I submitted is related to this problem. I think this is something that the bn.js library validates, here is an example of the validation in the iaddn function https://github.com/indutny/bn.js/blob/master/lib/bn.js#L2145 |
This seems to be a problem in
|
having the same problem where gasLimit in testrpc is set greater than 9007199254740991 (2^53 -1) and tests are ran. |
Make sure your Bad: {gas: 40000.0000001}
Example of usage:
Good luck! |
(sorry for the notification, but this is for future searchers) I got this issue when I attempted to issue a |
@assafmo solution worked for me. Just don't index strings in your events |
Just encountered this. Not relevant exactly the JS VM, but for any other souls that come here, an addition to what @DevNebulae said: I had set the gasLimit with ganache-cli to a number bigger than 53 bits. Changed it, still didn't work. Turns out that Metamask caches the gas limit, so you have to switch between networks and switch back before it gets the new one. Until then, you'll get a 53 bits error on any transaction. |
My gaslimit is 800000 and I still get this error. Here is the code that causes it: BN.js:498
Does anyone have a clue what he is parsing here? |
@nikita-fuchs You should be able to debug this by directly injecting some log statements in this file in your |
Not indexing a string as event parameter solved this for me. It's often
said this wouldn't be possible anyway, but as the compiler won't complain,
it seems it's only the JS libraries are having problems with that?
Am Mo., 5. Nov. 2018, 21:21 hat Holger Drewes <notifications@github.com>
geschrieben:
… @nikita-fuchs <https://github.com/nikita-fuchs> You should be able to
debug this by directly injecting some log statements in this file in your
node_modules folder?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#114 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ALN4pM2PH5ZoFjff3TAsvt9zx4GJLwcXks5usJ3VgaJpZM4LX6A5>
.
|
Hello, I just ran into the same error. But with the quorum tutorial from truffle. Here is my stack overflow post for further description: https://stackoverflow.com/questions/54128954/quorum-ethereum-truffle-error-number-can-only-safely-store-up-to-53-bits/54182896#54182896 |
Hello, I'm facing the same issue. You can just get web3's util to variable. for example, var BigNumber = web3.utils.BN;
var amount = new BigNumber(3700 * 10 ** 3); and amount is BigNumber. so you can compare to any Ethereum uint256 like this: return Token.deployed().then((instance) => {
token = instance;
return token .balanceOf.call(account_one);
}).then((balance) => {
account_one_starting_balance = balance;
return token.balanceOf.call(account_two);
}).then((balance) => {
account_two_starting_balance = balance;
return token.transfer(account_two, amount, {from: account_one});
}).then(() => {
return token.balanceOf.call(account_one)
}).then((balance) => {
account_one_ending_balance = balance;
return token.balanceOf.call(account_two);
}).then((balance) => {
account_two_ending_balance = balance;
assert.equal(account_one_ending_balance.toString(), account_one_starting_balance.sub(amount).toString(), "Amount wasn't correctly taken from the sender");
assert.equal(account_two_ending_balance.toString(), account_two_starting_balance.add(amount).toString(), "Amount wasn't correctly sent to the receiver");
}); This code is from truffle's contract test code to test if the transfer is working with account_one to account_to. |
There are actually few issues which make me so confused within the whole Is this still a thing? How much is this related to the VM implementation? Does anyone have some code part which can directly be executed on the VM and is triggering the respective error? |
In many blogs I've found it was a Truffle version problem. Truffle v5 would make problems of this type. They suggest to downgrade to truffle@4.1.15. This has not been so for me. I have continue to use truffle v5. I've resolved by checking my gas limit when I sent a transaction. Node: v8.11.4 |
Can you give us more info about your failing setup @macman18? Truffle version? Node version? Are you using ganache? Which version? Thanks! |
Of course. I've also added a new discovered... Now it is definitive! |
So the problem appeared when sending a tx without an explicit gas limit? What is the value of Also, your truffle config would be useful. |
My versions:Node: v8.11.4
Truffle-config.js
Code of my send signed transaction function `
` |
My Versions:Truffle v5.0.22, a portion of my code:
The Error after $> truffle test:
|
I can able to run truffle test by using const o = {
balance: 2000000000 * (10 ** 18),
}
let owner_balance = await tokoin.balanceOf(root, {
from: root
});
eq(o.balance, owner_balance.toString()); |
Added babel-cli to distribute ES5 version on npm
This hasn't been reported for quite some time, will close. |
(feel free to reopen though) |
On the various libraries, input is now directly taken as a |
Getting this while running the tests on a fresh clone.
OSX Yosemite
Node v6.3.0
The text was updated successfully, but these errors were encountered: