layerzero

Implement LayerZero V2 cross-chain messaging, OFT tokens, and DVN security configuration.

1|1|Updated May 21, 2026
One-click install
npx skills add https://github.com/naruto11eth/cryptoskills --skill layerzero-naruto11eth
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: layerzero
Source: https://github.com/naruto11eth/cryptoskills/tree/main/skills/layerzero
Command: npx skills add https://github.com/naruto11eth/cryptoskills --skill layerzero-naruto11eth

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? AI agents frequently confuse LayerZero V1 and V2 architectures, hallucinate contract addresses, misuse chain IDs instead of endpoint IDs, and misconfigure peers or fees — causing reverted transactions and failed cross-chain messages. This Skill provides verified V2 contract addresses, correct OApp/OFT patterns, and debugging workflows for building reliable omnichain applications. ## Core Features & Use Cases - OApp Development: Complete patterns for sending and receiving cross-chain messages via _lzSend/_lzReceive, including fee quoting, message options, and composed messages. - OFT & OFTAdapter Deployment: Deploy new Omnichain Fungible Tokens or wrap existing ERC-20s with OFTAdapter, with shared decimals handling and bidirectional peer configuration. - DVN Security Configuration: Configure required and optional DVN sets (LayerZero Labs, Google Cloud, Polyhedra) with ULN302 send/receive library settings per pathway. - Use Case: Deploy an OFTAdapter on Ethereum for an existing ERC-20 and an OFT on Arbitrum, set peers bidirectionally, configure a 1-required + 1-of-2-optional DVN stack, and send tokens cross-chain with correct fee quoting. ## Quick Start Ask the agent to deploy a LayerZero V2 OApp on Ethereum and Arbitrum with peers configured and send a test cross-chain message.

Frequently Asked Questions about layerzero

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I send a cross-chain message with LayerZero V2?

Inherit OApp, call _quote to get the MessagingFee, then call _lzSend with the destination eid, payload, options, and fee. On the destination, override _lzReceive to handle the incoming payload. Always quote fees immediately before sending.

What is the difference between LayerZero V1 and V2?

V2 replaces V1's LZApp and monolithic oracle-relayer model with OApp contracts, EndpointV2, and modular DVN plus Executor verification. Use @layerzerolabs/oapp-evm for V2; the solidity-examples package is V1 and should not be imported.

How do I bridge an existing ERC-20 token cross-chain with OFT?

Deploy OFTAdapter on the token's home chain to lock the original ERC-20, and deploy OFT contracts on remote chains that mint representations. Set peers bidirectionally using bytes32-encoded addresses, then call send with a quoted fee.

Why does my LayerZero transaction revert with NoPeer or OnlyPeer?

NoPeer means setPeer was never called for that destination eid on the source OApp. OnlyPeer means the receiving chain has not registered the sender as its peer. Peers must be set bidirectionally using left-padded bytes32 addresses, not raw addresses.

Why is my LayerZero message stuck at Verifying on LayerZero Scan?

DVNs wait for the configured block confirmations before verifying; Ethereum defaults to around 15 confirmations. Also verify your DVN configuration supports the specific chain pair, since not all DVNs operate on every pathway.

What are shared decimals in LayerZero OFT transfers?

OFT normalizes tokens to 6 shared decimals by default, so an 18-decimal token loses 12 digits of dust per transfer. Override sharedDecimals() to increase precision, and set minAmountLD based on the post-conversion amount to avoid SlippageExceeded reverts.