3

while looking on Etherscan I see a several types of failed transactions:

  1. Bad Instruction

  2. Bad Jump Destination

  3. Reverted
  4. Out Of Gas

I can only understand Out Of Gas failure. what is the reason for the others?

Also, I saw that there are failed transactions with the word [CANCELLED] and some are without it.

for example: with cancelled : https://etherscan.io/tx/0x67ec3acc5274a88c50d1e79e9b9d4c2c3d5e0e3ba3cc33b32d65f3fdb3b5a258

without cancelled : https://etherscan.io/tx/0xc2c388756c7e379d7ebb7af58a7f54156ac83a8df702b7b72f111344fe2df013

3
  • The "bad instruction" was the way to generate an assert, the compiler insert an invalid opcode (0xFE) that on execution will cause EVM to stop and revert the transaction consuming all the remaining gas. This is caused by an explicit assert() or an illegal operation like accessing an invalid index of an array, etc.

  • "Bad jump destination" is caused by a security measure of the EVM. For a JUMP opcode in the contract the destination have to be a JUMPDEST opcode. So an invalid jump will likely cause the contract to stop immediately and revert the whole transaction.

  • "Reverted" this is a new opcode with the Byzantium fork, generated by a revert(). It will stop contract execution and revert the transaction and return the remaining gas. It is recommended to use revert when validating user supplied data.

  • "Out of gas" this is caused when the gas assigned to a transaction execution runs out before the contract stops.

As stated by @oktapodia the "CANCELLED" status is used by Etherscan to indicate a transaction with a non-zero transfer failed and the value is returned to the sender.

  • What is the specific cause of the "bad jump destination" error? Solidity compiler bugs? – lixq May 22 '18 at 12:09
  • This error happened to me when doing low level programming in assembly, I do not remember exactly I think it was I was using an opcode incorrectly and this caused the opcodes to be unbalanced (like a push without data) and the EVM end up interpreting some data as opcodes. – Ismael May 22 '18 at 13:02
0

All the error are reverted on a smart contract, this is the default EVM error message.

To be honest, I never seen the bad instruction or bad jump destination error, do you have an example?

The CANCELLED status occured only when the transaction have a value, this means that the value is refund to the sender.

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.