@webb-tools/semaphore
v0.0.1-5
Published
A library to help deploy Semaphore usage on typescript.
Downloads
7
Keywords
Readme
To learn more about contracts visit semaphore.appliedzkp.org.
🛠 Install
npm or yarn
Install the @webb-tools/semaphore-contracts
package with npm:
npm i @webb-tools/semaphore-contracts
or yarn:
yarn add @webb-tools/semaphore-contracts
📜 Usage
Compile contracts
Compile the smart contracts with Hardhat:
yarn compile
Testing
Run Mocha to test the contracts:
yarn test
You can also generate a test coverage report:
yarn test:coverage
Or a test gas report:
yarn test:report-gas
Deploy contracts
Deploy a verifier contract with depth = 20:
yarn deploy:verifier --depth 20
Deploy the Semaphore.sol
contract with one verifier:
yarn deploy:semaphore --verifiers '[{"merkleTreeDepth": 20, "contractAddress": "0x06bcD633988c1CE7Bd134DbE2C12119b6f3E4bD1"}]'
Deploy all verifiers and Semaphore contract:
yarn deploy:all
If you want to deploy contracts in a specific network you can set up the DEFAULT_NETWORK
variable in your .env
file with the name of one of our supported networks (hardhat, localhost, goerli, arbitrum). Or you can specify it as option:
yarn deploy:all --network goerli
yarn deploy:all --network localhost
If you want to deploy contracts on Goerli or Arbitrum, remember to provide a valid private key and an Infura API in your .env
file.