The Demo codes for CCIP cross-chain NFT use case.
-
Get ETH tokens on Ethereum Sepolia testnet from Chainlink Faucets.
-
Get AVAX and LINK tokens on Avalanche Fuji testnet from Chainlink Fuji Faucet
-
Open Remix online IDE.
-
Swtich metamask to Sepolia testnet.
-
Deploy the smart contract
MyNFT.sol
on Sepolia testnet. -
Get the address of
MyNFT.sol
. -
Deploy the smart contract
DestChainReceiver.sol
on Sepolia testnet with address ofMyNFT.sol
and CCIP Sepolia router address. You can find the address here. -
Switch metamask to Avalanche Fuji network, and find the RPC info here if you do not have the network in you metamask.
-
Deploy the smart contract
SourceChainMinter.sol
on Avalanche Fuji testnet. You will need deploy with CCIP Fuji router address and LINK token Address on Fuji. -
Transfer 2 AVAX and 3 LINK tokens to
SourceChainMinter.sol
. -
Call function
sendMessage
to mint NFT with AVAX tokens as gas fee. Parameters are as follow:destinationChainSelector
: find ChainSelector for Sepolia here.receiver
: this is the address ofDestChainReceiver.sol
in step 6.feeToken
: select 0 to pay AVAX for gas fee.
-
Call function
sendMessage
to mint NFT with LINK tokens as gas fee. Parameters are as follow:destinationChainSelector
: find ChainSelector for Sepolia here.receiver
: this is the address ofDestChainReceiver.sol
in step 6.feeToken
: select 1 to pay LINK for gas fee.
-
Head to Opensea testnet to check your minted NFT. You will find 2 NFT collected under your profile
MyNFT.sol
: ERC-721 smart contract.DestChainReceiver.sol
: Receive message from Chainlink CCIP on destination chain.SourceChainMinter.sol
: Send mint message to Chainlink CCIP on source chain.
- Please use Avalanche Fuji as source chain since the source finalized faster than others.
- You can choose Polygon Mumbai and Ethereum Sepolia as destination chain since the NFT can be displayed on Opensea testnet.
- Ask Frank if you cannot get the test tokens.
- If you complete the CCIP steps above, let Frank know and you can get a gift and NFT certificate.