FewTokenHook on Ethereum

Uniswap v4 Hook Contract 0x134974e0b914728aa13cc550af0adcb557356888 on Ethereum · Utility · Verified contract

Volume (24h)
$0
Value locked (TVL)
$0
All-time volume
$0
Pools using this hook
1
Swaps (24h)
0 (0 traders)
Total swaps
5

What it does

Lets traders swap between a token and its fewToken wrapper at a fixed 1:1 rate inside a zero-fee Uniswap v4 pool, wrapping or unwrapping on each swap.

How it works step by step

  • Validates in beforeInitialize that the pool holds exactly the underlying token and the fewToken with a zero fee tier
  • Converts each swap into a wrap (underlying to fewToken) or unwrap (fewToken to underlying) call on the fewToken contract
  • Returns a custom BeforeSwapDelta so the swap settles at 1:1 instead of using AMM pricing
  • Settles the wrapped or unwrapped output back to the pool manager through take and settle
  • Allows liquidity addition to the pool through beforeAddLiquidity without extra checks
  • Reverts with generic messages if the pool pair or fee is invalid
Swap behaviour
Each swap is handled by the hook: if the swap direction matches wrapZeroForOne the underlying token is taken and wrapped into fewToken, otherwise fewToken is taken and unwrapped; the pool price is bypassed and a 1:1 amount is returned.
Liquidity behaviour
beforeAddLiquidity only permits liquidity addition with no extra logic; beforeRemoveLiquidity, afterAddLiquidity and afterRemoveLiquidity are not enabled.
Fee behaviour
Pool fee must be 0 (enforced in beforeInitialize); the hook charges no fee and the swap is a 1:1 wrap or unwrap.
Owner & admin controls
No admin controls found. fewToken, wrapperCurrency, underlyingCurrency and wrapZeroForOne are immutable and set in the constructor; there is no owner, pause or upgrade path in the source.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeAddLiquidity, beforeSwap, beforeSwapReturnDelta

beforeInitialize validates the pool pair and zero fee; beforeAddLiquidity allows liquidity adds; beforeSwap performs the wrap or unwrap of the underlying token against the fewToken and returns a custom swap delta (beforeSwapReturnDelta) so the pool manager is settled by the hook instead of the pool's own AMM math.

Security & trust assessment

Risk level: low (verified source, high confidence).

Who controls it: No privileged key is present in the source, so no single account can change fees, pause swaps or move funds.

Risk to user funds: The hook temporarily holds underlying or fewToken during each swap and can hold residual balances if transfers leave dust; it does not expose an owner withdrawal, but the max approval to fewToken means the security of user funds is tied to the fewToken contract.

Security findings

  • [medium] Custom swap delta depends on external wrapper: beforeSwapReturnDelta lets the hook take input and settle output itself, bypassing the pool's normal pricing; correctness depends entirely on the external fewToken wrap and unwrap returning 1:1 amounts.
  • [medium] Unlimited approval to fewToken: The constructor approves fewToken for max uint256 of the underlying token, so a compromised or malicious fewToken contract could drain any underlying balance held by the hook.
  • [info] Fixed 1:1 wrapping: Swaps are 1:1 and the hook itself holds no reserves beyond in-flight amounts, so the pool's liquidity is what backs the wrapped asset; the hook is not an AMM and does not price risk.

Contract details

Verified source
Yes (FewTokenHook)
Compiler
solc 0.8.26+commit.8a97fa7a
Bytecode size
6,536 bytes
Upgradeable proxy
No
Detected patterns
return-delta

Pools using FewTokenHook