ContentmentHook on Base
Uniswap v4 Hook Contract 0x2a0e6206325c966fee8b2284ca1a276877332844 on Base · Fee sharing · Verified contract
- Volume (24h)
- $0
- Value locked (TVL)
- $6.68K
- All-time volume
- $628.10K
- Pools using this hook
- 1
- Swaps (24h)
- 0 (0 traders)
- Total swaps
- 1,048
What it does
A Uniswap v4 hook for the ContentmentCoin launch pool that charges a profit-based ETH fee of up to 10% on token sells, with a 1% platform cut, and restricts pool setup and liquidity to the launch phase.
How it works step by step
- Restricts pool initialization and liquidity additions to the one-time launch phase of the ContentmentCoin pool
- Tracks per-user buy cost basis and sell history to classify each sale's profit
- Charges a sell fee of 0 to 10% of ETH received, scaled by realized profit percentage, with maximum fee for unknown-origin or excess sales
- Takes fees as an ETH return delta in afterSwap and distributes a 1% platform fee plus the remainder to the coin owner
- Notifies ContentmentCoin of buys and sells to update the mood NFT state
- Swap behaviour
- Only whitelisted routers may swap. Buys (ETH to token) pay no fee. Sells (token to ETH) are tracked per user and charged a profit-based fee of up to 10% of the ETH received, taken in ETH via afterSwap return delta. Exact-output ETH sells revert. Fee collection can be permanently disabled by the owner.
- Liquidity behaviour
- beforeAddLiquidity only allows liquidity addition while contentmentCoin.loadingLiquidity() is true and the pool currency1 is the ContentmentCoin, so only the initial launch liquidity can be added. No remove-liquidity callbacks are enabled.
- Fee behaviour
- On sells (token to ETH) the hook charges a profit-based fee of up to 10% (MAX_FEE_BIPS 1000) of ETH received: 100% or more profit gets the maximum, lower profits scale linearly, losses and breakeven pay nothing. Unknown-origin tokens or sales exceeding tracked hook-bought balance pay the maximum 10%. Fees are taken via manager.take in currency0 (ETH) and returned as an afterSwap delta. A 1% platform fee to tokenWorks is taken from the fee when the fee rate is at least 2% or the max fee applies; the remainder goes to the contentmentCoin owner. Buys pay no fee. When feeKilled is set, the afterSwap fee logic is skipped.
- Owner & admin controls
- Owner of ContentmentCoin (read via contentmentCoin.owner()) can whitelist routers via whitelistRouters, permanently disable fee collection via killFee, and withdraw any ETH held by the hook via transferEther. Owner is also the recipient of creator fees. No upgradeability or pausing of swaps found.
Enabled Uniswap v4 callbacks
beforeInitialize, beforeAddLiquidity, afterSwap, afterSwapReturnDelta
beforeInitialize: restricts pool initialization to the period when ContentmentCoin is loading liquidity. beforeAddLiquidity: restricts liquidity additions to the launch phase and the matching ContentmentCoin pair. afterSwap: tracks per-user buy/sell positions, emits mood-related logTrade calls and collects the profit-based fee. afterSwapReturnDelta: lets the hook take the fee amount from the swap's output as a return delta.
Security & trust assessment
Risk level: medium (verified source, high confidence).
Who controls it: The contentmentCoin owner can whitelist any router, call killFee to permanently turn off fee collection, and drain all ETH held by the hook through transferEther. The owner also receives creator fees, so the owner key controls a significant portion of fee flow.
Risk to user funds: The hook takes a fee in ETH on profitable or unknown-origin sells via a return delta and holds no user principal. The owner can withdraw any ETH balance from the hook and can block swaps from non-whitelisted routers. Exact-output ETH sells revert.
Security findings
- [medium] Owner-controlled router whitelist gates swaps: The hook has no swap pause, so the owner cannot block trading directly. Only whitelisted routers can swap, and the owner controls the whitelist, so the owner can prevent non-whitelisted routers from trading.
- [medium] Owner can withdraw hook ETH balance: transferEther lets the owner withdraw any ETH balance held by the hook, including fee ETH that has been accumulated or sent in via receive.
- [low] Irreversible fee kill switch: killFee permanently disables fee collection and cannot be reversed. The owner can use it at any time to remove the fee mechanism.
- [low] Trust in whitelisted routers' msgSender: The user position tracking relies on the router's msgSender() to identify the trader and on a trusted router whitelist. Any whitelisted router that misreports msgSender could manipulate position state and fee tiers for other users.
- [info] Hook takes fees via return delta: The hook takes fee ETH via manager.take and pays out creator and platform fees using forceSafeTransferETH to fixed recipients, so user funds are not held beyond the fee amount. Swap execution itself is not blocked by the hook, except for the router whitelist, exact-output ETH sells, and the non-whitelisted case.
Contract details
- Verified source
- Yes (ContentmentHook)
- Compiler
- solc 0.8.26+commit.8a97fa7a
- Bytecode size
- 6,028 bytes
- Upgradeable proxy
- No
- Detected patterns
- access-control, moves-currency, return-delta
Pools using ContentmentHook
- ETH / CONTENT (0.00% fee) — 24h volume $0, TVL $6.68K, 0 swaps today