fhEVM
WebsiteLibrariesProduct & ServicesDevelopersSupport
0.6
0.6
  • Welcome to fhEVM
  • White paper
  • Getting Started
    • Overview
    • Quick Start
      • Remix
        • 1. Setting up Remix
        • 2. Connect your wallet to Remix
        • 3. Deploying ConfidentialERC20
        • 4. Interacting with the contract
      • Hardhat
        • Prerequisites
        • 1. Setting up Hardhat
        • 2. Writing contracts
        • 3. Testing in mocked mode
        • 4. Deploying the contract
        • 5. Interacting with the contract
  • Tutorials
    • See all tutorials
  • Smart contract
    • Key features
    • Configuration
    • FhEVM contracts
    • Supported types
    • Operations on encrypted types
    • Access Control List
      • ACL examples
    • Encrypted Inputs
    • Decryption
      • Decryption
      • Decryption in depth
      • Re-encryption
    • If sentences
    • Branching in FHE
    • AsEbool, asEuintXX, asEaddress and asEbytesXX operations
    • Generate random numbers
    • Error handling
    • Gas estimation
    • Debug decrypt
    • Using Foundry
  • Frontend
    • Setup
    • Build a web application
    • Using React.js
    • Using Next.js
    • Using Vue.js
    • Using Node or Typescript
    • Using the CLI
    • Common webpack errors
  • Explanations
    • Architectural overview
    • FHE on blockchain
    • fhEVM components
    • Encryption, decryption, re-encryption, and computation
  • References
    • Table of all addresses
    • Smart contracts - fhEVM API
    • Frontend - fhevmjs lib
    • Repositories
  • Developer
    • Contributing
    • Development roadmap
    • Release note
    • Feature request
    • Bug report
    • Status
Powered by GitBook

Libraries

  • TFHE-rs
  • Concrete
  • Concrete ML
  • fhEVM

Developers

  • Blog
  • Documentation
  • Github
  • FHE resources

Company

  • About
  • Introduction to FHE
  • Media
  • Careers
On this page
  • Prerequisites
  • Step 1. Preparing for deployment
  • Step 2. Funding your wallet
  • Step 3. Deploying the contract
  • Step 4. Verify the deployment

Was this helpful?

Export as PDF
  1. Getting Started
  2. Quick Start
  3. Hardhat

4. Deploying the contract

Previous3. Testing in mocked modeNext5. Interacting with the contract

Last updated 3 months ago

Was this helpful?

This guide walks you through deploying your Confidential ERC20 smart contract on the Sepolia test network.

Prerequisites

Before proceeding, ensure you have:

  • A configured Hardhat project using the fhEVM Hardhat Template (see previous sections).

  • A crypto wallet installed (e.g., Metamask).

  • Some Sepolia ETH available for testing. If you don’t have enough ETH, use a Sepolia faucet to request free SepoliaETH for testing:

Step 1. Preparing for deployment

  1. Generate a mnemonic seed for accounts using cast:

    • (cast is a Foundry function. If you don't have Foundry installed, run curl -L https://foundry.paradigm.xyz | bash first):

cast wallet new-mnemonic
  1. Obtain a Sepolia RPC URL:

    • Sign up for a node provider such as Alchemy - https://www.alchemy.com/ or Infura - https://infura.io/. Copy your Sepolia RPC URL.

  2. Open the .env file:

    • Past your mnemonic in the code:

      • MNEMONIC=<Your mnemonic generated>

    • Paste a Sepolia RPC URL:

      • SEPOLIA_RPC_URL=<Your node provider URL>

  3. Verify generated accounts:

npx hardhat get-accounts --num-accounts 5

Step 2. Funding your wallet

  1. Open your wallet (e.g, MetaMask)

  2. Import the first 2 accounts (e.g., Alice and Bob) into your wallet with their private keys.

  3. Fund these 2 accounts with some Sepolia ETH.

Step 3. Deploying the contract

In the deploy/ directory, there is a preconfigured deploy.ts file that handles the deployment process. You can customize it or add your own scripts.

To deploy the contracts to Sepolia, run:

# Using npm
npm run deploy-sepolia

# Using yarn
yarn deploy-sepolia

# Using pnpm
pnpm deploy-sepolia

Step 4. Verify the deployment

Once deployment is successful, you should see a console output that includes the contract address such as:

MyConfidentialERC20: 0x1234........ABCD

Congratulations! 🎉 You have deployed your first confidential ERC20 smart contract. Let's mint a few tokens and perform some encrypted transactions!

You can verify this contract on by searching for the deployed address.

Alchemy Faucet
QuickNode Faucet
Sepolia Etherscan