Emit event

Cross Chain Messaging Protocol makes it possible to send events between different chains. CCMP relies on the events. To start interacting with it, modify your Src smart contract to emit the event.

pragma solidity ^0.8.0;

contract MsgSender {
    event MyMessage(string message);

    function sendMessage(string memory _message) external {
        emit MyMessage(_message);

You could also add destChainId and destAddress params to the event to make it more specific. However, none of those are required, and you could pass any parameters depending on your internal dApp logic.

See the example of sendMessage transaction on the explorer.

Last updated