How Codex Built a Go Adapter for Uniswap
Two interfaces, one experiment
Codex checked WAB API version 1.0 and Sepolia chain ID 11155111 before preparing an EVM trade. The WAB check established the Bitcoin service context; the separate Go adapter performed Ethereum execution. The earlier v4 router preflight did not determine the final implementation: the completed trade used Uniswap v3 SwapRouter02.
From quote to execution
The adapter compared four fee tiers, selected the best positive quote and computed a minimum output using integer arithmetic: quote multiplied by 99 and divided by 100. It simulated the exact call before allowing broadcast. The final recorded fee tier was 500, and the input was 1,000,000,000,000,000 wei (0.001 test ETH).
1{
2 "address": "0x5148e363afbE929a37eF255423e1bD08543687Be",
3 "amount_in_wei": "1000000000000000",
4 "before_usdc_units": "0",
5 "chain_id": "11155111",
6 "fee_tier": 500,
7 "minimum_usdc_units": "39651873",
8 "quote_usdc_units": "40052397",
9 "router": "0x3bFA4769FB09eefC5a80d6E87c3B9C650f7Ae48E",
10 "simulated_usdc_units": "40048754",
11 "token_out": "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",
12 "wab_version": "1.0"
13}The earlier simulation and final execution records contain different quotes. That is why the final transaction record, rather than an earlier preview, is the basis for the settlement claim. The broadcast path required an explicit testnet flag, estimated gas, checked gas and gas-price limits, and created an exclusive local transaction marker before submission.
Verifying the result
1{
2 "address": "0x5148e363afbE929a37eF255423e1bD08543687Be",
3 "after_usdc_units": "40048758",
4 "amount_in_wei": "1000000000000000",
5 "before_usdc_units": "0",
6 "block": "12230782",
7 "chain_id": "11155111",
8 "fee_tier": 500,
9 "minimum_usdc_units": "39648270",
10 "quote_usdc_units": "40048758",
11 "received_usdc_units": "40048758",
12 "router": "0x3bFA4769FB09eefC5a80d6E87c3B9C650f7Ae48E",
13 "simulated_usdc_units": "40048758",
14 "swap_tx": "0xc704c48f9fd260785cdf69d822e1c39cbaa232627751732d76e1b0e2baea223d",
15 "token_out": "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",
16 "wab_version": "1.0"
17}The successful receipt in block 12230782 recorded 40,048,758 USDC base units. The adapter filtered Transfer logs by token and recipient and checked that the wallet balance increase matched. The result was 40.048758 test USDC, not a mainnet exchange rate or realized profit.
The source is available for study, but the one-shot marker is not a complete recovery system: an ambiguous broadcast outcome needs transaction-hash reconciliation before retrying. This experiment demonstrated a separate EVM execution adapter, not a Bitcoin-to-Ethereum swap.
Primary lab references
https://thamer.org/api
https://thamer.org/ask/wab-sepolia-funded-swap
