-
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
Use proxies from OpenZeppelin Contracts 4.8.3 #795
Conversation
New dependency changes detected. Learn more about Socket for GitHub ↗︎ 👍 No new dependency issues detected in pull request Bot CommandsTo ignore an alert, reply with a comment starting with Pull request alert summary
📊 Modified Dependency Overview:
|
const TransparentUpgradeableProxyFactory = await getTransparentUpgradeableProxyFactory(hre, signer); | ||
const proxy = TransparentUpgradeableProxyFactory.attach(proxyAddress); | ||
// No admin contract: use ITransparentUpgradeableProxyFactory to get proxiable interface | ||
const ITransparentUpgradeableProxyFactory = await getITransparentUpgradeableProxyFactory(hre, signer); |
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.
Is there a reason for this change?
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.
Oh, I remember now, and I understand why this was done.
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.
Commenting for completeness:
The upgradeProxy
function in the plugins invokes the upgradeToAndCall
or upgradeTo
function on the proxy, regardless of whether it is a UUPS or Transparent proxy. It did this by using TransparentUpgradeableProxy's contract factory to encode those functions, which depends on the ABI. (Note this also works for UUPS proxies because those function signatures are the same between UUPS and Transparent).
In OpenZeppelin Contracts 4.8.3, the upgradeToAndCall
and upgradeTo
functions are not part of TransparentUpgradeableProxy's ABI, but are in the interface ITransparentUpgradeableProxy's ABI. Therefore, we use ITransparentUpgradeableProxy's contract factory to encode those functions instead.
Co-authored-by: Francisco <fg@frang.io>
Co-authored-by: Francisco <fg@frang.io>
Co-authored-by: Francisco <fg@frang.io>
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.
LGTM
Closes #774
Closes #773
Closes #772
Closes #771
Updates proxies in order to use updated TransparentUpgradeableProxy from OpenZeppelin Contracts 4.8.3.
Note: Using this version of the plugin to verify a proxy that was deployed by a previous version of the plugin will fail. See #674 for details. Users who are affected should downgrade the plugins to the previous version, run the verify task, then upgrade the plugins back to the latest version.