Generalized Messaging Protocol
Overview
Contract Design
Events
event Message(
uint256 indexed srcChainId,
bytes indexed srcAddress,
uint256 indexed connSn,
uint256 dstChainId,
bytes dstAddress,
bytes payload
);State Variables
address public owner; // Contract owner with privileges to update configurations and relayers, (how to upgrade and manage relays safely?)
address public feeHandler; // Contract owner with privileges to update configurations and relayers, (how to upgrade and manage relays safely?)
bytes32[] public relayers; // List of authorized relayers for message verification
uint256 public connSn; // Serial number for outgoing messages, ensuring unique identification
uint256 public chainId; // Chain ID of the current contract’s chain
mapping(uint256 => mapping(uint256 => bool)) public receipts; // Tracks processed messages to prevent duplicationFees
Functions
sendMessage
sendMessageverifyMessage
verifyMessageExample DApp: Using ICON GMP for Cross-Chain Messaging
Sending Messages
Receiving Messages
Alternative Message Consumption
Encoding Compliance
Last updated