Multichain Lock Migration
Overview
Curvance's veCVE (Voting Escrow CVE) implements a novel multichain lock system that allows users to transfer their voting escrow locks seamlessly between different blockchains in the Curvance ecosystem. This functionality enables users to participate in different chain economies while maintaining their governance and reward positions.
How Multichain Lock Migration Works
Data Flow
The lock migration process follows these steps:
User initiates a bridge operation on the source chain
The system processes rewards and verifies lock eligibility
User points and unlock data are updated on the source chain
The veCVE tokens are burned on the source chain
The underlying CVE tokens are burned with destination data
A cross-chain message is sent via the Messaging Hub
The Messaging Hub on the destination chain receives the message
New CVE tokens are minted on the destination chain
A new veCVE lock is created with equivalent parameters on the destination chain
State Transitions
All pending rewards are claimed before migration
Non-expired locks can be migrated (expired locks must be processed separately)
User points are properly adjusted on both chains
Lock continuity is maintained (continuous or non-continuous lock status)
User Functions
bridgeLock()
This function allows users to move a lock from the current chain to a destination chain while claiming any pending rewards.
Function signature:
lockIndex
uint256
The index of the lock to bridge
bridgeData
BridgeData
Struct containing instructions for the bridge operation including destination chain ID, continuous lock status, and gas limit
rewardsData
RewardsData
Data for claiming pending rewards before migration
params
bytes
Parameters for rewards claim function
aux
uint256
Auxiliary data for reward processing
Usage Notes:
The function is payable as cross-chain messaging requires native tokens for gas fees
Only non-expired locks can be bridged
The function automatically claims pending rewards before migration
If the user has no remaining locks after the bridge operation, their reward claim index is reset
Cross-Chain Messaging
The bridge operation relies on Curvance's Messaging Hub, which handles cross-chain communication. When a lock is bridged:
The MessagingHub sends a message with payload type 4 (veCVE lock migration)
The message contains the recipient address, token amount, and continuous lock status
On the destination chain, the MessagingHub receives the message and:
Mints the required CVE tokens
Creates a new veCVE lock with the same properties
Benefits of Multichain Lock Migration
Liquidity Flexibility: Users can move their governance power to chains where they wish to participate more actively
Fee Optimization: Chains can compete to attract veCVE holders, potentially offering better fee structures
Cross-Chain Participation: Users can participate in different blockchain ecosystems while maintaining their governance position
Chain-Specific Opportunities: Users can take advantage of opportunities specific to different chains without sacrificing their veCVE position
Multichain lock migration is one of the key innovations in Curvance's voting escrow system, distinguishing it from traditional single-chain voting escrow implementations.
Last updated