Skip to content

Commit

Permalink
fix: bump sdks for correct quoter address on astrochain sepolia (#738)
Browse files Browse the repository at this point in the history
* fix: bump sdks for correct quoter address on astrochain sepolia

* fix: bump sdks to have correct quoter address on astrochain sepolia, also add FOT detector on worldchain and astrochain sepolia

* github workflow test astrochain
  • Loading branch information
jsy1218 authored Oct 4, 2024
1 parent 069a038 commit 758575d
Show file tree
Hide file tree
Showing 6 changed files with 89 additions and 47 deletions.
26 changes: 25 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -780,8 +780,32 @@ jobs:
TENDERLY_PROJECT: ${{ secrets.TENDERLY_PROJECT }}
TENDERLY_ACCESS_KEY: ${{ secrets.TENDERLY_ACCESS_KEY }}

integration-tests-quote-for-other-networks-astrochain:
name: Integration Tests - Quote For Other Networks AstroChain
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 18.x
registry-url: https://registry.npmjs.org

- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm install

# This is required separately from yarn test because it generates the typechain definitions
- name: Compile
run: npm run build

- name: Run Integration tests
run: npm run integ-test -- -t 'quote for other networks * astrochain-sepolia'
run: npm run integ-test -- -t 'quote for other networks * astrochain'
env:
JSON_RPC_PROVIDER_ASTROCHAIN_SEPOLIA: ${{ secrets.JSON_RPC_PROVIDER_ASTROCHAIN_SEPOLIA }}
TENDERLY_BASE_URL: ${{ secrets.TENDERLY_BASE_URL }}
Expand Down
64 changes: 32 additions & 32 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@
"@uniswap/default-token-list": "^11.13.0",
"@uniswap/permit2-sdk": "^1.3.0",
"@uniswap/router-sdk": "^1.14.0",
"@uniswap/sdk-core": "^5.8.0",
"@uniswap/sdk-core": "^5.8.1",
"@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": "^3.3.0",
"@uniswap/v2-sdk": "^4.6.0",
"@uniswap/v3-sdk": "^3.17.0",
"@uniswap/v4-sdk": "^1.6.3",
"@uniswap/v2-sdk": "^4.6.1",
"@uniswap/v3-sdk": "^3.17.1",
"@uniswap/v4-sdk": "^1.10.0",
"async-retry": "^1.3.1",
"await-timeout": "^1.1.1",
"axios": "^0.21.1",
Expand Down
4 changes: 4 additions & 0 deletions src/providers/token-fee-fetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ const FEE_DETECTOR_ADDRESS = (chainId: ChainId) => {
return '0x8eEa35913DdeD795001562f9bA5b282d3ac04B60';
case ChainId.AVALANCHE:
return '0x8269d47c4910B8c87789aA0eC128C11A8614dfC8';
case ChainId.WORLDCHAIN:
return '0xbc708B192552e19A088b4C4B8772aEeA83bCf760';
case ChainId.ASTROCHAIN_SEPOLIA:
return '0xbc708B192552e19A088b4C4B8772aEeA83bCf760';
default:
// just default to mainnet contract
return '0xbc708B192552e19A088b4C4B8772aEeA83bCf760';
Expand Down
3 changes: 3 additions & 0 deletions src/util/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const SUPPORTED_CHAINS: ChainId[] = [
ChainId.ZORA,
ChainId.ZKSYNC,
ChainId.WORLDCHAIN,
ChainId.ASTROCHAIN_SEPOLIA,
// Gnosis and Moonbeam don't yet have contracts deployed yet
];

Expand All @@ -39,6 +40,8 @@ export const V2_SUPPORTED = [
ChainId.BASE,
ChainId.BNB,
ChainId.AVALANCHE,
ChainId.WORLDCHAIN,
ChainId.ASTROCHAIN_SEPOLIA,
];

export const V4_SUPPORTED = [ChainId.SEPOLIA];
Expand Down
31 changes: 21 additions & 10 deletions test/integ/routers/alpha-router/alpha-router.integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3506,8 +3506,7 @@ describe('quote for other networks', () => {
// Tests are failing https://github.com/Uniswap/smart-order-router/issues/104
c != ChainId.CELO_ALFAJORES &&
c != ChainId.ZORA_SEPOLIA &&
c != ChainId.ROOTSTOCK &&
c != ChainId.ASTROCHAIN_SEPOLIA
c != ChainId.ROOTSTOCK
)) {
for (const tradeType of [TradeType.EXACT_INPUT, TradeType.EXACT_OUTPUT]) {
const erc1 = TEST_ERC20_1[chain]();
Expand Down Expand Up @@ -3651,7 +3650,10 @@ describe('quote for other networks', () => {

const tokenIn = wrappedNative;
const tokenOut = erc1;
const amount =
const amount = ChainId.ASTROCHAIN_SEPOLIA ?
tradeType == TradeType.EXACT_INPUT ?
parseAmount('0.01', tokenIn):
parseAmount('0.01', tokenOut) :
tradeType == TradeType.EXACT_INPUT
? parseAmount('10', tokenIn)
: parseAmount('10', tokenOut);
Expand Down Expand Up @@ -3715,7 +3717,10 @@ describe('quote for other networks', () => {

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

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

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

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

// Universal Router is not deployed on Gorli.
const swapWithSimulationOptions: SwapOptions =
Expand Down Expand Up @@ -4243,7 +4254,7 @@ describe('quote for other networks', () => {
const tokenOut = chain == ChainId.BASE || chain == ChainId.ZORA ? USDC_ON(chain) : erc2;
const amount =
tradeType == TradeType.EXACT_INPUT
? parseAmount(chain === ChainId.WORLDCHAIN || chain === ChainId.ASTROCHAIN_SEPOLIA ? '0.01' : '1', tokenIn)
? parseAmount(chain === ChainId.WORLDCHAIN || chain === ChainId.ASTROCHAIN_SEPOLIA ? '0.001' : '1', tokenIn)
: parseAmount('1', tokenOut);

// Universal Router is not deployed on Gorli.
Expand Down

0 comments on commit 758575d

Please sign in to comment.