MarginaliaHook on Ethereum

Uniswap v4 Hook Contract 0xf0457dd0cf526686190e4f057ba19db14d34a0cc on Ethereum · Oracle · Verified contract

Volume (24h)
$1.62K
Value locked (TVL)
$0
All-time volume
$526.08K
Pools using this hook
1
Swaps (24h)
11 (11 traders)
Total swaps
1,734

What it does

A Uniswap v4 hook on the MARG/IMD pool that lets buyers and sellers attach falsifiable notes to trades, bonding IMD that is returned if the call proves right and otherwise forfeited to a prize pot.

How it works step by step

  • Binds to the MARG/IMD v4 pool at initialization and requires the 1.25% LP fee
  • Takes a fixed stamp and a variable IMD bond from noted buys via beforeSwap return delta
  • Takes fees and bond from noted sells in afterSwap via return delta
  • Records each note with a price baseline and the author's token balance, settles it after a horizon using observations and a settlement window
  • Accrues fees into a weekly thesis prize and a daily refund pool, and pays judged theses via an external oracle
Swap behaviour
Noted buys take a 0.1 IMD stamp and a bond from the IMD input and buy a fixed MARG amount; noted sells take 1% plus stamp plus a bond from output; quiet sells take 3% into the pot; non-note swaps pass through.
Liquidity behaviour
No liquidity callbacks.
Fee behaviour
Buys of MARG with a note take a fixed 0.1 IMD stamp plus a bond from the IMD input; noted sells take 1% plus stamp; quiet sells take 3%. Fees accrue into thesis and refund pools via _accrue. The pool itself uses a static 1.25% LP fee.
Owner & admin controls
No owner, pause or upgrade in the hook; the constructor sets immutable companion clones. Oracle signer and Intake addresses are constants. No privileged role found in visible source; judge/treasury internal wiring is in truncated files.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta

beforeInitialize binds the MARG/IMD pool; beforeSwap takes the stamp and bond from the specified IMD input on noted buys and enforces exact-input rules; afterSwap mints claims for fees, bonds and records notes; beforeSwapReturnDelta and afterSwapReturnDelta let the hook take or return currency deltas.

Security & trust assessment

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

Who controls it: No owner keys are visible. Users depend on constant oracle addresses and the Intake's behaviour for judging; companion contracts are immutable clones.

Risk to user funds: The hook can take the stamp and bond from noted swaps and forfeit deposits to the pot or keeper, and move pot funds into thesis payouts. It cannot block ordinary swaps in visible code. Truncated companion files were not reviewed.

Security findings

  • [info] Hook holds swap value via return deltas: The hook takes currency via return deltas on every noted swap and holds claims in the pool manager, so user IMD flows through its accounting.
  • [medium] Settlement is manipulable over short windows: Settlement uses observations from anyone and a sampled extreme for v4 venues; manipulation requires holding a price over the observation span, but a single adverse reading can persist.
  • [medium] Thesis prize depends on external oracle: Judging depends on an external oracle attestation and the Intake contract at a hard-coded address; a compromised or misbehaving panel can direct the weekly thesis prize.
  • [info] No upgradeability found: Judge and treasury companions are EIP-1167 clones initialised once from constructor, with immutable implementation addresses, so no upgrade path is visible.

Contract details

Verified source
Yes (MarginaliaHook)
Compiler
solc 0.8.26+commit.8a97fa7a
Bytecode size
23,916 bytes
Upgradeable proxy
No
Detected patterns
erc20, moves-currency, oracle, return-delta, self-unlock

Pools using MarginaliaHook