CabalcoinHook on Ethereum

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

Volume (24h)
$0
Value locked (TVL)
$21.00K
All-time volume
$2.02M
Pools using this hook
1
Swaps (24h)
0 (0 traders)
Total swaps
7,696

What it does

A Cabalcoin fee hook that charges a percentage fee on swaps in the Cabalcoin pool, gates pool creation and liquidity addition to the token's launch phase, and lets the owner and nomoWallet withdraw the accumulated fees.

How it works step by step

  • Initializes with a 3% fee (feeBips = 300) and allows only fee reductions by the Cabalcoin owner
  • Charges a fee on every swap in afterSwap and takes it from the pool manager to the hook
  • Converts non-ETH fees into ETH by swapping them back through the pool
  • Restricts pool initialization and liquidity addition to when cabalcoin.loadingLiquidity() is true
  • Lets the owner or nomoWallet withdraw all ETH, split 50/50 between owner and nomoWallet
  • Lets the owner rescue any ERC20 held by the hook via transferToken
Swap behaviour
After each swap, takes feeBips of the swap amount from the pool, converts any non-ETH fee to ETH through a further pool swap, emits TokensBought or TokenSold and HookFee events, and returns the fee as a delta adjustment.
Liquidity behaviour
beforeAddLiquidity reverts unless cabalcoin.loadingLiquidity() is true, restricting liquidity provision to the launch phase. No remove-liquidity callbacks.
Fee behaviour
Charges a feeBips percentage (initially 300 bps = 3%) of the swap output amount in afterSwap, taken from the pool via manager.take. Non-ETH fees are converted to ETH by a swap back through the pool. The owner can only lower the fee.
Owner & admin controls
Cabalcoin owner (via cabalcoin.owner()) can lower the swap fee via lowerFees (only decreasing, never raising) and can call withdrawAllFees and transferToken; nomoWallet can also call withdrawAllFees. No pause, no upgradeability observed in the source.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeAddLiquidity, afterSwap, afterSwapReturnDelta

beforeInitialize checks that cabalcoin.loadingLiquidity() is true before pool creation. beforeAddLiquidity applies the same loadingLiquidity gate. afterSwap emits events, takes the fee and converts non-ETH fees to ETH. afterSwapReturnDelta lets the hook's returned fee amount reduce the swapper's delta.

Security & trust assessment

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

Who controls it: The Cabalcoin owner can reduce the fee to zero, withdraw all ETH held by the hook (split 50/50 with nomoWallet) and move any ERC20 tokens held by the hook. nomoWallet can also trigger withdrawals.

Risk to user funds: The hook holds ETH and any fee-converted tokens and can transfer them only through owner or nomoWallet functions. Swappers pay a configurable fee (3% initially, reducible to 0 by the owner). The hook does not block swaps or hold user principal beyond fees.

Security findings

  • [info] Fee skim to privileged addresses: The hook takes a percentage of every swap output and sends the ETH balance to owner and nomoWallet, so accumulated fees depend on the owner's and nomoWallet's keys.
  • [low] Owner can sweep arbitrary ERC20 balances: transferToken is payable and callable by the owner to move any ERC20 held by the hook, including tokens that may be in transit from fee conversion.
  • [info] One-way fee control: The fee can be lowered to 0 by the owner but never raised, which limits fee-raising abuse but not the owner's ability to reduce it.
  • [low] Liveness depends on external token flag: Pool initialization and liquidity addition depend on cabalcoin.loadingLiquidity(), an external flag, so the token contract controls whether the pool can be created or seeded.
  • [info] Swapper identity taken from caller: afterSwap trusts IValidRouter(sender).msgSender() to identify the swapper for events only; the value is not used for access control or fund movement.

Contract details

Verified source
Yes (CabalcoinHook)
Compiler
solc 0.8.26+commit.8a97fa7a
Bytecode size
5,730 bytes
Upgradeable proxy
No
Detected patterns
moves-currency, return-delta

Pools using CabalcoinHook