From e09a63c120b6eb1bc6dfda1bbc91a2486fed7275 Mon Sep 17 00:00:00 2001 From: "Guido W. Pettinari" Date: Fri, 31 Mar 2023 18:06:53 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9B=93=20Add=20chain=20zkSync=20Era?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyproject.toml | 14 +++++++++----- src/web3cli/main.py | 10 ++++++++++ src/web3core/seeds/chain_seeds.py | 17 ++++++++++++++++- 3 files changed, 35 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index ab9971c..8a46f5c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,11 +36,13 @@ dev = [ [tool.pdm.scripts] w3 = {cmd = "w3", help = "Run the CLI in dev mode"} -w3eth = {cmd = "w3eth", help = "Run the CLI in dev mode, on eth chain"} -w3bnb = {cmd = "w3bnb", help = "Run the CLI in dev mode, on bnb chain"} -w3avax = {cmd = "w3avax", help = "Run the CLI in dev mode, on avax chain"} -w3matic = {cmd = "w3matic", help = "Run the CLI in dev mode, on matic chain"} -w3cro = {cmd = "w3cro", help = "Run the CLI in dev mode, on cro chain"} +w3eth = {cmd = "w3eth", help = "Run the CLI in dev mode, on Ethereum"} +w3bnb = {cmd = "w3bnb", help = "Run the CLI in dev mode, on BNB chain"} +w3avax = {cmd = "w3avax", help = "Run the CLI in dev mode, on Avalanche chain"} +w3matic = {cmd = "w3matic", help = "Run the CLI in dev mode, on Polygon POS chain"} +w3cro = {cmd = "w3cro", help = "Run the CLI in dev mode, on Cronos chain"} +w3arb = {cmd = "w3arb", help = "Run the CLI in dev mode, on Arbitrum One chain"} +w3era = {cmd = "w3era", help = "Run the CLI in dev mode, on zkSync Era chain"} test = "brownie test tests" test_verbose = "brownie test tests -s" @@ -61,6 +63,8 @@ w3bnb = "web3cli.main:w3bnb" w3avax = "web3cli.main:w3avax" w3matic = "web3cli.main:w3matic" w3cro = "web3cli.main:w3cro" +w3arb = "web3cli.main:w3arb" +w3era = "web3cli.main:w3era" [project.urls] homepage = "https://github.com/coccoinomane/web3cli" diff --git a/src/web3cli/main.py b/src/web3cli/main.py index d5b3abf..d186ff5 100644 --- a/src/web3cli/main.py +++ b/src/web3cli/main.py @@ -210,3 +210,13 @@ def w3matic() -> None: def w3cro() -> None: """Shorthand command w3eth that uses cro chain""" main(lambda a: override_arg(a, "chain", "cro")) + + +def w3arb() -> None: + """Shorthand command w3eth that uses arb chain""" + main(lambda a: override_arg(a, "chain", "arb")) + + +def w3era() -> None: + """Shorthand command w3eth that uses zkSync Era chain""" + main(lambda a: override_arg(a, "chain", "era")) diff --git a/src/web3core/seeds/chain_seeds.py b/src/web3core/seeds/chain_seeds.py index 76343be..d9288db 100644 --- a/src/web3core/seeds/chain_seeds.py +++ b/src/web3core/seeds/chain_seeds.py @@ -92,6 +92,21 @@ ], } +# Arbitrum One chain +era: ChainFields = { + "name": "era", + "desc": "zkSync Era", + "chain_id": 324, + "coin": "ETH", + "tx_type": 2, + "middlewares": "", + "rpcs": [ + { + "url": "https://mainnet.era.zksync.io", + }, + ], +} + # Local chain (e.g. ganache or hardhat network) local: ChainFields = { @@ -108,4 +123,4 @@ ], } -all: List[ChainFields] = [eth, arb, bnb, avax, matic, cro, local] +all: List[ChainFields] = [eth, bnb, avax, matic, cro, arb, era, local]