Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support zora #584

Merged
merged 6 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
fix zora integ tests
  • Loading branch information
jsy1218 committed May 21, 2024
commit 08c6d92c84693a3e6cdbc08877cc507fde6d4c23
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ jobs:
- name: Run Integration tests
run: npm run integ-test -- -t 'quote for other networks * zora'
env:
JSON_RPC_PROVIDER_BLAST: ${{ secrets.JSON_RPC_PROVIDER_BLAST }}
JSON_RPC_PROVIDER_BLAST: ${{ secrets.JSON_RPC_PROVIDER_ZORA }}
TENDERLY_BASE_URL: ${{ secrets.TENDERLY_BASE_URL }}
TENDERLY_USER: ${{ secrets.TENDERLY_USER }}
TENDERLY_PROJECT: ${{ secrets.TENDERLY_PROJECT }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ const GAS_ESTIMATE_DEVIATION_PERCENT: { [chainId in ChainId]: number } = {
[ChainId.AVALANCHE]: 36,
[ChainId.BASE]: 39,
[ChainId.BASE_GOERLI]: 30,
[ChainId.ZORA]: 30,
[ChainId.ZORA]: 40,
[ChainId.ZORA_SEPOLIA]: 30,
[ChainId.ROOTSTOCK]: 30,
[ChainId.BLAST]: 34,
Expand Down Expand Up @@ -3518,7 +3518,7 @@ describe('quote for other networks', () => {
const tokenOut = erc2;

// Current WETH/USDB pool (https://blastscan.io/address/0xf52b4b69123cbcf07798ae8265642793b2e8990c) has low WETH amount
const exactOutAmount = chain === ChainId.BLAST ? '0.002' : '1';
const exactOutAmount = chain === ChainId.BLAST || chain === ChainId.ZORA ? '0.002' : '1';
const amount =
tradeType == TradeType.EXACT_INPUT
? parseAmount('1', tokenIn)
Expand Down Expand Up @@ -3693,7 +3693,7 @@ describe('quote for other networks', () => {
const tokenOut = erc1;
const amount =
tradeType == TradeType.EXACT_INPUT
? parseAmount('10', tokenIn)
? parseAmount(chain === ChainId.ZORA ? '0.1': '10', tokenIn)
: parseAmount('10', tokenOut);

// Universal Router is not deployed on Gorli.
Expand Down Expand Up @@ -3896,8 +3896,8 @@ describe('quote for other networks', () => {
const tokenOut = erc2;
const amount =
tradeType == TradeType.EXACT_INPUT
? parseAmount('1', tokenIn)
: parseAmount('1', tokenOut);
? parseAmount(chain === ChainId.ZORA ? '0.1': '1', tokenIn)
: parseAmount(chain === ChainId.ZORA ? '0.1': '1', tokenOut);

// Universal Router is not deployed on Gorli.
const swapWithSimulationOptions: SwapOptions =
Expand Down Expand Up @@ -3996,7 +3996,7 @@ describe('quote for other networks', () => {
const tokenIn = nativeOnChain(chain);
// TODO ROUTE-64: Remove this once smart-order-router supports ETH native currency on BASE
// see https://uniswapteam.slack.com/archives/C021SU4PMR7/p1691593679108459?thread_ts=1691532336.742419&cid=C021SU4PMR7
const tokenOut = chain == ChainId.BASE ? USDC_ON(ChainId.BASE) : erc2
const tokenOut = chain == ChainId.BASE || chain == ChainId.ZORA ? USDC_ON(chain) : erc2
const amount =
tradeType == TradeType.EXACT_INPUT
? parseAmount('1', tokenIn)
Expand Down
5 changes: 4 additions & 1 deletion test/test-util/whales.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
USDC_NATIVE_OPTIMISM,
USDC_NATIVE_POLYGON,
USDC_ON,
USDC_ZORA,
USDT_MAINNET,
WETH9,
WNATIVE_ON
Expand All @@ -42,6 +43,8 @@ export const WHALES = (token: Currency): string => {
return '0x8894E0a0c962CB723c1976a4421c95949bE2D4E3';
case nativeOnChain(ChainId.OPTIMISM):
return '0x12478d1a60a910C9CbFFb90648766a2bDD5918f5';
case nativeOnChain(ChainId.ZORA):
return '0xBC698ce1933aFb2980D4A5a0F85feA1b02fbb1c9';
case WETH9[1]:
return '0x2fEb1512183545f48f6b9C5b4EbfCaF49CfCa6F3';
case WNATIVE_ON(ChainId.MAINNET):
Expand Down Expand Up @@ -98,7 +101,7 @@ export const WHALES = (token: Currency): string => {
return '0x8894E0a0c962CB723c1976a4421c95949bE2D4E3';
case USDC_ON(ChainId.BASE):
return '0x4a3636608d7bc5776cb19eb72caa36ebb9ea683b';
case USDC_ON(ChainId.ZORA):
case USDC_ZORA:
return '0x26eF03A20AaeDA8aaFCeE4E146DC6B328195947C';
case USDC_NATIVE_BASE:
return '0x20fe51a9229eef2cf8ad9e89d91cab9312cf3b7a';
Expand Down
Loading