Skip to content

Make BuybackBurner venue-neutral and add BuybackBurnerUniswapV3 #1000

Closed

Description

@alpergundogdu

Context

FeeRouter routes the 30% buyback bucket by transferring USDC to a buybackBurner address, swappable in one governance call via setBuybackBurner (FeeRouter.sol). FeeRouter never calls a swap method — it only safeTransfers USDC — so it is already fully agnostic to the swap venue.

The only concrete burner today is BuybackBurnerBalancerV3. However, Balancer V3 is not deployed on Arbitrum Sepolia (the testnet target per CLAUDE.md) — the singleton Vault 0xbA13… has no code there. Uniswap V3 is live on Arbitrum Sepolia (factory 0x248AB79…, QuoterV2 0x2779a0…). So the initial testnet network needs a Uniswap V3 burner; the Balancer path can be swapped in later, once Balancer V3 reaches Arb Sepolia, with no FeeRouter change.

Problem

The abstract BuybackBurner base bakes in Balancer-specific wiring that a Uniswap burner cannot reuse cleanly:

  • balancerVault / balancerPool storage
  • setPool / setVault setters + PoolUpdated / VaultUpdated events
  • the if (balancerPool == 0 || balancerVault == 0) revert PoolNotWired() check inside executeBuyback

Proposed change

  1. Make the base venue-neutral. Lift the Balancer-specific storage, setters, and events down into BuybackBurnerBalancerV3. Replace the base's hard wiring check with an abstract _requireWired() hook each venue implements (still reverting the shared PoolNotWired). The base keeps everything genuinely shared: roles, usdc/token, the executeBuyback skeleton (amount/minOut checks, balance bound, TOKEN-balance-delta verification, burn, event), the _performSwap hook, rescueUSDC, pause.
  2. Add BuybackBurnerUniswapV3. A concrete sibling: single exactInputSingle USDC→TOKEN swap via SwapRouter02, with the same security posture as the Balancer burner:
    • scoped router approval (forceApprove(router, amountIn) then reset to 0),
    • governed slippageBps / minBuybackAmount / maxBuybackAmount band,
    • on-chain TWAP minOut floor sourced from the V3 pool's native observe() oracle (no hand-rolled accumulator needed, unlike Balancer V3), fail-closed until the observation window matures,
    • per-epoch USDC liquidity cap for parity.
  3. Tests + green CI (forge fmt, FOUNDRY_PROFILE=ci forge build --deny warnings, forge test, slither, aderyn).

Out of scope

  • Deploying/seeding the pool itself (operational).
  • FeeRouter changes — none needed; it is already venue-agnostic.

Testnet rollout

Wire BuybackBurnerUniswapV3 on Arbitrum Sepolia now; swap to BuybackBurnerBalancerV3 via setBuybackBurner once Balancer V3 lands there. Relates to ADR 018 (liquidity strategy) and ADR 026 (FeeRouter split / burn).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions