PubhouseHook on Base

Uniswap v4 Hook Contract 0x4ab61d774b170d0610fdcc5559aae2c356c600c8 on Base · Fee sharing · Verified contract

Volume (24h)
$0
Value locked (TVL)
$1.71K
All-time volume
$9.40M
Pools using this hook
1,216
Swaps (24h)
0 (0 traders)
Total swaps
19,300

What it does

Routes the fees earned by a token pool back to its creator and the Pubhouse team, and uses a portion to buy back and burn the protocol token.

How it works step by step

  • Claims accrued fees from a position through the position manager after each swap.
  • Splits claimed ETH into a buyback allocation and a distributable portion.
  • Sends the protocol share to teamWallet and the remaining share to the token creator.
  • Fills part of incoming ETH-for-token buys from the hook's accumulated token fees via an internal swap.
  • Buys the protocol token with pending ETH in multiples of 0.05 ETH and burns it.
  • Lets the owner configure reward percentages, team wallet, and the protocol token pool.
Swap behaviour
On ETH-for-token buys, beforeSwap fills part of the swap from the hook's accumulated fee balances via an internal swap and adjusts the swap delta. On every swap, afterSwap claims liquidity fees, distributes ETH to the team and creator, and triggers a buyback and burn when pending buyback ETH reaches the threshold.
Liquidity behaviour
No liquidity callbacks. The hook interacts with a liquidity position it was assigned (positionId) by decreasing liquidity to collect fees during swaps, but it does not hook liquidity additions or removals.
Fee behaviour
Each swap triggers _afterSwap, which claims accrued fees from a liquidity position via the position manager. Of the ETH claimed, buybackReward percent is set aside into buyBackPendingFees for protocol token buybacks. The remainder is split into a protocol share (protocolReward percent, sent to teamWallet) and a creator share (sent to the token's creator). The hook sets no swap fee itself; it returns a zero swap fee.
Owner & admin controls
Owner (initially the team wallet) can call updateRewardSplit to change protocolReward and buybackReward (summing to at most 100), updateTeamWallet to redirect the protocol fee share, and setProtocolTokenHook to set the protocol token and its buyback pool key. Owner or the Pubhouse factory can call initTokenData to register token position data. Ownership can be transferred or renounced via Ownable. No pause or upgrade mechanism was found.

Enabled Uniswap v4 callbacks

beforeSwap, afterSwap, beforeSwapReturnDelta

beforeSwap: routes incoming ETH-for-token buys through an internal swap that consumes the hook's accumulated ETH fees and token fees before the pool swap. afterSwap: claims and distributes position fees and runs the protocol token buyback when the threshold is reached. beforeSwapReturnDelta: lets the hook return a delta that offsets the external swap amount to account for the internal fill.

Security & trust assessment

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

Who controls it: The owner controls reward percentages (up to 100% combined is allowed, which would leave the creator share at zero if protocolReward plus buybackReward equals 100 and the remainder is zero), and can redirect the team share by changing teamWallet. The owner can also point the buyback at any protocol token via setProtocolTokenHook. Owner can renounce ownership.

Risk to user funds: The hook can hold ETH and protocol tokens accrued from fee claims and can consume them to fill swaps through beforeSwapReturnDelta. Users trading into the pool can be filled by hook-held inventory. Fees are forwarded to teamWallet and creators on every swap, and buyback tokens are burned, so the hook is in the custody path for pool fees but not for LP principal held in the position.

Security findings

  • [medium] Hook takes and settles currency during swaps: The hook takes ownership of the pool's ETH and token fees and can fill swaps itself using accumulated fees, altering the amount traders receive through beforeSwapReturnDelta.
  • [low] Buyback executed inside swap path: afterSwap claims liquidity fees and performs a buyback swap and burn on every swap once the threshold is met, so swap gas and outcomes depend on hook state.
  • [medium] Owner can redirect fee split: updateRewardSplit allows the owner to set the protocol share and buyback share to any values summing to 100, and updateTeamWallet can redirect the protocol share to any address without a timelock.
  • [low] Buyback relies on single pool price: The buyback swap uses a fixed 5% slippage limit but no minimum output, and the fee tier and tick spacing for protocolTokenKey are hardcoded at setup, so a poorly chosen or manipulated pool could yield little for the burn.
  • [info] Payable admin setter and reentrancy-sensitive ordering: setProtocolTokenHook is payable and unguarded beyond onlyOwner, and the internal token fee counter is reset in buyback before the swap, which relies on the pool manager's unlock context for safety.

Contract details

Verified source
Yes (PubhouseHook)
Compiler
solc 0.8.26+commit.8a97fa7a
Bytecode size
21,626 bytes
Upgradeable proxy
No
Detected patterns
erc6909-claims, moves-currency, ownable, return-delta, rewards

Pools using PubhouseHook