Skip to content

Commit

Permalink
Create zkEVM and zkEVM Cardona testnet under Polygon blockchain. Depr…
Browse files Browse the repository at this point in the history
…ecate blockchain level zkEVM records. Update deps
  • Loading branch information
OBrezhniev committed Sep 9, 2024
1 parent 8565593 commit 369e31a
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 24 deletions.
41 changes: 30 additions & 11 deletions did.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ const (
// Polygon is polygon blockchain network
Polygon Blockchain = "polygon"
// ZkEVM is zkEVM blockchain network
// Note: deprecated in favor of a zkEVM network of Polygon, will be removed in the future
ZkEVM Blockchain = "zkevm"
// Privado is Privado blockchain network
Privado Blockchain = "privado"
Expand Down Expand Up @@ -102,17 +103,10 @@ func RegisterBlockchain(b Blockchain) error {
// NetworkID is method specific network identifier
type NetworkID string

// Generic NetworkIDs
const (
// Main is main network
Main NetworkID = "main"
// Mumbai is polygon mumbai test network
Mumbai NetworkID = "mumbai"
// Amoy is polygon amoy test network
Amoy NetworkID = "amoy"
// Goerli is ethereum goerli test network
Goerli NetworkID = "goerli" // goerli
// Sepolia is ethereum Sepolia test network
Sepolia NetworkID = "sepolia"
// Test is test network
Test NetworkID = "test"
// UnknownNetwork is used when it's not possible to retrieve network from identifier
Expand All @@ -121,10 +115,32 @@ const (
NoNetwork NetworkID = ""
)

// Ethereum-specific NetworkIDs
const (
// Goerli is Ethereum goerli test network
Goerli NetworkID = "goerli"
// Sepolia is Ethereum Sepolia test network
Sepolia NetworkID = "sepolia"
)

// Polygon-specific NetworkIDs
const (
// Mumbai is Polygon mumbai test network
Mumbai NetworkID = "mumbai"
// Amoy is Polygon amoy test network
Amoy NetworkID = "amoy"
// Zkevm is zkEVM network in Polygon and potentially other blockchains
Zkevm NetworkID = "zkevm"
// Cardona is Polygon zkEVM Cardona test network
Cardona NetworkID = "cardona"
)

var networks = map[NetworkID]NetworkID{
Main: Main,
Mumbai: Mumbai,
Amoy: Amoy,
Zkevm: Zkevm,
Cardona: Cardona,
Goerli: Goerli,
Sepolia: Sepolia,
Test: Test,
Expand Down Expand Up @@ -188,14 +204,17 @@ type DIDNetworkFlag struct {
var blockchainNetworkMap = map[DIDNetworkFlag]byte{
{Blockchain: ReadOnly, NetworkID: NoNetwork}: 0b0000_0000,

{Blockchain: Polygon, NetworkID: Main}: 0b0001_0000 | 0b0000_0001,
{Blockchain: Polygon, NetworkID: Mumbai}: 0b0001_0000 | 0b0000_0010,
{Blockchain: Polygon, NetworkID: Amoy}: 0b0001_0000 | 0b0000_0011,
{Blockchain: Polygon, NetworkID: Main}: 0b0001_0000 | 0b0000_0001,
{Blockchain: Polygon, NetworkID: Mumbai}: 0b0001_0000 | 0b0000_0010,
{Blockchain: Polygon, NetworkID: Amoy}: 0b0001_0000 | 0b0000_0011,
{Blockchain: Polygon, NetworkID: Zkevm}: 0b0001_0000 | 0b0000_0100,
{Blockchain: Polygon, NetworkID: Cardona}: 0b0001_0000 | 0b0000_0101,

{Blockchain: Ethereum, NetworkID: Main}: 0b0010_0000 | 0b0000_0001,
{Blockchain: Ethereum, NetworkID: Goerli}: 0b0010_0000 | 0b0000_0010,
{Blockchain: Ethereum, NetworkID: Sepolia}: 0b0010_0000 | 0b0000_0011,

// deprecated in favor of a zkEVM network of Polygon, will be removed in the future
{Blockchain: ZkEVM, NetworkID: Main}: 0b0011_0000 | 0b0000_0001,
{Blockchain: ZkEVM, NetworkID: Test}: 0b0011_0000 | 0b0000_0010,

Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ module github.com/iden3/go-iden3-core/v2
go 1.18

require (
github.com/iden3/go-iden3-crypto v0.0.15
github.com/iden3/go-iden3-crypto v0.0.16
github.com/mr-tron/base58 v1.2.0
github.com/stretchr/testify v1.8.2
github.com/stretchr/testify v1.9.0
)

require (
Expand Down
15 changes: 4 additions & 11 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/iden3/go-iden3-crypto v0.0.15 h1:4MJYlrot1l31Fzlo2sF56u7EVFeHHJkxGXXZCtESgK4=
github.com/iden3/go-iden3-crypto v0.0.15/go.mod h1:dLpM4vEPJ3nDHzhWFXDjzkn1qHoBeOT/3UEhXsEsP3E=
github.com/iden3/go-iden3-crypto v0.0.16 h1:zN867xiz6HgErXVIV/6WyteGcOukE9gybYTorBMEdsk=
github.com/iden3/go-iden3-crypto v0.0.16/go.mod h1:dLpM4vEPJ3nDHzhWFXDjzkn1qHoBeOT/3UEhXsEsP3E=
github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c=
github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o=
github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

0 comments on commit 369e31a

Please sign in to comment.