fhEVM
WebsiteLibrariesProduct & ServicesDevelopersSupport
0.4
0.4
  • Welcome to fhEVM
  • Getting Started
    • What is fhEVM
    • Connecting to Zama Devnet
    • Using Zama Faucet
    • Local dev node
    • Whitepaper
  • Fundamentals
    • Write contract
      • Using Hardhat
      • Using Remix
      • Other development environment
    • Use encrypted types
    • Operations on encrypted types
    • Branching in FHE
    • Decrypt and reencrypt
    • Generate random number
    • Contracts standard library
  • Guides
    • Gas estimation
    • Common pitfalls and best practises
    • How can I break a loop ?
    • Encrypt an input
    • Reencryption
    • Use the CLI
    • Build a web application
    • Build with Node
    • Common webpack errors
  • Tutorials
    • See all tutorials
    • Write confidential smart contract with fhEVM
  • References
    • API Function specifications
    • Repositories
  • Developer
    • Contributing
    • Development roadmap
    • Release note
    • Feature request
    • Bug report
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
  • Getting Started
  • Installation
  • A Simple Example
  • Available contracts

Was this helpful?

Export as PDF
  1. Fundamentals

Contracts standard library

Getting Started

Installation

# Using npm
npm install fhevm-contracts

# Using Yarn
yarn add fhevm-contracts

# Using pnpm
pnpm add fhevm-contracts

A Simple Example

// SPDX-License-Identifier: BSD-3-Clause-Clear

pragma solidity ^0.8.20;

import "fhevm/lib/TFHE.sol";
import "fhevm-contracts/contracts/token/ERC20/EncryptedERC20.sol";

contract MyERC20 is EncryptedERC20 {
  constructor() EncryptedERC20("MyToken", "MYTOKEN") {
    _mint(1000000, msg.sender);
  }
}

Available contracts

PreviousGenerate random numberNextGas estimation

Last updated 1 year ago

Was this helpful?

EncryptedERC20
DAO
EncryptedErrors