fix: a swap's unknown first take shows beside a PERMIT2_TRANSFER_FROM, only when the user pays it (closes #634)
decode() now records whether the user pays the V4 step that sets the input side any of its input token, and decides once, after the loop, whether that step counts as a take from the sender. A stated amount counts whoever pays it; with none stated, the step counts only when the user pays it. Paid from the router, it gets no Moved from the sender lines, with a PERMIT2_PERMIT of another token or without. When it counts and states no amount, its Unknown (could not be decoded) line also shows beside a PERMIT2_TRANSFER_FROM of its token, whose figure is on that move's own lines or, into the router, on its Paid to line. README Transaction Decoding says the same. Model: opus-5-5
This commit was merged in pull request #639.
This commit is contained in:
@@ -3185,7 +3185,8 @@ Currently supported:
|
||||
step whose input it cannot read, in whole or in part, and a step it fails on.
|
||||
In any other case the line gives the total, as with no permit. When the step
|
||||
that sets the input side spends a token other than the permit's, or one the
|
||||
decoder does not know, its amount gets lines of its own and the total has no
|
||||
decoder does not know, its amount gets lines of its own, unless it states no
|
||||
amount and the user pays it none of its input token, and the total has no
|
||||
figure to start from: unless the permit's amount stands there is no `Amount`
|
||||
line, and each take of the permit's token gets lines of its own. Each take the
|
||||
total does not count gives three lines after the `Amount` line (after
|
||||
@@ -3193,11 +3194,16 @@ Currently supported:
|
||||
`Token In` after an amount that is not a quantity (a V4 open delta,
|
||||
`ALREADY_PAID`, which keep their wording on the `Amount` line, or no stated
|
||||
amount, as of a V4 exact-out step); and one whose amount the decoder does not
|
||||
know. When the step that sets the input side states no amount and there is no
|
||||
`Amount` line, that step gets them too whenever another take's lines give a
|
||||
figure, so that figure cannot read as all that leaves. They come in step
|
||||
order, the step that sets the input side first when it has them:
|
||||
`Moved from the sender`, its amount, worded as the `Amount` line words one, or
|
||||
know. When the step that sets the input side states no amount, the user pays
|
||||
it some of its input token, and there is no `Amount` line, that step gets them
|
||||
too whenever another take's lines give a figure, or a `PERMIT2_TRANSFER_FROM`
|
||||
of its token gives one, on the lines below or, into the router, on its
|
||||
`Paid to` line, so that figure cannot read as all that leaves. When it states
|
||||
no amount and the user pays it none of its input token, as when the router
|
||||
pays it, that step takes none of that token from the user's wallet and never
|
||||
gets them, with a permit or without. They come in step order, the step that
|
||||
sets the input side first when it has them: `Moved from the sender`, its
|
||||
amount, worded as the `Amount` line words one, or
|
||||
`Unknown (could not be decoded)` when the decoder does not know it;
|
||||
`Token moved`, giving the token's address as the `Token In` line does; and
|
||||
`Moved to`, which reads `The swap step that spends it`. A token the decoder
|
||||
|
||||
Reference in New Issue
Block a user