BasketHook on Polygon

Uniswap v4 Hook Contract 0x32aaade8006e549829ffa21b8a8e03bc857a6888 on Polygon · Custom pricing · 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
0

What it does

Traders buy shares for USDT0 and sell shares back at oracle-based NAV, with buys paying a 0.30% mint fee and sells paying a 0.50% redeem fee plus any slippage incurred when the basket must sell assets; LPs cannot add liquidity and the owner can drain or freeze holdings.

How it works step by step

  • Acts as the sole counterparty for the USDT0/SHARE pool: beforeSwap fills every exact-input swap at NAV instead of using pool liquidity
  • Buys: takes USDT0 from the PoolManager, swaps the non-cash portion into basket assets via Uniswap v3 at target weights, and mints shares for the oracle value added minus the mint fee
  • Sells: mints the incoming shares as ERC-6909 claims, pays out USDT0 at NAV minus the redeem fee from the cash buffer first, selling overweight assets via Uniswap v3 if short
  • redeemInKind burns shares and transfers a pro-rata slice of every basket token directly, with no oracle or swap and not subject to pause
  • Uses Chainlink TOKEN/USD feeds with staleness checks to value holdings; managers can rebalance and set weights, the owner manages assets, feeds, paths, fees and freezes
  • Share token (BasketShare) can freeze accounts and the owner can burn a frozen account's shares
Swap behaviour
Buys (USDT0 in, shares out) and sells (shares in, USDT0 out) are both filled by the hook at oracle-based NAV; the pool has no liquidity. Buys pay the mint fee of 0.3% minimum (default 0.30%) plus any swap slippage and oracle lag; sells pay the redeem fee of 0.3% minimum (default 0.50%) plus slippage when a sale of basket assets is needed. Buys revert when paused, sells do not.
Liquidity behaviour
beforeAddLiquidity always reverts (LiquidityLocked), so no LP can add liquidity to the hook pool. Liquidity is represented by the basket holdings themselves; redeemInKind lets holders withdraw a pro-rata slice without swapping.
Fee behaviour
Fees are not dynamic: a mint fee (default 30 bps, bounded 30 to 200 bps) is taken on buys and a redeem fee (default 50 bps, bounded 30 to 200 bps) on sells, both set by the owner via setParams. The pool's own fee is 0. The fees accrue to the basket, raising NAV for remaining holders.
Owner & admin controls
Owner (Ownable2Step, two-step transfer, renounceable): adds and removes assets, sets feeds, swap paths, fee and cap parameters, managers, freezes and burns frozen shares, rescues all basket assets to any address and pauses (rescueAll), rescues stray tokens, initializes the pool. Managers (owner-appointed) and owner: set weights, rebalance and rebalanceAll (oracle-bounded), and pause or unpause buys. No upgradeability proxy is evident.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeAddLiquidity, beforeSwap, beforeSwapReturnDelta

beforeInitialize: restricts pool initialization to this hook (WrongPool otherwise). beforeAddLiquidity: reverts to block all LP additions. beforeSwap: fills every exact-input swap at NAV and returns a before-swap delta so the PoolManager settles against the hook (return delta). beforeSwapReturnDelta: enables the hook to take over the swap amounts.

Security & trust assessment

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

Who controls it: A single owner key can drain all assets (rescueAll), freeze and burn any holder's shares, change fees up to 2%, and replace managers; managers can alter weights and rebalance. Holders have no on-chain protection against these actions.

Risk to user funds: The hook holds all basket tokens and USDT0 cash and moves them on every trade through the PoolManager; users' USDT0 and shares are fully exposed to owner actions (rescueAll, setFrozen, burnFrozen) and to oracle and swap execution.

Security findings

  • [high] Owner can drain all basket assets: rescueAll(to) transfers every basket asset to an arbitrary address and sets paused; shares remain outstanding but unbacked, as the contract comment states this is a test version.
  • [high] Owner can freeze and burn user shares: setFrozen blocks transfers of any non-special account's shares and burnFrozen(account) burns the full balance, removing holder claims on the basket with no user consent.
  • [medium] Hook takes custody and moves user funds: The hook holds the basket and cash, and beforeSwap uses return deltas and PoolManager take/settle to move user USDT0 and shares; price and slippage depend on Chainlink feeds and router minimums, so oracle failure or manipulation affects trades.
  • [medium] Managers can trade and rebalance the treasury: Managers can call rebalance, rebalanceAll and setWeights, executing Uniswap swaps with up to maxSlippageBps (max 5%) of slippage per trade, a path for value leakage through bad execution.
  • [info] Buys can be paused by managers: setPaused by owner or managers stops buys (IsPaused); sells and redeemInKind remain available, which limits lock-in risk.

Contract details

Verified source
Yes (BasketHook)
Compiler
solc 0.8.26+commit.8a97fa7a
Bytecode size
23,445 bytes
Upgradeable proxy
No
Detected patterns
dynamic-fee, erc20, liquidity-management, moves-currency, ownable, pausable, return-delta, self-unlock

Pools using BasketHook