1---2name: smart-contract-audit3description: Smart contract and Web3 security audit skill for Solidity, Vyper, Move, and Cairo. Covers reentrancy, access control, oracle manipulation, MEV/sandwich exposure, signature replay, upgrade safety, ERC token edge cases, bridge risk, and DeFi invariants. Tooling includes Slither, Mythril, Echidna, Foundry, Halmo, Certora, and custom invariant tests. Use for design review, code audit, and incident analysis on contracts you own or are authorized to assess.4---56# Smart Contract Audit78## Authorization Boundary910- Audit only protocols and code where you have explicit authorization or a public bounty scope.11- Treat private keys and seed phrases as untouchable; never request, store, or use them.12- Distinguish lab/testnet from mainnet; never simulate exploits against live user funds.1314## Audit Workflow15161. Architecture: contract map, upgrade pattern, proxy admin, roles, external calls, oracles, AMMs, bridges, governance.172. Threat model: trust assumptions, economic invariants, privileged actors, off-chain dependencies, MEV exposure.183. Static and semantic: `slither`, `aderyn`, `semgrep`, `mythril`, Solidity compiler warnings; review storage layout for upgradeable contracts.194. Property tests: write invariants in Foundry/Echidna/Halmo; fuzz with state-machine harnesses; run differential tests vs reference.205. Manual review: reentrancy (CEI), unchecked external calls, signature replay, frontrunning, slippage, rounding, oracle freshness/TWAP, ERC-20 fee-on-transfer and rebasing edge cases, ERC-721/1155 callbacks.216. Economic: invariant set on liquidity, fees, debt, collateral; simulate MEV (`mev-share`, `cannon`, `tenderly`).227. Report: severity, likelihood, impact, fix, regression test.2324## High-Risk Patterns Checklist2526- Upgrade safety: storage gaps, initializer guards, admin keys, timelocks.27- Bridge messages: replay protection, finality, message origin validation.28- Oracles: single-source, manipulable spot price, missing staleness checks.29- Governance: flash-loan-driven votes, quorum manipulation, proposal hijack.30- Token assumptions: non-standard ERC-20 (USDT-style, rebasing, fee-on-transfer, blocklist).3132## Output Contract3334- `scope.md`, `architecture.md`, `threat-model.md`.35- `findings/<id>.md`: severity, code refs, PoC, fix, test.36- `invariants/`: Foundry/Echidna harnesses.37- `report.pdf` or `report.md`: exec summary, findings, appendices, remediation status matrix.