decision: a trailing PERMIT2_PERMIT replaces the swap's input side on the approval screen #370
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Raised by the review of #368 (#368 (comment)). Pre-existing and unchanged by that PR — verified byte-identical in behaviour before and after it.
A
PERMIT2_PERMITarriving AFTER a swap step has already established the input side still REPLACES it. So theToken InandAmountshown can be the permit's token and allowance rather than the swap's actual input.Why it is not obviously wrong: the permit is a real authorization in the same transaction, and #368's stated invariant — that an amount and the token it is counted in always come from the same source — is honoured, because both halves come from the permit together. Nothing displayed is internally inconsistent.
Why it is worth deciding: "the first source that states either half" is not what a trailing permit does, and this is the one remaining route by which the displayed input side is not the swap's input. On a screen whose job is to state what is being authorized, showing an allowance where the user expects the amount being swapped is a plausible misreading.
The reviewer declined to file it as a defect because it is deliberate and unchanged; it is filed here as a decision rather than a bug.
Options
Token In, and render the permit as its own labelled line, so neither displaces the other.Recommendation: (b), since both facts are true and the screen currently has to discard one of them. It is also the only option under which nothing the user is authorizing goes unstated.
Definition of done
make checkgreen.