Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8d524b7f3d |
@@ -1197,9 +1197,8 @@ exact-in actions from the input end and a chain of exact-out actions from the
|
||||
output end, so a step whose swap actions are all of one kind is lined up from
|
||||
what the user pays to what the user receives. A step that mixes the two kinds
|
||||
need not be: one that buys WETH with USDT exact-in and then USDC with that WETH
|
||||
exact-out is lined up with the USDC purchase first, so with no `SETTLE`,
|
||||
`SETTLE_ALL`, `TAKE` or `TAKE_ALL` it reads `Swap WETH → WETH`. `Amount` is the
|
||||
first action's `amountIn`, shown only when that action spends the step's input
|
||||
exact-out is lined up with the USDC purchase first. `Amount` is the first
|
||||
action's `amountIn`, shown only when that action spends the step's input
|
||||
currency, and `Min. received` the last action's `amountOutMin`, shown only when
|
||||
that action buys the step's output currency, so no figure is shown against a
|
||||
currency it is not counted in. The decoder reads no amount from an exact-out
|
||||
|
||||
+12
-13
@@ -414,19 +414,18 @@ function decodeV4SwapAction(actionId, param) {
|
||||
// its output currency, wherever in the step they stand. A side neither one
|
||||
// names is read from the swap actions, lined up as the exact-out actions in
|
||||
// reverse order, then the exact-in actions in the order they appear. The
|
||||
// input comes from the first action in that line and the output from the
|
||||
// last. The router runs exact-in actions from the input end and a chain of
|
||||
// exact-out actions from the output end, so a step whose swap actions are all
|
||||
// of one kind is lined up from what the user pays to what the user receives.
|
||||
// A step that mixes the two kinds need not be: one that buys WETH with USDT
|
||||
// exact-in and then USDC with that WETH exact-out is lined up with the USDC
|
||||
// purchase first, so with no SETTLE, SETTLE_ALL, TAKE or TAKE_ALL both its
|
||||
// sides are WETH. Amount is the first action's amountIn, kept only when that
|
||||
// action spends the step's input currency, and Min. received the last
|
||||
// action's amountOutMin, kept only when that action buys the step's output
|
||||
// currency, so a figure is never shown against a currency other than the one
|
||||
// it is counted in. A swap action that could not be read keeps its place in
|
||||
// the line and states nothing.
|
||||
// input comes from the first action in that line and the output
|
||||
// from the last. The router runs exact-in actions from the input end and a
|
||||
// chain of exact-out actions from the output end, so a step whose swap actions
|
||||
// are all of one kind is lined up from what the user pays to what the user
|
||||
// receives. A step that mixes the two kinds need not be: one that buys WETH
|
||||
// with USDT exact-in and then USDC with that WETH exact-out is lined up with
|
||||
// the USDC purchase first. Amount is the first action's amountIn, kept only
|
||||
// when that action spends the step's input currency, and Min. received the
|
||||
// last action's amountOutMin, kept only when that action buys the step's
|
||||
// output currency, so a figure is never shown against a currency other than
|
||||
// the one it is counted in. A swap action that could not be read keeps its
|
||||
// place in the line and states nothing.
|
||||
function decodeV4Swap(input) {
|
||||
try {
|
||||
const d = coder.decode(["bytes", "bytes[]"], input);
|
||||
|
||||
Reference in New Issue
Block a user