GithubHelp home page GithubHelp logo

asmitadhungana / blockchain-bridge-simplified Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chainstacklabs/evm-blockchain-bridge

0.0 0.0 0.0 701 KB

A simplified blockchain bridge between two EVM compatible networks

Shell 1.26% JavaScript 36.20% TypeScript 3.95% CSS 0.11% HTML 0.63% Vue 51.80% Solidity 6.05%

blockchain-bridge-simplified's Introduction

Blockchain bridge simplified

You can read the full article for this project in the Chainstack blog

This project contains multiple pieces to create a functional (although not production ready) ERC20 blockchain bridge between two EVM compaticle chains.

It uses a wallet as an escrow and leverages the events triggered from the ERC20 tokens to burn and mint tokens in each side of the bridge

Requirements

Build & Compile

Smart contracts

Create a Metamask wallet and get some tokens for your target networks. This code was tested with Ropsten and Harmony testnet. You can get Ropsten ETH here and Harmony testnet ONE here.

Run npm i to install all required dependencies.

Rename /solidity/.env.example to /solidity/.env and fill in the details with your wallet address and the RPC endpoints from your Chainstack dashboard.

To deploy your contracts run npm run deploy:ori and npm run deploy:dest.

You'll get the contract address in the console.

You can test the contracts running npm run test.

Front-end

Rename /web/.env.example to /web/.env and fill in the details with your wallet address, RPC endpoints and token addresses from the deployed smart contracts.

To build the front-end, run npm i and npm run build inside the web directory. You can run the front-end locally with npm run dev or deploy the the generated dist folder to any static site hosting.

Back-end

The back-end service is required to actually run the bridge.

Rename /backend/.env.example to /backend/.env and fill in the details with your wallet address, RPC endpoints and token addresses from the deployed smart contracts.

Run npm i inside the backend directory. To start the back-end service run npm start.

Once the back-end service is running, you can use the front-end to send tokens through the bridge.

blockchain-bridge-simplified's People

Contributors

uf4no avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.