PositionManager on Ethereum

Uniswap v4 Hook Contract 0xb741a710e456fc6d7f76c88f5c56b27d05e8a5dc on Ethereum · Launchpad · Verified contract

Volume (24h)
$0
Value locked (TVL)
$348
All-time volume
$35.62K
Pools using this hook
150
Swaps (24h)
0 (0 traders)
Total swaps
916

What it does

Flaunch PositionManager hook that launches memecoins into Uniswap v4 pools, charges a swap fee taken through return deltas, fills swaps from an internal fee inventory, and splits fees between the creator, a BidWall, the treasury, the protocol and referrers.

How it works step by step

  • flaunch() creates a memecoin, an ERC721 creator token and a treasury, initializes the pool itself (direct initialization is blocked), seeds single-sided liquidity and can fill a creator premine.
  • Before each swap it checks any launch schedule, lets the InternalSwapPool fill part of the swap from accumulated fee inventory, checks whether the BidWall position is stale, and records the pre-swap tick into a price oracle.
  • After each swap it takes a swap fee through the afterSwap return delta, pays any referrer directly, and deposits the rest into the InternalSwapPool.
  • Once paired-token fees pass a threshold, they are split by a waterfall among the creator, the BidWall (a buy-side liquidity position), the memecoin treasury and the protocol recipient. Shares are credited in a FeeEscrow.
  • Fee calculators and fee exemptions can adjust or waive fees. The hook emits pool state and swap events and notifies subscribers through a Notifier.
  • Only paired tokens whitelisted in a registry can be used. Each pool's paired-token config (escrow, thresholds) is frozen at launch.
Swap behaviour
beforeSwap reverts until a scheduled launch time has passed. It then lets the InternalSwapPool fill the swap from fee inventory: the hook takes and settles tokens against the PoolManager and returns a beforeSwapDelta. It also checks the BidWall for staleness and records an oracle observation. afterSwap computes the fee on the unspecified currency, pays the referrer, deposits the remainder in the InternalSwapPool, distributes fees if over the threshold, tracks the swap in the fee calculator, and returns the fee as the hook delta.
Liquidity behaviour
The hook only emits pool state events after liquidity is added or removed, and after a donate. During flaunch it creates the initial single-sided position itself inside a PoolManager unlock. The BidWall also adds and removes liquidity through hook-driven flows.
Fee behaviour
The pool's static LP fee is 0. The hook charges its own swap fee through return deltas. The fee comes from the global or per-pool FeeDistribution, optionally overridden by a fee calculator, and exempt addresses can be skipped. The waterfall is swap fee, then referrer, then protocol (capped at 10% by MAX_PROTOCOL_ALLOCATION), then creator, then BidWall, with treasury as the fallback. Creators can adjust their own fee allocation.
Owner & admin controls
The owner (Solady Ownable, with two-step handover and renounce) can set the flaunch contract, initial price contract, fee calculator, global fee distribution (swap fee, referrer and protocol shares), per-pool fee distributions, protocol fee distribution and the referral escrow. The creator-fee allocation setter is restricted to the pool creator (CallerNotCreator error). The hook does not appear to be an upgradeable proxy, and no pause function is visible in the ABI. Part of the source was truncated, so setter bounds are not fully verified.

Enabled Uniswap v4 callbacks

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

beforeInitialize always reverts so that only the hook itself can initialize its pools. afterAddLiquidity, afterRemoveLiquidity and afterDonate emit state updates for indexers and subscribers. beforeSwap enforces launch schedules, runs the InternalSwapPool fill, checks BidWall staleness and records oracle ticks. afterSwap captures and distributes fees and tracks swaps for fee calculators. beforeSwapReturnDelta lets the internal fill alter swap amounts. afterSwapReturnDelta lets the hook take its swap fee from the unspecified currency.

Security & trust assessment

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

Who controls it: The owner can change global and per-pool fee splits, the fee calculator, the referral escrow, and the flaunch and initial-price contracts. It could redirect or raise fees within the validated caps, and a malicious fee calculator could raise per-swap fees. It cannot directly withdraw LP positions, and no pause or upgrade function is visible. Protocol and registry contracts are separately owned.

Risk to user funds: The hook transiently holds fee inventory and the paired token while it settles internal fills, distributes fees and moves BidWall funds. It credits fees to FeeEscrow for withdrawal by recipients. It takes fees from swaps through return deltas. A failing external dependency could revert swaps. Plain LPs are not custodied by the hook, but the creator's initial liquidity position is managed through the hook.

Security findings

  • [info] Hook takes fees via return deltas: afterSwap returns the swap fee as the hook delta and beforeSwap returns an internal-fill delta, so traders receive less of the output than the raw pool price implies. This is by design, and the fee is bounded by FeeDistribution validation.
  • [medium] Owner can change fee parameters and fee calculator: setFeeDistribution, setPoolFeeDistribution, setProtocolFeeDistribution and setFeeCalculator are onlyOwner or protocol-controlled. A swap-fee cap exists (SwapFeeInvalid), but its value is not visible in the provided source, and a custom calculator contract can influence per-swap fees.
  • [medium] Swaps depend on many external contracts: Every swap calls the InternalSwapPool, BidWall, oracle, fee calculator, escrows and paired-token code. A revert or malicious callback in any of them, for example a stuck BidWall allowance, could block swaps on a pool. The source comments themselves discuss reentrancy via callback-capable tokens.
  • [low] Shared pre-swap tick slot: _beforeSwapTick is a single storage slot shared across pools. The code commits it last in beforeSwap and snapshots it first in afterSwap to mitigate nested-swap clobbering, but this remains a subtle reentrancy surface.
  • [low] Owner controls launch and price contracts: setFlaunch and setInitialPrice let the owner replace the contracts that create tokens and set launch prices, which affects only future launches. The registry that whitelists paired tokens lives outside this contract.

Contract details

Verified source
Yes (PositionManager)
Compiler
solc 0.8.26+commit.8a97fa7a
Bytecode size
23,925 bytes
Upgradeable proxy
No
Detected patterns
dynamic-fee, erc6909-claims, launchpad, moves-currency, oracle, ownable, return-delta, self-unlock, tax

Pools using PositionManager