Skip to content

Commit

Permalink
Merge pull request #337 from zama-ai/docs/fhevm-contract
Browse files Browse the repository at this point in the history
Docs/fhevm contract
  • Loading branch information
jatZama authored Mar 26, 2024
2 parents 6e7cdf2 + f5a859b commit 6e575d1
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
39 changes: 39 additions & 0 deletions docs/fundamentals/contracts.md
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 6e575d1

Please sign in to comment.