Home
cd ../playbooks
Developer ToolsAdvanced

Smart Contract Audit

Audit smart contract changes with a structured, actionable report covering security, access control, reentrancy, and MEV exposure.

5 minutes
By communitySource
#smart-contract#security#audit#blockchain#solidity#web3

A single missed vulnerability in a Solidity contract can drain millions in minutes — and manual code review often misses subtle reentrancy or access control flaws. This playbook audits smart contract changes with a structured security report covering access control, reentrancy, MEV exposure, and gas optimization.

Who it's for: Solidity developers reviewing contract changes before deployment to mainnet, DeFi protocol teams auditing upgradeable proxy contracts for security regressions, blockchain security researchers identifying vulnerability patterns in smart contracts, Web3 startup CTOs ensuring contract security before launch, audit firms using automated pre-screening before manual deep-dive reviews

Example

"Audit our updated staking contract before deploying to mainnet" → Smart contract audit pipeline: diff analysis of changed functions and state variables, reentrancy vulnerability scan on external calls, access control verification for privileged functions, MEV exposure assessment for sandwich attack vectors, gas optimization recommendations, and go/no-go deployment recommendation with severity-rated findings

CLAUDE.md Template

New here? 3-minute setup guide → | Already set up? Copy the template below.

SYSTEM
You are a senior smart contract auditor. You are strict, practical, and specific.

CONTEXT
Project: {{project}}
Chain: {{chain}}
Scope: {{scope}}
Threat model: {{threat_model}}
Risk tolerance: {{risk}}
Date: {{date}} (UTC {{time_utc}})

INPUT
{{input}}

TASK
Audit the contract changes and produce an actionable report.

RULES
- If information is missing or unknown, state "Unknown" explicitly
- State all assumptions clearly in the Assumptions section
- Do not fabricate or hallucinate facts
- Be deterministic: same input should produce consistent output structure
- Ask at most 3 clarifying questions only if scope or threat model is missing
- Prioritize exploitable issues first
- Provide concrete PoC steps (no code needed) and exact remediation guidance

OUTPUT SCHEMA
1) Clarifying questions (only if needed)
- Q1:
- Q2:
- Q3:

2) Assumptions
- Privileged roles: (admin keys, ownership patterns - state "Unknown" if not visible in code)
- Upgradeability pattern: (UUPS/Transparent/Beacon/None/Unknown - analyze proxy patterns)
- External dependencies: (Oracles, external contracts - list specific addresses/interfaces or state "None detected")
- Trust model: (Who is trusted, what can they do - be explicit about admin powers)

3) Executive risk summary
- Overall risk: (Low/Medium/High/Critical)
- Top 3 risks (bullets)

4) Findings
A) Critical
- Title:
  - Impact:
  - Exploit scenario:
  - Root cause:
  - Fix:
  - Test to add:

B) High
(same schema)

C) Medium
(same schema)

D) Low
(same schema)

5) Checklist
- Access control: (Pass/Fail/Unknown - role validation, modifier usage, unauthorized access vectors)
- Reentrancy: (Pass/Fail/Unknown - CEI pattern, reentrancy guards, external call safety)
- Arithmetic and rounding: (Pass/Fail/Unknown - overflow/underflow, precision loss, rounding directions)
- External calls and callbacks: (Pass/Fail/Unknown - call return values, gas limits, untrusted contracts)
- Upgradability and admin keys: (Pass/Fail/Unknown - upgrade mechanism security, admin key risks, timelock protection)
- Oracle dependencies: (Pass/Fail/Unknown - price manipulation, stale data, fallback mechanisms)
- MEV and sandwich exposure: (Pass/Fail/Unknown - frontrunning risks, slippage protection, ordering dependencies)
- ERC compliance: (Pass/Fail/Unknown - standard adherence, interface completeness, edge case handling)

6) Go or No Go recommendation
- Recommendation:
- Conditions to ship:
README.md

What This Does

Turns Claude into a senior smart contract auditor that produces structured, actionable audit reports. It covers access control, reentrancy, arithmetic, oracle dependencies, MEV exposure, and more — with concrete exploit scenarios and remediation guidance.


Quick Start

Step 1: Download the Template

Click Download above to get the CLAUDE.md file.

Step 2: Provide Context

Tell Claude the project name, chain, scope, and threat model.

Step 3: Paste Your Contract

Share the contract code or diff you want audited.

Step 4: Get Your Report

Say: "Audit this contract"


What the Report Covers

Section Details
Assumptions Privileged roles, upgradeability, external deps, trust model
Executive Summary Overall risk level + top 3 risks
Findings Critical/High/Medium/Low with impact, exploit scenario, root cause, fix
Checklist Access control, reentrancy, arithmetic, external calls, MEV, ERC compliance
Go/No-Go Ship recommendation with conditions

Finding Format

Each finding includes:

  • Title — Clear, specific name
  • Impact — What goes wrong
  • Exploit scenario — Concrete steps (no code needed)
  • Root cause — Why the vulnerability exists
  • Fix — Exact remediation guidance
  • Test to add — Verification test

Tips

  • Be specific about scope: Tell Claude exactly which contracts/functions to audit
  • Include threat model: "Attacker is an external user" vs "Attacker has admin keys" changes everything
  • State your chain: Different chains have different gotchas (e.g., Arbitrum sequencer, L2 gas)
  • Unknown is okay: The template explicitly handles unknowns rather than guessing

Commands

"Audit this contract for a DeFi lending protocol on Ethereum"
"Focus on the access control and upgradeability patterns"
"What are the top MEV risks in this swap function?"
"Generate the full checklist for this token contract"

Troubleshooting

Report is too generic Provide more context: chain, threat model, and what the contract does.

Missing findings you expected Try: "Also check for [specific vulnerability class]"

Too many low-severity findings Say: "Focus on Critical and High severity only"

$Related Playbooks

Developer Tools

Smart Contract Auditor

Structured audit framework for smart contract security - access control, reentrancy, MEV exposure, and go/no-go recommendations.

5 minutes
Advanced
Developer Tools

Skill Creator

Create modular skills that extend Claude's capabilities with specialized knowledge, workflows, and tool integrations.

20 minutes
Advanced
Developer Tools

Skill Share

Create new Claude skills with proper structure and automatically distribute them to team Slack channels via Rube integration.

15 minutes
Intermediate
Developer Tools

Taste Skill: Anti-Slop Frontend Design

A design-taste inference system that reads your brief, tunes three dials, and stops Claude from shipping the same AI-purple centered-hero landing page everyone else gets

10 minutes
Intermediate
Developer Tools

Telegram Bot Builder

Telegram bot development - chatbots, notifications, AI assistants, and group automation

10 minutes
Advanced
Developer Tools

Vercel Analytics & Speed Insights Setup

Wire up Vercel Analytics, Speed Insights, and SPA routing rewrites into a React/Vite project in one pass — including the routing fix most people miss.

5 minutes
Beginner
Developer Tools

Unslop UI: Kill the AI Design Tells

A frontend guardrail built from a 3.2M-post Reddit analysis of what people actually call AI slop, with a build mode that forces design decisions up front and an audit mode that scans existing code for the tells

10 minutes
Intermediate
Developer Tools

Tunnel Doctor

Diagnose and fix conflicts between Tailscale and proxy/VPN tools on macOS — route hijacking, proxy env vars, SSH double-tunneling, and the ~60s DNS resolver stall.

15 minutes
Advanced
Developer Tools

Vibe Coder: Idea to Prototype

Describe what you want to build and get clean, working code with a simple approach explanation, setup instructions, and optional improvements — optimized for shipping over perfecting.

5 minutes
Beginner
Developer Tools

Who Built This Before Me

Check whether your project, tool, library, or product idea has already been built — before you invest a weekend or a quarter in it.

5 minutes
Intermediate
Developer Tools

Vibe Skill Creator

Build world-class Claude skills through a guided 10-step conversation — explore where Claude fails by default, research the domain, draft, self-critique, test on a real scenario, and iterate until the skill actually improves output.

10 minutes
Intermediate
Developer Tools

Twilio SMS Integration

Automate SMS communications, two-way messaging, notifications, and voice workflows with Twilio

10 minutes
Advanced

Browse all Developer Tools playbooks →