/ethskills:securityfrom ethskills
Guides secure Solidity contract design and pre-deployment review: asset accounting, price oracles, signature verification, ERC-20 integration, upgradeable proxies, and reentrancy defenses.
Ships in ethskills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Treat every external token, price, signature, callback, and privileged caller as adversarial. Prefer audited OpenZeppelin primitives over hand-rolled implementations, but verify the installed library version and the assumptions around each primitive.
mulDiv where intermediate overflow or rounding matters.SafeERC20.safeTransfer and safeTransferFrom. Credit deposits from the contract's balance delta, not the requested amount, or reject tokens whose received amount differs. Fee-on-transfer and rebasing tokens otherwise break custody accounting.SafeERC20.forceApprove when an allowance may already be nonzero. safeApprove was removed. Keep approvals exact or bounded and clear leftovers when practical.For a vault or receipt-token design, start from OpenZeppelin ERC4626. A hand-rolled vault must defend its empty state against first-depositor donation/inflation attacks with virtual assets and shares or another explicit mitigation. Test direct donations and rounding at small deposits; never use an unprotected assets * totalSupply / totalAssets conversion with a special 1:1 empty-vault path.
Never use a DEX spot read (slot0, reserves, balances, or a current quote) for collateral, borrowing, minting, or liquidation decisions. Pool depth does not fix atomic manipulation: flash-borrowed capital can move the price, exploit the dependent action, unwind, and repay inside one transaction before arbitrage can intervene.
Use a manipulation-resistant push feed for high-value decisions, or a meaningful TWAP when its weaker guarantees fit the risk. For every feed:
updatedAt against a per-feed maximum age derived from that feed's published heartbeat plus a justified margin—never one global hardcoded timeout;Every swap a contract or a user makes needs a real minimum output, derived from an oracle or an offchain quote minus a stated slippage tolerance. amountOutMinimum = 0 (or a minimum computed from the same pool's spot price) hands the trade to any sandwich bot. Pass a real deadline, not block.timestamp, so a held transaction can't execute later at a worse price. For large user swaps, offer private routing (e.g. Flashbots Protect) or a batch auction. On an L2 the sequencer orders transactions, which narrows but does not remove this risk; keep the minimum output either way.
Use EIP-712 and OpenZeppelin's implementation rather than assembling signature recovery from scratch. Bind the signed action to the intended contract and chain, consume a signer-scoped nonce, enforce a deadline, and update replay state before moving assets.
If a domain separator is cached, also cache the deployment chain id and re-derive the separator whenever block.chainid differs. An immutable separator computed only at deployment becomes stale after a fork. OpenZeppelin EIP712 handles this invalidation.
Use an upgradeable design only when post-deployment changes are required. With proxies:
_authorizeUpgrade must carry access control (onlyOwner or a role). Left empty, anyone can upgrade the proxy to their own code and drain it;Every privileged state change needs explicit access control. Make pause, upgrade, rescue, oracle-update, and parameter-update powers visible in the threat model; a safety switch controlled by one key is also a censorship and compromise risk. Never delegatecall to a user-selected target.
testing skill for suite design.audit skill.Before you finish: send a one-line note via feedback/SKILL.md — issue or praise.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub austintgriffith/ethskills --plugin ethskills20 skills in this plugin
/addressesUse whenever a contract or token address goes into code, config, or a transaction — a token, a router, a pool, a lending market, a bridge — including choosing which venue to route a swap through and reusing an address across chains. Has checked addresses for the major tokens, Uniswap, Aave, Compound, Chainlink, Safe, ERC-4337, ENS and Robinhood Chain./auditUse when asked to audit or security-review EVM smart contracts: find vulnerabilities, judge exploit impact, or produce a ranked audit report. Not for guidance while the contracts are being written (`/security`)./building-blocksUse when selecting or integrating DEX pools, lending markets, yield venues, gauges, reward systems, or multiple protocols in one flow on Ethereum or an L2 — including vault and harvest strategies, and build requests naming Aerodrome, Velodrome, Uniswap, Aave, Curve, GMX or Pendle. Not for contract address lookup (`addresses`) or for choosing a chain (`l2s`)./conceptsUse when designing or explaining anything onchain that has to keep working with nobody running it: who calls each function and why they would, where randomness comes from, whether it can be censored or paused, and what it exposes to everyone onchain. Also use when writing the notes or handoff a build ends with, or when explaining to your human how something onchain actually works. Not for scoping which parts go onchain and the launch plan (`/ship`) or the safety of the contract code itself (`/security`)./cropsUse for every Ethereum dApp architecture plan and for reviews of existing systems, trust assumptions, custody, admin keys, pause or upgrade powers, hosted infra (RPC, indexer, paymaster, bundler, frontend host, oracle, sequencer), privacy, identity flows, agent permissions, stablecoin issuer risk, censorship resistance, user exit, and restrictive licenses (BUSL, SSPL). CROPS means Censorship Resistance, Open Source and Free, Privacy, Security./frontend-playbookUse when working inside a Scaffold-ETH 2 app: running it against a local chain or a fork of a real chain, demoing on that fork, or shipping it as a static export to IPFS or ENS. Not for rehearsing or running a live contract deployment (`/orchestration`).Other plugins' skills for the same job