ntu-SRSLab / vultron

Dynamic Vulnerability Discovery for Smart Contracts
MIT License
26 stars 8 forks source link

Error: Number can only safely store up to 53 bits #12

Open mojtaba-eshghie opened 3 years ago

mojtaba-eshghie commented 3 years ago

Hi, I've been playing with Vultron for two days, and I am stuck because of the following bug which is emitted when I try to upload contracts via the web application of Vultron (the picture of response in web app is attached).

Steps to reproduce the issue

  1. Installed the packages using npm install in the nodejs app directory (main directory of Vultron). Specifically (web3@1.2.0, truffle@5.0.42)
  2. Had the path to a geth instance in vultron/geth_instr/gether_cf/build/bin contained in $PATH.
  3. Instantiated a blockchain instance using the vultron/geth_instr/test_geth/command file
  4. node server.js at the root of vultron.
  5. Migrated contracts using tuffle,
  6. Tried to upload batches of contracts (screenshots attached)

What's the expected result?

This is my first time using Vultron, and I hardly can tell.

What's the actual result?

No debug-related info appeared in nodejs console. I traced the bug, it happend at /load route of express server at vultron/server.js, while it was trying to call fuzzer.load function from vultron/connection/ethereum/fuzzer.js. More specifically, it happened when the fuzzer.load was trying to call fuzzer.get_instance with artifact_path set to /tmp/1606666269695_Attack_BountyHunt0.json (this file is also attached). Finally, the exact line causing the problem is the let instance = await MyContract.deployed(); of fuzzer.get_instance function. The Error and trace is: Error: Number can only safely store up to 53 bits at assert (/home/mojtaba/clones/vultron/node_modules/number-to-bn/node_modules/bn.js/lib/bn.js:8:21) at BN.toNumber (/home/mojtaba/clones/vultron/node_modules/number-to-bn/node_modules/bn.js/lib/bn.js:508:7) at Object.hexToNumber (/home/mojtaba/clones/vultron/node_modules/web3-utils/src/utils.js:234:24) at Method.outputBlockFormatter (/home/mojtaba/clones/vultron/node_modules/web3-core-helpers/src/formatters.js:236:28) at Method.web3.eth.getBlock.method.outputFormatter (/home/mojtaba/clones/vultron/node_modules/truffle-interface-adapter/dist/ethereum-overloads.js:36:40) at Method.formatOutput (/home/mojtaba/clones/vultron/node_modules/web3-core-method/src/index.js:163:54) at sendTxCallback (/home/mojtaba/clones/vultron/node_modules/web3-core-method/src/index.js:473:33) at /home/mojtaba/clones/vultron/node_modules/web3-core-requestmanager/src/index.js:147:9 at XMLHttpRequest.request.onreadystatechange (/home/mojtaba/clones/vultron/node_modules/web3/node_modules/web3-providers-http/src/index.js:96:13) at XMLHttpRequestEventTarget.dispatchEvent (/home/mojtaba/clones/vultron/node_modules/xhr2-cookies/dist/xml-http-request-event-target.js:34:22) at XMLHttpRequest._setReadyState (/home/mojtaba/clones/vultron/node_modules/xhr2-cookies/dist/xml-http-request.js:208:14) at XMLHttpRequest._onHttpResponseEnd (/home/mojtaba/clones/vultron/node_modules/xhr2-cookies/dist/xml-http-request.js:318:14) at IncomingMessage.<anonymous> (/home/mojtaba/clones/vultron/node_modules/xhr2-cookies/dist/xml-http-request.js:289:61) at IncomingMessage.emit (events.js:326:22) at endReadableNT (_stream_readable.js:1241:12) at processTicksAndRejections (internal/process/task_queues.js:84:21)

Additional details / screenshot

image image

1606666269695_Attack_BountyHunt0.json.zip

The tried solutions

It seems that for some people downgrading to truffle 4.x has worked, but I tried, and the same problem still exist.

mojtaba-eshghie commented 3 years ago

I should have added that it seems the nodejs is successfully connected to the geth client since the account is unlocked.