Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions docs/solidity-guides/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
## Get Started

- [Overview](solidity-overview.md)
- [Quick Start guide](overview.md)
- [Overview](overview.md)
- [Quick Start - Hardhat](hardhat/README.md)
- [Prerequisites](hardhat/prerequisites.md)
- [1. Setting up Hardhat](hardhat/1.-setting-up-hardhat.md)
Expand Down
8 changes: 4 additions & 4 deletions docs/solidity-guides/configure.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ To utilize encrypted computations in Solidity contracts, you must configure the

By inheriting these configuration contracts, you ensure seamless initialization and functionality across environments.

## ZamaFHEVMConfig.sol
## ZamaConfig.sol

This configuration contract initializes the **fhevm environment** with required encryption parameters.

**Import based on your environment:**

```solidity
// For Ethereum Sepolia
import { SepoliaZamaFHEVMConfig } from "@fhevm/solidity/config/ZamaFHEVMConfig.sol";
import { SepoliaConfig } from "@fhevm/solidity/config/ZamaConfig.sol";
```

**Purpose:**
Expand All @@ -36,9 +36,9 @@ import { SepoliaZamaFHEVMConfig } from "@fhevm/solidity/config/ZamaFHEVMConfig.s
// SPDX-License-Identifier: BSD-3-Clause-Clear
pragma solidity ^0.8.24;

import { SepoliaZamaFHEVMConfig } from "@fhevm/solidity/config/ZamaFHEVMConfig.sol";
import { SepoliaConfig } from "@fhevm/solidity/config/ZamaConfig.sol";

contract MyERC20 is SepoliaZamaFHEVMConfig {
contract MyERC20 is SepoliaConfig {
constructor() {
// Additional initialization logic if needed
}
Expand Down
4 changes: 2 additions & 2 deletions docs/solidity-guides/decryption/public-decryption.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ contract TestAsyncDecrypt is SepoliaConfig {

function requestBool() public {
require(!isDecryptionPending, "Decryption is in progress");
uint256[] memory cts = new uint256[](1);
cts[0] = FHE.toUint256(xBool);
bytes32[] memory cts = new bytes32[](1);
cts[0] = FHE.toBytes32(xBool);
uint256 latestRequestId = FHE.requestDecryption(cts, this.myCustomCallback.selector);

/// @dev This prevents sending multiple requests before the first callback was sent.
Expand Down
2 changes: 1 addition & 1 deletion docs/solidity-guides/inputs.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ function transfer(
bytes calldata inputProof
) public {
// Verify the provided encrypted amount and convert it into an encrypted uint64
euint64 amount = FHE.asEuint64(encryptedAmount, inputProof);
euint64 amount = FHE.fromExternal(encryptedAmount, inputProof);

// Function logic here, such as transferring funds
...
Expand Down
4 changes: 2 additions & 2 deletions docs/solidity-guides/operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ Choose the smallest encrypted type that can accommodate your data to optimize ga

```solidity
// Bad: Using euint256 for small numbers wastes gas
euint64 age = FHE.euint256(25); // age will never exceed 255
euint64 percentage = FHE.euint256(75); // percentage is 0-100
euint64 age = FHE.asEuint128(25); // age will never exceed 255
euint64 percentage = FHE.asEuint128(75); // percentage is 0-100
```

✅ Instead, use the smallest appropriate type:
Expand Down