JrnyHook on Ethereum

Uniswap v4 Hook Contract 0xaeaba72a2142547b73c6bb1b2eacb228b58500cc on Ethereum · Dynamic fee · Verified contract

Volume (24h)
$0
Value locked (TVL)
$0
All-time volume
$0.20
Pools using this hook
1
Swaps (24h)
0 (0 traders)
Total swaps
3

What it does

A fee-collecting hook for ETH-paired pools that takes a configurable percentage of each swap's ETH side, optionally with a time-decaying shock fee, and distributes the proceeds to protocol fee receivers.

How it works step by step

  • Takes a fee in ETH from swaps on the ETH side via poolManager.take and return deltas in beforeSwap and afterSwap
  • Computes the fee as amount times a compounded fee (sum of receiver percentages, capped by maxCompoundedFee) divided by 10000
  • Supports a shock-fee window where the fee starts at maxCompoundedFee and decays linearly to the base fee over time
  • Allows fee direction to be limited to buys, sells or both
  • Accumulates fees and distributes them proportionally to receivers automatically over a threshold or on demand via distributeFees
  • Stashes failed distribution transfers and lets the owner withdraw the stash or all ETH
Swap behaviour
Buys that specify input ETH and sells that specify output ETH are charged in beforeSwap; buys with exact output and sells with exact input are charged in afterSwap. In each case the fee is taken from the ETH amount and reported as a return delta. Swaps revert if currency0 is not native ETH.
Liquidity behaviour
No liquidity callbacks.
Fee behaviour
Hook takes a fee from the ETH side of every swap, computed as amount times a compounded fee (sum of receiver percentages, default 0 to 99.00%) divided by 10000. The fee is taken with poolManager.take and reported as the swap return delta. During a shock-fee window set by the owner or an operator, the fee decays linearly from maxCompoundedFee toward the base compounded fee; fee direction (buy, sell or both) can restrict which side it applies to. Accrued fees are distributed proportionally to receivers automatically when the threshold is met during swaps, or manually via distributeFees; failed transfers are stashed.
Owner & admin controls
Owner (OwnableUpgradeable) can upgrade the implementation via UUPS (_authorizeUpgrade onlyOwner), set and remove protocol fee receivers and their percentages (setReceiver, removeReceiver), set maxCompoundedFee up to 99.99%, set minRequiredGatheredFees, configure shock-fee start/end timestamps and fee direction (setTimestampStartEnd, setFeeDirection, setSunrise), grant or revoke operators (setOperator), and withdraw all ETH via emergencyWithdraw or emergencyWithdrawStash. Operators can change fee direction and shock-fee timing via operatorSetTimestampStartEnd, but only before the sunrise time. There is no pause function.

Enabled Uniswap v4 callbacks

beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta

beforeSwap: takes the ETH fee on exact-input buys and exact-output sells and returns it as a delta, and auto-distributes accrued fees. afterSwap: takes the ETH fee on exact-output buys and exact-input sells and returns it as a delta, and auto-distributes accrued fees. beforeSwapReturnDelta and afterSwapReturnDelta: allow the hook to take a share of swap amounts, which is how the fee is collected.

Security & trust assessment

Risk level: high (verified source, high confidence).

Who controls it: The owner can set any receiver fee so that the compounded fee reaches up to 99.99% (the cap check is on the setMaxCompoundedFee value, while receiver percentages are not bounded individually), shifting nearly all ETH swap value to receivers or the owner. The owner can also withdraw all ETH held by the hook at any time, upgrade the implementation to arbitrary logic that could steal or block funds, and grant operators the ability to alter fee direction and shock timing. Because the owner controls the upgrade path, the code running behind the proxy can change at any point.

Risk to user funds: The hook holds ETH collected from swaps before distribution and can take a share of every swap through return deltas. The owner can withdraw held ETH at will and can upgrade to logic that moves or blocks funds, so user-facing swap value depends on the owner's honesty and key security.

Security findings

  • [high] Unrestricted upgradeability by owner: The owner can upgrade the proxy implementation through UUPS with no timelock, giving arbitrary control over swap logic and funds.
  • [medium] Owner can set very high swap fees: setReceiver does not cap individual fees, and compoundedFee is the sum of all receiver percentages, so the owner can push the swap fee close to 100% by adding receivers, subject only to a maxCompoundedFee cap that is applied in the dynamic fee read path.
  • [medium] Owner can withdraw all held ETH: emergencyWithdraw and emergencyWithdrawStash let the owner send any ETH held by the hook to the owner address, which includes accrued but undistributed fees.
  • [low] Fee distribution uses low-level ETH transfers: Any user can trigger distributeFees; receivers are paid via low-level calls with failure stashing, and the last receiver receives the rounding remainder, so receiver ordering is set by the owner.
  • [info] Only native-ETH-paired pools supported: Swaps revert with ProtocolTokenNotSupported unless currency0 is native ETH, so the hook only works for ETH pools.

Contract details

Verified source
Yes (JrnyHook)
Compiler
solc 0.8.26+commit.8a97fa7a
Bytecode size
122 bytes
Upgradeable proxy
Yes
Detected patterns
dynamic-fee, fee-sharing, liquidity-management, moves-currency, ownable, return-delta, upgradeable

Pools using JrnyHook