Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
- ADD_CHAIN138_TO_LEDGER_LIVE: Ledger form done; public code review repo bis-innovations/LedgerLive; init/push commands - CONTRACT_DEPLOYMENT_RUNBOOK: Chain 138 gas price 1 gwei, 36-addr check, TransactionMirror workaround - CONTRACT_*: AddressMapper, MirrorManager deployed 2026-02-12; 36-address on-chain check - NEXT_STEPS_FOR_YOU: Ledger done; steps completable now (no LAN); run-completable-tasks-from-anywhere - MASTER_INDEX, OPERATOR_OPTIONAL, SMART_CONTRACTS_INVENTORY_SIMPLE: updates - LEDGER_BLOCKCHAIN_INTEGRATION_COMPLETE: bis-innovations/LedgerLive reference Co-authored-by: Cursor <cursoragent@cursor.com>
259 lines
9.0 KiB
Markdown
259 lines
9.0 KiB
Markdown
# Bridge Success Requirements
|
|
## What Is Really Required for Successful ETH/WETH Bridging from ChainID 138 to Ethereum Mainnet
|
|
|
|
**Date**: 2025-01-27
|
|
**Purpose**: Clear, actionable list of requirements for successful bridge operation
|
|
|
|
---
|
|
|
|
## Core Requirement: Destination Must Be Enabled
|
|
|
|
### The Single Most Important Requirement
|
|
|
|
**From Contract Code** (`CCIPWETH9Bridge.sol` line 97):
|
|
```solidity
|
|
DestinationChain memory dest = destinations[destinationChainSelector];
|
|
require(dest.enabled, "CCIPWETH9Bridge: destination not enabled");
|
|
```
|
|
|
|
**What This Means**:
|
|
- The bridge contract must have Mainnet (`5009297550715157269`) configured as an enabled destination
|
|
- This requires `addDestination(5009297550715157269, 0x3304b747E565a97ec8AC220b0B6A1f6ffDB837e6)` to have been called successfully
|
|
- The Mainnet bridge address must be set correctly
|
|
|
|
**Current Status**: ⚠️ **UNKNOWN** - Configuration functions revert, cannot verify
|
|
|
|
**Action Required**:
|
|
1. Check event logs for `DestinationAdded` events
|
|
2. If no events, verify bytecode and fix configuration
|
|
3. If events exist, test bridge transfer
|
|
|
|
---
|
|
|
|
## Complete Requirements List
|
|
|
|
### 1. Contract Deployment Requirements ✅
|
|
|
|
| Requirement | Status | Details |
|
|
|-------------|--------|---------|
|
|
| WETH9 on ChainID 138 | ✅ | `0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2` (predeployed) |
|
|
| Bridge on ChainID 138 | ✅ | `0x3304b747E565a97ec8AC220b0B6A1f6ffDB837e6` (deployed) |
|
|
| Bridge on Mainnet | ✅ | `0x3304b747E565a97ec8AC220b0B6A1f6ffDB837e6` (deployed) |
|
|
| CCIP Router on ChainID 138 | ✅ | `0x8078A09637e47Fa5Ed34F626046Ea2094a5CDE5e` (deployed) |
|
|
| CCIP Router on Mainnet | ✅ | `0x80226fc0Ee2b096224EeAc085Bb9a8cba1146f7D` (official) |
|
|
|
|
**All contracts are deployed** ✅
|
|
|
|
---
|
|
|
|
### 2. Configuration Requirements ⚠️
|
|
|
|
| Requirement | Status | Details |
|
|
|-------------|--------|---------|
|
|
| Mainnet → ChainID 138 | ✅ | Configured on Mainnet bridges |
|
|
| ChainID 138 → Mainnet | ⚠️ | **UNKNOWN** - Functions revert |
|
|
| Destination enabled flag | ⚠️ | **MUST BE TRUE** for `sendCrossChain()` to work |
|
|
| Receiver bridge address | ⚠️ | Must be `0x3304b747E565a97ec8AC220b0B6A1f6ffDB837e6` |
|
|
|
|
**Critical**: Destination must be enabled for bridge to work
|
|
|
|
---
|
|
|
|
### 3. Token Requirements ✅
|
|
|
|
| Requirement | Status | Details |
|
|
|-------------|--------|---------|
|
|
| WETH9 on ChainID 138 | ✅ | Predeployed at canonical address |
|
|
| LINK on ChainID 138 | ✅ | `0xb7721dD53A8c629d9f1Ba31a5819AFe250002b03` (deployed) |
|
|
| Wallet has LINK | ✅ | ~999,980 LINK tokens available |
|
|
| LINK recognized by router | ⚠️ | **NEEDS VERIFICATION** |
|
|
|
|
**Tokens are available** ✅
|
|
|
|
---
|
|
|
|
### 4. User Requirements (Per Transfer)
|
|
|
|
| Requirement | Status | Details |
|
|
|-------------|--------|---------|
|
|
| ETH balance | ✅ | For gas fees on ChainID 138 |
|
|
| WETH9 balance | ✅ | Amount to bridge |
|
|
| WETH9 approval | ✅ | Script handles this |
|
|
| LINK balance | ✅ | For CCIP fees (typically 0.1-2 LINK) |
|
|
| LINK approval | ⚠️ | **MAY BE REQUIRED** - Needs verification |
|
|
| Valid recipient address | ✅ | User provides |
|
|
|
|
**User requirements are straightforward** ✅
|
|
|
|
---
|
|
|
|
### 5. CCIP Requirements ⚠️
|
|
|
|
| Requirement | Status | Details |
|
|
|-------------|--------|---------|
|
|
| Router accepts LINK token | ⚠️ | **NEEDS VERIFICATION** |
|
|
| Router calculates fees | ⚠️ | **NEEDS VERIFICATION** |
|
|
| Router sends message | ⚠️ | **NEEDS VERIFICATION** |
|
|
| Message delivered to Mainnet | ⚠️ | **NEEDS VERIFICATION** |
|
|
| Mainnet bridge receives message | ⚠️ | **NEEDS VERIFICATION** |
|
|
|
|
**CCIP functionality needs end-to-end testing** ⚠️
|
|
|
|
---
|
|
|
|
## The sendCrossChain() Function Requirements
|
|
|
|
### Step-by-Step What Happens
|
|
|
|
1. **Validation** (Lines 93-97)
|
|
- ✅ `amount > 0` - User provides
|
|
- ✅ `recipient != address(0)` - User provides
|
|
- ⚠️ `destinations[destinationChainSelector].enabled == true` - **MUST BE CONFIGURED**
|
|
|
|
2. **Token Transfer** (Line 100)
|
|
- ✅ `IERC20(weth9).transferFrom(msg.sender, address(this), amount)` - Requires approval
|
|
|
|
3. **Fee Calculation** (Line 131)
|
|
- ⚠️ `ccipRouter.getFee(destinationChainSelector, message)` - **MUST WORK**
|
|
|
|
4. **Fee Payment** (Lines 134-137)
|
|
- ⚠️ `IERC20(feeToken).transferFrom(msg.sender, address(this), fee)` - Requires LINK approval
|
|
- ⚠️ `IERC20(feeToken).approve(address(ccipRouter), fee)` - Requires LINK approval
|
|
|
|
5. **CCIP Send** (Line 140)
|
|
- ⚠️ `ccipRouter.ccipSend(destinationChainSelector, message)` - **MUST WORK**
|
|
|
|
---
|
|
|
|
## What Will Fail If Not Met
|
|
|
|
### Failure Point 1: Destination Not Enabled
|
|
**Error**: `"CCIPWETH9Bridge: destination not enabled"`
|
|
**Location**: Line 97
|
|
**Fix**: Configure destination via `addDestination()` or verify it's already configured
|
|
|
|
### Failure Point 2: Insufficient WETH9 Approval
|
|
**Error**: `"CCIPWETH9Bridge: transfer failed"`
|
|
**Location**: Line 100
|
|
**Fix**: User must approve bridge to spend WETH9
|
|
|
|
### Failure Point 3: CCIP Router Fee Calculation Fails
|
|
**Error**: Revert from `ccipRouter.getFee()`
|
|
**Location**: Line 131
|
|
**Fix**: Verify router configuration, LINK token recognition
|
|
|
|
### Failure Point 4: Insufficient LINK Balance/Approval
|
|
**Error**: `"CCIPWETH9Bridge: fee transfer failed"` or `"CCIPWETH9Bridge: fee approval failed"`
|
|
**Location**: Lines 135-136
|
|
**Fix**: User must have LINK and approve bridge to spend it
|
|
|
|
### Failure Point 5: CCIP Router Rejects Message
|
|
**Error**: Revert from `ccipRouter.ccipSend()`
|
|
**Location**: Line 140
|
|
**Fix**: Verify router configuration, supported tokens, chain selector
|
|
|
|
---
|
|
|
|
## Verification Checklist
|
|
|
|
### Before Attempting Bridge Transfer
|
|
|
|
- [ ] **Destination configured**: Check event logs or test `destinations()` mapping
|
|
- [ ] **WETH9 balance**: User has sufficient WETH9
|
|
- [ ] **WETH9 approval**: Bridge has allowance to spend WETH9
|
|
- [ ] **LINK balance**: User has LINK tokens (recommended: 1-2 LINK)
|
|
- [ ] **LINK approval**: Bridge has allowance to spend LINK (if required)
|
|
- [ ] **Fee calculation works**: Test `calculateFee()` function
|
|
- [ ] **Recipient address**: Valid non-zero address on Mainnet
|
|
- [ ] **Gas available**: Sufficient ETH for gas fees
|
|
|
|
### During Bridge Transfer
|
|
|
|
- [ ] **Transaction sent**: `sendCrossChain()` transaction submitted
|
|
- [ ] **Transaction confirmed**: Transaction included in block
|
|
- [ ] **Event emitted**: `CrossChainTransferInitiated` event logged
|
|
- [ ] **CCIP message created**: Message ID returned from router
|
|
- [ ] **CCIP message processing**: Message appears in CCIP Explorer
|
|
|
|
### After Bridge Transfer
|
|
|
|
- [ ] **CCIP message delivered**: Message processed on Mainnet
|
|
- [ ] **Mainnet bridge received**: `ccipReceive()` called successfully
|
|
- [ ] **WETH9 transferred**: Recipient balance increased on Mainnet
|
|
- [ ] **Event emitted**: `CrossChainTransferCompleted` event logged
|
|
- [ ] **Balance verified**: Check recipient WETH9 balance on Mainnet
|
|
|
|
---
|
|
|
|
## Quick Verification Commands
|
|
|
|
### Check Destination Configuration
|
|
```bash
|
|
# Check if destination is configured (may revert)
|
|
cast call 0x3304b747E565a97ec8AC220b0B6A1f6ffDB837e6 \
|
|
"destinations(uint64)(uint64,address,bool)" \
|
|
5009297550715157269 \
|
|
--rpc-url http://192.168.11.211:8545
|
|
|
|
# Check event logs for DestinationAdded
|
|
cast logs --from-block 0 \
|
|
--address 0x3304b747E565a97ec8AC220b0B6A1f6ffDB837e6 \
|
|
"DestinationAdded(uint64,address)" \
|
|
--rpc-url http://192.168.11.211:8545
|
|
```
|
|
|
|
### Check Fee Calculation
|
|
```bash
|
|
# Test fee calculation (requires destination enabled)
|
|
cast call 0x3304b747E565a97ec8AC220b0B6A1f6ffDB837e6 \
|
|
"calculateFee(uint64,uint256)" \
|
|
5009297550715157269 \
|
|
1000000000000000000 \
|
|
--rpc-url http://192.168.11.211:8545
|
|
```
|
|
|
|
### Check LINK Token
|
|
```bash
|
|
# Check LINK balance
|
|
cast call 0xb7721dD53A8c629d9f1Ba31a5819AFe250002b03 \
|
|
"balanceOf(address)" \
|
|
0x4A666F96fC8764181194447A7dFdb7d471b301C8 \
|
|
--rpc-url http://192.168.11.211:8545
|
|
```
|
|
|
|
---
|
|
|
|
## Summary: What's Really Required
|
|
|
|
### Absolutely Required (Will Fail Without)
|
|
1. ✅ **Destination enabled**: `destinations[5009297550715157269].enabled == true`
|
|
2. ✅ **WETH9 approval**: User approved bridge to spend WETH9
|
|
3. ✅ **LINK tokens**: User has LINK for fees
|
|
4. ✅ **LINK approval**: User approved bridge to spend LINK (if required)
|
|
5. ✅ **Valid recipient**: Non-zero address on Mainnet
|
|
|
|
### Should Be Verified (May Cause Issues)
|
|
1. ⚠️ **CCIP Router configuration**: Router recognizes LINK token
|
|
2. ⚠️ **Fee calculation works**: Router can calculate fees
|
|
3. ⚠️ **CCIP message delivery**: Router can send messages to Mainnet
|
|
4. ⚠️ **Mainnet bridge receives**: Bridge can receive and process messages
|
|
|
|
### Nice to Have (Not Blocking)
|
|
1. ✅ **Documentation updated**: All addresses correct
|
|
2. ✅ **Scripts updated**: All use correct addresses
|
|
3. ✅ **Frontend updated**: Config uses correct addresses
|
|
|
|
---
|
|
|
|
## The Bottom Line
|
|
|
|
**The single most important requirement**: The destination must be enabled in the bridge contract.
|
|
|
|
**Everything else is either already met or can be verified/tested easily.**
|
|
|
|
**Next action**: Verify if destination is already configured (15 min check), then test bridge transfer (30-40 min).
|
|
|
|
---
|
|
|
|
**Status**: ✅ **REQUIREMENTS CLEARLY IDENTIFIED**
|