CCIP v2.0.0 IAny2EVMMessageReceiver API Reference
IAny2EVMMessageReceiver defines the interface for contracts that receive CCIP messages from the Router.
If you implement this interface, you define how your contract validates and processes inbound CCIP messages.
Most applications should not implement this interface directly. Use
CCIPReceiver, which provides a validated entrypoint and default behavior.
Usage Boundary
You typically should not implement this interface directly.
- Use
CCIPReceiverfor standard message handling. - Implement this interface only if you need full control over message validation and execution.
- If you implement it, you are responsible for validating the caller and safely handling all message data.
Contract
interfaces/IAny2EVMMessageReceiver.sol
Import
import {IAny2EVMMessageReceiver} from "chainlink-ccip/interfaces/IAny2EVMMessageReceiver.sol";
If you have not installed the package:
npm install @chainlink/contracts-ccip@2.0.0
External API
ccipReceive
function ccipReceive( Client.Any2EVMMessage calldata message ) external
Entry point for inbound CCIP messages.
If you implement this function, you define how your contract processes incoming messages delivered by the Router.
You must validate the caller and handle the message safely. Failing to do so can allow unauthorized message execution.
| Parameter | Type | Description |
|---|---|---|
message | Client.Any2EVMMessage calldata | The decoded CCIP message containing sender, data, tokens, and metadata. |
Events
No new events declared.
For a cross-contract event index, see Events.
Errors
No new custom errors declared.
For a cross-contract error index, see Errors.
Notes
- If you implement this interface, you must restrict access to a trusted Router (for example, using an
onlyRoutermodifier). - This interface does not enforce validation or execution behavior. You are responsible for implementing both correctly.