Bridge Mechanisms
Last updated
Last updated
Curvance implements a cross-chain bridging system for CVE tokens, allowing seamless movement between all supported blockchains through the Protocol Messaging Hub. This guide explains how the bridge. The bridging process leverages established bridge providers with these key components:
Native Bridge Integration: Utilizes secure, audited bridges like Wormhole or other similar infrastructure.
Gas Management: Native gas tokens are stored in the Protocol Messaging Hub to pay for cross-chain actions.
Message Verification: Ensures secure cross-chain message delivery with proper verification mechanisms.
Consistent Supply Management: Maintains proper token supply accounting across all chains through burn/mint or lock/release patterns.
The CVE bridge architecture follows a burn-and-mint pattern:
Source Chain: CVE tokens are burned (removed from circulation)
Message Relay: Cross-chain message is sent via the underlying bridge provider
Destination Chain: Equivalent CVE tokens are minted to the recipient
Burns the specified amount of CVE tokens from the caller's balance on the source chain and initiates a cross-chain message through the Protocol Messaging Hub. The message instructs the destination chain to mint an equivalent amount of tokens to the recipient. The function requires a fee payment in native tokens (attached via msg.value) to cover cross-chain messaging costs. The caller must have sufficient CVE balance. Emits a BridgeTokens event upon successful initiation.
Function Signature:
recipient
address
The address that will receive tokens on the destination chain
dstChainId
uint256
The address that will receive tokens on the destination chain
amount
uint256
Amount of CVE tokens to bridge (in wei)
gasLimit
uint256
Gas limit for execution on the destination chain
Returns the estimated amount of native tokens required to pay for the cross-chain bridge operation. The fee varies based on the destination chain, current network conditions, and the specified gas limit. This is a view function that doesn't modify state. The returned fee should be sent along with the bridge function call. Fees typically cover bridge provider costs, destination chain gas fees, and relayer compensation. Higher gas limits increase the fee but provide more execution resources on the destination chain.
Function Signature:
recipient
address
The address receiving the bridged tokens.
amount
uint256
Amount of CVE tokens to mint (in wei)
System-only function called exclusively by the Protocol Messaging Hub to complete the bridging process on the destination chain. It mints the specified amount of CVE tokens to the recipient's address. This function implements strict access control and can only be executed by the authorized Messaging Hub contract. It validates that the message comes from a legitimate source chain and includes appropriate verification. Emits a BridgeTokensComplete event upon successful completion. This function should never be called directly by users or external contracts.
Function Signature:
recipient
address
The address receiving the bridged tokens
amount
uint256
Amount of CVE tokens to mint (in wei)