This repository contains the smart contracts for LayerZero Endpoints. For developers looking to build on top of LayerZero please refer to the docs
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.
add this to your package.json
"@layerzerolabs/contracts": "latest",
yarn install
yarn test
yarn test test/Endpoint.test.js
yarn test:gas
yarn test:coverage
yarn lint
only lints .js/.ts files
Deploy networks are generated based on tags.
yarn dev
spins up local environment and deploys contracts
hardhat --network rinkeby-testnet deploy
hardhat --network rinkeby-sandbox deploy
hardhat --network ethereum deploy
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
}
}
Thank you to the core development team for building the LayerZero Endpoints: Ryan Zarick, Isaac Zhang, Caleb Banister, Carmen Cheng and T. Riley Schwarz
The primary license for LayerZero is the Business Source License 1.1 (BUSL-1.1). see LICENSE
.