-
Notifications
You must be signed in to change notification settings - Fork 271
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
Options to change deploy and factory functions #1104
base: master
Are you sure you want to change the base?
Conversation
Adds two new options that allow override of the deploy and factory functions. Kind is still used to identify the kind of proxy used, but this customization can manage variations of the proxy implementation and its constructor parameters. As a test case, and to show a concrete application of this change, I implemented a AccessManagedProxy. This proxy works like a UUPS (ERC1967) proxy, but before delegating the calls, checks with the access manager if the call is allowed.
Quick fix, I'm not expert enough in Typescript to make the correct type annotations
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.
Thank you @gnarvaja for this PR! This looks like a good approach for allowing the proxy deployment to be overridden.
I made a few minor changes to the example proxy's comments and simplified the types for the new options.
The following would also be needed before we can merge this. Would you be interested in adding these? Thanks!
- A basic test for deploying a custom beacon proxy
- Add the new options in the documentation in
docs/modules/ROOT/pages/api-hardhat-upgrades.adoc
Adds the documentation to the new options of the `deployProxy` method.
- Added a test case for the customization of the BeaconProxy. - Fixed the documentation, moving the new options to common options since they are used both in deployProxy and deployBeaconProxy.
Done, I added an example of a custom beacon proxy. Also, I added the new options to the documentation. Including links to the default implementations of the factories and deploy functions. |
Implementation for #231
Adds two new options that allow override of the deploy and factory
functions.
Kind is still used to identify the kind of proxy used, but this
customization can manage variations of the proxy implementation and its
constructor parameters.
As a test case, and to show a concrete application of this change, I
implemented a AccessManagedProxy. This proxy works like a UUPS (ERC1967)
proxy, but before delegating the calls, checks with the access manager
if the call is allowed.