A practical security checklist that walks you through the standard AMM vulnerability surface: reentrancy guards, check-effects-interactions ordering, donation attacks from raw balanceOf calls, oracle manipulation via spot prices, and missing slippage protection. Each category shows a vulnerable snippet next to the hardened fix using OpenZeppelin or Uniswap libraries. If you're writing or auditing swap functions, LP deposits, or anything that tracks reserves, this gives you the pattern library and a final checklist to run through before deployment. The examples are concrete enough to paste and adapt. Includes audit tool commands for Slither, Echidna, and Foundry fuzzing at the end.

skills.sh installs
3.5K
GitHub stars
229.1K
last updated
Jul 14, 2026

Install

$ npx -y skills add affaan-m/everything-claude-code --skill defi-amm-security --agent claude-code

Installs into .claude/skills of the current project.

Files

DeFi AMM Security

Critical vulnerability patterns and hardened implementations for Solidity AMM contracts, LP vaults, and swap functions.

When to Use

  • Writing or auditing a Solidity AMM or liquidity-pool contract
  • Implementing swap, deposit, withdraw, mint, or burn flows that hold token balances
  • Reviewing any contract that uses token.balanceOf(address(this)) in share or reserve math
  • Adding fee setters, pausers, oracle updates, or other admin functions to a DeFi protocol

How It Works

Use this as a checklist-plus-pattern library. Review every user entrypoint against the categories below and prefer the hardened examples over hand-rolled variants.

Execution Safety

The shell commands in this skill are local audit examples. Run them only in a trusted checkout or disposable sandbox, and do not splice untrusted contract names, paths, RPC URLs, private keys, or user-supplied flags into shell commands. Ask before installing tools or running long fuzzing/static-analysis jobs that may consume significant local or paid resources.

Never include secrets, private keys, seed phrases, API tokens, or mainnet signing credentials in command examples, logs, or reports.

Sponsors

Details

Repository
github.com/affaan-m/everything-claude-code
Categories
Security, Finance & Trading, Web3 & Blockchain
First seen
May 16, 2026

More from affaan-m/everything-claude-code

All 256

Recommended

More Security
1boshu2 avatarsecurityboshu2/agentopsRun authorized repository security scans for1.4Kskills.sh installs
2uniswap avatarv4-security-foundationsuniswap/uniswap-aiSecurity-first Uniswap v4 hook development. Use when user mentions "v4 hooks", "hook security", "PoolManager", "beforeSwap", "afterSwap", or asks about V4 hook 1.2Kskills.sh installs
3ruvnet avataragent-authenticationruvnet/rufloAgent skill for authentication - invoke with $agent-authentication1.1Kskills.sh installs
4davila7 avatarsenior-securitydavila7/claude-code-templatesComprehensive security engineering skill for application security, penetration testing, security architecture, and compliance auditing. Includes security assess987skills.sh installs
5aradotso avatarslowmist-agent-security-frameworkaradotso/security-skillsslowmist agent security framework955skills.sh installs
6aradotso avatarpalisade-security-nexus-bitdefenderaradotso/security-skillspalisade security nexus bitdefender937skills.sh installs