HbnbMasterHook on BNB Chain

Uniswap v4 Hook Contract 0x3b2efc2ed5b00f8ae7bdd3311b8fb02c131768cc on BNB Chain · Custom pricing · Verified contract

Volume (24h)
$4.73
Value locked (TVL)
$1.19K
All-time volume
$102.79K
Pools using this hook
1
Swaps (24h)
1 (1 traders)
Total swaps
5,424

What it does

A shared Uniswap v4 hook on BNB Chain that routes each registered HBNB token pool to its own economy contract, enforcing exact-input sells and collecting a quote-token toll on swaps.

How it works step by step

  • Maps each PoolId to a registered economy contract deployed by the immutable factory, rejecting unauthorized or duplicate registrations.
  • Blocks liquidity additions from any sender other than the pool's economy, so only the protocol-managed POL and Hook Wall positions exist.
  • Forces a zero LP fee and routes before-swap specified and unspecified deltas through PoolManager mint and burn.
  • Requires sells to be exact-input and reverts with PartialSellFill or ZeroSellOutput when input is not fully consumed or output is zero.
  • Returns a quote-token toll from afterSwap as a return delta, bounded by the bid quote and pool quote movement, and mints it to the economy.
Swap behaviour
beforeSwap delegates to the pool's economy, forces a zero LP fee, and settles deltas through PoolManager mint and burn; afterSwap rejects sells that do not fill the full input or produce zero output, then takes a toll via return delta.
Liquidity behaviour
beforeAddLiquidity only permits liquidity additions where the sender is the pool's registered economy contract; third-party LPs are rejected. Genesis POL and Hook Wall positions are therefore managed exclusively by the economy.
Fee behaviour
The hook returns a zero LP fee override from beforeSwap and requires the pool fee to be 0. Revenue comes from a quote-denominated toll returned by afterSwap via return delta, which the hook mints to the economy contract.
Owner & admin controls
No owner or pause function on the master hook; registration is restricted to the immutable factory address and each pool's economy contract is fixed at registration. Economy contracts are fixed-code deployments by the factory; per-pool parameters are set in the economy, not in the master hook.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeAddLiquidity, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta

beforeInitialize validates pool initialization via the economy; beforeAddLiquidity restricts adds to the economy; beforeSwap delegates to the economy, enforces sign and amount bounds, and settles specified/unspecified deltas through PoolManager mint and burn; afterSwap enforces exact-input sells, rejects zero output, and collects a quote toll through a return delta; beforeSwapReturnDelta and afterSwapReturnDelta allow the hook to take or return currency during swaps.

Security & trust assessment

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

Who controls it: No admin key is present in the master hook; there is no pause, upgrade or parameter setter. Behaviour is determined by the immutable factory and the per-pool economy code, so trust sits in that deployment logic rather than in an owner.

Risk to user funds: The hook can take or return quote and token currency through PoolManager accounting on every swap and holds burn/mint rights over its own pool claims. Users are exposed to the economy contract's fixed logic and to these return-delta settlements, but no admin can directly redirect funds.

Security findings

  • [info] Exact-input sell enforcement can revert swaps: afterSwap requires an exact-input sell fill and reverts with PartialSellFill or ZeroSellOutput if any input is left unspent, so sells against thin or empty liquidity can fail rather than partially fill.
  • [medium] Hook moves pool balances through return deltas: beforeSwap takes quote tokens via manager.burn from the hook and mints the hook's accounting to the economy, and afterSwap mints a toll to the economy; the hook holds accounting claims on PoolManager and the economy controls how they are used.
  • [info] Logic delegated to economy contracts not reviewed: Economy contracts are deployed by the factory with fixed code, and registration validates the economy's bindings and the pool key, but the economy's own internal logic was not analysed here beyond the interface.

Contract details

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

Pools using HbnbMasterHook