#circomspect #parser

circomspect-parser

Support crate for the Circomspect static analyzer

7 stable releases

2.1.3 Mar 21, 2023
2.0.11 Nov 29, 2022
2.0.10 Sep 13, 2022
2.0.8 Sep 12, 2022

#3 in #identify-potential

Download history 9/week @ 2023-11-01 15/week @ 2023-11-08 15/week @ 2023-11-15 30/week @ 2023-11-22 38/week @ 2023-11-29 7/week @ 2023-12-06 16/week @ 2023-12-13 14/week @ 2023-12-20 16/week @ 2023-12-27 9/week @ 2024-01-03 11/week @ 2024-01-10 13/week @ 2024-01-17 23/week @ 2024-01-24 24/week @ 2024-01-31 16/week @ 2024-02-07 96/week @ 2024-02-14

161 downloads per month
Used in 2 crates

LGPL-3.0-only

425KB
10K SLoC

Circomspect 🔎

Crates.io badge GitHub badge

Circomspect is a static analyzer and linter for the Circom programming language. The codebase borrows heavily from the Rust Circom compiler built by iden3.

Circomspect currently implements a number of analysis passes which can identify potential issues in Circom circuits. It is our goal to continue to add new analysis passes to be able to detect more issues in the future.

Circomspect example image

Installing Circomspect

Circomspect is available on crates.io and can be installed by invoking

  cargo install circomspect

To build Circomspect from source, simply clone the repository and build the project by running cargo build in the project root. To install from source, use

  cargo install --path cli

Running Circomspect

To run Circomspect on a file or directory, simply run

  circomspect path/to/circuit

By default, Circomspect outputs warnings and errors to stdout. To see informational results as well you can set the output level using the --level option. To ignore certain types of results, you can use the --allow option together with the corresponding result ID. (The result ID can be obtained by passing the --verbose flag to Circomspect.)

To output the results to a Sarif file (which can be read by the VSCode Sarif Viewer), use the option --sarif-file.

VSCode example image

Circomspect supports the same curves that Circom does: BN254, BLS12-381, and Goldilocks. If you are using a different curve than the default (BN254) you can set the curve using the command line option --curve.

Analysis Passes

Circomspect implements analysis passes for a number of different types of issues. A complete list, together with a high-level description of each issue, can be found here.

Dependencies

~10–22MB
~316K SLoC