Skip to content

Commit 13a9480

Browse files
authored
fix(core): bump ethers to v6.13.4 (#921)
Update ethers version to resolve ws security issue (CVE-2024-37890). Move contract address check outside of branch statement so Typescript can see. Add build instructions to setup to resolve 'Cannot find module '@semaphore-protocol/...' when running tests for the first time. re #920
1 parent 53967a9 commit 13a9480

File tree

13 files changed

+63
-78
lines changed

13 files changed

+63
-78
lines changed

README.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -275,12 +275,18 @@ Clone this repository:
275275
git clone https://github.com/semaphore-protocol/semaphore.git
276276
```
277277

278-
And install the dependencies:
278+
Install the dependencies:
279279

280280
```bash
281281
cd semaphore && yarn
282282
```
283283

284+
And build the repositiory:
285+
286+
```bash
287+
yarn build
288+
```
289+
284290
## 📜 Usage
285291

286292
Copy the `.env.example` file as `.env`:

packages/cli-template-contracts-hardhat/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"eslint-config-airbnb-typescript": "^17.1.0",
6060
"eslint-config-prettier": "^9.1.0",
6161
"eslint-plugin-import": "^2.29.1",
62-
"ethers": "^6.4.0",
62+
"ethers": "^6.13.4",
6363
"hardhat": "^2.20.1",
6464
"hardhat-gas-reporter": "^1.0.8",
6565
"prettier": "^3.2.5",

packages/cli-template-monorepo-ethers/apps/contracts/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"eslint-config-airbnb-typescript": "^17.1.0",
3939
"eslint-config-prettier": "^9.1.0",
4040
"eslint-plugin-import": "^2.29.1",
41-
"ethers": "^6.4.0",
41+
"ethers": "^6.13.4",
4242
"hardhat": "^2.20.1",
4343
"hardhat-gas-reporter": "^1.0.8",
4444
"prettier": "^3.2.5",

packages/cli-template-monorepo-ethers/apps/web-app/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"@semaphore-protocol/core": "4.7.2",
1313
"@semaphore-protocol/data": "4.7.2",
1414
"@semaphore-protocol/utils": "4.7.2",
15-
"ethers": "^6.11.1",
15+
"ethers": "^6.13.4",
1616
"next": "14.1.0",
1717
"next-pwa": "^5.6.0",
1818
"react": "^18",

packages/cli-template-monorepo-subgraph/apps/contracts/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"eslint-config-airbnb-typescript": "^17.1.0",
3939
"eslint-config-prettier": "^9.1.0",
4040
"eslint-plugin-import": "^2.29.1",
41-
"ethers": "^6.4.0",
41+
"ethers": "^6.13.4",
4242
"hardhat": "^2.20.1",
4343
"hardhat-gas-reporter": "^1.0.8",
4444
"prettier": "^3.2.5",

packages/cli-template-monorepo-subgraph/apps/web-app/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"@semaphore-protocol/core": "4.7.2",
1313
"@semaphore-protocol/data": "4.7.2",
1414
"@semaphore-protocol/utils": "4.7.2",
15-
"ethers": "^6.11.1",
15+
"ethers": "^6.13.4",
1616
"next": "14.1.0",
1717
"next-pwa": "^5.6.0",
1818
"react": "^18",

packages/contracts/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"@types/ncp": "^2",
3030
"@types/node": "^20.10.7",
3131
"chai": "^4.2.0",
32-
"ethers": "^6.4.0",
32+
"ethers": "^6.13.4",
3333
"hardhat": "^2.19.4",
3434
"hardhat-gas-reporter": "^1.0.8",
3535
"ncp": "^2.0.0",

packages/data/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,6 @@
3939
"dependencies": {
4040
"@semaphore-protocol/utils": "4.7.2",
4141
"axios": "1.6.6",
42-
"ethers": "6.11.0"
42+
"ethers": "6.13.4"
4343
}
4444
}

packages/data/src/ethers.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,13 @@ export default class SemaphoreEthers {
5858
options.address ??= address
5959
options.startBlock ??= startBlock
6060
} else {
61-
if (options.address === undefined) {
62-
throw new Error(`Network '${networkOrEthereumURL}' needs a Semaphore contract address`)
63-
}
64-
6561
options.startBlock ??= 0
6662
}
6763

64+
if (options.address === undefined) {
65+
throw new Error(`Network '${networkOrEthereumURL}' needs a Semaphore contract address`)
66+
}
67+
6868
let provider: Provider
6969

7070
switch (options.provider) {

packages/hardhat/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"dependencies": {
4343
"@nomicfoundation/hardhat-ethers": "^3.0.0",
4444
"@semaphore-protocol/contracts": "4.7.2",
45-
"ethers": "^6.4.0",
45+
"ethers": "^6.13.4",
4646
"hardhat-dependency-compiler": "^1.1.3"
4747
}
4848
}

packages/proof/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"@semaphore-protocol/utils": "4.7.2",
5555
"@zk-kit/artifacts": "1.8.0",
5656
"@zk-kit/utils": "1.2.1",
57-
"ethers": "6.10.0",
57+
"ethers": "6.13.4",
5858
"snarkjs": "0.7.4"
5959
}
6060
}

packages/utils/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,6 @@
5454
"rollup-plugin-cleanup": "^3.2.1"
5555
},
5656
"dependencies": {
57-
"ethers": "^6.11.1"
57+
"ethers": "^6.13.4"
5858
}
5959
}

yarn.lock

+42-63
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,6 @@ __metadata:
55
version: 8
66
cacheKey: 10
77

8-
"@adraffy/ens-normalize@npm:1.10.0":
9-
version: 1.10.0
10-
resolution: "@adraffy/ens-normalize@npm:1.10.0"
11-
checksum: 10/5cdb5d2a9c9f8c0a71a7bb830967da0069cae1f1235cd41ae11147e4000f368f6958386e622cd4d52bf45c1ed3f8275056b387cba28902b83354e40ff323ecde
12-
languageName: node
13-
linkType: hard
14-
158
"@adraffy/ens-normalize@npm:1.10.1":
169
version: 1.10.1
1710
resolution: "@adraffy/ens-normalize@npm:1.10.1"
@@ -7354,7 +7347,7 @@ __metadata:
73547347
eslint-config-airbnb-typescript: "npm:^17.1.0"
73557348
eslint-config-prettier: "npm:^9.1.0"
73567349
eslint-plugin-import: "npm:^2.29.1"
7357-
ethers: "npm:^6.4.0"
7350+
ethers: "npm:^6.13.4"
73587351
hardhat: "npm:^2.20.1"
73597352
hardhat-gas-reporter: "npm:^1.0.8"
73607353
prettier: "npm:^3.2.5"
@@ -7439,7 +7432,7 @@ __metadata:
74397432
"@rollup/plugin-typescript": "npm:^11.1.6"
74407433
"@semaphore-protocol/utils": "npm:4.7.2"
74417434
axios: "npm:1.6.6"
7442-
ethers: "npm:6.11.0"
7435+
ethers: "npm:6.13.4"
74437436
rimraf: "npm:^5.0.5"
74447437
rollup: "npm:^4.12.0"
74457438
rollup-plugin-cleanup: "npm:^3.2.1"
@@ -7467,7 +7460,7 @@ __metadata:
74677460
"@nomicfoundation/hardhat-ethers": "npm:^3.0.0"
74687461
"@rollup/plugin-typescript": "npm:^11.1.6"
74697462
"@semaphore-protocol/contracts": "npm:4.7.2"
7470-
ethers: "npm:^6.4.0"
7463+
ethers: "npm:^6.13.4"
74717464
hardhat: "npm:^2.19.4"
74727465
hardhat-dependency-compiler: "npm:^1.1.3"
74737466
rimraf: "npm:^5.0.5"
@@ -7505,7 +7498,7 @@ __metadata:
75057498
"@types/snarkjs": "npm:^0"
75067499
"@zk-kit/artifacts": "npm:1.8.0"
75077500
"@zk-kit/utils": "npm:1.2.1"
7508-
ethers: "npm:6.10.0"
7501+
ethers: "npm:6.13.4"
75097502
rimraf: "npm:^5.0.5"
75107503
rollup: "npm:^4.12.0"
75117504
rollup-plugin-cleanup: "npm:^3.2.1"
@@ -7522,7 +7515,7 @@ __metadata:
75227515
dependencies:
75237516
"@rollup/plugin-json": "npm:^6.1.0"
75247517
"@rollup/plugin-typescript": "npm:^11.1.6"
7525-
ethers: "npm:^6.11.1"
7518+
ethers: "npm:^6.13.4"
75267519
rimraf: "npm:^5.0.5"
75277520
rollup: "npm:^4.12.0"
75287521
rollup-plugin-cleanup: "npm:^3.2.1"
@@ -8690,10 +8683,12 @@ __metadata:
86908683
languageName: node
86918684
linkType: hard
86928685

8693-
"@types/node@npm:18.15.13":
8694-
version: 18.15.13
8695-
resolution: "@types/node@npm:18.15.13"
8696-
checksum: 10/b9bbe923573797ef7c5fd2641a6793489e25d9369c32aeadcaa5c7c175c85b42eb12d6fe173f6781ab6f42eaa1ebd9576a419eeaa2a1ec810094adb8adaa9a54
8686+
"@types/node@npm:22.7.5":
8687+
version: 22.7.5
8688+
resolution: "@types/node@npm:22.7.5"
8689+
dependencies:
8690+
undici-types: "npm:~6.19.2"
8691+
checksum: 10/e8ba102f8c1aa7623787d625389be68d64e54fcbb76d41f6c2c64e8cf4c9f4a2370e7ef5e5f1732f3c57529d3d26afdcb2edc0101c5e413a79081449825c57ac
86978692
languageName: node
86988693
linkType: hard
86998694

@@ -14852,33 +14847,18 @@ __metadata:
1485214847
languageName: node
1485314848
linkType: hard
1485414849

14855-
"ethers@npm:6.10.0":
14856-
version: 6.10.0
14857-
resolution: "ethers@npm:6.10.0"
14858-
dependencies:
14859-
"@adraffy/ens-normalize": "npm:1.10.0"
14860-
"@noble/curves": "npm:1.2.0"
14861-
"@noble/hashes": "npm:1.3.2"
14862-
"@types/node": "npm:18.15.13"
14863-
aes-js: "npm:4.0.0-beta.5"
14864-
tslib: "npm:2.4.0"
14865-
ws: "npm:8.5.0"
14866-
checksum: 10/04fdd3f76ea93a8b45b2fe4d9c8e2bd0d688823faba672897dd19cc3303c202a166902fe6058004562f13aaecf9f77a9f70ff113f995e94107efef2457b016dd
14867-
languageName: node
14868-
linkType: hard
14869-
14870-
"ethers@npm:6.11.0":
14871-
version: 6.11.0
14872-
resolution: "ethers@npm:6.11.0"
14850+
"ethers@npm:6.13.4, ethers@npm:^6.13.4":
14851+
version: 6.13.4
14852+
resolution: "ethers@npm:6.13.4"
1487314853
dependencies:
1487414854
"@adraffy/ens-normalize": "npm:1.10.1"
1487514855
"@noble/curves": "npm:1.2.0"
1487614856
"@noble/hashes": "npm:1.3.2"
14877-
"@types/node": "npm:18.15.13"
14857+
"@types/node": "npm:22.7.5"
1487814858
aes-js: "npm:4.0.0-beta.5"
14879-
tslib: "npm:2.4.0"
14880-
ws: "npm:8.5.0"
14881-
checksum: 10/c6e5964ceabf2d289f8ae5b16e634995375457a8c5b814ea54799b5a3c951668465adb9b6dda3aea559d9c4fe3faa8297a38651853b54a53de9448663a908f12
14859+
tslib: "npm:2.7.0"
14860+
ws: "npm:8.17.1"
14861+
checksum: 10/221192fed93f6b0553f3e5e72bfd667d676220577d34ff854f677e955d6f608e60636a9c08b5d54039c532a9b9b7056384f0d7019eb6e111d53175806f896ac6
1488214862
languageName: node
1488314863
linkType: hard
1488414864

@@ -14920,21 +14900,6 @@ __metadata:
1492014900
languageName: node
1492114901
linkType: hard
1492214902

14923-
"ethers@npm:^6.11.1, ethers@npm:^6.4.0":
14924-
version: 6.12.1
14925-
resolution: "ethers@npm:6.12.1"
14926-
dependencies:
14927-
"@adraffy/ens-normalize": "npm:1.10.1"
14928-
"@noble/curves": "npm:1.2.0"
14929-
"@noble/hashes": "npm:1.3.2"
14930-
"@types/node": "npm:18.15.13"
14931-
aes-js: "npm:4.0.0-beta.5"
14932-
tslib: "npm:2.4.0"
14933-
ws: "npm:8.5.0"
14934-
checksum: 10/2995766164292b531499764d319d753b1f4e1cd7ddb4f26c6557a26e42947d5642a4b3bbeace0b8bb398b909dc22fafa4f52d5190a9bb8180bebf2dd3d4d48a9
14935-
languageName: node
14936-
linkType: hard
14937-
1493814903
"ethjs-unit@npm:0.1.6":
1493914904
version: 0.1.6
1494014905
resolution: "ethjs-unit@npm:0.1.6"
@@ -21305,7 +21270,7 @@ __metadata:
2130521270
eslint-config-airbnb-typescript: "npm:^17.1.0"
2130621271
eslint-config-prettier: "npm:^9.1.0"
2130721272
eslint-plugin-import: "npm:^2.29.1"
21308-
ethers: "npm:^6.4.0"
21273+
ethers: "npm:^6.13.4"
2130921274
hardhat: "npm:^2.20.1"
2131021275
hardhat-gas-reporter: "npm:^1.0.8"
2131121276
prettier: "npm:^3.2.5"
@@ -21331,7 +21296,7 @@ __metadata:
2133121296
dotenv: "npm:^16.4.5"
2133221297
eslint: "npm:^8"
2133321298
eslint-config-next: "npm:14.1.0"
21334-
ethers: "npm:^6.11.1"
21299+
ethers: "npm:^6.13.4"
2133521300
next: "npm:14.1.0"
2133621301
next-pwa: "npm:^5.6.0"
2133721302
react: "npm:^18"
@@ -21368,7 +21333,7 @@ __metadata:
2136821333
eslint-config-airbnb-typescript: "npm:^17.1.0"
2136921334
eslint-config-prettier: "npm:^9.1.0"
2137021335
eslint-plugin-import: "npm:^2.29.1"
21371-
ethers: "npm:^6.4.0"
21336+
ethers: "npm:^6.13.4"
2137221337
hardhat: "npm:^2.20.1"
2137321338
hardhat-gas-reporter: "npm:^1.0.8"
2137421339
prettier: "npm:^3.2.5"
@@ -21394,7 +21359,7 @@ __metadata:
2139421359
dotenv: "npm:^16.4.5"
2139521360
eslint: "npm:^8"
2139621361
eslint-config-next: "npm:14.1.0"
21397-
ethers: "npm:^6.11.1"
21362+
ethers: "npm:^6.13.4"
2139821363
next: "npm:14.1.0"
2139921364
next-pwa: "npm:^5.6.0"
2140021365
react: "npm:^18"
@@ -25857,7 +25822,7 @@ __metadata:
2585725822
"@types/node": "npm:^20.10.7"
2585825823
"@zk-kit/lean-imt.sol": "npm:2.0.0"
2585925824
chai: "npm:^4.2.0"
25860-
ethers: "npm:^6.4.0"
25825+
ethers: "npm:^6.13.4"
2586125826
hardhat: "npm:^2.19.4"
2586225827
hardhat-gas-reporter: "npm:^1.0.8"
2586325828
ncp: "npm:^2.0.0"
@@ -27935,6 +27900,13 @@ __metadata:
2793527900
languageName: node
2793627901
linkType: hard
2793727902

27903+
"tslib@npm:2.7.0":
27904+
version: 2.7.0
27905+
resolution: "tslib@npm:2.7.0"
27906+
checksum: 10/9a5b47ddac65874fa011c20ff76db69f97cf90c78cff5934799ab8894a5342db2d17b4e7613a087046bc1d133d21547ddff87ac558abeec31ffa929c88b7fce6
27907+
languageName: node
27908+
linkType: hard
27909+
2793827910
"tslib@npm:^1.8.1, tslib@npm:^1.9.3":
2793927911
version: 1.14.1
2794027912
resolution: "tslib@npm:1.14.1"
@@ -28325,6 +28297,13 @@ __metadata:
2832528297
languageName: node
2832628298
linkType: hard
2832728299

28300+
"undici-types@npm:~6.19.2":
28301+
version: 6.19.8
28302+
resolution: "undici-types@npm:6.19.8"
28303+
checksum: 10/cf0b48ed4fc99baf56584afa91aaffa5010c268b8842f62e02f752df209e3dea138b372a60a963b3b2576ed932f32329ce7ddb9cb5f27a6c83040d8cd74b7a70
28304+
languageName: node
28305+
linkType: hard
28306+
2832828307
"undici@npm:^5.12.0, undici@npm:^5.14.0":
2832928308
version: 5.28.4
2833028309
resolution: "undici@npm:5.28.4"
@@ -29762,18 +29741,18 @@ __metadata:
2976229741
languageName: node
2976329742
linkType: hard
2976429743

29765-
"ws@npm:8.5.0":
29766-
version: 8.5.0
29767-
resolution: "ws@npm:8.5.0"
29744+
"ws@npm:8.17.1":
29745+
version: 8.17.1
29746+
resolution: "ws@npm:8.17.1"
2976829747
peerDependencies:
2976929748
bufferutil: ^4.0.1
29770-
utf-8-validate: ^5.0.2
29749+
utf-8-validate: ">=5.0.2"
2977129750
peerDependenciesMeta:
2977229751
bufferutil:
2977329752
optional: true
2977429753
utf-8-validate:
2977529754
optional: true
29776-
checksum: 10/f0ee700970a0bf925b1ec213ca3691e84fb8b435a91461fe3caf52f58c6cec57c99ed5890fbf6978824c932641932019aafc55d864cad38ac32577496efd5d3a
29755+
checksum: 10/4264ae92c0b3e59c7e309001e93079b26937aab181835fb7af79f906b22cd33b6196d96556dafb4e985742dd401e99139572242e9847661fdbc96556b9e6902d
2977729756
languageName: node
2977829757
linkType: hard
2977929758

0 commit comments

Comments
 (0)