traverse-mermaid
Mermaid diagram generation for visualizing Solidity smart contract interactions.
Overview
This crate provides utilities to generate Mermaid diagrams from analyzed Solidity code, enabling visual representation of contract relationships, call graphs, and sequence diagrams. Mermaid diagrams can be rendered in documentation, GitHub, or any Mermaid-compatible viewer.
Features
- Sequence Diagrams: Visualize contract interaction flows
- Call Graphs: Map function call relationships
- Class Diagrams: Show contract inheritance and structure
- State Diagrams: Represent contract state machines
- Clean, readable Mermaid syntax output
Usage
use ;
Output Example
sequenceDiagram
participant User
participant Contract
User->>Contract: deploy()
Contract-->>User: Deployed
Supported Diagram Types
- Sequence diagrams with alt/opt/loop blocks
- Directed graphs for call analysis
- Flowcharts for control flow
- Class diagrams for contract structure
Part of Traverse
This crate is part of the Traverse suite of tools for Solidity code analysis, visualization, and test generation.
License
MIT OR Apache-2.0