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

Commit 660199c

Browse files
authored
Merge pull request #435 from jlin27/development
Update docs for skipValidation and Allowance Targets & Addresses
2 parents 11e09f8 + ebc4c4c commit 660199c

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

mdx/api/index.mdx

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ We offer hosted versions for different Ethereum networks. Requests for more netw
1616
| Avalanche | https://avalanche.api.0x.org/ |
1717
| Fantom | https://fantom.api.0x.org/ |
1818
| Celo | https://celo.api.0x.org/ |
19+
| Optimism | https://optimism.api.0x.org/ |
1920

2021
## Versioning
2122

@@ -58,6 +59,32 @@ And will only document the objects in the `records` field.
5859
If a query provides an unreasonable (ie. too high) `perPage` value, the response can return a validation error as specified in the [errors section](#errors).
5960
If the query specifies a `page` that does not exist (ie. there are not enough `records`), the response will return an empty `records` array.
6061

62+
63+
## Allowance Targets
64+
Some interactions with 0x require or are improved by setting [token allowances](https://tokenallowance.io/), or in other words, giving 0x's smart contracts permission to move certain tokens on your behalf. Some examples include -
65+
66+
* Submitting a 0x API quote selling ERC20 tokens, you will need to give an allowance to the contract address. This address can be found either as the value of `allowanceTarget` returned in the quote response or in the ExchangeProxy Address column in the (#addresses by network) table below.
67+
* Trading ERC20 tokens using the Exchange contract, you will have to give an allowance to the [ERC20Proxy](https://0x.org/docs/guides/v3-specification#assetproxy) contract.
68+
* Paying protocol fees in WETH, you will need to give a WETH allowance to the [StakingProxy](https://0x.org/docs/guides/v3-staking-specification#architecture)
69+
* **Note:** For swaps with "ETH" as sellToken, wrapping "ETH" to "WETH" or unwrapping "WETH" to "ETH" no allowance is needed, a null address of `0x0000000000000000000000000000000000000000` is then returned instead.
70+
71+
Refer to this guide for [how to set your token allowances](https://0x.org/docs/guides/how-to-set-your-token-allowances).
72+
73+
### Addresses by Network
74+
75+
The following table includes commonly used contract addresses. For a full list of our smart contract deployments address, see the [0x cheat sheet](https://0x.org/docs/guides/0x-cheat-sheet).
76+
77+
| Network | Endpoint | ExchangeProxy Address | ERC20Proxy Address | StakingProxy Address |
78+
|---------------------|-------------------------------|--------------------------------------------|--------------------------------------------|--------------------------------------------|
79+
| Mainnet | https://api.0x.org/ | 0xdef1c0ded9bec7f1a1670819833240f027b25eff | 0x95e6f48254609a6ee006f7d493c8e5fb97094cef | 0xa26e80e7dea86279c6d778d702cc413e6cffa777 |
80+
| Binance Smart Chain | https://bsc.api.0x.org/ | 0xdef1c0ded9bec7f1a1670819833240f027b25eff | 0x0000000000000000000000000000000000000000 | 0x0000000000000000000000000000000000000000 |
81+
| Ropsten | https://ropsten.api.0x.org/ | 0xdef1c0ded9bec7f1a1670819833240f027b25eff | 0xf1ec7d0ba42f15fb5c9e3adbe86431973e44764c | 0x6acab4c9c4e3a0c78435fdb5ad1719c95460a668 |
82+
| Polygon | https://polygon.api.0x.org/ | 0xdef1c0ded9bec7f1a1670819833240f027b25eff | 0x0000000000000000000000000000000000000000 | 0x0000000000000000000000000000000000000000 |
83+
| Avalanche | https://avalanche.api.0x.org/ | 0xdef1c0ded9bec7f1a1670819833240f027b25eff | 0x0000000000000000000000000000000000000000 | 0x0000000000000000000000000000000000000000 |
84+
| Fantom | https://fantom.api.0x.org/ | 0xdef189deaef76e379df891899eb5a00a94cbc250 | 0x0000000000000000000000000000000000000000 | 0x0000000000000000000000000000000000000000 |
85+
| Celo | https://celo.api.0x.org/ | 0xdef1c0ded9bec7f1a1670819833240f027b25eff | 0x0000000000000000000000000000000000000000 | 0x0000000000000000000000000000000000000000 |
86+
| Optimism | https://optimism.api.0x.org/ | 0xdef1abe32c034e558cdd535791643c58a13acc10 | 0x0000000000000000000000000000000000000000 | 0x0000000000000000000000000000000000000000 |
87+
6188
## Errors
6289

6390
Unless the spec defines otherwise, errors to bad requests should respond with HTTP 4xx or status codes.
@@ -709,7 +736,10 @@ Nearly identical to [`/swap/v1/quote`](#get-swapv1quote), but with a few key dif
709736

710737
### Request
711738

712-
Identical to the request schema for `/swap/v1/quote`, with one exception: the `skipValidation` parameter will always be considered to be `true`, even when a `takerAddress` has been specified.
739+
Identical to the request schema for `/swap/v1/quote`, with one exception: the `skipValidation` parameter -
740+
* On Mainnet, `skipValidation` is always considered `true`, even when a `takerAddress` has been specified. Note that this will change soon to behave as it does on Ropsten.
741+
* On Ropsten, `skipValidation` behaves identically to that on `/swap/v1/quote`. For details, see the `skipValidation` parameter in the [/swap/v1/quote Request](https://0x.org/docs/api#request-1) section.
742+
713743

714744
### Response
715745

0 commit comments

Comments
 (0)