Skip to content

Instantly share code, notes, and snippets.

@hayeah

hayeah/block17. Secret

Created September 3, 2017 10:29
Show Gist options
  • Save hayeah/03976a31758e08548b804030f2caad54 to your computer and use it in GitHub Desktop.
Save hayeah/03976a31758e08548b804030f2caad54 to your computer and use it in GitHub Desktop.
/* solc --bin --asm --optimize call--two-methods.sol */
// methodSelector = calldata[0:4]
and(div(calldataload(0x0), 0x100000000000000000000000000000000000000000000000000000000), 0xffffffff)
// if methodSelector == 0x9cdcf9b
0x9cdcf9b
dup2
eq
tag_2 // SetB
jumpi
// elsif methodSelector == 0xee919d50
dup1
0xee919d50
eq
tag_3 // SetA
jumpi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment