https://github.com/ocdbytes/polygon_ozg
This application is an example of both frontend and smart contract implmentation of lx/ly bridge for ERC20 token bridging.
https://github.com/ocdbytes/polygon_ozg
polygon tokenbridge zkevm
Last synced: 6 months ago
JSON representation
This application is an example of both frontend and smart contract implmentation of lx/ly bridge for ERC20 token bridging.
- Host: GitHub
- URL: https://github.com/ocdbytes/polygon_ozg
- Owner: ocdbytes
- Created: 2023-09-20T18:30:19.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-11-26T10:45:45.000Z (about 2 years ago)
- Last Synced: 2024-04-14T04:08:40.930Z (almost 2 years ago)
- Topics: polygon, tokenbridge, zkevm
- Language: Solidity
- Homepage:
- Size: 706 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# Polygon_OZG
- [Polygon_OZG](#polygon_ozg)
- [Example Lx/Ly Bridge](#example-lxly-bridge)
- [Setup](#setup)
- [Frontend](#frontend)
- [Smart Contract](#smart-contract)
- [Resources](#resources)
## Example Lx/Ly Bridge
This application is an example of both frontend and smart contract implmentation of lx/ly bridge for ERC20 token bridging.

`Frontend`

`Claim Function Listener`
## Setup
#### Frontend
- Add the Wallet Connect project id to `src/app/providers.tsx`
- [File To Edit](./proto/src/app/providers.tsx)
```sh
cd proto
yarn
yarn dev
```
#### Smart Contract
```sh
cd erc20bridge
npm i
npx hardhat compile
```
**Smart Contract Addresses :**
```json
{
"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` to `zkEVMTestnet` 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 :
```sh
npm run monitor:polygonZKEVMTestnet
```
ENV example :
```sh
MNEMONIC="test test test test test test test test test test test junk"
INFURA_PROJECT_ID=""
ETHERSCAN_API_KEY=""
ETHERSCAN_ZKEVM_API_KEY=""
PVTKEY=""
```
## Resources
Problem Statement Link :
[https://pushprotocol.notion.site/Polygon-557f8054f87e4dec8fe14fd55e76becd](https://pushprotocol.notion.site/Polygon-557f8054f87e4dec8fe14fd55e76becd)
More Code Examples :
[https://github.com/0xPolygonHermez/code-examples](https://github.com/0xPolygonHermez/code-examples)
How ZkEVM Bridge Works ? :
[https://wiki.polygon.technology/docs/zkevm/protocol/zkevm-bridge/](https://wiki.polygon.technology/docs/zkevm/protocol/zkevm-bridge/)