-
Notifications
You must be signed in to change notification settings - Fork 0
Add an experimental layout command #101
base: main
Are you sure you want to change the base?
Conversation
|
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.
lgtm, just one suggestion
await runLayout(etherscanClient, config.layout.addresses, logger) | ||
} | ||
|
||
async function runLayout( |
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.
What do you think about making this function return the results (the layout
variable) and the function above can save them. This would allow us to later export this runLayout
and use the results without having to interface with the filesystem
This PR adds a layout command. This command downloads sources from Etherscan and compiles them with
solc
to get the storage layout. Then it removes indirection and recursion from the layout, flattens the layout and finally combines it with the layouts of other implementations to get a unified view of the storage.This is experimental functionality. While there are tests some edge cases surely exist. There is also the issue of compiler versions. Currently the installed version of solc is used, but that should be changed to a dynamic version based on the sources.
Try it with the following command for the zkSync diamond: