Skip to content

Commit

Permalink
polygon zkevm
Browse files Browse the repository at this point in the history
  • Loading branch information
lassejaco committed Oct 10, 2023
1 parent 52adc57 commit b2702d9
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 7 deletions.
33 changes: 32 additions & 1 deletion pretix_eth/network/tokens.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,9 +415,38 @@ class DaiGoerliArbitrum(Arbitrum):
CHAIN_ID = 421613
EIP3091_EXPLORER_URL = "https://goerli.arbiscan.io"

# """ ZkSync Networks """

# """ Polygon zk evm """
class Polygon(L1):
"""
Implementation for ZkSync networks
"""

NETWORK_IDENTIFIER = "PolygonZkEVM"
NETWORK_VERBOSE_NAME = "Polygon zkEVM"
CHAIN_ID = 1101
EIP3091_EXPLORER_URL = "https://zkevm.polygonscan.com/"


class ETHPolygonZkEvm(Polygon):
"""
Ethereum on Polygon mainnet Network
"""

TOKEN_SYMBOL = "ETH"


class DaiPolygonZkEvm(Polygon):
"""
DAI on Polygon Mainnet
"""

TOKEN_SYMBOL = "DAI"
IS_NATIVE_ASSET = False
ADDRESS = "0xC5015b9d9161Dca7e18e32f6f25C4aD850731Fd4"


# """ ZkSync Networks """
class ZkSync(L1):
"""
Implementation for ZkSync networks
Expand Down Expand Up @@ -461,6 +490,8 @@ class DaiZkSync(ZkSync):
ETHGoerliArbitrum(),
DaiGoerliArbitrum(),
ETHZkSync(),
ETHPolygonZkEvm(),
DaiPolygonZkEvm()
]
all_network_verbose_names_to_ids = {}
for token in registry:
Expand Down
1 change: 1 addition & 0 deletions pretix_eth/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def signal_process_response(sender, request, response, **kwargs):
# Chrome correctly errors out without this CSP
'connect-src': [
"wss://relay.walletconnect.com",
"https://zkevm-rpc.com/",
"https://explorer-api.walletconnect.com",
"https://rpc.walletconnect.com",
"https://zksync2-mainnet.zksync.io/",
Expand Down
4 changes: 2 additions & 2 deletions pretix_eth/static/pretix_eth/web3modal-dist/manifest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"main.js": "/static/pretix_eth/web3modal-dist/web3modal.eef51034554448f63acc.js",
"periodicCheck.js": "/static/pretix_eth/web3modal-dist/web3modal.7a7a63a03cd530c47640.js"
"main.js": "/static/pretix_eth/web3modal-dist/web3modal.4411707096ff89c614b4.js",
"periodicCheck.js": "/static/pretix_eth/web3modal-dist/web3modal.177d8cabdae10dcc5990.js"
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion pretix_eth/static/pretix_eth/web3modal/src/chains.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { arbitrum, arbitrumGoerli, mainnet, goerli, optimism, optimismGoerli, sepolia, zkSync } from "@wagmi/core/chains";
import { arbitrum, arbitrumGoerli, mainnet, goerli, optimism, optimismGoerli, sepolia, zkSync, polygonZkEvm } from "@wagmi/core/chains";

// Safe is only supported on certain networks there doesn't seem to be any smart way to detect if a network is supported (it doesn't follow https://github.com/ethereum-lists/chains ?), so this has to be manually configured
// Safe documentation: https://github.com/safe-global/safe-docs/blob/main/learn/safe-core/safe-core-api/available-services.md
Expand Down Expand Up @@ -31,4 +31,7 @@ export default [
{
chain: sepolia
},
{
chain: polygonZkEvm
}
];

0 comments on commit b2702d9

Please sign in to comment.