This is a simple Chainlink CCIP that transfer the ERC20 Token from Sepolia to Amoy testnet
- git
- You'll know you did it right if you can run
git --version
and you see a response likegit version x.x.x
- You'll know you did it right if you can run
- foundry
- You'll know you did it right if you can run
forge --version
and you see a response likeforge 0.2.0 (816e00b 2023-03-16T00:05:26.396218Z)
- You'll know you did it right if you can run
git clone https://github.com/cqlyj/simple-chainlink-ccip.git
cd simple-chainlink-ccip
make
- Set up your environment variables:
cp .env.example .env
- Fill in the
.env
file with your own values. And also replace the address anywhere you see in files with your own address. - Before running the demo, you need to set up your wallet:
cast wallet import YOUR_ACCOUNT_NAME --interactive
Here I would call it burner
, and a interactive prompt will show as below:
Enter private key:
Enter password:
`your-account-name` keystore was saved successfully. Address: address-corresponding-to-private-key
Please keep in mind the password you entered, this will be needed for you moving forward with the private key.
And if you change the name from burner
to something else, you need to update in the Makefile
as well. Also the sender
needs to be your address.
deploy:
- @forge script script/DeployTokenTransfer.s.sol:DeployTokenTransfer --rpc-url $(SEPOLIA_RPC_URL) --account burner --sender 0xFB6a372F2F51a002b390D18693075157A459641F --broadcast --verify --verifier blockscout --verifier-url https://eth-sepolia.blockscout.com/api/ -vvvv
+ @forge script script/DeployTokenTransfer.s.sol:DeployTokenTransfer --rpc-url $(SEPOLIA_RPC_URL) --account YOUR_ACCOUNT_NAME --sender YOUR_ADDRESS --broadcast --verify --verifier blockscout --verifier-url https://eth-sepolia.blockscout.com/api/ -vvvv
Same for any other command in Makefile
which ask for your account name and sender addresses.
- Also update the address in
script/TransferTokenPayNative.s.sol
andscript/WithdrawBalance.s.sol
with your own address.
In script/TransferTokenPayNative.s.sol
:
address public constant RECEIVER =
- 0xFB6a372F2F51a002b390D18693075157A459641F;
+ YOUR_ADDRESS;
In script/WithdrawBalance.s.sol
:
address public constant BENEFICIARY =
- 0xFB6a372F2F51a002b390D18693075157A459641F;
+ YOUR_ADDRESS;
- Run the demo:
make demo
Wait for about 20 mins, and you will get the token in your Amoy testnet account.
Luo Yingjie - [email protected]