Add a virtual pure function that can be overriden to customize the storage location#156
Add a virtual pure function that can be overriden to customize the storage location#156
Conversation
|
imo the NatSpec of the Also, I'm pretty sure we can detect overrides to these functions in upgrades plugins, cc @ericglau |
|
The However, if they are inheriting from a contracts library, they may not be able to modify the parent source code's struct annotation. There is no direct link between the struct and the storage location function, so in order to support this, we could introduce further annotations or heuristics. However, this would be outside the scope (and perhaps an extension) of ERC-7201. Consider the following example from the tests: From the AST's perspective, Two considerations:
|
I'd say yes. IMO the user should not modify the source code of the upgradeable contracts, nor should he redefine a structure. I think there should be a way for the user to add an anotation that overrides the |
TODO:
/// @custom:storage-location erc7201:${id}annotation being invalid if the function is overriden ? How do we deal with that ?