-
Notifications
You must be signed in to change notification settings - Fork 88
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
Allow custom storage slots #162
Comments
If we do it like this, we can maintain full test coverage without writing any new tests: function layout() internal pure returns (Layout storage l) {
l = layout(STORAGE_SLOT);
}
function layout(bytes32 slot) internal pure returns (Layout storage l) {
assembly {
l.slot := slot
}
} |
After some discussion, this seems less useful than I originally thought. For it to work, each contract would have to store a reference to the This could still be a useful change, but needs more thought. Use cases for custom slots:
|
Would only work if storage libraries were merged into internal contracts, which is not desirable. |
I'm once again considering implementing this. If Solidstate introduces a breaking change to support EIP-7201 (#166), we will want to provide a way for existing users to continue using the legacy storage slots. |
A function like this must be added to each storage library:
The text was updated successfully, but these errors were encountered: