Code review solidity

From NoorQureshi/security-skills · View interactive version

Code review solidity is an AI agent skill from the GitHub repository NoorQureshi/security-skills. Security review of Solidity / EVM smart contracts — reentrancy, access control, arithmetic, and DeFi economic bugs. Load when reviewing a smart contract / web3 codebase or PR, on .sol source in scope, or "audit this contract". Signals: *.sol, foundry/hardhat, ERC-20/721, external calls, delegatecall

How to use this skill

Skill file

Solidity / smart-contract review

When it applies

Reviewing on-chain code (a protocol, a token, a bridge). Smart-contract bugs are usually

irreversible and directly financial, so the review bar is high and the classic patterns are

well known — start there, then look for economic/logic flaws unique to the protocol.

Why it works

The EVM executes exactly as written with real money at stake: an external call can re-enter before

state updates, arithmetic wraps, and a missing modifier means anyone can call a privileged function.

Most losses trace to a small set of patterns a careful read (plus Slither/Mythril) will surface.

Sinks & patterns (read, then reason about ordering and trust)

hooks). Enforce checks-effects-interactions or a nonReentrant guard.

auth (phishable); unprotected initialize() on upgradeable proxies.

from divide-before-multiply; rounding that favors the attacker.

proxies.

slippage/deadline, MEV/front-running of state-changing txs, first-depositor share inflation.

blockhash), signature replay (missing nonce/chainId in EIP-712), DoS via unbounded loops.

Method

  1. Run slither (fast, high-signal) and mythril; triage findings.
  2. Read every external call and check state-update ordering (reentrancy) and return-value handling.
  3. Map roles/modifiers to every state-changing and fund-moving function.
  4. Model the economics: how does price/valuation get set, and can a flash loan move it within one tx?
  5. Property-test invariants with echidna/Foundry fuzzing where feasible.

Gotchas

References

SWC Registry; Slither/Mythril docs; Trail of Bits & OpenZeppelin audit guidance; rekt.news post-mortems.

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.