4

STOP halts execution and according to this mentions INVALID is used as an abort. Is the difference between these opcodes purely semantical?

eth
  • 85,679
  • 53
  • 285
  • 406
everconfusedGuy
  • 235
  • 1
  • 4

1 Answers1

4

STOP is a valid stop to the contract. State changes are kept and unsued gas is refunded.

INVALID will throw the transaction, its state changes and cause the consumption of all gas sent with it.

As of Solidity 0.4.10 there is now a revert() call which enacts the REVERT opcode introduced in EIP140. This opcode, halts the contract, throws state changes but refunds unused gas.

o0ragman0o
  • 4,320
  • 18
  • 35