🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

@semaphore-protocol/cli-template-contracts-foundry

Package Overview
Dependencies
Maintainers
4
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@semaphore-protocol/cli-template-contracts-foundry

Semaphore Foundry template.

latest
npmnpm
Version
4.14.0
Version published
Maintainers
4
Created
Source

Semaphore Foundry Template

This project demonstrates a basic Semaphore use case. It comes with a sample contract, a test for that contract and a sample script that deploys that contract.

Prerequisites

This project requires Foundry, and thus a Rust environment, installed in the machine.

Install

Install dependencies

yarn

Usage

Compile contracts

yarn compile

Test contracts

yarn test

You can also generate a test coverage report:

yarn test:coverage

Or a test gas report:

yarn test:gas-report

You can also start a local Anvil node with Semaphore and Feedback contracts deployed on it with:

yarn dev

Code quality and formatting

Run solhint to analyze the code and catch bugs:

yarn lint

Run Prettier to check formatting rules:

yarn prettier

Or to automatically format the code:

yarn prettier:write

Integrating with Semaphore Boilerplate

You can also integrate this project with Semaphore Boilerplate, using this project as the contract end and connecting with Boilerplate front end.

  • In cli-template-contracts-foundry package directory, run:

    yarn install
    yarn dev
    

    After running yarn dev, notice the output of

    # ...
    # ...
    
    == Return ==
    feedbackAddr: address 0x6f1AFCA8BCA87bF02091AF6187a5002802f9FB31
    semaphoreAddr: address 0xb730ce6CAE3FB706e83E4E00dFA31623966570eB
    semaphoreVerifierAddr: address 0xE2c114f548bEf410eaCe04D0390b61cc963df295
    
    # ...
    # ...
    
  • Now, with another terminal, clone Semaphore Boilerplate down:

    # Clone Semaphore boilerplate and build dependencies
    git clone https://github.com/semaphore-protocol/boilerplate.git
    cd boilerplate
    yarn install
    
    # Use the sample .env.example
    cp .env.example .env
    
  • Open the file apps/web-app/.env.development. Modify the values of NEXT_PUBLIC_FEEDBACK_CONTRACT_ADDRESS and NEXT_PUBLIC_SEMAPHORE_CONTRACT_ADDRESS with feedbackAddr and semaphoreAddr values shown in step 1.

  • Run the Boilerplate front end:

    yarn dev:web-app
    

FAQs

Package last updated on 27 Oct 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts