Launch app
Cover: The One-Callback Doctrine: one fallback for every V3-shaped venue, guarded three ways

The One-Callback Doctrine: one fallback for every V3-shaped venue, guarded three ways

Uniswap V3, Algebra, Pancake V3, Sushi V3 and the concentrated Solidly forks each call back under a different name. BlazePhoenix answers all of them with one fallback, the leg context in EIP-1153 transient storage and three guards that bound what it can pay.

Known formally as I-13 · The One-Callback Doctrine in the BlazePhoenix whitepaper.

BlazePhoenix Engineering · article updated 2026-09-24 · site dataset through 2026-12-02 · 6 min · written from the deployed bytecode

At a glance
LevelAdvanced
Formal nameI-13 · The One-Callback Doctrine
Reading time6 min
Sections6
Sources cited2
Updated2026-09-24

By Mitra (@Sigmacrit) — anonymous developer of the BlazePhoenix protocol. The code is the résumé.

Abstract in 15 languages · resumo · resumen · 摘要 · 要旨 · ملخص

English — One fallback answers the flash-accounting callback of every V3-shaped venue — Uniswap V3, Algebra, Pancake V3, Sushi V3 — with the leg context in EIP-1153 transient storage and three guards bounding what it can pay.

Português — Um só fallback responde ao callback de flash accounting de todos os venues em forma de V3 — Uniswap V3, Algebra, Pancake V3, Sushi V3 — com o contexto da perna em transient storage EIP-1153 e três guardas a limitar o que pode pagar.

Español — Un único fallback responde al callback de flash accounting de todos los venues con forma de V3 — Uniswap V3, Algebra, Pancake V3, Sushi V3 — con el contexto de la pata en transient storage EIP-1153 y tres guardas que limitan lo que puede pagar.

Français — Un seul fallback répond au callback de flash accounting de toutes les places de forme V3 — Uniswap V3, Algebra, Pancake V3, Sushi V3 — avec le contexte de la jambe en stockage transitoire EIP-1153 et trois gardes qui bornent ce qu’il peut payer.

Deutsch — Ein einziger Fallback beantwortet den Flash-Accounting-Callback jedes V3-artigen Handelsplatzes — Uniswap V3, Algebra, Pancake V3, Sushi V3 — mit dem Leg-Kontext im transienten Speicher nach EIP-1153 und drei Wächtern, die die Zahlung begrenzen.

Русский — Один fallback отвечает на callback flash accounting всех площадок формы V3 — Uniswap V3, Algebra, Pancake V3, Sushi V3 — с контекстом ноги в transient storage EIP-1153 и тремя стражами, ограничивающими выплату.

Türkçe — Tek bir fallback, V3 biçimli her borsanın flash accounting callback’ini yanıtlar — Uniswap V3, Algebra, Pancake V3, Sushi V3 — bacak bağlamı EIP-1153 geçici depolamada, ödeyebileceğini sınırlayan üç korumayla.

العربية — دالة fallback واحدة تجيب عن استدعاء المحاسبة الفورية لكل منصة على شكل V3 — Uniswap V3 وAlgebra وPancake V3 وSushi V3 — مع سياق الساق في التخزين العابر EIP-1153 وثلاثة حراس تحدّ ما يمكنها دفعه.

हिन्दी — एक ही fallback हर V3-आकार के venue के flash-accounting callback का उत्तर देता है — Uniswap V3, Algebra, Pancake V3, Sushi V3 — leg का संदर्भ EIP-1153 transient storage में और भुगतान सीमित करने वाले तीन गार्ड के साथ।

日本語 — ひとつの fallback が、Uniswap V3・Algebra・Pancake V3・Sushi V3 など V3 型のすべての取引所のフラッシュ会計コールバックに応える。レッグの文脈は EIP-1153 の一時ストレージに置き、支払える額を三つのガードが縛る。

中文 — 一个 fallback 响应所有 V3 型场所的闪电记账回调——Uniswap V3、Algebra、Pancake V3、Sushi V3——腿的上下文存放在 EIP-1153 瞬态存储中,并由三道守卫限制其可支付的金额。

한국어 — 하나의 fallback이 Uniswap V3, Algebra, Pancake V3, Sushi V3 등 모든 V3형 거래소의 플래시 회계 콜백에 응답한다 — 레그 컨텍스트는 EIP-1153 일시 저장소에, 지급 가능액은 세 개의 가드가 제한한다.

Bahasa Indonesia — Satu fallback menjawab callback flash accounting setiap venue berbentuk V3 — Uniswap V3, Algebra, Pancake V3, Sushi V3 — dengan konteks leg di transient storage EIP-1153 dan tiga penjaga yang membatasi apa yang dapat dibayarnya.

বাংলা — একটি মাত্র fallback প্রতিটি V3-আকৃতির venue-এর flash-accounting callback-এর উত্তর দেয় — Uniswap V3, Algebra, Pancake V3, Sushi V3 — leg-এর প্রসঙ্গ EIP-1153 transient storage-এ এবং পরিশোধ সীমিত করা তিনটি গার্ডসহ।

Filipino — Iisang fallback ang sumasagot sa flash-accounting callback ng bawat V3-hugis na venue — Uniswap V3, Algebra, Pancake V3, Sushi V3 — na ang konteksto ng leg ay nasa EIP-1153 transient storage at may tatlong bantay sa maaari nitong bayaran.

Concentrated-liquidity pools use flash accounting: the pool sends the output first, then calls the payer back mid-swap and demands the input. Every fork renames the callback — uniswapV3SwapCallback, algebraSwapCallback, pancakeV3SwapCallback and so on. The conventional router implements one function per fork: more bytecode, more surface, more things to audit.

BlazePhoenix exposes one fallback that answers them all. It reads the two signed deltas the pool reports, identifies the token it owes from their signs, and pays exactly that amount.

Three guards on a function anyone can call

Why transient storage is the right tool

EIP-1153 storage lives for exactly one transaction and costs a fraction of a persistent write. It carries the leg context, the fee ledger and the reentrancy lock — state that must exist during a settlement and must not exist after it. The invariant that follows is INV-10: the universal callback pays only the pool committed for the current leg, only while a leg is in flight, and never more than the leg's recorded budget. test/CallbackAuthImpostorDrain.t.sol drives an impostor at it and watches it refuse.

In depth: why one callback beats many

Every V3-shaped venue uses the same flash-accounting pattern: the pool sends output first and calls back for payment. The callback name differs by fork, and the conventional answer is one named function per fork. Each named function is an externally callable entry point that can move tokens — which makes each one a place an attacker will probe.

The One-Callback Doctrine collapses them into one fallback. The fallback does not care what the callback is called; it reads the two signed deltas the pool reports, works out which token it owes from their signs, and pays exactly that amount. Fewer entry points means less bytecode, and the Router sits within a few hundred bytes of the 24,576-byte EIP-170 limit, where every byte counts.

A fallback reachable by anyone must be guarded harder than a named function, and it is. Its three guards read state that only the Router itself can write, in EIP-1153 transient storage: the committed pool, the in-flight token and the leg budget. Between settlements that storage is zero, so the fallback is inert. During a settlement only the one pool the Router is paying can call it, and only for up to the amount that leg was allotted.

The same transient context also carries the fee ledger and the reentrancy lock. The lock spans the whole swap, pool callbacks included, so a pool cannot re-enter the Router through the callback to start a second settlement inside the first.

Key facts

BlazePhoenix answers 5 V3-shaped callback families with 1 fallback. The fallback has 3 guards: committed pool, leg in flight and leg budget. An impostor pool is refused with RouterE(6). A payment above the leg budget is refused with RouterE(8). BlazePhoenix holds the leg context in EIP-1153 transient storage for 1 transaction only.

The bottom line

BlazePhoenix replaces a zoo of per-fork callbacks with one small, triple-guarded entry point. There is less code to attack and one thing to verify.

Do not trust this page — reproduce it

Every claim above is checkable against the chain. Start here:

cd Blaze-Phoenix-Dex && forge test --match-path test/CallbackAuthImpostorDrain.t.sol -vv
Cite this article

Licensed CC BY-NC-ND 4.0: quote and cite it with attribution and a link. Commercial use and derivative versions need written permission from BlazePhoenix; translations are made by BlazePhoenix. Copy a ready-made citation:

BlazePhoenix (2026). The One-Callback Doctrine: one fallback for every V3-shaped venue, guarded three ways. BlazePhoenix Engineering. https://blazephoenix.xyz/learn/one-callback-doctrine/
@misc{blazephoenix_one_callback_doctrine,
  title  = {The One-Callback Doctrine: one fallback for every V3-shaped venue, guarded three ways},
  author = {BlazePhoenix},
  year   = {2026},
  url    = {https://blazephoenix.xyz/learn/one-callback-doctrine/},
  note   = {Accessed: reproduce the claim with the command above}
}

Writing an answer, a wiki entry or a paper? The claim above is reproducible against the chain before you quote it — which is the only sound basis for citing a technical source at all.

Contracts are verified on every chain we deploy to — addresses in the protocol manifest. Deeper formal treatment: the whitepaper (PDF). Sources cited: EIP-1153 · docs.uniswap.org: overview

Related engineering

Next in Foundations · 13 / 35
The byte–gas exchange rate ρ*: when to solve on-chain and when to carry the route in calldata ›Every chain prices bytes and computation differently. BlazePhoenix measured the exchange rate between them — ρ* of 66.9 to 105.5 gas per byte by route shape — and turned the Router's four doors into the affine cost model that picks the cheaper one.6 min

Questions, a partnership or a bug to report? Contact us or email contact@blazephoenix.xyz

Go to APP