CAHook on Ethereum

Uniswap v4 Hook Contract 0x889e76f2219fde464f450472dd56c9bffa0220cc on Ethereum · Fee sharing · Verified contract

Volume (24h)
$21
Value locked (TVL)
$42
All-time volume
$21
Pools using this hook
1
Swaps (24h)
3 (1 traders)
Total swaps
3

What it does

A swap-fee hook for the CuratedApes ETH/token pool that charges a launch fee decaying to a lower final fee, splitting the ETH fees between NFT rewards, a treasury and a buyback-and-burn.

How it works step by step

  • Charges a swap fee that starts at launchFeeBps when the pool is initialized and decays linearly to finalFeeBps over decaySeconds.
  • Splits each ETH-denominated fee into rewards (ApeRewards), treasury and buyback-and-burn shares via immutable basis-point settings.
  • Holds fees as ERC6909 claims in the PoolManager and converts them on a public flush() call that pays rewards and treasury and burns token-side fees to 0xdEaD.
  • Allows the owner to run buyback(amount, minOut) to spend accumulated ETH on tokens sent to 0xdEaD.
  • Restricts pool initialization to a single native ETH/token pool using this hook, initiated by the owner.
  • Does not implement liquidity callbacks and never touches LP positions.
Swap behaviour
On buys with exact ETH input, the fee is taken from the ETH input in beforeSwap. On buys with exact token output, extra ETH is charged in afterSwap. On sells with exact token input, a share of the ETH output is kept. On sells with exact ETH output, extra tokens are charged and burned.
Liquidity behaviour
No liquidity callbacks.
Fee behaviour
Charges a fee on every swap in ETH where possible, starting at launchFeeBps (up to 50%) and decaying linearly to finalFeeBps over decaySeconds. Fees are split into rewardsShareBps (ApeRewards), treasuryShareBps (treasury) and the remainder as buyback-and-burn ETH. In the sell-with-exact-ETH-out case the fee is taken in tokens and burned on flush.
Owner & admin controls
Owner (Ownable) can call buyback(amount,minOut) to spend buyback ETH on tokens sent to 0xdEaD, setTreasury to redirect the treasury share, transferOwnership and renounceOwnership. Owner-only buyback is designed to prevent sandwiching. Treasury address is changeable at any time. Contract is not proxy-upgradeable and there is no pause function.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta

beforeInitialize restricts pool creation to the single native ETH/token pool using this hook and the owner. beforeSwap takes the ETH fee on buys with exact ETH input via a return delta. afterSwap takes fees on other swap directions via afterSwap return deltas or mints token claims. beforeSwapReturnDelta and afterSwapReturnDelta allow the hook to take a share of swap amounts.

Security & trust assessment

Risk level: medium (verified source, high confidence).

Who controls it: The owner can execute buybacks at chosen times and amounts (with a minOut slippage guard), redirect future treasury payments via setTreasury, and transfer or renounce ownership. The owner cannot change fee parameters, which are immutable constructor values, and cannot pause swaps or withdraw user LP funds.

Risk to user funds: The hook holds ETH and token claims from swap fees and can move them to the rewards address, the treasury, or the dead address. It cannot touch LP positions. Swaps are never blocked by an admin pause. The fee is charged on each swap, which is a material cost to traders, especially at the launch fee level.

Security findings

  • [info] Swap fees taken via return deltas: The hook takes ETH or token value from swaps through beforeSwap and afterSwap return deltas, so every swap in the pool pays the fee to the hook's claims.
  • [low] Fee accounting relies on flush and owner-triggered buyback: Fee claims are minted as ERC6909 and sent to rewards and treasury on flush, which anyone can call. Buyback ETH stays in the contract until the owner calls buyback.
  • [low] Owner can redirect treasury payouts: setTreasury allows the owner to change the treasury address immediately without a timelock, so future treasury fees can be redirected.
  • [low] Buyback slippage protection depends on owner input: The owner-triggered buyback accepts minOut as a parameter; passing 0 disables slippage protection, so the owner could execute buybacks at a poor price.

Contract details

Verified source
Yes (CAHook)
Compiler
solc 0.8.26+commit.8a97fa7a
Bytecode size
7,695 bytes
Upgradeable proxy
No
Detected patterns
launchpad, moves-currency, ownable, return-delta, rewards, self-unlock

Pools using CAHook