Bridge
Bridge
Section titled “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
Section titled “MessageStatusChanged”event MessageStatusChanged(bytes32 msgHash, enum LibBridgeStatus.MessageStatus status, address transactor)
DestChainEnabled
Section titled “DestChainEnabled”event DestChainEnabled(uint256 chainId, bool enabled)
receive
Section titled “receive”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.
sendMessage
Section titled “sendMessage”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.
releaseEther
Section titled “releaseEther”function releaseEther(struct IBridge.Message message, bytes proof) external
processMessage
Section titled “processMessage”function processMessage(struct IBridge.Message message, bytes proof) external
retryMessage
Section titled “retryMessage”function retryMessage(struct IBridge.Message message, bool isLastAttempt) external
isMessageSent
Section titled “isMessageSent”function isMessageSent(bytes32 msgHash) public view virtual returns (bool)
Checks if a msgHash has been stored on the bridge contract by the current address.
isMessageReceived
Section titled “isMessageReceived”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.
isMessageFailed
Section titled “isMessageFailed”function isMessageFailed(bytes32 msgHash, uint256 destChainId, bytes proof) public view virtual returns (bool)
Checks if a msgHash has been failed on the destination chain.
getMessageStatus
Section titled “getMessageStatus”function getMessageStatus(bytes32 msgHash) public view virtual returns (enum LibBridgeStatus.MessageStatus)
context
Section titled “context”function context() public view returns (struct IBridge.Context)
Returns the bridge state context.
isEtherReleased
Section titled “isEtherReleased”function isEtherReleased(bytes32 msgHash) public view returns (bool)
isDestChainEnabled
Section titled “isDestChainEnabled”function isDestChainEnabled(uint256 _chainId) public view returns (bool enabled)
hashMessage
Section titled “hashMessage”function hashMessage(struct IBridge.Message message) public pure returns (bytes32)
getMessageStatusSlot
Section titled “getMessageStatusSlot”function getMessageStatusSlot(bytes32 msgHash) public pure returns (bytes32)