Skip to main content

Optimism_Messenger

Optimism_Messenger#

Sends cross chain messages Optimism L2 network.

This contract's owner should be set to the BridgeAdmin deployed on the same L1 network so that only the BridgeAdmin can call cross-chain administrative functions on the L2 DepositBox via this messenger.

Functions#

constructor(address _crossDomainMessenger) (public)
relayMessage(address target, address, uint256, uint256 gasLimit, uint256, uint256, bytes message) (external)

Sends a message to an account on L2.

Parameters:#

  • target: The intended recipient on L2.
  • gasLimit: The gasLimit for the receipt of the message on L2.
  • message: The data to send to the target (usually calldata to a function with onlyFromCrossDomainAccount())
getCrossDomainMessenger() โ†’ contract ICrossDomainMessenger (internal)

Gets the messenger, usually from storage. This function is exposed in case a child contract needs to override.

sendCrossDomainMessage(address _crossDomainTarget, uint32 _gasLimit, bytes _message) (internal)

q Sends a message to an account on another domain

Parameters:#

  • _crossDomainTarget: The intended recipient on the destination domain
  • _message: The data to send to the target (usually calldata to a function with onlyFromCrossDomainAccount())
  • _gasLimit: The gasLimit for the receipt of the message on the target domain.
owner() โ†’ address (public)

Returns the address of the current owner.

renounceOwnership() (public)

Leaves the contract without owner. It will not be possible to call onlyOwner functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.

transferOwnership(address newOwner) (public)

Transfers ownership of the contract to a new account (newOwner). Can only be called by the current owner.

_msgSender() โ†’ address (internal)
_msgData() โ†’ bytes (internal)

Events#

OwnershipTransferred(address previousOwner, address newOwner)

Modifiers#

onlyFromCrossDomainAccount(address _sourceDomainAccount)

Enforces that the modified function is only callable by a specific cross-domain account.

Parameters:

  • _sourceDomainAccount: The only account on the originating domain which is authenticated to call this function.
onlyOwner()

Throws if called by any account other than the owner.