-
Notifications
You must be signed in to change notification settings - Fork 267
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
CLI: Disallow self-references for storage layout validations #1064
Comments
Is this also required for the first version one deploys? Asking because that doesn't seem like something that should be labeled unsafe. |
This does not apply to the first version, it only applies to subsequent versions (and when being called through Foundry Upgrades, it would only apply when preparing or performing an upgrade). The first version should not have and does not require a reference. |
Clarified the above in the error message in this commit. |
If the CLI is used with
--contract MyContract --reference MyContract
, or a contractMyContract
has annotation@custom:oz-upgrades-from MyContract
, this is a self-reference and doing so effectively makes upgrade safety validations pointless.We should consider this incorrect usage and throw an error in this case.
Note that referencing the same contract name in a different build info file as introduced in #1062 is allowed.
If users do not have a reference contract available in the current project or any previous build info directory, they should use the
--unsafeSkipStorageCheck
option to skip storage checks.The text was updated successfully, but these errors were encountered: