-
CALLDATASIZE (36)
: Pushes the size of the calldata (in bytes) onto the stack. -
PUSH1 03 (6003)
: Pushes the value03
onto the stack. -
LT (10)
: Compares the calldata size with03
. Pushes1
(true) if less than03
, otherwise0
(false). -
PUSH1 09 (6009)
: Pushes the value09
onto the stack. -
JUMPI (57)
: Conditionally jumps to byte09
if the top stack item is1
. -
REVERT (FD)
: Reverts the transaction if the jump is not executed. -
JUMPDEST (5B)
at09
: Marks a valid jump destination. -
CALLVALUE (34)
: Pushes the value sent with the transaction onto the stack. -
CALLDATASIZE (36)
: Pushes the size of the calldata onto the stack again. -
MUL (02)
: Multiplies the transaction value and the calldata size. -
PUSH1 08 (6008)
: Pushes the value08
onto the stack. -
EQ (14)
: Checks if the multiplication result equals08
. -
PUSH1 14 (6014)
: Pushes the value14
onto the stack. -
JUMPI (57)
: Conditionally jumps to byte14
if the multiplication result equals08
. -
REVERT (FD)
: Reverts the transaction if the jump is not executed. -
JUMPDEST (5B)
at14
: Marks another valid jump destination. -
STOP (00)
: Halts execution.
To successfully reach the STOP
instruction without reverting:
- The calldata size must be greater than or equal to 3 bytes to avoid the first revert.
- The product of the transaction value (
CALLVALUE
) and the calldata size (CALLDATASIZE
) must equal 8.
To meet these requirements, the calldata size and transaction value need to be chosen such that:
CALLDATASIZE
≥ 3CALLVALUE
×CALLDATASIZE
= 8
Possible solutions include:
- Calldata:
0xFFFFFFFFFFFFFFFF
(8 bytes) and Transaction Value:1 wei
. Here,CALLDATASIZE
is 8, and the product withCALLVALUE
(1 wei) equals 8. - Calldata:
0xFFFFFFFF
(4 bytes) and Transaction Value:2 wei
. In this case,CALLDATASIZE
is 4, and the product withCALLVALUE
(2 wei) also equals 8.
These configurations satisfy both conditions, allowing the bytecode execution to reach the STOP
opcode successfully.