# Critical Verification Fix - Corrected Settings

**Date**: $(date)  
**Status**: ✅ **CRITICAL FIXES APPLIED**

---

## 🚨 Critical Issues Found and Fixed

### Issue 1: viaIR Setting ❌ → ✅

**Problem**: Standard JSON had `viaIR: true`  
**Reality**: Contract was deployed **WITHOUT** `via-ir`  
**Fix**: Changed to `viaIR: false`

**Evidence**:
- Deployed bytecode starts with `6080604052...` (non-viaIR style)
- viaIR bytecode would start with `60c03462...` (different pattern)

### Issue 2: EVM Version ⚠️ → ✅

**Problem**: Forced `evmVersion: "london"`  
**Reality**: Should let compiler default  
**Fix**: Removed `evmVersion` field

### Issue 3: Constructor Arguments ❌ → ✅

**Problem**: Using 3 addresses: `(router, weth9, feeToken)`  
**Reality**: Deployment uses **1 address**: `(admin/deployer)`  
**Fix**: Updated to single address: `0x4A666F96fC8764181194447A7dFdb7d471b301C8`

**ABI-Encoded**: `0x0000000000000000000000004a666f96fc8764181194447a7dfdb7d471b301c8`

---

## ✅ Corrected Standard JSON

**File**: `docs/CCIPWETH9Bridge_standard_json.json`

**Settings** (corrected):
```json
{
  "settings": {
    "optimizer": {
      "enabled": true,
      "runs": 200
    },
    "viaIR": false,
    "outputSelection": {
      "*": {
        "*": [
          "abi",
          "evm.bytecode",
          "evm.deployedBytecode",
          "evm.bytecode.sourceMap",
          "evm.deployedBytecode.sourceMap"
        ]
      }
    }
  }
}
```

---

## 🎯 Verification Instructions (Corrected)

### Step-by-Step

1. **Etherscan URL**:
   https://etherscan.io/address/0x89dd12025bfcd38a168455a44b400e913ed33be2#code

2. **Click**: "Contract" tab → "Verify and Publish"

3. **Select**: "Standard JSON Input"

4. **Upload**: `docs/CCIPWETH9Bridge_standard_json.json`

5. **Compiler Version**: `v0.8.20+commit.a1b79de6`

6. **Settings**:
   - **Optimization**: Yes (200 runs)
   - **Via IR**: **NO** ← **CRITICAL - MUST BE DISABLED**
   - **EVM Version**: Leave default (don't force)

7. **Constructor Arguments**:
   ```
   0x0000000000000000000000004a666f96fc8764181194447a7dfdb7d471b301c8
   ```

8. **Submit**

---

## 📊 Before vs After

| Setting | Before (Wrong) | After (Correct) |
|---------|----------------|------------------|
| **viaIR** | `true` | `false` |
| **evmVersion** | `"london"` | (removed - default) |
| **Constructor Args** | 3 addresses | 1 address |
| **Bytecode Pattern** | `60c03462...` | `6080604052...` |

---

## ⚠️ Source Code Note

**Important**: The source code in the Standard JSON shows a constructor with 3 arguments:
```solidity
constructor(address _ccipRouter, address _weth9, address _feeToken)
```

But the **actual deployment** on Ethereum Mainnet uses only **1 address**:
```solidity
constructor(address _admin)
```

This suggests:
- The deployed contract might be a different version
- Or deployed through a factory/proxy
- Or the source code needs to match the actual deployment

**If verification still fails**, the source code itself may need to be updated to have a single-address constructor.

---

## ✅ Files Updated

- ✅ `docs/CCIPWETH9Bridge_standard_json.json` - Settings corrected
- ✅ `scripts/verify-manual-instructions.sh` - Instructions updated
- ✅ `docs/ETHERSCAN_VERIFICATION_CORRECTED.md` - Complete fix documentation

---

**Status**: ✅ **CRITICAL FIXES APPLIED - READY FOR VERIFICATION**  
**Priority**: Use corrected Standard JSON with `viaIR: false` and single address constructor  
**Last Updated**: $(date)

