Project type: Cross-chain Infrastructure

Home | LayerZero\</A> Developers\</A> Developers\</A> How It Works\</A> How It Works\</A> Ecosystem\</A> Ecosystem\</A> LzCatalyst\</A> LzCatalyst\</A> Community\</A> Community\</A> Scan\</A> Scan Events\</A> Events](/events)Developer AssistanceDeveloper Assistance# Build
/// one protocol. any Blockchain.PositioningPrinciplesLayerzero numbersMessage LifecycleEcosystemCode examplesStart building to explore01 / 06PositioningLayerZero is a technology that enables applications to move data across blockchains, uniquely supporting censorship-resistant messages and permissionless development through immutable smart contractsDocumentation / 06PrinciplesPrinciples./ 01Censorship-ResistantThe protocol ensures all messages are delivered without selective interference./ 02ImmutableThe underlying technology framework for sending and receiving messages will never change in perpetuity./ 03PermissionlessAnyone can run the required infrastructure to service applications that use the protocol.03 / 06LIVELayerZero By the numbersVisit LayerZERO SCAN Messages-Value Transferred$0+Supported Blockchains0+Applications Built on LayerZero0+04 / 06Message LifecycleLayerZero
Connects BlockchainsLearn more05 / 06Ecosystem OverviewSupporting an Omnichain Ecosystem.View moreDeFiInfrastructureNFTGamingDEFIEthenaEthena's synthetic dollar, USDe, provides the crypto-native, scalable solution for money achieved by delta-hedging staked Ethereum collateral. ENA, USDe, and sUSDE are OFTs available on multiple chains. is a liquid staking and restaking protocol, using LayerZero for native Layer 2 restaking. Its token, weETH, is a liquid restaking token that adopts the OFT standard.]( the utility token of PancakeSwap, is an OFT that is available across multiple networks; it is used to incentivize liquidity and allow holders to participate in governance.]( Capital](/static/ecosystem/Radiant.svg)Radiant CapitalRadiant Capital is an omnichain money market, allowing users to deposit major assets across chains and borrow supported assets cross-chain. $RDNT, the utility token, is interoperable via LayerZero OFT's standard.]( is a community-driven organization building a fully composable liquidity transport protocol that lives at the heart of Omnichain DeFi.]( JOE token has been transformed into an omnichain fungible token (OFT) standard that enables users to bridge JOE across Avalanche, Arbitrum, BNB and beyond.]( / 06code examplesDevelop with LayerZero.LayerZero protocol provides developers with the necessary tools to send messages across blockchains while retaining ownership of security. Move data, issue tokens, and build dApps on any blockchain through omnichain contract standards like OApp, OFT, and ONFT.Learn more 
4import { IOApp, ILayerZeroEndpointV2 } from "./interfaces/IOApp.sol";
5import { OAppSender } from "./OAppSender.sol";
6// @dev import the origin so its exposed to OApp implementers
7import { OAppReceiver, Origin } from "./OAppReceiver.sol";
9abstract contract OApp is IOApp, OAppSender, OAppReceiver {
10 constructor(address _endpoint, address _owner) {
11 _transferOwnership(_owner);
12 endpoint = ILayerZeroEndpointV2(_endpoint);
13 }
15 function oAppVersion() public pure virtual returns (uint64 senderVersion, uint64 receiverVersion) {
16 senderVersion = SENDER_VERSION;
17 receiverVersion = RECEIVER_VERSION;
18 }
OAPP.SOLApplicationProvides developers with a generic message passing interface to send and receive arbitrary pieces of data between contracts existing on different blockchain networks.HoverView code
4import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
5import { OFTCore } from "./OFTCore.sol";
7contract OFT is OFTCore, ERC20 {
8 constructor(
9 string memory _name,
10 string memory _symbol,
11 address _lzEndpoint,
12 address _owner
13 ) ERC20(_name, _symbol) OFTCore(decimals(), _lzEndpoint, _owner) {}
15 // @dev major indicates they shared a compatible msg payload format and CAN communicate between one another
16 // @dev minor indicates a varying version, eg. OFTAdapter vs. OFT
17 function oftVersion() external pure returns (uint64 major, uint64 minor) {
18 return (1, 1);
19 }
21 function token() external view virtual returns (address) {
22 return address(this);
23 }
25 // @dev burn the tokens from the users specified balance
26 function _debitSender(
27 uint256 _amountToSendLD,
28 uint256 _minAmountToReceiveLD,
29 uint32 _dstEid
30 ) internal virtual override returns (uint256 amountDebitedLD, uint256 amountToCreditLD) {
31 (amountDebitedLD, amountToCreditLD) = _debitView(_amountToSendLD, _minAmountToReceiveLD, _dstEid);
33 _burn(msg.sender, amountDebitedLD);
34 }
36 // @dev burn the tokens that someone has sent into this contract in a push method
37 // @dev allows anyone to send tokens that have been sent to this contract
38 // @dev similar to how you can push tokens to the endpoint to pay the msg fee, vs the endpoint needing approval
39 function _debitThis(
40 uint256 _minAmountToReceiveLD,
41 uint32 _dstEid
42 ) internal virtual override returns (uint256 amountDebitedLD, uint256 amountToCreditLD) {
43 (amountDebitedLD, amountToCreditLD) = _debitView(balanceOf(address(this)), _minAmountToReceiveLD, _dstEid);
45 _burn(address(this), amountDebitedLD);
46 }
48 function _credit(
49 address _to,
50 uint256 _amountToCreditLD,
51 uint32 /*_srcEid*/
52 ) internal virtual override returns (uint256 amountReceivedLD) {
53 _mint(_to, _amountToCreditLD);
54 return _amountToCreditLD;
55 }
OFT.SOLTokenOFTs allow fungible tokens to be transferred across multiple blockchains without asset wrapping, middlechains, or liquidity pools.HoverView codeSocial Media\</A> Telegram\</A> Telegram Discord\</A> Discord]( X (Twitter)\</A> X (Twitter)]( Medium\</A> Medium]( the developersDeveloper AssistanceLayerZero Scan V2 Github]( Form](’re hiring](/careers)Media Kit of Use](/terms)Privacy PolicyCookie Policy© 2024 LayerZero