IORMP
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
Name | Type | Description |
---|---|---|
toChainId | uint256 | The Message destination chain id. |
to | address | User application contract address which receive the message. |
gasLimit | uint256 | Gas limit for destination user application used. |
encoded | bytes | The calldata which encoded by ABI Encoding. |
refund | address | Return extra fee to refund address. |
params | bytes | General extensibility for relayer to custom functionality. |
Returns
Name | Type | Description |
---|---|---|
<none> | bytes32 | Return 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
Name | Type | Description |
---|---|---|
toChainId | uint256 | The Message destination chain id. |
ua | address | |
gasLimit | uint256 | Gas limit for destination user application used. |
encoded | bytes | The calldata which encoded by ABI Encoding. |
params | bytes | General 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
Name | Type | Description |
---|---|---|
message | Message | Verified receive message info. |
proof | bytes | Message proof of this message. |
Returns
Name | Type | Description |
---|---|---|
dispatchResult | bool | Result 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
Name | Type | Description |
---|---|---|
ua | address | User application contract address. |
setAppConfig
Set user application config.
function setAppConfig(address oracle, address relayer) external;
Parameters
Name | Type | Description |
---|---|---|
oracle | address | Oracle which user application choose. |
relayer | address | Relayer 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
Name | Type | Description |
---|---|---|
msgHash | bytes32 | Hash of the checked message. |
Returns
Name | Type | Description |
---|---|---|
<none> | bool | Return 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
Name | Type | Description |
---|---|---|
chainId | uint256 | The source chain id. |
channel | address | The message channel. |
msgIndex | uint256 | The source chain message index. |
hash_ | bytes32 | The hash to import. |
hashLookup
Fetch hash.
function hashLookup(address oracle, bytes32 lookupKey) external view returns (bytes32);
Parameters
Name | Type | Description |
---|---|---|
oracle | address | The oracle address. |
lookupKey | bytes32 | The key for loop up hash. |
Returns
Name | Type | Description |
---|---|---|
<none> | bytes32 | Return the hash imported by the oracle. |