Skip to content

Commit

Permalink
⛓ Add chain zkSync Era
Browse files Browse the repository at this point in the history
  • Loading branch information
coccoinomane committed Mar 31, 2023
1 parent be4396b commit e09a63c
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 6 deletions.
14 changes: 9 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
10 changes: 10 additions & 0 deletions src/web3cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
17 changes: 16 additions & 1 deletion src/web3core/seeds/chain_seeds.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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]

0 comments on commit e09a63c

Please sign in to comment.