example-fork-detection
TEMPLATE — replace with the description of your rule. Should activate on the specific code patterns your fork has. Activate on…
Detect oracle manipulation risks — spot-price reads from AMMs, stale Chainlink answers, single-source dependence, TWAP gaming. Activate whenever code reads a price, conversion rate, exchange rate, or `getReserves`, `latestAnswer`, `latestRoundData`, `consult`, `quote`, `slot0`,
Claude Code
$ npx -y skills add omermaksutii/RugProof --skill oracle-manipulation --agent claude-code
Codex
$ npx skills add omermaksutii/RugProof --skill oracle-manipulation -a codex -y
Cursor
$ npx skills add omermaksutii/RugProof --skill oracle-manipulation -a cursor -y
Gemini CLI
$ npx skills add omermaksutii/RugProof --skill oracle-manipulation -a gemini-cli -y
GitHub Copilot
$ npx skills add omermaksutii/RugProof --skill oracle-manipulation -a github-copilot -y
OpenCode
$ npx skills add omermaksutii/RugProof --skill oracle-manipulation -a opencode -y
Windsurf
$ npx skills add omermaksutii/RugProof --skill oracle-manipulation -a windsurf -y
name: oracle-manipulation description: Detect oracle manipulation risks — spot-price reads from AMMs, stale Chainlink answers, single-source dependence, TWAP gaming. Activate whenever code reads a price, conversion rate, exchange rate, or `getReserves`, `latestAnswer`, `latestRoundData`, `consult`, `quote`, `slot0`, `observe`, `getAmountsOut`.
Any code that consumes a price feed or derives a price from on-chain state:
(uint112 r0, uint112 r1,) = pair.getReserves(); uint256 price = r1 * 1e18 / r0; // ← flash-loan manipulable in one block
(, int256 answer,,,) = feed.latestRoundData(); // ← ignores updatedAt and answeredInRound
Required checks:
int256 p = feed.latestAnswer(); // ← deprecated, prefer latestRoundData
Only one oracle, no fallback, no cross-check against a second source.
(uint160 sqrtPriceX96,,,,,,) = pool.slot0(); // ← spot, manipulable
Use `observe()` for TWAP with sufficient lookback (≥30min for shallow pools).
TWAP < 5 min on volatile assets or low-liquidity pools is gameable across two blocks.
Reading `getVirtualPrice` / `getReserves` mid-callback — see [[reentrancy]] §Read-only.
LP token price should use the *fair LP price* formula (Alpha Homora's method), not `reserve / totalSupply`.
Chainlink answers come in feed-specific decimals; mixing ETH/USD (8 decimals) with token (18 decimals) without normalizing produces silent off-by-1e10 errors.
On Arbitrum, Optimism, Base — must check `SequencerUptimeFeed` to avoid stale prices when sequencer is down.
| Pattern | Severity | |---|---| | Spot-price from AMM used in liquidation/mint | **Critical** | | Uniswap V3 `slot0` used for collateral pricing | **Critical** | | LP token priced via raw `reserve / totalSupply` | **Critical** | | `latestRoundData` without freshness/round checks | **High** | | Single oracle, no fallback, financial-critical path | **High** | | Sequencer uptime check missing on L2 | **High** | | Insufficient TWAP window (<5min on shallow pool) | **High** | | Stale heartbeat for known-volatile asset | **High** | | `latestAnswer` (deprecated) used | **Medium** | | Decimal-scaling mistake | **High** |
Rugproof your code before someone else does. 🌐 Live site: omermaksutii.github.io/RugProof 📦 Latest: v1.0.0 — 45 commands · 23 agents · 45 skills · 13 MCP servers · tested, offline-first, with rule packs, a benchmark, non-EVM coverage, and post-deploy
TEMPLATE — replace with the description of your rule. Should activate on the specific code patterns your fork has. Activate on…
Detect unsafe assumptions about Solady's gas-optimized ERC20/ERC2612 permit and DN404 metadata. Solady's ERC20 uses custom…
Detect front-runnable ownership initialization in Solady Ownable / OwnableRoles. Solady's `_initializeOwner` is a guarded…
Detect Solady SafeTransferLib calls that assume the token has code. SafeTransferLib.safeTransfer/safeTransferFrom/safeApprove…
Detect Uniswap V4 hooks that fail to settle currency deltas with the PoolManager. Every credit/debit a hook creates…
Detect Uniswap V4 hooks whose address-encoded permission flags don't match the callbacks the hook actually implements. In V4 the…
Use for authorized security assessment of REST, GraphQL, WebSocket, or SOAP APIs, including discovery, authentication,…
Extract and decrypt Windows DPAPI-protected secrets (Credential Manager, browser logins/cookies, Wi-Fi credentials, KeePass keys)…
Clean and finalize authorized natural-language text intended for readers by auditing suspicious invisible Unicode and rewriting…