LaunchFeeHook

Inherits: InitializerHook, IUnlockCallback

LBP-compatible InitializerHook that charges an afterSwap hook fee into FeeDistributor.

Constants

MAX_HOOK_FEE

uint24 internal constant MAX_HOOK_FEE = 1e6

distributor

FeeDistributor public immutable distributor

defaultHookFee

uint24 public immutable defaultHookFee

State Variables

hookFeeOf

mapping(PoolId => uint24) public hookFeeOf

feeConfigured

mapping(PoolId => bool) public feeConfigured

Functions

constructor

constructor(IPoolManager poolManager_, address authorized_, FeeDistributor distributor_, uint24 defaultHookFee_)
    InitializerHook(poolManager_, authorized_);

setPoolHookFee

function setPoolHookFee(PoolId poolId, uint24 fee) external;

getHookPermissions

function getHookPermissions() public pure override returns (Hooks.Permissions memory);

_afterSwap

function _afterSwap(
    address sender,
    PoolKey calldata key,
    SwapParams calldata params,
    BalanceDelta delta,
    bytes calldata
) internal override returns (bytes4, int128);

harvest

function harvest(PoolKey calldata key) external;

unlockCallback

function unlockCallback(bytes calldata data) external onlyPoolManager returns (bytes memory);

receive

receive() external payable;

Events

PoolHookFeeSet

event PoolHookFeeSet(PoolId indexed poolId, uint24 fee);

HookFee

event HookFee(bytes32 indexed poolId, address indexed sender, uint128 feeAmount0, uint128 feeAmount1);

Errors

InvalidFee

error InvalidFee();

HookFeeTooLarge

error HookFeeTooLarge();