# Mainnet Deployment Prioritized Report

## 📋 Remaining Smart Contracts for Ethereum Mainnet

### Total: 3 Contracts

---

### 1. CCIPLogger
- **Contract**: `contracts/ccip-integration/CCIPLogger.sol`
- **Type**: Ethereum receiver for CCIP messages
- **Framework**: Hardhat
- **Deployment Script**: `scripts/ccip-deployment/deploy-ccip-logger.js`
- **Command**: `npx hardhat run scripts/ccip-deployment/deploy-ccip-logger.js --network mainnet`
- **Estimated Gas**: ~2,500,000 units
- **Estimated Cost**: ~0.00068 ETH (at current gas prices: ~0.27 Gwei)
- **Dependencies**: None
- **Priority**: 1 (Can deploy independently)

**Status:**
- ✅ Contract code complete
- ✅ Compilation: Ready (Hardhat)
- ✅ Tests: Integration tests available
- ⏳ Deployment: Pending

---

### 2. CCIPWETH9Bridge
- **Contract**: `contracts/ccip/CCIPWETH9Bridge.sol`
- **Type**: Cross-chain WETH9 bridge
- **Framework**: Foundry
- **Deployment Script**: `script/DeployCCIPWETH9Bridge.s.sol`
- **Command**: `forge script script/DeployCCIPWETH9Bridge.s.sol --rpc-url $ETHEREUM_MAINNET_RPC --broadcast --private-key $PRIVATE_KEY`
- **Estimated Gas**: ~1,800,000 units
- **Estimated Cost**: ~0.00049 ETH (at current gas prices: ~0.27 Gwei)
- **Dependencies**: CCIPRouter (must be deployed/configured first)
- **Priority**: 2 (After CCIPRouter)

**Status:**
- ✅ Contract code complete
- ✅ Compilation: Ready (Foundry)
- ✅ Tests: Unit tests available
- ⏳ Deployment: Pending

---

### 3. CCIPWETH10Bridge
- **Contract**: `contracts/ccip/CCIPWETH10Bridge.sol`
- **Type**: Cross-chain WETH10 bridge
- **Framework**: Foundry
- **Deployment Script**: `script/DeployCCIPWETH10Bridge.s.sol`
- **Command**: `forge script script/DeployCCIPWETH10Bridge.s.sol --rpc-url $ETHEREUM_MAINNET_RPC --broadcast --private-key $PRIVATE_KEY`
- **Estimated Gas**: ~1,800,000 units
- **Estimated Cost**: ~0.00049 ETH (at current gas prices: ~0.27 Gwei)
- **Dependencies**: CCIPRouter (must be deployed/configured first)
- **Priority**: 3 (After CCIPRouter)

**Status:**
- ✅ Contract code complete
- ✅ Compilation: Ready (Foundry)
- ✅ Tests: Unit tests available
- ⏳ Deployment: Pending

---

## 📊 Current Gas Prices (Real-Time from Etherscan)

**Last Updated**: $(date +"%Y-%m-%d %H:%M:%S")

- **Safe (Low)**: ~0.10 Gwei
- **Standard**: ~0.11 Gwei
- **Fast (High)**: ~0.12 Gwei
- **Recommended (2.5x highest)**: ~0.27 Gwei

*Note: Gas prices are fetched in real-time from Etherscan API*

---

## 💰 Deployment Cost Analysis

### Current Wallet Status
- **Wallet Address**: `0x4A666F96fC8764181194447A7dFdb7d471b301C8`
- **Current Balance**: 0.00253 ETH
- **Total Estimated Cost**: ~0.00166 ETH (all 3 contracts)
- **Remaining After Deployment**: ~0.00087 ETH

### Cost Breakdown (at ~0.27 Gwei)
1. **CCIPLogger**: ~0.00068 ETH
2. **CCIPWETH9Bridge**: ~0.00049 ETH
3. **CCIPWETH10Bridge**: ~0.00049 ETH

**Total**: ~0.00166 ETH

---

## 🎯 Prioritization Based on Wallet Balance

### ✅ All Contracts Can Be Deployed

With current balance of **0.00253 ETH**, all 3 contracts can be deployed:

**Recommended Deployment Order:**
1. **CCIPLogger** (Priority 1)
   - Cost: ~0.00068 ETH
   - No dependencies
   - Remaining after: ~0.00185 ETH

2. **CCIPWETH9Bridge** (Priority 2)
   - Cost: ~0.00049 ETH
   - Requires: CCIPRouter
   - Remaining after: ~0.00136 ETH

3. **CCIPWETH10Bridge** (Priority 3)
   - Cost: ~0.00049 ETH
   - Requires: CCIPRouter
   - Remaining after: ~0.00087 ETH

---

## ⚠️ Important Notes

### Predeployed Contracts (No Deployment Needed)
- **WETH9**: `0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2` (canonical Mainnet address)
- **WETH10**: `0xf4BB2e28688e89fCcE3c0580D37d36A7672E8A9f` (canonical Mainnet address)

### CCIPRouter Requirement
- Bridge contracts require CCIPRouter to be deployed/configured
- Using Chainlink's official router: `0x80226fc0Ee2b096224EeAc085Bb9a8cba1146f7D`
- Verify router is accessible before deploying bridges

---

## 📝 Next Steps

1. **Compile Contracts**:
   ```bash
   ./scripts/deployment/compile-test-mainnet-contracts.sh
   ```

2. **Check Gas Prices**:
   ```bash
   ./scripts/deployment/get-mainnet-gas-prices.sh
   ```

3. **Calculate Costs**:
   ```bash
   ./scripts/deployment/calculate-accurate-deployment-costs.sh
   ```

4. **Deploy in Priority Order**:
   ```bash
   # 1. Deploy CCIPLogger
   npx hardhat run scripts/ccip-deployment/deploy-ccip-logger.js --network mainnet
   
   # 2. Deploy CCIPWETH9Bridge (after CCIPRouter configured)
   forge script script/DeployCCIPWETH9Bridge.s.sol --rpc-url $ETHEREUM_MAINNET_RPC --broadcast --private-key $PRIVATE_KEY
   
   # 3. Deploy CCIPWETH10Bridge (after CCIPRouter configured)
   forge script script/DeployCCIPWETH10Bridge.s.sol --rpc-url $ETHEREUM_MAINNET_RPC --broadcast --private-key $PRIVATE_KEY
   ```

5. **Verify Contracts**:
   - Verify on Etherscan after deployment
   - Update `.env` with contract addresses
   - Configure bridge destinations

---

## ✅ Summary

- **Total Contracts**: 3
- **Total Cost**: ~0.00166 ETH
- **Wallet Balance**: 0.00253 ETH
- **Status**: ✅ **Sufficient funds for all deployments**
- **Recommended Action**: Deploy all contracts in priority order
