Skip to content

Simple monorepo you can use as a template to start developing your dApp with Semaphore.

License

Notifications You must be signed in to change notification settings

semaphore-protocol/boilerplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

8e4d887 Β· Feb 28, 2024
Feb 14, 2024
Mar 15, 2023
Feb 28, 2024
Jun 9, 2022
Feb 14, 2024
Feb 16, 2024
Feb 1, 2024
Jun 9, 2022
Mar 15, 2023
Jan 31, 2024
Feb 14, 2024
Feb 14, 2024
Feb 16, 2024

Repository files navigation

Semaphore Boilerplate

Github license GitHub Workflow style Linter eslint Code style prettier

The repository is divided into two components: web app and contracts. The app allows users to create their own Semaphore identity, join a group and then send their feedback anonymously (currently on Sepolia).

πŸ›  Install

Use this repository as a Github template.

Clone your repository:

git clone https://github.com/<your-username>/<your-repo>.git

and install the dependencies:

cd <your-repo> && yarn

πŸ“œ Usage

Copy the .env.example file as .env:

cp .env.example .env

and add your environment variables or run the app in a local network.

Local server

You can start your app locally with:

yarn dev

Deploy the contract

  1. Go to the apps/contracts directory and deploy your contract:
yarn deploy --semaphore <semaphore-address> --group <group-id> --network sepolia
  1. Update the apps/web-app/.env.$(NODE_ENV).local files with your new contract address, the group id and the semaphore contract address.

  2. Copy your contract artifacts from apps/contracts/artifacts/contracts folder to apps/web-app/contract-artifacts folder.

Note
Check the Semaphore contract addresses here.

Warning
The group id is a number!

Verify the contract

Verify your contract on Etherscan:

yarn verify <your-contract-address> <semaphore-address> <group-id> --network sepolia

Note
Remember to set the Etherscan API Key in your .env file.

Code formatting

Run Prettier to check formatting rules:

yarn prettier

or to automatically format the code:

yarn prettier:write