-
Notifications
You must be signed in to change notification settings - Fork 270
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
Deploy proxy contracts from OpenZeppelin Contracts 5.0 #919
Deploy proxy contracts from OpenZeppelin Contracts 5.0 #919
Conversation
Updated and removed dependencies detected. Learn more about Socket for GitHub ↗︎
🚮 Removed packages: @openzeppelin/[email protected] |
👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎ This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. |
@ericglau hello ser, is this blocked? Anxiously awaiting this functionality, thanks. |
const constructorArgs = ethers.AbiCoder.defaultAbiCoder().encode(['address'], [owner]).replace(/^0x/, ''); | ||
await verifyContractWithConstructorArgs(etherscan, adminAddress, artifact, constructorArgs, errorReport); |
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.
The current owner may not be the one used for deployment. Not sure if that would be easy to support, but if that is not the case, we probably want to have a verbose error.
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.
Good point. Changed it to look for the OwnershipTransferred event that should have been logged during construction and get the original owner from that.
Co-authored-by: Hadrien Croubois <[email protected]>
@rsimonton We're planning to have this available soon. We'll likely do an alpha release once this is merged so that you can start using it (it will be alpha for now since we still need to evaluate some breaking changes, particularly #912) |
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.
On a side note, I think we should change all of the @openzeppelin/contracts-v5
imports and use @openzeppelin/contracts-v4
for v4 instead.
Should be added before the final 3.0 release, right?
packages/plugin-hardhat/test/transparent-transfer-admin-ownership-wrong-signer.js
Outdated
Show resolved
Hide resolved
packages/plugin-hardhat/test/transparent-admin-initial-owner.js
Outdated
Show resolved
Hide resolved
packages/plugin-hardhat/test/transparent-admin-initial-owner.js
Outdated
Show resolved
Hide resolved
packages/plugin-hardhat/test/transparent-admin-initial-owner.js
Outdated
Show resolved
Hide resolved
packages/plugin-hardhat/test/transparent-admin-initial-owner.js
Outdated
Show resolved
Hide resolved
Co-authored-by: Ernesto García <[email protected]>
I'd prefer that, however these paths are in Since |
Right, thanks for clarifying. I'd suggest creating an issue to track this if we ever bump upgrades/core so we can consider a fix, but you decide. |
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.
Alright, this LGTM 🚀
Opened issue #931 to track. |
d6be275
into
OpenZeppelin:hardhat-upgrades-v3
You all are legends! 🫡 |
I don't have time to open an issue atm but it looks like the In my case I have contracts A and B, where B extends A. Both are upgradeable. B's initializer adds an additional argument. When calling B's initializer (prior to my incorporating the upgrades plugin) in order for ethers to know which version of Trying to do this when calling
...the deployment fails with Is it possible for the upgrades plugin to support the ethers v6 typed data API? Or is there some other way to work around? Thanks! |
@rsimonton You can try specifying a fragment using the For example, you can provide the initializer function's signature like:
If this is still a problem for you, please open a separate issue, thanks! |
Targets release branch
hardhat-upgrades-v3
to allow for alpha version.Deploys proxy contracts from OpenZeppelin Contracts 5.0, but continues to support importing and working with existing deployments from Contracts 4.x and below.
Updates Etherscan verification to verify proxy admins which are deployed by a transparent proxy rather than directly by the plugin.
upgrades-core
will have proxy bytecodes for both 5.0 and 4.x proxies for backwards compatibility with older version ofhardhat-upgrades
.Fixes #907