MyGit

LayerZero-Labs/LayerZero-v1

Fork: 1251 Star: 1955 (更新于 2024-12-05 01:31:44)

license: NOASSERTION

Language: Solidity .

An Omnichain Interoperability Protocol

GitHub网址

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.

最近版本更新:(数据更新于 2024-08-28 05:19:10)

LayerZero-Labs/LayerZero-v1同语言 Solidity最近更新仓库

2024-10-03 22:56:46 OpenZeppelin/openzeppelin-contracts

2024-08-28 00:31:10 Uniswap/UniswapX

2024-07-26 11:31:29 bnb-chain/bsc-genesis-contract

2024-02-23 01:47:34 eth-infinitism/account-abstraction

2021-02-26 11:11:11 bnb-chain/eth-bsc-swap-contracts

1970-01-01 00:00:00 Vectorized/solady