Skip to content

Instantly share code, notes, and snippets.

@kamescg
Created May 22, 2020 15:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kamescg/7e7dfbe07a3d10f160ecdbf743029073 to your computer and use it in GitHub Desktop.
Save kamescg/7e7dfbe07a3d10f160ecdbf743029073 to your computer and use it in GitHub Desktop.
CREATE2
function deploy(bytes _code, bytes32 _salt) public payable {
assembly {
_contract := create2(
callvalue(),
add(_code, 32),
mload(_code),
_salt)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment