example-fork-detection
TEMPLATE — replace with the description of your rule. Should activate on the specific code patterns your fork has. Activate on `<your trigger keywords or…
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
$ npx -y skills add omermaksutii/RugProof --skill mev-frontrunning --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/mev-frontrunningContext preview
The summary Claude sees to decide when to auto-load this skill.
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
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
Repo: omermaksutii/RugProof
TEMPLATE — replace with the description of your rule. Should activate on the specific code patterns your fork has. Activate on `<your trigger keywords or…
Detect unsafe assumptions about Solady's gas-optimized ERC20/ERC2612 permit and DN404 metadata. Solady's ERC20 uses custom storage slots, returns bools via…
Detect front-runnable ownership initialization in Solady Ownable / OwnableRoles. Solady's `_initializeOwner` is a guarded one-time setter (it reverts with…
Detect Solady SafeTransferLib calls that assume the token has code. SafeTransferLib.safeTransfer/safeTransferFrom/safeApprove deliberately skip the EXTCODESIZE…
Detect Uniswap V4 hooks that fail to settle currency deltas with the PoolManager. Every credit/debit a hook creates (BeforeSwapDelta, afterSwap hookDelta,…
Detect Uniswap V4 hooks whose address-encoded permission flags don't match the callbacks the hook actually implements. In V4 the hook's permissions live in the…