create-fhevm-example 1.4.8 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/contracts/advanced/BlindAuction.sol +3 -6
  2. package/contracts/advanced/EncryptedEscrow.sol +3 -6
  3. package/contracts/advanced/HiddenVoting.sol +4 -5
  4. package/contracts/advanced/PrivateKYC.sol +3 -8
  5. package/contracts/advanced/PrivatePayroll.sol +3 -5
  6. package/contracts/basic/decryption/PublicDecryptMultipleValues.sol +4 -7
  7. package/contracts/basic/decryption/PublicDecryptSingleValue.sol +3 -6
  8. package/contracts/basic/decryption/UserDecryptMultipleValues.sol +4 -7
  9. package/contracts/basic/decryption/UserDecryptSingleValue.sol +4 -7
  10. package/contracts/basic/encryption/EncryptMultipleValues.sol +4 -6
  11. package/contracts/basic/encryption/FHECounter.sol +3 -5
  12. package/contracts/basic/fhe-operations/FHEAdd.sol +3 -6
  13. package/contracts/basic/fhe-operations/FHEArithmetic.sol +4 -7
  14. package/contracts/basic/fhe-operations/FHEComparison.sol +4 -8
  15. package/contracts/basic/fhe-operations/FHEIfThenElse.sol +4 -7
  16. package/contracts/concepts/antipatterns/ControlFlow.sol +3 -5
  17. package/contracts/concepts/antipatterns/OperationsGasNoise.sol +6 -7
  18. package/contracts/concepts/antipatterns/Permissions.sol +3 -5
  19. package/contracts/concepts/core/FHEAccessControl.sol +3 -5
  20. package/contracts/concepts/core/FHEEdgeCases.sol +376 -0
  21. package/contracts/concepts/core/FHEHandles.sol +4 -7
  22. package/contracts/concepts/core/FHEInputProof.sol +4 -6
  23. package/contracts/gaming/EncryptedLottery.sol +3 -7
  24. package/contracts/gaming/EncryptedPoker.sol +3 -7
  25. package/contracts/gaming/RockPaperScissors.sol +4 -8
  26. package/contracts/openzeppelin/ERC7984.sol +4 -8
  27. package/contracts/openzeppelin/ERC7984ERC20Wrapper.sol +3 -6
  28. package/contracts/openzeppelin/SwapERC7984ToERC20.sol +3 -6
  29. package/contracts/openzeppelin/SwapERC7984ToERC7984.sol +3 -5
  30. package/contracts/openzeppelin/VestingWallet.sol +2 -5
  31. package/dist/scripts/commands/add-mode.d.ts.map +1 -1
  32. package/dist/scripts/commands/add-mode.js +342 -55
  33. package/dist/scripts/index.js +0 -0
  34. package/dist/scripts/shared/builders.d.ts.map +1 -1
  35. package/dist/scripts/shared/builders.js +7 -3
  36. package/dist/scripts/shared/config.d.ts.map +1 -1
  37. package/dist/scripts/shared/config.js +41 -29
  38. package/package.json +1 -2
  39. package/test/advanced/BlindAuction.ts +66 -3
  40. package/test/advanced/EncryptedEscrow.ts +73 -3
  41. package/test/advanced/HiddenVoting.ts +63 -2
  42. package/test/advanced/PrivateKYC.ts +45 -2
  43. package/test/advanced/PrivatePayroll.ts +58 -1
  44. package/test/basic/decryption/PublicDecryptMultipleValues.ts +17 -9
  45. package/test/basic/decryption/PublicDecryptSingleValue.ts +22 -14
  46. package/test/basic/decryption/UserDecryptMultipleValues.ts +13 -4
  47. package/test/basic/decryption/UserDecryptSingleValue.ts +15 -7
  48. package/test/basic/encryption/EncryptMultipleValues.ts +25 -14
  49. package/test/basic/encryption/EncryptSingleValue.ts +4 -2
  50. package/test/basic/encryption/FHECounter.ts +21 -5
  51. package/test/basic/fhe-operations/FHEAdd.ts +13 -9
  52. package/test/basic/fhe-operations/FHEArithmetic.ts +15 -3
  53. package/test/basic/fhe-operations/FHEComparison.ts +14 -2
  54. package/test/basic/fhe-operations/FHEIfThenElse.ts +12 -9
  55. package/test/concepts/antipatterns/ControlFlow.ts +14 -2
  56. package/test/concepts/antipatterns/OperationsGasNoise.ts +15 -2
  57. package/test/concepts/antipatterns/Permissions.ts +14 -7
  58. package/test/concepts/core/FHEAccessControl.ts +11 -4
  59. package/test/concepts/core/FHEEdgeCases.ts +460 -0
  60. package/test/concepts/core/FHEHandles.ts +9 -3
  61. package/test/concepts/core/FHEInputProof.ts +9 -4
  62. package/test/gaming/EncryptedLottery.ts +65 -1
  63. package/test/gaming/EncryptedPoker.ts +67 -3
  64. package/test/gaming/RockPaperScissors.ts +56 -5
  65. package/test/openzeppelin/ERC7984.ts +28 -25
  66. package/test/openzeppelin/ERC7984ERC20Wrapper.ts +10 -1
  67. package/test/openzeppelin/SwapERC7984ToERC20.ts +15 -5
  68. package/test/openzeppelin/SwapERC7984ToERC7984.ts +15 -10
  69. package/test/openzeppelin/VestingWallet.ts +15 -5
@@ -10,15 +10,12 @@ import {
10
10
  import {ZamaEthereumConfig} from "@fhevm/solidity/config/ZamaConfig.sol";
11
11
 
12
12
  /**
13
- * @notice Blind auction where bids remain encrypted until the end.
14
- * Bidders submit encrypted amounts. The contract finds the highest bid
15
- * using FHE.gt and FHE.select without ever decrypting losing bids.
16
- * Only the winning bid amount is revealed after the auction closes.
17
- * Losing bids remain private forever, ensuring true bid confidentiality.
13
+ * @notice Blind auction where bids remain fully encrypted until the end.
14
+ * Uses FHE.gt/select to find the winner without decrypting losing bids.
15
+ * Only the winning amount is revealed after the auction closes.
18
16
 
19
17
  * @dev Flow: bid() → endAuction() → revealWinner()
20
18
  * Uses FHE.gt/select to find winner without revealing losing bids.
21
- * Losing bids remain encrypted forever!
22
19
  */
23
20
  contract BlindAuction is ZamaEthereumConfig {
24
21
  enum AuctionState {
@@ -10,14 +10,11 @@ import {
10
10
  import {ZamaEthereumConfig} from "@fhevm/solidity/config/ZamaConfig.sol";
11
11
 
12
12
  /**
13
- * @notice Confidential escrow service with hidden transaction amounts.
14
- * Buyer and seller agree on encrypted escrow amount. Funds are held
15
- * securely until conditions are met. Amount remains hidden from public
16
- * view until release or refund. Includes arbiter for dispute resolution.
17
- * Perfect for high-value transactions requiring privacy.
13
+ * @notice Confidential escrow service with hidden transaction amounts and arbiters.
14
+ * Secures funds with encrypted amounts. Details remain hidden until
15
+ * release or refund, supporting multi-party dispute resolution.
18
16
  *
19
17
  * @dev Flow: createEscrow() → fundEscrow() → release()/requestRefund()/raiseDispute()
20
- * Multi-party agreement with arbiter for disputes.
21
18
  */
22
19
  contract EncryptedEscrow is ZamaEthereumConfig {
23
20
  enum EscrowState {
@@ -5,11 +5,9 @@ import {FHE, euint64, ebool, externalEuint8} from "@fhevm/solidity/lib/FHE.sol";
5
5
  import {ZamaEthereumConfig} from "@fhevm/solidity/config/ZamaConfig.sol";
6
6
 
7
7
  /**
8
- * @notice Private voting system with homomorphic vote tallying.
9
- * Voters submit encrypted ballots (Yes/No). Votes are tallied using
10
- * homomorphic addition WITHOUT decrypting individual ballots. Only the
11
- * final tally is revealed - individual votes remain private forever.
12
- * Perfect for DAO governance, elections, or any scenario requiring ballot secrecy.
8
+ * @notice Private voting system with homomorphic vote tallying (Yes/No).
9
+ * Ballots are added without decryption. Only final totals are revealed,
10
+ * ensuring individual vote secrecy forever.
13
11
  *
14
12
  * @dev Flow: vote() → closeVoting() → revealResults()
15
13
  * ⚡ Gas: Each vote costs ~200k gas (FHE.add + FHE.select operations)
@@ -118,6 +116,7 @@ contract HiddenVoting is ZamaEthereumConfig {
118
116
  );
119
117
  _noVotes = FHE.add(_noVotes, noIncrement);
120
118
 
119
+ FHE.allowThis(_yesVotes);
121
120
  FHE.allowThis(_noVotes);
122
121
 
123
122
  hasVoted[msg.sender] = true;
@@ -12,16 +12,11 @@ import {
12
12
  import {ZamaEthereumConfig} from "@fhevm/solidity/config/ZamaConfig.sol";
13
13
 
14
14
  /**
15
- * @notice Privacy-preserving identity verification using predicate proofs.
16
- * Users submit encrypted personal data (age, country, credit score).
17
- * Contract can verify predicates like "Is user 18+?" or "Good credit?"
18
- * without learning the actual values. Returns encrypted booleans that
19
- * prove compliance without revealing sensitive information. Revolutionary
20
- * for KYC/AML compliance while preserving user privacy.
15
+ * @notice Privacy-preserving KYC using encrypted predicate proofs (e.g., 18+ check).
16
+ * Users submit encrypted data. The contract verifies compliance without
17
+ * learning actual values, returning encrypted booleans.
21
18
  *
22
19
  * @dev Flow: submitKYC() → verifyAge18()/verifyGoodCredit()/etc.
23
- * Returns encrypted booleans: "Is 18+?", "Good credit?" without revealing actual values.
24
- * ⚠️ Production KYC needs trusted attesters!
25
20
  */
26
21
  contract PrivateKYC is ZamaEthereumConfig {
27
22
  struct Identity {
@@ -10,11 +10,9 @@ import {
10
10
  import {ZamaEthereumConfig} from "@fhevm/solidity/config/ZamaConfig.sol";
11
11
 
12
12
  /**
13
- * @notice Confidential payroll system with encrypted salaries.
14
- * Employers can add employees with encrypted salary amounts. Each employee
15
- * can decrypt only their own salary - other salaries remain hidden.
16
- * Demonstrates selective decryption permissions where different users
17
- * see different encrypted values. Perfect for privacy-preserving HR systems.
13
+ * @notice Confidential payroll system with encrypted salaries and selective access.
14
+ * Employers manage employees with hidden salaries. Only the owner and the
15
+ * respective employee can access specific salary data.
18
16
  *
19
17
  * @dev Flow: addEmployee() → fund() → processPayment()
20
18
  * Each employee can decrypt only their own salary.
@@ -5,14 +5,11 @@ import {FHE, euint8} from "@fhevm/solidity/lib/FHE.sol";
5
5
  import {ZamaEthereumConfig} from "@fhevm/solidity/config/ZamaConfig.sol";
6
6
 
7
7
  /**
8
- * @notice Highest die roll game with public decryption of multiple values.
9
- * Two players roll encrypted 8-sided dice, results are made publicly
10
- * decryptable. Demonstrates handling multiple encrypted values in
11
- * checkSignatures() where ORDER MATTERS - the cts[] array must match
12
- * the order of values in the ABI-encoded result.
8
+ * @notice Dice game demonstrating public decryption of multiple encrypted values.
9
+ * Shows how to use checkSignatures() with multiple values, highlighting
10
+ * that the order in cts[] must match the ABI-encoded results.
13
11
  *
14
- * @dev Uses FHE.randEuint8() + FHE.makePubliclyDecryptable() for both dice rolls.
15
- * ⚠️ Order matters in cts[] array for checkSignatures!
12
+ * @dev Uses FHE.randEuint8() and FHE.makePubliclyDecryptable().
16
13
  */
17
14
  contract HighestDieRoll is ZamaEthereumConfig {
18
15
  // Simple counter to assign a unique ID to each new game.
@@ -6,13 +6,10 @@ import {ZamaEthereumConfig} from "@fhevm/solidity/config/ZamaConfig.sol";
6
6
 
7
7
  /**
8
8
  * @notice Heads or Tails game with public, permissionless decryption.
9
- * Demonstrates makePubliclyDecryptable() which allows ANYONE to decrypt
10
- * the result (not just allowed users). Perfect for public game results,
11
- * lottery winners, or voting tallies. Uses FHE.randEbool() for fair
12
- * randomness and KMS-verified decryption proofs.
9
+ * Demonstrates FHE.makePubliclyDecryptable(), allowing any user to
10
+ * decrypt results like game outcomes or voting tallies using KMS proofs.
13
11
  *
14
- * @dev Uses FHE.randEbool() for random result + FHE.makePubliclyDecryptable() for revealing.
15
- * Anyone can decrypt results with valid KMS proof.
12
+ * @dev Uses FHE.randEbool() and FHE.makePubliclyDecryptable().
16
13
  */
17
14
  contract HeadsOrTails is ZamaEthereumConfig {
18
15
  /// Simple counter to assign a unique ID to each new game.
@@ -5,14 +5,11 @@ import {FHE, ebool, euint32, euint64} from "@fhevm/solidity/lib/FHE.sol";
5
5
  import {ZamaEthereumConfig} from "@fhevm/solidity/config/ZamaConfig.sol";
6
6
 
7
7
  /**
8
- * @notice Decrypting multiple encrypted values of different types for a user.
9
- * Shows how to handle ebool, euint32, and euint64 in one contract.
10
- * Each value requires individual permission grants - there's no batching
11
- * for permissions (unlike input proofs). Demonstrates the pattern of
12
- * granting allowThis() for each value separately.
8
+ * @notice Decrypting multiple encrypted values (ebool, euint32, euint64) for a user.
9
+ * Highlights that each value requires individual permission grants,
10
+ * as there is no batching for FHE.allow() or FHE.allowThis().
13
11
  *
14
- * @dev Each value needs separate permission grants (no batching).
15
- * ⚠️ Cannot batch permission grants - must call allow() for each value!
12
+ * @dev Individual permissions are required for each encrypted value.
16
13
  */
17
14
  contract UserDecryptMultipleValues is ZamaEthereumConfig {
18
15
  ebool private _encryptedBool;
@@ -5,14 +5,11 @@ import {FHE, euint32} from "@fhevm/solidity/lib/FHE.sol";
5
5
  import {ZamaEthereumConfig} from "@fhevm/solidity/config/ZamaConfig.sol";
6
6
 
7
7
  /**
8
- * @notice User-controlled decryption with proper permission management.
9
- * Demonstrates the critical two-step permission pattern: allowThis()
10
- * grants the contract permission to store/compute, while allow() grants
11
- * the user permission to decrypt. Missing either step causes decryption
12
- * to fail. Includes examples of both correct and incorrect patterns.
8
+ * @notice User-controlled decryption with mandatory two-step permissions.
9
+ * Demonstrates the pattern: allowThis() for contract storage/computation
10
+ * and allow() for user decryption, illustrating correct vs incorrect usage.
13
11
  *
14
- * @dev Shows CORRECT vs INCORRECT permission granting.
15
- * ⚠️ Both allowThis + allow required for user decryption!
12
+ * @dev Both allowThis and allow are required for successful user decryption.
16
13
  */
17
14
  contract UserDecryptSingleValue is ZamaEthereumConfig {
18
15
  euint32 private _trivialEuint32;
@@ -13,13 +13,11 @@ import {
13
13
  import {ZamaEthereumConfig} from "@fhevm/solidity/config/ZamaConfig.sol";
14
14
 
15
15
  /**
16
- * @notice Efficient handling of multiple encrypted values in one transaction.
17
- * Demonstrates batched input validation where a single proof covers
18
- * multiple encrypted values (ebool, euint32, eaddress), saving ~50k gas
19
- * per additional value compared to separate proofs.
16
+ * @notice Efficient handling of multiple encrypted values via batched inputs.
17
+ * Uses a single proof for multiple values (ebool, euint32, eaddress),
18
+ * saving significant gas compared to separate proofs.
20
19
  *
21
- * @dev Demonstrates batched input (ONE proof for multiple values).
22
- * ⚡ Gas: Batching saves ~50k gas vs separate proofs!
20
+ * @dev Batching saves ~50k gas per additional value.
23
21
  */
24
22
  contract EncryptMultipleValues is ZamaEthereumConfig {
25
23
  ebool private _encryptedEbool;
@@ -6,12 +6,10 @@ import {ZamaEthereumConfig} from "@fhevm/solidity/config/ZamaConfig.sol";
6
6
 
7
7
  /**
8
8
  * @notice Confidential counter with encrypted increment/decrement operations.
9
- * Demonstrates the complete FHE workflow: encryption, computation,
10
- * and permission management. The counter value remains private,
11
- * only accessible through decryption by authorized users.
9
+ * Demonstrates the FHE workflow: encryption, computation, and permission
10
+ * management while keeping the counter value private.
12
11
 
13
- * @dev Demonstrates basic FHE workflow: fromExternal() → computeallow permissions.
14
- * All arithmetic happens on encrypted values without revealing the count.
12
+ * @dev Workflow: fromExternal (validation) → arithmetic → permissions.
15
13
  */
16
14
  contract FHECounter is ZamaEthereumConfig {
17
15
  euint32 private _count;
@@ -6,13 +6,10 @@ import {ZamaEthereumConfig} from "@fhevm/solidity/config/ZamaConfig.sol";
6
6
 
7
7
  /**
8
8
  * @notice Introduction to homomorphic addition on encrypted values.
9
- * Demonstrates the most fundamental FHE operation: adding two encrypted
10
- * numbers without decrypting them. Shows the complete flow from receiving
11
- * encrypted inputs, performing the addition, and granting permissions
12
- * for both contract storage and user decryption.
9
+ * Demonstrates adding two encrypted numbers without decryption, including
10
+ * input handling, addition, and permission management.
13
11
 
14
- * @dev Shows the most basic FHE operation and permission flow.
15
- * ⚡ Gas: FHE.add() costs ~100k gas (coprocessor call)
12
+ * @dev Shows the basic FHE operation and permission flow (FHE.add ~100k gas).
16
13
  */
17
14
  contract FHEAdd is ZamaEthereumConfig {
18
15
  euint8 private _a;
@@ -5,14 +5,11 @@ import {FHE, euint32, externalEuint32} from "@fhevm/solidity/lib/FHE.sol";
5
5
  import {ZamaEthereumConfig} from "@fhevm/solidity/config/ZamaConfig.sol";
6
6
 
7
7
  /**
8
- * @notice Complete suite of FHE arithmetic operations on encrypted values.
9
- * Covers all basic math: addition, subtraction, multiplication, division,
10
- * remainder (modulo), minimum, and maximum. Includes gas cost comparisons
11
- * and important limitations (e.g., division/remainder only work with
12
- * plaintext divisors, not encrypted divisors).
8
+ * @notice FHE arithmetic (add, sub, mul, div, rem, min, max) on encrypted values.
9
+ * Includes gas cost comparisons and key limitations, such as plaintext
10
+ * divisors for division and remainder operations.
13
11
  *
14
- * @dev Gas costs vary: add/sub (~100k) < mul (~150k) < div/rem (~300k)
15
- * ⚠️ div/rem only work with plaintext divisor (not encrypted!)
12
+ * @dev div/rem only work with plaintext divisors (not encrypted).
16
13
  */
17
14
  contract FHEArithmetic is ZamaEthereumConfig {
18
15
  euint32 private _a;
@@ -10,15 +10,11 @@ import {
10
10
  import {ZamaEthereumConfig} from "@fhevm/solidity/config/ZamaConfig.sol";
11
11
 
12
12
  /**
13
- * @notice Complete guide to encrypted comparisons and conditional selection.
14
- * Covers all comparison operators (eq, ne, gt, lt, ge, le) that return
15
- * encrypted booleans (ebool), and demonstrates FHE.select for branching
16
- * without information leakage. Critical for implementing logic like
17
- * "find maximum" or "check threshold" without revealing values.
13
+ * @notice Encrypted comparisons (eq, ne, gt, lt, ge, le) and conditional selection.
14
+ * Demonstrates FHE.select for branching without information leakage,
15
+ * essential for "find maximum" or threshold logic.
18
16
  *
19
- * @dev Results are encrypted booleans (ebool) - comparisons reveal nothing!
20
- * ⚡ Gas: Comparisons ~100k, select ~120k
21
- * ❌ WRONG: if (FHE.gt(a,b)) → decrypts! ✅ CORRECT: FHE.select()
17
+ * @dev Comparisons return ebool; select avoids revealing values during branching.
22
18
  */
23
19
  contract FHEComparison is ZamaEthereumConfig {
24
20
  euint32 private _a;
@@ -5,14 +5,11 @@ import {FHE, ebool, euint8, externalEuint8} from "@fhevm/solidity/lib/FHE.sol";
5
5
  import {ZamaEthereumConfig} from "@fhevm/solidity/config/ZamaConfig.sol";
6
6
 
7
7
  /**
8
- * @notice Conditional logic without information leakage using FHE.select.
9
- * Demonstrates how to implement if-then-else logic on encrypted values
10
- * (computing max of two numbers). Using regular if/else would decrypt
11
- * and leak which branch was taken. FHE.select evaluates BOTH branches
12
- * and picks one based on the encrypted condition, preserving privacy.
8
+ * @notice Conditional logic using FHE.select for privacy-preserving branching.
9
+ * Demonstrates if-then-else logic on encrypted values. Unlike regular
10
+ * if/else, FHE.select avoids information leakage by evaluating both branches.
13
11
  *
14
- * @dev Can't use if/else (leaks info!) ✅ Use FHE.select instead
15
- * ⚡ Gas: ~120k for select operation
12
+ * @dev Evaluates both branches using encrypted conditions (FHE.select ~120k gas).
16
13
  */
17
14
  contract FHEIfThenElse is ZamaEthereumConfig {
18
15
  euint8 private _a;
@@ -11,12 +11,10 @@ import {ZamaEthereumConfig} from "@fhevm/solidity/config/ZamaConfig.sol";
11
11
 
12
12
  /**
13
13
  * @notice Control flow anti-patterns in FHE development.
14
- * Demonstrates common mistakes when using conditional logic
15
- * and loops with encrypted values.
14
+ * Demonstrates mistakes with conditional logic and loops on encrypted
15
+ * values, providing correct vs incorrect implementations.
16
16
  *
17
- * @dev Covers 3 critical patterns: if/else branching, require statements,
18
- * and encrypted loop iterations.
19
- * Each shows ❌ WRONG and ✅ CORRECT implementations.
17
+ * @dev Covers if/else branching, require statements, and encrypted loops.
20
18
  */
21
19
  contract FHEControlFlowAntiPatterns is ZamaEthereumConfig {
22
20
  euint32 private _secretBalance;
@@ -11,11 +11,10 @@ import {ZamaEthereumConfig} from "@fhevm/solidity/config/ZamaConfig.sol";
11
11
 
12
12
  /**
13
13
  * @notice Operations, gas, and noise anti-patterns in FHE development.
14
- * Demonstrates performance issues, side-channel leaks, and
15
- * inefficient encrypted computation patterns.
14
+ * Covers performance issues, side-channel leaks, noise accumulation,
15
+ * and inefficient encrypted computation patterns.
16
16
  *
17
- * @dev Covers 4 patterns: gas/timing side channels, noise accumulation,
18
- * deprecated APIs, and type mismatches.
17
+ * @dev Explores timing side channels, noise, deprecated APIs, and type mismatches.
19
18
  */
20
19
  contract FHEOperationsGasNoiseAntiPatterns is ZamaEthereumConfig {
21
20
  euint32 private _secretValue;
@@ -117,16 +116,16 @@ contract FHEOperationsGasNoiseAntiPatterns is ZamaEthereumConfig {
117
116
  // ═══════════════════════════════════════════════════════════════════════
118
117
 
119
118
  /**
120
- * ❌ WRONG: Using old TFHE.decrypt() pattern
119
+ * ❌ WRONG: Using old FHE.decrypt() pattern
121
120
  * @dev Deprecated in FHEVM v0.9+
122
121
  */
123
122
  function wrongDeprecatedAPI() external pure returns (string memory) {
124
123
  // ❌ OLD (v0.8 and earlier):
125
- // TFHE.decrypt() - went through Zama Oracle
124
+ // FHE.decrypt() - went through Zama Oracle
126
125
  //
127
126
  // This pattern is deprecated and no longer supported
128
127
 
129
- return "Don't use TFHE.decrypt() - it's deprecated";
128
+ return "Don't use FHE.decrypt() - it's deprecated";
130
129
  }
131
130
 
132
131
  /**
@@ -6,12 +6,10 @@ import {ZamaEthereumConfig} from "@fhevm/solidity/config/ZamaConfig.sol";
6
6
 
7
7
  /**
8
8
  * @notice Permission management anti-patterns in FHE development.
9
- * Demonstrates common mistakes with allowThis, allow, and
10
- * permission propagation across transfers and contracts.
9
+ * Covers mistakes with allowThis, allow, and permission propagation
10
+ * across transfers and cross-contract calls.
11
11
  *
12
- * @dev Covers 6 critical patterns: missing allowThis, missing allow(user),
13
- * view functions without permissions, unauthenticated re-encryption,
14
- * transfer permission issues, and cross-contract delegation.
12
+ * @dev Explores missing permissions, view function failures, and delegation issues.
15
13
  */
16
14
  contract FHEPermissionsAntiPatterns is ZamaEthereumConfig {
17
15
  euint32 private _secretValue;
@@ -5,11 +5,9 @@ import {FHE, euint32, externalEuint32} from "@fhevm/solidity/lib/FHE.sol";
5
5
  import {ZamaEthereumConfig} from "@fhevm/solidity/config/ZamaConfig.sol";
6
6
 
7
7
  /**
8
- * @notice Master class for FHE permission patterns and access control.
9
- * Explains the three permission types: allow() for permanent access,
10
- * allowThis() for contract operations, and allowTransient() for
11
- * temporary cross-contract calls. Includes correct and incorrect
12
- * usage examples to prevent common decryption failures.
8
+ * @notice FHE permission patterns: allow() permanent, allowThis() contract,
9
+ * and allowTransient() temporary access. Demonstrates usage to
10
+ * prevent common decryption failures.
13
11
 
14
12
  * @dev allow() = permanent, allowThis() = contract permission,
15
13
  * allowTransient() = expires at TX end