CCIP v1.5.0 CCIPReceiver API Reference
CCIP receiver contracts inherit from CCIPReceiver
.
import {CCIPReceiver} from "@chainlink/contracts-ccip/src/v0.8/ccip/applications/CCIPReceiver.sol";
...
constructor(address _router) is CCIPReceiver(router) {
}
Functions
constructor
constructor(address router) internal
supportsInterface
function supportsInterface(bytes4 interfaceId) public pure returns (bool)
IERC165 supports an interfaceId
Parameters
Name | Type | Description |
---|---|---|
interfaceId | bytes4 | The interfaceId to check |
Return Values
Name | Type | Description |
---|---|---|
[0] | bool | true if the interfaceId is supported |
ccipReceive
function ccipReceive(struct Client.Any2EVMMessage message) external override onlyRouter
Only the Router can call this function to deliver a message. If this reverts, any token transfers also revert. The message will move to a FAILED state and become available for manual execution.
Parameters
Name | Type | Description |
---|---|---|
message | struct Client.Any2EVMMessage | CCIP Message |
_ccipReceive
function _ccipReceive(struct Client.Any2EVMMessage message) internal virtual
Override this function in your implementation.
Parameters
Name | Type | Description |
---|---|---|
message | struct Client.Any2EVMMessage | Any2EVMMessage |
getRouter
function getRouter() public view returns (address)
This function returns the current Router address.
Return Values
Name | Type | Description |
---|---|---|
[0] | address | i_router address |
InvalidRouter
error InvalidRouter(address router)
onlyRouter
modifier onlyRouter()
Only calls from the set router are accepted.