CrowdHook
EthereumCrowdHook is a Uniswap v4 hook on Ethereum. Runs code on every swap. Runs at pool creation.
- Contract name
- CrowdHook
How this hook works
Launch helperA launch helper hook. It only lets approved callers create pools.
Only approved callers create pools
New pools with this hook can only be created by approved callers, for example its own factory or launcher.
The code that does this (beforeInitialize):function beforeInitialize(address, PoolKey calldata key, uint160) external onlyPoolManager returns (bytes4) { if (poolSet) revert PoolAlreadySet(); if (!key.currency0.isAddressZero() || Currency.unwrap(key.currency1) != token) revert WrongPool(); if (tx.origin != launcher) revert NotLauncher(); poolId = key.toId(); poolSet = true; poolKey = key; emit PoolSet(poolId); return IHooks.beforeInitialize.selector; }Anyone can trigger payouts
Anyone can collect the fees it has built up, so nobody has to wait on the hook developer.
The code that does this (collectLpFees):function collectLpFees() external { if (lpUnlockAt == 0) revert NoPosition(); uint256 tokenId = lpTokenId; bytes memory actions = abi.encodePacked(uint8(0x01), uint8(0x11)); bytes[] memory params = new bytes[](2); params[0] = abi.encode(tokenId, uint256(0), uint128(0), uint128(0), bytes("")); params[1] = abi.encode(poolKey.currency0, poolKey.currency1, feeRecipient); emit LpFeesCollected(tokenId, feeRecipient); positionManager.modifyLiquidities(abi.encode(actions, params), block.timestamp); }
Who controls it: The pool creator can call: register lp, extend lock, wls, bls. The code cannot be changed.
Based on the hook’s published code.
What it can do
Its code executes inside each trade in pools that use it.
It runs when a pool is created, often to lock in that pool’s settings.
Hook history
- Joined 12 times
Latest transactions
- 0x6f4633a1…845527 block 26,385,415
- 0x3702a866…9eba15 block 26,385,414
- 0x0c614f53…2ac888 block 26,385,271
- 0x96c1e814…9393d3 block 26,385,263
- 0x87c37d9e…223852 block 26,385,259
- 0x1f7dfd57…ba0cab block 26,385,258
- 0x4db96c1f…800915 block 26,385,257
- 0x8b3dd70b…9ded13 block 26,385,241
- 0x65d14660…2901b8 block 26,385,238
- 0x709626bc…58deb4 block 26,385,236
- Vaulted the liquidity 1 time
- Liquidity unwound 1 time
Settings changes: set the pool (1 time).
Counted from what the hook recorded on-chain across all its pools, for every action in its published code, plus token transfers in and out of it.