Deployed contract on Goerli : 0xE29ff6DA321397d10819DD9579dbcdcf817fF862
Runtime bytecode (30 bytes):
0x68601e8060093d393df35952383d59396009380160173d828234f050f0ff
Deployed contract on Goerli : 0xE29ff6DA321397d10819DD9579dbcdcf817fF862
Runtime bytecode (30 bytes):
0x68601e8060093d393df35952383d59396009380160173d828234f050f0ff
# ▇ => ▇ + ▇ | |
# Minimal runtime bytecode for a contract that mutates | |
# into two child contracts and then self-destructs | |
# 1st child contract receives the call value | |
# 2nd child contract recevies the remaining balance | |
# author: Saw-mon and Natalie | |
# constructor payload for the spawned contract | |
# ┏━━━━━━━━━━━━━━━━━━━ push1 RUNTIME_BYTECODE_LEN # L | |
# ┃ ┏━━━━━━━━━━━━━━━ dup1 # L L | |
# ┃ ┃ ┏━━━━━━━━━━━━━ push1 RUNTIME_BYTECODE_OFFSET # O L L | |
# ┃ ┃ ┃ ┏━━━━━━━━━ returndatasize # 0 O L L | |
# ┃ ┃ ┃ ┃ ┏━━━━━━━ codecopy # L | |
# ┃ ┃ ┃ ┃ ┃ ┏━━━━━ returndatasize # 0 L | |
# ┃ ┃ ┃ ┃ ┃ ┃ ┏━━━ return | |
push9 0x601e8060093d393df3 | |
# ┗┻╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍ The only important byte that varies. | |
msize | |
mstore # mem = 000...000 601e8060093d393df3 | |
# = 000...000 spawned constructor payload | |
# copy the runtime bytecode after the constructor code in mem | |
codesize # cs | |
returndatasize # 0 cs | |
msize # 0x20 0 cs | |
codecopy # mem = 000...000 601e8060093d393df3 RUNTIME_BYTECODE | |
# --- stack --- | |
push1 9 # 9 | |
codesize # cs 9 | |
add # cs+9 = CS = total codesize in memory | |
push1 23 # 23 CS | |
returndatasize # 0 23 CS | |
dup3 # CS 0 23 CS | |
dup3 # 23 CS 0 23 CS | |
callvalue # v 23 CS 0 23 CS | |
create # addr1 0 23 CS | |
pop # 0 23 CS | |
create # addr2 | |
selfdestruct |