Skip to content

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.

event MessageStatusChanged(bytes32 msgHash, enum LibBridgeStatus.MessageStatus status, address transactor)
event DestChainEnabled(uint256 chainId, bool enabled)
receive() external payable

Allow Bridge to receive ETH from the TokenVault or EtherVault.

function init(address _addressManager) external

Initializer to be called after being deployed behind a proxy.

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

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

function releaseEther(struct IBridge.Message message, bytes proof) external
function processMessage(struct IBridge.Message message, bytes proof) external
function retryMessage(struct IBridge.Message message, bool isLastAttempt) external
function isMessageSent(bytes32 msgHash) public view virtual returns (bool)

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

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

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

function isMessageFailed(bytes32 msgHash, uint256 destChainId, bytes proof) public view virtual returns (bool)

Checks if a msgHash has been failed on the destination chain.

function getMessageStatus(bytes32 msgHash) public view virtual returns (enum LibBridgeStatus.MessageStatus)
function context() public view returns (struct IBridge.Context)

Returns the bridge state context.

function isEtherReleased(bytes32 msgHash) public view returns (bool)
function isDestChainEnabled(uint256 _chainId) public view returns (bool enabled)
function hashMessage(struct IBridge.Message message) public pure returns (bytes32)
function getMessageStatusSlot(bytes32 msgHash) public pure returns (bytes32)