naddison36 / sol2uml

Solidity contract visualisation tool
MIT License
1.12k stars 257 forks source link

FR: ignore storage slots matching a pattern #161

Closed aspiers closed 11 months ago

aspiers commented 11 months ago

Here's an example of a contract (0x8A4d...09DD on Polygon) which due to its upgradeability (via OpenZeppelin) has various gaps deliberately inserted in the storage layout:

CarbonOffsetBatches

These __gap structures will never contain data, so it would be great if there was an option to exclude them from the generated diagram.

naddison36 commented 11 months ago

That's a good idea. I'll see what I can do. Maybe have an option which is a comma-separated list of variable names to ignore expanding out.

aspiers commented 11 months ago

Yes that sounds perfect, thanks a lot!

naddison36 commented 11 months ago

I've added support for this in release v2.5.9

Here's the result using your example

sol2uml storage 0xa90dAF1975BA13c26F63976e0Fd73A21F966EE0D --hideExpand __gap --network polygon -v

CarbonOffsetBatches

aspiers commented 11 months ago

Awesome, thanks so much!