DEV Community

rahuldev-17
rahuldev-17

Posted on • Edited on

1

How to understand long contracts with a visual tool: Sol2Uml

Have you ever faced difficulty in understanding a large solidity contract? If you answer in affirmative, you are in good company. Commercially deployed contracts on mainnet typically runs in ~800 to 1000 LOC. To wrap your brain around the whole contract just by scrolling might not be so useful. So let us explore a visual aid for this purpose: "Solidity to UML".

Let us first see its example on BSC scan (blockchain explorer-mainnet). On the contract page, click the on the "outline" button to get an overview of different interfaces, library and available abstract contracts(zoom in the image for clarity).

verified contract tab on BSC scan

To get a visual representation click on the "more options" dropdown list, and click on the "Sol2Uml" button(zoom in the image for clarity).

verified contract tab on BSC scan

A vector file(SVG) is generated which can be zoomed infinitely to view the call diagrams between class like structures of your contracts.

You can also use it to view contracts in your local environment by installing it as npm package. See details here.

Comment or ask if any further queries down below the box.

Image of Datadog

Master Mobile Monitoring for iOS Apps

Monitor your app’s health with real-time insights into crash-free rates, start times, and more. Optimize performance and prevent user churn by addressing critical issues like app hangs, and ANRs. Learn how to keep your iOS app running smoothly across all devices by downloading this eBook.

Get The eBook

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay