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

seth: add Optimistic Ethereum and Arbitrum Support #781

Merged
merged 5 commits into from
Sep 11, 2021
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
2 changes: 1 addition & 1 deletion src/seth/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ Print the symbolic name of the current blockchain by checking the
genesis block hash.

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

### `seth chain-id`

Expand Down
12 changes: 12 additions & 0 deletions src/seth/libexec/seth/seth
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,18 @@ if [[ $SETH_CHAIN ]]; then
~/{.local/share,Library/Application\ Support}/io.parity.ethereum/keys/"$SETH_CHAIN"/
)
;;
optimism-mainnet)
eth_rpc_url=https://optimism-mainnet.infura.io/$INFURA_KEY
export ETHERSCAN_API_URL=https://api-optimistic.etherscan.io/api
;;
optimism-kovan)
eth_rpc_url=https://optimism-kovan.infura.io/$INFURA_KEY
export ETHERSCAN_API_URL=https://api-kovan-optimistic.etherscan.io/api
;;
arbitrum-mainnet)
eth_rpc_url=https://arbitrum-mainnet.infura.io/$INFURA_KEY
export ETHERSCAN_API_URL=https://api.arbiscan.io/api
;;
bsctest)
eth_rpc_url=https://data-seed-prebsc-2-s1.binance.org:8545/
export ETHERSCAN_API_URL=https://api-testnet.bscscan.com/api
Expand Down
6 changes: 6 additions & 0 deletions src/seth/libexec/seth/seth-chain
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ case $genesis in
echo kovan;;
0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d)
echo ropsten;;
0x39e1b9259598b65c8c71d1ea153de17e89222e64e8b271213dfb92c231f7fb88)
echo optimism-mainnet;;
0x2510549c5c30f15472b55dbae139122e2e593f824217eefc7a53f78698ac5c1e)
echo optimism-kovan;;
0x7ee576b35482195fc49205cec9af72ce14f003b9ae69f6ba0faef4514be8b442)
echo arbitrum-mainnet;;
0x0cd786a2425d16f152c658316c423e6ce1181e15c3295826d7c9904cba9ce303)
echo morden;;
0x6341fd3daf94b748c72ced5a5b26028f2474f5f00d824504e4fa37a75767e177)
Expand Down
11 changes: 10 additions & 1 deletion src/seth/libexec/seth/seth-etherscan-source
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,23 @@ case "$chain" in
ropsten|kovan|rinkeby|goerli)
URL="${ETHERSCAN_API_URL:-https://api-$chain.etherscan.io}"
;;
optimism-mainnet)
URL="${ETHERSCAN_API_URL:-https://api-optimistic.etherscan.io}"
;;
optimism-kovan)
URL="${ETHERSCAN_API_URL:-https://api-kovan-optimistic.etherscan.io/}"
;;
arbitrum-mainnet)
URL="${ETHERSCAN_API_URL:-https://api.arbiscan.io/api}"
;;
bsctest)
URL="${ETHERSCAN_API_URL:-https://api-testnet.bscscan.com}"
;;
bsc)
URL="${ETHERSCAN_API_URL:-https://api.bscscan.com}"
;;
*)
echo >&2 "Source fetching only works on mainnet, ropsten, kovan, rinkeby, and goerli."
echo >&2 "Source fetching only works on mainnet, ropsten, kovan, rinkeby, goerli, optimism-mainnet, optimism-kovan, and arbitrum-mainnet."
exit 1
esac

Expand Down