- 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>
17 KiB
T1.2: Bridge Interface Resolution - Detailed Task List
Last Updated: 2026-01-31
Document Version: 1.0
Status: Active Documentation
Date: 2026-01-18
Status: 📋 TASK BREAKDOWN COMPLETE
Based on: T1_2_BRIDGE_RESOLUTION_PLAN.md
📊 Current Situation Summary
Problem
- Mainnet → ChainID 138: ✅ WORKING (50% complete)
- ChainID 138 → Mainnet: ⚠️ BLOCKED (configuration functions missing)
Root Cause
- ChainID 138 bridge contract (
0x3304b747E565a97ec8AC220b0B6A1f6ffDB837e6) is missing critical functions:- ❌
addDestination(uint64,address): NOT in bytecode - ❌
getDestinationChains()(uint64[]): NOT in bytecode
- ❌
- Code size: 1,311 bytes (91% smaller than Mainnet's 15,041 bytes)
- Conclusion: Different/older version without configuration functions
🎯 Resolution Phases & Tasks
PHASE 1: VERIFY CURRENT STATE (Immediate - ~1 hour)
Task 1.1: Test Bridge Functionality
Objective: Determine if ChainID 138 → Mainnet bridge already works despite missing interface functions
Subtasks:
-
Prepare test environment
- Set up test account with sufficient funds on ChainID 138
- Ensure test account has admin access if needed
- Prepare test token (WETH9 or WETH10) on ChainID 138
- Verify Mainnet bridge addresses are accessible
-
Perform test transfer
- Attempt test transfer from ChainID 138 to Mainnet using bridge
- Use minimal test amount (e.g., 0.001 WETH)
- Monitor transaction status on ChainID 138
- Check for CCIP message creation
-
Verify transfer completion
- Monitor CCIP message processing
- Verify token arrival on Mainnet
- Check transaction receipts on both chains
- Document transfer status
Deliverable: Test transfer result (success/failure) with transaction hashes
Success Criteria:
- ✅ If transfer succeeds: Destinations already configured → NO FURTHER ACTION NEEDED
- ❌ If transfer fails: Proceed to Phase 2
Task 1.2: Check Event Logs for Existing Configuration
Objective: Verify if destinations were configured via events or alternative methods
Subtasks:
-
Query WETH9 Bridge events
- Search for
DestinationAdded(uint64,address)events on ChainID 138 WETH9 bridge - Query from block 0 to latest block
- Filter for Mainnet chain selector:
5009297550715157269 - Document any events found
- Search for
-
Query WETH10 Bridge events
- Search for
DestinationAdded(uint64,address)events on ChainID 138 WETH10 bridge - Query from block 0 to latest block
- Filter for Mainnet chain selector:
5009297550715157269 - Document any events found
- Search for
-
Analyze event results
- Compare event timestamps with deployment dates
- Verify receiver bridge addresses match Mainnet bridge addresses
- Document findings
Deliverable: Event log analysis report with any discovered configuration events
Command Reference:
# WETH9 Bridge
cast logs --from-block 0 \
--address 0x3304b747E565a97ec8AC220b0B6A1f6ffDB837e6 \
"DestinationAdded(uint64,address)" \
--rpc-url http://192.168.11.211:8545
# WETH10 Bridge
cast logs --from-block 0 \
--address 0x8078A09637e47Fa5Ed34F626046Ea2094a5CDE5e \
"DestinationAdded(uint64,address)" \
--rpc-url http://192.168.11.211:8545
Success Criteria:
- ✅ If events found with Mainnet selector: Destinations configured → NO FURTHER ACTION NEEDED
- ❌ If no events found: Proceed to Phase 2
PHASE 2: CHOOSE RESOLUTION OPTION (Decision Point)
Task 2.1: Evaluate Resolution Options
Objective: Based on Phase 1 results, select appropriate resolution strategy
Decision Matrix:
Option A: Contract Upgrade/Update (RECOMMENDED if Phase 1 fails)
Best for: Long-term solution, full functionality
Pros:
- Full functionality matching Mainnet interface
- Long-term solution
- Matches expected contract behavior
Cons:
- Requires contract deployment
- May need state migration
- Breaking change for existing integrations
Estimated Time: 1-2 days (deployment + testing)
Option B: Use Existing Contract (if Phase 1 succeeds)
Best for: Immediate solution if already working
Pros:
- No contract changes needed
- Immediate solution
Cons:
- Only applicable if already configured
- Limited investigation capability
Estimated Time: Verification only (included in Phase 1)
Option C: Wrapper/Adapter Pattern
Best for: Temporary solution without changing existing contract
Pros:
- Doesn't change existing contract
- Provides missing interface
- Temporary solution
Cons:
- Adds another layer/contract
- More complex architecture
- Gas overhead
Estimated Time: 2-3 days (development + deployment)
Option D: Direct Storage Manipulation
Status: ⚠️ NOT RECOMMENDED - Too risky
Task 2.2: Decision Document
Objective: Document selected resolution option and justification
Subtasks:
- Review Phase 1 results
- Select resolution option (likely Option A)
- Document decision rationale
- Get approval if required
- Create implementation plan for selected option
Deliverable: Decision document with selected option and plan
PHASE 3: IMPLEMENT RESOLUTION (If Option A Selected - 1-2 days)
Task 3.1: Prepare Contract Deployment
Objective: Prepare updated bridge contract with full interface
Subtasks:
-
Review contract source code
- Verify
CCIPWETH9Bridge.solhas all required functions - Verify
CCIPWETH10Bridge.solhas all required functions - Check contract compilation status
- Verify contract matches Mainnet version
- Verify
-
Identify state migration requirements
- Document current storage slots:
- Slot 0:
0x99b3511a2d315a497c8112c1fdd8d508d4b1e506(likelyccipRouterororacleAggregator) - Slot 1:
0x4a666f96fc8764181194447a7dfdb7d471b301c8(matchesadmin()return value)
- Slot 0:
- Identify immutable constructor parameters:
ccipRouteraddressweth9orweth10token addressfeeTokenaddress (if applicable)adminaddress
- Document any existing destination configurations (if any)
- Plan state migration steps
- Document current storage slots:
-
Prepare deployment script
- Create/update deployment script for ChainID 138
- Verify constructor parameters match current contract state
- Add state migration steps if needed
- Include verification steps
-
Prepare deployment environment
- Verify admin private key access
- Verify sufficient gas on ChainID 138
- Test RPC connection to ChainID 138 (
http://192.168.11.211:8545) - Verify deployment account has required permissions
Deliverable: Deployment plan document with contract source review, state migration plan, and deployment script
Task 3.2: Deploy New Bridge Contract
Objective: Deploy updated bridge contract with full interface
Subtasks:
-
Deploy WETH9 Bridge
- Run deployment script for
CCIPWETH9Bridge - Capture deployment transaction hash
- Wait for transaction confirmation
- Verify contract address (note: may differ from current address)
- Verify contract bytecode size matches Mainnet (should be ~15,041 bytes)
- Run deployment script for
-
Deploy WETH10 Bridge
- Run deployment script for
CCIPWETH10Bridge - Capture deployment transaction hash
- Wait for transaction confirmation
- Verify contract address
- Verify contract bytecode size matches Mainnet (should be ~15,041 bytes)
- Run deployment script for
-
Verify contract deployments
- Call
admin()on both new contracts to verify deployment - Call
ccipRouter()to verify immutable variables - Call
weth9()andweth10()respectively to verify token addresses - Verify
getDestinationChains()returns empty array initially - Verify
addDestination()function exists (via bytecode inspection)
- Call
Deliverable: New bridge contract addresses with verification results
Command Reference:
# Verify code size
cast code <NEW_BRIDGE_ADDRESS> --rpc-url http://192.168.11.211:8545 | wc -c
# Should be ~15,041 bytes (similar to Mainnet)
# Verify admin
cast call <NEW_BRIDGE_ADDRESS> "admin()(address)" --rpc-url http://192.168.11.211:8545
# Verify functions exist
cast 4byte "addDestination(uint64,address)" # Should return function selector
cast 4byte "getDestinationChains()(uint64[])" # Should return function selector
Task 3.3: Migrate State (if applicable)
Objective: Transfer existing state from old contract to new contract
Subtasks:
-
Extract current state from old contracts
- Read
admin()from old WETH9 bridge:0x4a666f96fc8764181194447a7dfdb7d471b301c8 - Extract CCIP router address (from storage slot 0 or deployment records)
- Extract WETH9 token address (from deployment records)
- Extract WETH10 token address (from deployment records)
- Document any existing destination configurations
- Read
-
Verify new contract state
- Verify new contract admin matches old contract admin
- Verify new contract router matches old contract router
- Verify new contract token addresses match old contract addresses
-
Migrate destination configurations (if any existed)
- If destinations were configured on old contract, document them
- Re-apply configurations to new contracts if needed
- Note: If old contract had no destinations, this step is skipped
Deliverable: State migration report confirming all state transferred correctly
Task 3.4: Configure Bidirectional Destinations
Objective: Configure new bridge contracts to enable ChainID 138 → Mainnet transfers
Subtasks:
-
Configure WETH9 Bridge to Mainnet
- Call
addDestination(uint64,address)on ChainID 138 WETH9 bridge - Parameters:
- Chain selector:
5009297550715157269(Ethereum Mainnet) - Receiver bridge: Mainnet WETH9 bridge address
0x3304b747E565a97ec8AC220b0B6A1f6ffDB837e6
- Chain selector:
- Capture transaction hash
- Wait for confirmation
- Verify destination added
- Call
-
Configure WETH10 Bridge to Mainnet
- Call
addDestination(uint64,address)on ChainID 138 WETH10 bridge - Parameters:
- Chain selector:
5009297550715157269(Ethereum Mainnet) - Receiver bridge: Mainnet WETH10 bridge address
0x8078A09637e47Fa5Ed34F626046Ea2094a5CDE5e
- Chain selector:
- Capture transaction hash
- Wait for confirmation
- Verify destination added
- Call
-
Verify configuration
- Call
getDestinationChains()on ChainID 138 WETH9 bridge - Expected result:
[5009297550715157269] - Call
getDestinationChains()on ChainID 138 WETH10 bridge - Expected result:
[5009297550715157269] - Verify
destinations(5009297550715157269)returns correct receiver bridge addresses
- Call
Deliverable: Configuration verification report with transaction hashes
Command Reference:
# Add destination (WETH9)
cast send <CHAIN138_WETH9_BRIDGE> \
"addDestination(uint64,address)" \
5009297550715157269 \
0x3304b747E565a97ec8AC220b0B6A1f6ffDB837e6 \
--rpc-url http://192.168.11.211:8545 \
--private-key $PRIVATE_KEY
# Verify (WETH9)
cast call <CHAIN138_WETH9_BRIDGE> \
"getDestinationChains()(uint64[])" \
--rpc-url http://192.168.11.211:8545
# Expected: [5009297550715157269]
# Add destination (WETH10)
cast send <CHAIN138_WETH10_BRIDGE> \
"addDestination(uint64,address)" \
5009297550715157269 \
0x8078A09637e47Fa5Ed34F626046Ea2094a5CDE5e \
--rpc-url http://192.168.11.211:8545 \
--private-key $PRIVATE_KEY
# Verify (WETH10)
cast call <CHAIN138_WETH10_BRIDGE> \
"getDestinationChains()(uint64[])" \
--rpc-url http://192.168.11.211:8545
# Expected: [5009297550715157269]
Task 3.5: Test Bidirectional Configuration
Objective: Verify bidirectional bridge functionality works end-to-end
Subtasks:
-
Test Mainnet → ChainID 138 (should already work)
- Perform test transfer from Mainnet to ChainID 138
- Use minimal test amount
- Verify token arrival on ChainID 138
- Document transaction hashes
- ✅ Should succeed (already configured)
-
Test ChainID 138 → Mainnet (new functionality)
- Perform test transfer from ChainID 138 to Mainnet
- Use minimal test amount
- Verify CCIP message creation
- Monitor CCIP message processing
- Verify token arrival on Mainnet
- Document transaction hashes
- ✅ Should now succeed (newly configured)
-
Test both bridges (WETH9 and WETH10)
- Test WETH9 bridge in both directions
- Test WETH10 bridge in both directions
- Document all test results
Deliverable: Test results report with transaction hashes and verification of bidirectional functionality
Task 3.6: Update All References
Objective: Update all documentation, scripts, and integrations to use new bridge addresses
Subtasks:
-
Update documentation
- Update bridge address references in documentation files
- Update configuration guides
- Update deployment records
- Update bridge verification documents
-
Update scripts
- Update deployment scripts with new addresses
- Update configuration scripts
- Update verification scripts
- Update test scripts
-
Update integrations (if applicable)
- Update frontend/explorer references
- Update API configurations
- Update monitoring systems
- Update any hardcoded addresses
-
Create migration notice
- Document old addresses and new addresses
- Create migration guide if needed
- Notify stakeholders of address change
Deliverable: Updated documentation and scripts with new bridge addresses
Files to Update:
- Bridge configuration documentation
- Deployment scripts
- Configuration scripts
- Verification scripts
- Any hardcoded bridge addresses in codebase
📋 ALTERNATIVE: Option C Implementation (Wrapper Pattern)
Note: Only if Option A is not feasible
Task C.1: Design Wrapper Contract
Objective: Design wrapper contract that provides missing interface functions
Subtasks:
- Design contract interface matching Mainnet bridge
- Design storage layout for destination tracking
- Design proxy mechanism for existing bridge calls
- Review gas implications
- Create contract specification
Task C.2: Implement Wrapper Contract
Objective: Implement and test wrapper contract
Subtasks:
- Implement
addDestination()function - Implement
getDestinationChains()function - Implement proxy functions for other bridge operations
- Write unit tests
- Review and audit contract code
Task C.3: Deploy Wrapper Contract
Objective: Deploy wrapper contract and configure
Subtasks:
- Deploy wrapper contract
- Configure destinations via wrapper
- Test wrapper functionality
- Update references to use wrapper address
📊 Success Criteria
Phase 1 Success
- ✅ Test transfer result documented
- ✅ Event logs analyzed
- ✅ Decision point reached (proceed or stop)
Phase 2 Success
- ✅ Resolution option selected
- ✅ Decision documented and approved
Phase 3 Success (Option A)
- ✅ New bridge contracts deployed with full interface
- ✅ State migrated correctly (if applicable)
- ✅ Bidirectional destinations configured
- ✅ End-to-end tests pass in both directions
- ✅ All references updated
Final State:
- Mainnet → ChainID 138: ✅ WORKING
- ChainID 138 → Mainnet: ✅ WORKING
- Result: 100% bidirectional configuration ✅
⏱️ Time Estimates
| Phase | Task | Estimated Time |
|---|---|---|
| Phase 1 | Verify Current State | 1-2 hours |
| Phase 2 | Choose Resolution Option | Decision point (immediate) |
| Phase 3 | Implement Resolution (Option A) | 1-2 days |
| Total | Complete Resolution | 1-3 days |
🔗 Related Documentation
T1_2_BRIDGE_RESOLUTION_PLAN.md- Main resolution planT1_2_BRIDGE_INTERFACE_INVESTIGATION.md- Initial investigationT1_2_BRIDGE_VERSION_ANALYSIS.md- Version analysisscripts/configuration/check-bridge-alternative-config.sh- Investigation script- Bridge deployment scripts in
scripts/deployment/ - Bridge configuration scripts in
scripts/configuration/
📝 Notes
Key Addresses
Mainnet Bridges:
- WETH9 Bridge:
0x3304b747E565a97ec8AC220b0B6A1f6ffDB837e6 - WETH10 Bridge:
0x8078A09637e47Fa5Ed34F626046Ea2094a5CDE5e
ChainID 138 Bridges (Current):
- WETH9 Bridge:
0x3304b747E565a97ec8AC220b0B6A1f6ffDB837e6 - WETH10 Bridge:
0x8078A09637e47Fa5Ed34F626046Ea2094a5CDE5e
ChainID 138 RPC: http://192.168.11.211:8545
Mainnet Chain Selector: 5009297550715157269
Admin Address: 0x4a666f96fc8764181194447a7dfdb7d471b301c8
Current Storage Slots (ChainID 138 Old Contract)
- Slot 0:
0x99b3511a2d315a497c8112c1fdd8d508d4b1e506(likely router/aggregator) - Slot 1:
0x4a666f96fc8764181194447a7dfdb7d471b301c8(admin)
Status: 📋 TASK BREAKDOWN COMPLETE
Last Updated: 2026-01-18