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

Network
Chain ID
SP1 Verifier Address

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 Deploymentsarrow-up-right for latest verifier addresses.

Environment Setup

Create .env File

Load 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:

  1. Deploy new contract version

  2. Migrate state (if possible)

  3. 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:

Network
Gas Price
Deployment Cost

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

  1. Compiler Settings:

  1. 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:

  1. Pause Operations (if pause mechanism exists)

  2. Notify Users via official channels

  3. Investigate Issue with security team

  4. Deploy Fix to testnet first

  5. Migrate State if necessary

  6. Resume Operations after verification

Next Steps

After deployment:

  1. ✅ Deploy contract

  2. ✅ Verify on block explorer

  3. ✅ Test basic functionality

  4. 🔲 Deploy prover service

  5. 🔲 Deploy frontend

  6. 🔲 Set up monitoring

  7. 🔲 Announce to community

  8. 🔲 Launch bug bounty

Resources

Last updated