> ## Documentation Index
> Fetch the complete documentation index at: https://docs.layerzero.network/llms.txt
> Use this file to discover all available pages before exploring further.

# Interactive Contract Playground

> Step-by-step guide to interactive contract playground using LayerZero V2. Build and deploy omnichain applications with crosschain messaging. Follow step-by-...

Test LayerZero contracts directly from your browser. No coding required. Explore key application functions for message fee calculation, sending, receiving, configuration, and state management. This page focuses on methods relevant to building applications and does not include worker-related functions.

> [!TIP]
>
> ### Real Onchain Methods
>
> All functions shown in this playground are **real methods** available in the LayerZero contracts today:
>
> * **Endpoint Contract**: [Source Code](https://github.com/LayerZero-Labs/LayerZero-v2/tree/main/packages/layerzero-v2/evm/protocol/contracts)
> * **OFT Contract**: [Source Code](https://github.com/LayerZero-Labs/devtools/tree/main/packages/oft-evm)
>
> We only document OApp-relevant instructions, excluding admin-only functions. State variables are clearly marked as direct account data reads, not instructions.

## LayerZero EndpointV2

The main entry point for all crosschain messaging operations. This contract handles message routing, fee calculation, and configuration management.

### Message Routing

Core functions for sending and receiving messages between smart contracts.

#### quote() - Get Fee Estimates

Loading...

#### send() - Send Messages

Loading...

#### lzReceive() - Receive Messages

Loading...

#### sendCompose() - Send Compose Messages

Loading...

#### lzCompose() - Execute Compose Messages

Loading...

### Configuration Management

Functions for setting custom verification, execution, and pathway management.

#### eid() - Get Endpoint ID

Loading...

#### isRegisteredLibrary() - Check Library Registration

Loading...

#### receiveLibraryTimeout() - Get Library Timeout

Loading...

#### setDelegate() - Set Delegate Address

Loading...

#### setSendLibrary() - Configure Send Library

Loading...

#### setReceiveLibrary() - Configure Receive Library

Loading...

#### setConfig() - Set Configuration Parameters

Loading...

### Message Recovery & Security

Functions for handling message exceptions, security threats, and recovery scenarios.

#### clear() - Clear Stored Message

Loading...

#### burn() - Permanently Block Message

Loading...

#### skip() - Skip Message Nonce

Loading...

#### nilify() - Mark Message as Nil

Loading...

### Status Checks

Functions for querying current configuration settings, library assignments, nonce tracking, and message states.

#### getConfig() - Check Configuration

Loading...

#### delegates() - Check Delegate Address

Loading...

#### getSendLibrary() - Get Send Library

Loading...

#### getReceiveLibrary() - Get Receive Library

Loading...

#### inboundNonce() - Get Processed Nonce

Loading...

#### lazyInboundNonce() - Get Lazy Nonce

Loading...

#### initializable() - Check Message Initialization

Loading...

#### verifiable() - Check Message Verification

Loading...

#### inboundPayloadHash() - Get Message Payload Hash

Loading...

#### nextGuid() - Get Next Message GUID

Loading...

#### composeQueue() - Check Compose Message Queue

Loading...

#### isSendingMessage() - Check Send State

Loading...

#### getSendContext() - Get Current Send Context

Loading...

### Events

Key events emitted by the EndpointV2 contract.

#### PacketSent - Message Sent Event

Emitted when a packet is sent through the endpoint. Contains the encoded packet data and execution options for tracking crosschain messages.

#### PacketVerified - Message Verified Event

Emitted when a packet has been verified by the receive library and is ready for delivery. Contains the origin chain, sender, receiver, and nonce information.

#### PacketDelivered - Message Delivered Event

Emitted when a packet is successfully delivered to the receiver OApp. Indicates the message has been executed on the destination chain.

#### ComposeSent - Compose Message Queued Event

Emitted when an OApp queues a composed message via sendCompose(). This occurs when an OApp wants to send a follow-up message after processing an incoming crosschain message, enabling horizontal composability.

#### ComposeDelivered - Compose Message Delivered Event

Emitted when a composed message is successfully delivered to the target composer contract via lzCompose(). Indicates the composed message has been executed, completing the horizontal composability flow.

#### DelegateSet - Delegate Configuration Event

Emitted when a delegate is set for a sender. Delegates can configure messaging parameters on behalf of the sender, enabling easier management of crosschain configurations.

#### SendLibrarySet - Send Library Configuration Event

Emitted when a send library is configured for an OApp on a specific endpoint. Send libraries handle the outbound message packaging and transmission logic.

#### ReceiveLibrarySet - Receive Library Configuration Event

Emitted when a receive library is configured for an OApp on a specific endpoint. Receive libraries handle the verification and processing of inbound messages.

#### ReceiveLibraryTimeoutSet - Library Timeout Configuration Event

Emitted when a timeout is set for transitioning from an old receive library to a new one. This grace period ensures smooth library migrations without message loss.

#### InboundNonceSkipped - Nonce Skip Event

Emitted when inbound message nonces are skipped to handle out-of-order message delivery. This allows for more flexible message ordering when required by the application.

#### PacketNilified - Message Nilified Event

Emitted when a packet is nilified (marked as processed without execution). This acknowledges receipt while preventing execution, useful for handling invalid or unwanted messages.

#### PacketBurnt - Message Burnt Event

Emitted when a packet is permanently burnt from the message queue. This removes the message entirely, typically used for cleanup of undeliverable or expired messages.

### Errors

#### LZ\_InsufficientFee - Insufficient Fee

Thrown when the provided fee is insufficient to cover the crosschain messaging costs. Always call quote() first to get the exact fee required.

#### LZ\_InvalidNonce - Invalid Nonce

Thrown when attempting to process a message with an invalid nonce. This ensures messages are processed in the correct order.

#### LZ\_Unauthorized - Unauthorized Access

Thrown when an unauthorized address attempts to perform a restricted operation. Only authorized contracts and delegates can perform certain actions.

#### LZ\_SendReentrancy - Send Reentrancy Detected

Thrown when a reentrant call is detected during message sending. This protects against reentrancy attacks during crosschain operations.

#### Key Functions to Try:

* **Messaging Operations:**
  * `quote()` - Get fee estimates for crosschain messages
  * `send()` - Send messages to other chains
  * `lzReceive()` - Receive messages from other chains
  * `sendCompose()` - Queue compose messages
  * `lzCompose()` - Execute compose messages
* **Configuration Management:**
  * `setDelegate()` - Assign configuration permissions
  * `setSendLibrary()` - Choose send message library
  * `setReceiveLibrary()` - Choose receive message library
  * `setConfig()` - Set library-specific parameters
* **Message Recovery & Security:**
  * `burn()` - Permanently block malicious messages
  * `skip()` - Skip flagged message nonces
  * `nilify()` - Mark messages for re-verification
  * `clear()` - Clear verified but unexecuted messages
* **Status Checks:**
  * `getConfig()` - Check current configurations
  * `delegates()` - View current delegate address
  * `getSendLibrary()` - Check send library for endpoint
  * `getReceiveLibrary()` - Check receive library for endpoint
  * `inboundNonce()` - Get highest processed message nonce
  * `lazyInboundNonce()` - Get highest verified/skipped nonce
  * `nextGuid()` - Get next message GUID
  * `composeQueue()` - Check compose queue
  * `isSendingMessage()` - Check send state
  * `getSendContext()` - Get send context

## LayerZero Message Libraries

Message Libraries handle the core verification and execution logic for LayerZero messages. While developers don't interact with these contracts directly, understanding their error codes and events is crucial for debugging failed transactions.

### Current Message Libraries

* **SendUln302**: Handles outbound message verification setup
* **ReceiveUln302**: Processes inbound message verification and execution
* **ReadLib1002**: Manages crosschain read operations

> **When You'll See These**: These errors appear when calling Endpoint methods like `send()` or `lzReceive()`. The Endpoint delegates to these libraries internally, so their errors bubble up through your Endpoint transactions.

### SendUln302 - Outbound Message Library

The SendUln302 library manages the configuration and verification setup for outbound messages. It coordinates with DVNs (Decentralized Verifier Networks) and handles fee calculations for message transmission.

### Errors

Configuration & Setup Errors

#### LZ\_ULN\_InvalidConfigType - Invalid Configuration Type

Thrown when attempting to set an invalid configuration type. Valid types are CONFIG\_TYPE\_ULN (2) for ULN config and CONFIG\_TYPE\_EXECUTOR (1) for executor config.

#### LZ\_ULN\_InvalidRequiredDVNCount - Invalid DVN Count

Thrown when the required DVN count is invalid. Must have at least one required DVN and cannot exceed the maximum allowed DVNs.

#### LZ\_ULN\_InvalidOptionalDVNCount - Invalid Optional DVN Count

Thrown when the optional DVN count configuration is invalid. Optional DVNs must be properly configured with a threshold.

#### LZ\_ULN\_InvalidOptionalDVNThreshold - Invalid DVN Threshold

Thrown when the optional DVN threshold is invalid. The threshold must be greater than 0 and less than or equal to the number of optional DVNs.

#### LZ\_ULN\_AtLeastOneDVN - At Least One DVN Required

Thrown when attempting to configure a path without any DVNs. At least one DVN must be specified for message verification.

#### LZ\_ULN\_InvalidConfirmations - Invalid Confirmations

Thrown when the confirmation count is invalid. Confirmations must be within acceptable range for the destination chain.

#### LZ\_ULN\_Unsorted - DVNs Not Sorted

Thrown when DVN addresses are not provided in sorted order. DVN addresses must be sorted in ascending order.

Worker & Option Errors

#### LZ\_ULN\_InvalidWorkerId - Invalid Worker ID

Thrown when an invalid worker ID is provided. Valid worker IDs are 1 for DVN and 2 for Executor.

#### LZ\_ULN\_InvalidWorkerOptions - Invalid Worker Options

Thrown when worker options are malformed or contain invalid parameters. The cursor parameter indicates where in the options the error was found.

#### LZ\_ULN\_UnsupportedOptionType - Unsupported Option Type

Thrown when an unsupported option type is provided. Check the supported option types for your message library version.

#### LZ\_ULN\_InvalidLegacyType1Option - Invalid Legacy Type 1 Option

Thrown when legacy type 1 options are invalid or incorrectly formatted.

#### LZ\_ULN\_InvalidLegacyType2Option - Invalid Legacy Type 2 Option

Thrown when legacy type 2 options are invalid or incorrectly formatted.

#### LZ\_ULN\_UnsupportedEid - Unsupported Endpoint ID

Thrown when attempting to send to an unsupported or invalid endpoint ID.

Fee & Payment Errors

#### LZ\_MessageLib\_InvalidAmount - Invalid Fee Amount

Thrown when the provided fee amount doesn't match the required amount. The error returns both the requested amount and the available amount. Always use quote() to get the exact fee required.

#### LZ\_MessageLib\_TransferFailed - Fee Transfer Failed

Thrown when the native token transfer for fees fails. This can occur if the contract doesn't have sufficient balance or if the transfer is blocked.

Library Access Errors

#### LZ\_MessageLib\_OnlyEndpoint - Only Endpoint Allowed

Thrown when a function is called by an address other than the LayerZero endpoint. Only the endpoint can call library functions.

#### LZ\_MessageLib\_InvalidExecutor - Invalid Executor

Thrown when an invalid executor address is provided or the executor is not authorized.

#### LZ\_MessageLib\_NotTreasury - Not Treasury

Thrown when a treasury-only function is called by a non-treasury address.

#### LZ\_MessageLib\_CannotWithdrawAltToken - Cannot Withdraw Alt Token

Thrown when attempting to withdraw alternative tokens that cannot be withdrawn from the library.

Message Validation Errors

#### LZ\_MessageLib\_InvalidMessageSize - Message Too Large

Thrown when the message size exceeds the maximum allowed size. Returns both the actual size and the maximum allowed size. Consider breaking large messages into smaller chunks.

#### LZ\_MessageLib\_ZeroMessageSize - Zero Message Size

Thrown when attempting to send a message with zero size. Messages must contain data.

#### DVN\_InvalidDVNOptions - Invalid DVN Options

Thrown when DVN options are malformed or contain invalid parameters. The cursor parameter indicates where in the options the error was found.

#### DVN\_InvalidDVNIdx - Invalid DVN Index

Thrown when an invalid DVN index is provided. The index must be within the range of configured DVNs.

Transfer Errors

#### Transfer\_NativeFailed - Native Transfer Failed

Thrown when a native token transfer fails. Returns the recipient address and amount that failed to transfer.

#### Transfer\_ToAddressIsZero - Transfer to Zero Address

Thrown when attempting to transfer to the zero address. Transfers must be to valid addresses.

### Events

#### DVNFeePaid - DVN Fee Payment

Emitted when fees are paid to DVNs for message verification. Contains the DVN addresses and fee amounts for tracking payment distribution.

### ReceiveUln302 - Inbound Message Library

The ReceiveUln302 library handles the verification and execution of inbound messages. It validates DVN signatures, manages message ordering, and ensures secure message delivery.

### Errors

Verification Errors

#### LZ\_ULN\_InvalidPacketHeader - Invalid Packet Header

Thrown when the packet header is malformed or contains invalid data. This typically indicates corruption or tampering with the message.

#### LZ\_ULN\_InvalidPacketVersion - Wrong Packet Version

Thrown when the packet version doesn't match the expected version. This library expects packet version 1.

#### LZ\_ULN\_InvalidEid - Invalid Endpoint ID

Thrown when the endpoint ID in the packet doesn't match the expected source or destination. This prevents message routing errors.

Configuration Errors

#### LZ\_ULN\_InvalidConfigType - Invalid Configuration Type

Thrown when attempting to set an invalid configuration type. Valid types are CONFIG\_TYPE\_ULN (2) for ULN config.

#### LZ\_ULN\_InvalidRequiredDVNCount - Invalid DVN Count

Thrown when the required DVN count is invalid. Must have at least one required DVN and cannot exceed the maximum allowed DVNs.

#### LZ\_ULN\_InvalidOptionalDVNCount - Invalid Optional DVN Count

Thrown when the optional DVN count configuration is invalid. Optional DVNs must be properly configured with a threshold.

#### LZ\_ULN\_InvalidOptionalDVNThreshold - Invalid DVN Threshold

Thrown when the optional DVN threshold is invalid. The threshold must be greater than 0 and less than or equal to the number of optional DVNs.

#### LZ\_ULN\_AtLeastOneDVN - At Least One DVN Required

Thrown when attempting to configure a path without any DVNs. At least one DVN must be specified for message verification.

#### LZ\_ULN\_InvalidConfirmations - Invalid Confirmations

Thrown when the confirmation count is invalid. Confirmations must be within acceptable range for the source chain.

#### LZ\_ULN\_Unsorted - DVNs Not Sorted

Thrown when DVN addresses are not provided in sorted order. DVN addresses must be sorted in ascending order.

#### LZ\_ULN\_UnsupportedEid - Unsupported Endpoint ID

Thrown when receiving from an unsupported or invalid endpoint ID.

#### LZ\_ULN\_Verifying - Already Verifying

Thrown when attempting to verify a packet that is already being verified. Wait for the current verification to complete.

#### LZ\_MessageLib\_OnlyEndpoint - Only Endpoint Allowed

Thrown when a function is called by an address other than the LayerZero endpoint. Only the endpoint can call library functions.

### ReadLib1002 - Crosschain Read Library

The ReadLib1002 library enables crosschain data reading without state changes. It manages read channels, handles request/response cycles, and ensures data integrity.

### Errors

Configuration Errors

#### LZ\_RL\_InvalidConfigType - Invalid Configuration Type

Thrown when attempting to set an invalid configuration type. Valid types are CONFIG\_TYPE\_ULN for read library config and CONFIG\_TYPE\_EXECUTOR for executor config.

#### LZ\_RL\_InvalidRequiredDVNCount - Invalid DVN Count

Thrown when the required DVN count is invalid for read operations. Must have at least one required DVN.

#### LZ\_RL\_InvalidOptionalDVNCount - Invalid Optional DVN Count

Thrown when the optional DVN count configuration is invalid for read operations.

#### LZ\_RL\_InvalidOptionalDVNThreshold - Invalid DVN Threshold

Thrown when the optional DVN threshold is invalid. The threshold must be greater than 0 and less than or equal to the number of optional DVNs.

Validation Errors

#### LZ\_RL\_InvalidPacketHeader - Invalid Packet Header

Thrown when the read packet header is malformed or contains invalid data.

#### LZ\_RL\_InvalidPacketVersion - Wrong Packet Version

Thrown when the read packet version doesn't match the expected version.

#### LZ\_RL\_InvalidCmdHash - Invalid Command Hash

Thrown when the command hash doesn't match the expected value, indicating potential tampering or corruption.

#### LZ\_RL\_InvalidReceiver - Invalid Receiver

Thrown when the receiver address for the read response is invalid or not authorized.

#### LZ\_RL\_InvalidAmount - Invalid Fee Amount

Thrown when the provided fee amount doesn't match the required amount for the read operation.

#### LZ\_RL\_Verifying - Already Verifying

Thrown when attempting to verify a read response that is already being verified.

#### LZ\_RL\_InvalidEid - Invalid Endpoint ID

Thrown when the endpoint ID in the read packet doesn't match the expected source or destination.

#### LZ\_RL\_AtLeastOneDVN - At Least One DVN Required

Thrown when attempting to configure a read path without any DVNs.

#### LZ\_RL\_Unsorted - DVNs Not Sorted

Thrown when DVN addresses are not provided in sorted order for read operations.

#### LZ\_RL\_UnsupportedEid - Unsupported Endpoint ID

Thrown when attempting to read from an unsupported or invalid endpoint ID.

Library Access Errors

#### LZ\_MessageLib\_OnlyEndpoint - Only Endpoint Allowed

Thrown when a function is called by an address other than the LayerZero endpoint.

#### LZ\_RL\_InvalidExecutor - Invalid Executor

Thrown when an invalid executor address is provided for read operations.

#### LZ\_RL\_NotTreasury - Not Treasury

Thrown when a treasury-only function is called by a non-treasury address.

#### LZ\_RL\_CannotWithdrawAltToken - Cannot Withdraw Alt Token

Thrown when attempting to withdraw alternative tokens that cannot be withdrawn from the read library.

Worker & Option Errors

#### LZ\_ULN\_InvalidWorkerId - Invalid Worker ID

Thrown when an invalid worker ID is provided for read operations.

#### LZ\_ULN\_InvalidWorkerOptions - Invalid Worker Options

Thrown when worker options are malformed for read operations.

#### LZ\_ULN\_UnsupportedOptionType - Unsupported Option Type

Thrown when an unsupported option type is provided for read operations.

#### LZ\_ULN\_InvalidLegacyType1Option - Invalid Legacy Type 1 Option

Thrown when legacy type 1 options are invalid for read operations.

#### LZ\_ULN\_InvalidLegacyType2Option - Invalid Legacy Type 2 Option

Thrown when legacy type 2 options are invalid for read operations.

DVN Errors

#### DVN\_InvalidDVNOptions - Invalid DVN Options

Thrown when DVN options are malformed for read operations.

#### DVN\_InvalidDVNIdx - Invalid DVN Index

Thrown when an invalid DVN index is provided for read operations.

Transfer Errors

#### Transfer\_NativeFailed - Native Transfer Failed

Thrown when a native token transfer fails in read operations.

#### Transfer\_ToAddressIsZero - Transfer to Zero Address

Thrown when attempting to transfer to the zero address in read operations.

### Troubleshooting Common Library Errors

#### Fee-Related Issues

* **LZ\_MessageLib\_InvalidAmount**: Always use `quote()` before `send()` to get exact fees
* **LZ\_MessageLib\_TransferFailed**: Ensure contract has sufficient ETH balance
* **LZ\_RL\_InvalidAmount**: Ensure correct fee for read operations
* **DVN\_InvalidDVNOptions**: Check DVN option encoding and parameters

#### Configuration Issues

* **LZ\_ULN\_InvalidRequiredDVNCount**: Must have at least 1 required DVN
* **LZ\_ULN\_InvalidOptionalDVNThreshold**: Threshold must be ≤ optional DVN count
* **LZ\_ULN\_InvalidConfigType**: Use correct config type (ULN=2, Executor=1)
* **LZ\_RL\_InvalidConfigType**: Use correct config type for read library

#### Verification Issues

* **LZ\_ULN\_Verifying**: Message already being verified, wait for completion
* **LZ\_RL\_Verifying**: Read response already being verified
* **LZ\_ULN\_InvalidPacketHeader**: Possible message corruption or tampering
* **LZ\_RL\_InvalidPacketHeader**: Read packet header malformed
* **LZ\_ULN\_InvalidPacketVersion**: Wrong packet version for message library
* **LZ\_RL\_InvalidPacketVersion**: Wrong packet version for read library

For detailed troubleshooting guides, see [LayerZero Troubleshooting](https://docs.layerzero.network/v2/developers/evm/troubleshooting/debugging-messages.md).

## Omnichain Application (OApp)

The foundation for building any crosschain application. **OApp** provides the core messaging infrastructure for a smart contract interacting with the **EndpointV2**.

### Core Information

#### oAppVersion() - Get OApp Version

Loading...

#### endpoint() - Get Endpoint Address

Loading...

### Peer Configuration

#### peers() - Get Remote Peer Address

Loading...

#### setPeer() - Connect Remote Chains

Loading...

#### setDelegate() - Set Configuration Delegate

Loading...

### Message Reception

#### allowInitializePath() - Check Path Initialization

Loading...

#### nextNonce() - Get Next Message Nonce

Loading...

#### lzReceive() - Receive Crosschain Messages

Loading...

### Composability

#### isComposeMsgSender() - Verify Compose Sender

Loading...

### Events and Errors

Key events and errors emitted by the OApp contract.

#### Events

#### PeerSet - Peer Configuration Updated

Emitted when a peer address is configured for a destination chain. Contains the endpoint ID (eid) and the peer address (bytes32). This establishes the trusted relationship between OApp contracts on different chains.

#### Errors

#### OnlyPeer - Unauthorized Peer Message

Thrown when receiving a message from an address that is not a configured peer for the source chain. Only messages from trusted peer contracts are accepted.

#### NoPeer - Missing Peer Configuration

Thrown when attempting to send a message to a destination chain where no peer contract has been configured. Use setPeer() to configure the peer address first.

#### InvalidEndpointCall - Invalid Endpoint Call

Thrown when the endpoint call doesn't meet the required conditions or format. This typically occurs when the call parameters or context are invalid.

#### InvalidDelegate - Invalid Delegate Configuration

Thrown when attempting to set an invalid delegate address. Delegates must be valid addresses that can configure messaging parameters on behalf of the OApp.

#### NotEnoughNative - Insufficient Native Fee

Thrown when msg.value is insufficient to cover the native fee for sending a crosschain message. Always call quote() first to get the exact fee required, then send that amount as msg.value.

#### OnlyEndpoint - Unauthorized Endpoint Call

Thrown when a function restricted to the LayerZero endpoint is called by an unauthorized address. Functions like lzReceive() can only be called by the trusted endpoint contract.

#### LzTokenUnavailable - LayerZero Token Not Available

Thrown when attempting to pay fees with LayerZero token but the LZ token is not available or not configured for the current endpoint. Use native token payment instead.

#### Key Functions to Try:

* **Core Information:**
  * `oAppVersion()` - Get OApp version information
  * `endpoint()` - Get connected endpoint address
* **Peer Configuration:**
  * `setPeer()` - Connect to remote chains
  * `peers()` - Check connected chains
  * `setDelegate()` - Set configuration delegate
* **Message Reception:**
  * `lzReceive()` - Receive crosschain messages
  * `allowInitializePath()` - Check path initialization
  * `nextNonce()` - Get message ordering info
* **Composability:**
  * `isComposeMsgSender()` - Verify compose sender

#### Tips:

* Peers must be set before messaging
* Nonces ensure ordered delivery
* Options control execution parameters

## Omnichain Application Read (OAppRead)

**OAppRead** extends the standard **OApp** with LayerZero Read functionality, enabling crosschain data reading capabilities. It includes all standard methods plus the read channel configuration.

#### setReadChannel() - Configure Read Channel

Loading...

#### Key Functions to Try:

* `setReadChannel()` - Configure read channel for crosschain data reading
* Plus all standard OApp functions listed above

## Omnichain Fungible Token (OFT)

**OFT** inherits from **OApp**, providing all crosschain messaging capabilities plus token-specific functionality. Create tokens that work seamlessly across multiple blockchains while maintaining a unified supply.

### Send Tokens

#### quoteSend() - Get Transfer Fees

Loading...

#### quoteOFT() - Get Detailed Transfer Quote

Loading...

#### send() - Transfer Tokens

Loading...

### Token Details

#### sharedDecimals() - Get Shared Decimals

Loading...

#### approvalRequired() - Check Approval Requirement

Loading...

#### oftVersion() - Get OFT Version

Loading...

#### token() - Get Underlying Token Address

Loading...

#### decimalConversionRate() - Get Decimal Conversion Factor

Loading...

### Management Functions

#### owner() - Get Current Owner

Loading...

#### transferOwnership() - Transfer Contract Ownership

Loading...

#### renounceOwnership() - Renounce Ownership

Loading...

#### setPeer() - Connect to Remote OFTs

Loading...

#### setEnforcedOptions() - Configure Message Options

Loading...

#### setMsgInspector() - Set Message Inspector

Loading...

### Events

Key events emitted by the OFT contract.

#### OFTSent - Token Transfer Sent

Emitted when tokens are sent crosschain. Contains the message GUID, destination endpoint ID, sender and recipient addresses, and the amount sent in both shared and local decimals.

#### OFTReceived - Token Transfer Received

Emitted when tokens are received from another chain. Includes the message GUID, source endpoint ID, recipient address, and the amount received in both shared and local decimals.

#### Transfer - Standard ERC20 Transfer

Standard ERC20 Transfer event emitted when tokens are transferred, minted, or burned. Essential for tracking token movements and wallet balances.

### Errors

#### InvalidLocalDecimals - Invalid Decimal Configuration

Thrown when the local decimal configuration is invalid. OFT requires proper decimal setup to handle crosschain conversions between different token decimal standards.

#### SlippageExceeded - Transfer Slippage Too High

Thrown when the actual amount received after crosschain transfer falls below the minimum acceptable amount due to decimal conversions. Use quoteSend() to get accurate amounts and set appropriate minimums.

#### AmountSDOverflowed - Shared Decimal Overflow

Thrown when converting token amounts to shared decimals results in an overflow. This typically occurs with very large token amounts that exceed the maximum value in the shared decimal representation.

#### Key Functions to Try:

* **Transfer Operations:**
  * `quoteSend()` - Get transfer fee estimates
  * `send()` - Transfer tokens crosschain
  * `quoteOFT()` - Get comprehensive transfer quotes
* **Token Information:**
  * `sharedDecimals()` - Check decimal configuration
  * `approvalRequired()` - Check if approval is needed
  * `oftVersion()` - Get OFT implementation version
  * `token()` - Get underlying token address
  * `decimalConversionRate()` - Get decimal conversion factor
* **Management Functions:**
  * `owner()` - Check current contract owner
  * `setPeer()` - Connect to OFTs on other chains
  * `setEnforcedOptions()` - Configure security parameters
  * `setMsgInspector()` - Set message inspector
  * `transferOwnership()` - Transfer contract ownership
  * `renounceOwnership()` - Permanently remove ownership

#### Tips:

* Always call `quoteSend()` before `send()` to get accurate fees
* The `minAmountLD` parameter provides slippage protection
* Shared decimals (typically 6-8) may differ from local decimals (e.g., 18 for most ERC20s)
* `approvalRequired()` returns false for OFT and true for OFTAdapter
* Use `quoteOFT()` for detailed information including transfer limits and fee breakdowns
* OFTAdapter requires approval on the underlying token before sending
* Must call `setPeer()` to connect OFTs on different chains before transfers
* Only the contract owner can call management functions
* Use `setEnforcedOptions()` to enforce minimum gas limits for security
* `renounceOwnership()` is irreversible - use with extreme caution

For complete contract documentation including all functions, events, and technical details:

* [Contract Standards Overview](https://docs.layerzero.network/v2/developers/evm/overview.md)
* [OApp Technical Reference](https://docs.layerzero.network/v2/concepts/technical-reference/oapp-reference.md)
* [OFT Technical Reference](https://docs.layerzero.network/v2/concepts/technical-reference/oft-reference.md)
* [Protocol Contracts](https://docs.layerzero.network/v2/developers/evm/protocol-contracts-overview.md)

## Decentralized Verifier Network (DVN)

DVNs provide independent verification of crosschain messages. Each DVN can set custom pricing and confirmation requirements for different destination chains.

### getFee() - Get DVN Verification Fee

InteractiveDVN temporarily disabled.

CALL

getFee
(

)

### dstConfig() - Get DVN Configuration

InteractiveDVN temporarily disabled.

CALL

dstConfig
(

)

## Executor

Executors handle the final delivery of verified messages on destination chains. They manage gas pricing, execution parameters, and delivery guarantees.

### getFee() - Get Execution Fee

Loading...

### dstConfig() - Get Destination Configuration

Loading...

> [!NOTE]
>
> Contract ABIs shown here are from the latest deployment. Always verify addresses and ABIs for your specific use case.
