BackGeoOracle on Optimism

Uniswap v4 Hook Contract 0x79234983ded8eaa571873fffe94e437e11c7fac4 on Optimism · Oracle · Verified contract

Volume (24h)
$1.10K
Value locked (TVL)
$3.11K
All-time volume
$42.69K
Pools using this hook
5
Swaps (24h)
7,900 (72 traders)
Total swaps
276,984

What it does

An oracle hook that records time-weighted price observations for each pool on every swap and liquidity change, so anyone can read historical tick data from the pool.

How it works step by step

  • Initializes an observation array for each pool when the pool is created (afterInitialize).
  • Writes a new price observation (tick and accumulated tick value) after each swap, as indicated by the afterSwap and beforeSwap entry points and the cardinality storage.
  • Lets the pool's observation buffer be enlarged via increaseCardinalityNext so it can store more history.
  • Exposes read functions observe, getObservation, getState and observations so other contracts can compute time-weighted average prices.
  • Restricts oracle use to full-range positions: liquidity add and remove hooks revert with OraclePositionsMustBeFullRange when positions are not full range.
  • Uses ERC6909 claims (mint) and return deltas, indicating it can take or settle tokens on behalf of the pool manager.
Swap behaviour
beforeSwap and afterSwap are implemented. They read and update observation state for the pool, and afterSwapReturnDelta is enabled, so afterSwap can adjust the amounts settled with the pool manager.
Liquidity behaviour
beforeAddLiquidity and beforeRemoveLiquidity are implemented and enforce that only full-range positions are allowed, reverting with OraclePositionsMustBeFullRange otherwise. afterAddLiquidity and afterRemoveLiquidity are view functions that do not change state.
Fee behaviour
Uses the pool's static fee. No dynamic fee function was found in the decoded selectors.
Owner & admin controls
No owner, pause, upgrade or parameter-setting functions were found in the decoded selectors. Observation cardinality can be increased by any caller via increaseCardinalityNext, which is permissionless.

Enabled Uniswap v4 callbacks

beforeInitialize, afterInitialize, beforeAddLiquidity, beforeRemoveLiquidity, beforeSwap, afterSwap, afterSwapReturnDelta

beforeInitialize and afterInitialize set up observation storage for a new pool. beforeSwap and afterSwap record price observations. afterSwapReturnDelta lets the hook take or return tokens from swaps. beforeAddLiquidity and beforeRemoveLiquidity restrict liquidity to full range.

Security & trust assessment

Risk level: medium (decoded bytecode, medium confidence).

Who controls it: No privileged roles were identified in the decoded functions. Holders have no visible admin key that could change fees or pause the hook.

Risk to user funds: The hook is permitted to move tokens through return deltas and ERC6909 minting during swaps, so it can take a share of swap value. Liquidity restrictions can block non-full-range deposits and withdrawals of such positions, but no general pause was found.

Security findings

  • [medium] Return delta grants the hook a share of swap amounts: afterSwapReturnDelta is enabled and the bytecode references mint and ERC6909 claim handling, so the hook can take a portion of swap output as claims. The exact amount and conditions cannot be confirmed without source.
  • [low] Permissionless observation cardinality growth: increaseCardinalityNext has no visible access check in the decoded functions, so anyone can grow a pool's observation storage and pay the gas cost of the writes.
  • [info] Full-range restriction on liquidity: beforeAddLiquidity and beforeRemoveLiquidity revert for non-full-range positions, which prevents concentrated liquidity in pools using this hook.
  • [info] Unverified source: No verified source is available, so the analysis relies on selectors, storage layout and permission flags.

Contract details

Verified source
Yes (BackGeoOracle)
Compiler
solc 0.8.26+commit.8a97fa7a
Bytecode size
11,497 bytes
Upgradeable proxy
No
Detected patterns
erc6909-claims, oracle, return-delta

Pools using BackGeoOracle