Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
894d972caa |
@@ -1364,10 +1364,10 @@ when both tokens are known. The lines are:
|
||||
sender. When it pays anyone but the router, that amount gets these lines. When
|
||||
it pays the router, that amount joins the `Amount` line if `Token In` is ETH,
|
||||
and gets these lines if not. A `WRAP_ETH` of `CONTRACT_BALANCE` states no
|
||||
amount, so it gets none. ETH that the sender pays a V4 step or such a
|
||||
`WRAP_ETH` can get these three lines when the router may hold ETH from an
|
||||
earlier step. When the decoder knows the amount, its `Moved from the sender`
|
||||
line reads `Up to` and the amount.
|
||||
amount, so it gets no lines. ETH that the sender pays a V4 step or a
|
||||
`WRAP_ETH` of a stated amount can get these three lines when the router may
|
||||
hold ETH from an earlier step. When the decoder knows the amount, its
|
||||
`Moved from the sender` line reads `Up to` and the amount.
|
||||
- `Permit2 allowance`, `Allowance token` and `Allowance spender`: each allowance
|
||||
that a `PERMIT2_PERMIT` or `PERMIT2_PERMIT_BATCH` grants, unless the permit's
|
||||
amount already stands as the `Amount` figure.
|
||||
|
||||
@@ -1382,8 +1382,8 @@ function decode(data, toAddress, chainId, sources, fromAddress) {
|
||||
};
|
||||
// A step may take from the sender what this decoder did not read: a
|
||||
// V4 step whose input or one of whose SETTLEs or SETTLE_ALLs it
|
||||
// cannot read; a V2 or V3 swap step or PERMIT2_TRANSFER_FROM whose
|
||||
// input it cannot read; a PERMIT2_TRANSFER_FROM_BATCH; an
|
||||
// cannot read; a V2 or V3 swap step, PERMIT2_TRANSFER_FROM or WRAP_ETH
|
||||
// whose input it cannot read; a PERMIT2_TRANSFER_FROM_BATCH; an
|
||||
// EXECUTE_SUB_PLAN; and a step it fails on. It is recorded with a null
|
||||
// token and amount: one line says so, there is no Amount line, whose
|
||||
// figure may then be too low, and the amount of a permit after it
|
||||
@@ -1952,6 +1952,7 @@ function decode(data, toAddress, chainId, sources, fromAddress) {
|
||||
} else {
|
||||
payeeUnread = true;
|
||||
stepsUnread.push(i);
|
||||
spentUnread();
|
||||
}
|
||||
} else if (command === "V4_SWAP") {
|
||||
const v4 = decodeV4Swap(inputs[i]);
|
||||
|
||||
@@ -2861,6 +2861,15 @@ describe("uniswap decoder", () => {
|
||||
["Moved from the sender", UNDECODED],
|
||||
],
|
||||
},
|
||||
{
|
||||
kind: "a V3 exact-in of 600 USDT, then a WRAP_ETH whose input this decoder cannot read",
|
||||
commands: [0x00, 0x0b],
|
||||
inputs: [V3_600, "0x1234"],
|
||||
lines: [
|
||||
...USDT_600_GROUP,
|
||||
["Moved from the sender", UNDECODED],
|
||||
],
|
||||
},
|
||||
{
|
||||
kind: "a V3 exact-in of 600 USDT, then a WRAP_ETH of nothing to another address, reads as on next",
|
||||
commands: [0x00, 0x0b],
|
||||
|
||||
Reference in New Issue
Block a user