Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

smart-contract-auditing

БесплатноБез исполняемых скриптовНе проверен

Complete mastery guide for smart contract security auditing — from first principles of EVM bytecode to advanced exploit patterns. Covers manual code review…

nirholasот nirholas★ 289 звёзд на GitHub

Об этом скилле

Smart Contract Auditing — From Zero to Expert

This skill teaches you to think like a top-tier smart contract auditor. You'll learn to find vulnerabilities that automated tools miss, write clear findings, and reason about protocol-level risks in DeFi systems.

The Auditor's Mindset

"Your job is not to confirm the code works. It's to prove it can break."

An auditor must think adversarially. Every function is a potential attack surface. Every external call is a trust boundary. Every assumption is a vulnerability waiting to happen.

┌─────────────────────────────────────────────────┐
│              AUDITOR'S MENTAL MODEL              │
├─────────────────────────────────────────────────┤
│                                                  │
│   1. UNDERSTAND the protocol's invariants        │
│   2. ENUMERATE every state-changing path         │
│   3. CHALLENGE every assumption                  │
│   4. SIMULATE adversarial scenarios              │
│   5. VERIFY mitigations are complete             │
│                                                  │
│   "What must ALWAYS be true?" ← start here       │
│   "How can I make it false?" ← then ask this     │
│                                                  │
└─────────────────────────────────────────────────┘

Vulnerability Taxonomy

Tier 1 — Critical (Funds at Risk)

Vulnerability What Breaks Classic Example
Reentrancy State updated after external call The DAO hack ($60M)
Flash Loan Attack Price oracle manipulation in single tx bZx ($8M), Cream ($130M)
Access Control Missing onlyOwner / role checks Parity wallet freeze ($280M)
Unchecked Return Values Silent failure on transfer Token transfers returning false
Storage Collision Proxy upgrades overwriting slots Audius governance ($6M)

Tier 2 — High (Protocol Malfunction)

Vulnerability What Breaks How to Spot
Oracle Manipulation Price feeds return stale/wrong data Check updatedAt staleness
Integer Overflow/Underflow Math wraps around (pre-0.8.0) Solidity < 0.8 without SafeMath
Front-running MEV bots sandwich user txs Unprotected swaps, auctions
Denial of Service Unbounded loops, gas griefing Arrays that grow without limit
Signature Replay Same sig reused across chains/contracts Missing nonce or chainId

Tier 3 — Medium (Edge Cases)

Vulnerability What Breaks How to Spot
Rounding Errors Dust accumulation, unfair distributions Division before multiplication
Timestamp Dependence Miners manipulate block.timestamp ±15 second tolerance
Centralization Risk Admin can rug (even if "trusted") Unrevoked roles, no timelock
Missing Events Off-chain trackers lose sync State changes without emit
Gas Optimization Tx reverts on large sets Storage reads in loops

The Audit Process

Phase 1: Scoping (Day 1)

Questions to answer before reading ANY code:
─────────────────────────────────────────────
□ What does this protocol DO? (lending, DEX, vault, stablecoin?)
□ What are the protocol invariants?
   - "Total deposits ≥ total borrows"
   - "LP token supply × price ≥ pool reserves"
   - "Collateral ratio always > liquidation threshold"
□ What's the attack surface?
   - External entry points (public/external functions)
   - Admin/privileged functions
   - Oracle dependencies
   - Cross-contract interactions
□ What token standards are involved? (ERC-20, ERC-721, ERC-4626, rebasing?)
□ Is it upgradeable? (proxy pattern? UUPS? Transparent?)
□ What chains is it deployed on? (different precompiles, EIPs)

Phase 2: Architecture Review (Day 1-2)

Draw the contract dependency graph:

┌──────────────┐     ┌──────────────┐     ┌──────────────┐
│   Router     │────▶│    Vault      │────▶│   Strategy   │
│ (user entry) │     │ (holds funds) │     │ (deploys $)  │
└──────────────┘     └──────┬───────┘     └──────────────┘
                            │
                     ┌──────▼───────┐
                     │  PriceOracle  │
                     │ (Chainlink)   │
                     └──────────────┘

Identify trust boundaries:

  • User → Router: Input validation, slippage checks
  • Router → Vault: Authorization, reentrancy guards
  • Vault → Strategy: Withdrawal limits, accounting
  • Vault → Oracle: Staleness checks, deviation bounds

Phase 3: Line-by-Line Review (Day 2-5)

Checklist Per Function

// For EVERY external/public function, verify:

// 1. ACCESS CONTROL
// ✓ Who can call this? Is that correct?
// ✓ Are modifiers applied? (onlyOwner, onlyRole, whenNotPaused)

// 2. INPUT VALIDATION
// ✓ Are all parameters validated? (address != 0, amount > 0)
// ✓ Are array lengths bounded?
// ✓ Can attacker pass malici
Полный SKILL.md на GitHub

Установить smart-contract-auditing в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл smart-contract-auditing?

Complete mastery guide for smart contract security auditing — from first principles of EVM bytecode to advanced exploit patterns. Covers manual code review methodology, automated tooling (Slither, Mythril, Foundry fuzz), common vulnerability taxonomy (reentrancy, flash-loan attacks, oracle manipulation, access control, integer math), audit report writing, severity classification (Critical/High/Medium/Low/Informational), gas optimization reviews, upgrade safety, and DeFi-specific audit checklists for lending, AMM, vault, and stablecoin protocols.

Как установить скилл smart-contract-auditing?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл smart-contract-auditing запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить smart-contract-auditing с