EVM Token Bridge - Transfers ERC20 tokens from source blockchain network to target network. We are going to use Goerli - Ethereum's Testnet and Mumbai - Polygon's testnet.
GOERLI BRIDGE: 0x2759a3c726cB59b70bb4B80C73bE20Aa3Dd125C0
MUMBAI BRIDGE: 0x6DeFf377FA433F879d2cfDA5F169352b1e4335DDMake sure you are in the directory of the cloned project then
npm installCreate an .env file with the following structure
ETHEREUM_RPC_URL=YOUR ETHEREUM_RPC_URL HERE
MUMBAI_RPC_URL=YOUR MUMBAI_RPC_URL HERE
PRIVATE_KEY=YOUR PRIVATE_KEY HERE
ETHERSCAN_KEY=YOUR ETHERSCAN_KEY HERE
POLYGONSCAN_KEY=YOUR POLYGONSCAN_KEY HEREIf everything from the previous steps was followed it's time to test the project with the following command:
npx hardhat testFirst we have to deploy our ERC20 token on desired network. In our case we are going to deploy on Goerli. Make sure you have some GoerliETH in your wallet.
deploy-erc20-goerli is a custom task implemented in hardhat.config.ts
npx hardhat deploy-erc20-goerli --network goerliSecond we have to deploy and verify our EthereumBridge contract on Goerli
npx hardhat deploy-ethbridge-goerli --network goerliThird we have to deploy and verify our PolygonBridge contract on Mumbai
npx hardhat deploy-polygonbridge-mumbai --network matic