smart-contracts/backlog/tasks/task-8 - Implement-CCIP-Hub...

59 lines
1.9 KiB
Markdown

---
id: TASK-8
title: Implement CCIP Hub-Spoke Cross-Chain Architecture
status: To Do
assignee: []
created_date: '2026-04-03 21:41'
labels:
- solidity
- ccip
- crosschain
dependencies:
- TASK-2
- TASK-5
references:
- /home/jeffe/Github/myco-bonding-curve/src/crosschain/hub_spoke.py
documentation:
- backlog/docs/402_CRDT_CrossChain_Fiat_Research.md
priority: high
---
## Description
<!-- SECTION:DESCRIPTION:BEGIN -->
Port src/crosschain/hub_spoke.py to production Chainlink CCIP contracts.
Architecture:
- HubRegistry.sol (Base) — central state, bonding curve, tranche manager
- SpokeVault.sol (ETH/ARB/OP/Polygon) — collateral vault, accepts deposits, sends CCIP messages
CCIP Message Types:
1. DEPOSIT_COLLATERAL — spoke→hub: asset deposited, amount, value
2. STATE_SYNC — hub→spoke: updated prices, tranche health, system CR
3. REBALANCE — hub→spoke: move collateral between spokes
4. EMERGENCY_PAUSE — hub→spoke: halt deposits/withdrawals
Token Standard:
- Use CCIP Cross-Chain Token (CCT) for $MYCO and tranche tokens
- BurnMintTokenPool for tokens we control mint rights on
- Programmable token transfers: send tokens + instructions atomically
Alternative layer: LayerZero OFT for wider DEX compatibility
- Consider dual-standard: CCIP for state sync, OFT for token transfers
Security:
- CCIP Risk Management Network monitors all cross-chain messages
- Rate limiting per spoke per time window
- Emergency pause callable by multisig
<!-- SECTION:DESCRIPTION:END -->
## Acceptance Criteria
<!-- AC:BEGIN -->
- [ ] #1 Hub receives CCIP messages from spoke vaults on 4+ chains
- [ ] #2 Spoke deposits correctly update hub state via CCIP
- [ ] #3 State sync messages propagate tranche health to all spokes
- [ ] #4 Emergency pause halts all cross-chain activity
- [ ] #5 Rate limiting prevents single-spoke drain
- [ ] #6 Tested on CCIP testnet (Sepolia, Fuji, Mumbai)
<!-- AC:END -->