Sending Tokenized Assets
To transfer tokens to different blockchain networks using LayerZero, you have 3 options:
Build your own Omnichain Token using LayerZero contract standards.
Send native gas tokens as part of your message's execution options.
Utilize a native bridge built on top of LayerZero (e.g., Stargate).
Building Your Own Omnichain Token
The Omnichain Fungible Token (OFT) Standard and Omnichain Non-Fungible Token (ONFT) Standard are ideal for creating tokens that exist on multiple chains.
These standards allow tokens to be transferred across multiple blockchains without asset wrapping or middlechains, ensuring consistency and interoperability for holders.
For new tokens, inherit from OFT
or ONFT
.
For existing tokens, use OFTAdapter
or ONFTAdapter
.
To build a token using OFT
or ONFT
, you need to deploy the standard contracts on each chain where the token you own will or currently exists.
Read the OFT Quickstart and the ONFT Quickstart to learn more.
Sending Small Amounts of Native Gas
Depending on your destination application's logic, you may want to transfer small amounts of native gas tokens for the destination chain's transaction fees or to help users onboard to the new blockchain.
LayerZero Message Execution Options enable you to send small amounts of native gas as part of your cross-chain call or to a specific address on the destination chain:
lzReceive
: SendgasLimit
AND / ORmsg.value
as part of the destinationEndpointV2.lzReceive
call.lzCompose
: SendgasLimit
AND / ORmsg.value
as part of the destinationEndpointV2.lzCompose
call.lzNativeDrop
: Send an_amount
of native gas in wei to a specific_receiver
address.
These gas amounts will be paid for on the source chain by the caller of EndpointV2.send
within your application, abstracting gas management from your users.
For more information, see Transaction Pricing.
Moving Native Assets (e.g., wETH, USDC, USDT)
To move native assets that have already been deployed by another contract owner, two methods exist to help your development:
Option 1: Protocols or Native Bridges Built on LayerZero
Utilize a protocol, decentralized exchange (DEX), or native asset bridge built on LayerZero (e.g., Stargate) for transferring native assets between chains.
Functionality: Stargate and similar platforms handle the creation of asset pools, facilitating the easy movement of native assets across multiple chains.
Advantages: This option enables you to utilize existing liquidity and composability with your smart contracts without the need for deploying the OFT Standards directly.
Read the Stargate Docs for how to transfer and swap cross-chain assets in your smart contracts.
Option 2: Wrapped Asset Bridges
If you run your own blockchain, you can Contact LayerZero Labs to deploy a LayerZero Endpoint contract on your network. This enables the creation of a wrapped asset bridge to easily move existing assets to your chain.
Wrapped Asset Bridge: The bridge locks tokens on the source chain and mints equivalent tokens on the destination chain using the OFT Standard.
This method is not advisable if this bridge will not be endorsed by the chain, as it requires acceptance and liquidity to be provided for the new token standard (e.g., "yourUSDC") by DeFi applications. Established tokens or those endorsed by the chain will have better composability and usability.