A two-model workflow for getting your Solidity to the state it deserves before you pay a real auditor. Draft in one model, audit in another, reconcile findings, repeat.
Smart contract bugs are unusually expensive. Curve lost $73M to a read-only reentrancy the Vyper compiler hadn't been hardened against. Euler lost $200M to a donation-attack pattern that didn't exist as a named category before that exploit. Mango lost $114M to oracle manipulation that any senior auditor would have flagged in five minutes β but no one ran one. The pattern repeats: the bug was findable in review, but nobody looked hard enough.
A professional audit at Spearbit, Trail of Bits, OpenZeppelin, or a Code4rena contest costs $20Kβ$200K and queues 2β6 weeks out. You don't want to show up with code that has obvious reentrancy or missing access modifiers β at a contest you're burning collateral, at a private engagement you're paying senior reviewers to write findings you could have caught yourself.
This tutorial's workflow is what to do before that engagement: get the code to a state where the audit finds subtle systemic risk, not onlyOwner typos.
One model has blind spots. A second model with a different training mix has different blind spots. The intersection β bugs that both miss β is smaller than either alone. That's the whole game.
What each tends to be biased toward, in practice:
LingCode's Claude tab gives you the same agent loop regardless of how Claude is authenticated:
All three drive the same Node-based agent bridge with full tool use, MCP support, and permission gating. From the audit's perspective, none of these matter β pick the cheapest path you can stomach.
If you're on the LingModel Pro tier, it appears automatically in the chat's provider switcher next to your Claude option. No key wrangling. Settings (β,) β Account confirms the tier is active.
LingModel runs a different model family than Claude Code Native, which is exactly what the audit pass needs β fresh priors on the same contract. An audit pass of a 300-line contract is well under $0.10 of LingModel usage.
Two non-obvious habits make the audit step actually useful:
forge init, contract under src/, test under test/.Example threat-model comment for a vault contract:
// THREAT MODEL
// Holds: depositor USDC, up to ~$50M assumed TVL.
// Trust: governance multisig (5/9) can pause and rotate strategist;
// no other admin path. Strategist is trusted to not collude.
// Adversaries: depositors trying to mint excess shares (4626 inflation);
// MEV bots front-running deposit/withdraw; oracle griefers.
Click the provider switcher in the chat input area and select LingModel. Open a new chat β do not continue the drafting conversation. Sharing context with the model that wrote the code defeats the entire purpose. The audit pass needs to read the contract cold, the way an auditor would.
Paste the contract (and Foundry tests, if you have them) and use a structured prompt rather than "audit this." Vague audit prompts produce vague findings.
Audit this Solidity contract assuming it controls $10M on mainnet.
Check every item below. For each finding, give:
- Severity (Critical / High / Medium / Low / Info)
- File:line
- One-paragraph explanation
- Concrete fix or mitigation
CHECKLIST
1. Reentrancy β including read-only reentrancy and cross-function
2. Access control β modifier coverage, owner-can-rug surface area
3. Integer arithmetic β even on 0.8.x, unchecked blocks and casting
4. Oracle dependency β staleness checks, manipulation, fallback path
5. Front-running β does any path need commit-reveal?
6. Signature replay β chainId, nonce, deadline, domain separator
7. Upgrade safety (if proxy) β initializer guards, storage gaps, __gap
8. ERC-4626 share inflation β first-depositor griefing, virtual shares
9. Gas griefing β unbounded loops over user-controlled input
10. Checks-Effects-Interactions discipline β order of state updates
11. External call return values β silent failure modes
12. Token assumptions β fee-on-transfer, rebasing, blocklist, ERC-777 hooks
13. Block.timestamp / block.number assumptions
14. tx.origin usage
15. Self-destruct / selfdestruct in dependencies
Output: a numbered findings list. Don't editorialize.
Save LingModel's findings. Then start a fresh chat in Claude with the same checklist prompt and the same contract. You now have two independent findings lists.
Loop the process until both models produce only Info-level findings on the latest version. That's your hand-off state to a real auditor β clean enough that they spend their hours on systemic risk, not on triage.
writing-smart-contractsThe community skill writing-smart-contracts encodes auditor-grade Solidity heuristics β reentrancy patterns, proxy storage collisions, oracle/MEV exposure, ERC-20/721/1155/4626 tokens, deploy-script gotchas β and pushes a Foundry test-first workflow. Install it once from the Skill Gallery and it activates in any chat where you mention Solidity, Forge, Hardhat, or an EIP.
Run it as the third pass after the Claude / LingModel reconcile. Same checklist prompt, but now the skill's heuristics steer the model toward categories the bare model would have skimmed. This is genuinely additive β it's not a fourth model, it's a sharper system prompt for whichever model you're using.
Be honest with yourself about the limits before you ship.
After the reconcile loop converges, deploy to a testnet and let the contract live there for a week. forge script ... --rpc-url $SEPOLIA_RPC --broadcast --verify, walk the storage layout in Tenderly, watch the events. Real on-chain testing finds gas griefing, MEV exposure, and integration breakage that static review cannot. Then book the audit.
writing-smart-contracts skill as a final sweep, deploy to Sepolia for a week, then pay for a real audit. The workflow doesn't replace any single step β it makes each one cheaper.