Skip to content

Commit

Permalink
docs: prettify
Browse files Browse the repository at this point in the history
  • Loading branch information
poppyseedDev committed Feb 21, 2025
1 parent e2c2ce3 commit 39a36f6
Show file tree
Hide file tree
Showing 7 changed files with 121 additions and 124 deletions.
34 changes: 17 additions & 17 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ layout:

Learn the basics of fhEVM, set it up, and make it run with ease.

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-cover data-type="files"></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Overview</strong></td><td>Explore the suite of fhEVM protocol.</td><td><a href=".gitbook/assets/start1.png">start1.png</a></td><td><a href="getting-started/overview.md">overview.md</a></td></tr><tr><td><strong>Quick start with Remix</strong></td><td>Learn and prototype in the in-browser IDE.</td><td><a href=".gitbook/assets/start4.png">start4.png</a></td><td><a href="getting-started/overview-1/overview.md">overview.md</a></td></tr><tr><td><strong>Get started with Hardhat</strong></td><td>Develop in production-ready envrionment.</td><td><a href=".gitbook/assets/start5.png">start5.png</a></td><td><a href="broken-reference">Broken link</a></td></tr></tbody></table>
<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-cover data-type="files"></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Overview</strong></td><td>Explore the suite of fhEVM protocol.</td><td><a href=".gitbook/assets/start1.png">start1.png</a></td><td><a href="getting-started/overview.md">overview.md</a></td></tr><tr><td><strong>Quick start with Remix</strong></td><td>Learn and prototype in the in-browser IDE.</td><td><a href=".gitbook/assets/start4.png">start4.png</a></td><td><a href="getting-started/overview-1/overview.md">overview.md</a></td></tr><tr><td><strong>Get started with Hardhat</strong></td><td>Develop in production-ready envrionment.</td><td><a href=".gitbook/assets/start5.png">start5.png</a></td><td><a href="./getting-started/overview-1/hardhat/README.md">hardhat.md</a></td></tr></tbody></table>

## Develop a fhEVM smart contract

Expand All @@ -35,39 +35,39 @@ Access to additional resources and join the Zama community.

### Explanations

Explore the technical architecture of the fheEVM protocol and the underlying cryptographic principles that power it.
Explore the technical architecture of the fhEVM protocol and the underlying cryptographic principles that power it.

* [Architecture overview](smart_contracts/architecture_overview.md)
* [FHE on blockchain](smart_contracts/architecture_overview/fhe-on-blockchain.md)
* [fhEVM components](smart_contracts/architecture_overview/fhevm-components.md)
* [Encryption, decryption re-encryption and computaiton](smart_contracts/d_re_ecrypt_compute.md)
- [Architecture overview](smart_contracts/architecture_overview.md)
- [FHE on blockchain](smart_contracts/architecture_overview/fhe-on-blockchain.md)
- [fhEVM components](smart_contracts/architecture_overview/fhevm-components.md)
- [Encryption, decryption re-encryption and computation](smart_contracts/d_re_ecrypt_compute.md)

### References

Refer to the API and access additional resources for in-depth explanations while working with fhEVM.

* [API function specifications](references/functions.md)
* [Repositories](references/repositories.md)
- [API function specifications](references/functions.md)
- [Repositories](references/repositories.md)

### Supports

Ask technical questions and discuss with the community. Our team of experts usually answers within 24 hours in working days.

* [Community forum](https://community.zama.ai/c/fhevm/15)
* [Discord channel](https://discord.com/invite/fhe-org)
* [Telegram](https://t.me/+Ojt5y-I7oR42MTkx)
- [Community forum](https://community.zama.ai/c/fhevm/15)
- [Discord channel](https://discord.com/invite/fhe-org)
- [Telegram](https://t.me/+Ojt5y-I7oR42MTkx)

### Developers

Collaborate with us to advance the FHE spaces and drive innovation together.

* [Contribute to fhEVM](developer/contribute.md)
* [Follow the development roadmap](developer/roadmap.md)
* [See the latest test release note](https://github.com/zama-ai/fhevm/releases)
* [Request a feature](https://github.com/zama-ai/fhevm/issues/new?assignees=\&labels=enhancement\&projects=\&template=feature-request.md\&title=)
* [Report a bug](https://github.com/zama-ai/fhevm/issues/new?assignees=\&labels=bug\&projects=\&template=bug_report_fhevm.md\&title=)
- [Contribute to fhEVM](developer/contribute.md)
- [Follow the development roadmap](developer/roadmap.md)
- [See the latest test release note](https://github.com/zama-ai/fhevm/releases)
- [Request a feature](https://github.com/zama-ai/fhevm/issues/new?assignees=&labels=enhancement&projects=&template=feature-request.md&title=)
- [Report a bug](https://github.com/zama-ai/fhevm/issues/new?assignees=&labels=bug&projects=&template=bug_report_fhevm.md&title=)

***
---

{% hint style="success" %}
**Zama 5-Question Developer Survey**
Expand Down
116 changes: 58 additions & 58 deletions docs/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -1,81 +1,81 @@
# Table of contents

* [Welcome to fhEVM](README.md)
* [White paper](https://github.com/zama-ai/fhevm/blob/main/fhevm-whitepaper-v2.pdf)
- [Welcome to fhEVM](README.md)
- [White paper](https://github.com/zama-ai/fhevm/blob/main/fhevm-whitepaper-v2.pdf)

## Getting Started

* [Overview](getting-started/overview.md)
* [Quick Start](getting-started/overview-1/overview.md)
* [Remix](getting-started/overview-1/remix/README.md)
* [1. Setting up Remix](getting-started/overview-1/remix/remix.md)
* [2. Connect your wallet to Remix](getting-started/overview-1/remix/connect_wallet.md)
* [3. Deploying ConfidentialERC20](getting-started/overview-1/remix/deploying_cerc20.md)
* [4. Interacting with the contract](getting-started/overview-1/remix/interact.md)
* [Hardhat](getting-started/overview-1/hardhat/README.md)
* [Prerequisites](getting-started/overview-1/hardhat/prerequisites.md)
* [1. Setting up Hardhat](getting-started/overview-1/hardhat/1.-setting-up-hardhat.md)
* [2. Writing contracts](getting-started/overview-1/hardhat/2.-writing-contracts.md)
* [3. Testing in mocked mode](getting-started/overview-1/hardhat/3.-testing-in-mocked-mode.md)
* [4. Deploying the contract](getting-started/overview-1/hardhat/4.-deploying-the-contract.md)
* [5. Interacting with the contract](getting-started/overview-1/hardhat/5.-interacting-with-the-contract.md)
- [Overview](getting-started/overview.md)
- [Quick Start](getting-started/overview-1/overview.md)
- [Remix](getting-started/overview-1/remix/README.md)
- [1. Setting up Remix](getting-started/overview-1/remix/remix.md)
- [2. Connect your wallet to Remix](getting-started/overview-1/remix/connect_wallet.md)
- [3. Deploying ConfidentialERC20](getting-started/overview-1/remix/deploying_cerc20.md)
- [4. Interacting with the contract](getting-started/overview-1/remix/interact.md)
- [Hardhat](getting-started/overview-1/hardhat/README.md)
- [Prerequisites](getting-started/overview-1/hardhat/prerequisites.md)
- [1. Setting up Hardhat](getting-started/overview-1/hardhat/1.-setting-up-hardhat.md)
- [2. Writing contracts](getting-started/overview-1/hardhat/2.-writing-contracts.md)
- [3. Testing in mocked mode](getting-started/overview-1/hardhat/3.-testing-in-mocked-mode.md)
- [4. Deploying the contract](getting-started/overview-1/hardhat/4.-deploying-the-contract.md)
- [5. Interacting with the contract](getting-started/overview-1/hardhat/5.-interacting-with-the-contract.md)

## Tutorials

* [See all tutorials](tutorials/see-all-tutorials.md)
- [See all tutorials](tutorials/see-all-tutorials.md)

## Smart contract

* [Key features](smart_contracts/key_concepts.md)
* [Configuration](smart_contracts/configure.md)
* [FhEVM contracts](smart_contracts/contracts.md)
* [Supported types](smart_contracts/types.md)
* [Operations on encrypted types](smart_contracts/operations.md)
* [Access Control List](smart_contracts/acl/README.md)
* [ACL examples](smart_contracts/acl/acl_examples.md)
* [Encrypted Inputs](smart_contracts/inputs.md)
* [Decryption](smart_contracts/decryption/README.md)
* [Decryption](smart_contracts/decryption/decrypt.md)
* [Decryption in depth](smart_contracts/decryption/decrypt_details.md)
* [Re-encryption](smart_contracts/decryption/reencryption.md)
* [If sentences](smart_contracts/loop.md)
* [Branching in FHE](smart_contracts/conditions.md)
* [AsEbool, asEuintXX, asEaddress and asEbytesXX operations](smart_contracts/asEXXoperators.md)
* [Generate random numbers](smart_contracts/random.md)
* [Error handling](smart_contracts/error_handling.md)
* [Gas estimation](smart_contracts/gas.md)
* [Debug decrypt](smart_contracts/debug_decrypt.md)
* [Using Foundry](smart_contracts/write_contract/foundry.md)
- [Key features](smart_contracts/key_concepts.md)
- [Configuration](smart_contracts/configure.md)
- [FhEVM contracts](smart_contracts/contracts.md)
- [Supported types](smart_contracts/types.md)
- [Operations on encrypted types](smart_contracts/operations.md)
- [Access Control List](smart_contracts/acl/README.md)
- [ACL examples](smart_contracts/acl/acl_examples.md)
- [Encrypted Inputs](smart_contracts/inputs.md)
- [Decryption](smart_contracts/decryption/README.md)
- [Decryption](smart_contracts/decryption/decrypt.md)
- [Decryption in depth](smart_contracts/decryption/decrypt_details.md)
- [Re-encryption](smart_contracts/decryption/reencryption.md)
- [If sentences](smart_contracts/loop.md)
- [Branching in FHE](smart_contracts/conditions.md)
- [AsEbool, asEuintXX, asEaddress and asEbytesXX operations](smart_contracts/asEXXoperators.md)
- [Generate random numbers](smart_contracts/random.md)
- [Error handling](smart_contracts/error_handling.md)
- [Gas estimation](smart_contracts/gas.md)
- [Debug decrypt](smart_contracts/debug_decrypt.md)
- [Using Foundry](smart_contracts/write_contract/foundry.md)

## Frontend

* [Setup](frontend/setup.md)
* [Build a web application](frontend/webapp.md)
* [Using React.js](https://github.com/zama-ai/fhevm-react-template)
* [Using Next.js](https://github.com/zama-ai/fhevm-next-template)
* [Using Vue.js](https://github.com/zama-ai/fhevm-vue-template)
* [Using Node or Typescript](frontend/node.md)
* [Using the CLI](frontend/cli.md)
* [Common webpack errors](frontend/webpack.md)
- [Setup](frontend/setup.md)
- [Build a web application](frontend/webapp.md)
- [Using React.js](https://github.com/zama-ai/fhevm-react-template)
- [Using Next.js](https://github.com/zama-ai/fhevm-next-template)
- [Using Vue.js](https://github.com/zama-ai/fhevm-vue-template)
- [Using Node or Typescript](frontend/node.md)
- [Using the CLI](frontend/cli.md)
- [Common webpack errors](frontend/webpack.md)

## Explanations

* [Architectural overview](smart_contracts/architecture_overview.md)
* [FHE on blockchain](smart_contracts/architecture_overview/fhe-on-blockchain.md)
* [fhEVM components](smart_contracts/architecture_overview/fhevm-components.md)
* [Encryption, decryption, re-encryption, and computation](smart_contracts/d_re_ecrypt_compute.md)
- [Architectural overview](smart_contracts/architecture_overview.md)
- [FHE on blockchain](smart_contracts/architecture_overview/fhe-on-blockchain.md)
- [fhEVM components](smart_contracts/architecture_overview/fhevm-components.md)
- [Encryption, decryption, re-encryption, and computation](smart_contracts/d_re_ecrypt_compute.md)

## References

* [Table of all addresses](references/table_of_addresses.md)
* [Smart contracts - fhEVM API](references/functions.md)
* [Frontend - fhevmjs lib](references/fhevmjs.md)
* [Repositories](references/repositories.md)
- [Table of all addresses](references/table_of_addresses.md)
- [Smart contracts - fhEVM API](references/functions.md)
- [Frontend - fhevmjs lib](references/fhevmjs.md)
- [Repositories](references/repositories.md)

## Developer

* [Contributing](developer/contribute.md)
* [Development roadmap](developer/roadmap.md)
* [Release note](https://github.com/zama-ai/fhevm/releases)
* [Feature request](https://github.com/zama-ai/fhevm/issues/new?assignees=\&labels=enhancement\&projects=\&template=feature-request.md\&title=)
* [Bug report](https://github.com/zama-ai/fhevm/issues/new?assignees=\&labels=bug\&projects=\&template=bug_report_fhevm.md\&title=)
- [Contributing](developer/contribute.md)
- [Development roadmap](developer/roadmap.md)
- [Release note](https://github.com/zama-ai/fhevm/releases)
- [Feature request](https://github.com/zama-ai/fhevm/issues/new?assignees=&labels=enhancement&projects=&template=feature-request.md&title=)
- [Bug report](https://github.com/zama-ai/fhevm/issues/new?assignees=&labels=bug&projects=&template=bug_report_fhevm.md&title=)
13 changes: 7 additions & 6 deletions docs/getting-started/overview-1/hardhat/1.-setting-up-hardhat.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ cd <your-new-repo-name>
```sh
cp .env.example .env
```

2. Install project dependencies: Depending on your package manager, run one of the following:

```sh
Expand All @@ -41,14 +42,14 @@ cd <your-new-repo-name>

## Project structure overview

* **`contracts/`**: Write your Solidity smart contracts here.
* **`test/`**: Place your test scripts for smart contract testing.
* **`deploy/`**: Deployment scripts for deploying your contracts.
* **`hardhat.config.js`**: The pre-configured Hardhat setup file for deploying on Sepolia.
* **`.env`:** The envrionment file that stores sensitive or environment-specific variables such as private keys and API keys.
- **`contracts/`**: Write your Solidity smart contracts here.
- **`test/`**: Place your test scripts for smart contract testing.
- **`deploy/`**: Deployment scripts for deploying your contracts.
- **`hardhat.config.js`**: The pre-configured Hardhat setup file for deploying on Sepolia.
- **`.env`:** The environment file that stores sensitive or environment-specific variables such as private keys and API keys.

To learn more about Hardhat, refer to the [official Hardhat documentation](https://hardhat.org/hardhat-runner/docs/getting-started#overview).

***
---

You are now ready to start building your confidential smart contracts with fhEVM!
38 changes: 18 additions & 20 deletions docs/getting-started/overview-1/hardhat/2.-writing-contracts.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,22 @@ This document explains how to write confidential smart contract using fhEVM in H

Before proceeding, ensure you have:

* A working Hardhat environment set up (see [previous section](1.-setting-up-hardhat.md)).
* Basic knowledge of Solidity.
* An understanding of ERC20 tokens.
- A working Hardhat environment set up (see [previous section](1.-setting-up-hardhat.md)).
- Basic knowledge of Solidity.
- An understanding of ERC20 tokens.

## Understanding the example contract

The Hardhat template includes an example contract in the `contracts/` folder - `MyConfidentialERC20.sol`. This contract enables:

* Private ERC20 token transfers.
* Encrypted balances.
* Minting functionality for authorized addresses.
- Private ERC20 token transfers.
- Encrypted balances.
- Minting functionality for authorized addresses.

Let's break down the contract.

{% embed url="https://scribehow.com/embed/Contract__WHzYcFfeQp-wamyKwJVDhw?removeLogo=true&skipIntro=true" %}



### Step 1. Importing required libraries and contracts.

```solidity
Expand All @@ -34,9 +32,9 @@ import "fhevm/config/ZamaFHEVMConfig.sol";
import "fhevm-contracts/contracts/token/ERC20/extensions/ConfidentialERC20Mintable.sol";
```

* **`TFHE.sol`**: The core Solidity library of Zama's fhEVM. It enables encrypted data type like `euint64`, secures encrypted operations, such as addition and comparison and allows access control.
* **`SepoliaZamaFHEVMConfig`**: A configuration contract that automatically sets up the required configurations for real-time encrypted operations on the Sepolia testnet.
* **`ConfidentialERC20Mintable.sol`** : The confidential smart contract that allows for full ERC20 compatibility with FHE encryption.
- **`TFHE.sol`**: The core Solidity library of Zama's fhEVM. It enables encrypted data type like `euint64`, secures encrypted operations, such as addition and comparison and allows access control.
- **`SepoliaZamaFHEVMConfig`**: A configuration contract that automatically sets up the required configurations for real-time encrypted operations on the Sepolia testnet.
- **`ConfidentialERC20Mintable.sol`** : The confidential smart contract that allows for full ERC20 compatibility with FHE encryption.

### Step 2. Contract construction

Expand All @@ -46,27 +44,27 @@ contract MyConfidentialERC20 is SepoliaZamaFHEVMConfig, ConfidentialERC20Mintabl
}
```

* This contract inherits `SepoliaZamaFHEVMConfig` and `ConfidentialERC20Mintable`.
* The constructor initializes the ERC20 token with a name and symbol, setting the deployer as the initial owner.
- This contract inherits `SepoliaZamaFHEVMConfig` and `ConfidentialERC20Mintable`.
- The constructor initializes the ERC20 token with a name and symbol, setting the deployer as the initial owner.

## Going further

This is a simple basic contract that we will deploy and use in this tutorial. To write more complex confidential smart contracts or customize your own functions:

* Explore the full range of fhEVM capabilities in the [**Smart Contract**](../../../smart_contracts/key_concepts.md) section.
* Use the **`fhevm-contracts`** library and extend from the basic contract templates.
- Explore the full range of fhEVM capabilities in the [**Smart Contract**](../../../smart_contracts/key_concepts.md) section.
- Use the **`fhevm-contracts`** library and extend from the basic contract templates.

{% hint style="info" %}
The **fhevm-contracts** is a Solidity library designed for developers to easily develop confidential smart contracts using fhEVM. It provides:

* **Ready-to-use confidential contracts**: Pre-built implementations of common token standards with FHE capabilities
* **Base contracts**: Foundational building blocks for creating custom confidential smart contracts
* **Extensions**: Additional features and utilities that can be added to base contracts
* **Testing utilities**: Tools to help test FHE-enabled smart contracts
- **Ready-to-use confidential contracts**: Pre-built implementations of common token standards with FHE capabilities
- **Base contracts**: Foundational building blocks for creating custom confidential smart contracts
- **Extensions**: Additional features and utilities that can be added to base contracts
- **Testing utilities**: Tools to help test FHE-enabled smart contracts

See more details in [the fhEVM-contracts documentation](../../../smart_contracts/contracts.md).
{% endhint %}

***
---

Your contract is ready! Let's move on to testing and deployment.
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ This tutorial walks you through performing tests in the **mocked** mode provided

Before proceeding, ensure you have:

* A configured Hardhat project using the fhEVM Hardhat template. (See the [previous section](1.-setting-up-hardhat.md))
* Basic knowledge of Solidity and Hardhat testing. (See the [Hardhat testing documentation](https://hardhat.org/hardhat-runner/docs/guides/test-contracts))
- A configured Hardhat project using the fhEVM Hardhat template. (See the [previous section](1.-setting-up-hardhat.md))
- Basic knowledge of Solidity and Hardhat testing. (See the [Hardhat testing documentation](https://hardhat.org/hardhat-runner/docs/guides/test-contracts))

{% hint style="info" %}
fhEVM provides a **mocked mode** in Hardhat that allows for:

* Faster testing on a local Hardhat network.
* The ability to analyze code coverage.
* A simulated version of encrypted types (they are not truly encrypted).
* Access to Hardhat features such as snapshots (`evm_snapshot`), time manipulation (`evm_increaseTime`), and debugging (`console.log`).
- Faster testing on a local Hardhat network.
- The ability to analyze code coverage.
- A simulated version of encrypted types (they are not truly encrypted).
- Access to Hardhat features such as snapshots (`evm_snapshot`), time manipulation (`evm_increaseTime`), and debugging (`console.log`).

To learn more about the fhEVM **mocked** mode, refer to the README in the [fhEVM Hardhat template repository](https://github.com/zama-ai/fhevm-hardhat-template).
{% endhint %}
Expand Down
Loading

0 comments on commit 39a36f6

Please sign in to comment.