CCIP v1.5.1 CCIPReceiver API Reference
CCIPReceiver
An abstract base contract that provides core functionality for CCIP-enabled applications to receive cross-chain messages.
Errors
InvalidRouter
error InvalidRouter(address router);
Parameters
Name | Type | Description |
---|---|---|
router | address | The invalid router address |
State Variables
i_ccipRouter
address internal immutable i_ccipRouter;
Modifiers
onlyRouter
modifier onlyRouter();
Functions
ccipReceive
Processes incoming CCIP messages from the router.
function ccipReceive(Client.Any2EVMMessage calldata message) external virtual override onlyRouter;
Parameters
Name | Type | Description |
---|---|---|
message | Client.Any2EVMMessage | The CCIP message |
constructor
constructor(address router);
Parameters
Name | Type | Description |
---|---|---|
router | address | The CCIP router contract address |
getRouter
Returns the address of the current CCIP router.
function getRouter() public view virtual returns (address);
Returns
Type | Description |
---|---|
address | The current CCIP router address |
supportsInterface
Determines whether the contract implements specific interfaces.
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool);
Parameters
Name | Type | Description |
---|---|---|
interfaceId | bytes4 | The interface identifier to check |
Returns
Type | Description |
---|---|
bool | True if the interface is supported |
_ccipReceive
Internal function to be implemented by derived contracts for custom message handling.
function _ccipReceive(Client.Any2EVMMessage memory message) internal virtual;
Parameters
Name | Type | Description |
---|---|---|
message | Client.Any2EVMMessage | The message to be processed |