Closed rayyan808 closed 3 years ago
For anyone who may encounter this issue, check that your truffle-config has a valid gas value. My gas value was a very large number, which caused Ganache to crash as it isn't meant to handle BNs in gas values (that's my guess anyway). Reducing the gas size fixed this error.
Expected Behavior
Ganache should deploy the contract, but during deployment it calls upon estimateGas which causes an assertion failure. This failure has something todo with handling BN's (BigNumbers). At first I presumed it was my contract gas overflowing, but the same instance of the contract deploys on Remix-IDE. The deployment on truffle side fails once the Ganache-CLI disconnects after throwing an error.
Current Behavior
Steps to Reproduce (for bugs)
To reproduce, you could simply clone my repo: https://github.com/rayyan808/bsc-project.git
There you may extract Election.sol and it's dependencies: MiMC.sol, utility.sol and verifier.sol
Context
Without this, my entire project and 2 months work is void because I cannot demo this app over REMIX-IDE. My application is a real life example of utilizing zk-SNARKs and researching into modern hashing techniques to be able to conduct a voting procedure completely on-chain. My react application needs to interact with a proper blockchain through web3.
Your Environment
Version used: Ganache CLI v6.12.2 (ganache-core: 2.13.2)
Version of Truffle/Remix/Other tools used: Truffle v5.3.4, Remix-IDE (latest version)
NodeJS Version: [ ] 6.x, [ ] 7.x (unsupported), [ ] 8.x, [ ] 9.x (None mentioned, my node-js is v16.3.0)
Operating System and version (include distro if Linux): Ubuntu 16, Linux
Link to your project or repro gist: https://github.com/rayyan808/bsc-project.git
Commit hash to use with above link for reproduction: c695e37c408660d88dc92cb2713fc6df4c40e336
I intend to submit a pull request to fix this issue: [ ]