Skip to main content

Arbitrum_Messenger

Arbitrum_Messenger#

Sends cross chain messages Arbitrum 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. This address will be the sender of any L1 --> L2 retryable tickets, so it should be set as the cross domain owner for L2 contracts that expect to receive cross domain messages.

Functions#

constructor(address _inbox) (public)

Parameters:#

  • _inbox: Contract that sends generalized messages to the Arbitrum chain.
relayMessage(address target, address userToRefund, uint256 l1CallValue, uint256 gasLimit, uint256 gasPrice, uint256 maxSubmissionCost, bytes message) (external)

Sends a message to an account on L2. If this message reverts on l2 for any reason it can either be resent on L1, or redeemed on L2 manually. To learn more see how "retryable tickets" work on Arbitrum https://developer.offchainlabs.com/docs/l1_l2_messages#parameters

Parameters:#

  • target: The intended recipient on L2.
  • userToRefund: User on L2 to refund extra fees to.
  • l1CallValue: Amount of ETH deposited to target contract on L2. Used to pay for L2 submission fee and l2CallValue. This will usually be > 0.
  • gasLimit: The gasLimit for the receipt of the message on L2.
  • gasPrice: Gas price bid for L2 execution.
  • Max: gas deducted from user's L2 balance to cover base submission fee. This amount is proportional to the size of data.
  • message: The data to send to the target (usually calldata to a function with onlyFromCrossDomainAccount())
sendTxToL2NoAliassing(address target, address user, uint256 l1CallValue, uint256 maxSubmissionCost, uint256 maxGas, uint256 gasPriceBid, bytes data) โ†’ uint256 (internal)
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.

_transferOwnership(address newOwner) (internal)

Transfers ownership of the contract to a new account (newOwner). Internal function without access restriction.

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

Events#

RelayedMessage(address from, address to, uint256 seqNum, address userToRefund, uint256 l1CallValue, uint256 gasLimit, uint256 gasPrice, uint256 maxSubmissionCost, bytes data)
OwnershipTransferred(address previousOwner, address newOwner)

Modifiers#

onlyFromCrossDomainAccount(address l2Counterpart)
onlyOwner()

Throws if called by any account other than the owner.