Skip to content

Commit adcc076

Browse files
authored
seth: add Optimistic Ethereum and Arbitrum Support (#781)
* [feat] add optimism * fix spelling error * [added] optimistic ethereum kovan support * remove unnecessary echo * [added] arbitrum mainnet support
1 parent 0c5c7dd commit adcc076

File tree

4 files changed

+29
-2
lines changed

4 files changed

+29
-2
lines changed

src/seth/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ Print the symbolic name of the current blockchain by checking the
560560
genesis block hash.
561561

562562
Outputs one of `ethlive`, `etclive`, `kovan`, `ropsten`, `goerli`, `morden`,
563-
`rinkeby`, or `unknown`.
563+
`rinkeby`, `optimism-mainnet`, `optimism-kovan`, `arbitrum-mainnet`, `bsc`, `bsctest`, `kotti`, or `unknown`.
564564

565565
### `seth chain-id`
566566

src/seth/libexec/seth/seth

+12
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,18 @@ if [[ $SETH_CHAIN ]]; then
214214
~/{.local/share,Library/Application\ Support}/io.parity.ethereum/keys/"$SETH_CHAIN"/
215215
)
216216
;;
217+
optimism-mainnet)
218+
eth_rpc_url=https://optimism-mainnet.infura.io/$INFURA_KEY
219+
export ETHERSCAN_API_URL=https://api-optimistic.etherscan.io/api
220+
;;
221+
optimism-kovan)
222+
eth_rpc_url=https://optimism-kovan.infura.io/$INFURA_KEY
223+
export ETHERSCAN_API_URL=https://api-kovan-optimistic.etherscan.io/api
224+
;;
225+
arbitrum-mainnet)
226+
eth_rpc_url=https://arbitrum-mainnet.infura.io/$INFURA_KEY
227+
export ETHERSCAN_API_URL=https://api.arbiscan.io/api
228+
;;
217229
bsctest)
218230
eth_rpc_url=https://data-seed-prebsc-2-s1.binance.org:8545/
219231
export ETHERSCAN_API_URL=https://api-testnet.bscscan.com/api

src/seth/libexec/seth/seth-chain

+6
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ case $genesis in
1515
echo kovan;;
1616
0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d)
1717
echo ropsten;;
18+
0x39e1b9259598b65c8c71d1ea153de17e89222e64e8b271213dfb92c231f7fb88)
19+
echo optimism-mainnet;;
20+
0x2510549c5c30f15472b55dbae139122e2e593f824217eefc7a53f78698ac5c1e)
21+
echo optimism-kovan;;
22+
0x7ee576b35482195fc49205cec9af72ce14f003b9ae69f6ba0faef4514be8b442)
23+
echo arbitrum-mainnet;;
1824
0x0cd786a2425d16f152c658316c423e6ce1181e15c3295826d7c9904cba9ce303)
1925
echo morden;;
2026
0x6341fd3daf94b748c72ced5a5b26028f2474f5f00d824504e4fa37a75767e177)

src/seth/libexec/seth/seth-etherscan-source

+10-1
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,23 @@ case "$chain" in
2929
ropsten|kovan|rinkeby|goerli)
3030
URL="${ETHERSCAN_API_URL:-https://api-$chain.etherscan.io}"
3131
;;
32+
optimism-mainnet)
33+
URL="${ETHERSCAN_API_URL:-https://api-optimistic.etherscan.io}"
34+
;;
35+
optimism-kovan)
36+
URL="${ETHERSCAN_API_URL:-https://api-kovan-optimistic.etherscan.io/}"
37+
;;
38+
arbitrum-mainnet)
39+
URL="${ETHERSCAN_API_URL:-https://api.arbiscan.io/api}"
40+
;;
3241
bsctest)
3342
URL="${ETHERSCAN_API_URL:-https://api-testnet.bscscan.com}"
3443
;;
3544
bsc)
3645
URL="${ETHERSCAN_API_URL:-https://api.bscscan.com}"
3746
;;
3847
*)
39-
echo >&2 "Source fetching only works on mainnet, ropsten, kovan, rinkeby, and goerli."
48+
echo >&2 "Source fetching only works on mainnet, ropsten, kovan, rinkeby, goerli, optimism-mainnet, optimism-kovan, and arbitrum-mainnet."
4049
exit 1
4150
esac
4251

0 commit comments

Comments
 (0)