ShadowSwap

Anti-MEV dark pool using commit-reveal batch swaps, built as a Uniswap v4 hook on Sepolia

ShadowSwap

Created At

HackMoney 2026

Project Description

ShadowSwap is an anti-MEV dark pool built as a Uniswap v4 hook. It uses a commit-reveal batch scheme to protect traders from frontrunning and sandwich attacks.

When you swap on a DEX, your transaction is visible in the mempool before execution. MEV bots exploit this by buying before you (driving the price up) and selling after. This costs DeFi users billions annually.

ShadowSwap solves this in three phases: COMMIT: Traders deposit tokens and submit only a keccak256 hash. The destination token and slippage are completely hidden on-chain. REVEAL: After the commit window closes, traders reveal their swap parameters. The contract verifies each reveal matches the original hash. EXECUTE: All revealed swaps execute together in a single atomic batch through Uniswap v4 — no preferred ordering, no MEV extraction possible.

The beforeSwap hook enforces that all swaps must go through the batch mechanism. Direct swaps are blocked at the protocol level.

How it's Made

Smart Contract: 520-line Solidity contract implementing IHooks from Uniswap v4-core. Uses beforeSwap hook to enforce commit-reveal batching. Built with Foundry, OpenZeppelin ReentrancyGuard and SafeERC20. 23 tests passing including fuzz tests.

Frontend: React + Wagmi v2 + Viem. Real-time countdown timer, localStorage commit tracking with cross-component sync, automatic Etherscan links for every transaction.

background image mobile

Join the mailing list

Get the latest news and updates

ShadowSwap | ETHGlobal