๐ Forge Guard
The most comprehensive pre-deployment smart contract auditing framework for Foundry.
๐ Table of Contents
- Overview
- Key Features
- Milestone Summary
- Installation
- Quick Start
- All Commands
- Usage Examples
- Configuration
- Architecture
- Security Checks
- Plugin Development
- CI/CD Integration
- Performance
- Development
- Supported Chains
- Changelog
- Contributing
- License
- Roadmap
Overview
Forge Guard transforms security auditing from an optional step into a mandatory pre-deployment process. It blocks unsafe deployments by default while providing detailed vulnerability reports, exploit path analysis, and comprehensive security scoring.
Built with Rust for maximum performance, forge-guard integrates directly into your Foundry workflow as a drop-in CLI tool.
Key Features
- ๐ 50+ Vulnerability Checks โ Reentrancy, access control, delegatecall, flash loans, MEV, oracles, signatures, and more
- ๐ก๏ธ Deployment Guard โ Blocks unsafe deployments by default;
--forcebypass available with warnings - โ On-Chain Verification โ Auto-verify contracts on Etherscan, Basescan, Arbiscan, and 14 more explorers
- ๐ก Bytecode Matching โ Compare local vs on-chain bytecode via RPC
eth_getCodewith metadata hash stripping - ๐ MEV Analysis โ Detect sandwich, flash loan, oracle, and value extraction attack vectors during simulation
- ๐ค AI-Powered Auditing โ OpenAI GPT-5, Anthropic Claude 5, and Ollama integration with consensus engine
- โ๏ธ Multi-Chain โ 17 supported EVM chains with auto-detected explorer URLs
- โก Parallel Chain Auditing โ
--all-chainsaudits all 17 chains concurrently via Rayon with--max-parallel-chainsconcurrency control, producing an aggregated report with chain-labeled findings - ๐ Plugin Architecture โ Extensible design for custom security rules; built-in + external (IPC subprocess) plugins
- ๐ Rich Reports โ Terminal, JSON, and Markdown output with detailed findings, scores, and remediation
- ๐ฅ Exploit Engine โ Generates attack vectors and proof-of-concept exploit paths
- ๐ฉบ Project Doctor โ Comprehensive health analysis: Foundry version, Solc version, project structure, dependencies, RPC, compiler settings
- ๐ Dependency Scanner โ 30+ known vulnerability entries covering OpenZeppelin, Solmate, Solady, Chainlink, Wormhole, LayerZero, forge-std, PRBMath, solc, and more
- โก High Performance โ Parallel execution via Rayon, filesystem caching, incremental SHA-256 content-hash analysis (unchanged files skipped on re-runs)
- โก Quick Mode โ
forge-guard audit --quickskips parser-heavy checks, ~5x faster for rapid feedback - ๐ Executive Summary โ
forge-guard audit --summaryshows concise PASS/FAIL verdict with action items - ๐๏ธ CI/CD Ready โ Generate pipeline configs for GitHub Actions, GitLab CI, Bitbucket Pipelines, Azure DevOps
- ๐ฏ Audit Templates โ Prebuilt profiles (ERC20, ERC721, DeFi, Bridge, Upgradeable) that adjust checks, scoring weights, and readiness gates; custom templates supported
- ๐ฆ SBOM Generation โ CycloneDX 1.6 / SPDX 2.3 bills of materials with
--ciGitHub Actions export for supply-chain compliance - ๐ช Git Pre-Commit Hook โ One-command install that audits staged
.solfiles and blocks commits with HIGH/CRITICAL findings - ๐ Foundry Config Sync โ
forge-guard doctor --syncimportssrc/test/lib/remappings/solc_versionfromfoundry.toml - ๐ External Analyzer Import โ
forge-guard importingests Slither, Mythril, and Semgrep JSON results with severity mapping, dedup, and unified reporting - ๐ข Webhook Notifications โ
forge-guard notifysends Slack/Discord alerts with rich payloads;--notifyon audit/deploy/deploy-safe - โ Suppression Files โ
.forge-guard-suppressionshides accepted risks and known false positives (--suppressions,--show-suppressed,--generate-suppressions)
Milestone Summary
All 15 development milestones are complete, and M16's Parallel Chain Auditing is shipped. Here's what each delivered:
| # | Milestone | Key Deliverables |
|---|---|---|
| ๐๏ธ | M1 โ Core Architecture | Cargo project, error handling, config system, module structure |
| ๐ฎ | M2 โ CLI Framework | 18 subcommands via clap, global flags (--json, --strict, --offline, etc.) |
| ๐ | M3 โ Security Engine | 50+ vulnerability checks across 5 severity levels, 11-category scoring system |
| ๐ | M4 โ Plugin Architecture | Plugin trait, built-in + IPC subprocess plugins, lifecycle management |
| โ๏ธ | M5 โ Multi-Chain | 17 EVM chains, alias resolution, chain registry with RPC testing |
| ๐ | M6 โ Report Engine | Terminal (color-coded), JSON, and Markdown reports with findings & scores |
| ๐ก๏ธ | M7 โ Deployment Guard | Pre-deployment check pipeline, deploy-safe (non-bypassable), MEV detection |
| ๐ฅ | M8 โ Exploit Engine | Attack vector generation from findings, storage collision analysis |
| โ | M9 โ Contract Verification | 17-chain explorer registry, forge verify-contract, RPC bytecode match, auto-verify |
| ๐ง | M10 โ Gas/Deps/Fuzz/CI | Gas analysis, 30-entry vulnerability DB, fuzzing adapter, 4-platform CI templates |
| ๐ค | M11 โ AI Auditing | OpenAI, Claude, Ollama providers, consensus engine, structured Solidity prompts |
| ๐งช | M12 โ Testing & Docs | 850+ tests, comprehensive README, CONTRIBUTING.md, CI workflows |
| โก | M13 โ Post-MVP Polish | Quick mode (~5x faster), executive summary, incremental file analysis, --summary flag |
| ๐ฏ | M14 โ Developer Experience | Applied audit templates (ERC20, ERC721, DeFi, Bridge, Upgradeable) with check/scoring/gates, SBOM --ci workflow export, per-file pre-commit hook, real foundry.toml sync, custom user templates |
| ๐ | M15 โ External Tooling & Interop | Slither/Mythril/Semgrep import with severity mapping + dedup + unified reports, Slack/Discord webhook notifications (notify, --notify), suppression files for accepted risks |
| โก | M16 โ Performance & Visualization | Parallel chain auditing: --all-chains audits all 17 chains concurrently via Rayon, --max-parallel-chains concurrency bound, aggregated report with chain-labeled findings |
Detailed breakdown: milestone-based-roadmap.md
Installation
Prerequisites
Option 1: Install via Cargo
Option 2: Add to PATH & Verify
# The forge-guard binary is installed to ~/.cargo/bin/
# Add to your .bashrc or .zshrc if not already in PATH:
Verify Installation
Quick Start
Navigate to a Foundry project and run:
# Run a comprehensive security audit
# Audit with strict mode (fail on any finding)
# Full audit including exploit paths and gas analysis
# Check deployment readiness
# Generate Markdown report
Example Output
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
FORGE GUARD โ SECURITY REPORT
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ Project: .
โ๏ธ Chain: ethereum
๐ Duration: 0.00s
๐ Files: 1
โโ Findings โโ
๐ Critical: 0
๐ด High: 0
๐ก Medium: 0
๐ต Low: 0
โช Info: 0
โโ Scores โโ
๐ Access Control: 100/100
๐ก๏ธ Security: 100/100
๐ฏ Fuzzing: 100/100
โฝ Gas: 100/100
๐๏ธ Architecture: 100/100
โฌ๏ธ Upgradeability: 100/100
Overall Score: 100
Risk Level: MINIMAL
Production Ready: โ
YES
Deployment: โ
APPROVED
All Commands
| Command | Description | Example |
|---|---|---|
forge-guard audit |
Run security audit with 50+ checks | forge-guard audit --full --chain base |
forge-guard audit --quick |
Quick audit (skips parser-heavy checks) | forge-guard audit --quick |
forge-guard audit --summary |
Executive summary report | forge-guard audit --summary |
forge-guard deploy |
Deploy with security guard | forge-guard deploy --force |
forge-guard deploy-safe |
Deploy with mandatory security pass | forge-guard deploy-safe Counter |
forge-guard fuzz |
Run fuzzing campaigns | forge-guard fuzz --runs 50000 |
forge-guard invariant |
Run invariant tests | forge-guard invariant --runs 2000 |
forge-guard simulate |
Deployment simulation | forge-guard simulate --blocks 200 |
forge-guard gas |
Gas usage analysis | forge-guard gas --all |
forge-guard report |
Generate audit reports | forge-guard report --format markdown |
forge-guard verify |
Verify contract deployments | forge-guard verify --all |
forge-guard doctor |
Project health analysis | forge-guard doctor --fix |
forge-guard watch |
Watch for changes and re-audit | forge-guard watch --dirs src |
forge-guard ci |
Generate CI/CD configs | forge-guard ci --platform github |
forge-guard benchmark |
Performance benchmarks | forge-guard benchmark --iterations 50 |
forge-guard scan |
Dependency vulnerability scan | forge-guard scan --update |
forge-guard upgrade-check |
Upgrade path analysis | forge-guard upgrade-check --all |
forge-guard plugins |
Manage plugins | forge-guard plugins list |
forge-guard chain |
Chain configuration | forge-guard chain list |
forge-guard security |
Security configuration | forge-guard security list |
forge-guard sbom |
Generate Software Bill of Materials | forge-guard sbom --format cyclonedx |
forge-guard install-hook |
Install git pre-commit hook | forge-guard install-hook |
forge-guard import |
Import external analyzer findings (Slither, Mythril, Semgrep) | forge-guard import --from slither results.json |
forge-guard notify |
Send webhook notifications (Slack, Discord) | forge-guard notify --findings reports/audit.json --on-critical |
๐ Full command reference: See COMMANDS.md for detailed documentation of every subcommand, flag, and example.
Common Flags
Detailed Usage Examples
Security Audit
# Standard audit
# Full audit with everything
# Cross-chain audit
# Output formats
# Analysis scope
# Audit templates
Deployment Guard
# Safe deploy (blocked by issues)
# Deploy with bypass (warnings still shown)
# Deploy specific contract
# Mandatory security pass (no bypass)
# Create2 deployment
# Deploy with auto-verification
Contract Verification
# Verify a single contract
# Bulk verify all deployments from forge script
# Verify on a specific chain
# Explorer and bytecode match are attempted automatically
Quick Mode & Executive Summary
# Quick audit โ skip parser-heavy checks for ~5x faster results
# Show executive summary (concise PASS/FAIL verdict with action items)
# Combine both for fastest feedback loop
# Still get the full report with --report
AI-Powered Auditing
# Run audit with AI (uses OPENAI_API_KEY env var)
# Use Claude instead
# Full AI audit (security + gas + logic auditors)
# Use local Ollama
Deployment Simulation
# Run deployment simulation
# With MEV analysis
# Custom block range and deployer
Dependency Scanning
# Scan project dependencies
# Deep scan (include indirect dependencies)
# Update vulnerability database
# JSON output
# Fail fast on critical vulnerabilities
Project Health
# Full health check
# Verbose output
# Auto-fix issues
# Check specific category
# Sync config from foundry.toml
# Preview sync changes without writing
# Show diff of sync changes
Plugin Management
# List installed plugins
# Create a new plugin scaffold
# Install from source
# Enable/disable
# Remove
CI/CD Generation
# GitHub Actions
# GitLab CI
# With deployment pipeline
# Custom output directory
# Overwrite existing configs
Git Pre-Commit Hook
Automatically audit staged .sol files before each commit. Blocks commits with HIGH/CRITICAL findings.
# Install pre-commit hook
# Force overwrite existing hook
# Uninstall the hook
# Install in specific project
Bypass the hook temporarily:
FORGE_GUARD_SKIP_HOOK=1
SBOM Generation
Generate a CycloneDX 1.6 or SPDX 2.3 Software Bill of Materials for your Foundry project.
# Generate CycloneDX SBOM (stdout)
# SPDX format
# Save to file
# Also write a GitHub Actions workflow for automated SBOM publishing
The --ci flag writes .github/workflows/sbom.yml, a workflow that generates both CycloneDX and SPDX SBOMs on every push to main/master and uploads them as build artifacts โ useful for supply-chain compliance (EO 14028 / NTIA minimum elements).
External Analyzer Import
Adopt Forge Guard incrementally by importing findings from the tools you already run:
# Import Slither results
# Import Mythril results and deduplicate against your last forge-guard audit
# Import Semgrep results as a unified JSON report
Severity scales are mapped automatically (Slither impact, Mythril severity/type, Semgrep ERROR/WARNING/INFO), and findings that duplicate Forge Guard's own are removed.
Webhook Notifications
Get Slack/Discord alerts without watching the CI tab:
# Summarize the last audit to a Slack webhook
# Discord embed, only when critical findings exist
# Preview the exact payload without sending
# Notify automatically after an audit / deployment
Configure webhooks once in forge-guard.toml (see Configuration); blocked deployments always notify, successful runs respect min_severity.
Suppression Files
Permanently silence known false positives and accepted risks (see examples/.forge-guard-suppressions for the file format):
# Generate a suppression file from the current findings
# Use it on subsequent audits (matching findings are hidden from scoring)
# Show suppressed findings (visually marked) instead of hiding them
File format โ one entry per line, FINDING_ID [file] # comment:
FA-H-001 # Known false positive in Vault.sol
FA-M-004 src/oracle/PriceFeed.sol
Audit Templates
Use predefined audit templates to focus on specific contract types. Templates don't just print a banner โ they actually adjust the audit: template enabled_checks/disabled_checks are wired into the security engine, focus_areas weight categories 2ร in the overall score, and min_scores gate production readiness.
# List available templates
# ERC20 token audit
# DeFi protocol audit
# Upgradeable contract audit
Built-in Templates
| Template | Focus |
|---|---|
erc20 |
Approval bugs, permit replay, token-specific vulnerabilities |
erc721 |
NFT patterns, royalties, metadata integrity |
defi |
Lending, AMM, oracles, flash loans, MEV resistance |
bridge |
Cross-chain messaging, validator sets, replay attacks |
upgradeable |
Proxy patterns, storage layouts, initializers |
Custom Templates
Drop a JSON file into ~/.forge-guard/templates/ to define your own template or override a built-in by name:
Run it with forge-guard audit --template my-protocol.
Configuration
Forge Guard reads configuration from forge-guard.toml in the project root. All fields are optional.
๐ก Ready-to-edit templates: see
examples/forge-guard.tomlfor a fully commented config (including Slack/Discord webhooks) andexamples/.forge-guard-suppressionsfor a sample suppression file.
Minimal Configuration
# forge-guard.toml
= ["src", "contracts"]
Full Configuration Reference
# โโ Source Settings โโ
= ["src", "contracts"] # Source directories to scan
= ["test", "mock", "interfaces"] # Exclusion patterns
# โโ Chain โโ
= "ethereum" # Default target chain
# โโ Security Engine โโ
[]
= true # Enable HIGH severity checks
= true # Enable MEDIUM severity checks
= true # Enable LOW severity checks
= false # Enable INFORMATIONAL checks
= true # Enable exploit path analysis
= false # Enable gas analysis
= 50 # Max findings per check type
# โโ Deployment Guard โโ
[]
= 70 # Minimum score to deploy (0-100)
= true # Block on critical findings
= true # Block on high findings
= false # Block on medium findings
= true # Require fuzzing to pass
= true # Require invariants to pass
= true # Run deployment simulation
= false # Require on-chain verification
= false # Auto-verify after deployment
= null # Explorer API key (reads env var when null)
# โโ Report Settings โโ
[]
= true # Include code snippets
= true # Include exploit demonstrations
= true # Include fix recommendations
= "reports" # Report output directory
# โโ Caching โโ
[]
= false # Enable caching (disable for CI)
= ".forge-guard-cache" # Cache directory
= 500 # Maximum cache size
= 3600 # Cache TTL (1 hour)
# โโ Plugin Configuration โโ
[]
= [".forge-guard/plugins"] # Plugin search paths
= ["forge-guard-example"] # Disable specific plugins
= false # Allow external plugin loading
# โโ AI Auditors โโ
[]
= "openai" # AI provider: openai, claude, ollama
= "gpt-5" # Model identifier
= 0.1 # Sampling temperature (0.0-1.0)
= 4000 # Max tokens per response
= 0.5 # Minimum confidence (0.0-1.0)
= false # Run all auditors (security + gas + logic)
# โโ Webhook Notifications โโ
[]
= "https://hooks.slack.com/services/T000/B000/XXXX" # Slack incoming webhook
= "high" # Notify when findings are at least this severe
[]
= "https://discord.com/api/webhooks/123/abc" # Discord webhook
= "critical"
Command-Line Overrides
CLI flags override config file values:
Architecture
โโโโโโโโโโโโโโโ
โ CLI Layer โ (clap argument parsing)
โโโโโโโโฌโโโโโโโ
โ
โโโโโโโโโโโโโโผโโโโโโโโโโโโโ
โผ โผ โผ
โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ
โ Audit โ โ Deploy โ โ CI โ ... 18 commands
โโโโโโฌโโโโโโ โโโโโโฌโโโโโโ โโโโโโฌโโโโโโ
โ โ โ
โผ โผ โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Security Engine โ
โ โโโโโโโโ โโโโโโโโ โโโโโโโโโโโโโโโ โ
โ โCEI โ โAccessโ โDelegatecall โ โ 50+ checks
โ โAnalysisโ โControlโโ โ โ
โ โโโโโโโโ โโโโโโโโ โโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโดโโโโโโโโโโ
โผ โผ
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ
โPlugin Registryโ โ Chain Registry โ
โ Built-in/IPC โ โ 17 EVM Chains โ
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโดโโโโโโโโโโ
โผ โผ
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ
โDeployment โ โ Report Engine โ
โGuard โ โ JSON / Markdown โ
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโดโโโโโโโโโโ
โผ โผ
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ
โ Exploit โ โ Doctor / Scan โ
โ Engine โ โ Health Checks โ
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ
Module Breakdown
| Module | Purpose |
|---|---|
src/core/ |
Types, config, error handling, audit results |
src/security/ |
50+ vulnerability checks + scoring engine |
src/plugins/ |
Plugin trait, built-in + external (IPC) plugins |
src/chains/ |
Chain registry with 17 EVM chains |
src/deployment/ |
Deployment guard + on-chain contract verifier |
src/deployment/verifier/ |
Block explorer registry, forge verify, RPC bytecode match |
src/reports/ |
JSON and Markdown report generation |
src/exploit/ |
Attack vector and exploit path generation |
src/dependencies/ |
30+ known vulnerability entries, online updates |
src/doctor/ |
Project health analysis |
src/gas/ |
Gas usage analysis and optimization suggestions |
src/fuzzing/ |
Fuzzing adapter interface |
src/ci/ |
CI/CD pipeline template generation |
src/benchmark/ |
Performance benchmarking |
src/parser/ |
Solidity source code parser |
src/ai/ |
AI auditing: providers (OpenAI, Claude, Ollama), auditors, consensus engine |
src/ai/providers/ |
OpenAI, Claude, Ollama HTTP client implementations |
src/ai/auditors/ |
Security, Gas, Logic auditor agents with Solidity prompts |
src/ai/consensus/ |
Cross-provider validation with confidence boosting |
src/importer/ |
External analyzer import: Slither/Mythril/Semgrep parsers, severity mapping, dedup |
src/notify/ |
Slack/Discord webhook payloads and sender, severity gating |
src/suppressions/ |
Suppression file parsing, matching, and generation |
src/utils/ |
Caching, formatting utilities |
Security Checks
HIGH Severity (blocks deployment)
| ID | Check | Description |
|---|---|---|
| FA-H-001 | Reentrancy | CEI violations, callback reentrancy, read-only reentrancy, self-call paths |
| FA-H-002 | Access Control | Missing modifiers, inline access checks, role-based access in initialize functions |
| FA-H-003 | Delegatecall | Unsafe delegatecall patterns |
| FA-H-004 | tx.origin | tx.origin for authentication |
| FA-H-005 | CREATE2 | CREATE2 address precomputation risks |
| FA-H-006 | DoS | Unbounded loops, denial of service |
| FA-H-007 | Storage Collision | Upgradeable contract storage gaps |
| FA-H-008 | Unsafe Assembly | Inline assembly blocks |
| FA-H-009 | Selfdestruct | selfdestruct usage |
| FA-H-010 | Proxy Vulnerabilities | Unsafe proxy patterns |
| FA-H-011 | Oracle Manipulation | Price oracle manipulation risks |
| FA-H-012 | Signature Vulnerabilities | Signature malleability, EIP-2098 issues |
| FA-H-013 | Replay Attacks | Cross-chain replay, missing nonces |
| FA-H-014 | ERC20 Issues | Approve race conditions |
| FA-H-015 | Bridge Vulnerabilities | Cross-chain bridge patterns |
| FA-H-016 | Flash Loan Issues | Flash loan attack surface |
| FA-H-017 | MEV Issues | Slippage, sandwich vulnerabilities |
| FA-H-018 | Cross-Chain Issues | Chain ID handling, message verification |
| FA-H-019 | Dependency Vulnerabilities | Known vulnerable dependencies |
| FA-H-020 | Unsafe Imports | HTTP/github imports |
| FA-H-021 | Unsafe Initializers | Missing initializer modifiers |
| FA-H-022 | Unsafe Upgrade Paths | UUPS/Transparent proxy paths |
| FA-H-023 | Clone Vulnerabilities | Minimal proxy clones |
MEDIUM Severity
| ID | Check | Description |
|---|---|---|
| FA-M-001 | Gas Problems | Inefficient patterns |
| FA-M-002 | Unsafe Casting | Unsafe type conversions |
| FA-M-003 | Timestamp Manipulation | block.timestamp in critical logic |
| FA-M-004 | Storage Inefficiencies | Unpacked storage variables |
| FA-M-005 | Unsafe Events | Sensitive data in events |
| FA-M-006 | Poor Visibility | Public mappings |
| FA-M-007 | Bad Modifiers | Modifiers making external calls |
| FA-M-008 | Unsafe Math | Unchecked arithmetic |
| FA-M-009 | Poor Access Patterns | Storage vs memory |
LOW & INFORMATIONAL
- Naming conventions
- Code duplication
- Optimization suggestions
- Style issues
- Missing documentation
- Line length
Plugin Development
Built-in Plugin
Create a built-in plugin by implementing the Plugin trait:
use ;
;
External Plugin (IPC Subprocess)
Plugins can also be external binaries communicating via JSON IPC:
# Create a plugin scaffold
The protocol:
- stdin: JSON
PluginIpcInputwith context - stdout: JSON
PluginIpcOutputwith findings - stderr: Diagnostic logs
CI/CD Integration
GitHub Actions (auto-generated)
# Run: forge-guard ci --platform github
name: Forge Guard Security Check
on:
jobs:
security-audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Install Forge Guard
run: cargo install forge-guard
- name: Security Audit
run: forge-guard audit --strict
- name: Scan Dependencies
run: forge-guard scan --depth 1
- name: Generate Report
run: forge-guard audit --report --markdown
With Deployment Protection
name: Deploy
on:
push:
branches:
jobs:
security-audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: foundry-rs/foundry-toolchain@v1
- name: Security check
run: forge-guard audit --strict --production
- name: Safe deploy
run: forge-guard deploy-safe
env:
ETH_RPC_URL: ${{ secrets.ETH_RPC_URL }}
PRIVATE_KEY: ${{ secrets.DEPLOYER_PRIVATE_KEY }}
Performance
- Parallel execution via Rayon โ all file analysis runs in parallel across CPU cores
- Filesystem caching โ analysis results cached with TTL; only changed files re-analyzed
- Memory-efficient โ streaming reads for large codebases
- Incremental โ re-audits only process modified files
- Benchmark mode โ measure and compare performance across versions
# Run benchmarks
# Benchmark specific module
# Compare with baseline
Development
Building
# The binary is at target/release/forge-guard
Testing
# Run all tests (850+)
# Run specific test suites
# Run with output
Linting & Formatting
# Check formatting
# Apply formatting
# Lint
Test Coverage
| Module | Tests | Status |
|---|---|---|
| AI providers (OpenAI, Claude, Ollama) | โ 11 | in-module tests |
| AI auditors (prompts, parsing, chunking) | โ 12 | in-module tests |
| AI consensus (dedup, boost, filtering) | โ 9 | in-module tests |
| Contract verifier (explorer URLs, bytecode) | โ 11 | in-module tests |
| Core types/config | โ 13 | integration_tests |
| Security engine (incl. template filtering) | โ 34 | security_tests |
| CLI end-to-end (audit, deploy, templates, sync, SBOM, hook) | โ 104 | cli_tests |
| Plugin architecture | โ 25 | plugin_tests |
| Dependency scanner | โ 14 | in-module tests |
| Parser | โ 39 | in-module tests |
| Chains | โ 8 | in-module tests |
| Deployment | โ 6 | in-module tests |
| Reports | โ 3 | in-module tests |
| Exploit engine | โ 2 | in-module tests |
| Utils | โ 6 | in-module tests |
| Gas analysis | โ 3 | in-module tests |
| CI generator (incl. SBOM workflow) | โ 21 | in-module tests |
| Doctor (incl. foundry.toml sync) | โ 18 | in-module tests |
| SBOM formats (CycloneDX/SPDX) | โ 56 | in-module tests |
| Templates (apply, override, serialization) | โ 16 | in-module tests |
| Pre-commit hook (install/uninstall/script) | โ 13 | in-module tests |
Supported Chains
| Chain | Chain ID | Currency | Status |
|---|---|---|---|
| Ethereum | 1 | ETH | โ |
| Base | 8453 | ETH | โ |
| Arbitrum | 42161 | ETH | โ |
| Optimism | 10 | ETH | โ |
| Polygon | 137 | MATIC | โ |
| BNB Chain | 56 | BNB | โ |
| Avalanche | 43114 | AVAX | โ |
| Scroll | 534352 | ETH | โ |
| Linea | 59144 | ETH | โ |
| Unichain | 130 | ETH | โ |
| ZKSync | 324 | ETH | โ |
| HyperEVM | 999 | HYPE | โ |
| Monad | 10143 | MON | โ |
| Sonic | 146 | S | โ |
| Blast | 81457 | ETH | โ |
| Mantle | 5000 | MNT | โ |
| Robinhood | 31753 | ETH | โ |
Future Support
Solana ยท Tron ยท Sui ยท Aptos
Contributing
See CONTRIBUTING.md for detailed guidelines.
Key points:
- Run
cargo test && cargo fmt && cargo clippybefore submitting PRs - Add tests for new functionality
- Document public APIs
- Follow Rust standard conventions
License
MIT โ see LICENSE for details.
Roadmap
See milestone-based-roadmap.md for the complete development roadmap.
| Milestone | Status |
|---|---|
| M1: Core Architecture | โ Complete |
| M2: CLI Framework | โ Complete |
| M3: Security Engine | โ Complete |
| M4: Plugin Architecture | โ Complete |
| M5: Multi-Chain Support | โ Complete |
| M6: Report Engine | โ Complete |
| M7: Deployment Guard | โ Complete |
| M8: Exploit Engine | โ Complete |
| M9: Contract Verification | โ Complete |
| M10: Gas/Deps/Fuzz/CI/Bench | โ Complete |
| M11: AI-Powered Auditing | โ Complete |
| M12: Testing & Documentation | โ Complete |
| M13: Post-MVP Polish | โ Complete |
| M14: Developer Experience & Integrations | โ Complete |
| M15: External Tooling & Interoperability | โ Complete |
| M16: Performance & Visualization | ๐ In Progress โ Parallel Chain Auditing โ , Dashboard & Trends pending |