Autonomous, Evidence-Backed Web3 & DeFi Vulnerability Hunting Engine
KISS Philosophy · Anti-Bamboozle Detached Auditor · Zero-Cheat PoC Synthesizer · Cryptographic Ledger
In Web3 bug bounty (Immunefi, Cantina, Code4rena, Sherlock), theoretical alerts and AI hallucinations have zero financial value. A vulnerability is only real when backed by a deterministic, reproducible, executable Proof of Concept (PoC) with measurable state delta on a pinned block.
hunt is built from first principles with Effect-TS to bridge the gap between AI reasoning and deterministic blockchain validation:
-
Anti-Bamboozle Detached Auditor:
- The implementing AI agent is never trusted to certify its own claims.
- An independent, isolated subprocess re-executes the PoC on a clean local Anvil fork to verify all 7 Validation Gates before any finding can be confirmed.
-
Strict State Delta & Anti-Cheat PoC Engine:
- Findings require an executable Foundry test (
testExploit()) demonstrating measurable economic gain ($\Delta\text{Balance} > 0$ ) or privilege takeover. - Prohibits
vm.storecheatcode bypasses: exploits must use realistic transactions.
- Findings require an executable Foundry test (
-
Autonomous Hunt Loop (
/hunt auto):- Exa semantic radar combined with GitHub search to discover newly launched DeFi platforms and pull verified contracts.
- Continues deep auditing in local sandboxes until a real, confirmed vulnerability is captured and proven.
-
Zero-Key Verified Contract Pulling:
- Automatically pulls multi-file Solidity source trees from Blockscout V2 and Sourcify for 8+ EVM networks without requiring any API keys.
-
Integrated
chain-traceOn-Chain Forensics:- 18 forensic analysis modules for honeypot detection, rug-pull analysis, DBSCAN holder cluster detection, and token flow tracing.
-
Full Effect-TS Service Architecture:
- Zero-leak resource management via
ScopeandEffect.acquireRelease(auto-teardown of Anvil forks and temporary sandboxes). - Pure typed errors (
HuntError), structured concurrency (Fibers), and schema validation.
- Zero-leak resource management via
-
Cryptographic SHA-256 Hash Chain:
- Append-only event-sourcing ledger verifying that every command output, finding, and report is cryptographically linked and tamper-proof.
graph TD
subgraph UI_Layer ["UI & Entry"]
CLI["CLI: hunt [target]"]
TUI["Pi TUI: /hunt [target]"]
AUTO["Auto Loop: /hunt auto [query]"]
end
subgraph Agent_Layer ["Pi Agent (Cognitive Layer)"]
EXA["Exa & GH Discovery Radar"]
XRAY["X-Ray Threat Modeling"]
INVAR["Invariant & Hypothesis Synthesis"]
POC_GEN["Foundry Exploit PoC Drafting"]
FORENSICS["Chain-Trace On-Chain Forensics"]
end
subgraph Effect_Layer ["Effect-TS Services (Deterministic Muscle & Arbiter)"]
MULTI["MultiChainService (8+ EVM Networks & Zero-Key Pulling)"]
FORK["ForkService (Scoped Ephemeral Anvil Lifecycle)"]
SCAN["ScannerService (Forge, Slither, Aderyn, Halmos, Echidna, Medusa)"]
POC["PoCService (Anti-Cheat & State Delta Verification)"]
AUDIT["DetachedAuditorService (Isolated 7-Gate Arbiter)"]
LEDGER["LedgerService (SHA-256 Hash-Chained Event Sourcing)"]
end
CLI --> Agent_Layer
TUI --> Agent_Layer
AUTO --> Agent_Layer
Agent_Layer --> EXA
Agent_Layer --> FORENSICS
Agent_Layer --> XRAY
XRAY --> INVAR
INVAR --> SCAN
INVAR --> POC_GEN
POC_GEN --> POC
POC --> FORK
POC --> AUDIT
AUDIT --> LEDGER
LEDGER --> REPORT["Verified Bounty Report (Immunefi / Cantina)"]
# Clone repository
git clone https://github.com/ArchdevilForge/pi-web3-hunter.git
cd pi-web3-hunter
# Install dependencies and build
npm install
npm run build
# Link globally for terminal CLI
npm link
# Install into Pi coding agent
pi install $(pwd)hunt automatically detects installed security scanners and falls back to standard user paths (~/.cargo/bin, ~/.config/.foundry/bin, ~/.local/bin, ~/go/bin, uv tool dirs):
| Tool | Category | Installation / Source |
|---|---|---|
Foundry (forge, cast, anvil) |
Core EVM Dev & Testing | `curl -L https://foundry.paradigm.xyz |
| Slither | Python Static Analysis | uv tool install slither-analyzer |
| Aderyn | Fast Rust Static Analysis | cargo install aderyn |
| Halmos | Symbolic Execution Formal Verifier | uv tool install halmos |
| Echidna | Haskell Invariant Fuzzing | gh release download -R crytic/echidna |
| Medusa | Go Parallel Invariant Fuzzer | go install github.com/crytic/medusa@latest |
| Docker | Containerized Scanning | System package manager |
Check scanner health anytime with:
hunt checkBoth in the terminal and in Pi TUI, everything uses the same concise command: hunt.
Pi TUI includes interactive autocomplete (/hunt + Tab / space):
# 1. Autonomous Hunting Loop (Exa Search -> Auto-Audit -> Stop on Confirmed Bug)
/hunt auto
/hunt auto dex
/hunt auto "base launchpad"
# 2. Audit Current Workspace (Default Goal mode)
/hunt .
# 3. Audit a Deployed Smart Contract (Auto-extracts verified source + local Anvil fork)
/hunt 0x1F98431c8aD98523631AE4a59f267346ea31F984 -c 1
# 4. Audit a DApp URL or GitHub Repository
/hunt https://app.uniswap.org
/hunt https://github.com/Uniswap/v3-core
# 5. Status, Reports & Verification
/hunt status # Display live progress and confirmed findings
/hunt report # Build and export markdown audit report
/hunt verify # Verify cryptographic evidence ledger integrity
/hunt check # Preflight tool availability check
# Start a hunt on current directory, URL, or contract
hunt [target] [-c <chain-id>] [-m <goal|list|loop>]
# Subcommands
hunt status <run-id>
hunt report <run-id>
hunt verify <run-id>
hunt checkEvery confirmed vulnerability recorded in the evidence ledger must pass all 7 criteria:
| Gate | Requirement | Proof Mechanism |
|---|---|---|
reproduced |
Vulnerability is deterministically reproducible | Foundry PoC test passes (PASS) on pinned fork block |
impactInScope |
Asset/contract is within program scope | Scope attestation manifest |
rootCauseInScope |
Bug originates in audited code (not 3rd-party) | AST & source location mapping |
realisticAttacker |
Exploitable without owner/privileged private keys | Transaction sequence uses permissionless caller |
notKnownOrIntended |
Not documented, acknowledged, or intended | Protocol docs & specification check |
impactDemonstrated |
Concrete asset loss or control compromise | Measured State Delta ( |
pinnedAndRepeatable |
Fully reproducible by third-party triagers | Pinned commit, chain ID, and fork block number |
Zero-config public RPCs and automated zero-key source code extraction (Blockscout V2 & Sourcify):
| Chain ID | Network | Default Public RPCs | Source Code Extractor |
|---|---|---|---|
1 |
Ethereum Mainnet | https://eth.llamarpc.com, https://cloudflare-eth.com |
Blockscout & Sourcify |
8453 |
Base | https://mainnet.base.org, https://base.llamarpc.com |
Blockscout & Sourcify |
42161 |
Arbitrum One | https://arb1.arbitrum.io/rpc, https://arbitrum.llamarpc.com |
Blockscout & Sourcify |
10 |
Optimism | https://mainnet.optimism.io, https://optimism.llamarpc.com |
Blockscout & Sourcify |
56 |
BNB Smart Chain | https://bsc-dataseed.binance.org, https://bsc.llamarpc.com |
Blockscout & Sourcify |
137 |
Polygon | https://polygon-rpc.com, https://polygon.llamarpc.com |
Blockscout & Sourcify |
43114 |
Avalanche C-Chain | https://api.avax.network/ext/bc/C/rpc |
Snowtrace & Sourcify |
59144 |
Linea | https://rpc.linea.build |
Blockscout & Sourcify |
534352 |
Scroll | https://rpc.scroll.io |
Blockscout & Sourcify |
# Run type checking
npm run check
# Run full test suite
npm run test
# Build production bundle
npm run build- License: This project is licensed under the MIT License.
- Acknowledgements:
chain-traceon-chain forensics modules integrated from Xeron2000/chain-trace.- Bundled
fizz,solidity-auditor,report-writing, andx-rayskill workflows adapted from Pashov Audit Group Skills, licensed under MIT © AI Skills Contributors.