sol-sentry

A fast, static analysis security scanner for Solidity smart contracts, designed to catch common vulnerabilities before they reach mainnet.


Usage

The tool has four main commands: scan, init, fix, and install-hook.

scan

Scans a single Solidity file or an entire directory for vulnerabilities.


# Scan a single file
sol-sentry scan ./contracts/MyNFT.sol

# Scan an entire directory
sol-sentry scan ./contracts

# Output the results in JSON format for scripting
sol-sentry scan . --format json
                    

init

Creates a default sol-sentry.json configuration file in the current directory. This file allows you to exclude files from scans or ignore specific vulnerability types.

sol-sentry init

fix (Pro Feature)

Starts an interactive session to provide detailed explanations and remediation advice for each vulnerability found in your project.

sol-sentry fix

install-hook (Pro Feature)

Installs a Git pre-commit hook in your repository. This will automatically run sol-sentry scan . on every commit, preventing vulnerable code from being checked in.

sol-sentry install-hook