Skip to content

IITDhCSE/Workshop-ERC20

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 

Repository files navigation

CrossChain ERC-20 Step by Step Guide

Effortlessly transfer ERC-20 tokens from one chain to another. Made using Router Cross-Talk.

This project is built with Router CrossTalk

Router Protocol is a solution introduced to address the issues hindering the usability of cross-chain liquidity migration in the DeFi ecosystem. It acts as a bridge connecting various layer 1 and layer 2 blockchains, allowing for the flow of contract-level data across them. The Router Protocol can either transfer tokens between chains or initiate operations on one chain and execute them on another.

Please check the official documentation of Router Protocol

⭐️ Star us

If this repository helps you build cross-chain dapps faster and easier - please star this project, every star makes us very happy!

🤝 Need help?

If you need help or have other some questions - don't hesitate to write in our discord channel and we will check asap. Discord link. The best thing about this is the super active community ready to help at any time! We help each other.

✌️Let's Begin 🚀

Step 1) Open Remix IDE https://remix.ethereum.org/

Step 2) Create a new workspace

image

Step 3) Create a new file, give a name and save it with ".sol" extension

image

Step 4) Copy the code from coin.sol and paste it in the editing area

image

Step 5) Install Metamask extension from https://metamask.io/download/ and to your browser

image

Step 6) Open the extension and click on Create Wallet

image

Step 7) Set a password for your wallet

image

Step 8) Select either of the 2 options. Securing your wallet is recommended.But for the time being, we can go with the 1st option.

image

Step 9) Connect to Mumbai Network :-

  1. Go to https://mumbai.polygonscan.com/
  2. Scroll down to the bottom end and click on Add Mumbai Network

image

Step 10) connect to Binance Network :- 1. Go to https://www.ankr.com/rpc/bsc/ 2. Select Testnet 3. Click on add to Network
image


Or

Step 10) Connect to Fuji Network :- 1. Go to https://testnet.snowtrace.io/ 2. Scroll down to the bottom end and click on Add C-Chain ( Fuji ) Network

image

Step 11) Come to Remix again and compile the code ( ctrl + s )

Step 12) Select Inject Provider from Environments in Deployments section

image

Step 13) Switch to Binance Chain and copy your wallet address

image

Or

Step 13) Switch to Fuji Network and copy your wallet address

image

Step 14) Add faucet to your account by visiting https://testnet.bnbchain.org/faucet-smart and pasting your wallet address and then click on REQUEST 2 AVAX

image

Or

Step 14) Add faucet to your account by visiting https://faucet.avax.network/ and pasting your wallet address and then click on REQUEST 2 AVAX

image

Step 15) Switch to Mumbai Network https://mumbai.polygonscan.com/ and copy your wallet address

Step 16) Add faucet to your account by visiting https://faucet.polygon.technology/ and pasting your wallet address and then click on Submit

image

Step 17) Come back to Remix and switch to Fuji/Binance Network

Step 18) Deploy the contract by passing Gateway address of Fuji/Binance ,DestGasLimit as 500000 and feePayer as router1z6ralzg5tsznq9s6xmutyeen7evylcj7harhmq

Step 19) Switch to Mumbai Network and deploy the contract by passing Gateway address of Mumbai and DestGasLimit as 500000

Gateway addresses for respective chains can be found here https://devnet-alpha.lcd.routerprotocol.com/router-protocol/router-chain/multichain/chain_config

Step 20) Switch to Fuji/Binance Network again and call setContractOnChain
Function of the Fuji contract passing in 0, 80001 and address of the Mumbai contract deployed respectively

image

Step 21) Switch to Mumbai Network and call setContractOnChain
Function of the Mumbai contract passing in 0, 43113 and address of the Fuji Contract Deployed

Step 22) Switch to Fuji/Binance Network and mint some ERC20 Tokens through mint function of the Fuji/Binance contract deployed

image

Step 23) Come back to Remix ,and Call TransferCrossChain function of the Fuji/Binance contract deployed , passing in 0, 80001 ,30000000000 ,recipient address and amount as parameters

image

Step 24) You can see the CrossTalk transactions here https://alpha-explorer-ui.routerprotocol.com/crosstalks

Step 25) When the status changes to Delivered, come back to Remix again and switch to Mumbai Network

Step 26) Call the function , totalSupply of the Mumbai contract deployed to see the ERC20 tokens transferred

Step 27) Earn your NFT Certificate . Fill the below form.

https://docs.google.com/forms/d/e/1FAIpQLSd8Xuiuw32kOqGsWmT5s7GLjLVZ_rHXw9bAJbdbr0XzrVG6RA/viewform?embedded=true

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Solidity 100.0%