FairTradeHook on Ethereum
Uniswap v4 Hook Contract 0xede8ec3dbb11055a736612e174ab7b0b41028ac0 on Ethereum · Access control · Verified contract
- Volume (24h)
- $873
- Value locked (TVL)
- $2.42K
- All-time volume
- $2.11M
- Pools using this hook
- 13
- Swaps (24h)
- 34 (23 traders)
- Total swaps
- 54,192
What it does
A swap-blocklist hook: the owner can block specific addresses from swapping in pools that use it, and blocked addresses' swaps revert. It takes no fees and holds no funds.
How it works step by step
- Keeps an owner-managed mapping, blockedAddresses, of addresses that are not allowed to swap.
- In beforeSwap, if the sender is blocked the call reverts with BotBlocked; otherwise the swap proceeds with a zero delta and no fee override.
- The owner can block or unblock one address (updateBlockedAddress) or many at once (updateBlockedAddresses).
- beforeAddLiquidity and beforeRemoveLiquidity only return their selectors and do not check the blocklist, so blocked addresses can still add or remove liquidity.
- afterSwap is a no-op that returns its selector and a zero delta.
- Swap behaviour
- beforeSwap reverts with BotBlocked when the sender (the address calling the PoolManager) is in blockedAddresses. Otherwise it returns a zero delta and no fee override. afterSwap does nothing.
- Liquidity behaviour
- beforeAddLiquidity and beforeRemoveLiquidity return their selectors with no checks and no deltas. Liquidity actions are not restricted by the blocklist.
- Fee behaviour
- Uses the pool's static fee. The hook returns a zero fee override and takes no fees.
- Owner & admin controls
- The owner (set in the constructor, managed through Ownable) can add or remove addresses from the swap blocklist and can transfer or renounce ownership. There is no pause, no upgrade mechanism (the contract is not a proxy), and no fee or parameter setting beyond the blocklist.
Enabled Uniswap v4 callbacks
beforeAddLiquidity, beforeRemoveLiquidity, beforeSwap, afterSwap
beforeSwap: gates swaps against the owner-managed blocklist. afterSwap: present but a no-op. beforeAddLiquidity and beforeRemoveLiquidity: present but only return their selectors. Return-delta permissions are all disabled, so the hook cannot take or give tokens through deltas.
Security & trust assessment
Risk level: medium (verified source, high confidence).
Who controls it: The owner can instantly prevent any chosen address from swapping in pools using this hook. The owner cannot move funds, change fees, or stop liquidity actions. Ownership can be transferred or renounced at any time.
Risk to user funds: The hook does not hold, move, or block pool funds directly. It can block swaps, which affects which users can trade, but it does not lock assets: liquidity removal is never blocked, and swaps are the only thing that can be prevented.
Security findings
- [medium] Owner can block addresses from swapping: updateBlockedAddress and updateBlockedAddresses are onlyOwner, and beforeSwap reverts with BotBlocked for any sender in the mapping. A single owner key can stop chosen addresses from swapping in every pool using this hook.
- [info] Blocklist keys on the immediate caller: beforeSwap checks the sender the PoolManager passes in, which is the address that called swap. Users routing through a router contract are checked against the router's address, not their own, so blocking an EOA may not stop it from trading through a router, and blocking a router blocks all of its users.
- [info] Blocklist does not cover liquidity actions: beforeAddLiquidity and beforeRemoveLiquidity return selectors without checking blockedAddresses. Blocked addresses can still add and remove liquidity, which may matter if the blocklist is meant to stop all participation.
- [info] No fund custody or delta control: All return-delta permission flags are false, the hook returns zero deltas, and it takes no fees. It does not hold or move user or pool funds.
- [low] Single-owner key with no timelock visible: Ownership is a plain Ownable with a single owner, and the source shows no timelock, multisig requirement, or delay on blocklist changes. The owner's identity and key management are not shown in the input.
Contract details
- Verified source
- Yes (FairTradeHook)
- Compiler
- solc 0.8.26+commit.8a97fa7a
- Bytecode size
- 3,758 bytes
- Upgradeable proxy
- No
- Detected patterns
- ownable
Pools using FairTradeHook
- ETH / RALLY (0.30% fee) — 24h volume $873, TVL $2.42K, 34 swaps today
- GROW / USDT (0.30% fee) — 24h volume $0, TVL <$0.01, 0 swaps today
- GROW / RALLY (0.30% fee) — 24h volume $0, TVL $0, 0 swaps today
- RALLY / SWITCH (0.30% fee) — 24h volume $0, TVL $0, 0 swaps today
- WIN / GREEN (0.30% fee) — 24h volume $0, TVL $0, 0 swaps today
- RALLY / ELMT (0.30% fee) — 24h volume $0, TVL $0, 0 swaps today
- ETH / GROW (0.30% fee) — 24h volume $0, TVL <$0.01, 0 swaps today
- SWITCH / IZE (0.30% fee) — 24h volume $0, TVL $0, 0 swaps today
- GROW / ELMT (0.30% fee) — 24h volume $0, TVL $0, 0 swaps today
- GROW / IZE (0.30% fee) — 24h volume $0, TVL $0, 0 swaps today
- GROW / SWITCH (0.30% fee) — 24h volume $0, TVL $0, 0 swaps today
- ELMT / SWITCH (0.30% fee) — 24h volume $0, TVL $0, 0 swaps today
- WIN / SWITCH (0.30% fee) — 24h volume $0, TVL $0, 0 swaps today