GithubHelp home page GithubHelp logo

sambacha / layerzero Goto Github PK

View Code? Open in Web Editor NEW

This project forked from layerzero-labs/layerzero

0.0 2.0 0.0 3.38 MB

An Omnichain Interoperability Protocol

License: Other

Solidity 23.13% TypeScript 17.61% Shell 0.59% JavaScript 58.68%

layerzero's Introduction

LayerZero - an Omnichain Interoperability Protocol

This repository contains the smart contracts for LayerZero Endpoints. For developers looking to build on top of LayerZero please refer to the docs

Overview

LayerZero is an Omnichain Interoperability Protocol designed for lightweight message passing across chains. LayerZero provides authentic and guaranteed message delivery with configurable trustlessness. The protocol is implemented as a set of gas-efficient, non-upgradable smart contracts.

Development

Interfaces

add this to your package.json

"@layerzerolabs/contracts": "latest",

Setup

  • copy .env.example to .env and fill in variables
  • yarn install

Testing

yarn test

Single Test File

yarn test test/Endpoint.test.js

Gas Uasge

yarn test:gas

Coverage

yarn test:coverage

Lint

yarn lint

only lints .js/.ts files

Deployment

Deploy networks are generated based on tags.

Hardhat

yarn dev

spins up local environment and deploys contracts

Development

hardhat --network rinkeby-testnet deploy
hardhat --network rinkeby-sandbox deploy

Production

hardhat --network ethereum deploy

Adding a new network

  1. Update hardhat config with network
    1. refer to STAGING_MAP for staging environments supported
  2. Update endpoints.json with network
  3. Make sure that key in endpoints.json matches network name in hardhat

Example: One LayerZero Network

//hardhat.config.ts
ethereum: {
    url: `{rpc address}`,
    chainId: 1, //chainlist id
}

//endpoints.json
"production": {
   ...
   "ethereum": {
     "id": 1 //layerzero chain id
   }
}

Example: More than one LayerZero Network on same chain (using expandNetwork)

//hardhat.config.ts
...expandNetwork({
    ropsten: {
        url: `{rpc address}`,
        chainId: 3, //chainlist id
    }
}, ["testnet", "sandbox"]),

//endpoints.json
"development": {
   ...
   "ropsten": {
     "id": 4 //layerzero chain id
   }
}

Acknowledgments

Thank you to the core development team for building the LayerZero Endpoints: Ryan Zarick, Isaac Zhang, Caleb Banister, Carmen Cheng and T. Riley Schwarz

LICENSING

The primary license for LayerZero is the Business Source License 1.1 (BUSL-1.1). see LICENSE.

layerzero's People

Contributors

ryanzarick avatar cowboyisaac avatar

Watchers

James Cloos avatar  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.