-
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
Add OpenZeppelin's upgrades validation for proxies #162
base: master
Are you sure you want to change the base?
Conversation
Possible TODOs:
But I think this serves as a good starting point for now and is sufficient to be merged. |
@outdoteth @wighawag - This looks extremely helpful, we're actually trying to solve for figuring out storage slot comparisons during proxy upgrades. What is the status of this PR? Would love to get this merged in if it's 👍 |
Hey all, sorry for the lack of update, need to look deeper but currently not available. |
This is a very important feature that will take a lot of work out of it. Hope to merge soon |
I just had a quick look and saw that there is a dependency on Any way to remove the dependency on having plugin import other plugin is not great |
@wighawag Yes it should be possible. There are only 3 small utility functions which are used from that package. I'll take a look tomorrow. |
Hi, what about now |
// Appends the implementation to the implementation history of the proxy. | ||
// Used for comparison against future implementations to ensure they are | ||
// compatible with eachother in `openzeppelin_assertIsValidUpgrade()`. | ||
export const openzeppelin_saveDeploymentManifest = async ( |
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.
would be better if we did not use openzeppelin file but instead include the data in the deployment file where it should belong
Any updates on this one? |
If this PR isn't progressing, is anyone aware of a good way to validate upgrades that are deployed via hardhat-deploy? I recently moved my project over to hardhat-deploy (for so many reasons, this project is amazing!), but would definitely miss the confidence that OZ's validation gives me when releasing upgrades. I'm not super familiar with the architecture here, but I may be able to help keep things moving with a point in the right direction. |
I submitted an updated PR with support for openzeppelin's upgradability validations #358 |
@outdoteth I doubt that pending conflicts are blocking this fork from merging with main branch? |
Fixes: #141
Also, this PR builds on #142 so that needs to be merged first.
This integrates open zeppelin's upgrades plugin: https://github.com/OpenZeppelin/openzeppelin-upgrades
and uses their upgrade verification logic to ensure that a contract is a valid implementation.
Some examples of the cool new errors generated 😄 :
This is what happens with this plugin:
cache/validations.json
cache/validations.json
and put it throughopenzeppelin_assertIsValidImplementation
to ensure the contract doesn't contain any constructors etc. and is valid.Then on upgrade, there is an additional step.
openzeppelin_assertIsValidUpgrade
. This will fetch the old implementation and compare it against the new implementation to make sure it is valid.