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: add Arb Sepolia list #113

Merged
merged 18 commits into from
Jan 3, 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
1 change: 1 addition & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
INFURA_KEY=
MAINNET_RPC="https://mainnet.infura.io/v3/${INFURA_KEY}"
GOERLI_RPC="https://goerli.infura.io/v3/${INFURA_KEY}"
SEPOLIA_RPC="https://sepolia.infura.io/v3/${INFURA_KEY}"
l2NetworkID=42161
PORT=3000
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ jobs:
INFURA_KEY: '${{ secrets.INFURA_KEY }}'
MAINNET_RPC: 'https://mainnet.infura.io/v3/${{ secrets.INFURA_KEY }}'
GOERLI_RPC: 'https://goerli.infura.io/v3/${{ secrets.INFURA_KEY }}'
SEPOLIA_RPC: 'https://sepolia.infura.io/v3/${{ secrets.INFURA_KEY }}'

steps:
- uses: actions/checkout@v3
Expand All @@ -72,6 +73,7 @@ jobs:
INFURA_KEY: '${{ secrets.INFURA_KEY }}'
MAINNET_RPC: 'https://mainnet.infura.io/v3/${{ secrets.INFURA_KEY }}'
GOERLI_RPC: 'https://goerli.infura.io/v3/${{ secrets.INFURA_KEY }}'
SEPOLIA_RPC: 'https://sepolia.infura.io/v3/${{ secrets.INFURA_KEY }}'

steps:
- uses: actions/checkout@v3
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/generate-token-lists.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,23 @@ jobs:
- ArbTokenLists/421613_arbed_full.json
version: false
command: yarn fullList --l2NetworkID 421613 --newArbifiedList ./src/ArbTokenLists/421613_arbed_full.json --skipValidation

- name: ArbSepolia Arbify Uniswap
paths:
- ArbTokenLists/421614_arbed_coinmarketcap.json
version: true
command: yarn arbify --l2NetworkID 421614 --ignorePreviousList 421614_arbed_uniswap_labs_default.json --tokenList https://gateway.ipfs.io/ipns/tokens.uniswap.org --newArbifiedList ./src/ArbTokenLists/421614_arbed_uniswap_labs_default.json
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--ignorePreviousList is temporary because we don't have an existing list yet and the arbifying process won't work without this flag

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted, list was uploaded to s3


- name: ArbSepolia FullList
paths:
- ArbTokenLists/421614_arbed_full.json
version: false
command: yarn fullList --l2NetworkID 421614 --newArbifiedList ./src/ArbTokenLists/421614_arbed_full.json --skipValidation
env:
INFURA_KEY: '${{ secrets.INFURA_KEY }}'
MAINNET_RPC: 'https://mainnet.infura.io/v3/${{ secrets.INFURA_KEY }}'
GOERLI_RPC: 'https://goerli.infura.io/v3/${{ secrets.INFURA_KEY }}'
SEPOLIA_RPC: 'https://sepolia.infura.io/v3/${{ secrets.INFURA_KEY }}'

steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"test:unit": "yarn test --ci __test__/unit"
},
"dependencies": {
"@arbitrum/sdk": "^3.0.0",
"@arbitrum/sdk": "^3.1.13",
"@types/jest": "^29.2.5",
"@uniswap/token-lists": "^1.0.0-beta.33",
"ajv": "^8.12.0",
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ From root:

1. `yarn install`
2. `cd packages/cli; cp .env.sample .env`
3. In `.env`, either set `MAINNET_RPC` and `GOERLI_RPC` var or `INFURA_KEY`
3. In `.env`, either set `MAINNET_RPC`, `GOERLI_RPC`, and `SEPOLIA_RPC` var or `INFURA_KEY`

### Arbify an L1 Token List

Expand Down
7 changes: 5 additions & 2 deletions src/lib/graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ const apolloL2GatewaysRinkebyClient =
const apolloL2GatewaysClient =
'https://api.thegraph.com/subgraphs/name/fredlacs/layer2-token-gateway';

const appoloL2GatewaysGoerliRollupClient =
const apolloL2GatewaysGoerliRollupClient =
'https://api.thegraph.com/subgraphs/name/fredlacs/layer2-token-gateway-nitro-goerli';
// const apolloL2GatewaysSepoliaRollupClient = '';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leftover comment


const chaidIdToGraphClientUrl = (chainID: string) => {
switch (chainID) {
Expand All @@ -18,7 +19,9 @@ const chaidIdToGraphClientUrl = (chainID: string) => {
case '421611':
return apolloL2GatewaysRinkebyClient;
case '421613':
return appoloL2GatewaysGoerliRollupClient;
return apolloL2GatewaysGoerliRollupClient;
// case '421614':
// return apolloL2GatewaysGoerliRollupClient;
default:
throw new Error('Unsupported chain');
}
Expand Down
5 changes: 3 additions & 2 deletions src/lib/instantiate_bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,20 @@ export const getNetworkConfig = async () => {

const l2Rpc = (() => {
if (networkID === 42161) return 'https://arb1.arbitrum.io/rpc';
else if (networkID === 421611) return 'https://rinkeby.arbitrum.io/rpc';
else if (networkID === 42170) return 'https://nova.arbitrum.io/rpc';
else if (networkID === 421613)
return 'https://goerli-rollup.arbitrum.io/rpc';
else if (networkID === 421614)
return 'https://sepolia-rollup.arbitrum.io/rpc';
throw new Error('No L2 RPC detected');
})();
const arbProvider = new providers.JsonRpcProvider(l2Rpc);
const l2Network = await getL2Network(arbProvider);

const expectedEnv = (() => {
if (l2Network.partnerChainID === 1) return 'MAINNET_RPC';
else if (l2Network.partnerChainID === 4) return 'RINKEBY_RPC';
else if (l2Network.partnerChainID === 5) return 'GOERLI_RPC';
else if (l2Network.partnerChainID === 11155111) return 'SEPOLIA_RPC';
throw new Error('No L1 RPC detected');
})();
const l1Rpc = process.env[expectedEnv];
Expand Down
1 change: 1 addition & 0 deletions src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const isNetwork = () => {
isArbOne: argv.l2NetworkID === 42161,
isNova: argv.l2NetworkID === 42170,
isGoerliRollup: argv.l2NetworkID === 421613,
isSepoliaRollup: argv.l2NetworkID === 421614,
};
};

Expand Down
21 changes: 17 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@
"@jridgewell/gen-mapping" "^0.1.0"
"@jridgewell/trace-mapping" "^0.3.9"

"@arbitrum/sdk@^3.0.0":
version "3.0.0"
resolved "https://registry.yarnpkg.com/@arbitrum/sdk/-/sdk-3.0.0.tgz#a5dc48a00cb8c6e230a2c696c0e880a7f80c637d"
integrity sha512-Mws5WAxxirp3vk8JH3vyQ5H6q1NNUIAAGEd9oEnQYDMyTBHLKU293GA3s9w4w6ZfIq/RZq8YCexhy4D1R+mQng==
"@arbitrum/sdk@^3.1.13":
version "3.1.13"
resolved "https://registry.yarnpkg.com/@arbitrum/sdk/-/sdk-3.1.13.tgz#a0d3d9a7b387f42547c63f6f066d8a6c4dd945cc"
integrity sha512-oE/j8ThWWEdFfV0helmR8lD0T67/CY1zMCt6RVslaCLrytFdbg3QsrHs/sQE3yiCXgisQlsx3qomCgh8PfBo8Q==
dependencies:
"@ethersproject/address" "^5.0.8"
"@ethersproject/bignumber" "^5.1.1"
"@ethersproject/bytes" "^5.0.8"
async-mutex "^0.4.0"
ethers "^5.1.0"

"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.16.0", "@babel/code-frame@^7.18.6":
Expand Down Expand Up @@ -1386,6 +1387,13 @@ ast-types-flow@^0.0.7:
resolved "https://registry.yarnpkg.com/ast-types-flow/-/ast-types-flow-0.0.7.tgz#f70b735c6bca1a5c9c22d982c3e39e7feba3bdad"
integrity sha512-eBvWn1lvIApYMhzQMsu9ciLfkBY499mFZlNqG+/9WR7PVlroQw0vG30cOQQbaKz3sCEc44TAOu2ykzqXSNnwag==

async-mutex@^0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/async-mutex/-/async-mutex-0.4.0.tgz#ae8048cd4d04ace94347507504b3cf15e631c25f"
integrity sha512-eJFZ1YhRR8UN8eBLoNzcDPcy/jqjsg6I1AP+KvWQX80BqOSW1oJPJXDylPUEeMr2ZQvHgnQ//Lp6f3RQ1zI7HA==
dependencies:
tslib "^2.4.0"

asynckit@^0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
Expand Down Expand Up @@ -4070,6 +4078,11 @@ tslib@^1.8.1:
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==

tslib@^2.4.0:
version "2.6.2"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae"
integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==

tsutils@^3.21.0:
version "3.21.0"
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623"
Expand Down
Loading