General
What is LayerZero and how does LayerZero Work?
What is LayerZero and how does LayerZero Work?
Where can I find LayerZero contract examples?
Where can I find LayerZero contract examples?
What is the estimated delivery time for a LayerZero message?
What is the estimated delivery time for a LayerZero message?
- Source Block Confirmations: The message waits for the source chain to finalize a specified number of block confirmations. To view the default configuration for a given pathway, refer to the default configs checker.
- DVN/Verification: Each Decentralized Verifier Network (DVN) submits one transaction to verify the message.
- Committer/Commit Verification: One additional transaction is required to commit the verified message.
- Executor/Message Execution: A final transaction is submitted to execute the message on the destination chain.
Total Time ≈ (sourceBlockTime × number of block confirmations) + (destinationBlockTime × (2 blocks + number of DVNs))Note: This formula offers a rough estimate for a message that does not implement lzCompose. It assumes that each transaction is included in the next block without delay and does not factor in network latency, or other real-world conditions that may affect transaction processing time.What's the difference between Endpoint ID (EID) and Chain ID?
What's the difference between Endpoint ID (EID) and Chain ID?
1 for Ethereum Mainnet, 42161 for Arbitrum Mainnet). It’s used by node clients, wallets, and RPCs to identify the network.Endpoint ID (EID) is LayerZero’s internal identifier used by the protocol to route messages between chains. Every LayerZero Endpoint contract has a unique EID. EIDs are VM-agnostic and do not map 1:1 to chain IDs.Key points:- EIDs are what you use in LayerZero configs, CLI commands, and contract calls
- Chain IDs are for EVM chains and used for RPCs/wallets; EIDs are for LayerZero messaging
- For EIDs, Mainnets typically use the
30xxxrange; testnets use the40xxxrange
What's the difference between Delegate and Owner?
What's the difference between Delegate and Owner?
LZ_Unauthorized() error.This is because the delegate can call most wire functions (like setPeer()), but only the owner can call setEnforcedOptions(). If the accounts differ and you attempt to call setEnforcedOptions() through the delegate, the call will fail.Unless there’s a specific need to separate permissions, it’s recommended to use the same address for both owner and delegate to avoid unintended access issues.Can I use the OFT standard if I already have tokens deployed across multiple chains?
Can I use the OFT standard if I already have tokens deployed across multiple chains?
- Each innerToken contract must expose externally callable
mintandburnfunctions. - The innerToken must grant the MintBurnOFTAdapter the necessary permissions (
MINTER_ROLEandBURNER_ROLE) to invoke these functions.
What is sharedDecimals? Can I override default sharedDecimals in an OFT contract?
What is sharedDecimals? Can I override default sharedDecimals in an OFT contract?
What should I set for msgType 1 and msgType 2
What should I set for msgType 1 and msgType 2
enforcedOptions. Use the OptionsBuilder to add the message execution options for each msgType.msgType 1 = SENDThis msgType is a basic token transfer or message send. It does not include a composed message.Options you can use:-
lzReceiveOption to specify the gas values the Executor uses when callinglzReceiveon the destination chain. -
lzNativeDropOption to specify how much native gas to drop to any address on the destination chain.
SEND_AND_CALLThis msgType includes additional composed message(s), allowing for one or more extra calls to be sent along with the message.Options you can use:-
lzReceiveOption to specify the gas values the Executor uses when callinglzReceiveon the destination chain. -
lzComposeOption to allocate gas and value for Composed Messages on the destination chain.
lzRecieve and lzCompose option. Overestimating wastes funds; underestimating may cause message execution to fail.Why is my transaction expensive?
Why is my transaction expensive?
Can I cancel verification of an in-flight message?
Can I cancel verification of an in-flight message?
skip() method on the endpoint to stop delivery. The skip function should be used only in instances where either message verification fails or must be stopped, not message execution. LayerZero provides separate handling for retrying or removing messages that have successfully been verified, but fail to execute.Learn more: Skip Message GuideWhat is "LZ Dead DVN"?
What is "LZ Dead DVN"?
How do I deploy my OFT to a new EVM network?
How do I deploy my OFT to a new EVM network?
- Add the new network to your
hardhat.config.tswith the correct LayerZero Endpoint ID and RPC URL - Deploy the OFT on the new network
- Update your
layerzero.config.tsto include the new contract and connections - Wire peers to apply configuration (If the current OFT deployment involves a non-EVM chain, follow the specific instructions for that VM)
Error & Troubleshooting
What are the common causes for _quote() function failures?
What are the common causes for _quote() function failures?
_quote() often stem from:- Incomplete Network Pathway: Not all pathways are fully wired, especially on testnets. Contact LayerZero if you require support for a specific pathway.
- Missing
enforcedOptionsorextraOptions: At least one must be set for a successful quote. - LZ Dead DVN: If your configuration includes LZ Dead DVN for a particular pathway, the quote will fail. OApps must configure DVNs explicitly on Mainnet.
What does "NotInitializable" mean on LayerZero Scan?
What does "NotInitializable" mean on LayerZero Scan?
-
Incorrect peer configuration:
Ensure that
setPeer()is correctly called on both the source and destination chains during deployment. Double-check that the address format and EID (endpoint ID) are accurate. -
Pathway not initialized correctly:
Confirm that
allowInitializePath()is properly implemented in your OApp contract. Learn more: Integration Checklist
endpoint.initOAppNonce was called with the correct parameters.Why is my message marked as "Blocked"?
Why is my message marked as "Blocked"?
- NotInitializable: Ensure peers are set correctly on both ends or pathway is initialized correctly as explained above.
- DVN mismatch: All DVN providers must be the same on source and destination.
- Block confirmations mismatch: Outbound confirmations must be ≥ inbound confirmations.
How do I resolve the error DVN_EidNotSupported?
How do I resolve the error DVN_EidNotSupported?
- Read-compatible DVNs (
lzRead) must only be used forlzRead(pull / request-response) workflows. - Using a Read-compatible DVN for push messaging will cause the error
DVN_EidNotSupported.
How do I prevent out-of-gas errors on the destination chain?
How do I prevent out-of-gas errors on the destination chain?
lzReceive() on the destination:- Use
enforcedOptions(set at the OApp/OFT contract level) to define a default gas value for all sends. - Use
extraOptions(specified in thesendfunction call) for transaction-specific overrides.
lzReceive() on the destination. It is also common to simply use enforcedOptions and set extraOptions to 0x.If the destination message fails due to insufficient gas, you can retry it manually:Ecosystem
Which projects are part of the LayerZero ecosystem?
Which projects are part of the LayerZero ecosystem?
How can my project be listed on the ecosystem page?
How can my project be listed on the ecosystem page?
Are there grants available for builders on LayerZero?
Are there grants available for builders on LayerZero?