Skip to main content

Contract Standards

Developers can easily start building omnichain applications by inheriting and extending LayerZero Contract Standards that seamlessly integrate with the protocol's interfaces.

LayerZero offers a suite of template contracts to expedite the development process. These templates serve as foundational blueprints for developers to build upon:

OApp

The OApp Contract Standard provides developers with a generic message passing interface to send and receive arbitrary pieces of data between contracts existing on different blockchain networks.

OApp Example OApp Example

This standard abstracts away the core Endpoint interfaces, allowing you to focus on your application's core implementation and features without needing a complex understanding of the LayerZero protocol architecture.

This interface can easily be extended to include anything from specific financial logic in a DeFi application to a voting mechanism in a DAO, or broadly any smart contract use case.

OFT

The Omnichain Fungible Token (OFT) Standard allows fungible tokens to be transferred across multiple blockchains without asset wrapping or middlechains.

This standard works by burning tokens on the source chain whenever an omnichain transfer is initiated, sending a message via the protocol, and delivering a function call to the destination contract to mint the same number of tokens burned. This creates a unified supply across all networks LayerZero supports that the OFT is deployed on.

OFT Example OFT Example

Using this design pattern, developers can extend any fungible token to interoperate with other chains using LayerZero. The most widely used of these standards is OFT.sol, an extension of the OApp Contract Standard and the ERC20 Token Standard.

Configuration

All Contract Standards offer an opt-in default OApp Configuration, allowing for rapid development without needing complex setup or post-deployment configuration.

The OApp owner or delegated signer can change or lock your configuration at any time.