From 6a3b1d963153f42283b27e9973ebcb2b0d27bff7 Mon Sep 17 00:00:00 2001 From: cqlyj Date: Tue, 3 Dec 2024 14:34:03 +0800 Subject: [PATCH] feat: update README with project description, setup instructions, and usage guidelines --- README.md | 93 +++++++++++++++++++++++++++++++++---------------------- 1 file changed, 56 insertions(+), 37 deletions(-) diff --git a/README.md b/README.md index 9265b45..cea0062 100644 --- a/README.md +++ b/README.md @@ -1,66 +1,85 @@ -## Foundry +# Simple Chainlink CCIP -**Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.** +This is a simple Chainlink CCIP that transfer the ERC20 Token from Sepolia to Amoy testnet -Foundry consists of: +# Getting Started -- **Forge**: Ethereum testing framework (like Truffle, Hardhat and DappTools). -- **Cast**: Swiss army knife for interacting with EVM smart contracts, sending transactions and getting chain data. -- **Anvil**: Local Ethereum node, akin to Ganache, Hardhat Network. -- **Chisel**: Fast, utilitarian, and verbose solidity REPL. +## Requirements -## Documentation +- [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) + - You'll know you did it right if you can run `git --version` and you see a response like `git version x.x.x` +- [foundry](https://getfoundry.sh/) + - You'll know you did it right if you can run `forge --version` and you see a response like `forge 0.2.0 (816e00b 2023-03-16T00:05:26.396218Z)` -https://book.getfoundry.sh/ +## Quickstart -## Usage +``` +git clone https://github.com/cqlyj/simple-chainlink-ccip.git +cd simple-chainlink-ccip +make +``` -### Build +# Usage -```shell -$ forge build +1. Set up your environment variables: + +```bash +cp .env.example .env ``` -### Test +2. Fill in the `.env` file with your own values. And also replace the address anywhere you see in files with your own address. +3. Before running the demo, you need to set up your wallet: -```shell -$ forge test +```bash +cast wallet import YOUR_ACCOUNT_NAME --interactive ``` -### Format +Here I would call it `burner`, and a interactive prompt will show as below: -```shell -$ forge fmt +```bash + Enter private key: + Enter password: + `your-account-name` keystore was saved successfully. Address: address-corresponding-to-private-key ``` -### Gas Snapshots +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. -```shell -$ forge snapshot +```diff +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 ``` -### Anvil +Same for any other command in `Makefile` which ask for your account name and sender addresses. -```shell -$ anvil -``` +4. Also update the address in `script/TransferTokenPayNative.s.sol` and `script/WithdrawBalance.s.sol` with your own address. -### Deploy +In `script/TransferTokenPayNative.s.sol`: -```shell -$ forge script script/Counter.s.sol:CounterScript --rpc-url --private-key +```diff +address public constant RECEIVER = +- 0xFB6a372F2F51a002b390D18693075157A459641F; ++ YOUR_ADDRESS; ``` -### Cast +In `script/WithdrawBalance.s.sol`: -```shell -$ cast +```diff +address public constant BENEFICIARY = +- 0xFB6a372F2F51a002b390D18693075157A459641F; ++ YOUR_ADDRESS; ``` -### Help +5. Run the demo: -```shell -$ forge --help -$ anvil --help -$ cast --help +```bash +make demo ``` + +Wait for about 20 mins, and you will get the token in your Amoy testnet account. + +## Contact + +Luo Yingjie - [luoyingjie0721@gmail.com](luoyingjie0721@gmail.com)