-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Unexpected storage layout caused by interfaces #13332
Comments
A simple demo |
The layout of storage in the presence of inheritance is determined by the C3 linearization of the inheritance graph. That being said, I'm actually wondering, whether interfaces should be exempt from being treated the same as contracts in the C3 linearization - out of my head, it seems to me that this would be possible and might actually be beneficial. This would be a gravely breaking change, though, so at least for the time being, the change in storage layout is expected and this behaviour cannot be changed in the short term... |
yeah, ideally, interfaces should be exempt from the linearization |
Is there any tool to preview the solidity C3 output of a given contract? |
@Elyx0 : you can use slither's inheritance graph: https://github.com/crytic/slither/wiki/Printer-documentation#inheritance-graph
|
This issue has been marked as stale due to inactivity for the last 90 days. |
Hi everyone! This issue has been automatically closed due to inactivity. |
Description
Addition of an interface causes reordering of fields in the storage layout.
Environment
Steps to Reproduce
Compiling of the code below gives following storage layouts:
Expected layout is:
When ITest is removed from P22, then the layout is generated as expected.
This effect depends on position of interfaces on the inheritance list, especially for contracts with complex composition.
The text was updated successfully, but these errors were encountered: