Skip to content

Commit

Permalink
refactor(cli-templates-monorepo-ethers): update configs
Browse files Browse the repository at this point in the history
  • Loading branch information
vplasencia committed Feb 27, 2024
1 parent 04fc12e commit 70e465c
Show file tree
Hide file tree
Showing 15 changed files with 23 additions and 179 deletions.
22 changes: 4 additions & 18 deletions packages/cli-template-monorepo-ethers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,15 @@

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.

## 📜 Usage

### Add the environment variables

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

```bash
cp .env.example .env
```
## Install

- Copy the `.env.development.local.example` file as `.env.development.local`:
### Install dependencies

```bash
cp ./apps/web-app/.env.development.local.example ./apps/web-app/.env.development.local
yarn
```

- Copy the `.env.production.local.example` file as `.env.production.local`:

```bash
cp ./apps/web-app/.env.production.local.example ./apps/web-app/.env.production.local
```

Add your environment variables or run the app in a local network.
## 📜 Usage

### Local server

Expand Down

This file was deleted.

17 changes: 0 additions & 17 deletions packages/cli-template-monorepo-ethers/apps/contracts/.eslintignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# dependencies
node_modules
package-lock.json
yarn.lock
.yarn

# testing
coverage
Expand All @@ -13,17 +10,6 @@ artifacts
cache
typechain-types

# types
types

# circuits
circuits

# production
dist
build
docs

# misc
.DS_Store
*.pem
Expand All @@ -33,7 +19,4 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*

# packages
cli-template-*

snark-artifacts
54 changes: 0 additions & 54 deletions packages/cli-template-monorepo-ethers/apps/contracts/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,59 +13,5 @@ node_modules
/coverage
/coverage.json

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# IDE
.vscode
.idea

# Dependency directories
node_modules/

# Output of 'npm pack'
*.tgz

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Yarn Integrity file
.yarn-integrity

# vercel
.vercel

# dotenv environment variable files
.env

# Optional npm cache directory
.npm
.DS_Store

# yarn v3
.pnp.*
.pnp.js
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import { HardhatUserConfig } from "hardhat/config"
import { NetworksUserConfig } from "hardhat/types"
import "@nomicfoundation/hardhat-toolbox"
import "dotenv/config"
import { config as dotenvConfig } from "dotenv"
import { resolve } from "path"
import "@semaphore-protocol/hardhat"
import "./tasks/deploy"

dotenvConfig({ path: resolve(__dirname, "../../.env") })

function getNetworks(): NetworksUserConfig {
if (!process.env.INFURA_API_KEY || !process.env.ETHEREUM_PRIVATE_KEY) {
return {}
Expand Down Expand Up @@ -44,6 +47,7 @@ function getNetworks(): NetworksUserConfig {

const config: HardhatUserConfig = {
solidity: "0.8.23",
defaultNetwork: process.env.DEFAULT_NETWORK || "localhost",
networks: {
hardhat: {
chainId: 1337
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"typescript": "^5.3.3"
},
"dependencies": {
"@semaphore-protocol/contracts": "^4.0.0-alpha.8"
"@semaphore-protocol/contracts": "4.0.0-alpha.8"
},
"packageManager": "[email protected]"
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,26 +59,26 @@ describe("Feedback", () => {

const feedback = encodeBytes32String("Hello World")

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

const transaction = feedbackContract.sendFeedback(
fullProof.merkleTreeDepth,
fullProof.merkleTreeRoot,
fullProof.nullifier,
proof.merkleTreeDepth,
proof.merkleTreeRoot,
proof.nullifier,
feedback,
fullProof.points
proof.points
)

await expect(transaction)
.to.emit(semaphoreContract, "ProofValidated")
.withArgs(
groupId,
fullProof.merkleTreeDepth,
fullProof.merkleTreeRoot,
fullProof.nullifier,
fullProof.message,
proof.merkleTreeDepth,
proof.merkleTreeRoot,
proof.nullifier,
proof.message,
groupId,
fullProof.points
proof.points
)
})
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@
"strict": true,
"skipLibCheck": true,
"resolveJsonModule": true
}
},
"include": ["scripts/**/*", "tasks/**/*", "test/**/*", "build/typechain/**/*", "types/**/*"],
"files": ["./hardhat.config.ts"]
}
21 changes: 0 additions & 21 deletions packages/cli-template-monorepo-ethers/apps/web-app/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@

# dependencies
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz

# testing
/coverage

# next.js
/.next/
Expand All @@ -19,18 +13,3 @@
# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
4 changes: 0 additions & 4 deletions packages/cli-template-monorepo-ethers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,10 @@
"license": "Unlicense",
"files": [
"files.tgz",
"scripts/",
".editorconfig",
".env.example",
".eslintignore",
".eslintrc.json",
".prettierignore",
".prettierrc.json",
"tsconfig.json",
"README.md"
],
"scripts": {
Expand Down

0 comments on commit 70e465c

Please sign in to comment.