Skip to content

Comments

Issue #241: Add Contract Dependency Graph Visualization#241

Merged
Timi16 merged 1 commit intoTimi16:mainfrom
Tijesunimi004:feature/201-contract-dependency-graph
Feb 23, 2026
Merged

Issue #241: Add Contract Dependency Graph Visualization#241
Timi16 merged 1 commit intoTimi16:mainfrom
Tijesunimi004:feature/201-contract-dependency-graph

Conversation

@Tijesunimi004
Copy link
Contributor

@Tijesunimi004 Tijesunimi004 commented Feb 23, 2026

Description

This PR addresses Issue #241 by implementing the ability to analyze a contract's cross-contract call patterns and export a directed dependency graph. It supports visualizing the dependencies in both Graphviz (DOT) and Mermaid markdown formats natively from the CLI.

Key Changes

  • CLI Arguments (src/cli/args.rs):
    • Updated the --dependency-graph flag in InspectArgs to accept a specified <FORMAT> mapping to a newly introduced GraphFormat Enum (Dot | Mermaid).
  • Graph Structure (src/analyzer/graph.rs):
    • Enhanced the Mermaid formatting exporter to_mermaid() to construct standard flowchart visualizations using flowchart TD styling headers instead of the older graph LR formatting format.
  • Execution Hooks (src/cli/commands.rs):
    • Refactored the inspect execution blocks to safely parse the exact requested format structure (GraphFormat::Dot or GraphFormat::Mermaid), ensuring unselected format strings are stripped and logs stay strictly isolated to the user-requested visualization format.

Testing

  • Added comprehensive unit tests that rigorously validate both Graph format output structures rendering correct quotes, nodes, edges, and headers accurately.
  • Ran cargo fmt to enforce codebase styling standards and executed cargo test verifying zero stability regressions across CLI integration mapping formats correctly.

Related Issues

Closes #241

@Timi16 Timi16 merged commit 2cbaacc into Timi16:main Feb 23, 2026
4 checks passed
@Tijesunimi004 Tijesunimi004 changed the title Issue #201: Add Contract Dependency Graph Visualization Issue #241: Add Contract Dependency Graph Visualization Feb 23, 2026
Tijesunimi004 added a commit to Tijesunimi004/soroban-debugger that referenced this pull request Feb 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants