fix quote consumer RFQ VIP code path not checking if transfromERC20 is required (#461)

Co-authored-by: Lawrence Forman <me@merklejerk.com>
This commit is contained in:
Lawrence Forman
2022-04-07 09:58:07 -06:00
committed by Noah Khamliche
parent aca9338acb
commit 4929c60565
2 changed files with 12 additions and 1 deletions

View File

@@ -1,4 +1,13 @@
[
{
"version": "16.55.0",
"changes": [
{
"note": "Fix fillRfqOrder VIP being used for swaps that need transformERC20",
"pr": 461
}
]
},
{
"version": "16.54.0",
"changes": [

View File

@@ -70,6 +70,7 @@ import {
isDirectSwapCompatible,
isMultiplexBatchFillCompatible,
isMultiplexMultiHopFillCompatible,
requiresTransformERC20,
} from './quote_consumer_utils';
// tslint:disable-next-line:custom-no-magic-numbers
@@ -364,7 +365,8 @@ export class ExchangeProxySwapQuoteConsumer implements SwapQuoteConsumerBase {
[ChainId.Mainnet, ChainId.Polygon].includes(this.chainId) &&
!isToETH &&
!isFromETH &&
quote.orders.every(o => o.type === FillQuoteTransformerOrderType.Rfq)
quote.orders.every(o => o.type === FillQuoteTransformerOrderType.Rfq) &&
!requiresTransformERC20(optsWithDefaults)
) {
const rfqOrdersData = quote.orders.map(o => o.fillData as NativeRfqOrderFillData);
const fillAmountPerOrder = (() => {