Contracts by Module
Phase 1: Foundation (Modules 00-03)
01. SimpleStorage (Module 00)
01. SimpleStorage (Module 00)
- Basic storage variable
- Getter and setter functions
- Events
0x8B7D25a45890d214db56790ae59afaE72273c1D3 (Sepolia)02. BasicToken (Module 00)
02. BasicToken (Module 00)
- Plaintext balances
- Transfer function
- Mint function
0x790f57EA01ec1f903645723D6990Eeaa2a36a814 (Sepolia)03. HelloFHEVM (Module 02)
03. HelloFHEVM (Module 02)
- Encrypted counter (
euint32) - Increment function
- Inherits
ZamaEthereumConfig
0xbFd008661B7222Dd974074f986D1eb18dD4dF1F1 (Sepolia)04. EncryptedTypes (Module 03)
04. EncryptedTypes (Module 03)
- All encrypted types (ebool, euint8-256, eaddress)
- Type storage patterns
- Type retrieval
0x56c52A3b621346DC47B7B2A4bE0230721EE48c12 (Sepolia)05. TypeConversions (Module 03)
05. TypeConversions (Module 03)
- Upcast (euint8 → euint32)
- Downcast (euint32 → euint8)
- Plaintext to encrypted conversion
0x11c8ebc9A95B2A1DA4155b167dadA9B5925dde8f (Sepolia)Phase 2: Core (Modules 04-09)
06. ArithmeticOps (Module 04)
06. ArithmeticOps (Module 04)
- FHE.add, FHE.sub, FHE.mul
- FHE.div, FHE.rem (plaintext divisor)
- FHE.min, FHE.max, FHE.neg
0xB6D81352EA3Cd0426838B655D15097E0FaE80177 (Sepolia)07. BitwiseOps (Module 04)
07. BitwiseOps (Module 04)
- FHE.and, FHE.or, FHE.xor, FHE.not
- FHE.shl, FHE.shr (shift)
- FHE.rotl, FHE.rotr (rotate)
0xb0bd1D30eDfaAbA1fc02F7A917820fD9edB24438 (Sepolia)08. ComparisonOps (Module 04)
08. ComparisonOps (Module 04)
- FHE.eq, FHE.ne
- FHE.gt, FHE.ge, FHE.lt, FHE.le
- Returns ebool
0xB1141F0b2588aAb0C1fe819b1B6AF1C0a7564490 (Sepolia)09. ACLDemo (Module 05)
09. ACLDemo (Module 05)
- FHE.allowThis()
- FHE.allow(ciphertext, address)
- FHE.isSenderAllowed()
0xc4f08eB557DF912E3D1FdE79bf3465d5242ea53d (Sepolia)10. MultiUserVault (Module 05)
10. MultiUserVault (Module 05)
- mapping(address => euint64) balances
- Deposit and withdraw
- Per-user ACL
0xa988F5BFD7Fc19481Fdac5b55027b7Dc126a67e6 (Sepolia)11. SecureInput (Module 06)
11. SecureInput (Module 06)
- externalEuint32 input parameter
- FHE.fromExternal(value, proof)
- FHE.isInitialized() check
0x27d2b5247949606f913Db8c314EABB917fcffd96 (Sepolia)12. PublicDecrypt (Module 07)
12. PublicDecrypt (Module 07)
- FHE.makePubliclyDecryptable()
- FHE.isPubliclyDecryptable()
- Timed reveal
0x605002BbB689457101104e8Ee3C76a8d5D23e5c8 (Sepolia)13. UserDecrypt (Module 07)
13. UserDecrypt (Module 07)
- FHE.allow(ciphertext, user)
- Client-side instance.userDecrypt()
- Private balance viewing
0x5E3ef9A91AD33270f84B32ACFF91068Eea44c5ee (Sepolia)14. ConditionalDemo (Module 08)
14. ConditionalDemo (Module 08)
- FHE.select(condition, valueIfTrue, valueIfFalse)
- Nested selects
- Boolean logic (FHE.and, FHE.or)
0x0A206f2BC275012703BA262B9577ABC49A4f6782 (Sepolia)15. EncryptedMinMax (Module 08)
15. EncryptedMinMax (Module 08)
- FHE.gt comparison
- FHE.select to choose min/max
- Silent fail pattern
0xbA5c38093CefBbFA08577b08b0494D5c7738E4F6 (Sepolia)16. RandomDemo (Module 09)
16. RandomDemo (Module 09)
- FHE.randEuint32()
- FHE.randEbool()
- Bounded random (upperBound)
0xe473aF953d269601402DEBcB2cc899aB594Ad31e (Sepolia)Phase 3: Applications (Modules 10-13)
17. SimpleCounter (Module 10)
17. SimpleCounter (Module 10)
- Encrypted counter
- Increment with encrypted input
- Frontend with Relayer SDK
0x17B6209385c2e36E6095b89572273175902547f9 (Sepolia)18. ConfidentialERC20 (Module 11)
18. ConfidentialERC20 (Module 11)
- Encrypted balances (euint64)
- transfer() with silent fail
- approve() and transferFrom()
- ERC-7984 pattern
0x623b1653AB004661BC7832AC2930Eb42607C4013 (Sepolia)19. ConfidentialVoting (Module 12)
19. ConfidentialVoting (Module 12)
- Encrypted votes (euint64)
- Homomorphic tallying (FHE.add)
- finalizeProposal() with decryption
- Duplicate vote prevention
0xd80537D04652E1B4B591319d83812BbA6a9c1B14 (Sepolia)20. PrivateVoting (Module 12)
20. PrivateVoting (Module 12)
- Multiple candidates
- Encrypted vote counts
- Winner determination
0x70Aa742C113218a12A6582f60155c2B299551A43 (Sepolia)21. SealedBidAuction (Module 13)
21. SealedBidAuction (Module 13)
- Encrypted bids (euint64)
- Winner determination with FHE.gt + FHE.select
- Bid reveal after deadline
0xC53c8E05661450919951f51E4da829a3AABD76A2 (Sepolia)22. RevealableAuction (Module 13)
22. RevealableAuction (Module 13)
- Encrypted bids
- Only winning bid revealed
- Losing bids remain encrypted
0x8F1ae8209156C22dFD972352A415880040fB0b0c (Sepolia)23. EncryptedMarketplace (Module 13)
23. EncryptedMarketplace (Module 13)
- Encrypted prices
- Encrypted inventory
- Purchase with encrypted amounts
0x1E44074dF559E4f46De367ddbA0793fC710DB3a7 (Sepolia)24. EncryptedLottery (Module 09)
24. EncryptedLottery (Module 09)
- FHE.randEuint32() for winner selection
- Encrypted ticket numbers
- Prize pool
0x32D3012EEE7e14175CA24Fc8e8dAb5b1Cebf929e (Sepolia)Phase 4: Mastery (Modules 14-18)
25. TestableVault (Module 14)
25. TestableVault (Module 14)
- Mock mode setup
- createEncryptedInput helpers
- Silent failure test patterns
0xfa2a63616aDe3E5BE4abFEdAF8E58780eaF0feE9 (Sepolia)26. GasOptimized (Module 15)
26. GasOptimized (Module 15)
- Plaintext operands (FHE.add(enc, plaintext))
- Type selection (euint8 vs euint32)
- Batch operations
0x86daECb1Cc9Ce4862A8baFaF1f01aBe979a9b582 (Sepolia)27. GasBenchmark (Module 15)
27. GasBenchmark (Module 15)
- Benchmark functions for all operation types
- Cost comparison across types
- Gas reporting
0x76da41a5bD46F428E32E79a081065697C5151693 (Sepolia)28. SecurityPatterns (Module 16)
28. SecurityPatterns (Module 16)
- Constant-gas patterns
- FHE.isInitialized() checks
- LastError pattern
- No-revert patterns
0x59f51Da1Df210745bf64aABA55D1b874B26001f2 (Sepolia)29. VulnerableDemo (Module 16)
29. VulnerableDemo (Module 16)
- Intentional bugs for learning
- Missing ACL
- Information leakage examples
0x5AC6485D93CD0b90A7cF94eC706ef6e70DAEB778 (Sepolia)30. EncryptedStateMachine (Module 17)
30. EncryptedStateMachine (Module 17)
- 4 states with encrypted thresholds
- FHE.ge for threshold checks
- FHE.select for state transitions
0x17259782D5dB2C13a8A385211f8BE6b1001d0378 (Sepolia)31. LastErrorPattern (Module 17)
31. LastErrorPattern (Module 17)
- Per-user encrypted error codes
- No information leakage from errors
- Error checking without reverts
0x7f12c6D6b13C1E985D0efD1d79873c3e7F9c6c41 (Sepolia)32. EncryptedRegistry (Module 17)
32. EncryptedRegistry (Module 17)
- mapping(address => mapping(bytes32 => euint64))
- Encrypted key-value storage
- Cross-contract ACL
0xBF472B66b331303d9d7dF83195F7C355E332E137 (Sepolia)33. ConfidentialLending (Module 18)
33. ConfidentialLending (Module 18)
- Encrypted collateral deposits
- 50% LTV check with FHE.ge + FHE.select
- Encrypted borrow amounts
0x8B5526092F6a230E23651f0Eb559fd758C42967A (Sepolia)34. EncryptedOrderBook (Module 18)
34. EncryptedOrderBook (Module 18)
- Encrypted limit orders
- Encrypted price/amount fields
- Order matching with FHE.ge
0xB0fcA1f21d598006c5Bd327c44140a3471787E82 (Sepolia)Phase 5: Capstone (Module 19)
35. ConfidentialDAO (Module 19)
35. ConfidentialDAO (Module 19)
- Encrypted governance token (euint64 balances)
- Encrypted voting (yesVotes, noVotes)
- Private treasury management
- Proposal creation and execution
- Delegation support
- LastError pattern
- Full lifecycle: mint → propose → vote → finalize → execute
- Modules 03-18: All encrypted types, operations, ACL, inputs, decryption, conditionals, randomness, frontend, testing, gas optimization, security, advanced patterns, DeFi
0x6C41b7E9b4e8fe2366Ba842f04E975ed7a4e9d72 (Sepolia)Summary Statistics
Total Contracts
Total Tests
Network
Test Coverage
Contract Categories
By Complexity
| Level | Count | Examples |
|---|---|---|
| Beginner | 8 | SimpleStorage, HelloFHEVM, EncryptedTypes |
| Intermediate | 13 | ACLDemo, ConditionalDemo, RandomDemo |
| Advanced | 10 | ConfidentialERC20, ConfidentialVoting, SealedBidAuction |
| Expert | 4 | ConfidentialLending, EncryptedOrderBook, ConfidentialDAO |
By Concept
| Concept | Contracts |
|---|---|
| Operations | ArithmeticOps, BitwiseOps, ComparisonOps |
| ACL | ACLDemo, MultiUserVault, UserDecrypt |
| Inputs | SecureInput, SimpleCounter |
| Decryption | PublicDecrypt, UserDecrypt |
| Conditionals | ConditionalDemo, EncryptedMinMax |
| Randomness | RandomDemo, EncryptedLottery |
| Tokens | ConfidentialERC20, SecurityPatterns |
| Voting | ConfidentialVoting, PrivateVoting |
| Auctions | SealedBidAuction, RevealableAuction |
| DeFi | ConfidentialLending, EncryptedOrderBook |
| Governance | ConfidentialDAO |