fix: the approval screen names the address a swap's output is paid to (closes #594)
check / check (push) Waiting to run
e2e / e2e-chrome (push) Waiting to run
e2e / e2e-firefox (push) Waiting to run

The swap decoder read no recipient, so a swap paying its output to another
address still showed Min. received. It now reads the address that every swap
step, SWEEP, WRAP_ETH, UNWRAP_WETH, V4 TAKE and TAKE_ALL pays. The minimum
reads Min. received only when some step pays the sender, none pays another
address, none that may pay one went unread, and the output is not left in the
router: an output paid to the router needs a later SWEEP of that token, or
UNWRAP_WETH of WETH, paying it out. A payment that the next V2 swap spends as
already paid is a hop, not a payout. Otherwise it reads Min. paid out, with
Paid to lines saying who is paid.

Model: opus-5-5
This commit is contained in:
2026-10-19 08:01:45 +00:00
parent 5e4b8ff3b0
commit 05f2eea033
11 changed files with 1278 additions and 98 deletions
+3 -2
View File
@@ -87,7 +87,7 @@ function detail(data, label) {
describe("an execute() whose input currency never decoded", () => {
// A V4_SWAP whose sub-action params do not decode — an action encoding
// this decoder does not know — leaves every V4 token null. The
// BALANCE_CHECK still names the output, so the screen has a Min. received
// BALANCE_CHECK still names the output, so the screen has a minimum
// figure and a Token Out, and previously claimed the user was paying ETH
// for them.
const data = () =>
@@ -132,7 +132,8 @@ describe("an execute() that names only an output token", () => {
test("still states the output it did establish", () => {
expect(detail(data(), "Token Out").value).toContain("USDT");
expect(detail(data(), "Min. received").value).toBe("2.0000 USDT");
// No step pays anyone, so the minimum is not said to be received.
expect(detail(data(), "Min. paid out").value).toBe("2.0000 USDT");
});
});