Skip to content
NinaTeaPublic

About

static analyzer for circom circuits

Resources

Stars

8 stars

Watchers

0 watching

Forks

Repository files navigation

Zorro - Static Analyzer for Circom DSL


WIP

This is a work in progress, feel free to contribute!

In the near future:

  • Proper testing of detectors (add known vulnerable circuits and analyze detection scope and false positives).
  • Add proper detector documentation: implementation details, vulnerabilities to check, and remediation.

Acknowledgements

All the vulnerabilities are from zk-bug-tracker. Including examples and solutions.

This is software intended to detect unwated patterns or bad practices.

How to use

  1. Clone this repository (remember it has a submodule!).
~$ git clone --recursive git@github.com:NinaTea/Zorro.git

  1. Install the dependencies (Python >= 3.10). This also compiles the Circom grammar from the submodule, so a C compiler is needed.
~/Zorro$ python3 -m venv venv
~/Zorro$ source venv/bin/activate
~/Zorro$ pip install -r requirements.txt
  1. Make a directory at ~/Zorro$ with your circuits.
  2. Run this command
~/Zorro$ python3 zorro_analyzer_main.py <your_directory/>

example:

~/Zorro$ python3 zorro_analyzer_main.py tests/

Detectors

  1. Bad practices
  2. Arithmetic Over/Under Flows
  3. Underconstrained Circuits
Detector Bug Type Test Cases
to_do_comment 1 1
has_range_check 2 1
has_less_than_check 2 1
assigned_but_no_constrained 3 1

About

static analyzer for circom circuits

Resources

Stars

8 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages