-
Notifications
You must be signed in to change notification settings - Fork 298
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
deterministic Deployment initCall #383
Comments
They should definitely not do this, and if they do, they should change and let user provide the owner Why can't you use the constructor arguments ? |
For example, the openzepplin ownable give owner to |
Yes unfortunately openzeppelin does it, see : OpenZeppelin/openzeppelin-contracts#2639 |
I agree with you but it'll be too late when openzeppelin changes this.
|
Reopen this because I just realized that the owner in constructor arguments will affect the bytecode for deployments and these arguments shouldn't influence the exact bytecode for the create2 calculation. For example, Gnosis safe wallet address on different networks is different currently. So initial call is not useless. |
I disagree, the resulting address should absolutely change if the args changed. imagine if the address remained, someone could take control of the address on any other network, they could even frontrun you |
absolutely agree with @wighawag - the address MUST change. For anyone looking for a solution to this problem, here you go: pcaversaccio/create2deployer#81 (comment). Constructor arguments are enough - what you must understand is the inheritance pattern! |
Really thanks @wighawag @pcaversaccio |
Is your feature request related to a problem? Please describe.
Sometimes we need to deploy some contracts with privileges in deterministic deployments way, like Ownable, and AccessControl. By default, most library give the privilege to
msg.sender
rathertx.origin
and the factory contract get the privilege. On the other hand, we try to voidtx.origin
in the contract.Describe the solution you'd like**
we need a new deterministicDeployment factory and extra args for deterministicDeployment.
factory contract can be like this(source: https://ethereum-magicians.org/t/erc-2470-singleton-factory/3933/27). Provide it on each network.
And we need more args in deploy script, like this
For more convenience, we should support contract call auto encoding rather than calculate initcall bytes code manually.
Describe alternatives you've considered
No alternatives til now.
Additional context
How deterministic deployment works currently: https://github.com/wighawag/hardhat-deploy#4-deterministicdeployment-ability-to-specify-a-deployment-factory
TODO
This is not a tiny work and maybe there is already a solution. Just open this issue and expect more discussions.
The text was updated successfully, but these errors were encountered: