Crosschain Treasury Introduction
The Crosschain Treasury enables secure asset transfers between EVVM and external blockchains. This multi-chain solution uses interoperability protocols to coordinate asset management across different blockchain networks.
Architecture
The system uses two coordinated stations that communicate through multiple cross-chain protocols:
Host Chain Station (TreasuryHostChainStation)
- Operates on the same blockchain as EVVM
- Handles withdrawals from EVVM balances to external chains
- Receives Fisher bridge deposits from external chains
- Manages EVVM balance integration and updates
- Integrates with EVVM core contract for balance operations
External Chain Station (TreasuryExternalChainStation)
- Deployed on external blockchains where user assets exist
- Handles deposits from users to EVVM ecosystem
- Receives Fisher bridge withdrawals from EVVM
- Manages real asset custody (ERC20 tokens and native coins)
- Provides deposit interfaces for multiple asset types
Supported Protocols
| Protocol | ID | Description |
|---|---|---|
| Hyperlane | 0x01 | Modular interoperability framework |
| LayerZero | 0x02 | Omnichain protocol |
| Axelar | 0x03 | Decentralized cross-chain network |
Fisher Bridge System
Advanced feature enabling gasless cross-chain transactions:
- Gasless Operations: Users don't need native tokens for gas on destination chains
- EIP-191 Signature Authorization: Users sign structured messages to authorize transfers
- Priority Fees: Economic incentives for Fisher executors who process transactions
- Fisher Executor Control: Permissioned addresses with
onlyFisherExecutormodifier - Nonce-Based Security: Replay attack prevention with sequential nonce tracking
- EVVM ID Integration: Cross-instance security through unique EVVM identifiers
When to Use Crosschain Treasury
Ideal for:
- EVVM on different blockchain than user assets
- Multi-chain support requirements
- Advanced features like gasless transactions
- Interoperability protocol integration
Available Functions
Host Chain Station
- withdraw: Withdraw assets to external chains
- Fisher Bridge Functions: Gasless transaction support
- Admin Functions: System management
External Chain Station
- depositERC20: Deposit tokens to EVVM
- depositCoin: Deposit native coins to EVVM
- Fisher Bridge Functions: Gasless transaction support
- Admin Functions: System management
Cross-Chain Flow
External Chain Host Chain
│ │
User Assets ──────→ EVVM Balances
│ │
External Station ←──→ Host Station
The stations coordinate through cross-chain messaging to maintain synchronized asset management.
Available Functions
Host Chain Station Functions
- withdraw: Withdraw assets from EVVM to external chains via cross-chain protocols
- fisherBridgeReceive: Receive Fisher bridge deposits and credit EVVM balances
- fisherBridgeSend: Process Fisher bridge withdrawals with signature verification
- setExternalChainAddress: One-time setup of external station addresses
- Admin Functions: Time-delayed governance and executor management
External Chain Station Functions
- depositERC20: Deposit ERC20 tokens and send to EVVM via cross-chain protocols
- depositCoin: Deposit native coins and send to EVVM via cross-chain protocols
- fisherBridgeReceive: Receive Fisher bridge transactions (validation only)
- fisherBridgeSendERC20: Process Fisher bridge ERC20 transfers to host chain
- fisherBridgeSendCoin: Process Fisher bridge native coin transfers to host chain
- Admin Functions: Time-delayed governance and system configuration
Supporting Libraries
For Fisher Bridge signature requirements and verification, see the Fisher Bridge Signature Structure documentation.
The Treasury Crosschain system implements standardized error handling and data structures for cross-chain operations.
Security Features
- Principal Token Protection: Principal token (MATE) withdrawals blocked via
PrincipalTokenIsNotWithdrawableerror - Cross-Chain Authorization: All messages require sender and chain ID validation
- Fisher Bridge Signatures: EIP-191 compliant signatures with structured message format
- Nonce-Based Protection: Sequential nonce tracking prevents replay attacks
- Time-Delayed Governance: 1-day delays for admin and Fisher executor changes
- Access Control:
onlyAdminandonlyFisherExecutormodifiers restrict critical functions - Protocol Validation: Chain-specific authorization for Hyperlane, LayerZero, and Axelar
- Balance Verification: Insufficient balance checks with
InsufficientBalanceerror protection
Gas Management
Each protocol requires different gas payment mechanisms:
- Hyperlane: Native tokens paid to mailbox contract
- LayerZero: Estimated fees through LayerZero endpoint
- Axelar: Gas service payments for cross-chain execution
Users must provide sufficient native tokens to cover cross-chain transaction costs when initiating transfers.