-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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 _initializableStorageSlot
#5337
base: master
Are you sure you want to change the base?
Add _initializableStorageSlot
#5337
Conversation
🦋 Changeset detectedLatest commit: ce4ce8f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Alternatively, we can make |
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.
I'm concerned by line 63
* when using with upgradeable contracts.
*
* @custom:storage-location erc7201:openzeppelin.storage.Initializable // <<== HERE !
*/
struct InitializableStorage {
This comment will be wrong if the value is overriden. How will the plugin handle that ?
function _getInitializableStorage() internal virtual pure returns (InitializableStorage storage $) { Would be a smaller change, that we could easily generalize to all the upgradeable contracts. The downside is that overriding it would likely require the user writting assembly. |
I imagine that most teams requiring this functionality won't have an issue writing minimal yul. Don't think it's worth the extra function call just to bypass that. |
Fixes #4782
Adding
_initializableStorageSlot
seems like a good abstraction for developers who want to override the initializable storage slot. This makes sense in the context of Account Abstraction since some wallets might reuse the slot. For these case it may be better that each implementation has its own customized slot.PR Checklist
npx changeset add
)