Smart contract audit

From elophanto/EloPhanto · View interactive version

Smart contract audit is an AI agent skill from the GitHub repository elophanto/EloPhanto. Use when reviewing a Solidity, Vyper, or Rust (Solana/Anchor) smart contract for paid audit work or pre-launch sanity check. Covers reentrancy, oracle manipulation, access control, signature replay, integer/precision, donation/share-inflation, and protocol-specific risks. Outputs a findings report w

How to use this skill

Skill file

Triggers

Smart Contract Audit

Overview

Smart contract bugs are expensive: the average DeFi exploit in the last cycle

moved $5M+, and the average protocol team is overworked and underspecialized

in security. There is real, recurring demand for **a fast, paid second

set of eyes** between an internal review and a $50–250k formal audit firm.

This skill exists to do that review competently and to never over-claim.

Iron rules:

  1. Never write "this contract is secure." The most an audit produces is

"I checked these things, found these issues, and didn't find more in the

time allotted." Anything stronger is liability.

  1. Always include the time budget in the report. A $1k 2-day review is

not a Trail of Bits engagement. Say so explicitly.

  1. Reproducible findings only. Every High/Medium finding must include

either a PoC test (Foundry / Anchor / Hardhat) or a precise call sequence

that demonstrates the issue. No vibes findings.

  1. Disclosure first, public second. Findings go to the protocol via the

agreed channel before any public mention. Period.

Phase 1 — scoping & engagement (before reading any code)

Before opening the repo:

  1. Get the scope in writing. Specific commit hash, list of files in

scope, files explicitly out of scope. Not "the whole repo."

  1. Get the time budget in writing. Hours or days. This caps the

"Methodology — what was checked" section of the report.

  1. Get the disclosure channel in writing. Email, Telegram, Slack,

shared drive — pick one and stick to it. No "I'll just DM their X."

  1. Get the price in writing. Fixed fee or hourly. If it's a contest

(Code4rena/Sherlock/Cantina), the contest rules ARE the engagement —

read them and follow them, no separate negotiation.

If any of these is missing → push back, do not start. Scope creep is the

single biggest threat to audit quality and to the relationship.

Phase 2 — orientation (10–20% of budget)

An audit without business-context is a syntax check.

permissionless, what's upgradeable, who controls upgrade keys.

always equals sum of user shares", "outputAmount ≥ minOutputAmount",

"borrow ≤ collateral × LTV"). These become the test bench.

AMMs queried for prices, cross-chain bridges, off-chain components.

Phase 3 — vulnerability sweep (60–70% of budget)

Walk this checklist explicitly. Mark each as checked / found / N/A so the

report can show coverage.

Reentrancy

Oracle manipulation

Access control

Integer & precision

Token-specific

Solana / Anchor-specific (if applicable)

Economic / MEV

Upgradeability

Phase 4 — exploitation & PoC (10–15% of budget)

For every High or Medium finding, write a working PoC. Foundry test for

EVM, Anchor test for Solana. Without a PoC the finding gets downgraded

to Informational, no exceptions.

The PoC's job is to remove ambiguity for the protocol team. They should be

able to clone the repo, run forge test, and see the bug.

Phase 5 — report (10% of budget)

Severity rubric

attacker can't satisfy. ≥$X at risk where X is meaningful relative to TVL.

governance/admin power, OR DoS of core function.

market conditions, OR loss of accrued fees, OR meaningful griefing.

Report template

# Audit Report — {protocol name}

**Scope:** commit `{hash}`, files: {list}
**Time budget:** {N hours / days}
**Reviewer:** {name / handle}
**Engagement type:** {paid review / contest / pre-launch sanity check}
**Date range:** {start} – {end}

## Executive summary
{1 paragraph. # of findings by severity. Honest read on the protocol's
current security posture relative to the time budget. Explicit statement
that this is not a substitute for a formal audit firm if the protocol is
holding > $X.}

## Methodology — what was checked
{Bulleted list mapping to the Phase 3 checklist. Areas explicitly NOT
checked due to time/scope.}

## Findings

### [H-01] {short title}
- **Severity:** High
- **Location:** `src/Foo.sol#L123-L140`
- **Impact:** {1–2 sentences, concrete}
- **Description:** {what's wrong, with code snippet}
- **Proof of concept:** {Foundry test or call sequence}
- **Recommendation:** {specific fix, not "consider improving"}

[repeat per finding, ordered Critical → Informational]

## Disclaimer
This review was performed in {N hours/days} on commit {hash}. It is not a
guarantee of security. New code introduced after this commit is not
covered. The reviewer assumes no liability for losses arising from issues
not identified in this report.

Outreach (direct-to-protocol, no platform)

Cold outreach template

Subject: Pre-launch security review for {protocol}

Hi {name},

Saw {protocol} is launching {feature/version}. I do paid second-pass

security reviews on Solidity / Anchor protocols — the gap between

internal review and a $100k Trail of Bits engagement.

What it is: ~{N} day review, written report with PoCs for every High/Medium,

fixed fee of ${price}. Past work: {links to prior reports / disclosures}.

What it isn't: a full audit. If you're holding >$50M post-launch, you

still want a firm. I'm useful for the 6-week pre-firm-audit window or

as the sanity check after fixes ship.

Worth a 15-min call this week?

Pricing reference

full perp DEX in a week.

Failure modes / when to refuse

for any honest review at that price. Push for a smaller scope.

audit happens in <12 hours; saying yes is liability for both sides.

contract must run for real users on a public chain — there is no

meaningful private smart-contract audit. Push back.

is the only currency this skill earns; don't spend it on scammers.

Reputation tracking

Every completed audit (paid or unpaid) goes in learned/audits/{date}-{protocol}.md

with: scope, hours, findings count by severity, fee, did the protocol fix

the issues, did anything later get exploited that this audit missed.

Honest track record is the marketing.

Verify

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.