Skip to content

Commit

Permalink
refactor(cli-template-contracts-hardhat): update configs
Browse files Browse the repository at this point in the history
  • Loading branch information
vplasencia committed Feb 27, 2024
1 parent 7860fcf commit fe43cb4
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 42 deletions.
16 changes: 0 additions & 16 deletions packages/cli-template-contracts-hardhat/.eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,6 @@ artifacts
cache
typechain-types

# types
types

# circuits
circuits

# production
dist
build
docs

# misc
.DS_Store
*.pem
Expand All @@ -32,8 +21,3 @@ docs
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# packages
cli-template-*

snark-artifacts
2 changes: 1 addition & 1 deletion packages/cli-template-contracts-hardhat/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"project": ["./tsconfig.json", "./packages/**/tsconfig.json"]
"project": ["./tsconfig.json"]
},
"plugins": ["@typescript-eslint"],
"rules": {
Expand Down
8 changes: 0 additions & 8 deletions packages/cli-template-contracts-hardhat/.prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ package-lock.json
yarn.lock
.yarn


# debug
npm-debug.log*
yarn-debug.log*
Expand All @@ -18,12 +17,6 @@ coverage.json
artifacts
cache
typechain-types
packages/contracts/deployed-contracts/undefined.json
packages/contracts/deployed-contracts/hardhat.json
packages/contracts/deployed-contracts/localhost.json

# contracts
Verifier*.sol

# misc
.DS_Store
Expand All @@ -34,4 +27,3 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*

zk-artifacts
4 changes: 3 additions & 1 deletion packages/cli-template-contracts-hardhat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@

This project 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.

## Usage
## Install

### Install dependencies

```bash
yarn
```

## Usage

### Compile contracts

```bash
Expand Down
9 changes: 6 additions & 3 deletions packages/cli-template-contracts-hardhat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"files": [
"files.tgz",
"contracts/",
"scripts/",
"tasks/",
"test/",
".editorconfig",
Expand All @@ -16,7 +15,10 @@
".prettierignore",
".prettierrc.json",
"hardhat.config.ts",
"tsconfig.json"
"tsconfig.json",
"README.md",
".yarn/",
".yarnrc.yml"
],
"publishConfig": {
"access": "public"
Expand All @@ -30,6 +32,7 @@
"test:report-gas": "REPORT_GAS=true hardhat test",
"test:coverage": "hardhat coverage",
"typechain": "hardhat typechain",
"prepublish": "tar -czf files.tgz .gitignore",
"lint": "eslint . --ext .js,.ts && solhint 'contracts/**/*.sol'",
"prettier": "prettier -c --plugin=prettier-plugin-solidity .",
"prettier:write": "prettier -w --plugin=prettier-plugin-solidity ."
Expand Down Expand Up @@ -69,7 +72,7 @@
"typescript": "^5.3.3"
},
"dependencies": {
"@semaphore-protocol/contracts": "^4.0.0-alpha.8"
"@semaphore-protocol/contracts": "4.0.0-alpha.8"
},
"packageManager": "yarn@4.1.0"
}
20 changes: 10 additions & 10 deletions packages/cli-template-contracts-hardhat/test/Feedback.ts
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
4 changes: 3 additions & 1 deletion packages/cli-template-contracts-hardhat/tsconfig.json
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"]
}
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8527,7 +8527,7 @@ __metadata:
"@nomicfoundation/hardhat-network-helpers": ^1.0.0
"@nomicfoundation/hardhat-toolbox": ^4.0.0
"@nomicfoundation/hardhat-verify": ^2.0.0
"@semaphore-protocol/contracts": ^4.0.0-alpha.8
"@semaphore-protocol/contracts": 4.0.0-alpha.8
"@semaphore-protocol/core": ^4.0.0-alpha.8
"@semaphore-protocol/hardhat": ^4.0.0-alpha.8
"@typechain/ethers-v6": ^0.5.0
Expand Down Expand Up @@ -8622,7 +8622,7 @@ __metadata:
languageName: unknown
linkType: soft

"@semaphore-protocol/contracts@4.0.0-alpha.8, @semaphore-protocol/contracts@^4.0.0-alpha.8, @semaphore-protocol/contracts@workspace:packages/contracts/contracts":
"@semaphore-protocol/contracts@4.0.0-alpha.8, @semaphore-protocol/contracts@workspace:packages/contracts/contracts":
version: 0.0.0-use.local
resolution: "@semaphore-protocol/contracts@workspace:packages/contracts/contracts"
dependencies:
Expand Down

0 comments on commit fe43cb4

Please sign in to comment.