← ClaudeAtlas

mev-pbslisted

Detect MEV and proposer-builder-separation exposure — sandwichable swaps with no minOut, JIT liquidity, oracle-update frontrunning, backrunnable state, false reliance on private mempools, builder censorship, missing commit-reveal, and multi-block MEV post-PBS. Activate whenever code performs swaps/liquidations/auctions/redemptions whose ordering or price is observable in the public mempool before execution.
iktok90-design/ai-smart-contract-auditor · ★ 36 · AI & Automation · score 80
Install: claude install-skill iktok90-design/ai-smart-contract-auditor
# MEV / PBS risk detection ## When this applies Trigger on any of: - Swaps, mints, or redemptions priced from a spot source without slippage bounds - Liquidations, auctions, or rebalances triggerable by anyone observing the mempool - Logic assuming transactions land via a private orderflow (Flashbots Protect, MEV-Share) - Reveal-then-act flows with no commit phase - Reward/airdrop claims, NFT mints, or oracle pushes that are frontrun-profitable - Time- or block-sensitive state an attacker can backrun ## Detection patterns ### Sandwichable swap, no minOut (HIGH) ```solidity function swap(uint256 amountIn) external { uint256 out = router.swapExactTokensForTokens(amountIn, 0, path, ...); // ^ minOut = 0 } ``` **Signal:** `amountOutMin == 0` (or a deadline of `type(uint).max`) lets a searcher frontrun to move price, then backrun, extracting the full slippage. The user-facing call must accept a caller-supplied `minOut` and `deadline`, never hardcode 0. ### Oracle-update frontrunning (HIGH) A position becomes profitable to liquidate / mint the instant a Chainlink push or `updatePrice` lands. Searchers backrun the oracle tx in the same block. If your protocol grants the *liquidator* a fixed bonus, the value leaks to MEV; if redemptions price off a freshly-updated feed, frontrun the update. ### JIT liquidity (MEDIUM) Concentrated-liquidity add-just-before / remove-just-after a large swap captures fees from passive LP