0

I'm working on a smart contract that uses 0xAPI data passed in by the user to execute a number of ERC20 swaps.

I noticed that the 'to' field of the /swap/v1/quote response seems to always contain the address of the 0xExchangeProxy contract.

So I was wondering if I could hardcode this address in the contract to avoid potential attack vectors resulting from calling arbitrary contract addresses passed by the user.

In other words are there any circumstances (for ERC20 Token Trades) under which the 0xAPI will return a to address other than above linked Proxy contract?

1 Answer 1

1

In the case of ETH->WETH or WETH->ETH the to address is the WETH contract. This is a convenience with 0 added overhead of going through our contracts as a "trade".

The to address may change on different networks.

Currently for all "normal" trading the to address will be the 0x Exchange Proxy.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.