Docs
Reference
Bridge
Bridge

Bridge

Bridge contract which is deployed on both L1 and L2. Mostly a thin wrapper which calls the library implementations. See IBridge for more details.

The code hash for the same address on L1 and L2 may be different.

MessageStatusChanged

event MessageStatusChanged(bytes32 signal, enum LibBridgeStatus.MessageStatus status)

DestChainEnabled

event DestChainEnabled(uint256 chainId, bool enabled)

receive

receive() external payable

Allow Bridge to receive ETH from EtherVault.

init

function init(address _addressManager) external

Initializer to be called after being deployed behind a proxy.

sendMessage

function sendMessage(struct IBridge.Message message) external payable returns (bytes32 signal)

Sends a message to the destination chain and takes custody of Ether required in this contract. All extra Ether will be refunded.

sendSignal

function sendSignal(bytes32 signal) external

Stores a signal on the bridge contract and emits an event for the relayer to pick up.

processMessage

function processMessage(struct IBridge.Message message, bytes proof) external

retryMessage

function retryMessage(struct IBridge.Message message, bool isLastAttempt) external

isMessageSent

function isMessageSent(bytes32 signal) public view virtual returns (bool)

Checks if a signal has been stored on the bridge contract by the current address.

isMessageReceived

function isMessageReceived(bytes32 signal, uint256 srcChainId, bytes proof) public view virtual returns (bool)

Checks if a signal has been received on the destination chain and sent by the src chain.

isSignalSent

function isSignalSent(address sender, bytes32 signal) public view virtual returns (bool)

Checks if a signal has been stored on the bridge contract by the specified address.

isSignalReceived

function isSignalReceived(bytes32 signal, uint256 srcChainId, address sender, bytes proof) public view virtual returns (bool)

Check if a signal has been received on the destination chain and sent by the specified sender.

getMessageStatus

function getMessageStatus(bytes32 signal) public view virtual returns (enum LibBridgeStatus.MessageStatus)

context

function context() public view returns (struct IBridge.Context)

Returns the bridge state context.

isDestChainEnabled

function isDestChainEnabled(uint256 _chainId) public view returns (bool)

getMessageStatusSlot

function getMessageStatusSlot(bytes32 signal) public pure returns (bytes32)