diff --git a/sdks/v4-sdk/src/utils/v4Planner.test.ts b/sdks/v4-sdk/src/utils/v4Planner.test.ts index 95e085400..6b481bd13 100644 --- a/sdks/v4-sdk/src/utils/v4Planner.test.ts +++ b/sdks/v4-sdk/src/utils/v4Planner.test.ts @@ -199,33 +199,23 @@ describe('RouterPlanner', () => { describe('addTrade', () => { it('completes a take without a specified amount', async () => { - const routerMustCustody = true - planner.addTake(DAI, routerMustCustody) + const recipient = '0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + planner.addTake(DAI, recipient) expect(planner.actions).toEqual('0x12') expect(planner.params[0]).toEqual( - '0x0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000' + '0x0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f000000000000000000000000aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0000000000000000000000000000000000000000000000000000000000000000' ) }) it('completes a take with a specified amount', async () => { - const routerMustCustody = true + const recipient = '0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' const amount = BigNumber.from('8') - planner.addTake(DAI, routerMustCustody, amount) + planner.addTake(DAI, recipient, amount) expect(planner.actions).toEqual('0x12') expect(planner.params[0]).toEqual( - '0x0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000008' - ) - }) - - it('completes a take when router will not custody', async () => { - const routerMustCustody = false - planner.addTake(DAI, routerMustCustody) - - expect(planner.actions).toEqual('0x12') - expect(planner.params[0]).toEqual( - '0x0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000' + '0x0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f000000000000000000000000aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0000000000000000000000000000000000000000000000000000000000000008' ) }) }) diff --git a/sdks/v4-sdk/src/utils/v4Planner.ts b/sdks/v4-sdk/src/utils/v4Planner.ts index 8663a0725..3c7c80f28 100644 --- a/sdks/v4-sdk/src/utils/v4Planner.ts +++ b/sdks/v4-sdk/src/utils/v4Planner.ts @@ -108,8 +108,6 @@ const ABI_DEFINITION: { [key in Actions]: string[] } = { } const FULL_DELTA_AMOUNT = 0 -const MSG_SENDER = '0x0000000000000000000000000000000000000001' -const ADDRESS_THIS = '0x0000000000000000000000000000000000000002' export class V4Planner { actions: string @@ -159,10 +157,9 @@ export class V4Planner { this.addAction(Actions.SETTLE, [currencyAddress(currency), amount ?? FULL_DELTA_AMOUNT, payerIsUser]) } - addTake(currency: Currency, routerMustCustody: boolean, amount?: BigNumber): void { - const receiver = routerMustCustody ? ADDRESS_THIS : MSG_SENDER + addTake(currency: Currency, recipient: string, amount?: BigNumber): void { const takeAmount = amount ?? FULL_DELTA_AMOUNT - this.addAction(Actions.TAKE, [currencyAddress(currency), receiver, takeAmount]) + this.addAction(Actions.TAKE, [currencyAddress(currency), recipient, takeAmount]) } finalize(): string {