MCPcopy Index your code
hub / github.com/0xKitsune/solstat

github.com/0xKitsune/solstat @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
179 symbols 473 edges 87 files 13 documented · 7%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

solstat

A Solidity static analyzer to identify contract vulnerabilities and gas efficiencies.

.------. .------. .------. .------. .------. .------. .------.
|S.--. | |O.--. | |L.--. | |S.--. | |T.--. | |A.--. | |T.--. |
| :/\: | | :/\: | | :/\: | | :/\: | | :/\: | | (\/) | | :/\: |
| :\/: | | :\/: | | (__) | | :\/: | | (__) | | :\/: | | (__) |
| '--'S| | '--'O| | '--'L| | '--'S| | '--'T| | '--'A| | '--'T|
`------' `------' `------' `------' `------' `------' `------'

Table of Contents

 

Installation

First, make sure that you have Rust installed. Then you can choose either of the installation methods by entering the corresponding command in your terminal below.

 

Install from crates.io

cargo install solstat

 

Install from source

git clone https://github.com/0xKitsune/solstat &&
cd solstat &&
cargo install --path .

 

Usage

Now that you have solstat involved, you can use the solstat command from anywhere in your terminal. By default, solstat looks for a ./contracts directory and analyzes every file within the folder. If you would like to specify the directory solstat should use, you can pass the --path flag (ex. solstat --path <path_to_dir>).

In the default configuration, solstat runs analysis for every currently included Optimization, Vulnerability and QA, however if you would like to run analysis for select patterns, you can create a .toml file for your custom configuration. Check out the default solstat.toml configuration for reference. After creating a custom .toml file, make sure to pass the --toml flag when running solstat (ex. solstat --toml <path_to_toml_file>).

Once solstat runs its analysis, a report will be generated and output as solstat_report.md.

At any point you can use solstat --help to see a list of all commands and options.

Usage: solstat [OPTIONS]

Options:
  -p, --path <PATH>  Path to the directory containing the files solstat will analyze. The default directory is `./contracts`
  -t, --toml <TOML>  Path to the toml file containing the solstat configuration when not using the default settings.
  -h, --help         Print help information

 

Contributing

First off, thanks for taking the time to contribute! Contributions are welcomed and greatly appreciated.

If you are interested in contributing, please check out Contributing.md.

Core symbols most depended-on inside this repo

into
called by 187
src/analyzer/ast.rs
extract_target_from_node
called by 38
src/analyzer/ast.rs
report_section_content
called by 33
src/report/report_sections/qa/overview.rs
expression
called by 24
src/analyzer/ast.rs
extract_targets_from_node
called by 10
src/analyzer/ast.rs
source_unit_part
called by 8
src/analyzer/ast.rs
contract_part
called by 8
src/analyzer/ast.rs
pack_storage_variables_optimization
called by 7
src/analyzer/optimizations/pack_storage_variables.rs

Shape

Function 160
Method 10
Enum 6
Class 3

Languages

Rust100%

Modules by API surface

src/analyzer/ast.rs19 symbols
src/analyzer/utils.rs13 symbols
src/analyzer/optimizations/safe_math.rs7 symbols
src/analyzer/vulnerabilities/unprotected_selfdestruct.rs6 symbols
src/analyzer/vulnerabilities/mod.rs5 symbols
src/analyzer/qa/mod.rs5 symbols
src/analyzer/optimizations/mod.rs5 symbols
src/opts.rs4 symbols
src/analyzer/optimizations/increment_decrement.rs4 symbols
src/analyzer/optimizations/immutable_variables.rs4 symbols
src/report/vulnerability_report.rs3 symbols
src/analyzer/optimizations/shift_math.rs3 symbols

For agents

$ claude mcp add solstat \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact