CCIP v1.5.1 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) CCIPReceiver(router) {
}
error InvalidRouter(address router)
constructor(address router) internal
Name | Type | Description |
---|
router | address | The router address. |
function supportsInterface(bytes4 interfaceId) public pure returns (bool)
IERC165 supports an interfaceId. This allows CCIP to check if ccipReceive is available before calling it.
- If this returns false or reverts, only tokens are transferred to the receiver.
- If this returns true, tokens are transferred and ccipReceive is called atomically.
- If the receiver address does not have code associated with it at execution time (EXTCODESIZE returns 0), only tokens will be transferred.
Name | Type | Description |
---|
interfaceId | bytes4 | The interfaceId to check |
Name | Type | Description |
---|
[0] | bool | true if the interfaceId is supported |
function ccipReceive(Client.Any2EVMMessage calldata message) external
function _ccipReceive(Client.Any2EVMMessage memory message) internal virtual
Override this function in your implementation.
function getRouter() public view returns (address)
This function returns the current Router address.
Name | Type | Description |
---|
[0] | address | i_router address |
modifier onlyRouter()
Only calls from the set router are accepted.