Getting Started
The LzApp Standard provides developers with a generic message passing interface to send and receive arbitrary pieces of data between contracts existing on different blockchain networks.
LzApp lends access to two essential functions:
- _lzSend: the function your application must implement to send an omnichain message
- _lzReceive: the function to receive an omnichain message
You can dive right in with a simple code example here.
Because everything on the blockchain is at its root a smart contract, LayerZero can extend existing contract standards to interoperate with the protocol and provide developers a starting point for building specific applications.
Installation
npm install @layerzerolabs/solidity-examples
Usage
Once installed, you can use the contracts in the library by importing them:
import "@layerzerolabs/solidity-examples/contracts/lzApp/LzApp.sol";
contract MyLzApp is LzApp {
constructor(address _lzEndpoint) LzApp(_lzEndpoint) {}
}
Pass in your chain specific Testnet or Mainnet Contract Address, which is all you need to start sending cross-chain messages.