Skip to content

Commit a1628f6

Browse files
authored
chore: deploy contracts and replace mumbai with amoy (#809)
* chore: remove unused env variable * chore: deploy contracts and replace mumbai with amoy * docs(subgraph): update README.md * style(subgraph): format code with prettier * docs(contracts): update deploy command name
1 parent bb1975a commit a1628f6

File tree

11 files changed

+109
-370
lines changed

11 files changed

+109
-370
lines changed

.env.example

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
DEFAULT_NETWORK=hardhat
2-
TREE_DEPTH=10
32
REPORT_GAS=false
43
BACKEND_PRIVATE_KEY=
54
COINMARKETCAP_API_KEY=

apps/subgraph/README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,15 @@
4242

4343
## Networks
4444

45-
| Semaphore version | Sepolia | Mumbai | Optimism Sepolia | Arbitrum Sepolia | Arbitrum One |
46-
| ----------------- | ---------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
47-
| v2.0 | N/A | N/A | N/A | N/A | [semaphore-protocol/arbitrum](https://thegraph.com/hosted-service/subgraph/semaphore-protocol/arbitrum) |
48-
| v2.5 | N/A | N/A | N/A | N/A | N/A |
49-
| v2.6 | N/A | N/A | N/A | N/A | [semaphore-protocol/arbitrum-86337c](https://thegraph.com/hosted-service/subgraph/semaphore-protocol/arbitrum-86337c) |
50-
| v3.0 - v3.1 | N/A | N/A | N/A | N/A | [semaphore-protocol/arbitrum-72dca3](https://thegraph.com/hosted-service/subgraph/semaphore-protocol/arbitrum-72dca3) |
51-
| >= v3.2 | [semaphore-sepolia](https://api.studio.thegraph.com/query/14377/semaphore-sepolia/v3.6.1) | [semaphore-mumbai](https://api.studio.thegraph.com/query/14377/semaphore-mumbai/v3.6.1) | N/A | N/A | [semaphore-arbitrum](https://api.studio.thegraph.com/query/14377/semaphore-arbitrum/v3.6.1) |
52-
| >= v4.0.0-beta | [semaphore-sepolia](https://api.studio.thegraph.com/query/14377/semaphore-sepolia/v4.0.0-beta) | [semaphore-matic-mumbai](https://api.studio.thegraph.com/query/14377/semaphore-matic-mumbai/v4.0.0-beta) | [semaphore-optimism-sepolia](https://api.studio.thegraph.com/query/14377/semaphore-optimism-sepolia/v4.0.0-beta) | [semaphore-arbitrum-sepolia](https://api.studio.thegraph.com/query/14377/semaphore-arbitrum-sepolia/v4.0.0-beta) | N/A |
45+
| Semaphore version | Sepolia | Polygon Mumbai | Optimism Sepolia | Arbitrum Sepolia | Arbitrum One | Polygon Amoy |
46+
| ----------------- | ------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
47+
| v2.0 | N/A | N/A | N/A | N/A | [semaphore-protocol/arbitrum](https://thegraph.com/hosted-service/subgraph/semaphore-protocol/arbitrum) | N/A |
48+
| v2.5 | N/A | N/A | N/A | N/A | N/A | N/A |
49+
| v2.6 | N/A | N/A | N/A | N/A | [semaphore-protocol/arbitrum-86337c](https://thegraph.com/hosted-service/subgraph/semaphore-protocol/arbitrum-86337c) | N/A |
50+
| v3.0 - v3.1 | N/A | N/A | N/A | N/A | [semaphore-protocol/arbitrum-72dca3](https://thegraph.com/hosted-service/subgraph/semaphore-protocol/arbitrum-72dca3) | N/A |
51+
| >= v3.2 | [semaphore-sepolia](https://api.studio.thegraph.com/query/14377/semaphore-sepolia/v3.6.1) | [semaphore-mumbai](https://api.studio.thegraph.com/query/14377/semaphore-mumbai/v3.6.1) | N/A | N/A | [semaphore-arbitrum](https://api.studio.thegraph.com/query/14377/semaphore-arbitrum/v3.6.1) | N/A |
52+
| v4.0.0-beta | [semaphore-sepolia](https://api.studio.thegraph.com/query/14377/semaphore-sepolia/v4.0.0-beta) | [semaphore-matic-mumbai](https://api.studio.thegraph.com/query/14377/semaphore-matic-mumbai/v4.0.0-beta) | [semaphore-optimism-sepolia](https://api.studio.thegraph.com/query/14377/semaphore-optimism-sepolia/v4.0.0-beta) | [semaphore-arbitrum-sepolia](https://api.studio.thegraph.com/query/14377/semaphore-arbitrum-sepolia/v4.0.0-beta) | N/A | N/A |
53+
| >= v4.0.0-beta.15 | [semaphore-sepolia](https://api.studio.thegraph.com/query/14377/semaphore-sepolia/v4.0.0-beta.15) | N/A | [semaphore-optimism-sepolia](https://api.studio.thegraph.com/query/14377/semaphore-optimism-sepolia/v4.0.0-beta.15) | [semaphore-arbitrum-sepolia](https://api.studio.thegraph.com/query/14377/semaphore-arbitrum-sepolia/v4.0.0-beta.15) | N/A | [semaphore-matic-amoy](https://api.studio.thegraph.com/query/14377/semaphore-matic-amoy/v4.0.0-beta.15) |
5354

5455
## 🛠 Install
5556

apps/subgraph/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@
77
"scripts": {
88
"codegen": "node scripts/generate-subgraph.js ${0} && graph codegen",
99
"build": "graph build",
10-
"auth": "graph auth --studio",
11-
"deploy": "graph deploy --node https://api.studio.thegraph.com/deploy/ ${0}",
10+
"auth": "graph auth --studio ${0}",
11+
"deploy": "graph deploy --studio ${0}",
1212
"start-ipfs": "node scripts/start-ipfs.js",
1313
"create-local": "graph create --node http://localhost:8020/ semaphore",
1414
"remove-local": "graph remove --node http://localhost:8020/ semaphore",
1515
"deploy-local": "graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 semaphore",
1616
"test": "graph test Semaphore -v 0.5.0"
1717
},
1818
"dependencies": {
19-
"@graphprotocol/graph-cli": "0.67.0",
20-
"@graphprotocol/graph-ts": "0.32.0",
19+
"@graphprotocol/graph-cli": "0.77.0",
20+
"@graphprotocol/graph-ts": "0.35.1",
2121
"@semaphore-protocol/utils": "workspace:packages/utils"
2222
},
2323
"devDependencies": {

apps/subgraph/scripts/generate-subgraph.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ const network = process.argv.at(2)
66

77
const template = readFileSync("./subgraph.template.yaml", "utf-8")
88

9-
const subgraph = Mustache.render(template, { network, ...getDeployedContract(network) })
9+
const subgraph = Mustache.render(template, {
10+
network: network === "matic-amoy" ? "polygon-amoy" : network,
11+
...getDeployedContract(network)
12+
})
1013

1114
writeFileSync("./subgraph.yaml", subgraph)

packages/contracts/contracts/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,13 @@ yarn test:report-gas
9595
Deploy the `Semaphore.sol` contract without any parameter:
9696

9797
```bash
98-
yarn deploy:semaphore
98+
yarn deploy
9999
```
100100

101101
or deploy it by providing the addresses of the contracts/libraries on which it depends:
102102

103103
```bash
104-
yarn deploy:semaphore --semaphoreVerifier <address>
104+
yarn deploy --semaphoreVerifier <address>
105105
```
106106

107107
> **Note**
@@ -110,11 +110,11 @@ yarn deploy:semaphore --semaphoreVerifier <address>
110110
If you want to deploy your contract in a specific network you can set up the `DEFAULT_NETWORK` variable in your `.env` file with the name of one of our supported networks (hardhat, localhost, sepolia, arbitrum). Or you can specify it as an option:
111111

112112
```bash
113-
yarn deploy:semaphore --network sepolia
114-
yarn deploy:semaphore --network mumbai
115-
yarn deploy:semaphore --network optimism-sepolia
116-
yarn deploy:semaphore --network arbitrum-sepolia
117-
yarn deploy:semaphore --network arbitrum
113+
yarn deploy --network sepolia
114+
yarn deploy --network mumbai
115+
yarn deploy --network optimism-sepolia
116+
yarn deploy --network arbitrum-sepolia
117+
yarn deploy --network arbitrum
118118
```
119119

120120
If you want to deploy contracts on Sepolia or Arbitrum, remember to provide a valid private key and an Infura API in your `.env` file.

packages/contracts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"@nomicfoundation/hardhat-ethers": "^3.0.0",
1919
"@nomicfoundation/hardhat-network-helpers": "^1.0.0",
2020
"@nomicfoundation/hardhat-toolbox": "^4.0.0",
21-
"@nomicfoundation/hardhat-verify": "^2.0.5",
21+
"@nomicfoundation/hardhat-verify": "^2.0.8",
2222
"@semaphore-protocol/core": "workspace:packages/core",
2323
"@semaphore-protocol/utils": "workspace:packages/utils",
2424
"@typechain/ethers-v6": "^0.5.0",

packages/data/src/getURL.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ export default function getURL(supportedNetwork: SupportedNetwork): string {
1212
throw new TypeError(`Network '${supportedNetwork}' is not supported`)
1313
}
1414

15-
return `https://api.studio.thegraph.com/query/14377/semaphore-${supportedNetwork}/v4.0.0-beta`
15+
return `https://api.studio.thegraph.com/query/14377/semaphore-${supportedNetwork}/v4.0.0-beta.15`
1616
}

packages/data/src/types/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export type EthersNetwork =
22
| "mainnet"
33
| "sepolia"
44
| "matic"
5-
| "matic-mumbai"
5+
| "matic-amoy"
66
| "arbitrum"
77
| "arbitrum-sepolia"
88
| "optimism"

packages/utils/src/networks/deployed-contracts.json

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@
44
"contracts": [
55
{
66
"name": "SemaphoreVerifier",
7-
"address": "0x58AD7a4389E0F5d814815E5D5A3Ab903dAE9284a",
8-
"startBlock": 5539276
7+
"address": "0x521fCd9d3049DEc8a893A422f57C155ddB30BB45",
8+
"startBlock": 6198270
99
},
1010
{
1111
"name": "PoseidonT3",
1212
"address": "0x4EFfF6a6a7BB31cdAd9Ee742b0faAA6Bb9BF096B",
13-
"startBlock": 5539276
13+
"startBlock": 6198270
1414
},
1515
{
1616
"name": "Semaphore",
17-
"address": "0x0A09FB3f63c13F1C54F2fA41AFB1e7a98cffc774",
18-
"startBlock": 5539276
17+
"address": "0x42C0e6780B60E18E44B3AB031B216B6360009baB",
18+
"startBlock": 6198270
1919
}
2020
]
2121
},
@@ -24,18 +24,18 @@
2424
"contracts": [
2525
{
2626
"name": "SemaphoreVerifier",
27-
"address": "0x5f4edC58142f4395D1D536e793137A0252dA5a49",
28-
"startBlock": 25837653
27+
"address": "0xF864ABa335073e01234c9a88888BfFfa965650bD",
28+
"startBlock": 58900259
2929
},
3030
{
3131
"name": "PoseidonT3",
3232
"address": "0x181B7f34538cE3BceC68597d4A212aB3f7881648",
33-
"startBlock": 25837653
33+
"startBlock": 58900259
3434
},
3535
{
3636
"name": "Semaphore",
37-
"address": "0x220fBdB6F996827b1Cf12f0C181E8d5e6de3a36F",
38-
"startBlock": 25837653
37+
"address": "0xE5269ae1E996C6FEEf6E832c7032401E73087568",
38+
"startBlock": 58900259
3939
}
4040
]
4141
},
@@ -44,38 +44,38 @@
4444
"contracts": [
4545
{
4646
"name": "SemaphoreVerifier",
47-
"address": "0x3d3df6CFc6BFf68d9693e097F32bF4a9903E77a5",
48-
"startBlock": 9663266
47+
"address": "0x220fBdB6F996827b1Cf12f0C181E8d5e6de3a36F",
48+
"startBlock": 13847620
4949
},
5050
{
5151
"name": "PoseidonT3",
5252
"address": "0x5f4edC58142f4395D1D536e793137A0252dA5a49",
53-
"startBlock": 9663266
53+
"startBlock": 13847620
5454
},
5555
{
5656
"name": "Semaphore",
57-
"address": "0x181B7f34538cE3BceC68597d4A212aB3f7881648",
58-
"startBlock": 9663266
57+
"address": "0xF864ABa335073e01234c9a88888BfFfa965650bD",
58+
"startBlock": 13847620
5959
}
6060
]
6161
},
6262
{
63-
"network": "matic-mumbai",
63+
"network": "matic-amoy",
6464
"contracts": [
6565
{
6666
"name": "SemaphoreVerifier",
67-
"address": "0xE5269ae1E996C6FEEf6E832c7032401E73087568",
68-
"startBlock": 47356015
67+
"address": "0xEFD83f827FA5B0496359D817c6CD8a5AA5D2aCe5",
68+
"startBlock": 8788886
6969
},
7070
{
7171
"name": "PoseidonT3",
72-
"address": "0xC0ae1a8D3505B2bE9DCe0e826abd722Afd13F1c9",
73-
"startBlock": 47356015
72+
"address": "0x3d3df6CFc6BFf68d9693e097F32bF4a9903E77a5",
73+
"startBlock": 8788886
7474
},
7575
{
7676
"name": "Semaphore",
77-
"address": "0x346a936b19071b2f619200848B8ADbb938D72250",
78-
"startBlock": 47356015
77+
"address": "0x5f4edC58142f4395D1D536e793137A0252dA5a49",
78+
"startBlock": 8788886
7979
}
8080
]
8181
}

packages/utils/src/networks/supported-networks.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ export default {
1717
chainId: 11155420,
1818
explorer: "https://sepolia-optimism.etherscan.io"
1919
},
20-
"matic-mumbai": {
21-
name: "Matic Mumbai",
22-
url: "https://rpc-mumbai.polygon.technology",
23-
chainId: 80001,
24-
explorer: "https://mumbai.polygonscan.com"
20+
"matic-amoy": {
21+
name: "Matic Amoy",
22+
url: "https://rpc-amoy.polygon.technology",
23+
chainId: 80002,
24+
explorer: "https://amoy.polygonscan.com"
2525
}
2626
}

0 commit comments

Comments
 (0)