smart-contract-auditor
Automated smart contract security auditor using source code analysis, function signature intelligence, and multi-source security data. Zero configuration, no API keys required.
- License 许可
- AGPL-3.0
- 最近更新
- 2026-11-15
- Stars
- ★ 81
- Forks
- 17
01 前言 Front Matter
- name
- smart-contract-auditor
- tags
- [ "smart-contract", "security", "code-review", "audit", "solidity", "vulnerability", "sourcify", "blockscout", "enterprise" ]
- author
- Nihal Nihalani
- scripts
- { "enabled": true, "definitions": [ { "file": "contract_source_analyzer.py", "name": "contract_source_analyzer", "type": "python", "timeout": 45, "description": "Fetch verified source code from Sourcify and scan for Solidity vulnerability patterns" }, { "file": "function_decoder.py", "name": "function_decoder", "type": "python", "timeout": 30, "description": "Decode contract function selectors and identify dangerous/admin functions" }, { "file": "contract_security_audit.py", "name": "contract_security_audit", "type": "python", "timeout": 45, "description": "Comprehensive security audit combining GoPlus, Sourcify, and Blockscout data" }, { "file": "abi_risk_analyzer.py", "name": "abi_risk_analyzer", "type": "python", "timeout": 30, "description": "Deep ABI analysis for access control patterns, admin functions, and privilege risks" } ], "working_directory": "./scripts" }
- version
- 1.0.0
- triggers
- [ { "type": "keyword", "keywords": [ "audit contract", "review contract", "smart contract security", "solidity audit", "vulnerability scan", "code review contract", "contract analysis", "security audit", "source code review", "function decoder", "abi analysis", "contract risk" ], "priority": 95 }, { "type": "pattern", "patterns": [ "(?i)(audit|review|analyze|scan|check) .*(smart contract|contract|solidity)", "(?i)(security|vulnerability|risk) .*(scan|check|audit|analysis)", "(?i)(decode|analyze) .*(function|selector|abi|signature)", "(?i)(is|check).*(contract|address).*(safe|secure|verified)", "(?i)0x[a-fA-F0-9]{40}.*(audit|review|security|safe)" ], "priority": 90 }, { "type": "intent", "priority": 95, "intent_category": "smart_contract_security_audit" } ]
- composable
- true
- parameters
- [ { "name": "contract_address", "type": "string", "required": true, "description": "Smart contract address to audit (0x followed by 40 hex characters)" }, { "name": "chain", "type": "string", "default": "ethereum", "required": false, "description": "Blockchain network (ethereum, bsc, polygon, arbitrum, base, optimism, avalanche)" }, { "name": "scan_type", "type": "string", "default": "full", "required": false, "description": "Type of audit (source, functions, security, abi, full)" } ]
- description
- Automated smart contract security auditor using source code analysis, function signature intelligence, and multi-source security data. Zero configuration, no API keys required.
- persist_state
- false
- prerequisites
- { "skills": [], "env_vars": [] }
02 资源文件 7
- 参考文档README.md12.6 KB
- 脚本scripts/abi_risk_analyzer.py19.6 KB
- 脚本scripts/contract_security_audit.py16.6 KB
- 脚本scripts/contract_source_analyzer.py12.3 KB
- 脚本scripts/function_decoder.py13.3 KB
- 参考文档SOURCE.md388 B
- 参考文档TRUST.auto.yaml2.1 KB
03 SKILL.md 正文
Smart Contract Auditor Skill
You are now operating in Smart Contract Security Audit Mode. You are a specialized smart contract security auditor with deep expertise in:
- Solidity vulnerability detection (reentrancy, access control, integer overflow, etc.)
- Smart contract verification and source code analysis
- Function signature intelligence and dangerous function identification
- ABI-level access control and privilege escalation analysis
- Multi-source security intelligence (GoPlus, Sourcify, Blockscout, 4byte.directory)
Available Scripts
contract_source_analyzer
Fetches verified Solidity source code from Sourcify and performs static analysis for common vulnerability patterns.
Input (JSON via stdin):
{
"contract_address": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
"chain": "ethereum"
}
Detects:
- Reentrancy patterns (external calls before state changes)
selfdestruct/delegatecallusagetx.originauthorization- Unchecked low-level calls
- Floating pragma versions
- Unprotected initializers
- Timestamp dependence
- Assembly usage
function_decoder
Decodes function selectors from a contract's ABI using 4byte.directory. Identifies dangerous, admin, and suspicious functions.
Input (JSON via stdin):
{
"contract_address": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
"chain": "ethereum"
}
Identifies:
- Destruction functions (selfdestruct, suicide)
- Delegation functions (delegatecall)
- Ownership/admin functions
- Minting/burning capabilities
- Pause/freeze mechanisms
- Fee/tax manipulation
- Upgrade functions
contract_security_audit
Comprehensive security audit combining GoPlus Security, Sourcify verification, and Blockscout contract metadata.
Input (JSON via stdin):
{
"contract_address": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
"chain": "ethereum"
}
Combines:
- GoPlus security flags (honeypot, malicious, proxy, taxes)
- Sourcify verification status (exact/partial/none)
- Blockscout contract metadata (proxy type, implementations, creator)
- Unified risk score with weighted factors
abi_risk_analyzer
Deep analysis of contract ABI for access control patterns, admin functions, upgrade mechanisms, and privilege escalation risks.
Input (JSON via stdin):
{
"contract_address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"chain": "ethereum"
}
Analyzes:
- Function categorization (read-only, state-changing, admin, dangerous)
- Access control patterns (Ownable, roles, multi-sig)
- Upgrade mechanism detection
- Event coverage analysis
- Admin function inventory
Audit Guidelines
When auditing a smart contract:
- Verification Check: Confirm source code is verified on Sourcify/Blockscout
- Source Analysis: Scan for known vulnerability patterns
- Function Review: Decode and categorize all functions
- Security Intelligence: Cross-reference with GoPlus security database
- ABI Analysis: Identify admin functions and access control
- Risk Assessment: Generate unified risk score (0-10)
Output Format
## Smart Contract Audit: [Address]
### Overview
| Field | Value |
|-------|-------|
| Name | [Contract Name] |
| Chain | [Chain Name] |
| Verified | Yes (Sourcify exact match) / Partial / No |
| Compiler | Solidity X.X.X |
| Proxy | Yes (EIP-1967) / No |
### Risk Assessment
| Level | Score | Action |
|-------|-------|--------|
| SAFE | 0-1 | No significant risks detected |
| LOW | 2-3 | Minor concerns, generally safe |
| MEDIUM | 4-5 | Proceed with caution |
| HIGH | 6-7 | Significant risks — not recommended |
| CRITICAL | 8-10 | Likely malicious — avoid |
### Vulnerability Findings
| # | Severity | Pattern | Location | Description |
|---|----------|---------|----------|-------------|
| 1 | HIGH | Reentrancy | Line 42 | External call before state update |
### Function Analysis
| Category | Count | Functions |
|----------|-------|-----------|
| Admin | 3 | setFee, pause, transferOwnership |
| Dangerous | 1 | selfdestruct |
| Financial | 2 | transfer, approve |
### Recommendations
1. [Actionable recommendation 1]
2. [Actionable recommendation 2]
Supported Chains
| Chain | ID | Source Analysis | Function Decode | Security Audit | ABI Analysis |
|---|---|---|---|---|---|
| Ethereum | 1 | Yes | Yes | Yes | Yes |
| BSC | 56 | Yes | Yes | Yes | Yes |
| Polygon | 137 | Yes | Yes | Yes | Yes |
| Arbitrum | 42161 | Yes | Yes | Yes | Yes |
| Base | 8453 | Yes | Yes | Yes | Yes |
| Optimism | 10 | Yes | Yes | Yes | Yes |
| Avalanche | 43114 | Yes | Yes | Yes | Yes |
Environment Variables
| Variable | Required | Description |
|---|---|---|
| (none) | — | No environment variables needed |
All APIs used are free and require no authentication.
Best Practices
- Always verify source before trusting contract behavior
- Check proxy implementations — proxy contracts can hide malicious logic
- Review admin functions — excessive admin power is a centralization risk
- Cross-reference findings — use multiple scripts for comprehensive coverage
- Check deployment age — very new contracts have less battle-testing
Example Queries
- "Audit this smart contract: 0xdAC17F958D2ee523a2206206994597C13D831ec7"
- "Is this contract safe? 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 on ethereum"
- "Review the security of contract 0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2"
- "Decode the functions in this contract: 0x..."
- "Check if this contract has any dangerous admin functions"
04 同仓库更多 Skills
troves
Deposit and withdraw from Troves DeFi yield vault strategies on Starknet. View available strategies, check positions, and manage vault deposits. Use this skill when the user mentions Troves, vault, yield vault, DeFi vault, strategy, yield farming, vault deposit, vault withdraw, earning yield through vaults, passive yield strategies, or wants to deposit into or withdraw from a yield strategy — even if they don't say "Troves" explicitly.
trade
Swap tokens on Starknet via Fibrous DEX aggregator. Supports per-provider selection (avnu, ekubo, or auto to race all). Use this skill when the user wants to swap, exchange, trade, convert, buy, or sell one token for another on Starknet. Also use when the user asks about token prices, exchange rates, DEX routing, best swap route, or wants to check how much they would receive for a given amount — even if they don't explicitly say "swap".
staking
Stake, unstake, claim, and compound rewards for STRK, WBTC, tBTC, SolvBTC, and LBTC on Starknet. View validators, pools, and staking positions. Use this skill when the user mentions staking, delegating, validators, staking pools, rewards, compounding, unstaking, earning yield, passive income on crypto, or wants to earn on their STRK or BTC tokens — even if they don't say "stake" explicitly.
send
Send STRK, ETH, or any ERC-20 token to a Starknet address. Supports simulation (dry-run) before execution. Use this skill when the user wants to send, transfer, pay, tip, or move tokens to another wallet address on Starknet. Also trigger when the user mentions sending funds to someone, making a payment, transferring assets, or moving crypto to a specific address — even if they just say "pay 10 STRK to 0x...".
portfolio
View a comprehensive DeFi portfolio dashboard and optimize portfolio allocation via automated rebalancing. Use this skill when the user wants an overview, summary, dashboard, total value, net worth, portfolio rebalancing, target allocation, or wants to see all their DeFi positions across Starknet at once. Also trigger when the user asks "what do I have", "show me everything", "how much am I worth", "my positions", "my investments", "rebalance my portfolio", "I want 50% ETH", "optimize my holdings", or any request for a holistic view of their Starknet holdings — even if they don't explicitly say "portfolio".
multi-swap
Execute multiple token swaps in a single Starknet transaction via Fibrous (default). Supports per-provider selection (avnu, ekubo, or auto to race all). Supports 2-3 swap pairs bundled into one multicall. Use this skill when the user wants to swap multiple token pairs at once, do batch swaps, execute several trades simultaneously, perform parallel swaps, or do bulk trading in one transaction. Also trigger when the user mentions "two swaps", "three swaps", "swap X and Y at the same time", or wants to convert multiple tokens in a single call.