Skip to content

Instantly share code, notes, and snippets.

@stong
Last active Aug 22, 2022
Embed
What would you like to do?
EVM universal constructor
cast rpc eth_sendTransaction '{"data": "'$(cat constructor_bytecode.txt)$(cat bytecode.txt)'"}'
0x600D380380600D6000396000F3
00: 60 0D ; push 0x0D (size of deployer code)
02: 38 ; codesize
03: 03 ; sub (top of stack is now size of code to deploy)
04: 80 ; dup1
05: 60 0D ; push 0x0D (size of deployer code)
07: 60 00 ; push 0 (codecopy dst offset)
09: 39 ; codecopy (0, 0x0d, codesize-0x0d)
0A: 60 00 ; push 0 (return mem offset)
0C: F3 ; ret (0, codesize-0x0d)
0D: rest of your bytecode goes here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment