Skip to main content

bridge

BRIDGING Operations

OperationsExternal Call Operations → Bridge Operations (Call Forwarder)

Execute cross-chain bridge operations through supported bridge protocols.

Supported Bridges

BridgeIDDescription
Stargate V20x00Stargate V2 bridge protocol
Across0x0AAcross bridge protocol

BridgeIds Enum

ValueNameDescription
0x00STARGATE_V2Stargate V2 bridge protocol
0x0AACROSSAcross bridge protocol

Parameters

OffsetLength (bytes)Description
01bridgeId uint8
1Variablebridge-specific parameters

Encoding Example

bytes memory bridgeOp = abi.encodePacked(
uint8(ComposerCommands.BRIDGING),
uint8(BridgeIds.STARGATE_V2),
// Stargate V2 specific parameters...
);

Usage Context

Important: Bridge operations can only be executed through the Call Forwarder and require a two-layer calling structure:

Example

// 1. Create the bridge operation for Call Forwarder
bytes memory bridgeOp = abi.encodePacked(
uint8(ComposerCommands.BRIDGING),
uint8(BridgeIds.STARGATE_V2),
// ... bridge parameters
);

// 2. Wrap in EXT_CALL to Call Forwarder
bytes memory fullCall = abi.encodePacked(
uint8(ComposerCommands.EXT_CALL),
address(callForwarder), // Call Forwarder address
uint128(0), // No native value for Call Forwarder
uint16(bridgeOp.length), // Bridge operation length
bridgeOp // Bridge operation data
);

// 3. Execute on main composer
composer.deltaCompose(fullCall);