Skip to content

Commit 70e465c

Browse files
committed
refactor(cli-templates-monorepo-ethers): update configs
1 parent 04fc12e commit 70e465c

File tree

15 files changed

+23
-179
lines changed

15 files changed

+23
-179
lines changed

packages/cli-template-monorepo-ethers/README.md

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,15 @@
22

33
This project is a complete application that demonstrates a basic Semaphore use case. It comes with a sample contract, a test for that contract and a sample task that deploys that contract. It also contains a frontend to play around with the contract.
44

5-
## 📜 Usage
6-
7-
### Add the environment variables
8-
9-
- Copy the `.env.example` file as `.env`:
10-
11-
```bash
12-
cp .env.example .env
13-
```
5+
## Install
146

15-
- Copy the `.env.development.local.example` file as `.env.development.local`:
7+
### Install dependencies
168

179
```bash
18-
cp ./apps/web-app/.env.development.local.example ./apps/web-app/.env.development.local
10+
yarn
1911
```
2012

21-
- Copy the `.env.production.local.example` file as `.env.production.local`:
22-
23-
```bash
24-
cp ./apps/web-app/.env.production.local.example ./apps/web-app/.env.production.local
25-
```
26-
27-
Add your environment variables or run the app in a local network.
13+
## 📜 Usage
2814

2915
### Local server
3016

packages/cli-template-monorepo-ethers/apps/contracts/.env.example

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
# dependencies
22
node_modules
3-
package-lock.json
4-
yarn.lock
5-
.yarn
63

74
# testing
85
coverage
@@ -13,17 +10,6 @@ artifacts
1310
cache
1411
typechain-types
1512

16-
# types
17-
types
18-
19-
# circuits
20-
circuits
21-
22-
# production
23-
dist
24-
build
25-
docs
26-
2713
# misc
2814
.DS_Store
2915
*.pem
@@ -33,7 +19,4 @@ npm-debug.log*
3319
yarn-debug.log*
3420
yarn-error.log*
3521

36-
# packages
37-
cli-template-*
3822

39-
snark-artifacts

packages/cli-template-monorepo-ethers/apps/contracts/.gitignore

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -13,59 +13,5 @@ node_modules
1313
/coverage
1414
/coverage.json
1515

16-
# Logs
17-
logs
18-
*.log
19-
npm-debug.log*
20-
yarn-debug.log*
21-
yarn-error.log*
22-
lerna-debug.log*
23-
.pnpm-debug.log*
24-
25-
# Diagnostic reports (https://nodejs.org/api/report.html)
26-
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
27-
28-
# Runtime data
29-
pids
30-
*.pid
31-
*.seed
32-
*.pid.lock
33-
34-
# IDE
35-
.vscode
36-
.idea
37-
38-
# Dependency directories
39-
node_modules/
40-
41-
# Output of 'npm pack'
42-
*.tgz
43-
44-
# Microbundle cache
45-
.rpt2_cache/
46-
.rts2_cache_cjs/
47-
.rts2_cache_es/
48-
.rts2_cache_umd/
49-
50-
# Yarn Integrity file
51-
.yarn-integrity
52-
53-
# vercel
54-
.vercel
55-
56-
# dotenv environment variable files
57-
.env
58-
59-
# Optional npm cache directory
60-
.npm
6116
.DS_Store
6217

63-
# yarn v3
64-
.pnp.*
65-
.pnp.js
66-
.yarn/*
67-
!.yarn/patches
68-
!.yarn/plugins
69-
!.yarn/releases
70-
!.yarn/sdks
71-
!.yarn/versions

packages/cli-template-monorepo-ethers/apps/contracts/.prettierignore

Lines changed: 0 additions & 37 deletions
This file was deleted.

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

Lines changed: 0 additions & 5 deletions
This file was deleted.

packages/cli-template-monorepo-ethers/apps/contracts/.yarnrc.yml

Lines changed: 0 additions & 5 deletions
This file was deleted.

packages/cli-template-monorepo-ethers/apps/contracts/hardhat.config.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
import { HardhatUserConfig } from "hardhat/config"
22
import { NetworksUserConfig } from "hardhat/types"
33
import "@nomicfoundation/hardhat-toolbox"
4-
import "dotenv/config"
4+
import { config as dotenvConfig } from "dotenv"
5+
import { resolve } from "path"
56
import "@semaphore-protocol/hardhat"
67
import "./tasks/deploy"
78

9+
dotenvConfig({ path: resolve(__dirname, "../../.env") })
10+
811
function getNetworks(): NetworksUserConfig {
912
if (!process.env.INFURA_API_KEY || !process.env.ETHEREUM_PRIVATE_KEY) {
1013
return {}
@@ -44,6 +47,7 @@ function getNetworks(): NetworksUserConfig {
4447

4548
const config: HardhatUserConfig = {
4649
solidity: "0.8.23",
50+
defaultNetwork: process.env.DEFAULT_NETWORK || "localhost",
4751
networks: {
4852
hardhat: {
4953
chainId: 1337

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"typescript": "^5.3.3"
4949
},
5050
"dependencies": {
51-
"@semaphore-protocol/contracts": "^4.0.0-alpha.8"
51+
"@semaphore-protocol/contracts": "4.0.0-alpha.8"
5252
},
5353
"packageManager": "yarn@4.1.0"
5454
}

packages/cli-template-monorepo-ethers/apps/contracts/test/Feedback.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,26 +59,26 @@ describe("Feedback", () => {
5959

6060
const feedback = encodeBytes32String("Hello World")
6161

62-
const fullProof = await generateProof(users[1], group, feedback, groupId)
62+
const proof = await generateProof(users[1], group, feedback, groupId)
6363

6464
const transaction = feedbackContract.sendFeedback(
65-
fullProof.merkleTreeDepth,
66-
fullProof.merkleTreeRoot,
67-
fullProof.nullifier,
65+
proof.merkleTreeDepth,
66+
proof.merkleTreeRoot,
67+
proof.nullifier,
6868
feedback,
69-
fullProof.points
69+
proof.points
7070
)
7171

7272
await expect(transaction)
7373
.to.emit(semaphoreContract, "ProofValidated")
7474
.withArgs(
7575
groupId,
76-
fullProof.merkleTreeDepth,
77-
fullProof.merkleTreeRoot,
78-
fullProof.nullifier,
79-
fullProof.message,
76+
proof.merkleTreeDepth,
77+
proof.merkleTreeRoot,
78+
proof.nullifier,
79+
proof.message,
8080
groupId,
81-
fullProof.points
81+
proof.points
8282
)
8383
})
8484
})

0 commit comments

Comments
 (0)