[Ethereum] “The constructor should be payable if you send value” but constructor is NOT payable and didn’t send any value

constructoricoremixsoliditytokens

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!

Refs.:

Best Answer

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.

Related Topic