Access control hook on BNB Chain

Uniswap v4 Hook Contract 0x4ebab0d38d9e4ef3dfdabc12a09c75a4edcd8080 on BNB Chain · Access control

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

What it does

This hook restricts swaps in the pool to an owner-managed allowlist when gating is enabled, so only approved addresses can trade while other users' swaps revert and fees remain the pool's static fee.

How it works step by step

  • Implements only the beforeSwap callback, which reverts or permits swaps based on an allowlist
  • Stores an owner address in slot 0 that is checked against caller-restricted functions (NotOwner error present)
  • Holds a boolean gate flag in slot 0 (offset 20) that the owner toggles via setGated
  • Holds a mapping of addresses to allowed booleans in slot 1, updated by setAllowed
  • Checks that the caller is the pool manager (NotPM error present) before executing beforeSwap logic
Swap behaviour
beforeSwap reads the gate flag and the allowlist mapping for the swapping address; when gating is enabled and the sender is not allowed, the swap is expected to revert, otherwise it proceeds with no change to amounts or fees. The hook returns no delta and does not alter the swap.
Liquidity behaviour
No liquidity callbacks.
Fee behaviour
Uses the pool's static fee.
Owner & admin controls
The owner (slot 0) can toggle the gated flag via setGated and add or remove addresses from the allowlist via setAllowed. Ownership is a single address; no pause, upgrade or transfer-ownership selector was observed in the dispatch table.

Enabled Uniswap v4 callbacks

beforeSwap

beforeSwap is enabled and is used to gate which addresses may swap in the pool.

Security & trust assessment

Risk level: medium, estimated (decoded bytecode, medium confidence).

Who controls it: A single owner key can switch swap access on or off for the entire pool and decide which addresses can trade, effectively controlling who can use the liquidity.

Risk to user funds: The hook does not take custody of tokens or modify deltas, so it cannot directly move user or pool funds. However, it can block swaps for non-allowlisted users, which affects access to pool liquidity.

Security findings

  • [medium] Owner-controlled swap gating: The owner can enable gating and restrict swaps to allowlisted addresses, which can block all but chosen traders from using the pool. The owner can also rewrite the allowlist at any time.
  • [low] No ownership transfer observed: Only owner() is exposed among ownership functions; no transferOwnership or renounce selector was found, so the owner key is effectively permanent and a lost key would freeze the admin configuration.
  • [info] Pool manager caller check: The NotPM error indicates beforeSwap is restricted to the pool manager, preventing arbitrary direct invocation.

Contract details

Verified source
No
Bytecode size
1,225 bytes
Upgradeable proxy
No
Detected patterns
access-control, ownable

Pools using Access control hook