/viperclaw:viper-solidity-defi-advancedfrom viperclaw
Audits advanced DeFi protocols including AMMs, lending markets, yield vaults, EIP-712/EIP-2612 permits, and cross-chain bridges. Covers flash-loan TWAP manipulation, read-only reentrancy, signature replay, and non-standard ERC-20 tokens.
Ships in viperclaw. 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.
viper-solidity-defi-advanced)building-secure-contracts, OpenZeppelin Contracts v5, Immunefi Top DeFi Vulnerability Taxonomy.flowchart LR
Caller["User / Flash-Loan Contract"] --> Oracle["Chainlink + TWAP (No Spot Reserves)"] --> Sig["EIP-712 (chainid + nonce + deadline + ECDSA)"] --> Vault["Reentrancy-Locked View + minAmountOut > 0"]
viperclaw taint . --db .viperclaw/graph.db
*.sol for ecrecover, DOMAIN_SEPARATOR, getReserves(), balanceOf(address(this)), latestRoundData(), delegatecall.balanceOf(address(this)) Manipulation: Never compute collateral value or share price from instantaneous AMM spot reserves (pair.getReserves()) or raw token.balanceOf(address(this)) (vulnerable to flash-loan and direct-donation manipulation). Use manipulation-resistant Chainlink feeds + TWAP or internal accounting balances.receive() callbacks fire before the pool's internal invariant/virtual price is updated. Any lending protocol reading pool.get_virtual_price() during that callback reads an inflated price; check the target pool's reentrancy lock even on view functions.chainid & ecrecover Malleability: Ensure EIP-712 domain separators recompute dynamically if block.chainid changes (hard forks), include a per-user nonces[signer]++ and deadline >= block.timestamp, reject ecrecover returning address(0), and use OpenZeppelin's ECDSA.recover (enforcing low-s malleability).token.transferFrom(user, address(this), amount) increases the contract's balance by amount; measure actual received amount (balAfter - balBefore) and use SafeERC20.safeTransferFrom (handling USDT's missing boolean return).minAmountOut > 0) & Deadline Protection: Flag any swap or liquidity call that hardcodes amountOutMin = 0 or deadline = block.timestamp (which provides zero MEV/sandwich or mempool delay protection).// ❌ VULNERABLE: Hardcodes amountOutMin = 0 & deadline = block.timestamp (100% sandwichable)
router.swapExactTokensForTokens(amountIn, 0, path, msg.sender, block.timestamp);
// ✅ HARDENED: Caller-specified slippage floor & expiration deadline
function swapWithSlippage(uint256 amountIn, uint256 minAmountOut, uint256 deadline) external {
require(minAmountOut > 0, "Zero slippage protection");
require(block.timestamp <= deadline, "Expired deadline");
router.swapExactTokensForTokens(amountIn, minAmountOut, path, msg.sender, deadline);
}
Trail of Bits DeFi, OpenZeppelin v5, Immunefi, CWE-682, CWE-347| Severity Tier | Baseline CVSS v3.1 Vector | Qualifying Security Impact |
|---|---|---|
| CRITICAL (9.0–10.0) | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H | Unauthenticated remote code execution, cross-tenant authentication or isolation gap, or direct theft of funds/keys. |
| HIGH (7.0–8.9) | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N | Authenticated privilege escalation, unauthorized sensitive data exposure, or single-request service outage. |
| MEDIUM (4.0–6.9) | CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N | Scoped information disclosure, non-admin state mutation, or configuration weakness requiring user interaction. |
| LOW (0.1–3.9) | CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:L/I:N/A:N | Defense-in-depth hardening gap requiring high precondition complexity and minimal direct impact. |
viperclaw taint . --db .viperclaw/graph.db and viperclaw verify to record the verified state in .viperclaw/graph.db.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub zahidoverflow/viperclaw --plugin viperclaw72 skills in this plugin
/viper-agent-skill-supplychainAI Agent Skill, Plugin & MCP Config Supply-Chain Auditor (modeled on NVIDIA SkillSpector & OWASP Agentic Skills Top 10). Audits SKILL.md bundles and MCP JSON configs./viper-ai-llm-guardrailsAI, LLM & MCP Application Security & Guardrails Auditor (OWASP LLM Top 10). Reviews prompt boundaries, RAG data isolation, tool-call authorization, and output sanitization./viper-api-gateway-apigee-kongAPI Gateway, BFF & Rate-Tier Policy Auditor (Kong, AWS API Gateway, Apigee, Envoy Gateway). Reviews JWT authorizers, backend origin lockdown, and route-level quotas.Other plugins' skills for the same job