Skip to main content
This page provides an overview of all 35 contracts in the FHEVM Bootcamp curriculum.

Contracts by Module

Phase 1: Foundation (Modules 00-03)

Purpose: Solidity fundamentals reviewFeatures:
  • Basic storage variable
  • Getter and setter functions
  • Events
Key Learning: Standard Solidity patterns before FHEDeployed: 0x8B7D25a45890d214db56790ae59afaE72273c1D3 (Sepolia)
Purpose: ERC-20 fundamentals reviewFeatures:
  • Plaintext balances
  • Transfer function
  • Mint function
Key Learning: Understanding standard tokens before building confidential onesDeployed: 0x790f57EA01ec1f903645723D6990Eeaa2a36a814 (Sepolia)
Purpose: First encrypted contractFeatures:
  • Encrypted counter (euint32)
  • Increment function
  • Inherits ZamaEthereumConfig
Key Learning: Basic encrypted state and FHE.allowThis()Deployed: 0xbFd008661B7222Dd974074f986D1eb18dD4dF1F1 (Sepolia)
Purpose: Type system demonstrationFeatures:
  • All encrypted types (ebool, euint8-256, eaddress)
  • Type storage patterns
  • Type retrieval
Key Learning: Encrypted type declaration and storageDeployed: 0x56c52A3b621346DC47B7B2A4bE0230721EE48c12 (Sepolia)
Purpose: Type casting demonstrationFeatures:
  • Upcast (euint8 → euint32)
  • Downcast (euint32 → euint8)
  • Plaintext to encrypted conversion
Key Learning: FHE.asEuintXX() for type conversionDeployed: 0x11c8ebc9A95B2A1DA4155b167dadA9B5925dde8f (Sepolia)

Phase 2: Core (Modules 04-09)

Purpose: Arithmetic operations on encrypted valuesFeatures:
  • FHE.add, FHE.sub, FHE.mul
  • FHE.div, FHE.rem (plaintext divisor)
  • FHE.min, FHE.max, FHE.neg
Key Learning: All arithmetic FHE operationsDeployed: 0xB6D81352EA3Cd0426838B655D15097E0FaE80177 (Sepolia)
Purpose: Bitwise operationsFeatures:
  • FHE.and, FHE.or, FHE.xor, FHE.not
  • FHE.shl, FHE.shr (shift)
  • FHE.rotl, FHE.rotr (rotate)
Key Learning: Bitwise manipulation of encrypted valuesDeployed: 0xb0bd1D30eDfaAbA1fc02F7A917820fD9edB24438 (Sepolia)
Purpose: Comparison operationsFeatures:
  • FHE.eq, FHE.ne
  • FHE.gt, FHE.ge, FHE.lt, FHE.le
  • Returns ebool
Key Learning: Encrypted comparisons produce eboolDeployed: 0xB1141F0b2588aAb0C1fe819b1B6AF1C0a7564490 (Sepolia)
Purpose: Access Control List demonstrationFeatures:
  • FHE.allowThis()
  • FHE.allow(ciphertext, address)
  • FHE.isSenderAllowed()
Key Learning: ACL permission managementDeployed: 0xc4f08eB557DF912E3D1FdE79bf3465d5242ea53d (Sepolia)
Purpose: Per-user encrypted balancesFeatures:
  • mapping(address => euint64) balances
  • Deposit and withdraw
  • Per-user ACL
Key Learning: Multi-user encrypted state managementDeployed: 0xa988F5BFD7Fc19481Fdac5b55027b7Dc126a67e6 (Sepolia)
Purpose: Encrypted input handlingFeatures:
  • externalEuint32 input parameter
  • FHE.fromExternal(value, proof)
  • FHE.isInitialized() check
Key Learning: Client-to-contract encrypted input pipelineDeployed: 0x27d2b5247949606f913Db8c314EABB917fcffd96 (Sepolia)
Purpose: On-chain decryption patternFeatures:
  • FHE.makePubliclyDecryptable()
  • FHE.isPubliclyDecryptable()
  • Timed reveal
Key Learning: Public decryption for on-chain revealDeployed: 0x605002BbB689457101104e8Ee3C76a8d5D23e5c8 (Sepolia)
Purpose: User-specific decryption via ACLFeatures:
  • FHE.allow(ciphertext, user)
  • Client-side instance.userDecrypt()
  • Private balance viewing
Key Learning: Re-encryption for user-specific readsDeployed: 0x5E3ef9A91AD33270f84B32ACFF91068Eea44c5ee (Sepolia)
Purpose: FHE.select patternFeatures:
  • FHE.select(condition, valueIfTrue, valueIfFalse)
  • Nested selects
  • Boolean logic (FHE.and, FHE.or)
Key Learning: Branchless conditional logicDeployed: 0x0A206f2BC275012703BA262B9577ABC49A4f6782 (Sepolia)
Purpose: Min/max with FHE.selectFeatures:
  • FHE.gt comparison
  • FHE.select to choose min/max
  • Silent fail pattern
Key Learning: Implementing encrypted min/max logicDeployed: 0xbA5c38093CefBbFA08577b08b0494D5c7738E4F6 (Sepolia)
Purpose: On-chain encrypted randomnessFeatures:
  • FHE.randEuint32()
  • FHE.randEbool()
  • Bounded random (upperBound)
Key Learning: Generating encrypted random valuesDeployed: 0xe473aF953d269601402DEBcB2cc899aB594Ad31e (Sepolia)

Phase 3: Applications (Modules 10-13)

Purpose: Frontend integration demoFeatures:
  • Encrypted counter
  • Increment with encrypted input
  • Frontend with Relayer SDK
Key Learning: Client-side encryption with @zama-fhe/relayer-sdkDeployed: 0x17B6209385c2e36E6095b89572273175902547f9 (Sepolia)
Purpose: Confidential token standardFeatures:
  • Encrypted balances (euint64)
  • transfer() with silent fail
  • approve() and transferFrom()
  • ERC-7984 pattern
Key Learning: Building confidential tokensDeployed: 0x623b1653AB004661BC7832AC2930Eb42607C4013 (Sepolia)
Purpose: Encrypted voting with tally revealFeatures:
  • Encrypted votes (euint64)
  • Homomorphic tallying (FHE.add)
  • finalizeProposal() with decryption
  • Duplicate vote prevention
Key Learning: Privacy-preserving votingDeployed: 0xd80537D04652E1B4B591319d83812BbA6a9c1B14 (Sepolia)
Purpose: Alternative voting implementationFeatures:
  • Multiple candidates
  • Encrypted vote counts
  • Winner determination
Key Learning: Multi-candidate encrypted votingDeployed: 0x70Aa742C113218a12A6582f60155c2B299551A43 (Sepolia)
Purpose: First-price sealed-bid auctionFeatures:
  • Encrypted bids (euint64)
  • Winner determination with FHE.gt + FHE.select
  • Bid reveal after deadline
Key Learning: Encrypted bid comparisonDeployed: 0xC53c8E05661450919951f51E4da829a3AABD76A2 (Sepolia)
Purpose: Auction with selective revealFeatures:
  • Encrypted bids
  • Only winning bid revealed
  • Losing bids remain encrypted
Key Learning: Selective decryption patternsDeployed: 0x8F1ae8209156C22dFD972352A415880040fB0b0c (Sepolia)
Purpose: Confidential marketplaceFeatures:
  • Encrypted prices
  • Encrypted inventory
  • Purchase with encrypted amounts
Key Learning: Multi-party encrypted commerceDeployed: 0x1E44074dF559E4f46De367ddbA0793fC710DB3a7 (Sepolia)
Purpose: On-chain lottery with encrypted randomnessFeatures:
  • FHE.randEuint32() for winner selection
  • Encrypted ticket numbers
  • Prize pool
Key Learning: Randomness in gamesDeployed: 0x32D3012EEE7e14175CA24Fc8e8dAb5b1Cebf929e (Sepolia)

Phase 4: Mastery (Modules 14-18)

Purpose: Testing patterns for FHEFeatures:
  • Mock mode setup
  • createEncryptedInput helpers
  • Silent failure test patterns
Key Learning: FHE contract testing strategiesDeployed: 0xfa2a63616aDe3E5BE4abFEdAF8E58780eaF0feE9 (Sepolia)
Purpose: Gas optimization techniquesFeatures:
  • Plaintext operands (FHE.add(enc, plaintext))
  • Type selection (euint8 vs euint32)
  • Batch operations
Key Learning: Reducing FHE gas costsDeployed: 0x86daECb1Cc9Ce4862A8baFaF1f01aBe979a9b582 (Sepolia)
Purpose: Gas cost measurementFeatures:
  • Benchmark functions for all operation types
  • Cost comparison across types
  • Gas reporting
Key Learning: Understanding FHE operation costsDeployed: 0x76da41a5bD46F428E32E79a081065697C5151693 (Sepolia)
Purpose: Security best practicesFeatures:
  • Constant-gas patterns
  • FHE.isInitialized() checks
  • LastError pattern
  • No-revert patterns
Key Learning: Secure FHE contract designDeployed: 0x59f51Da1Df210745bf64aABA55D1b874B26001f2 (Sepolia)
Purpose: Common vulnerabilities (educational)Features:
  • Intentional bugs for learning
  • Missing ACL
  • Information leakage examples
Key Learning: What NOT to do in FHE contractsDeployed: 0x5AC6485D93CD0b90A7cF94eC706ef6e70DAEB778 (Sepolia)
Purpose: State machines with encrypted transitionsFeatures:
  • 4 states with encrypted thresholds
  • FHE.ge for threshold checks
  • FHE.select for state transitions
Key Learning: Advanced design patternsDeployed: 0x17259782D5dB2C13a8A385211f8BE6b1001d0378 (Sepolia)
Purpose: Encrypted error reportingFeatures:
  • Per-user encrypted error codes
  • No information leakage from errors
  • Error checking without reverts
Key Learning: Encrypted feedback mechanismsDeployed: 0x7f12c6D6b13C1E985D0efD1d79873c3e7F9c6c41 (Sepolia)
Purpose: Per-user private data storesFeatures:
  • mapping(address => mapping(bytes32 => euint64))
  • Encrypted key-value storage
  • Cross-contract ACL
Key Learning: Complex encrypted data structuresDeployed: 0xBF472B66b331303d9d7dF83195F7C355E332E137 (Sepolia)
Purpose: Confidential DeFi lendingFeatures:
  • Encrypted collateral deposits
  • 50% LTV check with FHE.ge + FHE.select
  • Encrypted borrow amounts
Key Learning: Confidential DeFi primitivesDeployed: 0x8B5526092F6a230E23651f0Eb559fd758C42967A (Sepolia)
Purpose: Confidential order matchingFeatures:
  • Encrypted limit orders
  • Encrypted price/amount fields
  • Order matching with FHE.ge
Key Learning: MEV-protected tradingDeployed: 0xB0fcA1f21d598006c5Bd327c44140a3471787E82 (Sepolia)

Phase 5: Capstone (Module 19)

Purpose: Capstone project demonstrating all conceptsFeatures:
  • 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
Integrates:
  • Modules 03-18: All encrypted types, operations, ACL, inputs, decryption, conditionals, randomness, frontend, testing, gas optimization, security, advanced patterns, DeFi
Key Learning: Building production-grade confidential applicationsDeployed: 0x6C41b7E9b4e8fe2366Ba842f04E975ed7a4e9d72 (Sepolia)

Summary Statistics

Total Contracts

35 contracts across 20 modules

Total Tests

328 tests (all passing)

Network

All deployed to Ethereum Sepolia testnet

Test Coverage

95%+ line coverage

Contract Categories

By Complexity

LevelCountExamples
Beginner8SimpleStorage, HelloFHEVM, EncryptedTypes
Intermediate13ACLDemo, ConditionalDemo, RandomDemo
Advanced10ConfidentialERC20, ConfidentialVoting, SealedBidAuction
Expert4ConfidentialLending, EncryptedOrderBook, ConfidentialDAO

By Concept

ConceptContracts
OperationsArithmeticOps, BitwiseOps, ComparisonOps
ACLACLDemo, MultiUserVault, UserDecrypt
InputsSecureInput, SimpleCounter
DecryptionPublicDecrypt, UserDecrypt
ConditionalsConditionalDemo, EncryptedMinMax
RandomnessRandomDemo, EncryptedLottery
TokensConfidentialERC20, SecurityPatterns
VotingConfidentialVoting, PrivateVoting
AuctionsSealedBidAuction, RevealableAuction
DeFiConfidentialLending, EncryptedOrderBook
GovernanceConfidentialDAO

Interactive Explorer

Explore all deployed contracts on Sepolia Etherscan: View Full Deployment Report

Build docs developers (and LLMs) love