stonecoldpat / anonymousvoting

Anonymous voting on Ethereum without a tally authority. Protocol from this paper http://homepages.cs.ncl.ac.uk/feng.hao/files/OpenVote_IET.pdf
340 stars 88 forks source link

callback contain no result Gas required exceeds limit: 3000000 #13

Closed smatthewenglish closed 1 month ago

smatthewenglish commented 7 years ago
screen shot 2017-08-23 at 10 22 35 am

I was trying to deploy this contract to ropsten using remix and meta mask, but I ran into the error callback contain no result Gas required exceeds limit: 3000000.

stonecoldpat commented 7 years ago

I'm surprised you got the code to load in remix! It always froze for me!

I remember creating the contract required around 3.7m gas. I'd recommend setting the gas limit to 4.7m and then deploy it. That error is saying the gas limit in remix is set to 3m (which isn't enough).

smatthewenglish commented 7 years ago

It seems to break even with a higher gas limit, I put some additional details here:

https://medium.com/@s.matthew.english/smart-contract-deployment-dame-mas-gasolina-ddf8ca792e

stonecoldpat commented 7 years ago

Hey.

I recommend using Ethereum wallet for deploying contracts. Remix doesn't like big contracts like this one. I put it in Ethereum wallet and it is estimating 4,619,006 gas:

screen shot 2017-08-23 at 16 21 53

It also caught two "unused variables" which might stop it compiling. This is because Solidity has had an update where it won't let you deploy contracts with unused variables. Easy fix is just re-assigning the variable to itself. i.e. bit = bit. The variables are used but inside the assembly {} brackets which Solidity compiler seems to ignore.

stonecoldpat commented 7 years ago

I just updated AnonymousVoting.sol to do the re-assignment. Maybe that is what remix was really complaining about.

SamuelRoberts96 commented 5 years ago

I am also getting an error when trying to run it.

image

This is the error: image

Then it simply fails. I am using remix connected to MetaMask.