IORMP

Git Source

Functions

send

follow https://eips.ethereum.org/EIPS/eip-5750

Send a cross-chain message over the endpoint.

function send(
    uint256 toChainId,
    address to,
    uint256 gasLimit,
    bytes calldata encoded,
    address refund,
    bytes calldata params
) external payable returns (bytes32);

Parameters

NameTypeDescription
toChainIduint256The Message destination chain id.
toaddressUser application contract address which receive the message.
gasLimituint256Gas limit for destination user application used.
encodedbytesThe calldata which encoded by ABI Encoding.
refundaddressReturn extra fee to refund address.
paramsbytesGeneral extensibility for relayer to custom functionality.

Returns

NameTypeDescription
<none>bytes32Return the hash of the message as message id.

fee

Get a quote in source native gas, for the amount that send() requires to pay for message delivery.

function fee(uint256 toChainId, address ua, uint256 gasLimit, bytes calldata encoded, bytes calldata params)
    external
    view
    returns (uint256);

Parameters

NameTypeDescription
toChainIduint256The Message destination chain id.
uaaddress
gasLimituint256Gas limit for destination user application used.
encodedbytesThe calldata which encoded by ABI Encoding.
paramsbytesGeneral extensibility for relayer to custom functionality.

recv

Recv verified message and dispatch to destination user application address.

function recv(Message calldata message, bytes calldata proof) external payable returns (bool dispatchResult);

Parameters

NameTypeDescription
messageMessageVerified receive message info.
proofbytesMessage proof of this message.

Returns

NameTypeDescription
dispatchResultboolResult of the message dispatch.

getAppConfig

If user application has not configured, then the default config is used.

Fetch user application config.

function getAppConfig(address ua) external view returns (address oracle, address relayer);

Parameters

NameTypeDescription
uaaddressUser application contract address.

setAppConfig

Set user application config.

function setAppConfig(address oracle, address relayer) external;

Parameters

NameTypeDescription
oracleaddressOracle which user application choose.
relayeraddressRelayer which user application choose.

defaultUC

function defaultUC() external view returns (address oracle, address relayer);

dones

Check the msg if it is dispatched.

function dones(bytes32 msgHash) external view returns (bool);

Parameters

NameTypeDescription
msgHashbytes32Hash of the checked message.

Returns

NameTypeDescription
<none>boolReturn the dispatched result of the checked message.

importHash

Hash is an abstract of the proof system, it can be a block hash or a message root hash, specifically provided by oracles.

Import hash by any oracle address.

function importHash(uint256 chainId, address channel, uint256 msgIndex, bytes32 hash_) external;

Parameters

NameTypeDescription
chainIduint256The source chain id.
channeladdressThe message channel.
msgIndexuint256The source chain message index.
hash_bytes32The hash to import.

hashLookup

Fetch hash.

function hashLookup(address oracle, bytes32 lookupKey) external view returns (bytes32);

Parameters

NameTypeDescription
oracleaddressThe oracle address.
lookupKeybytes32The key for loop up hash.

Returns

NameTypeDescription
<none>bytes32Return the hash imported by the oracle.