diff --git a/packages/asset-swapper/CHANGELOG.json b/packages/asset-swapper/CHANGELOG.json index 9741ba85c4..4027eb5a8c 100644 --- a/packages/asset-swapper/CHANGELOG.json +++ b/packages/asset-swapper/CHANGELOG.json @@ -5,6 +5,10 @@ { "note": "Check MAX_IN_RATIO in sampleBuysFromBalancer", "pr": 338 + }, + { + "note": "Go back to using transformERC20 (instead of transformERC20Staging)", + "pr": 343 } ] }, diff --git a/packages/asset-swapper/src/quote_consumers/exchange_proxy_swap_quote_consumer.ts b/packages/asset-swapper/src/quote_consumers/exchange_proxy_swap_quote_consumer.ts index effe3951fc..04601caf96 100644 --- a/packages/asset-swapper/src/quote_consumers/exchange_proxy_swap_quote_consumer.ts +++ b/packages/asset-swapper/src/quote_consumers/exchange_proxy_swap_quote_consumer.ts @@ -1,6 +1,5 @@ import { ChainId, ContractAddresses } from '@0x/contract-addresses'; import { IZeroExContract } from '@0x/contract-wrappers'; -import { TransformERC20FeatureContract } from '@0x/contracts-zero-ex'; import { encodeAffiliateFeeTransformerData, encodeCurveLiquidityProviderData, @@ -95,7 +94,6 @@ export class ExchangeProxySwapQuoteConsumer implements SwapQuoteConsumerBase { }; private readonly _exchangeProxy: IZeroExContract; - private readonly _transformERC20Feature: TransformERC20FeatureContract; constructor(public readonly contractAddresses: ContractAddresses, options: Partial = {}) { const { chainId } = _.merge({}, constants.DEFAULT_SWAP_QUOTER_OPTS, options); @@ -103,7 +101,6 @@ export class ExchangeProxySwapQuoteConsumer implements SwapQuoteConsumerBase { this.chainId = chainId; this.contractAddresses = contractAddresses; this._exchangeProxy = new IZeroExContract(contractAddresses.exchangeProxy, FAKE_PROVIDER); - this._transformERC20Feature = new TransformERC20FeatureContract(contractAddresses.exchangeProxy, FAKE_PROVIDER); this.transformerNonces = { wethTransformer: findTransformerNonce( contractAddresses.transformers.wethTransformer, @@ -495,8 +492,8 @@ export class ExchangeProxySwapQuoteConsumer implements SwapQuoteConsumerBase { amounts: [], }), }); - const calldataHexString = this._transformERC20Feature - .transformERC20Staging( + const calldataHexString = this._exchangeProxy + .transformERC20( isFromETH ? ETH_TOKEN_ADDRESS : sellToken, isToETH ? ETH_TOKEN_ADDRESS : buyToken, shouldSellEntireBalance ? MAX_UINT256 : sellAmount, diff --git a/packages/asset-swapper/test/exchange_proxy_swap_quote_consumer_test.ts b/packages/asset-swapper/test/exchange_proxy_swap_quote_consumer_test.ts index f3abe2389e..b381805401 100644 --- a/packages/asset-swapper/test/exchange_proxy_swap_quote_consumer_test.ts +++ b/packages/asset-swapper/test/exchange_proxy_swap_quote_consumer_test.ts @@ -186,7 +186,7 @@ describe('ExchangeProxySwapQuoteConsumer', () => { ); } - const transformERC20Encoder = AbiEncoder.createMethod('transformERC20Staging', [ + const transformERC20Encoder = AbiEncoder.createMethod('transformERC20', [ { type: 'address', name: 'inputToken' }, { type: 'address', name: 'outputToken' }, { type: 'uint256', name: 'inputTokenAmount' },