eip-reference
Installation
SKILL.md
EIP / ERC Reference
Canonical reference for Ethereum Improvement Proposals and ERC standards. Covers correct interfaces, behavioral rules, implementation patterns, and the gotchas that trip up humans and LLMs alike. Use this when you need the right function signature, the correct domain separator construction, or the nuance that separates a working implementation from a buggy one.
What You Probably Got Wrong
These misconceptions appear in LLM-generated code constantly. Fix your mental model before writing a single line.
- EIP != ERC — An EIP (Ethereum Improvement Proposal) covers the entire proposal process. An ERC (Ethereum Request for Comments) is the subset of EIPs defining application-layer standards (tokens, signatures, wallets). ERC-20 started as EIP-20 and became ERC-20 upon acceptance. Chain-level changes like EIP-1559 stay as EIPs — they are never ERCs.
- ERC-20
approvehas a race condition — If Alice approves Bob for 100, then changes to 50, Bob can front-run: spend the original 100, then spend the new 50, totaling 150. Mitigation: approve to 0 first, useincreaseAllowance/decreaseAllowance, or use ERC-2612permit. USDT requires resetting to 0 before setting a new nonzero allowance — it reverts otherwise. - ERC-721
transferFromskips receiver checks —transferFromdoes NOT callonERC721Receivedon the recipient. Tokens sent to contracts that cannot handle them are permanently locked. UsesafeTransferFromunless you have a specific reason not to. - EIP-712 domain separator MUST include
chainId— OmittingchainIdfrom theEIP712Domainallows signature replay across chains. A signature valid on mainnet becomes valid on every fork and L2 sharing the contract address. Always includechainIdandverifyingContract. - ERC-4337 bundler != relayer — A bundler packages
UserOperationobjects and submits to theEntryPoint. A relayer wraps a signed message and calls a trusted forwarder. Different trust models, different gas accounting, different entry points. - EIP-1559
baseFeeis protocol-controlled — Users setmaxFeePerGasandmaxPriorityFeePerGas. The protocol setsbaseFeeper block. The base fee is burned, the priority fee goes to the validator. Confusing these causes incorrect gas estimation. - ERC-4626 share/asset math is rounding-sensitive —
convertToSharesandconvertToAssetsmust round in favor of the vault to prevent share inflation attacks. First-depositor attacks exploit vaults that skip this. - EIP-2612 permit signatures can be front-run — The approval still takes effect, but the original
permitcall reverts. Always check allowance before calling permit. - ERC-1155 has no per-token approval — Only
setApprovalForAllexists (operator model). There is noapprove(tokenId)like ERC-721. decimals()is OPTIONAL — Part ofIERC20Metadata, notIERC20. USDC uses 6, WBTC uses 8. Never assume 18.