OctoHook on Ink
Uniswap v4 Hook Contract 0x1c6bcb72255a3f7901151dfcff84cc0bf6cfaacc on Ink · Dynamic fee · Verified contract
- Volume (24h)
- $59
- Value locked (TVL)
- $21.99K
- All-time volume
- $306.34K
- Pools using this hook
- 1
- Swaps (24h)
- 2 (1 traders)
- Total swaps
- 3,060
What it does
An ETH/OCTO hook that takes a decaying anti-sniper and standing swap fee on the ether side of every trade, splits it between a Quotron builders pool and a dev wallet, and uses incoming ether to buy and burn OCTO within rate limits.
How it works step by step
- Gates trading on the ETH/OCTO pool until the Octocore collection reaches the opening mint threshold, then latches the opening time.
- Charges a decaying opening fee (linear decay over 10 minutes) and a standing fee on the ether leg of every swap.
- Splits each fee by rate: the standing share accrues to the Quotron builders pool and the anti-sniper premium to the dev wallet, both paid out by anyone via flush functions.
- Queues mint shares and unwrapped royalties and uses them to buy and burn OCTO through the pool, limited per 12-second window by price shift and an ether cap.
- Restricts liquidity provision and pool initialization to the hook itself, so only the owner can seed or remove liquidity.
- Swap behaviour
- Gates trading until the collection reaches its opening mint count. Takes a swap fee on the ether leg in beforeSwap or afterSwap depending on which side is specified, using a decaying opening fee. Enforces no partial fills. Runs a rate-limited buyback at the end of each swap.
- Liquidity behaviour
- Only the hook itself may add or remove liquidity to its ETH/OCTO pool, and only the owner can trigger addLiquidity or removeLiquidity. Ether not reserved for queue, Quotron and dev is folded into the buyback queue on add. Removal pays the owner the free ether and all OCTO held by the hook. External liquidity providers are blocked by beforeAddLiquidity and beforeRemoveLiquidity requiring sender == hook; beforeDonate and afterAddLiquidity/afterRemoveLiquidity revert.
- Fee behaviour
- Swap fee is taken on the ether leg of every swap at currentFee(), which starts at a decaying opening fee (decayStartBps, up to 50%) and decays linearly over 600 seconds to the standing feeBps (default 2.5%, bounds 0.06% to 5%). Fees are taken in beforeSwap when ether is the specified side and in afterSwap otherwise. The fee is split by rate: the standing portion accrues to quotronDue (Quotron builders pool) and the anti-sniper premium above it accrues to devDue (dev wallet). Both are paid out via permissionless flushQuotron and flushDev. Mint shares from the collection also credit quotronDue, and the remainder queues for the buyback.
- Owner & admin controls
- Owner (single key, Solady Ownable with two-step handover) can: bind the collection once via setCollection; set standing fee (6 to 500 bps) via setFee; set opening decay fee (up to 5000 bps) via setDecayStart before trading opens; set quotron and dev payout addresses; set buyback shift (10 to 500 bps) and per-window cap (up to 1 ether) via setShift and setCap; create the pool via createPool; add and remove the hook's own liquidity; withdraw the buyback queue via withdrawQueue; renounce ownership once the collection, pool, quotron and dev are set. The owner can also upgrade the implementation (UUPS): stageUpgrade pins a candidate's codehash, then upgradeToAndCall replaces the logic with a checked but arbitrary new implementation, with no timelock. Ownership transfer is possible via transferOwnership and requestOwnershipHandover.
Enabled Uniswap v4 callbacks
beforeInitialize, beforeAddLiquidity, beforeRemoveLiquidity, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta
beforeInitialize: restricts pool initialization to the hook itself. beforeAddLiquidity and beforeRemoveLiquidity: restrict liquidity changes to the hook itself on the one pool. beforeSwap: opens trading (gate on collection mint count), anchors the buyback window price, and takes the fee on the ether leg when ether is the specified side. afterSwap: enforces no partial fills, takes the fee when ether is the unspecified side, books the fee and runs the buyback tail. beforeSwapReturnDelta and afterSwapReturnDelta: allow the hook to take its fee as a delta on the swap, so it can hold ether and OCTO in the pool as part of settlement.
Security & trust assessment
Risk level: medium (verified source, high confidence).
Who controls it: A single owner key controls fee level (up to 5%), an opening decay of up to 50%, the buyback shift and cap, payout destinations for Quotron and dev, the buyback queue withdrawal, pool liquidity removal, and the ability to upgrade the implementation to arbitrary logic with no timelock. A compromised key could redirect fees, drain the queue, or push a malicious upgrade that changes swap semantics (L3 semantics are not enforced on chain). Renouncing ownership removes all of this once the setup conditions are met.
Risk to user funds: The hook holds ether and OCTO for fee accounting, the buyback queue, Quotron and dev balances, and the pool's own position. It can take a fee from every swap and move funds to the owner through withdrawQueue, removeLiquidity and upgrades. Users depend on the owner not changing fees or swap logic, and on the upgrade gating holding. The hook does not block swaps on recipient failures because payouts are pulled.
Security findings
- [high] Upgradeable proxy controlled by a single owner key: The owner can upgrade the implementation through stageUpgrade and upgradeToAndCall with no timelock. The code checks codehash, immutables, flags and callback dispatch, but cannot verify the semantics of the new logic. A single key can change fee, payout and swap logic.
- [medium] Owner-adjustable fee and payout destinations: Owner can set the standing fee up to 500 bps and the opening decay fee up to 5000 bps, and set Quotron and dev payout addresses. The fee is taken from every trader, so a raised fee or redirected payout directly transfers user value.
- [medium] Owner can withdraw queued ether and pool liquidity: Owner can withdraw the buyback queue (withdrawQueue) and remove all hook liquidity (removeLiquidity), which pays out free ether and all OCTO held by the hook to the owner.
- [info] Pull-based fee payouts isolate recipient failures: Flush functions accrue fees to quotronDue and devDue and push them out in a separate permissionless call. A reverting recipient cannot block swaps, which limits the effect of a bad payout address to its own share.
- [info] Buyback is rate-limited and renouncement is gated: The buyback is bounded per 12-second window by a price shift limit and an ether cap, and is subject to a shift-versus-fee check that keeps sandwiching the buyback unprofitable. Ownership renouncement requires the pool to be live with liquidity and the payout addresses set.
Contract details
- Verified source
- Yes (OctoHook)
- Compiler
- solc 0.8.25+commit.b61c2a91
- Bytecode size
- 61 bytes
- Upgradeable proxy
- Yes
- Detected patterns
- dynamic-fee, erc20, moves-currency, ownable, return-delta, self-unlock, upgradeable
Pools using OctoHook
- ETH / OCTO (0.00% fee) — 24h volume $59, TVL $21.99K, 2 swaps today