Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9d97fa9d66 |
@@ -3500,16 +3500,16 @@ Currently supported:
|
||||
later permit or batch may raise what Permit2 lets the router take, and so may
|
||||
a step the decoder does not read in full: a command the decoder does not read
|
||||
(listed at the end of this section), a step whose input it cannot read, in
|
||||
whole or in part, and a step it fails on. Every other `PERMIT2_PERMIT`, before
|
||||
the step that sets the input side or after it, leaves `Token In` and the
|
||||
`Amount` line as they read with no permit, unless it lets a spender other than
|
||||
the router take `Token In` (see below): a permit of 5,000 DAI to another
|
||||
address and then a V3 exact-in of 600 USDT read `Swap USDT → USDC` with
|
||||
`Amount 600.0000 USDT`, and so do that exact-in and then a permit of 5,000 DAI
|
||||
to the router. A permit on the zero address never stands as the `Amount`
|
||||
figure, because Permit2 has no allowance of ETH. When a permit's amount stands
|
||||
and the step that sets the input side spends a token other than the permit's,
|
||||
or one the decoder does not know, that step's amount gets lines of its own,
|
||||
whole or in part, and a step it fails on. A permit on the zero address never
|
||||
stands as the `Amount` figure, because Permit2 has no allowance of ETH. Every
|
||||
other `PERMIT2_PERMIT`, before the step that sets the input side or after it,
|
||||
leaves `Token In` and the `Amount` line as they read with no permit, unless it
|
||||
lets a spender other than the router take `Token In` (see below): a permit of
|
||||
5,000 DAI to another address and then a V3 exact-in of 600 USDT read
|
||||
`Swap USDT → USDC` with `Amount 600.0000 USDT`, and so do that exact-in and
|
||||
then a permit of 5,000 DAI to the router. When a permit's amount stands and
|
||||
the step that sets the input side spends a token other than the permit's, or
|
||||
one the decoder does not know, that step's amount gets lines of its own,
|
||||
unless it states no amount and the user pays it none of its input token. Each
|
||||
take the total does not count gives three lines after the `Amount` line (after
|
||||
`Token In` when there is none): one of a token other than `Token In`; one of
|
||||
|
||||
@@ -2031,15 +2031,15 @@ function decode(data, toAddress, chainId, sources, fromAddress) {
|
||||
// before it takes under whatever allowance the router already had, so
|
||||
// it may take more. A later permit or batch, or a later step this
|
||||
// decoder did not read, may raise what Permit2 lets the router take.
|
||||
// A permit on the zero address never stands as the Amount figure,
|
||||
// because Permit2 has no allowance of ETH.
|
||||
// Every other PERMIT2_PERMIT leaves Token In and the Amount line as
|
||||
// they read with no permit, and gets lines of its own below. A permit
|
||||
// on the zero address never stands as the Amount figure, because
|
||||
// Permit2 has no allowance of ETH. A step that may take from the
|
||||
// sender what this decoder did not read leaves no figure, permit or
|
||||
// not (see spentUnread()), and so do a permit or batch whose input it
|
||||
// cannot read (see permitUnread()) and an allowance of Token In to
|
||||
// another spender (see toAnotherSpender). An EXECUTE_SUB_PLAN step
|
||||
// leaves both sides unknown (below).
|
||||
// they read with no permit, and gets lines of its own below. A step
|
||||
// that may take from the sender what this decoder did not read leaves
|
||||
// no figure, permit or not (see spentUnread()), and so do a permit
|
||||
// or batch whose input it cannot read (see permitUnread()) and an
|
||||
// allowance of Token In to another spender (see toAnotherSpender). An
|
||||
// EXECUTE_SUB_PLAN step leaves both sides unknown (below).
|
||||
const stepCommands = Array.from(
|
||||
commandsBytes,
|
||||
(b) => commands[b & commandTypeMask],
|
||||
|
||||
Reference in New Issue
Block a user