Skip to content

Commit d5c24c0

Browse files
authored
Merge pull request #269 from semaphore-protocol/chore/mumbai
Semaphore support for Mumbai network Former-commit-id: e002b24
2 parents c1752dc + d7ce540 commit d5c24c0

File tree

7 files changed

+26
-2
lines changed

7 files changed

+26
-2
lines changed

packages/cli/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import Spinner from "./spinner.js"
1414
const packagePath = `${dirname(fileURLToPath(import.meta.url))}/..`
1515
const { description, version } = JSON.parse(readFileSync(`${packagePath}/package.json`, "utf8"))
1616

17-
const supportedNetworks = ["goerli", "arbitrum"]
17+
const supportedNetworks = ["goerli", "mumbai", "arbitrum"]
1818

1919
program
2020
.name("semaphore")

packages/contracts/contracts/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ If you want to deploy your contract in a specific network you can set up the `DE
112112
```bash
113113
yarn deploy:semaphore --network goerli
114114
yarn deploy:semaphore --network sepolia
115+
yarn deploy:semaphore --network mumbai
115116
yarn deploy:semaphore --network arbitrum
116117
```
117118

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"Pairing": "0x3d3df6CFc6BFf68d9693e097F32bF4a9903E77a5",
3+
"SemaphoreVerifier": "0x5f4edC58142f4395D1D536e793137A0252dA5a49",
4+
"Poseidon": "0x181B7f34538cE3BceC68597d4A212aB3f7881648",
5+
"IncrementalBinaryTree": "0x220fBdB6F996827b1Cf12f0C181E8d5e6de3a36F",
6+
"Semaphore": "0xF864ABa335073e01234c9a88888BfFfa965650bD"
7+
}

packages/contracts/hardhat.config.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,13 @@ function getNetworks(): NetworksUserConfig {
3535
chainId: 11155111,
3636
accounts
3737
},
38+
mumbai: {
39+
url: `https://polygon-mumbai.infura.io/v3/${infuraApiKey}`,
40+
chainId: 80001,
41+
accounts
42+
},
3843
arbitrum: {
39-
url: "https://arb1.arbitrum.io/rpc",
44+
url: `https://arbitrum-mainnet.infura.io/v3/${infuraApiKey}`,
4045
chainId: 42161,
4146
accounts
4247
}

packages/data/src/ethers.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,19 @@ export default class SemaphoreEthers {
3737
checkParameter(options.apiKey, "apiKey", "string")
3838
}
3939

40+
if (networkOrEthereumURL === "matic") {
41+
networkOrEthereumURL = "maticmum"
42+
}
43+
4044
switch (networkOrEthereumURL) {
4145
case "arbitrum":
4246
options.address = "0x72dca3c971136bf47BACF16A141f0fcfAC925aeC"
4347
options.startBlock = 54934350
4448
break
49+
case "maticmum":
50+
options.address = "0xF864ABa335073e01234c9a88888BfFfa965650bD"
51+
options.startBlock = 32902215
52+
break
4553
case "goerli":
4654
options.address = "0x89490c95eD199D980Cdb4FF8Bac9977EDb41A7E7"
4755
options.startBlock = 8255063

packages/data/src/getURL.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ export default function getURL(network: Network): string {
99
switch (network) {
1010
case "goerli":
1111
return `https://api.studio.thegraph.com/query/14377/semaphore-goerli/v3.2.0`
12+
case "mumbai":
13+
return `https://api.studio.thegraph.com/query/14377/semaphore-mumbai/v3.2.0`
1214
case "arbitrum":
1315
return `https://api.studio.thegraph.com/query/14377/semaphore-arbitrum/v3.2.0`
1416
default:

packages/data/src/types/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export type Network =
44
| "goerli"
55
| "arbitrum"
66
| "maticmum"
7+
| "mumbai"
78
| "arbitrum-goerli"
89
| "optimism"
910
| "optimism-goerli"

0 commit comments

Comments
 (0)