-
Notifications
You must be signed in to change notification settings - Fork 27
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
Namespace storage #420
Namespace storage #420
Conversation
*/ | ||
mapping(address teleporterAddress => bool paused) private _pausedTeleporterAddresses; | ||
// solhint-disable private-vars-leading-underscore | ||
/// @custom:storage-location erc7201:teleporter.storage.TeleporterUpgradeable |
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.
For my own understanding, do you know why the custom storage location has three forward slashes? This seems to be the convention in OZ's docs as well as the EIP 7201 spec, but I couldn't find any justification for it.
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.
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.
So "///" is for single line natspec comments, and "/**" is for multi-line natspec comments.
(Where all natspec comments start with a @ tag, and can be used to auto-generate docs)
@@ -22,7 +22,15 @@ abstract contract TeleporterOwnerUpgradeable is TeleporterUpgradeable, OwnableUp | |||
address initialOwner | |||
) internal onlyInitializing { | |||
__TeleporterUpgradeable_init(teleporterRegistryAddress); | |||
__Ownable_init(); | |||
__Ownable_init_unchained(); |
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.
IIUC, __Ownable_init
vs __Ownable_init_unchained
doesn't have any functional difference here.
For my understanding, is there a reason why __Ownable_init_unchained
should be preferred? Seems like the normal _init
would be recommended unless there is a specific need to ensure none of the Ownable
parent initializers are called
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.
One question, but LGTM
Upgrading to OpenZeppelin v5 and Solidity 0.8.20
merging into #397 |
Why this should be merged
Fixes #415
How this works
Adds namespace storage to all contracts according to ERC7201. Namespace storage helps prevent collision between storage of different logic contracts when used in the context of upgradeable contracts and proxies.
Changes:
@custom:storage-location
according to erc7201$
structHow this was tested
CI
TODO: should ideally have unit tests to make sure that the storage location are computed correctly.
How is this documented
TBD