fhevm-contracts
This guide explains how to use the fhEVM Contracts standard library. This library provides secure, extensible, and pre-tested Solidity templates designed for developing smart contracts on fhEVM using the TFHE library.
Overview
The fhEVM Contracts standard library streamlines the development of confidential smart contracts by providing templates and utilities for tokens, governance, and error management. These contracts have been rigorously tested by ZAMA's engineers and are designed to accelerate development while enhancing security.
Installation
Install the library using your preferred package manager:
Example
Local testing with the mock network
When testing your contracts locally, you can use the SepoliaZamaFHEVMConfig
which provides a mock configuration for local development and testing. This allows you to test your contracts without needing to connect to a real network:
Deploying to Ethereum Sepolia
When deploying to Sepolia, you can use the SepoliaZamaFHEVMConfig
which provides the correct configuration for the Sepolia testnet:
Best practices for contract inheritance
When inheriting from configuration contracts, the order of inheritance is critical. Since constructors are evaluated from left to right in Solidity, you must inherit the configuration contract first to ensure proper initialization.
✅ Correct Order:
❌ Wrong order:
Available contracts
For a list of all available contracts see the page See all tutorials
Last updated