-
CALLDATASIZE (36)
: Pushes the size of the calldata onto the stack. -
PUSH1 00 (6000)
: Pushes the value00
onto the stack. -
DUP1 (80)
: Duplicates the top value of the stack. -
CALLDATACOPY (37)
: Copies the calldata into memory using destination offset, source offset, and length from the stack. -
PUSH1 00 (6000)
(repeated twice): Pushes00
onto the stack twice, preparing parameters forCREATE
. -
CREATE (F0)
: Creates a new contract with the calldata as its initialization code. -
PUSH1 00 (6000)
,DUP1 (80)
(repeated four times): Prepares stack forCALL
with parameters including gas, target address, value, and memory positions. -
SWAP5 (94)
: Swaps stack items to place the contract address at the correct position forCALL
. -
GAS (5A)
: Pushes remaining gas onto the stack. -
CALL (F1)
: Attempts to call the contract at the address with provided parameters. -
PUSH1 00 (6000)
,EQ (14)
: Checks if theCALL
operation was unsuccessful (equal to 0). -
PUSH1 1B (601B)
,JUMPI (57)
: Performs a conditional jump toJUMPDEST
ifCALL
was unsuccessful. -
JUMPDEST (5B)
,STOP (00)
: Marks a valid jump destination and halts execution.
- The sequence starts by copying the calldata into memory.
CREATE
uses this calldata to deploy a new contract.CALL
then attempts to execute this new contract, with the outcome determining the next steps.- For the puzzle to be solved, this
CALL
must fail, causing a jump toJUMPDEST
and then a successfulSTOP
.
The solution is to provide calldata that creates a contract that will cause the CALL
operation to fail. This can be done by deploying a contract that immediately reverts.
-
The calldata
0x60FD60005360016000F3
is a sequence of opcodes that results in such a contract:-
60FD
(PUSH1 FD
): Pushes theREVERT
opcode onto the stack. -
6000
(PUSH1 00
): Pushes the memory offset00
. -
53
(MSTORE8
): Stores theREVERT
opcode at the specified memory offset. -
6001
(PUSH1 01
) and6000
(PUSH1 00
): Prepare the stack forRETURN
, specifying the offset and size of the data to return. -
F3
(RETURN
): Returns theREVERT
opcode as the runtime bytecode of the new contract.
-
-
This calldata ensures that the new contract will
REVERT
any call to it, making theCALL
operation fail and allowing the execution to jump toJUMPDEST
and then executeSTOP
.