V4HOOKSCUT SHEET DIRECTORY

Index / Flaunch

product · MIT · last updated 2026-08-27

Flaunch

PositionManager hook: beforeSwap runs the internal swap pool; afterSwap distributes creator fees.

Flaunch’s PositionManager is a Uniswap v4 hook (MIT). Permissions: block external initialize, InternalSwapPool on beforeSwap + beforeSwapReturnDelta, FeeDistributor and BidWall on afterSwap + afterSwapReturnDelta, liquidity/donate event tracking. You do not copy this to “build Flaunch” — you read how a launchpad declares a wide permission mask and splits work across callbacks. Full PositionManager.sol is large; start at getHookPermissions then follow the comments in square brackets. Listing is not an audit.

Permission bits

These bits must match the deployed address. Confirm on-chain before you route.

Initialize
ba
Liquidity
baba
Swap
ba
Donate
ba
Return delta
baaa

beforeInitializeafterAddLiquidityafterRemoveLiquiditybeforeSwapafterSwapafterDonatebeforeSwapReturnDeltaafterSwapReturnDelta

Solidity

Excerpt from src/contracts/PositionManager.sol. Production hook. Study the callbacks, do not paste it as your factory. Not an audit.

// SPDX-License-Identifier: MIT
function getHookPermissions() public pure override returns (Hooks.Permissions memory) {
    return Hooks.Permissions({
        beforeInitialize: true, // Prevent initialize
        afterInitialize: false,
        beforeAddLiquidity: false,
        afterAddLiquidity: true, // [EventTracking]
        beforeRemoveLiquidity: false,
        afterRemoveLiquidity: true, // [EventTracking]
        beforeSwap: true, // [InternalSwapPool]
        afterSwap: true, // [FeeDistributor], [InternalSwapPool], [BidWall], [EventTracking]
        beforeDonate: false,
        afterDonate: true, // [EventTracking]
        beforeSwapReturnDelta: true, // [InternalSwapPool]
        afterSwapReturnDelta: true, // [FeeDistributor]
        afterAddLiquidityReturnDelta: false,
        afterRemoveLiquidityReturnDelta: false
    });
}

Spec

Kindproduct
Statusproduction
LicenseMIT
Sourcehttps://github.com/flayerlabs/flaunchgg-contracts
CategoriesLaunchpadsCreator economy
PropertiesCustom swap data
ChainsBase
Websitehttps://flaunch.gg/

FAQ

Can I paste this into production? The snippet is an excerpt. Use the full file at the source URL, match flags to the address, and treat this page as a map, not a guarantee.

How do I build this safely? Start with secure v4 hooks and the OpenZeppelin hooks guide.