-1

I have a huge contract so isolating the cause will be very arduous manually. Is there any way to get an indication automatically of what might be causing an "invalid opcode" error?

  • 1
    What has that got to do with compilation? An invalid opcode error occurs during runtime. Generally speaking, every assert operation could cause this error, as well every access to an array at an illegal index (though this one possibly throws a revert error, not entirely sure). – goodvibration Nov 13 '18 at 11:32
0

Invalid Opcode error occurs mostly when you are performing an mathematical operation and somewhere in the code maybe you are dividing some number (variable) with 0.

Maybe check your calculations to see if this is the case!

Hope this helps someone!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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