anonymousvoting icon indicating copy to clipboard operation
anonymousvoting copied to clipboard

callback contain no result Gas required exceeds limit: 3000000

Open smatthewenglish opened this issue 7 years ago • 5 comments

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.

smatthewenglish avatar Aug 23 '17 14:08 smatthewenglish

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).

stonecoldpat avatar Aug 23 '17 14:08 stonecoldpat

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

smatthewenglish avatar Aug 23 '17 15:08 smatthewenglish

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 avatar Aug 23 '17 15:08 stonecoldpat

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

stonecoldpat avatar Aug 23 '17 15:08 stonecoldpat

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.

SamuelRoberts96 avatar Jul 31 '19 14:07 SamuelRoberts96