Function Calls
Function Call #1 – Calling The Receivers
Caller
Explainer
The `propose` function is designed to emit a structured event containing details about a proposed interaction with a protocol on possibly another blockchain.
This event can then be caught by Receivers, which may perform further actions such as validating the proposal, executing cross-chain calls, or any other required process as per the system's design.
Function Call #2 – Receive Prompt From End Point
Explainer
This `receiver`function, is designed to be triggered by an End Point contract on a destination blockchain network as part of an operation that has gained consensus approval. This role restriction ensures that only authorized entities can trigger this function, enhancing security.
The function receives a single parameter, `data`, which is a byte array (`bytes calldata`). This array encapsulates multiple pieces of information:
protocolId: The identifier of protocol, where this operation was created and approved.
srcChainId: The ID of the source blockchain from which the operation originated.
srcBlockNumber: The block number on the source blockchain at which the operation was initiated or recorded.
srcOpTxId: A unique identifier (transaction ID) for the operation on the source blockchain.
payload: Additional data associated with the operation, which can be specific to the operation's context.
The function begins by decoding the `data` parameter to extract the `srcChainId`, `srcBlockNumber`, `srcOpTxId`, and the `payload`. This is done using the `abi.decode` function.
After extracting the basic information, the function further decodes the `payload` to obtain more specific data relevant to the operation.
For Web2 triggers, the srcChainId, srcBlockNumber, and srcOpTxId parameters can contain information about source identifier. This can be beneficial for processing information from various sources differently.
Last updated