Skip to main content

Overview

This guide provides comprehensive instructions for deploying the ZKScore Identity SBT contract to various networks. It covers deployment preparation, configuration, execution, and verification.
Always test your deployment on testnet before deploying to mainnet. Use the testnet deployment addresses provided in the Contract Overview section.

Prerequisites

Required Tools

  1. Node.js: Version 16 or higher
  2. npm/yarn: Package manager
  3. Hardhat/Foundry: Development framework
  4. MetaMask: Wallet for deployment
  5. Etherscan API Key: For contract verification

Environment Setup

Deployment Configuration

Network Configuration

Environment Variables

Contract Deployment

Deployment Script

Deployment Commands

Contract Verification

Automatic Verification

Manual Verification

Deployment Verification

Contract Verification Script

Network-Specific Deployment

Ethereum Mainnet

Polygon

Arbitrum

Deployment Checklist

Pre-Deployment

  • Test on testnet
  • Verify contract code
  • Check gas estimates
  • Prepare deployment script
  • Set up environment variables
  • Backup private keys

During Deployment

  • Monitor gas prices
  • Check network status
  • Verify transaction status
  • Save deployment addresses
  • Record transaction hashes

Post-Deployment

  • Verify contract on explorer
  • Test basic functions
  • Grant necessary roles
  • Update documentation
  • Notify team members

Troubleshooting

Common Issues

Gas Limit Exceeded

Verification Failed

Network Connection Issues

Error Handling

Best Practices

Security

  1. Use Hardware Wallets: Use hardware wallets for deployment
  2. Secure Private Keys: Store private keys securely
  3. Test on Testnet: Always test on testnet first
  4. Verify Contracts: Verify contracts on explorers
  5. Monitor Deployments: Monitor deployment transactions

Performance

  1. Optimize Gas: Use gas optimization techniques
  2. Batch Operations: Batch multiple operations
  3. Monitor Gas Prices: Deploy during low gas periods
  4. Use Efficient Networks: Choose appropriate networks
  5. Monitor Performance: Monitor contract performance

Maintenance

  1. Regular Updates: Keep dependencies updated
  2. Monitor Events: Monitor contract events
  3. Backup Data: Backup important data
  4. Document Changes: Document all changes
  5. Version Control: Use version control for deployments