MessageServiceBase
messageService
contract IMessageService messageService
The message service address on the current chain.
remoteSender
address remoteSender
The token bridge on the alternate/remote chain.
RemoteSenderSet
event RemoteSenderSet(address remoteSender, address setter)
Event emitted when the remote sender is set.
Parameters
Name | Type | Description |
---|---|---|
remoteSender | address | The address of the new remote sender. |
setter | address | The address of the account that set the remote sender. |
CallerIsNotMessageService
error CallerIsNotMessageService()
Thrown when the caller address is not the message service address
SenderNotAuthorized
error SenderNotAuthorized()
Thrown when remote sender address is not authorized.
onlyMessagingService
modifier onlyMessagingService()
_Modifier to make sure the caller is the known message service.
Requirements:
- The msg.sender must be the message service._
onlyAuthorizedRemoteSender
modifier onlyAuthorizedRemoteSender()
_Modifier to make sure the original sender is allowed.
Requirements:
- The original message sender via the message service must be a known sender._
__MessageServiceBase_init
function __MessageServiceBase_init(address _messageService) internal
Initializes the message service
Must be initialized in the initialize function of the main contract or constructor.
Parameters
Name | Type | Description |
---|---|---|
_messageService | address | The message service address, cannot be empty. |
_setRemoteSender
function _setRemoteSender(address _remoteSender) internal
Sets the remote sender
This function sets the remote sender address and emits the RemoteSenderSet event.
Parameters
Name | Type | Description |
---|---|---|
_remoteSender | address | The authorized remote sender address, cannot be empty. |