163 lines
4.6 KiB
Markdown
163 lines
4.6 KiB
Markdown
|
|
# Etherscan Contract Verification Guide
|
||
|
|
|
||
|
|
**Date**: 2025-12-11
|
||
|
|
**Status**: Ready for Verification
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## 📋 Contracts to Verify
|
||
|
|
|
||
|
|
### Ethereum Mainnet
|
||
|
|
|
||
|
|
| Contract | Address | Status |
|
||
|
|
|----------|---------|--------|
|
||
|
|
| **CCIPWETH9Bridge** | `0x3304b747E565a97ec8AC220b0B6A1f6ffDB837e6` | ❌ Not Verified |
|
||
|
|
| **CCIPWETH10Bridge** | `0x8078A09637e47Fa5Ed34F626046Ea2094a5CDE5e` | ❌ Not Verified |
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## 🔧 Verification Methods
|
||
|
|
|
||
|
|
### Method 1: Automated Script (Recommended)
|
||
|
|
|
||
|
|
```bash
|
||
|
|
cd /home/intlc/projects/smom-dbis-138
|
||
|
|
./scripts/deployment/verify-mainnet-etherscan.sh
|
||
|
|
```
|
||
|
|
|
||
|
|
**Requirements**:
|
||
|
|
- `ETHERSCAN_API_KEY` set in `.env`
|
||
|
|
- Foundry installed
|
||
|
|
- Contracts compiled
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
### Method 2: Manual Foundry Verification
|
||
|
|
|
||
|
|
#### CCIPWETH9Bridge
|
||
|
|
|
||
|
|
```bash
|
||
|
|
# Encode constructor arguments
|
||
|
|
CONSTRUCTOR_ARGS=$(cast abi-encode "constructor(address,address,address)" \
|
||
|
|
0x80226fc0Ee2b096224EeAc085Bb9a8cba1146f7D \
|
||
|
|
0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 \
|
||
|
|
0x514910771AF9Ca656af840dff83E8264EcF986CA)
|
||
|
|
|
||
|
|
# Verify contract
|
||
|
|
forge verify-contract \
|
||
|
|
--chain-id 1 \
|
||
|
|
--num-of-optimizations 200 \
|
||
|
|
--watch \
|
||
|
|
--constructor-args "$CONSTRUCTOR_ARGS" \
|
||
|
|
0x3304b747E565a97ec8AC220b0B6A1f6ffDB837e6 \
|
||
|
|
contracts/ccip/CCIPWETH9Bridge.sol:CCIPWETH9Bridge \
|
||
|
|
$ETHERSCAN_API_KEY
|
||
|
|
```
|
||
|
|
|
||
|
|
#### CCIPWETH10Bridge
|
||
|
|
|
||
|
|
```bash
|
||
|
|
# Encode constructor arguments
|
||
|
|
CONSTRUCTOR_ARGS=$(cast abi-encode "constructor(address,address,address)" \
|
||
|
|
0x80226fc0Ee2b096224EeAc085Bb9a8cba1146f7D \
|
||
|
|
0xf4BB2e28688e89fCcE3c0580D37d36A7672E8A9f \
|
||
|
|
0x514910771AF9Ca656af840dff83E8264EcF986CA)
|
||
|
|
|
||
|
|
# Verify contract
|
||
|
|
forge verify-contract \
|
||
|
|
--chain-id 1 \
|
||
|
|
--num-of-optimizations 200 \
|
||
|
|
--watch \
|
||
|
|
--constructor-args "$CONSTRUCTOR_ARGS" \
|
||
|
|
0x8078A09637e47Fa5Ed34F626046Ea2094a5CDE5e \
|
||
|
|
contracts/ccip/CCIPWETH10Bridge.sol:CCIPWETH10Bridge \
|
||
|
|
$ETHERSCAN_API_KEY
|
||
|
|
```
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
### Method 3: Etherscan Web UI
|
||
|
|
|
||
|
|
1. **Get Etherscan API Key**:
|
||
|
|
- Visit: https://etherscan.io/myapikey
|
||
|
|
- Create account (if needed)
|
||
|
|
- Generate API key
|
||
|
|
|
||
|
|
2. **Navigate to Contract**:
|
||
|
|
- CCIPWETH9Bridge: https://etherscan.io/address/0x3304b747E565a97ec8AC220b0B6A1f6ffDB837e6#code
|
||
|
|
- CCIPWETH10Bridge: https://etherscan.io/address/0x8078A09637e47Fa5Ed34F626046Ea2094a5CDE5e#code
|
||
|
|
|
||
|
|
3. **Click "Verify and Publish"**:
|
||
|
|
- Select "Via Standard JSON Input"
|
||
|
|
- Upload compiler metadata
|
||
|
|
- Enter constructor arguments
|
||
|
|
- Submit
|
||
|
|
|
||
|
|
4. **Or use the verification page**:
|
||
|
|
- Visit: https://etherscan.io/myverify_address
|
||
|
|
- Enter contract address
|
||
|
|
- Follow verification wizard
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## 📝 Constructor Arguments
|
||
|
|
|
||
|
|
### CCIPWETH9Bridge
|
||
|
|
|
||
|
|
| Parameter | Value | Description |
|
||
|
|
|-----------|-------|-------------|
|
||
|
|
| `_ccipRouter` | `0x80226fc0Ee2b096224EeAc085Bb9a8cba1146f7D` | Chainlink CCIP Router |
|
||
|
|
| `_weth9` | `0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2` | WETH9 token address |
|
||
|
|
| `_feeToken` | `0x514910771AF9Ca656af840dff83E8264EcF986CA` | LINK token address |
|
||
|
|
|
||
|
|
**Encoded**: `00000000000000000000000080226fc0ee2b096224eeac085bb9a8cba1146f7d000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca`
|
||
|
|
|
||
|
|
### CCIPWETH10Bridge
|
||
|
|
|
||
|
|
| Parameter | Value | Description |
|
||
|
|
|-----------|-------|-------------|
|
||
|
|
| `_ccipRouter` | `0x80226fc0Ee2b096224EeAc085Bb9a8cba1146f7D` | Chainlink CCIP Router |
|
||
|
|
| `_weth10` | `0xf4BB2e28688e89fCcE3c0580D37d36A7672E8A9f` | WETH10 token address |
|
||
|
|
| `_feeToken` | `0x514910771AF9Ca656af840dff83E8264EcF986CA` | LINK token address |
|
||
|
|
|
||
|
|
**Encoded**: `00000000000000000000000080226fc0ee2b096224eeac085bb9a8cba1146f7d000000000000000000000000f4bb2e28688e89fcce3c0580d37d36a7672e8a9f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca`
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## ⚙️ Compiler Settings
|
||
|
|
|
||
|
|
- **Compiler Version**: `0.8.19`
|
||
|
|
- **Optimization**: `200` runs
|
||
|
|
- **EVM Version**: `london` (default)
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## ✅ Verification Checklist
|
||
|
|
|
||
|
|
- [ ] Etherscan API key obtained and added to `.env`
|
||
|
|
- [ ] Contracts compiled with correct settings
|
||
|
|
- [ ] Constructor arguments encoded correctly
|
||
|
|
- [ ] Network connection to Ethereum Mainnet working
|
||
|
|
- [ ] Sufficient gas for verification transaction (if needed)
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## 🔗 Quick Links
|
||
|
|
|
||
|
|
- **Etherscan Verification Page**: https://etherscan.io/myverify_address
|
||
|
|
- **CCIPWETH9Bridge**: https://etherscan.io/address/0x3304b747E565a97ec8AC220b0B6A1f6ffDB837e6
|
||
|
|
- **CCIPWETH10Bridge**: https://etherscan.io/address/0x8078A09637e47Fa5Ed34F626046Ea2094a5CDE5e
|
||
|
|
- **Get API Key**: https://etherscan.io/myapikey
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## 📚 Additional Resources
|
||
|
|
|
||
|
|
- [Etherscan Verification Guide](https://docs.etherscan.io/contracts/verifying-contracts-on-etherscan)
|
||
|
|
- [Foundry Verification Docs](https://book.getfoundry.sh/reference/forge/forge-verify-contract)
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
**Last Updated**: 2025-12-11
|
||
|
|
|