Skip to content
This repository was archived by the owner on Oct 15, 2024. It is now read-only.

Commit 0255b25

Browse files
committed
Set RFQT taker address to Forwarder for ETH sales
Addresses review comment #162 (comment)
1 parent 47227ad commit 0255b25

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/services/swap_service.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
SwapQuoter,
1111
SwapQuoterOpts,
1212
} from '@0x/asset-swapper';
13+
import { getContractAddressesForChainOrThrow } from '@0x/contract-addresses';
1314
import { assetDataUtils, SupportedProvider } from '@0x/order-utils';
1415
import { AbiEncoder, BigNumber, decodeThrownErrorAsRevertError, RevertError } from '@0x/utils';
1516
import { TxData, Web3Wrapper } from '@0x/web3-wrapper';
@@ -26,6 +27,7 @@ import {
2627
import {
2728
DEFAULT_TOKEN_DECIMALS,
2829
GAS_LIMIT_BUFFER_PERCENTAGE,
30+
NULL_ADDRESS,
2931
ONE_SECOND_MS,
3032
PERCENTAGE_SIG_DIGITS,
3133
QUOTE_ORDER_EXPIRATION_BUFFER_MS,
@@ -85,11 +87,11 @@ export class SwapService {
8587
excludedSources, // TODO(dave4506): overrides the excluded sources selected by chainId
8688
apiKey,
8789
rfqt:
88-
rfqt === undefined || from === undefined
90+
rfqt === undefined || from === undefined || from === NULL_ADDRESS
8991
? undefined
9092
: {
9193
...rfqt,
92-
takerAddress: from,
94+
takerAddress: isETHSell ? getContractAddressesForChainOrThrow(CHAIN_ID).forwarder : from,
9395
},
9496
};
9597
if (sellAmount !== undefined) {

0 commit comments

Comments
 (0)