Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CallGraph Documentation #28

Merged
merged 13 commits into from
Nov 16, 2024
3 changes: 2 additions & 1 deletion cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@
"Dont",
"consteval",
"Georgiy",
"Komarov"
"Komarov",
"callgraph"
],
"flagWords": [],
"ignorePaths": [
Expand Down
33 changes: 33 additions & 0 deletions docs/tools/DumpCallGraph.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# DumpCallGraph

Misti provides a feature to dump the [Call Graph (CG)](https://en.wikipedia.org/wiki/Call_graph) in JSON, DOT, and Mermaid formats. This is essential for understanding the function call relationships within your Tact contracts and analyzing the flow of function calls.

## Usage

To dump the CG in Mermaid format, use the following command:

```bash
misti -t "DumpCallGraph:format=mmd" <TACT_CONFIG_PATH|TACT_FILE_PATH> > callgraph.mmd
```

To dump the CG in Graphviz DOT format, use the following command:

```bash
misti -t "DumpCallGraph:format=dot" <TACT_CONFIG_PATH|TACT_FILE_PATH> > callgraph.dot
```

To dump the CG in JSON format, use the following command:

```bash
misti -t "DumpCallGraph:format=json" <TACT_CONFIG_PATH|TACT_FILE_PATH> > callgraph.json
```

## Further Information

For detailed instructions on how to work with the generated Mermaid, Graphviz DOT, and JSON files—including how to view, convert, and visualize them—please refer to the [DumpCfg documentation](./DumpCfg.md#working-with-graphviz). The steps and tools used for `DumpCallGraph` outputs are the same as those described for `DumpCfg`.

By utilizing the `DumpCallGraph` tool, developers can gain deeper insights into the function call structure of their contracts and effectively debug and enhance their code.

---

**Note:** Replace `<TACT_CONFIG_PATH|TACT_FILE_PATH>` with the actual path to your Tact configuration file or Tact contract file when running the commands.
5 changes: 5 additions & 0 deletions sidebars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,11 @@ const sidebars: SidebarsConfig = {
id: 'hacking/custom-detector',
label: 'Writing Custom Detectors',
},
{
type: 'doc',
id: 'hacking/custom-detector',
label: 'Writing Custom Detectors',
},
],
};

Expand Down
Loading
Loading