Files
smom-dbis-138/contracts/ccip/IRouterClient.sol
defiQUG 1fb7266469 Add Oracle Aggregator and CCIP Integration
- Introduced Aggregator.sol for Chainlink-compatible oracle functionality, including round-based updates and access control.
- Added OracleWithCCIP.sol to extend Aggregator with CCIP cross-chain messaging capabilities.
- Created .gitmodules to include OpenZeppelin contracts as a submodule.
- Developed a comprehensive deployment guide in NEXT_STEPS_COMPLETE_GUIDE.md for Phase 2 and smart contract deployment.
- Implemented Vite configuration for the orchestration portal, supporting both Vue and React frameworks.
- Added server-side logic for the Multi-Cloud Orchestration Portal, including API endpoints for environment management and monitoring.
- Created scripts for resource import and usage validation across non-US regions.
- Added tests for CCIP error handling and integration to ensure robust functionality.
- Included various new files and directories for the orchestration portal and deployment scripts.
2025-12-12 14:57:48 -08:00

90 lines
2.8 KiB
Solidity

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
/**
* @title Chainlink CCIP Router Client Interface
* @notice Interface for Chainlink CCIP Router Client
* @dev This interface is based on Chainlink CCIP Router Client specification
*/
interface IRouterClient {
/// @notice Represents the router's fee token
enum TokenAmountType {
Fiat,
Native
}
/// @notice Represents a token amount and its type
struct TokenAmount {
address token;
uint256 amount;
TokenAmountType amountType;
}
/// @notice Represents a CCIP message
struct EVM2AnyMessage {
bytes receiver;
bytes data;
TokenAmount[] tokenAmounts;
address feeToken;
bytes extraArgs;
}
/// @notice Represents a CCIP message with source chain information
struct Any2EVMMessage {
bytes32 messageId;
uint64 sourceChainSelector;
bytes sender;
bytes data;
TokenAmount[] tokenAmounts;
}
/// @notice Emitted when a message is sent
event MessageSent(
bytes32 indexed messageId,
uint64 indexed destinationChainSelector,
address indexed sender,
bytes receiver,
bytes data,
TokenAmount[] tokenAmounts,
address feeToken,
bytes extraArgs
);
/// @notice Emitted when a message is received
event MessageReceived(
bytes32 indexed messageId,
uint64 indexed sourceChainSelector,
address indexed sender,
bytes data,
TokenAmount[] tokenAmounts
);
/// @notice Sends a message to a destination chain
/// @param destinationChainSelector The chain selector of the destination chain
/// @param message The message to send
/// @return messageId The ID of the sent message
/// @return fees The fees required for the message
/// @dev If feeToken is zero address, fees are paid in native token (ETH) via msg.value
function ccipSend(
uint64 destinationChainSelector,
EVM2AnyMessage memory message
) external payable returns (bytes32 messageId, uint256 fees);
/// @notice Gets the fee for sending a message
/// @param destinationChainSelector The chain selector of the destination chain
/// @param message The message to send
/// @return fee The fee required for the message
function getFee(
uint64 destinationChainSelector,
EVM2AnyMessage memory message
) external view returns (uint256 fee);
/// @notice Gets the supported tokens for a destination chain
/// @param destinationChainSelector The chain selector of the destination chain
/// @return tokens The list of supported tokens
function getSupportedTokens(
uint64 destinationChainSelector
) external view returns (address[] memory tokens);
}