BotcoinWethFeeHook on Base
Uniswap v4 Hook Contract 0x6b4d98ca88fa0e3bb2b70582d5af1b59971f3acc on Base · Custom pricing · Verified contract
- Volume (24h)
- $28
- Value locked (TVL)
- $55.80K
- All-time volume
- $867.32K
- Pools using this hook
- 1
- Swaps (24h)
- 7 (4 traders)
- Total swaps
- 3,767
What it does
A Uniswap v4 hook on the canonical BOTCOIN/WETH pool that charges configurable input fees on swaps, routes them to protocol revenue, burns part of BOTCOIN fees, and fills some swaps from a protocol-owned BOTCOIN buffer at a TWAP-gated price.
How it works step by step
- Restricts pool initialization and the swap path to the single canonical BOTCOIN/WETH pool key.
- Charges input-side fees on swaps using rates from a config registry, split between revenue vault, burn, subsidy and protocol recipient.
- Applies a 1% fee cap for traders holding a qualified active Rig NFT, including via trusted identity routers.
- Maintains a truncated tick oracle and uses a TWAP to gate protocol-owned buffer fills and bonus tranche buys.
- Blocks just-in-time liquidity by reverting same-block liquidity removals unless from the liquidity engine.
- Escrows fees when the pool manager cannot pay and later forwards them to the revenue vault in bounded batches.
- Swap behaviour
- beforeSwap charges an input fee, optionally fills part of a sell-WETH swap from the BOTCOIN conversion buffer through return deltas when the TWAP check passes, and afterSwap charges fees on exact-output swaps. Holders of a qualified Rig NFT pay a discounted fee capped at 1%.
- Liquidity behaviour
- beforeAddLiquidity records the block of each position add; beforeRemoveLiquidity reverts same-block removals (anti just-in-time liquidity) unless the sender is the configured liquidity engine. Liquidity can otherwise be added or removed normally.
- Fee behaviour
- Dynamic fee layered on swaps of the canonical BOTCOIN/WETH pool. Fees are charged on the input currency via beforeSwap/afterSwap, with rates from the config registry (main pool economic, subsidy, protocol, sell reward, sell burn). Holders of a qualified active Rig NFT get the rate capped at 1% (RIG_DISCOUNT_BPS). Fees are routed to the revenue vault, burned, sent to a protocol recipient, or escrowed in HookFeeEscrow if the pool manager cannot pay.
- Owner & admin controls
- Admin-gated via ProtocolAccessManager HOOK_ADMIN role: setProtocolRecipient, setTrustedIdentityRouter, setPoolFeeDepositor, bindPoolFeeBurner/bindBonusFunding/bindMiningFunding (one-time binds), setBufferParams (bounded by hardcoded caps). Role can be sealed forever via the access manager. The hook itself is not upgradeable (no proxy in source).
Enabled Uniswap v4 callbacks
beforeInitialize, afterInitialize, beforeAddLiquidity, beforeRemoveLiquidity, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta
beforeInitialize: restricts pool creation to the canonical key, the designated initializer and the expected starting price. afterInitialize: seeds the tick oracle. beforeAddLiquidity / beforeRemoveLiquidity: record add blocks and block same-block JIT removal. beforeSwap: charges input fees, reads the TWAP and may fill part of a swap from a conversion buffer of BOTCOIN (return delta). afterSwap: charges fees on exact-output swaps, lazily flushes escrow and runs bounded housekeeping. beforeSwapReturnDelta and afterSwapReturnDelta: let the hook take fee amounts and settle buffer fills against the swap.
Security & trust assessment
Risk level: medium (verified source, high confidence).
Who controls it: A HOOK_ADMIN key can redirect protocol fee revenue (setProtocolRecipient), authorize arbitrary fee depositors that can push BOTCOIN into the burn/buffer flow, trust arbitrary routers for identity-based discounts, and retune buffer fill size, band and tranche premium within hardcoded caps. Roles can be sealed to remove this power. Access manager admin is a DEFAULT_ADMIN that can grant HOOK_ADMIN.
Risk to user funds: The hook holds transient swap tokens and escrowed fee balances, and can absorb part of a swap through the buffer. Users cannot be blocked from swapping by a pause (none found), but an admin can alter fees and the buffer, and protocol revenue is routed by configuration.
Security findings
- [medium] Hook takes swap input via return deltas, with rates set by an external registry: beforeSwap and afterSwap take input tokens and return deltas, so the hook controls a share of each swap's flow. Fee rates come from the mutable config registry, so a configuration change alters what traders pay.
- [medium] Admin-tunable swap fill buffer: Protocol-owned buffer converts BOTCOIN into WETH against the pool and fills swaps at a TWAP-derived premium limit. Admin-set parameters (fill size up to 50%, band and premium caps) change how much of a swap the hook absorbs.
- [low] Trusted routers drive fee discounts: setTrustedIdentityRouter lets any address the admin trusts pass a msgSender() value used to grant the 1% fee discount. A malicious or misconfigured trusted router could misattribute trader identity.
- [low] Escrow and fallback accounting complexity: Pool fees are split and escrowed by HookFeeEscrow with an unlock-based fallback. If the pool manager cannot cover fees, claims are minted and escrow balances are tracked; large internal accounting paths increase complexity.
- [info] Protocol-owned buys and oracle gating: Bonus and subsidy flows swap protocol WETH into BOTCOIN and forward tokens to funding modules. Oracle is a self-written truncated tick TWAP that the hook also uses to gate execution.
Contract details
- Verified source
- Yes (BotcoinWethFeeHook)
- Compiler
- solc 0.8.26+commit.8a97fa7a
- Bytecode size
- 24,008 bytes
- Upgradeable proxy
- No
- Detected patterns
- liquidity-management, moves-currency, oracle, return-delta, self-unlock
Pools using BotcoinWethFeeHook
- BOTCOIN / WETH (0.00% fee) — 24h volume $28, TVL $55.80K, 7 swaps today