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.