MessageProxyForMainnet

Runs on Mainnet, contains functions to manage the incoming messages from targetSchainName and outgoing messages to fromSchainName. Every SKALE chain with IMA is therefore connected to MessageProxyForMainnet.

Messages from SKALE chains are signed using BLS threshold signatures from the nodes in the chain. Since Ethereum Mainnet has no BLS public key, mainnet messages do not need to be signed.

Modifiers

addConnectedChain addConnectedChain(string schainName) external

Allows msg.sender to connect schain with MessageProxyOnMainnet for transferring messages.

Requirements:

  • Schain name must not be Mainnet.

setCommunityPool setCommunityPool(contract CommunityPool newCommunityPoolAddress) external

Allows owner of the contract to set CommunityPool address for gas reimbursement.

Requirements:

  • msg.sender must be granted as DEFAULT_ADMIN_ROLE.

  • Address of CommunityPool contract must not be null.

registerExtraContract registerExtraContract(string schainName, address extraContract) external

Allows msg.sender to register extra contract for being able to transfer messages from custom contracts.

Requirements:

  • msg.sender must be granted as EXTRA_CONTRACT_REGISTRAR_ROLE.

  • Schain name must not be Mainnet.

removeExtraContract removeExtraContract(string schainName, address extraContract) external

Allows msg.sender to remove extra contract, thus extraContract will no longer be available to transfer messages from mainnet to schain.

Requirements:

  • msg.sender must be granted as EXTRA_CONTRACT_REGISTRAR_ROLE.

  • Schain name must not be Mainnet.

postIncomingMessages postIncomingMessages(string fromSchainName, uint256 startingCounter, struct MessageProxy.Message[] messages, struct MessageProxy.Signature sign) external

Posts incoming message from fromSchainName.

Requirements:

  • msg.sender must be authorized caller.

  • fromSchainName must be initialized.

  • startingCounter must be equal to the chain’s incoming message counter.

  • If destination chain is Mainnet, message signature must be valid.

setNewHeaderMessageGasCost setNewHeaderMessageGasCost(uint256 newHeaderMessageGasCost) external

Sets headerMessageGasCost to a new value.

Requirements:

  • msg.sender must be granted as CONSTANT_SETTER_ROLE.

setNewMessageGasCost setNewMessageGasCost(uint256 newMessageGasCost) external

Sets messageGasCost to a new value.

Requirements:

  • msg.sender must be granted as CONSTANT_SETTER_ROLE.

isConnectedChain isConnectedChain(string schainName) → bool public

Checks whether chain is currently connected.

Note: Mainnet chain does not have a public key, and is implicitly connected to MessageProxy.

Requirements:

  • schainName must not be Mainnet.

initialize initialize(contract IContractManager contractManagerOfSkaleManagerValue) public

Creates a new MessageProxyForMainnet contract.

_verifyMessages _verifyMessages(string fromSchainName, bytes32 hashedMessages, struct MessageProxy.Signature sign) → bool internal

Converts calldata structure to memory structure and checks whether message BLS signature is valid.

_checkSchainBalance _checkSchainBalance(bytes32 schainHash) → bool internal

GasCostMessageHeaderWasChanged GasCostMessageHeaderWasChanged(uint256 oldValue, uint256 newValue) event

Emitted when gas cost for message header was changed.

GasCostMessageWasChanged GasCostMessageWasChanged(uint256 oldValue, uint256 newValue) event

Emitted when gas cost for message was changed.