ShellHook on Ethereum
Uniswap v4 Hook Contract 0xb1e04874b59faa44ca49ed50e2fbdd9d11d5e0cc on Ethereum · Fee sharing · Verified contract
- Volume (24h)
- $0
- Value locked (TVL)
- $632
- All-time volume
- $0
- Pools using this hook
- 2
- Swaps (24h)
- 46 (19 traders)
- Total swaps
- 46
What it does
On every swap of a registered Shell token the hook takes a creator-set 1 to 5 percent tax in WPRL, which is split between token holders and the creator, while the pool itself charges no LP fee.
How it works step by step
- Takes a creator-chosen trading tax of 1% to 5% on every swap of a Shell pool, always denominated in WPRL, the pool's pair asset
- Splits each collected tax between the token's holders (holderBps share, streamed via a token notify call) and the creator (remainder accrued in creatorOwed for later claim)
- Registers token configs (creator, taxBps, holderBps) via a factory-only registerToken call; holderBps is fixed at launch and can range from 0 to 100 percent
- Uses beforeSwap to take tax on swaps where WPRL is the specified currency, and afterSwap to take tax when WPRL is the unspecified currency, returning deltas so the pool pays the hook
- Restricts beforeInitialize so only the factory can initialize pools and only pools that resolve to a registered Shell token are accepted
- Lets anyone trigger claimCreator, which always transfers accumulated WPRL to the registered creator address
- Swap behaviour
- On each swap that involves a registered token, the hook takes a tax of taxBps (100 to 500 basis points) on the WPRL side. For exact-in swaps where WPRL is specified, the tax is taken from the input amount in beforeSwap; for exact-out swaps where WPRL is specified, the tax is grossed up on the output. When WPRL is the unspecified currency, the tax is computed from the resulting WPRL delta and taken in afterSwap. Swaps that do not move WPRL on the specified side, or that compute zero tax, pass through unchanged. Tokens themselves are never sold by the hook, so the tax creates no token sell pressure.
- Liquidity behaviour
- No liquidity callbacks.
- Fee behaviour
- The pool's LP fee is 0 by construction (set in ShellKey). All trading cost comes from the hook's tax of taxBps, which is set per token at registration within 1% to 5%. The tax is split by holderBps: that share is transferred as WPRL to the token contract and notified to it, and the remainder is credited to creatorOwed for the creator to claim. The platform takes no share.
- Owner & admin controls
- The owner can only call setFactory once (to set the factory address) and renounceOwnership, which sets owner to zero. After setFactory, no one has privileged control over tax rates or holder shares, which are fixed per token at registration. Creators can reassign their own creator payout address via setCreator. The contract is not upgradeable and has no pause function.
Enabled Uniswap v4 callbacks
beforeInitialize, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta
beforeInitialize restricts pool creation to the factory and to pools that map to a registered token; beforeSwap takes the tax when WPRL is the specified currency and returns a before-swap delta to offset the pool's amounts; afterSwap takes the tax when WPRL is the unspecified currency and returns an after-swap delta; both return-delta flags allow the hook to take a share of swap amounts.
Security & trust assessment
Risk level: medium (verified source, high confidence).
Who controls it: After renounceOwnership, no key can change tax rates, holder shares, the factory or any pool parameter. Before renouncement, the owner can only set the factory once. Creators control only their own payout address.
Risk to user funds: The hook holds WPRL transiently during swaps, taking the tax via take() and immediately distributing it to holders and the creator accrual. It does not hold token balances and cannot move user funds beyond the configured tax. Accumulated creator WPRL sits in the contract until claimed.
Security findings
- [info] Hook takes value via return deltas: beforeSwap and afterSwap return non-zero deltas, so the hook extracts a 1 to 5 percent tax from every swap of a registered pool; this is the intended mechanism but means users pay it on every trade.
- [low] Holder notify call into token contract: _distribute transfers WPRL to the token and then calls notify() on it; the token contract is trusted to behave correctly, and a malicious or buggy token could revert swaps through this callback.
- [low] Owner retained until factory is set: The owner key can set the factory once; if the factory is set to a wrong address before renouncing, the registry would be wired to an unintended caller. Ownership is renounced in the designed flow, which reduces this risk.
- [info] Unbounded tax on exact-out gross-up: For exact-out swaps the tax is computed as amt*bps/(BPS-bps), which is bounded since bps is at most 500, so the gross-up is limited to about 5.3 percent of the amount.
Contract details
- Verified source
- Yes (ShellHook)
- Compiler
- solc 0.8.26+commit.8a97fa7a
- Bytecode size
- 4,594 bytes
- Upgradeable proxy
- No
- Detected patterns
- erc20, moves-currency, ownable, return-delta, tax
Pools using ShellHook
- WPRL / SHFARM (0.00% fee) — 24h volume $0, TVL $632, 44 swaps today
- WPRL / TEST (0.00% fee) — 24h volume $0, TVL <$0.01, 2 swaps today