A suite of tools and libraries for analyzing Compact
language for security vulnerabilities within the Midnight platform.
This workspace includes the following crates:
sdk
: Core SDK for building the AST, codebase, and writing custom security detectors.detectors
: Built-in security detectors for common vulnerability patterns.compact-scanner
: CLI tool to scan.compact
files and run detectors.
-
Clone the repository:
git clone https://github.com/OpenZeppelin/compact-security-detectors-sdk.git
-
Restore submodules:
git submodule update --init --recursive
-
Build the project:
cargo build
-
Scan a directory of
.compact
files:compact-scanner scan ./path/to/compact/files
Detailed developer guides for each crate:
graph TD;
subgraph Parser Layer
I[Compact code] --> G[tree-sitter-compact]
end
subgraph Core SDK
G --> C[sdk]
end
subgraph Analysis
C --> D[detectors]
C --> S[compact-scanner]
end
S -->|Results| O[Output JSON/Console]
See contributing.md for guidelines.
See style guidelines for coding standards and best practices.