본문으로 건너뛰기
Skillpedia
보안35k · #7679

auditing-foundry-smart-contract-security

하는 일

이 도구는 배포되기 전 Solidity로 작성된 스마트 컨트랙트의 보안을 점검합니다. 재진입(reentrancy)으로 인한 자금 도난이나 깨진 접근 제어 같은 흔한 버그를 찾기 위해 다양한 기법을 사용합니다. 그래서 실제 네트워크에 올리기 전에 코드가 안전하도록 합니다.

사용하는 경우

  • ✓컨트랙트를 어떤 네트워크(테스트넷 또는 메인넷)에든 배포하기 전에 점검할 때.
  • ✓자금(돈, 토큰)을 다루는 Foundry 프로젝트를 작업할 때.
  • ✓비밀 키가 노출되지 않도록 배포 과정을 설정할 때.

스킬 링크

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/auditing-foundry-smart-contract-security/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/auditing-foundry-smart-contract-security/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“메인넷에 배포하기 전에 이 스마트 컨트랙트의 보안을 확인해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

이 도구는 정적 코드 분석, 심볼릭 실행, 자동화된 테스트를 결합해 여러 상황을 시뮬레이션합니다. 또한 비밀 키가 보호되고 평문으로 노출되지 않는지 확인합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Auditing Foundry Smart Contract Security

Overview

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.

When to Use

  • Before deploying any Solidity contract to a testnet or mainnet EVM chain.
  • When writing or reviewing a Foundry project (foundry.toml, src/, test/, script/).
  • When a contract handles value: tokens (ERC-20/721/1155), vaults, staking, AMMs, bridges, governance.
  • When adding fuzz or invariant tests, or when coverage of value-moving functions is unknown.
  • When wiring deployment scripts — to verify keys are in an encrypted keystore, not .env plaintext.
  • When integrating a price oracle, external call, delegatecall, or upgradeable proxy.
  • When triaging a Slither/Aderyn report and needing to separate real bugs from false positives.

Prerequisites

  • Foundry installed (forge, cast, anvil): curl -L https://foundry.paradigm.xyz | bash && foundryup
  • Slither + solc: pip install slither-analyzer and solc-select install <ver> && solc-select use <ver>
  • Aderyn (recommended): cargo install aderyn (or npm i -g @cyfrin/aderyn)
  • Mythril (optional, slow symbolic exec): pip install mythril
  • gitleaks (key-leak scan): see the companion implementing-secret-scanning-with-gitleaks skill
  • A Foundry project that compiles (forge build succeeds) — analyzers need build artifacts.
  • Solidity ^0.8.x is assumed (built-in overflow checks); pre-0.8 contracts need extra SafeMath review.

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.

Steps

Step 1: Build and sanity-check the project

forge build                    # analyzers require fresh artifacts
forge fmt --check              # style gate (optional)
cat foundry.toml               # note solc version, optimizer, remappings, evm_version

Step 2: Static analysis (fast, run every time)

# 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

Step 3: Symbolic execution on critical contracts (optional, slow)

# 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

Step 4: Property-based testing — fuzz + invariants

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)

…

자주 묻는 질문

스마트 컨트랙트란 무엇인가요?

블록체인에서 실행되는 프로그램입니다. 특정 조건이 충족되면 돈이나 토큰을 옮기는 것 같은 작업을 자동으로 실행합니다.

배포 전에 보안이 왜 중요한가요?

한번 블록체인에 배포된 컨트랙트는 보통 바꿀 수 없습니다. 버그가 있으면 해커가 이를 악용해 자금을 잃을 수 있습니다.

Foundry란 무엇인가요?

Ethereum에서 스마트 컨트랙트를 만드는 개발자를 위한 도구 모음입니다. 컨트랙트를 작성하고, 테스트하고, 배포하는 데 도움을 줍니다.

상세 정보

작성자의 원본 설명

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, en

repo: mukul975/Anthropic-Cybersecurity-Skills

인기도

GitHub 스타
35k
순위
#7679
라이선스
Apache-2.0
업데이트
2026. 8. 31.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬