Skip to main content
This guide covers deploying Oak Network smart contracts to various networks and environments.

📋 Table of Contents

🔧 Prerequisites

Required Software

  • Node.js 16+ and npm/yarn
  • Git for version control
  • Hardhat for smart contract development
  • Celo CLI for network interaction
  • MetaMask or compatible wallet

Required Accounts

  • Deployer Account - Account with CELO for gas fees
  • Admin Account - Account for protocol administration
  • Treasury Account - Account for protocol fees

🌍 Environment Setup

1. Clone Repository

2. Install Dependencies

3. Environment Configuration

Create environment files for different networks:

4. Configure Environment Variables

🏠 Local Development

1. Start Local Network

2. Deploy Script

🧪 Testnet Deployment

1. Get Testnet CELO

Visit the Celo Faucet to get testnet CELO.

2. Deploy to Alfajores

3. Test Deployment

🌐 Mainnet Deployment

1. Pre-deployment Checklist

  • All tests passing
  • Security audit completed
  • Gas optimization reviewed
  • Contract addresses documented
  • Emergency procedures defined
  • Multi-sig wallet configured

2. Deploy to Mainnet

3. Post-deployment Setup

✅ Verification

1. Contract Verification

2. Verification Script

⚙️ Configuration

1. Protocol Parameters

2. Access Control Setup

🔧 Troubleshooting

Common Issues

1. Insufficient Gas

2. Transaction Reverted

3. Verification Failed

Debug Script

📊 Deployment Checklist

Pre-deployment

  • Environment variables configured
  • Private keys secured
  • Gas estimates calculated
  • Constructor arguments prepared
  • Testnet deployment successful

During Deployment

  • Monitor gas usage
  • Record contract addresses
  • Verify constructor arguments
  • Check transaction confirmations

Post-deployment

  • Verify contracts on block explorer
  • Configure protocol parameters
  • Set up access control
  • Test contract functionality
  • Update documentation
  • Notify community

🔒 Security Considerations

Private Key Management

  • Use hardware wallets for mainnet deployments
  • Never commit private keys to version control
  • Use environment variables for sensitive data
  • Consider multi-sig wallets for admin functions

Contract Security

  • Verify all contracts on block explorer
  • Use proxy patterns for upgradeable contracts
  • Implement proper access control
  • Test emergency procedures

Network Security

  • Use official RPC endpoints
  • Verify network parameters
  • Monitor for suspicious activity
  • Keep deployment scripts secure

Need help? Check our Smart Contract Reference or join our Discord community.