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.
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
| Kind | product |
|---|---|
| Status | production |
| License | MIT |
| Source | https://github.com/flayerlabs/flaunchgg-contracts |
| Categories | LaunchpadsCreator economy |
| Properties | Custom swap data |
| Chains | Base |
| Website | https://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.