diff --git a/packages/cli-template-contracts-hardhat/.eslintignore b/packages/cli-template-contracts-hardhat/.eslintignore index 9c1c7902b..c8c27e9cf 100644 --- a/packages/cli-template-contracts-hardhat/.eslintignore +++ b/packages/cli-template-contracts-hardhat/.eslintignore @@ -13,17 +13,6 @@ artifacts cache typechain-types -# types -types - -# circuits -circuits - -# production -dist -build -docs - # misc .DS_Store *.pem @@ -32,8 +21,3 @@ docs npm-debug.log* yarn-debug.log* yarn-error.log* - -# packages -cli-template-* - -snark-artifacts diff --git a/packages/cli-template-contracts-hardhat/.eslintrc.json b/packages/cli-template-contracts-hardhat/.eslintrc.json index 4cf715c01..29d2ebadb 100644 --- a/packages/cli-template-contracts-hardhat/.eslintrc.json +++ b/packages/cli-template-contracts-hardhat/.eslintrc.json @@ -8,7 +8,7 @@ "parserOptions": { "ecmaVersion": 6, "sourceType": "module", - "project": ["./tsconfig.json", "./packages/**/tsconfig.json"] + "project": ["./tsconfig.json"] }, "plugins": ["@typescript-eslint"], "rules": { diff --git a/packages/cli-template-contracts-hardhat/.prettierignore b/packages/cli-template-contracts-hardhat/.prettierignore index 9ff1796dd..a80eb0656 100644 --- a/packages/cli-template-contracts-hardhat/.prettierignore +++ b/packages/cli-template-contracts-hardhat/.prettierignore @@ -4,7 +4,6 @@ package-lock.json yarn.lock .yarn - # debug npm-debug.log* yarn-debug.log* @@ -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 @@ -34,4 +27,3 @@ npm-debug.log* yarn-debug.log* yarn-error.log* -zk-artifacts diff --git a/packages/cli-template-contracts-hardhat/README.md b/packages/cli-template-contracts-hardhat/README.md index ad11b873f..a0f4aec8a 100644 --- a/packages/cli-template-contracts-hardhat/README.md +++ b/packages/cli-template-contracts-hardhat/README.md @@ -2,7 +2,7 @@ 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 @@ -10,6 +10,8 @@ This project demonstrates a basic Semaphore use case. It comes with a sample con yarn ``` +## Usage + ### Compile contracts ```bash diff --git a/packages/cli-template-contracts-hardhat/package.json b/packages/cli-template-contracts-hardhat/package.json index 5460fcdbb..1cad29754 100644 --- a/packages/cli-template-contracts-hardhat/package.json +++ b/packages/cli-template-contracts-hardhat/package.json @@ -6,7 +6,6 @@ "files": [ "files.tgz", "contracts/", - "scripts/", "tasks/", "test/", ".editorconfig", @@ -16,7 +15,10 @@ ".prettierignore", ".prettierrc.json", "hardhat.config.ts", - "tsconfig.json" + "tsconfig.json", + "README.md", + ".yarn/", + ".yarnrc.yml" ], "publishConfig": { "access": "public" @@ -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 ." @@ -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" } diff --git a/packages/cli-template-contracts-hardhat/test/Feedback.ts b/packages/cli-template-contracts-hardhat/test/Feedback.ts index 7fd6eaa64..7733e3b86 100644 --- a/packages/cli-template-contracts-hardhat/test/Feedback.ts +++ b/packages/cli-template-contracts-hardhat/test/Feedback.ts @@ -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 ) }) }) diff --git a/packages/cli-template-contracts-hardhat/tsconfig.json b/packages/cli-template-contracts-hardhat/tsconfig.json index 74e6b64b5..454fb7fd9 100644 --- a/packages/cli-template-contracts-hardhat/tsconfig.json +++ b/packages/cli-template-contracts-hardhat/tsconfig.json @@ -7,5 +7,7 @@ "strict": true, "skipLibCheck": true, "resolveJsonModule": true - } + }, + "include": ["scripts/**/*", "tasks/**/*", "test/**/*", "build/typechain/**/*", "types/**/*"], + "files": ["./hardhat.config.ts"] } diff --git a/yarn.lock b/yarn.lock index cc1f95895..f89764105 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8564,7 +8564,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 @@ -8658,7 +8658,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: