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

Lines changed: 7 additions & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 4 additions & 4 deletions
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

Lines changed: 1 addition & 1 deletion
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
}

0 commit comments

Comments
 (0)