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.
| Parameter | Type | Description |
|---|---|---|
| from | address | Sender on Sepolia |
| to | address | Recipient on the rollup |
| amount | uint256 | Amount of ETH received |
| extraData | bytes | Additional 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.
| Parameter | Type | Description |
|---|---|---|
| localToken | address | CET address on the rollup |
| remoteToken | address | Canonical ERC20 token address on Sepolia |
| from | address | Sender on Sepolia |
| to | address | Recipient on the rollup |
| amount | uint256 | Amount to mint |
| extraData | bytes | Additional 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.
| Parameter | Type | Description |
|---|---|---|
| minGasLimit | uint32 | Minimum gas limit for the Sepolia-side execution |
| extraData | bytes | Additional 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.
| Parameter | Type | Description |
|---|---|---|
| to | address | Recipient on Sepolia |
| minGasLimit | uint32 | Minimum gas limit for the Sepolia-side execution |
| extraData | bytes | Additional 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.
| Parameter | Type | Description |
|---|---|---|
| localToken | address | CET address on the rollup |
| remoteToken | address | Canonical ERC20 token address on Sepolia |
| amount | uint256 | Amount to withdraw |
| minGasLimit | uint32 | Minimum gas limit for the Sepolia-side execution |
| extraData | bytes | Additional 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.
| Parameter | Type | Description |
|---|---|---|
| localToken | address | CET address on the rollup |
| remoteToken | address | Canonical ERC20 token address on Sepolia |
| to | address | Recipient on Sepolia |
| amount | uint256 | Amount to withdraw |
| minGasLimit | uint32 | Minimum gas limit for the Sepolia-side execution |
| extraData | bytes | Additional 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.