Deployment Guide
Prerequisites
Foundry installed (
foundryup)RPC URL for target network
Private key with sufficient ETH for gas
SP1 Verifier contract address (or deploy your own)
Network Configuration
Supported Networks
Ethereum Mainnet
1
TBD
Sepolia Testnet
11155111
TBD
Base Mainnet
8453
TBD
Base Sepolia
84532
TBD
Optimism
10
TBD
Arbitrum One
42161
TBD
Note: Check SP1 Contracts Deployments for latest verifier addresses.
Environment Setup
Create .env File
.env FileLoad Environment
Deployment Steps
1. Compile Contracts
Verify compilation succeeds:
2. Deploy SP1 Verifier (Optional)
If you need to deploy your own SP1 verifier:
3. Create Deployment Script
Create script/DeployGelap.s.sol:
4. Run Deployment
Dry Run (Simulation)
Actual Deployment
5. Verify Deployment
Check the deployment output:
6. Verify on Etherscan
If auto-verification fails, manually verify:
Post-Deployment Configuration
1. Save Deployment Info
Create deployments.json:
2. Test Deployment
Create a test script to verify contract functionality:
3. Initialize Monitoring
Set up event monitoring:
Upgrade Strategy
Current Contract (Non-Upgradeable)
The current GelapShieldedAccount is not upgradeable. To upgrade:
Deploy new contract version
Migrate state (if possible)
Update frontend/prover to use new address
Future: Upgradeable Pattern
Consider implementing UUPS or Transparent Proxy pattern:
Security Checklist
Before mainnet deployment:
Gas Optimization
Deployment Gas Costs
Approximate gas costs:
Ethereum Mainnet
30 gwei
~0.15 ETH
Base
0.001 gwei
~$0.50
Optimism
0.001 gwei
~$0.50
Arbitrum
0.1 gwei
~$5
Optimization Tips
Compiler Settings:
Deployment Parameters:
Troubleshooting
Common Deployment Issues
Issue: "Insufficient funds for gas"
Issue: "Nonce too low"
Issue: "Contract verification failed"
Issue: "SP1 Verifier not found"
Multi-Network Deployment
Deploy to Multiple Networks
Create deploy-all.sh:
Monitoring and Maintenance
Set Up Alerts
Use services like:
Tenderly for transaction monitoring
OpenZeppelin Defender for security monitoring
The Graph for indexing events
Regular Checks
Monitor contract balance
Track nullifier usage
Check Merkle tree growth
Monitor gas costs
Review unusual transactions
Rollback Plan
If issues are discovered:
Pause Operations (if pause mechanism exists)
Notify Users via official channels
Investigate Issue with security team
Deploy Fix to testnet first
Migrate State if necessary
Resume Operations after verification
Next Steps
After deployment:
✅ Deploy contract
✅ Verify on block explorer
✅ Test basic functionality
🔲 Deploy prover service
🔲 Deploy frontend
🔲 Set up monitoring
🔲 Announce to community
🔲 Launch bug bounty
Resources
Last updated