Skip to content

Latest commit

 

History

History
27 lines (18 loc) · 1.15 KB

Puzzle1.md

File metadata and controls

27 lines (18 loc) · 1.15 KB

Analysis

  1. CALLVALUE (34):

    • This opcode pushes the value of Ether (in wei) sent with the transaction onto the stack.
  2. JUMP (56):

    • This opcode alters the program counter to the location specified by the top stack item. In this case, it will jump to the byte location equal to the transaction value.
  3. REVERT (FD) (multiple instances):

    • These opcodes will revert the transaction if reached.
  4. JUMPDEST (5B) at 08:

    • This opcode marks a valid destination for a jump.
  5. STOP (00) at 09:

    • This opcode halts execution.

Execution

  • The execution must jump to the JUMPDEST at 08 and not hit any REVERT opcodes.
  • This means the transaction value, which is pushed onto the stack by CALLVALUE, must be such that the JUMP opcode jumps directly to the JUMPDEST at 08.

Solution:

  • The value to send with the transaction should be 08 (in hexadecimal), which is 8 in decimal.
  • Sending a transaction with a value of 8 wei will cause the JUMP at 01 to go to the JUMPDEST at 08, avoiding all REVERT opcodes and successfully halting at STOP.

Therefore, you should enter a value of 8 wei to solve this puzzle.