RubickHook on Ethereum
Uniswap v4 Hook Contract 0xeef6bfe24769184ef354f0d0c707b62324f050c0 on Ethereum · Other · Verified contract
- Volume (24h)
- $3.59K
- Value locked (TVL)
- $5.83
- All-time volume
- $3.59K
- Pools using this hook
- 1
- Swaps (24h)
- 40 (20 traders)
- Total swaps
- 40
What it does
A Uniswap v4 dynamic-fee hook that tracks a virtual Rubik's cube per pool, where each sufficiently large swap turns the cube and the top-face colors set the next swap's LP fee, with solving the cube granting a temporary low-fee window.
How it works step by step
- Initializes each pool with a 25-move pseudo-random scramble of a packed 3x3 cube and requires the pool to use a dynamic fee.
- Sets the LP fee on every swap to the average fee tier of the nine U-face stickers, with each color mapped to a fee tier.
- Turns one face per qualifying swap: zeroForOne swaps turn clockwise and the others counter-clockwise, with the face chosen pseudo-randomly unless the swapper supplies a move in hookData.
- Records the player who solves the cube as lastSolver, sets a golden hour of GOLDEN_FEE for goldenBlocks blocks and rescrambles the cube.
- Ignores swaps below minMoveAmount so dust swaps cannot steer the cube.
- Swap behaviour
- beforeSwap sets the LP fee to GOLDEN_FEE during a golden hour or to the average U-face color fee otherwise. afterSwap turns the cube for swaps of at least minMoveAmount, emitting Rotated, and if the cube is solved it emits Solved, starts a golden hour and rescrambles with Scrambled.
- Liquidity behaviour
- No liquidity callbacks.
- Fee behaviour
- Dynamic fee overridden on every swap: the fee is GOLDEN_FEE (0.01%) during a golden hour, otherwise the average of the nine U-face sticker color fee tiers (white 0.05%, red 1.00%, green 0.30%, yellow 0.10%, orange 0.75%, blue 0.50%). Fees are not shared with any party.
- Owner & admin controls
- No admin controls found. No owner, pause, upgrade or parameter setter in the ABI; minMoveAmount and goldenBlocks are immutable constructor parameters.
Enabled Uniswap v4 callbacks
afterInitialize, beforeSwap, afterSwap
afterInitialize: requires the pool to use a dynamic fee and scrambles the cube for the new pool. beforeSwap: returns the current cube-derived LP fee with the override flag. afterSwap: applies one cube turn for swaps whose size is at least minMoveAmount, and handles solve detection and rescrambling.
Security & trust assessment
Risk level: low (verified source, high confidence).
Who controls it: No privileged key is present in the source, so no single party can alter fees, pause swaps or move funds. Outcomes depend on block.prevrandao and block.timestamp, which validators can influence to a limited degree.
Risk to user funds: The hook does not hold, move or take tokens (beforeSwapReturnDelta and afterSwapReturnDelta are disabled) and has no pause or withdrawal path. Swaps only pay a fee that is set by the cube state, so user funds are exposed only through the fee level and the pool's own liquidity.
Security findings
- [medium] Predictable pseudo-randomness for scrambles and auto moves: The cube move and scramble seeds use block.prevrandao and block.timestamp, which proposers can influence. A proposer could bias which face turns and when a cube is solved, letting them capture the golden hour fee and solver record.
- [low] Golden hour can be targeted by searchers: Solving the cube sets a golden hour of 0.01% fees for goldenBlocks blocks. Searchers can attempt to plan the solving swap, using hookData to pick the exact move and monopolise the cheap-fee window.
- [info] Solver attribution comes from user-supplied hookData: Solving records msg.sender-derived player data from hookData without authentication; the solver field can be set by the caller to any address, so solver attribution is spoofable.
- [info] No custody of user funds: The hook never takes or holds tokens, uses no return deltas and is not upgradeable, so it cannot custody or block pool funds.
Contract details
- Verified source
- Yes (RubickHook)
- Compiler
- solc 0.8.26+commit.8a97fa7a
- Bytecode size
- 6,850 bytes
- Upgradeable proxy
- No
- Detected patterns
- dynamic-fee
Pools using RubickHook
- RUBICK / WETH (Dynamic fee) — 24h volume $3.59K, TVL $5.83, 40 swaps today