-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pass destChainSelector to onRamp and allow one offRamp to be responsi…
…ble for multiple sources (#213) Co-authored-by: Matt Yang <[email protected]>
- Loading branch information
Showing
16 changed files
with
853 additions
and
807 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
42 changes: 42 additions & 0 deletions
42
contracts/src/v0.8/ccip/interfaces/IEVM2AnyOnRampClient.sol
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,42 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import {IPool} from "./pools/IPool.sol"; | ||
|
||
import {Client} from "../libraries/Client.sol"; | ||
|
||
import {IERC20} from "../../vendor/openzeppelin-solidity/v4.8.0/contracts/token/ERC20/IERC20.sol"; | ||
|
||
interface IEVM2AnyOnRampClient { | ||
/// @notice Get the fee for a given ccip message | ||
/// @param destChainSelector The destination chain selector | ||
/// @param message The message to calculate the cost for | ||
/// @return fee The calculated fee | ||
function getFee(uint64 destChainSelector, Client.EVM2AnyMessage calldata message) external view returns (uint256 fee); | ||
|
||
/// @notice Get the pool for a specific token | ||
/// @param destChainSelector The destination chain selector | ||
/// @param sourceToken The source chain token to get the pool for | ||
/// @return pool Token pool | ||
function getPoolBySourceToken(uint64 destChainSelector, IERC20 sourceToken) external view returns (IPool); | ||
|
||
/// @notice Gets a list of all supported source chain tokens. | ||
/// @param destChainSelector The destination chain selector | ||
/// @return tokens The addresses of all tokens that this onRamp supports the given destination chain | ||
function getSupportedTokens(uint64 destChainSelector) external view returns (address[] memory tokens); | ||
|
||
/// @notice Send a message to the remote chain | ||
/// @dev only callable by the Router | ||
/// @dev approve() must have already been called on the token using the this ramp address as the spender. | ||
/// @dev if the contract is paused, this function will revert. | ||
/// @param destChainSelector The destination chain selector | ||
/// @param message Message struct to send | ||
/// @param feeTokenAmount Amount of fee tokens for payment | ||
/// @param originalSender The original initiator of the CCIP request | ||
function forwardFromRouter( | ||
uint64 destChainSelector, | ||
Client.EVM2AnyMessage memory message, | ||
uint256 feeTokenAmount, | ||
address originalSender | ||
) external returns (bytes32); | ||
} |
Oops, something went wrong.