Files
proxmox/docs/06-besu/T1_2_PHASE3_EXECUTION_PLAN.md
defiQUG fbda1b4beb
Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
docs: Ledger Live integration, contract deploy learnings, NEXT_STEPS updates
- 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>
2026-02-12 15:46:57 -08:00

216 lines
5.9 KiB
Markdown

# T1.2 Bridge Resolution - Phase 3 Execution Plan
**Last Updated:** 2026-01-31
**Document Version:** 1.0
**Status:** Active Documentation
---
**Date**: 2026-01-18
**Status**: 📋 **READY FOR EXECUTION**
**Prerequisites**: Admin private key, Foundry installed, RPC access
---
## 📊 Extracted State (Phase 3.1 & 3.3 Complete)
### Bridge Configuration Parameters
**Common Values** (both bridges):
- **Admin**: `0x4A666F96fC8764181194447A7dFdb7d471b301C8`
- **CCIP Router**: `0x99b3511a2d315a497c8112c1fdd8d508d4b1e506`
- **Fee Token (LINK)**: `0x514910771AF9Ca656af840dff83E8264EcF986CA` (expected - verify)
**WETH9 Bridge**:
- **WETH9 Token**: `0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2`
**WETH10 Bridge**:
- **WETH10 Token**: `0xf4BB2e28688e89fCcE3c0580D37d36A7672E8A9f`
### Mainnet Bridge Addresses (for configuration)
- **WETH9 Bridge (Mainnet)**: `0x3304b747E565a97ec8AC220b0B6A1f6ffDB837e6`
- **WETH10 Bridge (Mainnet)**: `0x8078A09637e47Fa5Ed34F626046Ea2094a5CDE5e`
---
## 🚀 Phase 3 Execution Steps
### Step 1: Prepare Deployment Environment
```bash
# Set environment variables
export RPC_URL="http://192.168.11.211:8545" # or http://192.168.11.250:8545
export PRIVATE_KEY="0x..." # Admin private key
export CCIP_ROUTER="0x99b3511a2d315a497c8112c1fdd8d508d4b1e506"
export CCIP_FEE_TOKEN="0x514910771AF9Ca656af840dff83E8264EcF986CA" # Verify this
# Verify access
cast wallet address "$PRIVATE_KEY" # Should output: 0x4A666F96fC8764181194447A7dFdb7d471b301C8
```
### Step 2: Deploy WETH9 Bridge (Phase 3.2)
```bash
cd smom-dbis-138
# Set bridge-specific variables
export WETH9_ADDRESS="0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
# Deploy using Foundry script
forge script script/DeployCCIPWETH9Bridge.s.sol:DeployCCIPWETH9Bridge \
--rpc-url "$RPC_URL" \
--broadcast \
--private-key "$PRIVATE_KEY" \
-vvvv
# Save new bridge address (will be printed)
# Example: NEW_WETH9_BRIDGE="0x..." # Save this!
```
**Verification**:
```bash
# Check code size (should be ~15,041 bytes, similar to Mainnet)
cast code "$NEW_WETH9_BRIDGE" --rpc-url "$RPC_URL" | wc -c
# Verify admin
cast call "$NEW_WETH9_BRIDGE" "admin()(address)" --rpc-url "$RPC_URL"
# Should return: 0x4A666F96fC8764181194447A7dFdb7d471b301C8
# Verify functions exist
cast 4byte "addDestination(uint64,address)" # Should return selector
cast 4byte "getDestinationChains()(uint64[])" # Should return selector
```
### Step 3: Deploy WETH10 Bridge (Phase 3.2)
```bash
# Set bridge-specific variables
export WETH10_ADDRESS="0xf4BB2e28688e89fCcE3c0580D37d36A7672E8A9f"
# Deploy using Foundry script
forge script script/DeployCCIPWETH10Bridge.s.sol:DeployCCIPWETH10Bridge \
--rpc-url "$RPC_URL" \
--broadcast \
--private-key "$PRIVATE_KEY" \
-vvvv
# Save new bridge address (will be printed)
# Example: NEW_WETH10_BRIDGE="0x..." # Save this!
```
**Verification**: Same as WETH9 bridge above
### Step 4: Configure WETH9 Bridge Destination (Phase 3.4)
```bash
# Add Mainnet as destination
cast send "$NEW_WETH9_BRIDGE" \
"addDestination(uint64,address)" \
5009297550715157269 \
0x3304b747E565a97ec8AC220b0B6A1f6ffDB837e6 \
--rpc-url "$RPC_URL" \
--private-key "$PRIVATE_KEY"
# Verify configuration
cast call "$NEW_WETH9_BRIDGE" \
"getDestinationChains()(uint64[])" \
--rpc-url "$RPC_URL"
# Expected: [5009297550715157269]
```
### Step 5: Configure WETH10 Bridge Destination (Phase 3.4)
```bash
# Add Mainnet as destination
cast send "$NEW_WETH10_BRIDGE" \
"addDestination(uint64,address)" \
5009297550715157269 \
0x8078A09637e47Fa5Ed34F626046Ea2094a5CDE5e \
--rpc-url "$RPC_URL" \
--private-key "$PRIVATE_KEY"
# Verify configuration
cast call "$NEW_WETH10_BRIDGE" \
"getDestinationChains()(uint64[])" \
--rpc-url "$RPC_URL"
# Expected: [5009297550715157269]
```
### Step 6: Test Bidirectional Configuration (Phase 3.5)
#### Test Mainnet → ChainID 138 (should already work)
```bash
# On Mainnet
cast call 0x3304b747E565a97ec8AC220b0B6A1f6ffDB837e6 \
"getDestinationChains()(uint64[])" \
--rpc-url https://eth.llamarpc.com
# Should show ChainID 138 selector if configured
```
#### Test ChainID 138 → Mainnet (newly enabled)
```bash
# Use wrap-and-bridge script with new bridge address
# Update bridge address in script to $NEW_WETH9_BRIDGE
./scripts/wrap-and-bridge-weth9-to-mainnet.sh 0.001
# Monitor transaction and CCIP message processing
```
### Step 7: Update All References (Phase 3.6)
**Files to Update**:
1. Environment files (`.env`)
2. Deployment documentation
3. Configuration scripts
4. Integration code
**Old Addresses**:
- WETH9 Bridge: `0x3304b747E565a97ec8AC220b0B6A1f6ffDB837e6`
- WETH10 Bridge: `0x8078A09637e47Fa5Ed34F626046Ea2094a5CDE5e`
**New Addresses**: (will be populated after deployment)
- WETH9 Bridge: `TBD`
- WETH10 Bridge: `TBD`
---
## 📋 Quick Reference Commands
### State Extraction
```bash
./scripts/phase3-extract-bridge-state.sh
```
### Complete Deployment Script
```bash
# Create and run comprehensive deployment script
# (See scripts/phase3-deploy-bridges-complete.sh)
```
---
## ⚠️ Important Notes
1. **Router Address**: `0x99b3511a2d315a497c8112c1fdd8d508d4b1e506` extracted from storage - **VERIFY** this is correct CCIP router
2. **Fee Token**: LINK address needs verification - check with CCIP router deployment records
3. **Old vs New Addresses**: Old bridges cannot be removed (deployed contracts), new addresses must be used going forward
4. **State Migration**: No state migration needed - old contracts had no destinations configured
5. **Breaking Change**: All integrations using old bridge addresses must be updated
---
## ✅ Success Criteria
- [x] State extraction complete
- [ ] New WETH9 bridge deployed with full interface
- [ ] New WETH10 bridge deployed with full interface
- [ ] Both bridges configured with Mainnet destination
- [ ] Bidirectional tests pass
- [ ] All references updated
---
**Status**: 📋 **EXECUTION PLAN READY - AWAITING DEPLOYMENT**
**Last Updated**: 2026-01-18