Introduction
Thecreate-lz-oapp CLI is a powerful command-line tool designed to streamline the development of LayerZero Omnichain Applications (OApps). This CLI toolkit simplifies the process of building, testing, deploying, and configuring omnichain applications by providing a structured project template and essential development tools.
With create-lz-oapp, you can quickly bootstrap a new LayerZero project with both Hardhat and Foundry development frameworks pre-configured, along with example contracts, crosschain unit tests, LayerZero configuration files, and deployment scripts.
Installation & Usage
Create a new LayerZero OApp project with a single command:CLI Options
Thecreate-lz-oapp CLI supports the following options:
Version Information
CI Mode
- Default:
false
Project Directory
Example Project Template
Always Available Examples
These examples are always available:| Example Name | Description |
|---|---|
oapp | OApp: Basic Omnichain Application for crosschain messaging |
oft | OFT: Omnichain Fungible Token implementation |
oft-adapter | OFTAdapter: Adapter for existing ERC20 tokens |
onft721 | ONFT721: Omnichain Non-Fungible Token (ERC721) |
Feature-Flagged Examples
These examples are available only when specific environment variables are set:| Example Name | Description | Required Environment Variable |
|---|---|---|
lzapp-migration | EndpointV1 Migration | LZ_ENABLE_MIGRATION_EXAMPLE |
onft721-zksync | ONFT721 zksolc | LZ_ENABLE_ZKSOLC_EXAMPLE |
oft-upgradeable | UpgradeableOFT | LZ_ENABLE_UPGRADEABLE_EXAMPLE |
native-oft-adapter | NativeOFTAdapter | LZ_ENABLE_NATIVE_EXAMPLE |
oft-alt | OFTAlt | LZ_ENABLE_ALT_EXAMPLE |
mint-burn-oft-adapter | MintBurnOFTAdapter | LZ_ENABLE_MINTBURN_EXAMPLE |
oapp-read | lzRead View/Pure Functions Example | LZ_ENABLE_READ_EXAMPLE |
view-pure-read | lzRead Public Variables Example | LZ_ENABLE_READ_EXAMPLE |
uniswap-read | lzRead UniswapV3 Quote | LZ_ENABLE_READ_EXAMPLE |
oft-solana | OFT (Solana) | LZ_ENABLE_SOLANA_OFT_EXAMPLE |
oapp-solana | OApp (Solana) | LZ_ENABLE_SOLANA_OAPP_EXAMPLE |
oft-initia | OFT (Initia) | LZ_ENABLE_EXPERIMENTAL_INITIA_EXAMPLES |
oft-adapter-initia | OFT Adapter (Initia) | LZ_ENABLE_EXPERIMENTAL_INITIA_EXAMPLES |
oft-aptos-move | OFT (Aptos Move) | LZ_ENABLE_EXPERIMENTAL_MOVE_VM_EXAMPLES |
oft-adapter-aptos-move | OFT Adapter (Aptos Move) | LZ_ENABLE_EXPERIMENTAL_MOVE_VM_EXAMPLES |
oapp-aptos-move | OApp (Aptos Move) | LZ_ENABLE_EXPERIMENTAL_MOVE_VM_EXAMPLES |
oft-hyperliquid | OFT + Composer (Hyperliquid) | LZ_ENABLE_EXPERIMENTAL_HYPERLIQUID_EXAMPLE |
omni-call | EVM OmniCall | LZ_ENABLE_EXPERIMENTAL_OMNI_CALL_EXAMPLE |
Log Level
- Available choices:
"error","warn","info","http","verbose","debug","silly" - Default:
"info"
Package Manager
- Available choices:
"npm","pnpm","bun"
Environment Variables for Feature-Flagged Examples
To access feature-flagged examples, you can set the corresponding environment variables inline with the command. These examples provide access to experimental, specialized, or advanced features.Setting Environment Variables
On Unix/macOS/Linux:Example Usage
Basic Interactive Setup
Non-Interactive Setup with Options
Create an OFT Project
Create an ONFT721 Project
Using Feature-Flagged Examples
To use feature-flagged examples, include the required environment variable in the command:Next Steps
After creating your project withcreate-lz-oapp, you’ll have a fully structured omnichain application ready for development. The generated project includes:
- Example smart contracts implementing LayerZero standards
- Deployment scripts and configuration