Deploying to Sepolia Testnet
This guide walks you through deploying your fhEVM contracts to the Ethereum Sepolia testnet, where they can interact with Zama’s fhEVM coprocessor.Prerequisites
Get Sepolia ETH
You’ll need Sepolia ETH for gas fees. Get free testnet ETH from:Recommended: At least 0.5 ETH for deploying multiple contracts.
Deployment Script
Create a deployment script atscripts/deploy-sepolia.ts:
scripts/deploy-sepolia.ts
Deploy Your Contracts
Save the deployed addresses
Create a file to store your deployed contract addresses:
deployments/sepolia.json
Deploy All Contracts
For a complete deployment of all bootcamp contracts, use the comprehensive script:scripts/deploy-all.ts
Network Information
Ethereum Sepolia
- Chain ID: 11155111
- RPC URL: https://ethereum-sepolia-rpc.publicnode.com
- Block Explorer: https://sepolia.etherscan.io
Zama fhEVM Coprocessor Addresses
These are automatically configured by@fhevm/solidity:
- ACL Contract:
0xf0Ffdc93b7E186bC2f8CB3dAA75D86d1930A433D - KMS Contract:
0xbE0E383937d564D7FF0BC3b46c51f0bF8d5C311A - Input Verifier:
0xBBC1fFCdc7C316aAAd72E807D9b0272BE8F84DA0 - Gateway Chain ID: 10901
Post-Deployment Testing
After deployment, verify your contracts work on-chain:Test with Hardhat Console
Verify FHE Operations
For FHE contracts, you’ll need to use the Relayer SDK from a frontend. See the Frontend Integration guide.Troubleshooting
Deployment fails with 'insufficient funds'
Deployment fails with 'insufficient funds'
Cause: Not enough Sepolia ETH for gas fees.Solution: Get more testnet ETH from a faucet. Each deployment costs approximately:
- Simple contracts: ~0.001-0.005 ETH
- Complex FHE contracts: ~0.01-0.03 ETH
- Full 35-contract deployment: ~0.3-0.5 ETH
Deployment succeeds but contract doesn't work
Deployment succeeds but contract doesn't work
Cause: Contract may not be inheriting from
ZamaEthereumConfig.Solution: Ensure your FHE contracts inherit from the correct config:Transaction reverts with 'invalid proof'
Transaction reverts with 'invalid proof'
Cause: Encrypted input was created for the wrong network or contract address.Solution: Ensure frontend uses the correct:
- Contract address (from your deployment)
- Chain ID (11155111 for Sepolia)
- Relayer URL (
https://gateway.zama.ai)
Etherscan verification fails
Etherscan verification fails
Cause: Constructor arguments not provided correctly.Solution: For contracts with constructor args, provide them in order:
Cost Estimation
Based on on-chain deployment data:| Contract Type | Approx. Gas Cost | At 50 gwei |
|---|---|---|
| SimpleStorage | ~200,000 | ~0.01 ETH |
| HelloFHEVM | ~1,500,000 | ~0.075 ETH |
| ConfidentialERC20 | ~2,000,000 | ~0.10 ETH |
| SealedBidAuction | ~2,500,000 | ~0.125 ETH |
| ConfidentialDAO | ~3,000,000 | ~0.15 ETH |
Gas costs vary based on network congestion. Check current gas prices at Sepolia Gas Tracker.
Next Steps
Frontend Integration
Connect a React frontend to your deployed contracts
Testing FHE Contracts
Write comprehensive tests before deploying