Command Palette

Search for a command to run...

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

solidity-audit

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

Security audit and code review checklist. Covers 30+ vulnerability types with real-world exploit cases (2021-2026) and EVMbench Code4rena patterns. Use when…

ComeOnOliverот ComeOnOliver★ 67 звёзд на GitHub

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

Solidity Security Audit Checklist

Language Rule

  • Always respond in the same language the user is using. If the user asks in Chinese, respond in Chinese. If in English, respond in English.

Usage: This skill is for security audits and code reviews. It is NOT auto-invoked — call /solidity-audit when reviewing contracts for vulnerabilities.

Contract-Level Vulnerabilities

1. Reentrancy

Variant Description Check
Same-function Attacker re-enters the same function via fallback/receive All external calls after state updates (CEI pattern)?
Cross-function Attacker re-enters a different function sharing state All functions touching shared state protected by nonReentrant?
Cross-contract Attacker re-enters through a different contract that reads stale state External contracts cannot read intermediate state?
Read-only View function returns stale data during mid-execution state No critical view functions used as oracle during state transitions?

Case: GMX v1 (Jul 2025, $42M) — reentrancy in GLP pool on Arbitrum, attacker looped withdrawals to drain liquidity.

2. Access Control

Check Detail
Missing modifier Every state-changing function has explicit access control?
Modifier logic Modifier actually reverts on failure (not just empty check)?
State flag Access-once patterns properly update storage after each user?
Admin privilege scope Owner powers are minimal and time-limited?

Case: Bybit (Feb 2025, $1.4B) — Safe{Wallet} UI injected with malicious JS, hijacked signing process. Not a contract flaw, but access control at the infrastructure layer.

3. Input Validation

Check Detail
Zero address All address params reject address(0)?
Zero amount Fund transfers reject zero amounts?
Array bounds Paired arrays validated for matching length?
Arbitrary call No unvalidated address.call(data) where attacker controls data?
Numeric bounds Inputs bounded to prevent dust attacks or gas griefing?

4. Flash Loan Attacks

Variant Mechanism Defense
Price manipulation Flash-borrow → swap to move price → exploit price-dependent logic → repay TWAP oracle with min-liquidity check
Governance Flash-borrow governance tokens → vote → repay in same block Snapshot voting + minimum holding period + timelock ≥ 48h
Liquidation Flash-borrow → manipulate collateral value → trigger liquidation Multi-oracle price verification + circuit breaker
Combo (rounding) Flash-borrow → manipulate pool → micro-withdrawals exploit rounding → repay Minimum withdrawal amount + virtual shares

Cases:

5. Oracle & Price

Check Detail
Single oracle dependency Using multiple independent price sources?
Stale price Checking updatedAt timestamp and rejecting old data?
Spot price usage Never using raw AMM reserves for pricing?
Minimum liquidity Oracle reverts if pool reserves below threshold?
Price deviation Circuit breaker if price moves beyond threshold vs last known?
Chainlink round completeness Checking answeredInRound >= roundId?

Case: Cream Finance (Oct 2021, $130M) — attacker manipulated yUSD vault price by reducing supply, then used inflated collateral to drain all lending pools.

6. Numerical Issues

Type Description Defense
Primitive overflow uint256 a = uint8(b) + 1 — reverts if b=255 on Solidity ≥0.8 Use consistent types, avoid implicit narrowing
Truncation int8(int256Value) — silently overflows even on ≥0.8 Use SafeCast library for all type narrowing
Rounding / precision loss usdcAmount / 1e12 always rounds to 0 for small amounts Multiply before divide; check for zero result
Division before multiplication (a / b) * c loses precision Always (a * c) / b

Case: Bunni (Sep 2025, $8.4M) — rounding errors in micro-withdrawals exploited via flash loan.

7. Signature Issues

Type Description Defense
ecrecover returns addres
Полный SKILL.md на GitHub

Установить solidity-audit в Claude Code и Claude Desktop

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

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

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

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

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

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

FAQ

Что делает скилл solidity-audit?

Security audit and code review checklist. Covers 30+ vulnerability types with real-world exploit cases (2021-2026) and EVMbench Code4rena patterns. Use when conducting security audits, code reviews, or pre-deployment security assessments.

Как установить скилл solidity-audit?

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

Скилл solidity-audit запускает скрипты?

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

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

Сравнить solidity-audit с