GlacisRouter

Your gateway to cross-chain activity.

The GlacisRouter smart contract acts as the on-chain interface for all cross-chain activity with Glacis.

You can discover the source smart contract GlacisRouter.sol in this repository.

The Route Function

The main function in GlacisRouter is route, which sends a cross-chain message. It comes in the following varieties, each which return a bytes32 messageId:

route(
	uint256 chainId,
	address to,
	bytes memory payload,
	uint8[] memory gmps,
	bool retriable)
returns(bytes32)

The Retry Route

There is an additional route function variant that hasn't been mentioned yet:

routeRetry(
	uint256 chainId,
	address to,
	bytes memory payload,
	uint8[] memory gmps,
	bytes32 messageId,
	uint256 nonce)
	returns(bytes32)

This route cannot be used for original cross-chain messages. Instead, it is used to retry a cross-chain message with an identical message ID and identical data (but potentially through a different GMP). This can be helpful in cases where a message is somehow lost by a GMP's consensus mechanism or its relayers. An identical message would be sent, and whichever message arrives after the first will revert.

Two additional parameters are required with this function:

Only the original message sender can retry a message, no other address can do it on their behalf. Also note that identical data must be provided.

Read-Only

These are the read-only functions in GlacisRouter, but most developers won't use them:

Errors

It also includes the following errors, some of which you may encounter:

Last updated