Aftercheck

Aftercheck checks Uniswap swap outcomes against declared rules - with replayable evidence

Aftercheck

Created At

ETHGlobal Mumbai

Project Description

A successful blockchain transaction doesn't necessarily mean it satisfied the user's financial requirements.

Aftercheck is a read-only, local-first verification tool that examines completed Uniswap swaps and evaluates their recorded effects against user-declared financial policies.

Built around Uniswap v3 on Ethereum Sepolia, Aftercheck validates transaction evidence, identifies the actual router and liquidity pool, reconciles Swap and Transfer events, and checks financial requirements such as maximum spending, minimum received amounts, and expected recipients.

Crucially, it separates four things: transaction execution, protocol support, evidence completeness, and financial-policy compliance.

The same successful transaction can produce PASS under one policy and VIOLATION under another. If the available evidence cannot establish a requirement - such as the wallet's balance immediately after the transaction - Aftercheck reports UNKNOWN rather than inventing a reassuring answer.

The browser interface lets users inspect evidence, adjust retrospective financial requirements, and export complete verification packages. These packages can be independently reproduced through an offline CLI without depending on our website, backend, or live RPC access.

We also integrated Chainlink CRE for additional historical Uniswap pool-identity corroboration. An official local CRE CLI simulation successfully demonstrated MATCH, controlled MISMATCH, and UNAVAILABLE outcomes, without changing the core financial verdict.

Aftercheck is experimental verification infrastructure, not a wallet, an execution guard, or a guarantee of financial safety.

How it's Made

Aftercheck is built with TypeScript, JavaScript, Node.js 24, native browser APIs, and Ethereum JSON-RPC. The frontend uses lightweight HTML, CSS, and native JavaScript modules rather than a heavyweight web framework.

Our Uniswap integration directly supports v3 SwapRouter02 exactInputSingle on Ethereum Sepolia.

The read-only evidence collector retrieves historical transaction, receipt, block, and contract observations. It uses EIP-1898 block-hash-bound requests to establish consistent historical protocol context.

The verification engine decodes the exact seven-field Router02 calldata, checks the deployed router and factory-selected pool, and reconciles signed Uniswap Swap events with ordered ERC-20 Transfer events.

Financial calculations use bigint arithmetic, avoiding floating-point precision errors. Strict validation checks transaction identities, evidence integrity, supported routes, and policy inputs. Missing or conflicting information produces explicit UNKNOWN or unsupported results rather than false PASS verdicts.

The same deterministic evaluation logic runs in Node.js and the browser. Users can adjust retrospective policies, inspect individual checks, and download a verification package containing evidence, policy, JSON/Markdown reports, and offline reproduction instructions.

Our optional Chainlink CRE integration combines an HTTPS capability retrieving a revision-pinned public evidence manifest with an EVM capability reading the historical Uniswap v3 factory on Sepolia.

We successfully executed official CRE CLI simulations for matching, deliberately mismatching, and unavailable evidence, then consumed their outputs as separate corroboration results without changing the original financial verdict.

The browser application is deployed as a static site on DigitalOcean. Core verification requires no proprietary backend, database, wallet connection, signing authority, or AI inference.

GitHub Actions validates the implementation through automated tests, browser/CLI parity checks, adversarial cases, and reproducible exports.

background image mobile

Join the mailing list

Get the latest news and updates