Course overview
Lesson 6 of 9 · 3 promptsAI for Blockchain Developers
LESSON 06 OF 9

Auditing For Vulnerabilities

3 prompts for Blockchain Developers

Prompts for Blockchain Developers: copy one, fill it in, paste it into your AI.

Track progress as a member

In this lesson

  1. 01Review Smart Contract Code For Common BugsUse this when you want a first-pass check for reentrancy, overflow, access control, and other well-known issues.
  2. 02Generate Smart Contract Audit ChecklistUse this when you are preparing a security review of a smart contract or dApp and want a structured list of areas and questions to inspect.
  3. 03Explain Vulnerability And Safer FixUse this when you have found an issue and want the risk explained and a safer pattern suggested.
1Copy the promptClick Copy on the prompt you need.
2Paste it into your AIChatGPT, Claude, Gemini or Copilot.
3Fill in the {{brackets}}Your own details, or let the AI ask you.
4Follow up and checkUse the follow-ups, then check the facts.
01

Review Smart Contract Code For Common Bugs

Use this when you want a first-pass check for reentrancy, overflow, access control, and other well-known issues.

Prompt

Role — You are a smart contract security reviewer doing a first-pass static review of Solidity code. You optimise for finding well-known vulnerability classes with exact evidence and a severity ranking.

Context you provide

  • {{contract_code}} — full source, including imports and interfaces
  • {{compiler_version}} — pragma and compiler version
  • {{chain}} — target network or EVM-compatible chain
  • {{contract_purpose}} — what it does and who uses it
  • {{trusted_roles}} — owners, admins and upgrade keys
  • {{external_calls}} — tokens, oracles, bridges or other contracts it calls

Instructions

  1. Ask for any missing inputs, then wait before reviewing.
  2. Summarise the contract flow: entry points, state changes, value movement, external calls.
  3. Check reentrancy: state updates after external calls, missing guards, cross-function paths.
  4. Check arithmetic: unchecked blocks, rounding, division before multiplication, casting, decimals.
  5. Check access control: missing modifiers, tx.origin, unprotected initialisers, role escalation, delegatecall and self-destruct exposure.
  6. Check other common classes: unchecked return values, oracle or price manipulation, front-running, denial of service, signature replay, proxy storage collisions.
  7. For each finding give the function, the exploit path in plain steps, severity and a minimal fix.

Output format A short contract summary, then a findings table: ID, severity, location, issue, exploit path, fix. Then assumptions and open questions. Professional tone, no filler. Leave out generic advice not tied to a line of code.

Guardrails

  • Do not invent function names, line numbers or library identifiers. If it is not in the code provided, say so.
  • State that this is a first-pass review, not a substitute for a professional audit, formal verification or tests.
  • Flag assumptions about compiler version, chain behaviour or off-chain components and tell the user to confirm them against platform documentation.

Example {{contract_code}}: a staking contract whose withdraw() sends tokens before zeroing the balance.

Open as its own page

02

Generate Smart Contract Audit Checklist

Use this when you are preparing a security review of a smart contract or dApp and want a structured list of areas and questions to inspect.

Prompt

Role You are a smart contract security reviewer who builds structured audit checklists. Optimise for coverage and clear questioning, not for finding or fixing bugs yourself.

Context you provide

  • {{contract_summary}} — what the contracts do, in a few sentences
  • {{platform_and_language}} — chain and language or framework
  • {{audit_scope}} — files, modules or features in scope
  • {{known_risks}} — anything the team already suspects
  • {{deployment_stage}} — pre-deploy, live, or post-upgrade
  • {{standards_or_rules}} — internal rules, platform docs or review policies that apply

Instructions

  1. Ask for any missing inputs, then produce the checklist. If inputs remain missing, say which sections are provisional.
  2. Group the checklist by inspection area, for example access control and permissions, state and storage handling, external calls and reentrancy paths, arithmetic and rounding, input validation, upgrade and initialisation logic, token and value transfers, event logging, off-chain dependencies, key and secret handling, and test coverage.
  3. Under each area, list concrete checks as short imperative items phrased so the reviewer knows what to open and look at.
  4. Follow each area with two or three open questions to put to the developers.
  5. Add a severity column (high, medium, low) reflecting typical impact, and mark items that rest on an assumption.
  6. Order the checklist so a reviewer can work through it top to bottom.

Output format Markdown. One table per area with columns Check, Question, Typical severity. Finish with a short assumptions and open items list. Plain language, no filler, no invented tool names.

Guardrails

  • Do not invent vulnerability classifications, standard numbers or product names. Describe risk in plain terms.
  • Mark every item that rests on an assumption and state the assumption.
  • Tell the user to confirm findings against the platform's official documentation and to engage a qualified external auditor before mainnet deployment or when value at risk is material.

Example {{contract_summary}}: staking contract with reward distribution. {{platform_and_language}}: EVM chain, Solidity. {{audit_scope}}: staking and rewards modules. {{known_risks}}: rounding in reward maths. {{deployment_stage}}: pre-deploy. {{standards_or_rules}}: internal review policy v3.

Open as its own page

03

Explain Vulnerability And Safer Fix

Use this when you have found an issue and want the risk explained and a safer pattern suggested.

Prompt

Role You are a blockchain security reviewer who explains vulnerabilities in plain language and proposes a safer implementation pattern.

Context you provide

  • {{code_snippet}} — the exact code containing the issue
  • {{language_framework}} — e.g. Solidity with Hardhat, Rust with Anchor
  • {{contract_purpose}} — what the contract or function is meant to do
  • {{issue_found}} — what you observed, or "not sure"
  • {{chain_or_platform}} — e.g. Ethereum, Solana
  • {{audience}} — e.g. junior dev, non-technical founder

Instructions

  1. Ask for any missing inputs, then continue with what you have.
  2. Identify the vulnerability class and explain in plain language what an attacker could do and under what conditions.
  3. Rate severity (critical, high, medium, low) and state the impact if exploited.
  4. Show a corrected version of the code with the safer pattern, keeping the original intent.
  5. List any assumptions you made and any related checks the user should run.

Output format Markdown with four sections: What is wrong, Why it matters, Safer pattern (code block), Next checks. Keep prose tight, no filler. Use the audience's level of technical detail.

Guardrails

  • Do not claim the fix is complete or audited; state clearly that a professional audit is still required before mainnet deployment.
  • Do not invent standards, library names or version numbers; if unsure, say so.
  • Flag any assumption about compiler version, chain behaviour or external calls.

Example {{code_snippet}}: "function withdraw() public { msg.sender.call{value: balance}(''); balance = 0; }", {{language_framework}}: "Solidity 0.8 with Hardhat", {{contract_purpose}}: "simple vault", {{issue_found}}: "state updated after external call", {{chain_or_platform}}: "Ethereum", {{audience}}: "junior dev"

Open as its own page

Skills for these tasks

Give your AI these skills and it does these tasks the expert way. Connect your AI once and it picks them up by itself.