Created
May 13, 2019 21:54
-
-
Save Arachnid/bdd420401c1589ec6c21b3c60b8338dd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object "Create2Proxy" { | |
code { | |
let size := datasize("runtime") | |
datacopy(0, dataoffset("runtime"), size) | |
return(0, size) | |
} | |
object "runtime" { | |
code { | |
let salt := calldataload(0) | |
let size := sub(calldatasize(), 32) | |
calldatacopy(0, 32, size) | |
let addr := create2(callvalue(), 0, size, salt) | |
mstore(0, addr) | |
return(0, 32) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment