PositionManager on Base

Uniswap v4 Hook Contract 0x51bba15255406cfe7099a42183302640ba7dafdc on Base · Launchpad · Verified contract

Volume (24h)
$0
Value locked (TVL)
$0
All-time volume
$96.84M
Pools using this hook
4,764
Swaps (24h)
115 (54 traders)
Total swaps
291,820

What it does

A launchpad hook that flaunches a memecoin into a Uniswap v4 pool with a 30-minute fair launch window, a BidWall that defends price with accumulated ETH fees, and a fee distribution system that routes swap fees to creators, treasury and protocol.

How it works step by step

  • Creates the memecoin and ERC721 ownership and initializes the pool with the hook as its hook, blocking direct external initialization
  • Runs a 30-minute fair launch window with a single-sided position where buys fill from the position and sells are blocked
  • Takes swap fees via return deltas on both internal and Uniswap swaps and splits them between creator, BidWall, treasury and protocol
  • Deposits ETH fees into a single-sided BidWall one tick below spot that is rebalanced when a threshold is crossed
  • Performs internal swaps of accumulated token fees against the pool before the external swap
  • Emits pool state and swap events and notifies subscribers after each callback
Swap behaviour
During the fair launch window, buy swaps are filled from the fair launch position and sell swaps are blocked. Token fees accumulated by the hook are internally swapped before the Uniswap swap. A swap fee is taken on each swap via return deltas and then distributed.
Liquidity behaviour
Liquidity can only be added or removed by the BidWall or FairLaunch contracts while the fair launch window is open; other callers are reverted with CannotModifyLiquidityDuringFairLaunch. After the window ends, anyone can modify liquidity. The BidWall places single-sided ETH liquidity one tick below spot and is rebalanced on each threshold deposit.
Fee behaviour
Swap fees are charged via the afterSwap return delta on Uniswap swaps and on internal swaps, then split by FeeDistributor: a creator allocation, a BidWall allocation, a treasury allocation and a protocol allocation, with an optional referrer share paid directly. Fees are distributed once they exceed MIN_DISTRIBUTE_THRESHOLD (0.001 ETH). The pool's own static fee is set to 0 and the swap fee is returned through hook deltas.
Owner & admin controls
Owner (protocol owner, Ownable via Solady with two-step ownership handover) can set the flaunch contract, the initial price calculator, fee calculators, fee distribution (global and per-pool), protocol fee allocation, referral escrow, and the BidWall swap fee threshold; the BidWall creator can disable or enable their BidWall. Ownership can be renounced or transferred.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeAddLiquidity, afterAddLiquidity, beforeRemoveLiquidity, afterRemoveLiquidity, beforeSwap, afterSwap, afterDonate, beforeSwapReturnDelta, afterSwapReturnDelta

beforeInitialize blocks direct pool initialization from outside the hook. beforeAddLiquidity and beforeRemoveLiquidity enforce the fair launch lock. beforeSwap handles scheduled-launch premine checks, fills swaps from the fair launch position, and performs internal swaps of accumulated token fees. afterSwap captures and distributes fees and emits events. afterAddLiquidity, afterRemoveLiquidity and afterDonate emit state update events and notify subscribers. beforeSwapReturnDelta and afterSwapReturnDelta let the hook take fees and fill swaps.

Security & trust assessment

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

Who controls it: The owner can point flaunchContract, initialPrice and fee calculators at arbitrary contracts, change fee distribution and the protocol fee recipient, and thereby redirect or raise the share of swap fees that goes to the protocol, creators or treasury. Creator-facing BidWall disabling and treasury routing are controlled by the owner-set distribution parameters. The contract is not upgradeable (no proxy in the verified source).

Risk to user funds: The hook holds ETH and memecoin balances during fee accumulation, BidWall rebalancing and fair launch settlement, and moves them through PoolManager settle and take calls, so a bug or a malicious owner-replaced logic contract could affect user funds. Under normal operation funds are routed to the pool, BidWall, creator and treasury as designed.

Security findings

  • [info] Fair launch lock: Fair launch window blocks liquidity changes and sells of the memecoin for 30 minutes, after which the position is closed and rebalanced by the hook.
  • [info] Hook takes tokens via return deltas: Swap fees are taken via return deltas in beforeSwap and afterSwap, and the hook also executes internal swaps of accumulated token fees before the Uniswap swap.
  • [medium] Owner controls fee split: setFeeDistribution, setProtocolFeeDistribution and setPoolFeeDistribution are owner-controlled and validated only against fixed maxima, so the owner can change how fees are split among protocol, creator, treasury and BidWall within those limits.
  • [medium] Owner can replace external logic contracts: The owner can swap in a new flaunch contract, initial price calculator, or fee calculator, each of which runs inside core swap, flaunch and fee paths, so a malicious or buggy replacement could affect pool behaviour.
  • [low] Hook holds and moves pool funds: The BidWall deposits and withdraws ETH and memecoins from pool liquidity and forwards them to the memecoin treasury, and the hook settles tokens against the PoolManager, so the contract holds pool-related balances during rebalances.

Contract details

Verified source
Yes (PositionManager)
Compiler
solc 0.8.27+commit.40a35a09
Bytecode size
24,554 bytes
Upgradeable proxy
No
Detected patterns
dynamic-fee, erc6909-claims, launchpad, moves-currency, ownable, return-delta, self-unlock, tax

Pools using PositionManager