-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathICrosschain.sol
52 lines (46 loc) · 1.94 KB
/
ICrosschain.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.20;
interface ICrosschain {
/**
* @notice Sends a cross-chain transaction.
* @param _destinationChain The destination chain ID.
* @param _callAddress The address of the contract on the destination chain.
* @param _payload The payload to send to the destination chain.
* @param _extraArgs The extra arguments to pass
* @dev extraArgs may contain items such as token, amount, feeTokenAddress, receipient, gasLimit, etc
*/
function sendCrossChainTransaction(
uint64 _destinationChain,
address _callAddress,
bytes calldata _payload,
bytes calldata _extraArgs
) external payable;
/**
* @notice callback function for when a cross-chain transaction is sent.
* @param _destinationChain The destination chain ID.
* @param _callAddress The address of the contract on the destination chain.
* @param _payload The payload sent to the destination chain.
* @param _extraArgs The extra arguments sent to the callAddress on the destination chain.
*/
function onCrossChainTransactionSent(
uint64 _destinationChain,
address _callAddress,
bytes calldata _payload,
bytes calldata _extraArgs
) internal;
/**
* @notice callback function for when a cross-chain transaction is received.
* @param _sourceChain The source chain ID.
* @param _sourceAddress The address of the contract on the source chain.
* @param _payload The payload sent to the destination chain.
* @param _extraArgs The extra arguments sent to the callAddress on the destination chain.
*/
function onCrossChainTransactionReceived(
uint64 _sourceChain,
address _sourceAddress,
bytes calldata _payload,
bytes calldata _extraArgs
) internal;
function setRouter(address _router) external;
function getRouter() external view returns (address);
}