FewUSDTHook on Ethereum
Uniswap v4 Hook Contract 0xbadf77d50478b4432ef1f243b9c0bc7869486888 on Ethereum · Token · 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
- 668
What it does
A wrapper hook that lets a Uniswap v4 pool swap between USDT and fewUSDT at a fixed 1:1 rate by wrapping or unwrapping inside the swap.
How it works step by step
- Accepts only a pool whose two currencies are USDT and fewUSDT, with fee 0, during initialisation.
- Allows liquidity to be added to such a pool without restriction.
- On swaps, wraps USDT into fewUSDT or unwraps fewUSDT into USDT, depending on swap direction.
- Settles the resulting tokens with the pool manager and returns a before-swap delta that fixes the swap at 1:1.
- Approves fewUSDT to spend the hook's USDT using a forced approve to support USDT's non-standard approve.
- Swap behaviour
- beforeSwap converts the input token to the output token by calling fewUSDT wrap or unwrap, then returns a before-swap delta so the pool records a 1:1 trade without running its AMM curve.
- Liquidity behaviour
- Only beforeAddLiquidity is enabled and it unconditionally allows liquidity addition. Removal is not hooked.
- Fee behaviour
- Pool must be initialised with fee 0 (enforced in beforeInitialize). The hook charges no fee; swaps are 1:1 wrap/unwrap with no fee deducted.
- Owner & admin controls
- No admin controls found. No owner, pause, upgrade or parameter-setter functions; the wrapped token and underlying currency are immutable, set in the constructor.
Enabled Uniswap v4 callbacks
beforeInitialize, beforeAddLiquidity, beforeSwap, beforeSwapReturnDelta
beforeInitialize validates the pool pair and zero fee; beforeAddLiquidity allows all liquidity additions; beforeSwap performs the wrap or unwrap of USDT and fewUSDT and returns a before-swap delta so the pool does not execute the swap itself; beforeSwapReturnDelta is required for that delta.
Security & trust assessment
Risk level: medium (verified source, high confidence).
Who controls it: No privileged role exists, so no single key can change behaviour. The fewUSDT and USDT addresses are fixed at deployment, so trust is placed in the fewUSDT contract's wrap and unwrap functions being honest and 1:1.
Risk to user funds: The hook temporarily holds USDT and fewUSDT while executing swaps and can settle or take pool funds through the pool manager. Funds are exposed to the fewUSDT contract's correctness, but there is no admin path to withdraw them.
Security findings
- [medium] Swaps depend on external fewUSDT wrap/unwrap: beforeSwap takes the input from the pool manager and settles the output through external fewUSDT wrap/unwrap calls, so all swaps depend on the fewUSDT contract behaving 1:1.
- [medium] Return delta bypasses pool pricing: The hook returns a before-swap delta that overrides the pool's AMM execution, so it fully determines swap amounts for this pool.
- [low] Swaps can revert if the hook's token balance is short: The hook must hold USDT or fewUSDT balances to serve swaps; it is not clear from the code how these balances are funded, and a shortfall causes InsufficientBalance reverts that block swaps.
- [info] 1:1 assumption enforced by revert checks: Wrap and unwrap amounts are assumed 1:1 and the result is checked against the input amount, but the check happens after the external call, so a misbehaving fewUSDT contract would revert rather than allow silent loss.
Contract details
- Verified source
- Yes (FewUSDTHook)
- Compiler
- solc 0.8.26+commit.8a97fa7a
- Bytecode size
- 6,552 bytes
- Upgradeable proxy
- No
- Detected patterns
- return-delta
Pools using FewUSDTHook
- USDT / fwUSDT (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today