example-fork-detection
TEMPLATE — replace with the description of your rule. Should activate on the specific code patterns your fork has. Activate on…
Detect MEV exposure and front-running risks — sandwich attacks, missing commit-reveal, missing/manipulable deadlines, slippage absent, public mempool dependence. Activate on swaps, mints, liquidations, NFT mints with reveals, auctions, and any function whose ordering can extract
Claude Code
$ npx -y skills add omermaksutii/RugProof --skill mev-frontrunning --agent claude-code
Codex
$ npx skills add omermaksutii/RugProof --skill mev-frontrunning -a codex -y
Cursor
$ npx skills add omermaksutii/RugProof --skill mev-frontrunning -a cursor -y
Gemini CLI
$ npx skills add omermaksutii/RugProof --skill mev-frontrunning -a gemini-cli -y
GitHub Copilot
$ npx skills add omermaksutii/RugProof --skill mev-frontrunning -a github-copilot -y
OpenCode
$ npx skills add omermaksutii/RugProof --skill mev-frontrunning -a opencode -y
Windsurf
$ npx skills add omermaksutii/RugProof --skill mev-frontrunning -a windsurf -y
name: mev-frontrunning description: Detect MEV exposure and front-running risks — sandwich attacks, missing commit-reveal, missing/manipulable deadlines, slippage absent, public mempool dependence. Activate on swaps, mints, liquidations, NFT mints with reveals, auctions, and any function whose ordering can extract value.
function swap(address tokenIn, uint256 amountIn) external {
router.swapExactTokensForTokens(amountIn, 0, path, msg.sender, block.timestamp);
// ^ amountOutMin = 0 → 100% sandwichable
}router.swap(..., block.timestamp); // ← deadline = now means no deadline at all
Searcher can delay your tx indefinitely. Use a real deadline (`block.timestamp + 15 min` or user-supplied).
Submitting `permit()` separately from the consuming tx lets an MEV bot front-run the permit and grief the user. Bundle in one tx.
function mintRare() external {
uint256 r = uint256(keccak256(abi.encode(block.timestamp, msg.sender)));
if (r % 100 == 0) _mint(msg.sender, RARE_ID); // ← searcher can simulate and skip
}Searcher simulates → only sends tx if outcome is favorable. Use commit-reveal or Chainlink VRF.
Proposer can manipulate post-merge `prevrandao` within bounded ranges; predictable enough for valuable mints.
Bots will sweep entire allocation. Not a vuln per se but a UX/fairness issue worth flagging.
LPs in concentrated-liquidity pools can be JIT'd. Inform user, not a fix.
First-price sealed bids on a public mempool = bid front-run. Use commit-reveal.
Classic ERC-20 `approve(spender, X)` → `approve(spender, Y)` front-run lets spender drain `X + Y`. See [[approval-issues]].
| Pattern | Severity | |---|---| | `amountOutMin = 0` on user-facing swap | **High** | | Deadline = `block.timestamp` on user-facing swap | **High** | | Block-data randomness for valuable outcomes | **High** | | Commit-reveal missing on sealed bid | **High** | | Permit + transferFrom unbundled | **Medium** | | Bot-sweep risk on public NFT mint | **Medium** | | JIT-LP exposure | **Low** | | Display-only ordering issue | **Info** |
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…