> ## Documentation Index
> Fetch the complete documentation index at: https://docs.grapl.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Hooks and authenticated routing

> The pool checks used by the local protocol and their limits.

GRAPL's local `LaunchHook` enforces initialization and swap rules in Uniswap v4. Its address enables exactly two callbacks: `beforeInitialize` and `beforeSwap`. The official [Uniswap hook model](https://developers.uniswap.org/docs/protocols/v4/concepts/hooks) explains callback permission bits.

<Tabs>
  <Tab title="Before initialization">
    Only an authorized factory can initialize a registered launch pool. This
    prevents pre-initialization of predictable future token pools with a
    different price.
  </Tab>

  <Tab title="Before a swap">
    The hook verifies the PoolManager and immutable router, reads the active
    caller and checks the schedule. Buying in the exclusive window requires that
    caller's Merkle proof.
  </Tab>

  <Tab title="After the window">
    The membership gate ends at `publicAt`. The router requirement remains,
    preserving fee collection and GEM issuance through the same path.
  </Tab>
</Tabs>

## Trade execution

The router supports exact-input swaps through registered pools, with a deadline, minimum output and maximum protocol fee. It settles actual v4 currency deltas before recording rewards. Partial fills pay protocol fees on executed GRAPL volume.

On a buy, the protocol fee is additional GRAPL input. On a sell, it comes from GRAPL received, requires allowance and is included in net minimum output. The LP fee is separate. Failure in settlement, fees or rewards reverts the entire transaction.

## Fixed integration, explicit powers

This implementation has no proxy upgrade, arbitrary external call, replaceable hook module or custom swap-return delta. Registry entries and hook/router dependencies are fixed once created.

Administrators can change roles and pause protocol modules. Those powers affect operation; see [security and authority](/reference/security). No external audit or AI safety guarantee is claimed.

Modular hooks and AI-assisted review remain research proposals. Current addresses exist only in the [local deployment](/reference/contracts); public-chain status is tracked under [supported chains](/reference/supported-chains).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.