fix: a PERMIT2_TRANSFER_FROM shows the swap's unknown first take beside its figure (closes #634)
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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user