-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor!: split gateway call functionality into separate contract (#267
- Loading branch information
1 parent
97ca896
commit 124db7e
Showing
9 changed files
with
274 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
pragma solidity ^0.8.0; | ||
|
||
/** | ||
* @title IGatewayCaller interface | ||
* @dev Interface for the GatewayCaller contract | ||
*/ | ||
interface IGatewayCaller { | ||
/** | ||
* @dev Enum representing different metadata versions | ||
*/ | ||
enum MetadataVersion { | ||
CONTRACT_CALL, | ||
EXPRESS_CALL | ||
} | ||
|
||
/** | ||
* @dev Error thrown when an invalid metadata version is provided | ||
*/ | ||
error InvalidMetadataVersion(uint32 metadataVersion); | ||
|
||
/** | ||
* @dev Calls a contract on a specific destination chain with the given payload | ||
* @param destinationChain The target chain where the contract will be called | ||
* @param destinationAddress The address of the contract to be called on the destination chain | ||
* @param payload The data payload for the transaction | ||
* @param metadataVersion The version of metadata to be used | ||
* @param gasValue The amount of gas to be paid for the transaction | ||
*/ | ||
function callContract( | ||
string calldata destinationChain, | ||
string calldata destinationAddress, | ||
bytes calldata payload, | ||
MetadataVersion metadataVersion, | ||
uint256 gasValue | ||
) external payable; | ||
|
||
/** | ||
* @dev Calls a contract on a specific destination chain with the given payload and token | ||
* @param destinationChain The target chain where the contract will be called | ||
* @param destinationAddress The address of the contract to be called on the destination chain | ||
* @param payload The data payload for the transaction | ||
* @param symbol The symbol of the token to be sent | ||
* @param amount The amount of tokens to be sent | ||
* @param metadataVersion The version of metadata to be used | ||
* @param gasValue The amount of gas to be paid for the transaction | ||
*/ | ||
function callContractWithToken( | ||
string calldata destinationChain, | ||
string calldata destinationAddress, | ||
bytes calldata payload, | ||
string calldata symbol, | ||
uint256 amount, | ||
MetadataVersion metadataVersion, | ||
uint256 gasValue | ||
) external payable; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.