Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Mev Frontrunning

ASecurity

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.

36 stars
0 votes
0 copies
0 views
Added 10/4/2026
blockchainrustgo

Security Analysis

A100/100

Scanned 10/4/2026

$npx -y skills add iktok90-design/ai-smart-contract-auditor --skill mev-frontrunning --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Mev Frontrunning?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Mev Frontrunning
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/iktok90-design-mev-frontrunning/badge)](https://www.skillsdirectory.com/skills/iktok90-design-mev-frontrunning)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
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.
---

# MEV / front-running detection

## When this applies

- Swaps, mints, redemptions on AMMs / vaults
- NFT mints with random/reveal mechanics
- Auctions, Dutch auctions, English auctions
- Liquidations
- Trade routers
- DEX aggregator paths
- Any function with `amountOutMin` or slippage parameters

## Detection patterns

### Missing slippage parameter (HIGH)
```solidity
function swap(address tokenIn, uint256 amountIn) external {
    router.swapExactTokensForTokens(amountIn, 0, path, msg.sender, block.timestamp);
    //                                       ^ amountOutMin = 0 → 100% sandwichable
}
```

### Manipulable deadline (HIGH)
```solidity
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).

### Permit + transferFrom front-running (MEDIUM)
Submitting `permit()` separately from the consuming tx lets an MEV bot front-run the permit and grief the user. Bundle in one tx.

### Reveal-based randomness without commit-reveal (HIGH)
```solidity
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.

### `block.prevrandao` / `block.difficulty` for randomness (HIGH)
Proposer can manipulate post-merge `prevrandao` within bounded ranges; predictable enough for valuable mints.

### NFT mint without per-tx limits + public sale (MEDIUM)
Bots will sweep entire allocation. Not a vuln per se but a UX/fairness issue worth flagging.

### Just-in-time (JIT) liquidity exposure (LOW)
LPs in concentrated-liquidity pools can be JIT'd. Inform user, not a fix.

### Auction first-price bidding (HIGH)
First-price sealed bids on a public mempool = bid front-run. Use commit-reveal.

### Approve race (MEDIUM)
Classic ERC-20 `approve(spender, X)` → `approve(spender, Y)` front-run lets spender drain `X + Y`. See [[approval-issues]].

## Severity rubric

| 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** |

## Remediation patterns

- Slippage: surface as a user parameter, enforce a sane minimum.
- Deadline: surface as user parameter, never `block.timestamp`.
- Randomness: Chainlink VRF, RANDAO with epoch lookback, or commit-reveal.
- Bid auctions: commit-reveal (hash bid + nonce → reveal after close).
- For high-value flows: support private mempools (Flashbots Protect, MEV-Share, Berachain's BBS).
- Bundle permit + use in single tx.
- ERC-20 approval: prefer `permit` (EIP-2612) or `increaseAllowance`.

## False-positive notes

- Atomic protocol-internal swaps with no user-controlled output token aren't front-runnable.
- Sequenced L2s (Arbitrum One, Base) currently have no public mempool ordering attack — flag risk as L2-conditional.
- Deadline checks that come from a trusted off-chain oracle/router (e.g. CoW Protocol) can be skipped.

## Related

- [[oracle-manipulation]] — sandwich attacks are oracle moves
- [[approval-issues]]
- [[signature-replay]] — replayable signed messages are MEV gold

Attribution

iktok90-designiktok90-design
View sourceSee grades on GitHubMore from iktok90-design →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Nft Standards

Implement NFT standards (ERC-721, ERC-1155) with proper metadata handling, minting strategies, and marketplace integration. Use when creating NFT contracts, building NFT marketplaces, or implementing digital asset systems.

458250 votes

Nft Standards

Implement NFT standards (ERC-721, ERC-1155) with proper metadata handling, minting strategies, and marketplace integration. Use when creating NFT contracts, building NFT marketplaces, or implementing digital asset systems.

401990 votes

vyper-compiler

Vyper smart contract compiler internals. Use when working on the Vyper compiler codebase — compilation pipeline, Venom IR, semantic analysis, code generation, testing, or contributing. Triggers on vyper compiler development, Venom passes, AST/semantics changes, codegen work, or test writing.

51840 votes

Flash Loan Simulator

Simulate flash loan arbitrage strategies and profitability across DeFi protocols. Use when performing crypto analysis. Trigger with phrases like "analyze crypto", "check blockchain", or "monitor market".

27190 votes

On Chain Analytics

Perform on-chain analysis including whale tracking, token flows, and network activity. Use when performing crypto analysis. Trigger with phrases like "analyze crypto", "check blockchain", or "monitor market".

27190 votes
View all in blockchain →