When copiling an ICO contract using http://remix.ethereum.org/ and JS VM environment the following error is thrown:

"VM error: invalid opcode. The constructor should be payable if you send value. The execution might have thrown. Debug the transaction to get more information."

Didn't send any value and the constructor is not a payable function. So why the error?

The contract source code is at: https://gist.github.com/computerphysicslab/3990c706a2f36fed56e31e72f59b61fb

Any hint? Thx!


  • 1
    I have found out one of the require() assertions fails. That's probably the cause of the error. So the error description is quite misleading to me... Commented Sep 25, 2017 at 14:01

1 Answer 1


This error jumps out for some (unpredictable) reasons when, may be, the internal remix ide stack is corrupted and/or your deployment silently fails.

Very often if you save, exit and reload it does not appear anymore.

If it appears again and again with your code, try to save/exit/reload and then deploy it again using a 10x gas limit.

I encountered this problem in 0.6.3 and 0.6.4 (currently online) version of remix ide. I hope it will be fixed for the next 0.7.0 (that is the alpha version today).

In these cases it is a system error, anyway. Your code is not affected if not for the amount of gas required in order to deploy it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.