Contract reference and security
Addresses
| HookCat | 0x470E03d0b85F3adB6E9F9188EB17BeEFE77f20cC |
| PoolManager | 0x8366a39CC670B4001A1121B8F6A443A643e40951 |
| PositionManager | 0x58daec3116aae6d93017baaea7749052e8a04fa7 |
| Universal Router 2.1.1 | 0x8876789976dEcBfCbBbe364623C63652db8C0904 |
| Permit2 | 0x000000000022D473030F116dDEE9F6B43aC78BA3 |
| USDG | 0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168 |
| House pool ETH / USDG | 0xde0c5f755a7c3f4b52f7bbee7e6252325f1d51f4c1d8e7a3dae5477638bb9bfb |
The source is verified on Sourcify. The hook's address was mined with CREATE2 so its last bits carry exactly its permissions: beforeInitialize, beforeSwap, afterSwap, beforeSwapReturnDelta and afterSwapReturnDelta (flags 0x20CC).
Functions
// cats
publishCat(uint8 kind, bytes32 params, string name) returns (uint32)
retune(uint32 catId, bytes32 params)
setTrainer(uint32 catId, address trainer)
setBuilder(uint32 catId, address to)
catOf(uint32 catId) view returns (Cat)
catCount() view returns (uint32)
// pools
open(PoolKey key, uint160 sqrtPriceX96, uint32 catId) returns (PoolId)
adopt(PoolId id, uint32 catId) // keeper
transferKeeper(PoolId id, address to) // keeper
quoteFee(PoolId id, bool zeroForOne, int256 amountSpecified) view returns (uint24 fee, uint24 lpFee, uint256 cut)
poolState(PoolId id) view returns (uint32 ewma, int24 lastTick, uint64 lastBlock, int8 lastDir, uint32 catId, address keeper)
poolStats(PoolId id) view returns (swaps, volumeEth, lpExtraEth, builderCut, stakerCut)
poolCount(), poolAt(uint256), keyOf(PoolId)
// money
builderOwed(address) view, stakerOwed() view
claimBuilder() returns (uint256)
forwardStakers() returns (uint256)
// events
Priced(PoolId indexed id, uint32 indexed catId, uint24 fee, uint24 lpFee, uint256 ethAmount, uint256 builderCut, uint256 stakerCut)
CatPublished, Retuned, Opened, Adopted, KeeperTransferred, BuilderClaimed, StakersForwardedWhat the owner can do
- Pause new
opencalls (existing pools keep trading and pricing). - Set the $HCAT staker distributor, once.
- Hand ownership over in two steps (
transferOwnership,acceptOwnership).
What the owner cannot do
- Change a pool's cat, its fees or the split.
- Touch a builder's or the stakers' ETH, or anyone's liquidity.
- Upgrade the hook: it has no proxy and no admin call into pools.
Tests
Unit tests cover each kind's formula, the clamps, the split in all four swap shapes (exact in and exact out, both directions) with a fuzz run, the block roll, quoteFee against the charged fee, claims, permissions and pause. A fork test runs the whole flow against the real PoolManager, PositionManager and Universal Router 2.1.1. The live check opened the house ETH / USDG pool, added and removed liquidity through the PositionManager, swapped four times in both directions and claimed the builder cut; every quoteFee matched the fee charged.