Skip to content

Instantly share code, notes, and snippets.

@Philogy
Last active August 1, 2022 10:51
Show Gist options
  • Save Philogy/eeb9d622c43079728baa1013c3584731 to your computer and use it in GitHub Desktop.
Save Philogy/eeb9d622c43079728baa1013c3584731 to your computer and use it in GitHub Desktop.
Cell Division - 24 bytes
#define constant CNSTR_CODE = 0x601834818180333cf3
#define constant CNSTR_CODE_SIZE = 0x9
#define constant CNSTR_CODE_OFFSET = 0x17 // 0x20 - [CNSTR_CODE_SIZE]
#define macro MAIN() = takes(0) returns(0) {
[CNSTR_CODE_SIZE] [CNSTR_CODE_OFFSET] // [cc_offset, cc_size]
returndatasize // [0, cc_offset, cc_size]
[CNSTR_CODE] dup2 mstore // [0, cc_offset, cc_size]
dup3 dup3 dup3 create // [addr1, 0, cc_offset, cc_size]
pop create // [addr2]
selfdestruct
}
#define constant PARENT_SIZE = 0x18
#define macro MAIN() = takes(0) returns(0) {
[PARENT_SIZE] callvalue // [0, size]
dup2 dup2 dup1 caller // [msg.sender, 0, 0, size, 0, size]
extcodecopy // [0, size]
return
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment