From fba0e8a1df756e658444682893c0d35ce937bc7d Mon Sep 17 00:00:00 2001 From: Emily Williams Date: Thu, 26 Sep 2024 14:26:33 -0400 Subject: [PATCH] fix(v4-sdk): patch error in V4Planner exactOut trade (#110) --- sdks/v4-sdk/src/utils/v4Planner.test.ts | 2 +- sdks/v4-sdk/src/utils/v4Planner.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdks/v4-sdk/src/utils/v4Planner.test.ts b/sdks/v4-sdk/src/utils/v4Planner.test.ts index a78afc164..95e085400 100644 --- a/sdks/v4-sdk/src/utils/v4Planner.test.ts +++ b/sdks/v4-sdk/src/utils/v4Planner.test.ts @@ -131,7 +131,7 @@ describe('RouterPlanner', () => { expect(planner.actions).toEqual('0x07') expect(planner.params[0]).toEqual( - '0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000001000000000000000000000000006b175474e89094c44da98b954eedeac495271d0f0000000000000000000000000000000000000000000000000000000000000bb8000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000000000bb8000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000' + '0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000001000000000000000000000000006b175474e89094c44da98b954eedeac495271d0f0000000000000000000000000000000000000000000000000000000000000bb8000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000000000bb8000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000' ) }) diff --git a/sdks/v4-sdk/src/utils/v4Planner.ts b/sdks/v4-sdk/src/utils/v4Planner.ts index 952243a99..8663a0725 100644 --- a/sdks/v4-sdk/src/utils/v4Planner.ts +++ b/sdks/v4-sdk/src/utils/v4Planner.ts @@ -144,7 +144,7 @@ export class V4Planner { currencyOut, path: encodeRouteToPath(trade.route, exactOutput), amountInMaximum: trade.maximumAmountIn(slippageTolerance ?? new Percent(0)).quotient.toString(), - amountOut: trade.inputAmount.quotient.toString(), + amountOut: trade.outputAmount.quotient.toString(), } : { currencyIn,