- Fork this repo, and
yarn install - follow the step to step guide
-
create a yarn project
yarn init
-
Install dependencies
yarn add --dev circomlib chai hardhat hardhat-circom typescript ts-node chai @types/node @types/mocha @types/chai @nomiclabs/hardhat-ethers @nomicfoundation/hardhat-chai-matchers @nomicfoundation/hardhat-toolbox @nomiclabs/hardhat-ethers @nomiclabs/hardhat-etherscan typechain @typechain/hardhat hardhat-gas-reporter solidity-coverage @typechain/ethers-v5 @nomicfoundation/hardhat-network-helpers ethers @ethersproject/abi
-
Start a hardhat project (yes, you need to remove
README.md)yarn hardhat
-
Add the following code snippet to
hardhat.config.ts(inconfig):circom: { inputBasePath: "./circuits", ptau: "https://hermezptau.blob.core.windows.net/ptau/powersOfTau28_hez_final_15.ptau", circuits: [ { name: "mul"} ] }
-
sanity check: Try running following tasks:
yarn hardhat help yarn hardhat test REPORT_GAS=true yarn hardhat test yarn hardhat node yarn hardhat run scripts/deploy.ts
yarn hardhat circom --verboseIt should generate a MulVerifier.sol file. Also you can see mul.r1cs, mul.vkey.json, mul.wasm, and mul.zkey generated under ./circuits.