Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...

Warmest welcome to the first-ever CCIP Bootcamp! Designed for established Web3 developer, the CCIP Bootcamp is meant to elevate your cross-chain development skills to the next level.





processMessage, a check is performed for a simulated revert condition using the s_simRevert state variable. This simulation is toggled by the setSimRevert function, callable only by the contract owner.MessageReceived event, signaling the successful processing of the message.s_messageContents








ccip-masterclassstrict - Used for strict sequencing. You should set it to false. CCIP will always process messages sent from a specific sender to a specific destination blockchain in the order they were sent. If you set strict: true in the extraArgs part of the message, and if the ccipReceive fails (reverts), it will prevent any following messages from the same sender from being processed until the current message is successfully executed. You should be very careful when using this feature to avoid unintentionally stopping messages from the sender from being processed. The strict sequencing feature is currently experimental, and there is no guarantee of its maintenance or further development in the future.















Please note, only participants who finish their homework for all three days will be eligible for the Certificate of Completion.
Please note, only participants who finish their homework for all three days will be eligible for the Certificate of Completion.
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;
import {Client} from "@chainlink/contracts-ccip/src/v0.8/ccip/libraries/Client.sol";
contract Empty {}node -vnpm -vmkdir ccip-masterclasscd ccip-masterclassnpx hardhat@2.14.1 initforge --versionnpm i @chainlink/contracts-ccip --save-dev# Node modules
node_modules/npm i @chainlink/contracts-ccip --save-dev// SOURCE BLOCKCHAIN
interface IRouterClient {
/// @notice Request a CCIP message to be sent to the destination chain
/// @param destinationChainSelector The destination chain selector
/// @param message The cross-chain CCIP message including data and/or tokens
/// @return messageId The message ID
function ccipSend(
uint64 destinationChainSelector,
Client.EVM2AnyMessage calldata message
) external payable returns(bytes32 messageId);
}// SOURCE BLOCKCHAIN
library Client {
struct EVM2AnyMessage {
bytes receiver; // abi.encode(receiver address) for dest EVM chains
bytes data; // data payload
EVMTokenAmount[] tokenAmounts; // token transfers
address feeToken; // fee token address; address(0) means you are sending msg.value
bytes extraArgs; // populate this with _argsToBytes(EVMExtraArgsV1)
}
struct EVMTokenAmount {
address token; // token address on local blockchain
uint256 amount;
}
struct EVMExtraArgsV1 {
uint256 gasLimit;
bool strict;
}
}// DESTINATION BLOCKCHAIN
/// @notice Application contracts that intend to receive messages from
/// the router should implement this interface.
interface IAny2EVMMessageReceiver {
/// @notice Router calls this to deliver a message
/// @param message CCIP Message
/// @dev Note ensure you check that msg.sender is the Router
function ccipReceive(Client.Any2EVMMessage calldata message) external;
}// DESTINATION BLOCKCHAIN
library Client {
struct Any2EVMMessage {
bytes32 messageId; // MessageId corresponding to ccipSend on source
uint64 sourceChainSelector; // Source chain selector
bytes sender; // abi.decode(sender) if coming from an EVM chain
bytes data; // payload sent in original message
EVMTokenAmount[] tokenAmounts; // Tokens and their amounts at destination
}
struct EVMTokenAmount {
address token; // token address on local blockchain
uint256 amount;
}
}mkdir ccip-masterclasscd ccip-masterclassforge initlibs = ['node_modules', 'lib']
remappings = [
'@chainlink/contracts-ccip/=node_modules/@chainlink/contracts-ccip'
]forge install smartcontractkit/ccip@ccip-develop# foundry.toml
remappings = [
'@chainlink/contracts-ccip/=lib/ccip/contracts/'
]