-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
create2 option #11
create2 option #11
Conversation
add create2 optionality
add salt to demo factory
add salt for demo factory deployment
add null input for demo clone deployment
use non-reserved keyword for null salt value constant
I don't think the is_zero check on salt is the right way to do this. I currently use create2 with empty salts for almost all of my deploys. I do this because I care about easily recreating the same address and not because I want a vanity address. I could change all my code to use a salt of "1" or something as default, but I think two separate functions would be better |
@wighawag @ZeframLou any chance of getting this merged? Interested in using this and deterministic address would-be killer. Also, I've been talking to people at Etherscan and they added minor support for detecting these types of clones already. Ideally, we'd get something similar to how EIP-1167 gets code verified automatically for all clones. |
@@ -137,7 +140,12 @@ library ClonesWithImmutableArgs { | |||
} | |||
// solhint-disable-next-line no-inline-assembly | |||
assembly { | |||
instance := create(0, ptr, creationSize) | |||
if iszero(salt) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe instead of this check, we should create 2 functions clone
as before and cloneDeterministic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, happy to make a new PR to work on this, unless @z0r0z is up for continuing on this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also super noob question, I'm not very good at assembly. But would there be a way to write a predictDeterministic
function that predicts the address it'll deploy to without actually deploying the contract? I know OZ's Clones
have that too.
add create2 optionality w/ salt