ethereum-wingman
Ethereum Wingman
Comprehensive Ethereum development guide for AI agents. Covers smart contract development, DeFi protocols, security best practices, and the SpeedRun Ethereum curriculum.
AI AGENT INSTRUCTIONS - READ THIS FIRST
🚫 CRITICAL: External Contracts & Scaffold Hooks
These rules are MANDATORY. Violations cause real bugs in production.
-
ALL CONTRACTS IN externalContracts.ts — Any contract you want to interact with (tokens, protocols, etc.) MUST be added to
packages/nextjs/contracts/externalContracts.tswith its address and ABI. Read the file first — the pattern is self-evident. -
SCAFFOLD HOOKS ONLY — NEVER RAW WAGMI — Always use
useScaffoldReadContractanduseScaffoldWriteContract, NEVER raw wagmi hooks likeuseWriteContractoruseReadContract.
Why this matters: Scaffold hooks use useTransactor which waits for transaction confirmation (not just wallet signing). Raw wagmi's writeContractAsync resolves the moment the user signs in MetaMask — BEFORE the tx is mined. This causes buttons to re-enable while transactions are still pending.