Skip to content

CR8 Token Testnet Deployment Guide

Prerequisites

Before deploying to testnet, you need:

  1. Testnet ETH - Get Sepolia ETH from a faucet:

  2. Private Key - Your wallet's private key (keep this secure!)

  3. Etherscan API Key (optional, for contract verification):

Setup

  1. Create a .env file in the project root:
bash
# Network RPC URLs
# Recommended: Use Alchemy or Infura for better reliability
# Get free API keys at:
# - Alchemy: https://www.alchemy.com/
# - Infura: https://www.infura.io/

# Option 1: Alchemy (Recommended)
SEPOLIA_RPC_URL=https://eth-sepolia.g.alchemy.com/v2/YOUR_ALCHEMY_API_KEY

# Option 2: Infura
# SEPOLIA_RPC_URL=https://sepolia.infura.io/v3/YOUR_INFURA_PROJECT_ID

# Option 3: Public RPC (less reliable)
# SEPOLIA_RPC_URL=https://ethereum-sepolia-rpc.publicnode.com

# Private Key (NEVER commit this to git!)
PRIVATE_KEY=your_private_key_here_without_0x_prefix

# Etherscan API Key (for contract verification)
ETHERSCAN_API_KEY=your_etherscan_api_key_here
  1. Fill in your values:
    • PRIVATE_KEY: Your wallet's private key (without 0x prefix)
    • SEPOLIA_RPC_URL: Can use public RPC or your own provider
    • ETHERSCAN_API_KEY: Optional, but recommended for verification

Deployment Steps

Step 1: Verify Setup

Check your account balance:

bash
# This will show your deployer address balance
npx hardhat run scripts/deploy.js --network sepolia --dry-run

Step 2: Deploy to Sepolia Testnet

bash
npm run deploy:sepolia

This will deploy:

  • CR8Token (upgradeable proxy) - 1.665 billion tokens (15% of max)
  • CR8Staking contract
  • AgentDeposit contract

After deployment, verify on Etherscan:

bash
# Verify CR8Token implementation
npx hardhat verify --network sepolia <IMPLEMENTATION_ADDRESS>

# Verify CR8Staking
npx hardhat verify --network sepolia <STAKING_ADDRESS> <TOKEN_ADDRESS>

# Verify AgentDeposit
npx hardhat verify --network sepolia <AGENT_DEPOSIT_ADDRESS> <TOKEN_ADDRESS> <STAKING_ADDRESS>

Step 4: Test the Deployment

Run the simulation script to test the contracts:

bash
npm run simulate:testnet

Deployment Costs

Estimated gas costs on Sepolia:

  • CR8Token (proxy): ~2-3M gas
  • CR8Staking: ~1-2M gas
  • AgentDeposit: ~1-2M gas
  • Ownership transfer: ~50k gas

Total: ~4-7M gas (varies with network conditions)

Security Reminders

⚠️ IMPORTANT:

  • Never commit your .env file to git
  • Never share your private key
  • Use a dedicated wallet for testnet deployments
  • Verify all contract addresses after deployment
  • Keep your deployment addresses safe

Troubleshooting

"Insufficient funds"

  • Get more Sepolia ETH from a faucet

"Nonce too high"

  • Reset your wallet nonce or wait a bit

"Contract verification failed"

  • Check that all constructor arguments are correct
  • Make sure the contract code matches exactly

Next Steps After Deployment

  1. Save deployment addresses from deployments/sepolia.json
  2. Share contract addresses with your team
  3. Test all functionality on testnet
  4. Run simulation script to verify everything works
  5. Prepare for mainnet deployment after thorough testing

CR8 Platform Documentation