Multi-chain Wallet Security Scanner β 16 EVM Chains
Quick Start β’ API Reference β’ Architecture β’ Tests β’ Security β’ Contributing
SENTINEL scans wallet approvals across 16 mainnet EVM chains, decompiles contract bytecode, detects 30+ vulnerability patterns, and lets users revoke dangerous approvals β all from a single dashboard.
Core pipeline: User wallet β Go API (concurrent multi-chain RPC) β Rust decompiler (bytecode β opcodes) β Python analyzer (heuristic risk scoring) β React frontend (actionable results).
| Ethereum & L2s | Alt L1s |
|---|---|
| Ethereum (1) β’ Arbitrum One (42161) β’ Optimism (10) β’ Base (8453) | BNB Chain (56) β’ Polygon PoS (137) β’ Avalanche (43114) β’ Fantom (250) |
| zkSync Era (324) β’ Linea (59144) β’ Scroll (534352) β’ Polygon zkEVM (1101) | Cronos (25) β’ Gnosis (100) β’ Celo (42220) β’ Moonbeam (1284) |
| Feature | Description |
|---|---|
| 16-Chain Scanning | Concurrent RPC calls across all supported mainnets |
| Bytecode Decompilation | Rust-powered opcode analysis and control-flow graph generation |
| 30+ Vuln Patterns | Honeypots, hidden mints, reentrancy, proxy risks, access control flaws |
| One-click Revoke | Remove dangerous approvals directly from the dashboard |
| Risk Scoring | Per-approval + global wallet health score (0β100) |
| JWT + API Key Auth | HS256 JWT tokens with API-key fallback for all protected endpoints |
| Distributed Rate Limiting | Redis-backed rate limiter with automatic in-memory fallback |
| Prometheus Metrics | /metrics endpoint β request counters, latency histograms, business KPIs |
| PostgreSQL + Redis | Persistent scan history, distributed caching (optional, graceful degradation) |
ββββββββββββββββββββββββββββ
β Frontend (React + TS) β
β Vite Β· Tailwind Β· wagmiβ
ββββββββββββββ¬ββββββββββββββ
β HTTPS
ββββββββββββββΌββββββββββββββ
β API Server (Go) β
β JWT Β· Rate Limit Β· CORS β
β Prometheus Β· Middleware β
ββββ¬ββββββββββ¬βββββββββββ¬βββ
β β β
ββββββββββββΌβββ ββββββΌβββββ βββββΌβββββββββββ
β Decompiler β βAnalyzer β β PostgreSQL β
β (Rust) β β(Python) β β + Redis β
β Opcodes/CFG β βHeuristicβ β Cache/Store β
βββββββββββββββ βββββββββββ ββββββββββββββββ
β
ββββββββββββΌβββββββββββββββββββββββ
β On-chain Contracts (Sol + Yul)β
β SentinelRegistry Β· BatchRevokeYulβ
βββββββββββββββββββββββββββββββββββ
| Layer | Technology | Role |
|---|---|---|
| API | Go 1.22 | HTTP server, multi-chain RPC, middleware (JWT, rate limit, CORS, metrics) |
| Decompiler | Rust (stable) | EVM bytecode disassembly, opcode parsing, CFG generation |
| Analyzer | Python 3.11+ | Heuristic vulnerability detection, risk scoring |
| Frontend | React 18, TypeScript, Vite, Tailwind, RainbowKit | Dashboard, wallet connection, one-click revoke |
| Contracts | Solidity 0.8.x + Yul | On-chain registry, gas-optimized batch revoke |
| Data | PostgreSQL 16, Redis 7 | Scan history, distributed cache, rate limiting |
| Infra | Docker Compose, GitHub Actions CI/CD | Multi-container deployment, 5-stage pipeline |
git clone https://github.com/Faraone-Dev/SENTINEL.git
cd SENTINEL
cp config/.env.example config/.env # edit with your RPC keys
docker-compose up -d # starts all 6 servicesServices are available at:
| Service | URL |
|---|---|
| Frontend | http://localhost:80 |
| API | http://localhost:8080 |
| Prometheus metrics | http://localhost:8080/metrics |
| Decompiler | http://localhost:3000 |
| Analyzer | http://localhost:5000 |
# API Server
cd api && go run cmd/server/main.go # :8080
# Decompiler
cd decompiler && cargo run -- --server --port 3000 # :3000
# Analyzer
cd analyzer && python src/server.py # :5000
# Frontend
cd frontend && npm install && npm run dev # :5173make build # Build all components
make test # Run all test suites
make docker-up # docker-compose up -d
make docker-down # docker-compose down
make help # List all targetsCopy config/.env.example to config/.env and set:
| Variable | Required | Default | Description |
|---|---|---|---|
ALCHEMY_API_KEY |
Recommended | β | Alchemy RPC key for reliable chain access |
ETHERSCAN_API_KEY |
Optional | β | Block explorer API (free tier works) |
ADMIN_API_KEY |
Production | β | API key for protected endpoints |
JWT_SECRET |
Optional | β | HS256 signing key (β₯32 chars); enables JWT auth |
DATABASE_URL |
Optional | β | PostgreSQL connection string |
REDIS_URL |
Optional | β | Redis connection string |
RATE_LIMIT_RPM |
Optional | 100 |
Max requests per minute per IP |
PORT |
Optional | 8080 |
API server port |
CORS_ORIGINS |
Optional | * |
Comma-separated allowed origins |
All infrastructure dependencies (PostgreSQL, Redis) are optional. The server degrades gracefully to in-memory caching and local rate limiting when they're unavailable.
| Method | Endpoint | Auth | Description |
|---|---|---|---|
GET |
/health |
None | Health check + version info |
GET |
/metrics |
None | Prometheus-compatible metrics |
GET |
/api/v1/chains |
None | List all 16 supported chains |
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/v1/scan?wallet=0x...&chains=ethereum,base |
Scan wallet approvals across chains |
GET |
/api/v1/analyze?contract=0x...&chain=ethereum |
Deep-analyze a single contract |
POST |
/api/v1/analyze/batch |
Batch analyze up to 10 contracts |
POST |
/api/v1/auth/token |
Issue JWT token (admin API key required) |
Option A β API Key:
curl -H "X-API-Key: YOUR_KEY" http://localhost:8080/api/v1/chainsOption B β JWT Token:
# 1. Get token (requires admin API key)
TOKEN=$(curl -s -X POST http://localhost:8080/api/v1/auth/token \
-H "X-API-Key: ADMIN_KEY" \
-H "Content-Type: application/json" \
-d '{"sub":"my-app","role":"reader","ttl":"24h"}' | jq -r .token)
# 2. Use token
curl -H "Authorization: Bearer $TOKEN" http://localhost:8080/api/v1/scan?wallet=0x...| Service | Port | Endpoints |
|---|---|---|
| Decompiler (Rust) | 3000 | GET /health Β· POST /analyze |
| Analyzer (Python) | 5000 | GET /health Β· POST /api/analyze Β· GET /api/stats |
| Metric | Type | Description |
|---|---|---|
sentinel_http_requests_total |
Counter | Requests by endpoint, method, status |
sentinel_http_request_duration_seconds |
Histogram | Latency per endpoint (10msβ10s buckets) |
sentinel_scans_total |
Counter | Wallet scans performed |
sentinel_analyzes_total |
Counter | Contract analyses performed |
sentinel_rate_limit_blocks_total |
Counter | Requests blocked by rate limiter |
sentinel_auth_failures_total |
Counter | Failed authentication attempts |
sentinel_uptime_seconds |
Gauge | Server uptime |
Scrape config for prometheus.yml:
scrape_configs:
- job_name: sentinel-api
static_configs:
- targets: ['sentinel-api:8080']SENTINEL/
βββ api/ # Go API server
β βββ cmd/server/
β β βββ main.go # Server, routes, middleware (~2300 lines)
β β βββ database.go # PostgreSQL client
β β βββ redis.go # Redis cache + distributed rate limiting
β β βββ metrics.go # Prometheus metrics (zero dependencies)
β β βββ jwt.go # JWT auth (HS256, zero dependencies)
β β βββ *_test.go # Unit, fuzz, integration, benchmark tests
β β βββ server.exe # Compiled binary
β βββ Dockerfile
β βββ go.mod
βββ analyzer/ # Python risk analyzer
β βββ src/ # analyzer.py, server.py
β βββ tests/
β βββ requirements.txt
βββ decompiler/ # Rust bytecode decompiler
β βββ src/ # main.rs, server.rs
β βββ Cargo.toml
βββ contracts/ # Solidity + Yul smart contracts
β βββ src/ # SentinelRegistry.sol, BatchRevokeYul
β βββ test/
β βββ foundry.toml
βββ frontend/ # React dashboard
β βββ src/
β β βββ App.tsx # Main app (~350 lines)
β β βββ components/ # 9 extracted UI components
β β βββ __tests__/ # 54+ Vitest unit tests
β βββ package.json
βββ db/ # PostgreSQL schema (init.sql)
βββ tests/e2e/ # End-to-end test suite
βββ config/ # .env, .env.example
βββ scripts/ # Build & deploy scripts
βββ .github/workflows/ci.yml # CI/CD pipeline (6 jobs)
βββ docker-compose.yml # Full stack (6 services)
βββ Makefile # Build, test, Docker shortcuts
βββ TESTING.md # Test suite documentation
βββ SECURITY.md # Security policy & bug bounty
βββ CONTRIBUTING.md # Contribution guidelines
| Category | Patterns |
|---|---|
| Token Scams | Honeypot, hidden mint, hidden fee, blacklist functions |
| Approval Risks | Unlimited allowances, unverified spenders, stale approvals |
| Proxy Risks | Upgradeable without timelock, recent upgrades, implementation mismatch |
| Reentrancy | State changes after external calls, cross-function reentrancy |
| Access Control | Single owner, no multisig, centralized kill switches |
| Flash Loan | Price oracle manipulation, unchecked callbacks |
| Logic Bugs | Integer overflow, unchecked return values, tx.origin auth |
~90,000 total test executions across all components (including fuzz and property-based runs).
| Component | Tests | Type | Runner |
|---|---|---|---|
| Go API | 15,000+ | Unit + Fuzz + Integration + Benchmark | go test |
| Rust Decompiler | 20,031 | Unit + Fuzz | cargo test |
| Solidity Contracts | 30,000+ | Foundry fuzz (30k runs) | forge test |
| Python Analyzer | 12,000+ | Hypothesis property-based | pytest |
| React Frontend | 54+ unit, 15,000+ fast-check | Vitest + @testing-library | npx vitest |
| E2E | Suite | API integration tests | go test ./tests/e2e/ |
See TESTING.md for full details, fuzz configuration, and CI recipes.
GitHub Actions runs on every push to main/develop and on PRs:
| Stage | What it does |
|---|---|
| Lint | golangci-lint, cargo clippy, ruff + mypy, ESLint, forge fmt |
| Test | All 5 language test suites with coverage thresholds |
| Build | Docker images for api, decompiler, analyzer, frontend (GHCR) |
| E2E | Integration tests against Redis + PostgreSQL services |
| Security | gosec, cargo-audit, safety, Slither (smart contracts) |
| Deploy | Contract deployment (on release) + service deployment (on main push) |
- Rate limiting per IP (Redis distributed + in-memory fallback)
- JWT (HS256) + API key dual authentication
- CORS with configurable origins
- Security headers (X-Content-Type-Options, X-Frame-Options, X-XSS-Protection)
- Request body size limits (1 MB)
- Graceful shutdown with 10s drain timeout
- Bug bounty program β see SECURITY.md
Faraone-Dev β @Faraone-Dev
Go Β· Rust Β· Python Β· Solidity Β· Yul Β· TypeScript
"Defense built by those who understand offense."