1. Setting up Hardhat

This guide walks you through setting up your Hardhat environment using Zama's fhEVM Hardhat template.

Step 1: Clone the Hardhat template

  1. Open the repository: Zama fhEVM Hardhat Template

  2. Click "Use this template" to create a new repository under your GitHub account.

  3. Clone the repository you have created to your local environment

  4. Copy the repository URL of your newly created repository.

  5. Open a terminal and run:

git clone <your-new-repo-url>
cd <your-new-repo-name>

Step 2: Configure the environment

  1. Copy the environment configuration template:

    cp .env.example .env
  2. Install project dependencies: Depending on your package manager, run one of the following:

    # Using npm
    npm install
    
    # Using yarn
    yarn install
    
    # Using pnpm
    pnpm install

Project structure overview

  • contracts/: Write your Solidity smart contracts here.

  • test/: Place your test scripts for smart contract testing.

  • deploy/: Deployment scripts for deploying your contracts.

  • hardhat.config.js: The pre-configured Hardhat setup file for deploying on Sepolia.

  • .env: The environment file that stores sensitive or environment-specific variables such as private keys and API keys.

To learn more about Hardhat, refer to the official Hardhat documentation.


You are now ready to start building your confidential smart contracts with fhEVM!

Last updated

Was this helpful?