Messenger
Variables
Message
A properly defined struct to pack essential cross-chain information.
Params
Name | Type | Description |
---|---|---|
| bytes32 | A globally unique identifier for each cross-chain message |
| bytes32 | Indicate the type of a cross-chain message |
| bytes32 | The address of the source chain Anchor in bytes32 |
| bytes | Additional data that depends on the |
| bytes32 | The address of the destination chain Anchor in bytes32 |
| bytes | Application-level data that will be forwarded to the destination consumer contract |
MessageStatus
Returns DELIVERED
when the cross-chain message has been successfully delivered to the destination. Otherwise, FAILED
is signalled, along with an event MessageCached
emitted.
Events
MessageSent
Emits on the source chain with essential cross-chain information packed in a Message
struct.
MessageReceived
Emits on the destination chain where the MessageStatus
can be either DELIVERED
or FAILED
.
MessageCached
Emits when the destination transaction reverted for some reason. A bridge builder should define the error logic in their application-level contracts.
It can be combined with the corresponding MessageReceived
event to recover the original message and identify the reverting reason.
Functions
sendToBool
Called by registered Anchors to forward cross-chain messages to BOOLNetwork.
Params
Name | Type | Description |
---|---|---|
| address payable | The address to receive the rest of the pre-paid transaction fee |
| bytes32 | Indicate the type of a cross-chain message |
| bytes | Additional data that depends on the |
| uint32 | ID of the destination chain |
| bytes32 | The address of the destination chain Anchor in bytes32 |
| bytes | Application-level data that will be forwarded to the destination consumer contract |
Return Values
Name | Type | Description |
---|---|---|
| bytes32 | A globally unique identifier for each cross-chain message |
receiveFromBool
Receives cross-chain messages from BOOLNetwork.
Params
Name | Type | Description |
---|---|---|
| Message | A Message struct consists of all the essential cross-chain information |
| bytes | Signature from a committee which is used to verify the validity of a cross-chain message |
Return Values
Name | Type | Description |
---|---|---|
| MessageStatus | An identifier to present the final status of a cross-chain message |
Last updated