Arbitrum_ParentMessenger
Arbitrum_ParentMessenger
#
Sends cross chain messages from Ethereum L1 to Arbitrum L2 network.
This contract is ownable and should be owned by the DVM governor.
#
Functionsconstructor(address _inbox, uint256 _childChainId) (public)
Construct the Optimism_ParentMessenger contract.
#
Parameters:- _inbox: Contract that sends generalized messages to the Arbitrum chain.
- _childChainId: The chain id of the Optimism L2 network this messenger should connect to. */
setRefundL2Address(address newRefundl2Address) (public)
Changes the refund address on L2 that receives excess gas or the full msg.value if the retryable ticket reverts.
The caller of this function must be the owner, which should be set to the DVM governor.
#
Parameters:- newRefundl2Address: the new refund address to set. This should be set to an L2 address that is trusted by the owner as it can spend Arbitrum L2 refunds for excess gas when sending transactions on Arbitrum. /
setDefaultGasLimit(uint32 newDefaultGasLimit) (public)
Changes the default gas limit that is sent along with transactions to Arbitrum.
The caller of this function must be the owner, which should be set to the DVM governor.
#
Parameters:- newDefaultGasLimit: the new L2 gas limit to be set. /
setDefaultGasPrice(uint256 newDefaultGasPrice) (public)
Changes the default gas price that is sent along with transactions to Arbitrum.
The caller of this function must be the owner, which should be set to the DVM governor.
#
Parameters:- newDefaultGasPrice: the new L2 gas price to be set. /
setDefaultMaxSubmissionCost(uint256 newDefaultMaxSubmissionCost) (public)
Changes the default max submission cost that is sent along with transactions to Arbitrum.
The caller of this function must be the owner, which should be set to the DVM governor.
#
Parameters:- newDefaultMaxSubmissionCost: the new L2 max submission cost to be set. /
setChildOracleSpoke(address newOracleSpoke) (public)
Changes the address of the oracle spoke on L2 via the child messenger.
The caller of this function must be the owner, which should be set to the DVM governor. This function will only succeed if this contract has enough ETH to cover the approximate L1 call value.
#
Parameters:- newOracleSpoke: the new oracle spoke address set on L2. /
setChildParentMessenger(address newParentMessenger) (public)
Changes the address of the parent messenger on L2 via the child messenger.
The caller of this function must be the owner, which should be set to the DVM governor. This function will only succeed if this contract has enough ETH to cover the approximate L1 call value.
#
Parameters:- newParentMessenger: the new parent messenger contract to be set on L2. /
sendMessageToChild(bytes data) (external)
Sends a message to the child messenger via the canonical message bridge.
The caller must be the either the OracleHub or the GovernorHub. This is to send either a price or initiate a governance action to the OracleSpoke or GovernorSpoke on the child network. The recipient of this message is the child messenger. The messenger must implement processMessageFromParent which then forwards the data to the target either the OracleSpoke or the governorSpoke depending on the caller. This function will only succeed if this contract has enough ETH to cover the approximate L1 call value.
#
Parameters:- data: data message sent to the child messenger. Should be an encoded function call or packed data. /
processMessageFromCrossChainChild(bytes data) (public)
Process a received message from the child messenger via the canonical message bridge.
The caller must be the the child messenger, sent over the canonical message bridge. Note that only the OracleHub can receive messages from the child messenger. Therefore we can always forward these messages to this contract. The OracleHub must implement processMessageFromChild to handle this message.
#
Parameters:- data: data message sent from the child messenger. Should be an encoded function call or packed data. /
getL1CallValue() โ uint256 (public)
This function is expected to be queried by Hub contracts that need to determine how much ETH
to include in msg.value when calling sendMessageToChild
.
fallback() (external)
_getL1CallValue() โ uint256 (internal)
_sendMessageToChild(bytes data, address target) (internal)
_preEntranceCheck() (internal)
_preEntranceSet() (internal)
_postEntranceReset() (internal)
_startReentrantGuardDisabled() (internal)
_endReentrantGuardDisabled() (internal)
setChildMessenger(address newChildMessenger) (public)
Changes the stored address of the child messenger, deployed on L2.
The caller of this function must be the owner. This should be set to the DVM governor.
#
Parameters:- newChildMessenger: address of the new child messenger, deployed on L2.
setOracleHub(address newOracleHub) (public)
Changes the stored address of the Oracle hub, deployed on L1.
The caller of this function must be the owner. This should be set to the DVM governor.
#
Parameters:- newOracleHub: address of the new oracle hub, deployed on L1 Ethereum.
setGovernorHub(address newGovernorHub) (public)
Changes the stored address of the Governor hub, deployed on L1.
The caller of this function must be the owner. This should be set to the DVM governor.
#
Parameters:- newGovernorHub: address of the new governor hub, deployed on L1 Ethereum.
setOracleSpoke(address newOracleSpoke) (public)
Changes the stored address of the oracle spoke, deployed on L2.
The caller of this function must be the owner. This should be set to the DVM governor.
#
Parameters:- newOracleSpoke: address of the new oracle spoke, deployed on L2.
setGovernorSpoke(address newGovernorSpoke) (public)
Changes the stored address of the governor spoke, deployed on L2.
The caller of this function must be the owner. This should be set to the DVM governor.
#
Parameters:- newGovernorSpoke: address of the new governor spoke, deployed on L2.
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)
sendTxToL2NoAliassing(address target, address user, uint256 l1CallValue, uint256 maxSubmissionCost, uint256 maxGas, uint256 gasPriceBid, bytes data) โ uint256 (internal)
#
EventsSetDefaultGasLimit(uint32 newDefaultGasLimit)
SetDefaultMaxSubmissionCost(uint256 newMaxSubmissionCost)
SetDefaultGasPrice(uint256 newDefaultGasPrice)
SetRefundL2Address(address newRefundL2Address)
MessageSentToChild(bytes data, address targetSpoke, uint256 l1CallValue, uint32 gasLimit, uint256 gasPrice, uint256 maxSubmissionCost, address refundL2Address, address childMessenger, uint256 sequenceNumber)
MessageReceivedFromChild(bytes data, address childMessenger, address targetHub)
SetChildMessenger(address childMessenger)
SetOracleHub(address oracleHub)
SetGovernorHub(address governorHub)
SetOracleSpoke(address oracleSpoke)
SetGovernorSpoke(address governorSpoke)
OwnershipTransferred(address previousOwner, address newOwner)
#
ModifiersnonReentrant()
Prevents a contract from calling itself, directly or indirectly.
Calling a nonReentrant
function from another nonReentrant
function is not supported. It is possible to
prevent this from happening by making the nonReentrant
function external, and making it call a private
function that does the actual state modification.
nonReentrantView()
Designed to prevent a view-only method from being re-entered during a call to a nonReentrant()
state-changing method.
onlyHubContract()
onlyOwner()
Throws if called by any account other than the owner.
onlyFromCrossDomainAccount(address l2Counterpart)