Skip to content

feat: support dev buys via rehype - #544

Merged
Zodomo merged 2 commits into
mainfrom
zodomo/devbuy
Aug 14, 2026
Merged

feat: support dev buys via rehype#544
Zodomo merged 2 commits into
mainfrom
zodomo/devbuy

Conversation

@Zodomo

@Zodomo Zodomo commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

Description

Using transient storage we can open a temporary window for the first buy atomically bundled with an Airlock.create call to be exempted from non-protocol fees assessed by the rehype hook. By redesigning Bundler such that it calls into Uniswap's PoolManager directly, we can further constrain access to this window within the hook to the bundler only, such that ERC-4337 AA userOp bundling cannot inadvertently trigger the exemption. In this way, dev buys can be enabled only for the first swap atomically combined via our bundler explicitly. Any integrators or wrappers will have to call into our bundler, rather than delegating control to their own contracts. Only one exact-input buy using the configured numeraire is allowed, multi-hop routing is not supported. All of this preparation takes place within pool initialization, and because transient storage is used, these preparations are dropped if no buy transaction is bundled on launch. Dev buys can optionally be vested with an optional cliff and configurable durations as well.

Motivation

Many teams and integrators have asked for the ability to perform "dev buys", which is understood to be a fee exemption on the first post-market creation swap for teams launching new assets. Many teams configure their launches with an aggressive anti-sniper decaying fee, often starting at 80%, so this can make it difficult for them to acquire tokens from the market first. This mechanism allows them the exclusive privilege to buy without non-protocol fees assessed, without having to worry about timing their entry along the decaying tax curve. The tokens purchased can also be vested to increase community confidence.

Changes

  • Redesigned Bundler to atomically create a market and execute one exact-input buy directly through Uniswap v4’s PoolManager.
  • Added a transient, pool-specific Rehype fee exemption restricted to the authorized Bundler; the Airlock owner fee remains assessed.
  • Added optional linear vesting with configurable cliff, duration, and permissionless or recipient-only claims.
  • Added bundle simulation for quoting the resulting asset, pool, governance, timelock, and purchase output without retaining state.
  • Updated deployment scripts and versioning to deploy Bundler before Rehype and bind the authorized Bundler address.
  • Added integration, vesting, rollback, fee-exemption, simulation, and unsupported-initializer tests.
  • Expanded CI coverage across primary contracts, initializers, Bundler, Rehype, migrators, and invariants.
  • Updated Rehype documentation and added Bundler documentation.

@Zodomo Zodomo self-assigned this Aug 14, 2026
@github-actions

Copy link
Copy Markdown

Gas Benchmark Summary

Status: 0 regression(s), 6 improvement(s), 27 below-threshold change(s).
Net significant delta: -5,460 gas.
Largest improvement: migrate with Multicurve, Doppler Hook Initializer, Doppler Hook Migrator, Governance Factory -910 gas (-0.09%).

Changed Facets

Facet Regressions Improvements Net Delta
Balance limit Disabled 0 6 -5,460
Migration costs 0 6 -5,460
Proceeds split Disabled 0 6 -5,460

Top Improvements

Metric Facets Base Head Delta Delta %
migrate Multicurve, Doppler Hook Initializer, Doppler Hook Migrator, Governance Factory 1,057,421 1,056,511 -910 -0.09%
migrate Multicurve, Doppler Hook Initializer, Doppler Hook Migrator, Launchpad Governance Factory 1,057,421 1,056,511 -910 -0.09%
migrate Multicurve, Doppler Hook Initializer, Doppler Hook Migrator, No-op Governance Factory 1,057,368 1,056,458 -910 -0.09%
migrate Multicurve, Doppler Hook Initializer, Uniswap V2 Migrator Split, Governance Factory 699,276 698,366 -910 -0.13%
migrate Multicurve, Doppler Hook Initializer, Uniswap V2 Migrator Split, Launchpad Governance Factory 699,276 698,366 -910 -0.13%

1 more significant change(s) hidden below.

All significant changes by section

Migration costs

Metric Facets Base Head Delta Delta %
migrate Multicurve, Doppler Hook Initializer, Doppler Hook Migrator, Governance Factory 1,057,421 1,056,511 -910 -0.09%
migrate Multicurve, Doppler Hook Initializer, Doppler Hook Migrator, Launchpad Governance Factory 1,057,421 1,056,511 -910 -0.09%
migrate Multicurve, Doppler Hook Initializer, Doppler Hook Migrator, No-op Governance Factory 1,057,368 1,056,458 -910 -0.09%
migrate Multicurve, Doppler Hook Initializer, Uniswap V2 Migrator Split, Governance Factory 699,276 698,366 -910 -0.13%
migrate Multicurve, Doppler Hook Initializer, Uniswap V2 Migrator Split, Launchpad Governance Factory 699,276 698,366 -910 -0.13%
migrate Multicurve, Doppler Hook Initializer, Uniswap V2 Migrator Split, No-op Governance Factory 682,176 681,266 -910 -0.13%

Comment thread src/dopplerHooks/RehypeDopplerHookInitializer.sol
Comment thread src/Bundler.sol Outdated
Comment thread src/Bundler.sol Outdated
@Zodomo
Zodomo merged commit 8b1fe7b into main Aug 14, 2026
3 checks passed
@Zodomo
Zodomo deleted the zodomo/devbuy branch August 14, 2026 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants