analyzing-ethereum-sma…
Perform static and symbolic analysis of Solidity smart contracts using
Pre-deployment security audit of Solidity smart contracts in a Foundry project. Combines static analysis (Slither, Aderyn), symbolic execution (Mythril), and property-based testing (forge fuzz + invariant tests with handlers) to catch reentrancy, access-control, oracle/price
$ npx -y skills add tradecatlabs/vibe-coding-cn --skill auditing-foundry-smart-contract-security --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/auditing-foundry-smart-contract-securityContext preview
The summary Claude sees to decide when to auto-load this skill.
Pre-deployment security audit of Solidity smart contracts in a Foundry project. Combines static analysis (Slither, Aderyn), symbolic execution (Mythril), and property-based testing (forge fuzz + invariant tests with handlers) to catch reentrancy, access-control, oracle/price
name: auditing-foundry-smart-contract-security description: >- Pre-deployment security audit of Solidity smart contracts in a Foundry project. Combines static analysis (Slither, Aderyn), symbolic execution (Mythril), and property-based testing (forge fuzz + invariant tests with handlers) to catch reentrancy, access-control, oracle/price manipulation, and arithmetic bugs BEFORE deploying to an EVM chain. Also enforces key hygiene (no plaintext private keys, encrypted cast keystore) and a secure deploy workflow. Use when writing, reviewing, testing, or deploying Solidity/Foundry contracts, building a dApp, or working with forge/cast/anvil, MetaMask, or Web3/DeFi code. domain: cybersecurity subdomain: blockchain-security tags: - solidity - foundry - forge - smart-contract - slither - aderyn - mythril - reentrancy - defi - web3 - invariant-testing - audit version: "1.0" author: devredious license: Apache-2.0 based_on: mukul975/analyzing-ethereum-smart-contract-vulnerabilities swc_registry: https://swcregistry.io/ mitre_attack: - T1190 - T1059
Deployed smart contracts are **immutable** and custody **real funds**, so a bug shipped to mainnet cannot be patched — it can only be exploited. Most catastrophic DeFi losses come from a small set of recurring classes: reentrancy, broken access control, oracle/price manipulation, and unchecked arithmetic or external calls.
This skill runs a **defense-in-depth, pre-deployment audit** of a Foundry project, layering four independent techniques that each catch what the others miss:
1. **Static analysis** — `slither` (90+ detectors) and `aderyn` (Cyfrin, Rust) scan the AST/IR in seconds for known anti-patterns. 2. **Symbolic execution** — `mythril` (optional, slow) explores execution paths and SMT-solves for deep arithmetic/reentrancy bugs. 3. **Property-based testing** — `forge test` with **fuzzing** (`testFuzz_*`) and **invariant tests** (`invariant_*` + handler contracts with ghost variables) proves protocol-level properties hold across millions of random sequences. 4. **Manual review + key hygiene** — a structured checklist (see `references/vulnerability-checklist.md`) and a secrets/keystore audit so no private key ever lives in plaintext and deployment goes through an encrypted `cast` keystore (see `references/secure-deployment-and-keys.md`).
The skill is **dev-side and pre-deployment** — it is run by the engineer building the contract, not by a SOC after an incident. Findings gate the deploy: any high/critical static finding, failing test, leaked key, or low coverage = **FAIL**.
> Install the Python tools in a virtualenv (recommended on externally-managed distros). Never run > analysis against untrusted contract source on a machine with funded wallets unlocked.
forge build # analyzers require fresh artifacts forge fmt --check # style gate (optional) cat foundry.toml # note solc version, optimizer, remappings, evm_version
# Slither — full project (uses foundry.toml + remappings automatically) slither . --json slither-report.json # Aderyn — Cyfrin Rust analyzer, complementary detectors aderyn . -o aderyn-report.json
Or run the bundled orchestrator that runs both, deduplicates, and gates the result:
python3 scripts/agent.py --project . --output audit-report.json
# Only on the highest-value contract(s) — Mythril is path-explosive myth analyze src/Vault.sol --solc-json mythril.config.json --execution-timeout 300 -o json # or: python3 scripts/agent.py --project . --mythril src/Vault.sol
forge test -vvv # unit + fuzz tests forge coverage --report summary # coverage of value-moving code forge test --match-test invariant_ -vvv # invariant suite (handler-based)
Every value-moving contract should have **invariant tests with a handler** (bounded inputs, ghost variables, `targetContract(handler)`) — not just unit tests. See `references/api-reference.md` for the handler pattern, and write a `test_RevertWhen_*` (with `vm.expectRevert`) for each access-control guard.
Walk `references/vulnerability-checklist.md` for every contract: reentrancy (checks-ef
从想法到产品的 AI 结对编程工作流标准:Prompt + Skill + Context + Quality Gate + 工程闭环 <!-- 徽章区域 (BADGES) --> 本仓库的 AI 解读链接:zread.ai/tukuaiai/vibe-coding-cn 🧠 六条核心命题
Repo: tradecatlabs/vibe-coding-cn
Perform static and symbolic analysis of Solidity smart contracts using
AI-powered tools for Web3 bug bounty automation. Use when you want to automate recon, run…
Complete reference for all 10 DeFi smart contract bug classes. Use this when hunting for…
Case study - role misconfiguration bug class applied to a yield aggregator protocol. Use as a…
Master grep command arsenal for Web3 smart contract auditing. Use when starting a new…
Hunter mindset, recon setup, and target scoring for Web3 bug bounty. Use at the START of any…