fix: a PERMIT2_TRANSFER_FROM shows the swap's unknown first take beside its figure (closes #634)
check / check (push) Canceled after 0s
e2e / e2e-chrome (push) Canceled after 0s
e2e / e2e-firefox (push) Canceled after 0s

When the step that sets the input side states no amount, a
PERMIT2_TRANSFER_FROM of the same token still showed its own figure,
which was then the only amount of that token on the screen. The rule
that adds the line saying the first take is not known now also applies
when such a move gives a figure of that token, before or after the
swap step. A move of another token, and a move into the router, read as
before.

Model: opus-5-5
This commit is contained in:
2026-10-20 08:14:33 +00:00
parent 657dc14f04
commit c13385b270
3 changed files with 62 additions and 7 deletions
+8 -4
View File
@@ -1873,14 +1873,18 @@ function decode(data, toAddress, chainId, sources, fromAddress) {
if (ofTokenIn && !present(t.amount)) total = null;
}
inputAmount = permitStands ? permit.amount : total;
// With no Amount figure, a later take's own figure could read as all
// that leaves, so the step that set the input side, when it stated
// no amount, then gets lines of its own too, first, saying its amount
// With no Amount figure, a later take's own figure, or that of a
// PERMIT2_TRANSFER_FROM of the same token, could read as all that
// leaves, so the step that set the input side, when it stated no
// amount, then gets lines of its own too, first, saying its amount
// is not known.
if (
!present(inputAmount) &&
firstTakeUnstated !== null &&
spentFromSender.some((s) => present(s.amount))
(spentFromSender.some((s) => present(s.amount)) ||
movedFromSender.some((m) =>
sameAddress(m.token, firstTakeUnstated.token),
))
) {
spentFromSender.unshift(firstTakeUnstated);
}