Verify the calldata before you sign: the check that refuses a changed swap
How do you check that swap calldata does what you asked before you sign it?
Run verifySwapExactIn from the BlazePhoenix SDK on the calldata you are about to sign. It decodes the bytes and compares them with your request. A changed recipient or a lowered minimum is refused with calldata_mismatch.
BlazePhoenix Engineering · article updated 2026-11-20 · site dataset through 2026-11-30 · 6 min · written from the deployed bytecode
At a glance
Level
Intermediate
Reading time
6 min
Sections
6
Updated
2026-11-20
By Mitra (@Sigmacrit) — anonymous developer of the BlazePhoenix protocol. The code is the résumé.
Abstract in 15 languages · resumo · resumen · 摘要 · 要旨 · ملخص
English — Run verifySwapExactIn from the BlazePhoenix SDK on the calldata you are about to sign. It decodes the bytes and compares them with your request. A changed recipient or a lowered minimum is refused with calldata_mismatch.
Português — Corre verifySwapExactIn, do SDK da BlazePhoenix, sobre o calldata que vais assinar. Descodifica os bytes e compara-os com o teu pedido. Um recipient alterado ou um mínimo reduzido é recusado com calldata_mismatch.
Español — Ejecuta verifySwapExactIn, del SDK de BlazePhoenix, sobre el calldata que vas a firmar. Decodifica los bytes y los compara con tu solicitud. Un recipient cambiado o un mínimo rebajado se rechaza con calldata_mismatch.
Français — Exécutez verifySwapExactIn, du SDK de BlazePhoenix, sur le calldata que vous allez signer. Il décode les octets et les compare à votre demande. Un recipient modifié ou un minimum abaissé est refusé avec calldata_mismatch.
Deutsch — Führe verifySwapExactIn aus dem BlazePhoenix SDK auf der Calldata aus, die du signieren willst. Es dekodiert die Bytes und vergleicht sie mit deiner Anfrage. Geänderter recipient oder gesenktes Minimum: calldata_mismatch.
Русский — Запустите verifySwapExactIn из SDK BlazePhoenix на calldata, которую собираетесь подписать. Она декодирует байты и сравнивает их с вашим запросом. Изменённый recipient или заниженный минимум отклоняются с calldata_mismatch.
Türkçe — İmzalamak üzere olduğunuz calldata üzerinde BlazePhoenix SDK’sından verifySwapExactIn çalıştırın. Baytları çözer ve isteğinizle karşılaştırır. Değişmiş bir recipient veya düşürülmüş bir minimum calldata_mismatch ile reddedilir.
العربية — شغّل verifySwapExactIn من BlazePhoenix SDK على الـ calldata الذي توشك أن توقّعه. يفك ترميز البايتات ويقارنها بطلبك. وأي recipient مُغيَّر أو حد أدنى مخفَّض يُرفض بالخطأ calldata_mismatch.
हिन्दी — जिस calldata पर आप दस्तख़त करने वाले हैं, उस पर BlazePhoenix SDK का verifySwapExactIn चलाएँ। यह बाइट्स डीकोड करके उन्हें आपके अनुरोध से मिलाता है। बदला हुआ recipient या घटाया हुआ मिनिमम calldata_mismatch के साथ ठुकरा दिया जाता है।
한국어 — 서명하려는 calldata에 BlazePhoenix SDK의 verifySwapExactIn을 실행하세요. 바이트를 디코딩해 요청과 비교하며, 바뀐 수령인이나 낮아진 최소 수량은 calldata_mismatch로 거부됩니다.
Bahasa Indonesia — Jalankan verifySwapExactIn dari SDK BlazePhoenix pada calldata yang akan kamu tandatangani. Ia mendekode byte dan membandingkannya dengan permintaanmu; recipient yang diubah atau minimum yang diturunkan ditolak dengan calldata_mismatch.
বাংলা — যে calldata-তে সই করতে যাচ্ছেন, তার ওপর BlazePhoenix SDK-র verifySwapExactIn চালান। এটি বাইট ডিকোড করে আপনার অনুরোধের সঙ্গে মেলায়। বদলে যাওয়া recipient বা কমিয়ে দেওয়া মিনিমাম calldata_mismatch দিয়ে প্রত্যাখ্যাত হয়।
Filipino — Patakbuhin ang verifySwapExactIn ng BlazePhoenix SDK sa calldata na pipirmahan mo. Dine-decode nito ang bytes at ikinukumpara sa request mo. Ang binagong recipient o ibinabang minimum ay tinatanggihan ng calldata_mismatch.
Short answer: verifySwapExactIn, exported by the BlazePhoenix SDK, decodes a swapExactIn call with the Router ABI and compares each field with the request you pass in. If anything differs, it throws a BlazeError with the code calldata_mismatch and lists every difference. It is a pure function: no network, no key.
This page shows what it compares, a real run on Base mainnet in which the calldata was edited twice and refused twice (10 USDC to AAPLc; nothing signed, nothing sent, no key), where the SDK calls it for you, and what it does not do.
What the check compares
You give it the calldata and a SwapExpectation: what you asked for. It decodes the calldata and checks these fields, and it collects every mismatch before it throws.
amountIn: the encoded input amount equals the one you asked for.
recipient: the encoded recipient equals yours. Upper and lower case are not told apart.
deadline: the encoded deadline equals the one in your plan.
userMinOut: at least your minOutAtLeast, and never zero.
route: the encoded route links tokenIn to tokenOut.
If you pass the route you previewed, the encoded route must be exactly that route.
The test: change one field
Build a plan on your own RPC, build the expectation from your own request and the plan, and check the honest bytes. Then edit the recipient word inside plan.tx.data and check again. The recipient and the demo address below are placeholders, and nothing is sent.
Lowering the encoded minimum to 1 is refused in the same way. Each edit changes exactly one 32-byte word of the calldata, which is the kind of change a tampered frontend or a swapped payload would make.
The output below is from the published SDK 1.6.0 on Base mainnet, on a public RPC, with the read pinned to block 59967185. The plan quoted amountOut 2840251 (0.02840251 AAPLc, which has 8 decimals) and minOut 2826050.
The honest calldata passes: the check returns without throwing.
The recipient word is changed from 0x1111111111111111111111111111111111111111 to 0x2222222222222222222222222222222222222222. The check throws calldata_mismatch with the line: recipient 0x2222222222222222222222222222222222222222 ≠ 0x1111111111111111111111111111111111111111.
The minimum is changed from 2826050 to 1. The check throws calldata_mismatch with the line: userMinOut 1 < required 2826050.
Where it runs by itself, and where you run it
buildSwap calls the same check on its own only on the Quoter 2.x path, where the Quoter encodes the calldata and the SDK checks it field by field against what you asked. In this run the version was 1, the only generation deployed on Base that day (asking for version 2 returns not_deployed, deployed: 1.0.0). On that path the SDK encodes the calldata itself, and the plan reports encodedBy sdk.
So in the run above, the check was called by hand. Its error text begins with Quoter calldata refused even when the SDK did the encoding, because the text is fixed. Run it before you sign, on the calldata you hold.
What it does not do
It compares the calldata with the request you give it, and nothing else. If you leave minOutAtLeast out of the expectation, a low minimum taken from the plan itself passes, so set your own floor. It does not simulate the swap and it does not say whether the swap is a good one.
Run it on the exact string you are about to sign, immediately before you sign it. If it throws, do not sign: it fails closed. To try it, npm i @blazephoenix/sdk, and see /agents for the rest of the toolkit.
Do not trust this page — reproduce it
Every claim above is checkable against the chain. Start here:
Install @blazephoenix/sdk, build a plan on your own RPC, change the recipient word in plan.tx.data, then call verifySwapExactIn(data, want). Expect calldata_mismatch with a line naming the recipient. Lower the encoded minimum to 1 and expect calldata_mismatch with userMinOut 1 < required. Run it on the exact bytes you will sign.
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). Verify the calldata before you sign: the check that refuses a changed swap. BlazePhoenix Engineering. https://blazephoenix.xyz/learn/verify-the-calldata-before-you-sign/
@misc{blazephoenix_verify_the_calldata_before_you_sign,
title = {Verify the calldata before you sign: the check that refuses a changed swap},
author = {BlazePhoenix},
year = {2026},
url = {https://blazephoenix.xyz/learn/verify-the-calldata-before-you-sign/},
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).