RampHookExternal on Base
Uniswap v4 Hook Contract 0x21cb58cbd2474feea79cd1f3975a2ef5314aa880 on Base · Dynamic fee · Verified contract
- Volume (24h)
- $0
- Value locked (TVL)
- <$0.01
- All-time volume
- $16
- Pools using this hook
- 5
- Swaps (24h)
- 0 (0 traders)
- Total swaps
- 12
What it does
A Uniswap v4 hook for externally launched tokens that sets a per-pool swap fee (flat or size-tiered, capped at 20%) and restricts liquidity provision and pool initialization to the owner or approved callers.
How it works step by step
- beforeInitialize restricts pool creation to the owner or approved callers.
- beforeAddLiquidity reverts for any sender other than the owner or approved callers, keeping LP one-sided.
- beforeSwap returns a dynamic fee override per swap, taken from the pool's flat or tiered configuration.
- Tiered mode charges different fees by swap size, measured only when the specified amount is in the quote currency.
- Fees are capped at 2000 bps (20%) for both owner and approved callers, with approved callers limited to adminMaxBps.
- Owner can set default fee, admin max, approved callers, and per-pool fee schedules.
- Swap behaviour
- beforeSwap computes a per-pool fee (flat, or tiered by quote-currency swap size) and returns it as an override fee on every swap. No return delta is taken, so swap amounts are not altered beyond the fee.
- Liquidity behaviour
- beforeAddLiquidity reverts with ExternalLPForbidden unless the sender is the owner or an approved caller, so only the factory-controlled side can add liquidity. No remove-liquidity callback is implemented; removal is handled by the PoolManager normally.
- Fee behaviour
- Per-swap dynamic fee via the override fee flag. Each pool uses a flat fee, or an optional owner-configured tiered schedule keyed on quote-currency swap size (tier0 below t1, tier1 between t1 and t2, tier2 at or above t2). Non-quote-denominated swaps pay tier1. Fallback is defaultFeeBps. All fees hard-capped at 2000 bps (20%).
- Owner & admin controls
- Owner (Ownable) can set the default fee and admin max (both capped at 20%), set the flat or tiered fee for any pool up to the 20% cap, grant or revoke approved callers, and transfer or renounce ownership. Approved callers (e.g. a factory) can set flat fees up to adminMaxBps. No pause, no upgrade mechanism (not a proxy).
Enabled Uniswap v4 callbacks
beforeInitialize, beforeAddLiquidity, beforeSwap
beforeInitialize: restricts pool initialization to the owner or approved callers to prevent front-run initialization at a bad price. beforeAddLiquidity: restricts liquidity provision to the owner or approved callers. beforeSwap: returns a per-swap dynamic fee override from the pool's fee configuration.
Security & trust assessment
Risk level: medium (verified source, high confidence).
Who controls it: The owner key can set any pool's fee to up to 20%, switch pools between flat and tiered schedules, change the default fee, and grant LP or initialization rights to any address. It cannot take custody of user funds or block swaps outright, since fees are capped and the hook returns no delta. Approved callers can set flat fees up to adminMaxBps.
Risk to user funds: The hook does not hold tokens and returns zero before-swap delta, so it cannot custody or directly seize pool funds. Exposure is indirect: the owner can raise fees on existing pools up to 20%, and it controls who can add liquidity.
Security findings
- [medium] Owner-adjustable swap fee: Owner can raise any pool's swap fee up to 20% (2000 bps) at any time, including after users have entered positions, which can extract value from traders.
- [low] Factory-gated liquidity: Only the owner or approved callers can add liquidity, so the pool is effectively controlled by the launch operator rather than open to outside LPs.
- [info] Initialization gated: Pool initialization is restricted to owner or approved callers, preventing third parties from initializing pools at manipulated prices.
- [info] Hard fee cap: Fee cap of 20% limits the owner from creating a sell-blocking honeypot, though a 20% fee is still substantial for traders.
- [info] Non-upgradeable: Immutable PoolManager reference and no proxy or upgrade path; the contract is not upgradeable.
Contract details
- Verified source
- Yes (RampHookExternal)
- Compiler
- solc 0.8.26+commit.8a97fa7a
- Bytecode size
- 3,823 bytes
- Upgradeable proxy
- No
- Detected patterns
- ownable
Pools using RampHookExternal
- WETH / DRILL (Dynamic fee) — 24h volume $0, TVL $0, 0 swaps today
- WETH / ATEST (Dynamic fee) — 24h volume $0, TVL <$0.01, 0 swaps today
- WETH / BS (Dynamic fee) — 24h volume $0, TVL $0, 0 swaps today
- WETH / DRILL2 (Dynamic fee) — 24h volume $0, TVL $0, 0 swaps today
- WETH / DFFDF (Dynamic fee) — 24h volume $0, TVL $0, 0 swaps today