Skip to main content

Smart contract security scanner — Slither + ML exploitability prediction

Project description

ChainAudit

Smart contract security scanner powered by Slither + ML exploitability prediction.

PyPI License: MIT


Install

Mac / Linux / Ubuntu

pip install chainaudit
pip install slither-analyzer
pip install solc-select
solc-select install 0.8.24
solc-select use 0.8.24

Windows

Requires Python 3.12. Download from python.org — check "Add Python to PATH" during install. Python 3.13 not yet supported on Windows.

pip install chainaudit
pip install slither-analyzer
pip install solc-select
solc-select install 0.8.24
solc-select use 0.8.24

If on a college/office network, use mobile hotspot for installation.


Usage

chainaudit scan contract.sol               # single file
chainaudit scan ./contracts --recursive    # directory
chainaudit scan contracts.zip              # zip archive
chainaudit scan contract.sol --json        # JSON output
chainaudit scan contract.sol --ml-only     # skip simulation
chainaudit --version                       # show version

Exit code 1 if CRITICAL vulnerabilities found — blocks deployments in CI.


GitHub Action

- uses: aizen299/smart-contract-auditor@v1
  with:
    target: contracts/
    fail-on-critical: true

What It Detects

EVM (Ethereum, Polygon, BNB Chain...)

Severity Examples
CRITICAL Reentrancy, Controlled Delegatecall
HIGH Unchecked Token Transfer, Weak Randomness, tx.origin Auth
MEDIUM Timestamp Dependence, Unchecked Send
LOW Missing Zero Check, Missing Events

L2 / Arbitrum / Optimism — auto-detected

Severity Examples
CRITICAL Cross-Chain Replay Attack, Bridge Reentrancy
HIGH L2 Block Number Assumption, Sequencer Dependence, Address Aliasing
MEDIUM Force-Include Griefing, Gas Price Assumption

L2 rules activate automatically when the scanner detects Arbitrum/Optimism identifiers (ArbSys, xDomainMessageSender etc.) in the contract source.


ML Predictions

Each finding includes an ML-predicted exploitability score trained on the SmartBugs dataset (143 contracts, 88% accuracy).

{
  "title": "Reentrancy",
  "severity": "CRITICAL",
  "ml_exploitability": "CRITICAL",
  "ml_confidence": 0.96
}

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chainaudit-1.1.0.tar.gz (32.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chainaudit-1.1.0-py3-none-any.whl (26.6 kB view details)

Uploaded Python 3

File details

Details for the file chainaudit-1.1.0.tar.gz.

File metadata

  • Download URL: chainaudit-1.1.0.tar.gz
  • Upload date:
  • Size: 32.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for chainaudit-1.1.0.tar.gz
Algorithm Hash digest
SHA256 3e23029c0b860c6c8b50414befe6b18edb889d4962ab4fd8bb9c152df44ca12f
MD5 ded7fbc34e4078dbd06c61a03a51b6a5
BLAKE2b-256 d7fa8d25524ded15862aa64310fe51edb6742b42a6d3197862fe9e2b8f561878

See more details on using hashes here.

File details

Details for the file chainaudit-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: chainaudit-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 26.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for chainaudit-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3f8b542443140b34045bede311b07f6c3af3b107e5169d9b6f9fa8f228c2bd69
MD5 153db812368baf1a3acf9849c1368e0d
BLAKE2b-256 14b9f14b4a8d062b2f8e6e4a4d89f82c714e9abfdb8dc2e888bac7552fff4b02

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page