This application is an example of both frontend and smart contract implmentation of lx/ly bridge for ERC20 token bridging.
Frontend
Claim Function Listener
- Add the Wallet Connect project id to
src/app/providers.tsx
- File To Edit
cd proto
yarn
yarn dev
cd erc20bridge
npm i
npx hardhat compile
Smart Contract Addresses :
{
"ERC20BridgeMainnet": "0x60281F9DE2c0311B5E9A407A658f6Da2F6d026b3",
"ERC20BridgezkEVM": "0x8A82c434F2701A44258173287aa0497856735386",
"erc20MainnetToken": "0x6c55287976DAd6AD30F55fdEF2F1268FDA84e0db",
"erc20zkEVMToken": "0xea4e3eB04d7EEb22B679D7d753AcCf5e54c6C019",
"deployerAddress": "0x858a9477F74baa24a7F062b74A7f2D064443DF2E",
"tokenName": "customTokenName",
"tokenSymbol": "CTN",
"tokenInitialBalance": "1000000000000000000000000000"
}
All addresses are on testnet.
- Bridging from
göerliETH
tozkEVMTestnet
can be done from the frontend. - But we need to run a claim listener in order to process the claims when ready.
To run the claim listener :
npm run monitor:polygonZKEVMTestnet
ENV example :
MNEMONIC="test test test test test test test test test test test junk"
INFURA_PROJECT_ID=""
ETHERSCAN_API_KEY=""
ETHERSCAN_ZKEVM_API_KEY=""
PVTKEY=""
Problem Statement Link :
https://pushprotocol.notion.site/Polygon-557f8054f87e4dec8fe14fd55e76becd
More Code Examples :
https://github.com/0xPolygonHermez/code-examples
How ZkEVM Bridge Works ? :
https://wiki.polygon.technology/docs/zkevm/protocol/zkevm-bridge/