diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md index 387ef97a..338a551e 100644 --- a/docs/SUMMARY.md +++ b/docs/SUMMARY.md @@ -21,6 +21,7 @@ - [Write conditions](fundamentals/conditions.md) - [Decrypt and reencrypt](fundamentals/decrypt.md) - [Generate random number](fundamentals/random.md) +- [Contracts standard library](fundamentals/contracts.md) ## Guides diff --git a/docs/fundamentals/contracts.md b/docs/fundamentals/contracts.md new file mode 100644 index 00000000..c3799c05 --- /dev/null +++ b/docs/fundamentals/contracts.md @@ -0,0 +1,39 @@ +# Contracts standard library + +## Getting Started + +### Installation + +```bash +# Using npm +npm install fhevm-contracts + +# Using Yarn +yarn add fhevm-contracts + +# Using pnpm +pnpm add fhevm-contracts +``` + +## A Simple Example + +```solidity +// 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 + +- [EncryptedERC20](https://github.com/zama-ai/fhevm-contracts/blob/main/contracts/token/ERC20/EncryptedERC20.sol) +- [DAO](https://github.com/zama-ai/fhevm-contracts/tree/main/contracts/DAO) +- [EncryptedErrors](https://github.com/zama-ai/fhevm-contracts/blob/main/contracts/utils/EncryptedErrors.sol)