V4HOOKSCUT SHEET DIRECTORY

Index / Zora Coin Hook

product · MIT · last updated 2026-08-27

Zora Coin Hook

Creator coin hook: launch fee decay, LP positions on init, fee swap + reward distribution.

ZoraV4CoinHook is Zora production code. On pool init it seeds multi-range LP from coin config. beforeSwap returns a dynamic launch fee that decays from ~99% to 1% over ~10 seconds after coin creation (LAUNCH_FEE_START → LP_FEE_V4). afterSwap collects LP fees, swaps to backing currency, and distributes rewards. Supports hook upgrades via IUpgradeableV4Hook migration paths. Use Zora's factory — do not reimplement to launch a coin. Excerpt shows permissions and launch fee calc. Full file at the permalink. 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

afterInitializebeforeAddLiquiditybeforeSwapafterSwap

Solidity

Excerpt from packages/coins/src/hooks/ZoraV4CoinHook.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: false,
        afterInitialize: true,
        beforeAddLiquidity: true,
        afterAddLiquidity: false,
        beforeRemoveLiquidity: false,
        afterRemoveLiquidity: false,
        beforeSwap: true,
        afterSwap: true,
        beforeDonate: false,
        afterDonate: false,
        beforeSwapReturnDelta: false,
        afterSwapReturnDelta: false,
        afterAddLiquidityReturnDelta: false,
        afterRemoveLiquidityReturnDelta: false
    });
}

/// Fee decays linearly from LAUNCH_FEE_START (99%) to LP_FEE_V4 (1%) over LAUNCH_FEE_DURATION.
function _calculateLaunchFee(address coin) internal view returns (uint24 fee) {
    // elapsed since IHasCreationInfo.creationTime(); returns OVERRIDE_FEE_FLAG | fee
}

Spec

Kindproduct
Statusproduction
LicenseMIT
Sourcehttps://github.com/ourzora/zora-protocol
CategoriesLaunchpadsCreator economyDynamic fees
PropertiesDynamic feeVanilla swap
ChainsBase
Websitehttps://zora.co/
Docshttps://docs.zora.co/

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.