Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

feat: support zora #425

Merged
merged 4 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/config/ChainConfigManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,9 @@ export abstract class ChainConfigManager {
alarmEnabled: false,
},
[ChainId.ZORA]: {
routingTypes: {},
routingTypes: {
[RoutingType.CLASSIC]: {},
},
alarmEnabled: false,
},
[ChainId.ZORA_SEPOLIA]: {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@
"@typechain/ethers-v5": "^7.0.1",
"@uniswap/default-token-list": "^11.7.0",
"@uniswap/permit2-sdk": "^1.2.0",
"@uniswap/router-sdk": "^1.9.0",
"@uniswap/router-sdk": "^1.9.2",
"@uniswap/sdk-core": "^4.2.0",
"@uniswap/smart-order-router": "^3.26.0",
"@uniswap/uniswapx-sdk": "2.1.0-beta.4",
"@uniswap/universal-router-sdk": "^1.9.0",
"@uniswap/universal-router-sdk": "^2.1.0",
"aws-cdk-lib": "2.85.0",
"aws-embedded-metrics": "^4.1.0",
"axios": "^1.2.1",
Expand Down
14 changes: 9 additions & 5 deletions test/integ/quote-classic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
ID_TO_NETWORK_NAME,
NATIVE_CURRENCY,
USDB_BLAST,
USDC_ZORA,
} from '@uniswap/smart-order-router';
import { fail } from 'assert';
import { AxiosResponse } from 'axios';
Expand Down Expand Up @@ -451,7 +452,7 @@ describe('quote', function () {
[ChainId.ARBITRUM_SEPOLIA]: null,
[ChainId.BASE_GOERLI]: USDC_ON(ChainId.BASE_GOERLI),
[ChainId.BASE]: USDC_ON(ChainId.BASE),
[ChainId.ZORA]: null,
[ChainId.ZORA]: USDC_ZORA,
[ChainId.ZORA_SEPOLIA]: null,
[ChainId.ROOTSTOCK]: null,
[ChainId.BLAST]: USDB_BLAST,
Expand All @@ -477,7 +478,7 @@ describe('quote', function () {
[ChainId.ARBITRUM_SEPOLIA]: null,
[ChainId.BASE_GOERLI]: WNATIVE_ON(ChainId.BASE_GOERLI),
[ChainId.BASE]: WNATIVE_ON(ChainId.BASE),
[ChainId.ZORA]: null,
[ChainId.ZORA]: WNATIVE_ON(ChainId.ZORA),
[ChainId.ZORA_SEPOLIA]: null,
[ChainId.ROOTSTOCK]: null,
[ChainId.BLAST]: WNATIVE_ON(ChainId.BLAST),
Expand All @@ -497,8 +498,7 @@ describe('quote', function () {
c != ChainId.OPTIMISM_SEPOLIA &&
c !== ChainId.BASE &&
c !== ChainId.BASE_GOERLI &&
// We will follow up supporting ZORA and ROOTSTOCK
c !== ChainId.ZORA &&
// We will follow up supporting ROOTSTOCK
c !== ChainId.ZORA_SEPOLIA &&
c !== ChainId.ROOTSTOCK
)) {
Expand Down Expand Up @@ -584,8 +584,12 @@ describe('quote', function () {
});
const native = NATIVE_CURRENCY[chain];
it(`${native} -> erc20`, async () => {
if (chain === ChainId.BLAST) {
if (chain === ChainId.BLAST || chain === ChainId.ZORA) {
jsy1218 marked this conversation as resolved.
Show resolved Hide resolved
// Blast doesn't have DAI or USDC yet
// Zora doesn't have DAI

// This test will become ETH -> WETH quote, and it will throw INVARIANT ADDRESS from sdk-core.
// Reasons explained in https://github.com/Uniswap/unified-routing-api/pull/425#discussion_r1611055408.
return;
}

Expand Down
132 changes: 47 additions & 85 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@
ethereum-cryptography "^2.0.0"
micro-ftch "^0.3.1"

"@ethersproject/abi@5.7.0", "@ethersproject/abi@^5.0.12", "@ethersproject/abi@^5.1.2", "@ethersproject/abi@^5.5.0", "@ethersproject/abi@^5.7.0":
"@ethersproject/abi@5.7.0", "@ethersproject/abi@^5.1.2", "@ethersproject/abi@^5.5.0", "@ethersproject/abi@^5.7.0":
version "5.7.0"
resolved "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.7.0.tgz"
integrity sha512-351ktp42TiRcYB3H1OP8yajPeAQstMW/yCFokj/AthP9bLHzQFPlOrxOcwYEDkUAICmOHljvN4K39OMTMUa9RA==
Expand Down Expand Up @@ -505,7 +505,7 @@
"@ethersproject/logger" "^5.7.0"
"@ethersproject/properties" "^5.7.0"

"@ethersproject/address@5.7.0", "@ethersproject/address@^5.0.0", "@ethersproject/address@^5.0.2", "@ethersproject/address@^5.7.0":
"@ethersproject/address@5.7.0", "@ethersproject/address@^5.0.2", "@ethersproject/address@^5.7.0":
version "5.7.0"
resolved "https://registry.npmjs.org/@ethersproject/address/-/address-5.7.0.tgz"
integrity sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA==
Expand Down Expand Up @@ -720,7 +720,7 @@
elliptic "6.5.4"
hash.js "1.1.7"

"@ethersproject/solidity@5.7.0", "@ethersproject/solidity@^5.0.0", "@ethersproject/solidity@^5.0.9":
"@ethersproject/solidity@5.7.0", "@ethersproject/solidity@^5.0.9":
version "5.7.0"
resolved "https://registry.npmjs.org/@ethersproject/solidity/-/solidity-5.7.0.tgz"
integrity sha512-HmabMd2Dt/raavyaGukF4XxizWKhKQ24DoLtdNbBmNKUOPqwjsKQSdV9GQtj9CBEea9DlzETlVER1gYeXXBGaA==
Expand Down Expand Up @@ -2078,21 +2078,21 @@
ethers "^5.7.0"
tiny-invariant "^1.1.0"

"@uniswap/router-sdk@^1.9.0":
version "1.9.0"
resolved "https://registry.yarnpkg.com/@uniswap/router-sdk/-/router-sdk-1.9.0.tgz#f35432ddc400ddb83985adc840c5898e2bc008cd"
integrity sha512-UeQrrjhOIzPDxHzkF341Sd9PjIzJwiHFQhaEYFIWNE4yC/wzSiISxc5Ebp94p/KVmettoFRa+682yn9IZBhFTA==
"@uniswap/router-sdk@^1.9.2":
version "1.9.2"
resolved "https://registry.yarnpkg.com/@uniswap/router-sdk/-/router-sdk-1.9.2.tgz#cc2411f0849467c2bd71ce34cdca9db2a584367d"
integrity sha512-J63Of3HRpV0s3ZtEnhGlyvbBuZFfjK7NtnMwflzFMKzfdm+75APHYqnvHAnVARKuL/hMYHF4hni0o84bHem2Ng==
dependencies:
"@ethersproject/abi" "^5.5.0"
"@uniswap/sdk-core" "^4.2.0"
"@uniswap/swap-router-contracts" "^1.1.0"
"@uniswap/v2-sdk" "^4.3.0"
"@uniswap/v3-sdk" "^3.11.0"
"@uniswap/sdk-core" "^5.0.0"
"@uniswap/swap-router-contracts" "^1.3.0"
"@uniswap/v2-sdk" "^4.3.2"
"@uniswap/v3-sdk" "^3.11.2"

"@uniswap/sdk-core@^4.2.0":
version "4.2.0"
resolved "https://registry.yarnpkg.com/@uniswap/sdk-core/-/sdk-core-4.2.0.tgz#9930f133baec9c1118d891ebf8fcba7f7efc153d"
integrity sha512-yXAMLHZRYYuh6KpN2nOlLTYBjGiopmI9WUB4Z0tyNkW4ZZub54cUt22eibpGbZAhRAMxclox9IPIs6wwrM3soQ==
version "4.2.1"
resolved "https://registry.yarnpkg.com/@uniswap/sdk-core/-/sdk-core-4.2.1.tgz#7b8c6fee48446bb67a4e6f2e9cb94c862034a6c3"
integrity sha512-hr7vwYrXScg+V8/rRc2UL/Ixc/p0P7yqe4D/OxzUdMRYr8RZd+8z5Iu9+WembjZT/DCdbTjde6lsph4Og0n1BQ==
dependencies:
"@ethersproject/address" "^5.0.2"
big.js "^5.2.2"
Expand All @@ -2114,22 +2114,22 @@
toformat "^2.0.0"

"@uniswap/smart-order-router@^3.26.0":
version "3.26.0"
resolved "https://registry.yarnpkg.com/@uniswap/smart-order-router/-/smart-order-router-3.26.0.tgz#b3b172adb6b6f5f2865f6dd8ec7dddebf7a701a5"
integrity sha512-0xoMyirXAjCwIYDA423O8HwahwxLX+0v2OaayDuRWeYKX+rFsKKGXRTykG9CJx0vHSpuI2fqBIQQ38r/+Ww3cA==
version "3.33.0"
resolved "https://registry.yarnpkg.com/@uniswap/smart-order-router/-/smart-order-router-3.33.0.tgz#ac67e8a88cea46f206c3b70f9bad894b16d771b9"
integrity sha512-G/4AWEbR8LEKJ/L4+V+irgKn4OG97Wx5dc30XgDxFB2E3rfoPhRIvBYXIcVZ2ct7pGQOq4anwR4u7md62JY+ew==
dependencies:
"@eth-optimism/sdk" "^3.2.2"
"@types/brotli" "^1.3.4"
"@uniswap/default-token-list" "^11.13.0"
"@uniswap/permit2-sdk" "^1.2.0"
"@uniswap/router-sdk" "^1.9.0"
"@uniswap/sdk-core" "^4.2.0"
"@uniswap/router-sdk" "^1.9.2"
"@uniswap/sdk-core" "^5.0.0"
"@uniswap/swap-router-contracts" "^1.3.1"
"@uniswap/token-lists" "^1.0.0-beta.31"
"@uniswap/universal-router" "^1.6.0"
"@uniswap/universal-router-sdk" "^1.8.1"
"@uniswap/v2-sdk" "^4.3.0"
"@uniswap/v3-sdk" "^3.11.0"
"@uniswap/universal-router-sdk" "^2.1.0"
"@uniswap/v2-sdk" "^4.3.2"
"@uniswap/v3-sdk" "^3.11.2"
async-retry "^1.3.1"
await-timeout "^1.1.1"
axios "^0.21.1"
Expand All @@ -2144,7 +2144,7 @@
node-cache "^5.1.2"
stats-lite "^2.2.0"

"@uniswap/swap-router-contracts@^1.1.0", "@uniswap/swap-router-contracts@^1.3.1":
"@uniswap/swap-router-contracts@^1.3.0", "@uniswap/swap-router-contracts@^1.3.1":
version "1.3.1"
resolved "https://registry.yarnpkg.com/@uniswap/swap-router-contracts/-/swap-router-contracts-1.3.1.tgz#0ebbb93eb578625618ed9489872de381f9c66fb4"
integrity sha512-mh/YNbwKb7Mut96VuEtL+Z5bRe0xVIbjjiryn+iMMrK2sFKhR4duk/86mEz0UO5gSx4pQIw9G5276P5heY/7Rg==
Expand All @@ -2156,18 +2156,6 @@
dotenv "^14.2.0"
hardhat-watcher "^2.1.1"

"@uniswap/swap-router-contracts@^1.2.1":
version "1.3.0"
resolved "https://registry.npmjs.org/@uniswap/swap-router-contracts/-/swap-router-contracts-1.3.0.tgz"
integrity sha512-iKvCuRkHXEe0EMjOf8HFUISTIhlxI57kKFllf3C3PUIE0HmwxrayyoflwAz5u/TRsFGYqJ9IjX2UgzLCsrNa5A==
dependencies:
"@openzeppelin/contracts" "3.4.2-solc-0.7"
"@uniswap/v2-core" "1.0.1"
"@uniswap/v3-core" "1.0.0"
"@uniswap/v3-periphery" "1.4.1"
dotenv "^14.2.0"
hardhat-watcher "^2.1.1"

"@uniswap/token-lists@^1.0.0-beta.31":
version "1.0.0-beta.33"
resolved "https://registry.npmjs.org/@uniswap/token-lists/-/token-lists-1.0.0-beta.33.tgz"
Expand All @@ -2184,33 +2172,19 @@
"@uniswap/sdk-core" "^5.0.0"
ethers "^5.7.0"

"@uniswap/universal-router-sdk@^1.8.1":
version "1.8.1"
resolved "https://registry.yarnpkg.com/@uniswap/universal-router-sdk/-/universal-router-sdk-1.8.1.tgz#1d94c3142aed697d3a06c0542ae8cc9404640296"
integrity sha512-oA4JFLD1JmfJn5AnPcvgOmLIqZnsUpDYSShYCt8CaA3AzBzKmPTz9xpGdQwVHIH8rJnYu6mPTqRg5GwLobeMGA==
dependencies:
"@uniswap/permit2-sdk" "^1.2.0"
"@uniswap/router-sdk" "^1.9.0"
"@uniswap/sdk-core" "^4.2.0"
"@uniswap/universal-router" "1.6.0"
"@uniswap/v2-sdk" "^4.2.0"
"@uniswap/v3-sdk" "^3.11.0"
bignumber.js "^9.0.2"
ethers "^5.3.1"

"@uniswap/universal-router-sdk@^1.9.0":
version "1.9.0"
resolved "https://registry.yarnpkg.com/@uniswap/universal-router-sdk/-/universal-router-sdk-1.9.0.tgz#7e0c38dc6dc015bcb3b74f34df820af0aef90f41"
integrity sha512-B6iEczP2WdMsq/aVIdQfvHWWLJyhaUD7enfxO6koxaH3huYOqUWRAzmZLl026fRK7R7P+tVFcA6AqImWLG6tYQ==
"@uniswap/universal-router-sdk@^2.1.0":
version "2.1.0"
resolved "https://registry.yarnpkg.com/@uniswap/universal-router-sdk/-/universal-router-sdk-2.1.0.tgz#7b4e48af92a6162973d3503bcd6ccf4b52dcba4a"
integrity sha512-nLIIr0bZ6AfvwuYC97rM10tyEfqDIdujtG+Ahwqhv1EMWayh6abbqPUwvUQvk6Px4LOyuKtlciryW/MJMusn4w==
dependencies:
"@uniswap/permit2-sdk" "^1.2.0"
"@uniswap/router-sdk" "^1.9.0"
"@uniswap/sdk-core" "^4.2.0"
"@uniswap/permit2-sdk" "^1.2.1"
"@uniswap/router-sdk" "^1.9.2"
"@uniswap/sdk-core" "^5.0.0"
"@uniswap/universal-router" "1.6.0"
"@uniswap/v2-sdk" "^4.3.0"
"@uniswap/v3-sdk" "^3.11.0"
"@uniswap/v2-sdk" "^4.3.2"
"@uniswap/v3-sdk" "^3.11.2"
bignumber.js "^9.0.2"
ethers "^5.3.1"
ethers "^5.7.0"

"@uniswap/universal-router@1.6.0", "@uniswap/universal-router@^1.6.0":
version "1.6.0"
Expand All @@ -2226,14 +2200,14 @@
resolved "https://registry.npmjs.org/@uniswap/v2-core/-/v2-core-1.0.1.tgz"
integrity sha512-MtybtkUPSyysqLY2U210NBDeCHX+ltHt3oADGdjqoThZaFRDKwM6k1Nb3F0A3hk5hwuQvytFWhrWHOEq6nVJ8Q==

"@uniswap/v2-sdk@^4.2.0", "@uniswap/v2-sdk@^4.3.0":
version "4.3.0"
resolved "https://registry.yarnpkg.com/@uniswap/v2-sdk/-/v2-sdk-4.3.0.tgz#621dcf4ea236448a0a49cd901932b3a466c8ae02"
integrity sha512-FUKkgo/1TQc/HuWWgsoy1FIcsLkKwm3Nnor88yfn2NH8ER5RK/wDF9UzDDilYh3yyf2mAnaY89CKFhcIl+lbBQ==
"@uniswap/v2-sdk@^4.3.2":
version "4.3.2"
resolved "https://registry.yarnpkg.com/@uniswap/v2-sdk/-/v2-sdk-4.3.2.tgz#d8eacdb2ddfeca849ee1cb05377521c4ba0d1542"
integrity sha512-yNxfQZuzmQ2xqiKutzyzzoXuiuwFrHWba6GG9gT8JeJ4NT5sTJOeLY1FEdEMVsJQwXfMc+goG/srNBRZXVRtSA==
dependencies:
"@ethersproject/address" "^5.0.0"
"@ethersproject/solidity" "^5.0.0"
"@uniswap/sdk-core" "^4.2.0"
"@ethersproject/address" "^5.0.2"
"@ethersproject/solidity" "^5.0.9"
"@uniswap/sdk-core" "^5.0.0"
tiny-invariant "^1.1.0"
tiny-warning "^1.0.3"

Expand All @@ -2247,18 +2221,6 @@
resolved "https://registry.yarnpkg.com/@uniswap/v3-core/-/v3-core-1.0.1.tgz#b6d2bdc6ba3c3fbd610bdc502395d86cd35264a0"
integrity sha512-7pVk4hEm00j9tc71Y9+ssYpO6ytkeI0y7WE9P6UcmNzhxPePwyAxImuhVsTqWK9YFvzgtvzJHi64pBl4jUzKMQ==

"@uniswap/v3-periphery@1.4.1":
version "1.4.1"
resolved "https://registry.npmjs.org/@uniswap/v3-periphery/-/v3-periphery-1.4.1.tgz"
integrity sha512-Ab0ZCKOQrQMKIcpBTezTsEhWfQjItd0TtkCG8mPhoQu+wC67nPaf4hYUhM6wGHeFUmDiYY5MpEQuokB0ENvoTg==
dependencies:
"@openzeppelin/contracts" "3.4.2-solc-0.7"
"@uniswap/lib" "^4.0.1-alpha"
"@uniswap/v2-core" "1.0.1"
"@uniswap/v3-core" "1.0.0"
base64-sol "1.0.1"
hardhat-watcher "^2.1.1"

"@uniswap/v3-periphery@^1.0.1", "@uniswap/v3-periphery@^1.1.1":
version "1.4.3"
resolved "https://registry.npmjs.org/@uniswap/v3-periphery/-/v3-periphery-1.4.3.tgz"
Expand All @@ -2281,15 +2243,15 @@
"@uniswap/v3-core" "^1.0.0"
base64-sol "1.0.1"

"@uniswap/v3-sdk@^3.11.0":
version "3.11.0"
resolved "https://registry.yarnpkg.com/@uniswap/v3-sdk/-/v3-sdk-3.11.0.tgz#328309fbafddd8c618b7b6850bb99cacf6733a79"
integrity sha512-gz6Q6SlN34AXvxhyz181F90D4OuIkxLnzBAucEzB9Fv3Z+3orHZY/SpGaD02nP1VsNQVu/DQvOsdkPUDGn1Y9Q==
"@uniswap/v3-sdk@^3.11.2":
version "3.11.2"
resolved "https://registry.yarnpkg.com/@uniswap/v3-sdk/-/v3-sdk-3.11.2.tgz#cda523307549548b6b53a1d5d1badeff1627a88b"
integrity sha512-TktyuMHVqlhtUxXK3cUaijlvlqiyWfpEYgzd2JD1EcvsVB55zLmtRKb/1fbtLbjRqOapcFsVihD5pVW9nyFlTg==
dependencies:
"@ethersproject/abi" "^5.0.12"
"@ethersproject/abi" "^5.5.0"
"@ethersproject/solidity" "^5.0.9"
"@uniswap/sdk-core" "^4.2.0"
"@uniswap/swap-router-contracts" "^1.2.1"
"@uniswap/sdk-core" "^5.0.0"
"@uniswap/swap-router-contracts" "^1.3.0"
"@uniswap/v3-periphery" "^1.1.1"
"@uniswap/v3-staker" "1.0.0"
tiny-invariant "^1.1.0"
Expand Down
Loading