# Genesis.json and .env Review Summary

**Date**: 2025-01-27

---

## ✅ Key Findings

### 1. WETH9 IS Predeployed at Canonical Address

**Genesis.json Confirmation**:
- **Address**: `0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2`
- **Bytecode**: ✅ Present (6,250 characters = ~3,125 bytes)
- **Status**: Predeployed in genesis block

**Verification**:
```bash
jq -r '.alloc["0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"]' genesis.json
# Result: { "balance": "0x0", "code": "0x6060604052..." } ✅
```

### 2. WETH10 IS Predeployed at Canonical Address

**Genesis.json Confirmation**:
- **Address**: `0xf4BB2e28688e89fCcE3c0580D37d36A7672E8A9f`
- **Bytecode**: ✅ Present
- **Status**: Predeployed in genesis block

### 3. Address Mapping File is Incorrect

**File**: `smom-dbis-138/config/address-mapping.json`

**Issue**: Maps WETH9 to bridge address instead of canonical address

**Incorrect Mapping**:
```json
{
  "WETH9": {
    "genesisAddress": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
    "deployedAddress": "0x3304b747E565a97ec8AC220b0B6A1f6ffDB837e6",  // ❌ This is the BRIDGE!
    ...
  }
}
```

**Correct Understanding**:
- WETH9: `0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2` (predeployed in genesis)
- CCIPWETH9Bridge: `0x3304b747E565a97ec8AC220b0B6A1f6ffDB837e6` (separate contract)

### 4. .env Configuration is Correct

**File**: `smom-dbis-138/terraform/phases/phase1/config/env.chain138.template`

```bash
WETH9_ADDRESS=0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2  ✅ Correct
CCIPWETH9_BRIDGE_CHAIN138=0x3304b747E565a97ec8AC220b0B6A1f6ffDB837e6  ✅ Correct
```

---

## Correct Address Reference

| Contract | Address | Source | Status |
|----------|---------|--------|--------|
| **WETH9** | `0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2` | genesis.json | ✅ Predeployed |
| **WETH10** | `0xf4BB2e28688e89fCcE3c0580D37d36A7672E8A9f` | genesis.json | ✅ Predeployed |
| **CCIPWETH9Bridge** | `0x3304b747E565a97ec8AC220b0B6A1f6ffDB837e6` | .env | ✅ Deployed separately |
| **CCIPWETH10Bridge** | `0x8078A09637e47Fa5Ed34F626046Ea2094a5CDE5e` | .env | ✅ Deployed separately |

---

## Impact on Bridge Verification

### For thirdweb Bridge

**Use WETH9 at canonical address**: `0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2`

The previous verification scripts were checking the wrong address. According to genesis.json, WETH9 should exist at the canonical address on-chain.

### Next Steps

1. **Verify on-chain**: Check if WETH9 exists at `0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2` on ChainID 138
2. **Update scripts**: Fix verification scripts to use canonical address
3. **Fix mapping**: Update `address-mapping.json` to reflect correct addresses

---

## Files Reviewed

1. ✅ `smom-dbis-138/config/genesis.json` - WETH predeployed correctly
2. ✅ `smom-dbis-138/terraform/phases/phase1/config/env.chain138.template` - Configuration correct
3. ⚠️ `smom-dbis-138/config/address-mapping.json` - Incorrect mapping

---

**Conclusion**: WETH contracts are correctly predeployed in genesis.json at canonical addresses. The address-mapping.json file contains incorrect information that should be fixed.
