Help us improve
Share bugs, ideas, or general feedback.
From grimoire
Audits Solidity smart contracts against all 10 OWASP Smart Contract Top 10 vulnerability classes using Slither static analysis and Foundry invariant testing, with specific detection commands and remediation steps.
npx claudepluginhub jeffreytse/grimoire --plugin grimoireHow this skill is triggered — by the user, by Claude, or both
Slash command
/grimoire:review-smart-contract-securityThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Audit smart contracts against the OWASP Smart Contract Top 10 using Slither static analysis and Foundry invariant testing — covering SC01 through SC10 with specific test procedures, detection commands, and remediation steps.
Orchestrates interactive Solidity smart contract security audits using Map-Hunt-Attack methodology: static analysis (Slither, Aderyn), fuzzing (Echidna, Medusa, Halmos), verification, and reporting.
Runs Slither and Mythril static/symbolic analysis on Solidity contracts to detect reentrancy, overflow, access control, and other vulnerabilities before Ethereum mainnet deployment.
Runs Slither and Mythril static/symbolic analysis on Solidity contracts to detect reentrancy, overflow, access control, and other vulnerabilities before Ethereum mainnet deployment.
Share bugs, ideas, or general feedback.
Audit smart contracts against the OWASP Smart Contract Top 10 using Slither static analysis and Foundry invariant testing — covering SC01 through SC10 with specific test procedures, detection commands, and remediation steps.
Adopted by: OWASP Smart Contract Top 10 is the authoritative vulnerability taxonomy. Trail of Bits, OpenZeppelin Security, and Consensys Diligence — the three most prominent smart contract audit firms — all use structured checklists covering SC01–SC10 equivalent categories. Slither (Trail of Bits) is the standard static analysis tool, used in Ethereum Foundation security tooling. MakerDAO, Compound, and Uniswap conduct external audits plus internal pre-deployment reviews against these classes before each major release. Impact: Smart contract audit findings consistently cluster in these 10 categories. Immunefi's "DeFi Bug Bounty Report" (2023) found that 73% of critical findings were in categories covered by SC01–SC10. Protocols that undergo structured audits have 4× lower incident rates than unaudited protocols (DeFi Safety score analysis, 2022). The $1B+ in DeFi losses attributed to smart contract exploits in 2022–2023 would have been significantly reduced by systematic SC01–SC10 review. Why best: Manual code review without a structured checklist misses vulnerability classes — a reviewer focused on reentrancy may overlook integer overflow or oracle manipulation. The SC01–SC10 framework provides completeness; Slither and Foundry provide automated detection for the mechanical findings, freeing human reviewers to focus on business logic vulnerabilities that tools miss.
Sources: OWASP Smart Contract Top 10; SWC Registry; Trail of Bits Slither documentation; Immunefi Bug Bounty Report (2023)
# Install analysis tools
pip install slither-analyzer
forge install foundry-rs/forge-std # Foundry standard library
# Run Slither on the contract directory
slither . --checklist --markdown-root "contracts/"
# Run Slither detectors individually
slither . --detect reentrancy-eth,reentrancy-no-eth
slither . --detect unprotected-upgrade,suicidal
slither . --detect oracle-manipulation,msg-value-loop
# Slither: find unprotected functions
slither . --detect unprotected-upgrade,suicidal,controlled-delegatecall
Check:
onlyOwner or onlyRole modifierinitialize() functions use initializer modifier (proxy contracts)DEFAULT_ADMIN_ROLE assigned to multi-sig, not EOAOwnable2Step) for all Ownable contractsslither . --detect overflow-before-cast,tautology
Check:
unchecked {} blocks without documented justificationslither . --detect weak-prng,timestamp
Check:
block.timestamp used for randomness or lottery outcomesblock.number as a proxy for time in cross-chain deploymentsslither . --detect reentrancy-eth,reentrancy-no-eth,reentrancy-benign,reentrancy-events
Check:
ReentrancyGuard.nonReentrant on all public/external functions making external callsslither . --detect suicidal,locked-ether,arbitrary-send-eth
Check:
selfdestruct not callable by unauthorized addresses# Manual check — Slither doesn't fully detect oracle patterns
grep -r "slot0()" contracts/ # spot price reading
grep -r "getReserves()" contracts/ # Uniswap V2 spot price
Check:
pool.slot0(), pair.getReserves())updatedAt + MAX_STALENESS > block.timestamp)# Foundry invariant testing
forge test --match-test invariant
Write invariant tests:
// Foundry invariant: total supply never exceeds max
function invariant_totalSupplyLeqMax() external view {
assertLe(token.totalSupply(), MAX_SUPPLY);
}
// Invariant: vault solvency — assets >= liabilities
function invariant_vaultSolvent() external view {
assertGe(vault.totalAssets(), vault.totalLiabilities());
}
slither . --detect weak-prng
grep -r "block\.timestamp\|block\.number\|blockhash\|block\.prevrandao" contracts/
Check:
slither . --detect costly-loop,msg-value-loop
Check:
DoS with (Unexpected) Revert — one failing recipient doesn't block all withdrawalsgrep -rn "amountOutMinimum: 0\|minAmountOut: 0" contracts/
grep -rn "deadline.*block\.timestamp" contracts/
Check:
amountOutMinimumblock.timestampAudit Summary:
□ SC01 Access Control — all privileged functions protected
□ SC02 Integer Safety — 0.8.x or SafeMath, no unsafe unchecked
□ SC03 Timestamp — no block vars for randomness
□ SC04 Reentrancy — CEI + nonReentrant on all external calls
□ SC05 Ether Withdrawal — no arbitrary send, no locked ETH
□ SC06 Oracle — TWAP/Chainlink with staleness checks
□ SC07 Logic — invariant tests written and passing
□ SC08 Randomness — Chainlink VRF for all random outcomes
□ SC09 Gas/DoS — no unbounded loops, pull payment pattern
□ SC10 Front-running — slippage protection, deadline params
□ Slither 0 high/medium findings
□ External audit completed (for TVL > $100k)
slither . --fail-on high.vm.createFork(mainnet_rpc) tests real oracle conditions and real liquidity depths.