freecoding.school100% FREE · NO SIGNUP
Ledger LandISSUE #88 of 90

front-running · sandwiching · countermeasures

BlockyVSDouble-Spend Dan
Blocky saysFront-running and sandwiching are on-chain attacks; mitigate with slippage limits and private RPCs.

Because pending transactions are public and ordering is for sale, your swap can be front-run or sandwiched (bc-57). User-side defenses: set tight slippage tolerance (cap how much price can move), submit through a private RPC/Flashbots Protect so bots can't see the trade, use commit-reveal schemes for sensitive ops, and avoid telegraphing large trades. Protocol designers add slippage checks and batch auctions.

Power-ups you unlock

Double-Spend Dan attacks — common mistakes

Boss battleList two user-side and one protocol-side defense against sandwiching.

Example code

<!doctype html><html><head><meta charset="utf-8"></head>
<body style="background:#06040d;color:#e6e0ff;font-family:monospace;padding:20px"><pre>user: tight slippage + private RPC
protocol: slippage checks, batch auctions
→ less sandwichable</pre></body></html>
▶ Open the interactive comic issue
‹ Audits · Slither · Mythril · Manual ReviewRegulation · Sec · Mica · Privacy Lines ›