Getting Started
Glacis Client
contract GlacisClientTextSample is GlacisClientOwnable {
string public currentMessage;
constructor(
address glacisRouter_,
address owner_
) GlacisClientOwnable(glacisRouter_, 1, owner_) {}
function sendMessage(
address to,
uint256 chainId,
string memory message,
uint8[] memory gmps,
uint256[] memory fees
) external payable returns (bytes32) {
return
_route(
chainId,
to,
abi.encode(message),
gmps,
fees,
msg.sender,
false,
msg.value
);
}
function _receiveMessage(
uint8[] calldata, // fromGmpId,
uint256, // fromChainId,
address, // fromAddress,
bytes memory payload
) internal override {
(currentMessage) = abi.decode(payload, (string));
}
}GlacisClient Initialization

Sending a Message


Last updated