PositionManager on Base

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

Volume (24h)
$0
Value locked (TVL)
$0
All-time volume
$92.02M
Pools using this hook
120,163
Swaps (24h)
191 (58 traders)
Total swaps
619,949

What it does

Flaunch's PositionManager hook launches memecoins into Uniswap v4 pools with a fair launch phase, takes a swap fee that is split between creator, BidWall, treasury and protocol, and sells accumulated fee tokens ahead of the pool.

How it works step by step

  • Creates a new memecoin, an ERC721 creator NFT and a treasury through flaunch(), then initializes the pool itself. Direct initialization by anyone else reverts with CannotBeInitializedDirectly.
  • Runs a fair launch: a one-sided token position sells only the memecoin for native token. Selling the token and adding or removing liquidity are blocked until the window ends, after which the position closes and unsold supply is sent to the dEaD address.
  • Takes a swap fee through return deltas in beforeSwap and afterSwap. A referrer share is paid out, and the rest accrues for distribution to the creator, BidWall, treasury and protocol once at least 0.001 ETH is collected.
  • Operates an internal swap pool that fills swaps from fee tokens the hook holds before the Uniswap pool is touched, which reduces price impact.
  • Supports scheduled launches and same-block premines, and uses a BidWall that places fee-funded single-tick bid liquidity just below the spot price.
  • Emits PoolSwap and PoolStateUpdated events and notifies subscriber contracts through a Notifier after each action.
Swap behaviour
beforeSwap reverts with TokenNotFlaunched while a pool is scheduled for the future, except for a matching premine in the same transaction. During the fair launch it rejects sells of the memecoin, fills buys from the fair launch position, takes a fee and closes the position once supply runs out or the window ends. It then runs the internal swap pool, which fills part of the swap from fees the hook holds, takes a fee on that fill, and checks whether the BidWall is stale. afterSwap takes a fee on the Uniswap swap, pays any referrer, distributes accumulated fees, notifies the fee calculator and emits events.
Liquidity behaviour
beforeAddLiquidity and beforeRemoveLiquidity revert with CannotModifyLiquidityDuringFairLaunch during the fair launch window, unless the sender is the BidWall or FairLaunch contract. After the window anyone can modify liquidity. The after callbacks only emit state updates and do not return deltas.
Fee behaviour
The pool's static fee is 0. The hook takes its own swap fee from a fee calculator, with separate calculators for fair launch and normal trading, and returns it as a hook delta. Fee exemptions can apply per sender. A referrer is paid first. The rest is split by a configurable distribution among creator, BidWall, treasury and protocol. The non-native token side is converted through the internal swap pool.
Owner & admin controls
The owner (a Solady Ownable with two-step handover) can change the Flaunch contract, the initial price contract, the fee calculators, the default fee distribution, the protocol fee share and the referral escrow. The owner can also override a pool's fee distribution and renounce or transfer ownership. These setters come from the ABI and the visible source. FeeDistributor is not shown, so the bounds and the exact access rules on them could not be checked. The BidWall has its own owner who can set the swap fee threshold and stale time window. Only the token creator can enable or disable the BidWall for a pool. There is no pause function and the hook is not a proxy.

Enabled Uniswap v4 callbacks

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

beforeInitialize blocks outside parties from initializing pools with this hook. beforeAddLiquidity and beforeRemoveLiquidity enforce the fair launch liquidity lock. afterAddLiquidity, afterRemoveLiquidity and afterDonate emit state updates and notify subscribers. beforeSwap handles scheduling, premine, fair launch fills and the internal swap pool, and returns a before-swap delta. afterSwap takes the swap fee, distributes fees and tracks swaps for the fee calculator. beforeSwapReturnDelta and afterSwapReturnDelta let the hook adjust swap amounts and take fees.

Security & trust assessment

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

Who controls it: The owner can change the fee calculators, the fee split, the initial price logic and the flaunch contract. That can raise the cost of trading or redirect fee revenue, subject to unseen caps. The owner cannot pause swaps or upgrade this contract directly.

Risk to user funds: The hook does not custody LP positions. It does hold accrued fees, fair launch tokens and BidWall-related funds, and it takes fees from swaps through return deltas. Unsold fair launch supply is burned. Pending and distributed fees are allocated to recipients through an escrow. A faulty dependency could block swaps or fee distribution, and hold-up of funds in the hook is possible. The source for several components was not available to confirm.

Security findings

  • [medium] Hook takes fees through return deltas: beforeSwap and afterSwap return deltas that make the hook take part of every swap as fees, so the trader's received amount depends on the fee calculator. Fee amounts come from external calculator contracts that the owner can replace.
  • [medium] Owner-controlled fee and price logic: setFeeCalculator, setFairLaunchFeeCalculator, setInitialPrice, setFlaunch, setFeeDistribution and setPoolFeeDistribution are owner-gated. Swap fee levels and fee splits can therefore change after launch. Hard caps are not visible because FeeDistributor and the calculators were not available. The ABI shows SwapFeeInvalid and ProtocolFeeInvalid errors, which suggest some validation exists.
  • [info] Liquidity and selling locked during fair launch: Third parties cannot add or remove liquidity, and nobody can sell the token, while the fair launch window is active. This is intended behaviour, but it limits exits for early buyers.
  • [low] Hook holds pending fee funds and token approvals: The hook holds accrued native fees, fee tokens for the internal swap pool and the initial token supply. The constructor gives the BidWall and FairLaunch contracts an unlimited native-token allowance, and it approves FairLaunch for the memecoin at each flaunch. Their trust matters, and their source was not available for review.
  • [low] Heavy external dependencies in the swap path: Swaps call the fair launch, BidWall, fee calculator, fee exemptions and Notifier subscriber contracts. A bug or revert in any of them could block swaps for a pool. Their source was not reviewed.

Contract details

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

Pools using PositionManager