Skip to content

anurag-iitk/chainlink-ccip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chainlink Cross-Chain Interoperability Protocol

  • TokenTransfer Smart Contract

This contract contains the TokenTransfer smart contract built using Solidity and Chainlink's Cross-Chain Interoperability Protocol (CCIP). The contract allows transferring tokens across multiple blockchains using Chainlink's router.

Features

  • Cross-Chain Token Transfer: Transfer ERC20 tokens across different blockchains using Chainlink's CCIP.
  • Fee Payment Options: Supports paying fees with LINK tokens or native chain currency.
  • Allowlisted Chains: Only transfers to specified allowlisted chains are allowed.
  • Receiver Validation: Ensures the receiver address is valid before executing a transfer.
  • Owner Access Control: The contract owner can manage allowlisted chains and execute transfers.

Installation

To use or develop this project, follow these steps:

  1. Clone the repository:

    git clone https://github.com/anurag-iitk/chainlink-ccip.git
    cd chainlink-ccip
  2. Install Foundry:

    Foundry is a blazing fast, portable, and modular toolkit for Ethereum application development written in Rust. If you don't have Foundry installed, you can install it here.

    curl -L https://foundry.paradigm.xyz | bash
    foundryup
  3. Install Dependencies:

    forge install
  4. Compile Contracts:

    forge build
  5. Run Tests:

    forge test
  6. Deploy

     forge script script/TokenTransfer.s.sol --rpc-url <your_rpc_url> --private-key 
     <your_private_key>

Usage

  1. Deploy Contract: Deploy the contract to the desired blockchain network using your preferred method (Remix, Hardhat, etc.).

  2. Add Allowlisted Chains: Use the allowlistDestinationChain function to specify the chains to which tokens can be transferred.

  3. Transfer Tokens:

    • Use transferTokensPayLINK for transfers paying fees in LINK tokens.
    • Use transferTokensPayNative for transfers paying fees in the native chain currency.
  4. Withdraw: Withdraw any remaining tokens or ETH in the contract using the withdraw or withdrawToken functions.

Acknowledgments

For more information, visit the project repository.


About

Cross-chain communication using Chainlink CCIP

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published