FairTradeHook on Ethereum
Uniswap v4 Hook Contract 0x62ee80f068dce30ea4a275e91bb733fb17fd0ac0 on Ethereum · MEV protection · Verified contract
- Volume (24h)
- $5.20
- Value locked (TVL)
- $2.07
- All-time volume
- $2.84M
- Pools using this hook
- 5
- Swaps (24h)
- 3 (3 traders)
- Total swaps
- 25,631
What it does
A swap guard for Uniswap v4 pools that blocks flagged addresses, enforces a per-address cooldown and rejects repeat swaps by the same sender in one block to limit bot and sandwich trading.
How it works step by step
- beforeSwap reverts with BotBlocked for addresses flagged in blockedAddresses.
- beforeSwap reverts with SandwichDetected if the same sender swapped earlier in the same block.
- beforeSwap reverts with CooldownNotMet if less than swapCooldown seconds (default 15) have passed since the sender's last swap.
- Owner can bulk-update the blocklist and set the cooldown up to 60 seconds.
- Liquidity add and remove callbacks are enabled but only return their selectors without checks.
- afterSwap is enabled but returns zero delta and has no effect.
- Swap behaviour
- On every swap, beforeSwap reverts if the sender is on the owner-managed blocklist, if the sender already swapped in the current block, or if the cooldown since the sender's last swap has not elapsed; otherwise it stores the sender's block and timestamp. afterSwap does nothing.
- Liquidity behaviour
- beforeAddLiquidity and beforeRemoveLiquidity simply return their selectors; they perform no checks despite the LiquidityImbalance error being declared and no logic enforcing it. No liquidity deltas are altered.
- Fee behaviour
- Uses the pool's static fee. The hook never returns a fee override and takes no fee itself.
- Owner & admin controls
- Owner (set at deployment, Ownable) can add or remove addresses from the blockedAddresses list via updateBlockedAddress and updateBlockedAddresses, which blocks those addresses from swapping, and can change swapCooldown via updateCooldown up to a maximum of 60 seconds. Owner can also transfer or renounce ownership. No pausing, upgrade proxy, or fee-setting controls were found.
Enabled Uniswap v4 callbacks
beforeAddLiquidity, beforeRemoveLiquidity, beforeSwap, afterSwap
beforeAddLiquidity and beforeRemoveLiquidity are enabled but do nothing beyond returning their selector. beforeSwap enforces blocklist, same-block and cooldown checks and records per-sender block and timestamp. afterSwap is enabled but returns the selector with zero delta. No return-delta permissions are enabled.
Security & trust assessment
Risk level: medium (verified source, high confidence).
Who controls it: The owner can block any address from swapping in this pool and can set the cooldown between 0 and 60 seconds. The owner cannot move user funds, change fees, or alter swap amounts, but can selectively deny trading access to wallets.
Risk to user funds: The hook does not hold, custody or move pool or user funds and takes no fee or return delta. The main exposure is denial of service: the owner or a compromised owner key can prevent specific addresses from swapping in pools that use this hook.
Security findings
- [medium] Owner-controlled swap blocklist: Owner can add any address to blockedAddresses, causing beforeSwap to revert with BotBlocked for that address; there is no timelock or appeal mechanism.
- [medium] Per-sender limits may block routers and aggregators: beforeSwap reverts if the same sender already swapped in the current block, and enforces a cooldown measured per sender address, not per pool or per trade. Routers and contracts that batch many users may be blocked or throttled because the check keys on msg.sender.
- [medium] Sandwich protection is weak: The same-block check only stops a sender from making two swaps in one block, which does not prevent sandwich attacks executed by different addresses or by MEV bots that rotate addresses; the protection is largely cosmetic against sophisticated MEV.
- [low] Liquidity hooks are no-ops: beforeAddLiquidity and beforeRemoveLiquidity are enabled but contain no logic, and the LiquidityImbalance error is declared but never used. The hook does not protect LPs.
- [info] Single owner key: Owner is a single EOA or address set at deployment with no timelock; the owner can renounce or transfer ownership at any time.
Contract details
- Verified source
- Yes (FairTradeHook)
- Compiler
- solc 0.8.26+commit.8a97fa7a
- Bytecode size
- 4,191 bytes
- Upgradeable proxy
- No
- Detected patterns
- mev-protection, ownable
Pools using FairTradeHook
- ETH / RALLY (0.30% fee) — 24h volume $5.20, TVL $2.06, 3 swaps today
- ETH / GROW (0.01% fee) — 24h volume $0, TVL <$0.01, 0 swaps today
- ETH / GROW (0.30% fee) — 24h volume $0, TVL $0, 0 swaps today
- RALLY / USDT (0.30% fee) — 24h volume $0, TVL $0, 0 swaps today
- GROW / USDT (0.30% fee) — 24h volume $0, TVL $0, 0 swaps today