From 47fe577ca2471aec6bd3eb3dc46aca722910c3a9 Mon Sep 17 00:00:00 2001 From: rajivpoc Date: Fri, 10 Sep 2021 12:39:38 -0400 Subject: [PATCH 1/5] [feat] add optimism --- src/seth/README.md | 2 +- src/seth/libexec/seth/seth | 4 ++++ src/seth/libexec/seth/seth-chain | 2 ++ src/seth/libexec/seth/seth-etherscan-source | 5 ++++- 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/seth/README.md b/src/seth/README.md index f42fa56bc..816fb77e2 100644 --- a/src/seth/README.md +++ b/src/seth/README.md @@ -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`, `bsc`, `bsctest`, `kotti`, or `unknown`. ### `seth chain-id` diff --git a/src/seth/libexec/seth/seth b/src/seth/libexec/seth/seth index 90951481e..1671e1688 100755 --- a/src/seth/libexec/seth/seth +++ b/src/seth/libexec/seth/seth @@ -214,6 +214,10 @@ if [[ $SETH_CHAIN ]]; then ~/{.local/share,Library/Application\ Support}/io.parity.ethereum/keys/"$SETH_CHAIN"/ ) ;; + optimism) + eth_rpc_url=https://optimism-mainnet.infura.io/$INFURA_KEY + export ETHERSCAN_API_URL=https://api-optimistic.etherscan.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 diff --git a/src/seth/libexec/seth/seth-chain b/src/seth/libexec/seth/seth-chain index 14da75ddc..fe9e9cfd0 100755 --- a/src/seth/libexec/seth/seth-chain +++ b/src/seth/libexec/seth/seth-chain @@ -15,6 +15,8 @@ case $genesis in echo kovan;; 0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d) echo ropsten;; + 0x39e1b9259598b65c8c71d1ea153de17e89222e64e8b271213dfb92c231f7fb88) + echo optimism;; 0x0cd786a2425d16f152c658316c423e6ce1181e15c3295826d7c9904cba9ce303) echo morden;; 0x6341fd3daf94b748c72ced5a5b26028f2474f5f00d824504e4fa37a75767e177) diff --git a/src/seth/libexec/seth/seth-etherscan-source b/src/seth/libexec/seth/seth-etherscan-source index 5072b7b91..95a23598f 100755 --- a/src/seth/libexec/seth/seth-etherscan-source +++ b/src/seth/libexec/seth/seth-etherscan-source @@ -29,6 +29,9 @@ case "$chain" in ropsten|kovan|rinkeby|goerli) URL="${ETHERSCAN_API_URL:-https://api-$chain.etherscan.io}" ;; + optimism) + URL="${ETHERSCAN_API_URL:-https://api-optimismistic.etherscan.io}" + ;; bsctest) URL="${ETHERSCAN_API_URL:-https://api-testnet.bscscan.com}" ;; @@ -36,7 +39,7 @@ case "$chain" in 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, and optimism." exit 1 esac From 096ee134c0f111994f06ab54016c903a0c17bd43 Mon Sep 17 00:00:00 2001 From: rajivpoc Date: Fri, 10 Sep 2021 13:21:20 -0400 Subject: [PATCH 2/5] fix spelling error --- src/seth/libexec/seth/seth-etherscan-source | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/seth/libexec/seth/seth-etherscan-source b/src/seth/libexec/seth/seth-etherscan-source index 95a23598f..d1e849f47 100755 --- a/src/seth/libexec/seth/seth-etherscan-source +++ b/src/seth/libexec/seth/seth-etherscan-source @@ -30,7 +30,7 @@ case "$chain" in URL="${ETHERSCAN_API_URL:-https://api-$chain.etherscan.io}" ;; optimism) - URL="${ETHERSCAN_API_URL:-https://api-optimismistic.etherscan.io}" + URL="${ETHERSCAN_API_URL:-https://api-optimistic.etherscan.io}" ;; bsctest) URL="${ETHERSCAN_API_URL:-https://api-testnet.bscscan.com}" From ac385fbfdf9812ca618af0b30c80de82b6f5d11d Mon Sep 17 00:00:00 2001 From: rajivpoc Date: Fri, 10 Sep 2021 13:53:40 -0400 Subject: [PATCH 3/5] [added] optimistic ethereum kovan support --- src/seth/README.md | 2 +- src/seth/libexec/seth/seth | 6 +++++- src/seth/libexec/seth/seth-chain | 5 ++++- src/seth/libexec/seth/seth-etherscan-source | 7 +++++-- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/seth/README.md b/src/seth/README.md index 816fb77e2..7dbccbe37 100644 --- a/src/seth/README.md +++ b/src/seth/README.md @@ -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`, `optimism`, `bsc`, `bsctest`, `kotti`, or `unknown`. +`rinkeby`, `optimism-mainnet`, `optimism-kovan` `bsc`, `bsctest`, `kotti`, or `unknown`. ### `seth chain-id` diff --git a/src/seth/libexec/seth/seth b/src/seth/libexec/seth/seth index 1671e1688..b74dd3cae 100755 --- a/src/seth/libexec/seth/seth +++ b/src/seth/libexec/seth/seth @@ -214,10 +214,14 @@ if [[ $SETH_CHAIN ]]; then ~/{.local/share,Library/Application\ Support}/io.parity.ethereum/keys/"$SETH_CHAIN"/ ) ;; - optimism) + optimism-mainnet) eth_rpc_url=https://optimism-mainnet.infura.io/$INFURA_KEY export ETHERSCAN_API_URL=https://api-optimistic.etherscan.io/api ;; + optimistm-kovan) + eth_rpc_url=https://optimism-kovan.infura.io/$INFURA_KEY + export ETHERSCAN_API_URL=https://api-kovan-optimistic.etherscan.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 diff --git a/src/seth/libexec/seth/seth-chain b/src/seth/libexec/seth/seth-chain index fe9e9cfd0..791345f67 100755 --- a/src/seth/libexec/seth/seth-chain +++ b/src/seth/libexec/seth/seth-chain @@ -3,6 +3,7 @@ ### Print the name of the current chain (`ethlive', `kovan', etc). set -e genesis=$(seth block 0 hash) +echo $genesis case $genesis in 0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3) case $(seth block 1920000 hash 2>/dev/null || echo null) in @@ -16,7 +17,9 @@ case $genesis in 0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d) echo ropsten;; 0x39e1b9259598b65c8c71d1ea153de17e89222e64e8b271213dfb92c231f7fb88) - echo optimism;; + echo optimism-mainnet;; + 0x2510549c5c30f15472b55dbae139122e2e593f824217eefc7a53f78698ac5c1e) + echo optimism-kovan;; 0x0cd786a2425d16f152c658316c423e6ce1181e15c3295826d7c9904cba9ce303) echo morden;; 0x6341fd3daf94b748c72ced5a5b26028f2474f5f00d824504e4fa37a75767e177) diff --git a/src/seth/libexec/seth/seth-etherscan-source b/src/seth/libexec/seth/seth-etherscan-source index d1e849f47..c034c1e0e 100755 --- a/src/seth/libexec/seth/seth-etherscan-source +++ b/src/seth/libexec/seth/seth-etherscan-source @@ -29,9 +29,12 @@ case "$chain" in ropsten|kovan|rinkeby|goerli) URL="${ETHERSCAN_API_URL:-https://api-$chain.etherscan.io}" ;; - optimism) + optimism-mainnet) URL="${ETHERSCAN_API_URL:-https://api-optimistic.etherscan.io}" ;; + optimism-kovan) + URL="${ETHERSCAN_API_URL:-https://https://api-kovan-optimistic.etherscan.io/}" + ;; bsctest) URL="${ETHERSCAN_API_URL:-https://api-testnet.bscscan.com}" ;; @@ -39,7 +42,7 @@ case "$chain" in URL="${ETHERSCAN_API_URL:-https://api.bscscan.com}" ;; *) - echo >&2 "Source fetching only works on mainnet, ropsten, kovan, rinkeby, goerli, and optimism." + echo >&2 "Source fetching only works on mainnet, ropsten, kovan, rinkeby, goerli, optimism-mainnet, and optimism-kovan." exit 1 esac From 635c89a044e11d1063081c0fb8c49d6927691be0 Mon Sep 17 00:00:00 2001 From: rajivpoc Date: Fri, 10 Sep 2021 13:55:05 -0400 Subject: [PATCH 4/5] remove unnecessary echo --- src/seth/libexec/seth/seth-chain | 1 - 1 file changed, 1 deletion(-) diff --git a/src/seth/libexec/seth/seth-chain b/src/seth/libexec/seth/seth-chain index 791345f67..a0455db14 100755 --- a/src/seth/libexec/seth/seth-chain +++ b/src/seth/libexec/seth/seth-chain @@ -3,7 +3,6 @@ ### Print the name of the current chain (`ethlive', `kovan', etc). set -e genesis=$(seth block 0 hash) -echo $genesis case $genesis in 0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3) case $(seth block 1920000 hash 2>/dev/null || echo null) in From 8b6fcb854afbcf50809b6fc4ad0a84d536d334ea Mon Sep 17 00:00:00 2001 From: rajivpoc Date: Fri, 10 Sep 2021 15:06:44 -0400 Subject: [PATCH 5/5] [added] arbitrum mainnet support --- src/seth/README.md | 2 +- src/seth/libexec/seth/seth | 6 +++++- src/seth/libexec/seth/seth-chain | 2 ++ src/seth/libexec/seth/seth-etherscan-source | 7 +++++-- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/seth/README.md b/src/seth/README.md index 7dbccbe37..56e5f0a11 100644 --- a/src/seth/README.md +++ b/src/seth/README.md @@ -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`, `optimism-mainnet`, `optimism-kovan` `bsc`, `bsctest`, `kotti`, or `unknown`. +`rinkeby`, `optimism-mainnet`, `optimism-kovan`, `arbitrum-mainnet`, `bsc`, `bsctest`, `kotti`, or `unknown`. ### `seth chain-id` diff --git a/src/seth/libexec/seth/seth b/src/seth/libexec/seth/seth index b74dd3cae..2304c5c85 100755 --- a/src/seth/libexec/seth/seth +++ b/src/seth/libexec/seth/seth @@ -218,10 +218,14 @@ if [[ $SETH_CHAIN ]]; then eth_rpc_url=https://optimism-mainnet.infura.io/$INFURA_KEY export ETHERSCAN_API_URL=https://api-optimistic.etherscan.io/api ;; - optimistm-kovan) + 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 diff --git a/src/seth/libexec/seth/seth-chain b/src/seth/libexec/seth/seth-chain index a0455db14..22b982158 100755 --- a/src/seth/libexec/seth/seth-chain +++ b/src/seth/libexec/seth/seth-chain @@ -19,6 +19,8 @@ case $genesis in echo optimism-mainnet;; 0x2510549c5c30f15472b55dbae139122e2e593f824217eefc7a53f78698ac5c1e) echo optimism-kovan;; + 0x7ee576b35482195fc49205cec9af72ce14f003b9ae69f6ba0faef4514be8b442) + echo arbitrum-mainnet;; 0x0cd786a2425d16f152c658316c423e6ce1181e15c3295826d7c9904cba9ce303) echo morden;; 0x6341fd3daf94b748c72ced5a5b26028f2474f5f00d824504e4fa37a75767e177) diff --git a/src/seth/libexec/seth/seth-etherscan-source b/src/seth/libexec/seth/seth-etherscan-source index c034c1e0e..de79a9f46 100755 --- a/src/seth/libexec/seth/seth-etherscan-source +++ b/src/seth/libexec/seth/seth-etherscan-source @@ -33,7 +33,10 @@ case "$chain" in URL="${ETHERSCAN_API_URL:-https://api-optimistic.etherscan.io}" ;; optimism-kovan) - URL="${ETHERSCAN_API_URL:-https://https://api-kovan-optimistic.etherscan.io/}" + 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}" @@ -42,7 +45,7 @@ case "$chain" in URL="${ETHERSCAN_API_URL:-https://api.bscscan.com}" ;; *) - echo >&2 "Source fetching only works on mainnet, ropsten, kovan, rinkeby, goerli, optimism-mainnet, and optimism-kovan." + echo >&2 "Source fetching only works on mainnet, ropsten, kovan, rinkeby, goerli, optimism-mainnet, optimism-kovan, and arbitrum-mainnet." exit 1 esac