Skip to main content

Rollup Bridge

The L2ComposeBridge contract is the rollup-side bridge for deposits arriving from Sepolia and withdrawals returning to Sepolia.

Overview

L2ComposeBridge is responsible for:

  • Finalizing deposits coming from Sepolia
  • Ensuring the correct CET representation exists on the rollup for Layer 1-originated ERC20 assets
  • Minting CET on deposit finalization
  • Burning CET when initiating withdrawals back to Sepolia
  • Sending withdrawal messages back toward ComposeL1Bridge

ETH remains native throughout deposits from Sepolia and withdrawals back to Sepolia. ERC20 withdrawals use CET burn on the rollup and canonical asset release on Layer 1.

Contract Interface

contract L2ComposeBridge {
function bridgeETH(...) external payable;
function bridgeETHTo(...) external payable;
function bridgeERC20(...) external;
function bridgeERC20To(...) external;
function finalizeBridgeETH(...) external payable;
function finalizeBridgeERC20(...) external;
}

Functions

finalizeBridgeETH(_from, _to, _amount, _extraData)

Description: Finalizes an ETH deposit arriving from Sepolia.

ParameterTypeDescription
fromaddressSender on Sepolia
toaddressRecipient on the rollup
amountuint256Amount of ETH received
extraDatabytesAdditional bridge data

Events:

  • ETHBridgeFinalized(address indexed from, address indexed to, uint256 amount, bytes extraData)

finalizeBridgeERC20(_localToken, _remoteToken, _from, _to, _amount, _extraData)

Description: Finalizes an ERC20 deposit by ensuring the correct CET exists on the rollup and minting it to the recipient.

ParameterTypeDescription
localTokenaddressCET address on the rollup
remoteTokenaddressCanonical ERC20 token address on Sepolia
fromaddressSender on Sepolia
toaddressRecipient on the rollup
amountuint256Amount to mint
extraDatabytesAdditional bridge data, including token metadata when needed

Events:

  • ERC20BridgeFinalized(address indexed localToken, address indexed remoteToken, address indexed from, address to, uint256 amount, bytes extraData)

bridgeETH(_minGasLimit, _extraData)

Description: Initiates an ETH withdrawal from the rollup back to the caller's address on Sepolia.

ParameterTypeDescription
minGasLimituint32Minimum gas limit for the Sepolia-side execution
extraDatabytesAdditional bridge data

Events:

  • ETHBridgeInitiated(address indexed from, address indexed to, uint256 amount, bytes extraData)

bridgeETHTo(_to, _minGasLimit, _extraData)

Description: Initiates an ETH withdrawal from the rollup back to a specified recipient on Sepolia.

ParameterTypeDescription
toaddressRecipient on Sepolia
minGasLimituint32Minimum gas limit for the Sepolia-side execution
extraDatabytesAdditional bridge data

Events:

  • ETHBridgeInitiated(address indexed from, address indexed to, uint256 amount, bytes extraData)

bridgeERC20(_localToken, _remoteToken, _amount, _minGasLimit, _extraData)

Description: Initiates an ERC20 withdrawal from the rollup back to the caller's address on Sepolia.

ParameterTypeDescription
localTokenaddressCET address on the rollup
remoteTokenaddressCanonical ERC20 token address on Sepolia
amountuint256Amount to withdraw
minGasLimituint32Minimum gas limit for the Sepolia-side execution
extraDatabytesAdditional bridge data

Events:

  • ERC20BridgeInitiated(address indexed localToken, address indexed remoteToken, address indexed from, address to, uint256 amount, bytes extraData)

bridgeERC20To(_localToken, _remoteToken, _to, _amount, _minGasLimit, _extraData)

Description: Initiates an ERC20 withdrawal from the rollup back to a specified recipient on Sepolia.

ParameterTypeDescription
localTokenaddressCET address on the rollup
remoteTokenaddressCanonical ERC20 token address on Sepolia
toaddressRecipient on Sepolia
amountuint256Amount to withdraw
minGasLimituint32Minimum gas limit for the Sepolia-side execution
extraDatabytesAdditional bridge data

Events:

  • ERC20BridgeInitiated(address indexed localToken, address indexed remoteToken, address indexed from, address to, uint256 amount, bytes extraData)

Events

ETHBridgeInitiated

event ETHBridgeInitiated(address indexed from, address indexed to, uint256 amount, bytes extraData)

Emitted when an ETH withdrawal is initiated from the rollup.

ETHBridgeFinalized

event ETHBridgeFinalized(address indexed from, address indexed to, uint256 amount, bytes extraData)

Emitted when an ETH deposit is finalized on the rollup.

ERC20BridgeInitiated

event ERC20BridgeInitiated(address indexed localToken, address indexed remoteToken, address indexed from, address to, uint256 amount, bytes extraData)

Emitted when an ERC20 withdrawal is initiated from the rollup.

ERC20BridgeFinalized

event ERC20BridgeFinalized(address indexed localToken, address indexed remoteToken, address indexed from, address to, uint256 amount, bytes extraData)

Emitted when an ERC20 deposit is finalized on the rollup.