HookNewEvents on Blast

Uniswap v4 Hook Contract 0xbf6f850784fe4f3e3865d9c9dbf2fa8f5bf68880 on Blast · Rewards · 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
1

What it does

A test or demo hook that emits descriptive events around liquidity additions and swaps without changing pricing, fees or liquidity for traders and LPs.

How it works step by step

  • Enables beforeAddLiquidity and beforeSwap callbacks only
  • beforeAddLiquidity decodes optional amounts and emits HookModifyLiquidity
  • beforeSwap decodes optional amounts and LP fee amounts and emits HookSwap
  • Returns zero BeforeSwapDelta and zero fee override, so pool economics are unchanged
  • Provides helper swap and modifyLiquidity entry points that use the PoolManager unlock flow to settle and take deltas
  • Exposes public functions that emit arbitrary hook events for testing or indexing
Swap behaviour
beforeSwap decodes optional caller data and emits a HookSwap event; it returns a zero delta and no fee override, so swap execution is unchanged.
Liquidity behaviour
beforeAddLiquidity decodes optional caller-supplied data and emits a HookModifyLiquidity event; it does not alter liquidity amounts. A helper modifyLiquidity entry point routes liquidity changes through the PoolManager unlock flow and settles or takes the resulting deltas for the sender.
Fee behaviour
Does not set or take fees itself; beforeSwap returns a zero delta and a zero fee override, so the pool's static fee applies. The callHookFee and HookSwap event paths only emit informational events.
Owner & admin controls
No admin controls found.

Enabled Uniswap v4 callbacks

beforeAddLiquidity, beforeSwap

beforeAddLiquidity: emits an event recording caller-supplied additional amounts. beforeSwap: emits an event recording caller-supplied additional amounts and LP fee amounts. All other callbacks are disabled.

Security & trust assessment

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

Who controls it: No owner or privileged role is defined; the hook has no admin functions. Anyone can call the public event-emitting functions (callHookFee, callHookModifyLiquidity, callHookBonus, callSwap), which can emit arbitrary HookFee, HookBonus, HookModifyLiquidity and HookSwap events with any pool id and amounts, so these events are not trustworthy as a record of real pool activity.

Risk to user funds: The hook callbacks do not move or hold pool funds. The helper swap and modifyLiquidity functions settle and take tokens against the PoolManager on behalf of the caller, and any stray ETH in the contract is returned to the caller, so user funds are handled only transiently during the caller's own operation.

Security findings

  • [medium] Unrestricted event-emitting functions: callHookFee, callHookModifyLiquidity, callHookBonus and callSwap are unrestricted external functions that emit events with arbitrary parameters, so off-chain indexers consuming these events can be spoofed.
  • [low] Shared mutable routing flags: The contract uses storage flags isSwap and isModifyLiq shared across calls; if a callback reverts or a flag is left set, subsequent unlockCallback routing can be misdirected, and the flags are not reset on the modify path failure.
  • [low] ETH refund to caller: The swap and modifyLiquidity entry points forward any ETH balance held by the contract to msg.sender, and the contract is not designed to hold user funds beyond transient settlement.
  • [info] No fund custody in hook callbacks: The hook returns zero deltas and does not take or hold pool tokens in its callbacks, so it does not block or redirect user funds through the hook path.

Contract details

Verified source
Yes (HookNewEvents)
Compiler
solc 0.8.26+commit.8a97fa7a
Bytecode size
10,332 bytes
Upgradeable proxy
No
Detected patterns
erc6909-claims, moves-currency, self-unlock

Pools using HookNewEvents