owanhunte / ethereum-solidity-course-updated-code

Up-to-date Solidity / web3.js / Node.js / React / Next.js code for the udemy.com course Ethereum and Solidity: The Complete Developer's Guide.
183 stars 82 forks source link

'VM Exception while processing transaction: out of gas' error may occur in Campaign tests #3

Closed owanhunte closed 4 years ago

owanhunte commented 4 years ago

When following along with the tests covered in section 6, lecture 139, but using more up-to-date smart contract code, you may get the error 'VM Exception while processing transaction: out of gas' when you run the tests.

To resolve this error and get passing tests, change the gas amount from 1000000 (1 million) to a higher value, e.g. 1500000 (1.5 million).

Some stackoverflow responses I found when trying to troubleshoot the error suggested setting a value of 3000000 (3 million) but I found 1.5 million to work fine for me.