Prerequisites
Last updated
Was this helpful?
Last updated
Was this helpful?
This guide will walk you through installing all necessary dependencies from scratch, preparing you for developing and deploying fhEVM smart contracts using Hardhat.
To use Hardhat to build and deploy confidential smart contract, you need to have the following:
Node.js (v20 or later)
A package manager: npm
, yarn
, or pnpm
Git for version control
Foundry for using the command cast
If you already have these installed, skip ahead to
To run the installation commands, open a terminal:
Use your system's built-in terminal (e.g., Terminal on macOS, Command Prompt or PowerShell on Windows, or a Linux shell).
Alternatively, use the integrated terminal in a IDE such as .
Instead of installing Node.js directly, we recommend using Node Version Manager (nvm
), which allows you to manage multiple versions of Node.js:
Install nvm
following the recommended tutorials:
Install Node.js using nvm. This installs the latest version of Node.js:
Install pnpm (optional but recommended for better speed and efficiency). After installing Node.js, you automatically have npm, so run:
Alternatively, you can continue using npm
or yarn
if you prefer.
Git is required for managing source code, cloning repositories, and handling version control. Install Git based on your operating system:
Linux: Use your distribution's package manager (e.g., sudo apt-get install git
on Ubuntu/Debian).
We will need the command cast
in our tutorial. This command is available with installing Foundry.
Install Foundry using the official installer:
Reload your terminal configuration:
Run the Foundry installer:
This will install all Foundry components, including cast
, forge
, anvil
, and chisel
.
To verify the installation, run:
Windows: .
macOS: Install via with brew install git
or .
You now have all the necessary dependencies installed. Continue to to begin creating and deploying your FHE smart contracts!