# Cronos Contract Verification Runbook

Manual verification for WETH9, WETH10, CCIPWETH9Bridge, and CCIPWETH10Bridge on Cronos (Chain 25).

---

## Why "Unmatched" with Flattened Source?

Contracts were **deployed with `via_ir = true`** (Foundry default). Flattened-source verification uses the legacy compiler pipeline (`via_ir = false`), which produces different bytecode → **always Unmatched**.

**Solution:** Use **Standard-Json-Input** — it includes `viaIR: true` and matches deployment bytecode.

---

## Verification Status

| Contract | Address | Check |
|----------|---------|-------|
| WETH9 | `0x99B3511A2d315A497C8112C1fdd8D508d4B1E506` | [View](https://explorer.cronos.org/address/0x99B3511A2d315A497C8112C1fdd8D508d4B1E506) |
| WETH10 | `0x3304b747E565a97ec8AC220b0B6A1f6ffDB837e6` | [View](https://explorer.cronos.org/address/0x3304b747E565a97ec8AC220b0B6A1f6ffDB837e6) |
| CCIPWETH9Bridge | `0x3Cc23d086fCcbAe1e5f3FE2bA4A263E1D27d8Cab` | [View](https://explorer.cronos.org/address/0x3Cc23d086fCcbAe1e5f3FE2bA4A263E1D27d8Cab) |
| CCIPWETH10Bridge | `0x105F8A15b819948a89153505762444Ee9f324684` | [View](https://explorer.cronos.org/address/0x105F8A15b819948a89153505762444Ee9f324684) |

---

## Step 1: Export Standard JSON

```bash
cd smom-dbis-138
./scripts/deployment/export-cronos-verification-sources.sh
```

This writes to `.cronos-verify/`:
- `WETH_standard_input.json`
- `WETH10_standard_input.json`
- `CCIPWETH9Bridge_standard_input.json`
- `CCIPWETH10Bridge_standard_input.json`

---

## Step 2: Verify Each Contract

Open https://explorer.cronos.org/verifyContract

For each contract:

1. **Contract address** — Use the address from the table above.
2. **Compiler type** — Select **"Solidity (Standard-Json-Input)"** (or equivalent).
3. **Contract files / Standard JSON** — Upload or paste the corresponding `*_standard_input.json` file.
4. **Contract name** — Choose the contract from the dropdown (e.g. `WETH`, `WETH10`, `CCIPWETH9Bridge`, `CCIPWETH10Bridge`).
5. **Constructor arguments** — Leave empty for WETH9 and WETH10. For bridges, use:

   **CCIPWETH9Bridge:**
   ```
   0x000000000000000000000000e26b0a098d861d5c7d9434ad471c0572ca6eaa6700000000000000000000000099b3511a2d315a497c8112c1fdd8d508d4b1e5060000000000000000000000008c80a01f461f297df7f9da3a4f740d7297c8ac85
   ```

   **CCIPWETH10Bridge:**
   ```
   0x000000000000000000000000e26b0a098d861d5c7d9434ad471c0572ca6eaa670000000000000000000000003304b747e565a97ec8ac220b0b6a1f6ffdb837e60000000000000000000000008c80a01f461f297df7f9da3a4f740d7297c8ac85
   ```

6. Accept terms and **Submit**.

---

## Constructor Argument Reference

| Bridge | Router | Token | LINK |
|--------|--------|-------|------|
| CCIPWETH9Bridge | 0xE26B0A09... | 0x99B3511A... | 0x8c80A01F... |
| CCIPWETH10Bridge | 0xE26B0A09... | 0x3304b747... | 0x8c80A01F... |

---

## Troubleshooting

- **Unmatched** — Ensure you use **Standard-Json-Input**, not flattened source. Flattened source will always fail (via_ir mismatch).
- **Constructor args rejected** — Use the exact ABI-encoded values above; include or omit `0x` per the form.
- **Contract name dropdown empty** — The JSON must compile cleanly; re-export with the script if needed.
- **`Invalid parameter(s)` / `JSON files not found` from the API** — Treat this as an explorer-side validation failure, not a contract failure. Use the web UI at `https://explorer.cronos.org/verifyContract`, upload the generated `*_standard_input.json` file, and enter the constructor args manually if the API rejects the multipart request.

---

## Related

- `scripts/deployment/export-cronos-verification-sources.sh` — Regenerates flattened sources
- `CRONOS_FULL_DEPLOYMENT_TODO.md` — Full Cronos + multi-chain deployment TODO (optional, token factories, recommendations)
- `docs/04-configuration/CRONOS_EXPLORER_OPERATIONS.md` — API and explorer reference
