Anchor.sol
Constants
PURE_MESSAGE
VALUE_MESSAGE
BOOLNetwork ONLY supports PURE_MESSAGE
type cross-chain messages at the current Testnet stage. VALUE_MESSAGE
has not been enabled yet and hence submitting this type of message will lead to a transaction revert.
Functions
updateConsumer
Updates the consumer contract that is uniquely binding to the anchor. This method can only be called by the current owner
.
Params
Name | Type | Description |
---|---|---|
| address | The address of the new consumer to use this Anchor as the cross-chain endpoint |
sendToMessenger
Calls anchor to forward the cross-chain message to the BOOLNetwork messenger on the source chain. This method can only be called by the consumer contract that is uniquely binding to the anchor.
Parameters:
Name | Type | Description |
---|---|---|
| address | The address to receive the refund 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 |
| address | The address of the destination chain Anchor |
| 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 |
receiveFromMessenger
Called by the Messenger contract on the local chain to receive the cross-chain message from the source chain and forward it to the connected consumer contract.
Params
Name | Type | Description |
---|---|---|
| bytes32 | A globally unique identifier for each cross-chain message |
| bytes32 | Indicate the type of a cross-chain message |
| bytes | Additional data that depends on the |
| bytes32 | The address of the source chain Anchor in bytes32 |
| bytes | Application-level data that will be forwarded to the destination consumer contract |
Last updated