MessageProxyForMainnet

messageInProgressLocker messageInProgressLocker() modifier

Reentrancy guard for postIncomingMessages.

whenNotPaused whenNotPaused(bytes32 schainHash) modifier

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 ICommunityPool 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 IMessageProxy.Message[] messages, struct IMessageProxy.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.

setVersion setVersion(string newVersion) external

Sets new version of contracts on mainnet

Requirements:

  • msg.sender must be granted DEFAULT_ADMIN_ROLE.

pause pause(string schainName) external

Allows PAUSABLE_ROLE to pause IMA bridge unlimited or DEFAULT_ADMIN_ROLE to pause for 4 hours or schain owner to pause unlimited after DEFAULT_ADMIN_ROLE pause it

Requirements:

  • IMA bridge to current schain was not paused

  • Sender should be PAUSABLE_ROLE, DEFAULT_ADMIN_ROLE or schain owner

resume resume(string schainName) external

Allows DEFAULT_ADMIN_ROLE or schain owner to resume IMA bridge

Requirements:

  • IMA bridge to current schain was paused

  • Sender should be DEFAULT_ADMIN_ROLE or schain owner

initialize initialize(contract IContractManager contractManagerOfSkaleManagerValue) public

Creates a new MessageProxyForMainnet contract.

postOutgoingMessage postOutgoingMessage(bytes32 targetChainHash, address targetContract, bytes data) public

PostOutgoingMessage function with whenNotPaused modifier

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.

isPaused isPaused(bytes32 schainHash) → bool public

Returns true if IMA to schain is paused.

_authorizeOutgoingMessageSender _authorizeOutgoingMessageSender(bytes32 targetChainHash) internal

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

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

_checkSchainBalance _checkSchainBalance(bytes32 schainHash) → bool internal

Checks whether balance of schain wallet is sufficient for for reimbursement custom message.

_getRegistryContracts _getRegistryContracts() → mapping(bytes32 => struct EnumerableSetUpgradeable.AddressSet) internal

Returns list of registered custom extra contracts.

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.

SchainPaused SchainPaused(bytes32 schainHash) event

Emitted when the schain is paused

SchainResumed SchainResumed(bytes32 schainHash) event

Emitted when the schain is resumed