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

Requires Python 3.11 or 3.12. Python 3.13 not yet supported on Windows.


Install

pip install chainaudit

Prerequisites:

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

Usage

# Single file
chainaudit scan contract.sol

# Directory
chainaudit scan ./contracts --recursive

# Zip archive
chainaudit scan contracts.zip

# JSON output
chainaudit scan contract.sol --json

# Skip exploit simulation
chainaudit scan contract.sol --ml-only

Exit code 1 if CRITICAL vulnerabilities found — use in CI to block deployments:

chainaudit scan contracts/ --recursive || echo "Vulnerabilities found, blocking deploy"

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.0.3.tar.gz (23.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.0.3-py3-none-any.whl (17.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: chainaudit-1.0.3.tar.gz
  • Upload date:
  • Size: 23.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.0.3.tar.gz
Algorithm Hash digest
SHA256 c730a8adb7cc270172d5c0a9adee8a37009f44009017b55ec01041eb2b90c7d0
MD5 0a88aa9e1c5cb7a95245e542903c5acb
BLAKE2b-256 4b8f037249bb27e0da2cee3cd82457f61c3edce0776e389b1746697097a672ae

See more details on using hashes here.

File details

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

File metadata

  • Download URL: chainaudit-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 17.9 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.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d6d2d6859fa851ab4f2ee8c39b2fa918d12585bb5b6b14e11511d42e70f418d9
MD5 e77f3f4a34986cc21d5192623fc6e533
BLAKE2b-256 2eb2315bad12c6c47a38ca4f5b915feba51dc1d20b10f05c4d8f389807dd0a3d

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