Skip to main content
Version: Endpoint V2

Interactive Contract Playground

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.

Real On-Chain Methods

All functions shown in this playground are real methods available in the LayerZero contracts today:

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 cross-chain 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

CALL
0x0fbd277fquote(_params: MessagingParams, _sender: address)

send() - Send Messages

SEND
0x1fd91580send(_params: MessagingParams, _refundAddress: address)

lzReceive() - Receive Messages

SEND
0xbb68813elzReceive(_origin: Origin, _receiver: address, _guid: bytes32, _message: bytes, _extraData: bytes)

sendCompose() - Send Compose Messages

SEND
0x7cb59012sendCompose(_to: address, _guid: bytes32, _index: uint16, _message: bytes)

lzCompose() - Execute Compose Messages

SEND
0x91d20fa1lzCompose(_from: address, _to: address, _guid: bytes32, _index: uint16, _message: bytes, _extraData: bytes)

Configuration Management

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

eid() - Get Endpoint ID

CALL
0x416ecebfeid()

isRegisteredLibrary() - Check Library Registration

CALL
0xdc706a62isRegisteredLibrary(lib: address)

receiveLibraryTimeout() - Get Library Timeout

CALL
0xef667aa1receiveLibraryTimeout(receiver: address, srcEid: uint32)

setDelegate() - Set Delegate Address

SEND
0xca5eb5e1setDelegate(_delegate: address)

setSendLibrary() - Configure Send Library

SEND
0x9535ff30setSendLibrary(_oapp: address, _eid: uint32, _newLib: address)

setReceiveLibrary() - Configure Receive Library

SEND
0x6a14d715setReceiveLibrary(_oapp: address, _eid: uint32, _newLib: address, _gracePeriod: uint256)

setConfig() - Set Configuration Parameters

SEND
0x01dd9320setConfig(_oapp: address, _lib: address, _params: SetConfigParam[])

Message Recovery & Security

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

clear() - Clear Stored Message

SEND
0x841515b1clear(_oapp: address, _origin: Origin, _guid: bytes32, _message: bytes)

burn() - Permanently Block Message

SEND
0x40f80683burn(_oapp: address, _srcEid: uint32, _sender: bytes32, _nonce: uint64, _payloadHash: bytes32)

skip() - Skip Message Nonce

SEND
0xd70b8902skip(_oapp: address, _srcEid: uint32, _sender: bytes32, _nonce: uint64)

nilify() - Mark Message as Nil

SEND
0x2e80fbf3nilify(_oapp: address, _srcEid: uint32, _sender: bytes32, _nonce: uint64, _payloadHash: bytes32)

Status Checks

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

getConfig() - Check Configuration

CALL
0x2b3197b9getConfig(_oapp: address, _lib: address, _eid: uint32, _configType: uint32)

delegates() - Check Delegate Address

CALL
0x587cde1edelegates(oapp: address)

getSendLibrary() - Get Send Library

CALL
0xb96a277fgetSendLibrary(_sender: address, _dstEid: uint32)

getReceiveLibrary() - Get Receive Library

CALL
0x402f8468getReceiveLibrary(_receiver: address, _srcEid: uint32)

inboundNonce() - Get Processed Nonce

CALL
0xa0dd43fcinboundNonce(_receiver: address, _srcEid: uint32, _sender: bytes32)

lazyInboundNonce() - Get Lazy Nonce

CALL
0x5b17bb70lazyInboundNonce(receiver: address, srcEid: uint32, sender: bytes32)

initializable() - Check Message Initialization

CALL
0x8a237427initializable(_origin: Origin, _receiver: address)

verifiable() - Check Message Verification

CALL
0xbe619818verifiable(_origin: Origin, _receiver: address)

inboundPayloadHash() - Get Message Payload Hash

CALL
0xc9fc7bcdinboundPayloadHash(receiver: address, srcEid: uint32, sender: bytes32, inboundNonce: uint64)

nextGuid() - Get Next Message GUID

CALL
0xaafe5e07nextGuid(_sender: address, _dstEid: uint32, _receiver: bytes32)

composeQueue() - Check Compose Message Queue

CALL
0x35d330b0composeQueue(from: address, to: address, guid: bytes32, index: uint16)

isSendingMessage() - Check Send State

CALL
0x79624ca9isSendingMessage()

getSendContext() - Get Current Send Context

CALL
0x14f651a9getSendContext()

Events

Key events emitted by the EndpointV2 contract.

PacketSent - Message Sent Event

EVENT
PacketSent(bytes encodedPayload, bytes options, address sendLibrary)

PacketVerified - Message Verified Event

EVENT
PacketVerified(tuple origin, address receiver, bytes32 payloadHash)

PacketDelivered - Message Delivered Event

EVENT
PacketDelivered(tuple origin, address receiver)

ComposeSent - Compose Message Queued Event

EVENT
ComposeSent(address from, address to, bytes32 guid, uint16 index, bytes message)

ComposeDelivered - Compose Message Delivered Event

EVENT
ComposeDelivered(address from, address to, bytes32 guid, uint16 index)

DelegateSet - Delegate Configuration Event

EVENT
DelegateSet(address sender, address delegate)

SendLibrarySet - Send Library Configuration Event

EVENT
SendLibrarySet(address sender, uint32 eid, address newLib)

ReceiveLibrarySet - Receive Library Configuration Event

EVENT
ReceiveLibrarySet(address receiver, uint32 eid, address newLib)

ReceiveLibraryTimeoutSet - Library Timeout Configuration Event

EVENT
ReceiveLibraryTimeoutSet(address receiver, uint32 eid, address oldLib, uint256 timeout)

InboundNonceSkipped - Nonce Skip Event

EVENT
InboundNonceSkipped(uint32 srcEid, bytes32 sender, address receiver, uint64 nonce)

PacketNilified - Message Nilified Event

EVENT
PacketNilified(uint32 srcEid, bytes32 sender, address receiver, uint64 nonce, bytes32 payloadHash)

PacketBurnt - Message Burnt Event

EVENT
PacketBurnt(uint32 srcEid, bytes32 sender, address receiver, uint64 nonce, bytes32 payloadHash)

Errors

LZ_InsufficientFee - Insufficient Fee

ERROR
0x4f3ec0d3
LZ_InsufficientFee(uint256 requiredNative, uint256 suppliedNative, uint256 requiredLzToken, uint256 suppliedLzToken)

LZ_InvalidNonce - Invalid Nonce

ERROR
0xc09b6350
LZ_InvalidNonce(uint64 nonce)

LZ_Unauthorized - Unauthorized Access

ERROR
0xc4c52593
LZ_Unauthorized()

LZ_SendReentrancy - Send Reentrancy Detected

ERROR
0xee120b09
LZ_SendReentrancy()

Key Functions to Try:

  • Messaging Operations:
    • quote() - Get fee estimates for cross-chain 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 cross-chain 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

ERROR
0xba97c1fa
LZ_ULN_InvalidConfigType(uint32 configType)

LZ_ULN_InvalidRequiredDVNCount - Invalid DVN Count

ERROR
0x83aa17da
LZ_ULN_InvalidRequiredDVNCount()

LZ_ULN_InvalidOptionalDVNCount - Invalid Optional DVN Count

ERROR
0x42211366
LZ_ULN_InvalidOptionalDVNCount()

LZ_ULN_InvalidOptionalDVNThreshold - Invalid DVN Threshold

ERROR
0x38682fa9
LZ_ULN_InvalidOptionalDVNThreshold()

LZ_ULN_AtLeastOneDVN - At Least One DVN Required

ERROR
0xce2c3751
LZ_ULN_AtLeastOneDVN()

LZ_ULN_InvalidConfirmations - Invalid Confirmations

ERROR
0x503667ae
LZ_ULN_InvalidConfirmations()

LZ_ULN_Unsorted - DVNs Not Sorted

ERROR
0x447516e1
LZ_ULN_Unsorted()

Worker & Option Errors

LZ_ULN_InvalidWorkerId - Invalid Worker ID

ERROR
0x6780cfaf
LZ_ULN_InvalidWorkerId(uint8 workerId)

LZ_ULN_InvalidWorkerOptions - Invalid Worker Options

ERROR
0x6592671c
LZ_ULN_InvalidWorkerOptions(uint256 cursor)

LZ_ULN_UnsupportedOptionType - Unsupported Option Type

ERROR
0x41705130
LZ_ULN_UnsupportedOptionType(uint16 optionType)

LZ_ULN_InvalidLegacyType1Option - Invalid Legacy Type 1 Option

ERROR
0x0dc652a8
LZ_ULN_InvalidLegacyType1Option()

LZ_ULN_InvalidLegacyType2Option - Invalid Legacy Type 2 Option

ERROR
0xc0927c56
LZ_ULN_InvalidLegacyType2Option()

LZ_ULN_UnsupportedEid - Unsupported Endpoint ID

ERROR
0xf0c10d04
LZ_ULN_UnsupportedEid(uint32 eid)

Fee & Payment Errors

LZ_MessageLib_InvalidAmount - Invalid Fee Amount

ERROR
0x34084fb8
LZ_MessageLib_InvalidAmount(uint256 requested, uint256 available)

LZ_MessageLib_TransferFailed - Fee Transfer Failed

ERROR
0xde5999a0
LZ_MessageLib_TransferFailed()

Library Access Errors

LZ_MessageLib_OnlyEndpoint - Only Endpoint Allowed

ERROR
0x467409c3
LZ_MessageLib_OnlyEndpoint()

LZ_MessageLib_InvalidExecutor - Invalid Executor

ERROR
0x20e9d05a
LZ_MessageLib_InvalidExecutor()

LZ_MessageLib_NotTreasury - Not Treasury

ERROR
0x885762a7
LZ_MessageLib_NotTreasury()

LZ_MessageLib_CannotWithdrawAltToken - Cannot Withdraw Alt Token

ERROR
0xe695d044
LZ_MessageLib_CannotWithdrawAltToken()

Message Validation Errors

LZ_MessageLib_InvalidMessageSize - Message Too Large

ERROR
0xc667af3e
LZ_MessageLib_InvalidMessageSize(uint256 actual, uint256 max)

LZ_MessageLib_ZeroMessageSize - Zero Message Size

ERROR
0x49cfac43
LZ_MessageLib_ZeroMessageSize()

DVN_InvalidDVNOptions - Invalid DVN Options

ERROR
0x04eb6e0c
DVN_InvalidDVNOptions(uint256 cursor)

DVN_InvalidDVNIdx - Invalid DVN Index

ERROR
0xd3d3d9bc
DVN_InvalidDVNIdx()

Transfer Errors

Transfer_NativeFailed - Native Transfer Failed

ERROR
0x465bc834
Transfer_NativeFailed(address _to, uint256 _value)

Transfer_ToAddressIsZero - Transfer to Zero Address

ERROR
0x6b7a9310
Transfer_ToAddressIsZero()

Events

DVNFeePaid - DVN Fee Payment

EVENT
DVNFeePaid(address[] requiredDVNs, address[] optionalDVNs, uint256[] fees)

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

ERROR
0xc9bf37b7
LZ_ULN_InvalidPacketHeader()

LZ_ULN_InvalidPacketVersion - Wrong Packet Version

ERROR
0x3a9ae7b9
LZ_ULN_InvalidPacketVersion()

LZ_ULN_InvalidEid - Invalid Endpoint ID

ERROR
0x42d2c97e
LZ_ULN_InvalidEid()

Configuration Errors

LZ_ULN_InvalidConfigType - Invalid Configuration Type

ERROR
0xba97c1fa
LZ_ULN_InvalidConfigType(uint32 configType)

LZ_ULN_InvalidRequiredDVNCount - Invalid DVN Count

ERROR
0x83aa17da
LZ_ULN_InvalidRequiredDVNCount()

LZ_ULN_InvalidOptionalDVNCount - Invalid Optional DVN Count

ERROR
0x42211366
LZ_ULN_InvalidOptionalDVNCount()

LZ_ULN_InvalidOptionalDVNThreshold - Invalid DVN Threshold

ERROR
0x38682fa9
LZ_ULN_InvalidOptionalDVNThreshold()

LZ_ULN_AtLeastOneDVN - At Least One DVN Required

ERROR
0xce2c3751
LZ_ULN_AtLeastOneDVN()

LZ_ULN_InvalidConfirmations - Invalid Confirmations

ERROR
0x503667ae
LZ_ULN_InvalidConfirmations()

LZ_ULN_Unsorted - DVNs Not Sorted

ERROR
0x447516e1
LZ_ULN_Unsorted()

LZ_ULN_UnsupportedEid - Unsupported Endpoint ID

ERROR
0xf0c10d04
LZ_ULN_UnsupportedEid(uint32 eid)

LZ_ULN_Verifying - Already Verifying

ERROR
0x4c3118d4
LZ_ULN_Verifying()

LZ_MessageLib_OnlyEndpoint - Only Endpoint Allowed

ERROR
0x467409c3
LZ_MessageLib_OnlyEndpoint()

ReadLib1002 - Cross-Chain Read Library

The ReadLib1002 library enables cross-chain 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

ERROR
0x0cb84e82
LZ_RL_InvalidConfigType(uint32 configType)

LZ_RL_InvalidRequiredDVNCount - Invalid DVN Count

ERROR
0x55a01c02
LZ_RL_InvalidRequiredDVNCount()

LZ_RL_InvalidOptionalDVNCount - Invalid Optional DVN Count

ERROR
0xe35436c6
LZ_RL_InvalidOptionalDVNCount()

LZ_RL_InvalidOptionalDVNThreshold - Invalid DVN Threshold

ERROR
0xf92940be
LZ_RL_InvalidOptionalDVNThreshold()

Validation Errors

LZ_RL_InvalidPacketHeader - Invalid Packet Header

ERROR
0x864d08b3
LZ_RL_InvalidPacketHeader()

LZ_RL_InvalidPacketVersion - Wrong Packet Version

ERROR
0x7952a82f
LZ_RL_InvalidPacketVersion()

LZ_RL_InvalidCmdHash - Invalid Command Hash

ERROR
0x660e96ee
LZ_RL_InvalidCmdHash()

LZ_RL_InvalidReceiver - Invalid Receiver

ERROR
0xa4884a59
LZ_RL_InvalidReceiver()

LZ_RL_InvalidAmount - Invalid Fee Amount

ERROR
0xb79d1263
LZ_RL_InvalidAmount(uint256 requested, uint256 available)

LZ_RL_Verifying - Already Verifying

ERROR
0x28ca4b51
LZ_RL_Verifying()

LZ_RL_InvalidEid - Invalid Endpoint ID

ERROR
0x3e96df16
LZ_RL_InvalidEid()

LZ_RL_AtLeastOneDVN - At Least One DVN Required

ERROR
0x9b5f9f7a
LZ_RL_AtLeastOneDVN()

LZ_RL_Unsorted - DVNs Not Sorted

ERROR
0xc0762a5d
LZ_RL_Unsorted()

LZ_RL_UnsupportedEid - Unsupported Endpoint ID

ERROR
0x0ff03e54
LZ_RL_UnsupportedEid(uint32 eid)

Library Access Errors

LZ_MessageLib_OnlyEndpoint - Only Endpoint Allowed

ERROR
0x467409c3
LZ_MessageLib_OnlyEndpoint()

LZ_RL_InvalidExecutor - Invalid Executor

ERROR
0x76df55a6
LZ_RL_InvalidExecutor()

LZ_RL_NotTreasury - Not Treasury

ERROR
0x96830d1e
LZ_RL_NotTreasury()

LZ_RL_CannotWithdrawAltToken - Cannot Withdraw Alt Token

ERROR
0xb77f5044
LZ_RL_CannotWithdrawAltToken()

Worker & Option Errors

LZ_ULN_InvalidWorkerId - Invalid Worker ID

ERROR
0x6780cfaf
LZ_ULN_InvalidWorkerId(uint8 workerId)

LZ_ULN_InvalidWorkerOptions - Invalid Worker Options

ERROR
0x6592671c
LZ_ULN_InvalidWorkerOptions(uint256 cursor)

LZ_ULN_UnsupportedOptionType - Unsupported Option Type

ERROR
0x41705130
LZ_ULN_UnsupportedOptionType(uint16 optionType)

LZ_ULN_InvalidLegacyType1Option - Invalid Legacy Type 1 Option

ERROR
0x0dc652a8
LZ_ULN_InvalidLegacyType1Option()

LZ_ULN_InvalidLegacyType2Option - Invalid Legacy Type 2 Option

ERROR
0xc0927c56
LZ_ULN_InvalidLegacyType2Option()

DVN Errors

DVN_InvalidDVNOptions - Invalid DVN Options

ERROR
0x04eb6e0c
DVN_InvalidDVNOptions(uint256 cursor)

DVN_InvalidDVNIdx - Invalid DVN Index

ERROR
0xd3d3d9bc
DVN_InvalidDVNIdx()

Transfer Errors

Transfer_NativeFailed - Native Transfer Failed

ERROR
0x465bc834
Transfer_NativeFailed(address _to, uint256 _value)

Transfer_ToAddressIsZero - Transfer to Zero Address

ERROR
0x6b7a9310
Transfer_ToAddressIsZero()

Troubleshooting Common Library Errors

  • 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.

Omnichain Application (OApp)

The foundation for building any cross-chain application. OApp provides the core messaging infrastructure for a smart contract interacting with the EndpointV2.

Core Information

oAppVersion() - Get OApp Version

CALL
0x17442b70oAppVersion()

endpoint() - Get Endpoint Address

CALL
0x5e280f11endpoint()

Peer Configuration

peers() - Get Remote Peer Address

CALL
0xbb0b6a53peers(eid: uint32)

setPeer() - Connect Remote Chains

SEND
0x3400288bsetPeer(_eid: uint32, _peer: bytes32)

setDelegate() - Set Configuration Delegate

SEND
0xca5eb5e1setDelegate(_delegate: address)

Message Reception

allowInitializePath() - Check Path Initialization

CALL
0xbfe94e81allowInitializePath(origin: Origin)

nextNonce() - Get Next Message Nonce

CALL
0x7d25a05enextNonce(: uint32, : bytes32)

lzReceive() - Receive Cross-Chain Messages

SEND
0xbf282d99lzReceive(_origin: Origin, _guid: bytes32, _message: bytes, _executor: address, _extraData: bytes)

Composability

isComposeMsgSender() - Verify Compose Sender

CALL
0x8833c245isComposeMsgSender(: Origin, : bytes, _sender: address)

Events and Errors

Key events and errors emitted by the OApp contract.

Events

PeerSet - Peer Configuration Updated

EVENT
PeerSet(uint32 eid, bytes32 peer)

Errors

OnlyPeer - Unauthorized Peer Message

ERROR
0xc26bebcc
OnlyPeer(uint32 eid, bytes32 sender)

NoPeer - Missing Peer Configuration

ERROR
0xf6ff4fb7
NoPeer(uint32 eid)

InvalidEndpointCall - Invalid Endpoint Call

ERROR
0x0fbdec0a
InvalidEndpointCall()

InvalidDelegate - Invalid Delegate Configuration

ERROR
0xb5863604
InvalidDelegate()

NotEnoughNative - Insufficient Native Fee

ERROR
0x9f704120
NotEnoughNative(uint256 msgValue)

OnlyEndpoint - Unauthorized Endpoint Call

ERROR
0x91ac5e4f
OnlyEndpoint(address addr)

LzTokenUnavailable - LayerZero Token Not Available

ERROR
0x5373352a
LzTokenUnavailable()

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 cross-chain 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 cross-chain data reading capabilities. It includes all standard methods plus the read channel configuration.

setReadChannel() - Configure Read Channel

SEND
0xf0a9e481setReadChannel(_channelId: uint32, _active: bool)

Key Functions to Try:

  • setReadChannel() - Configure read channel for cross-chain data reading
  • Plus all standard OApp functions listed above

Omnichain Fungible Token (OFT)

OFT inherits from OApp, providing all cross-chain 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

CALL
0x2f603a24quoteSend(_sendParam: SendParam, _payInLzToken: bool)

quoteOFT() - Get Detailed Transfer Quote

CALL
0xe6343d44quoteOFT(_sendParam: SendParam)

send() - Transfer Tokens

SEND
0xccfc9451send(_sendParam: SendParam, _fee: MessagingFee, _refundAddress: address)

Token Details

sharedDecimals() - Get Shared Decimals

CALL
0x857749b0sharedDecimals()

approvalRequired() - Check Approval Requirement

CALL
0x9f68b964approvalRequired()

oftVersion() - Get OFT Version

CALL
0x156a0d0foftVersion()

token() - Get Underlying Token Address

CALL
0xfc0c546atoken()

decimalConversionRate() - Get Decimal Conversion Factor

CALL
0x963efcaadecimalConversionRate()

Management Functions

owner() - Get Current Owner

CALL
0x8da5cb5bowner()

transferOwnership() - Transfer Contract Ownership

SEND
0xf2fde38btransferOwnership(newOwner: address)

renounceOwnership() - Renounce Ownership

SEND
0x715018a6renounceOwnership()

setPeer() - Connect to Remote OFTs

SEND
0x3400288bsetPeer(_eid: uint32, _peer: bytes32)

setEnforcedOptions() - Configure Message Options

SEND
0xd833f371setEnforcedOptions(_enforcedOptions: EnforcedOptionParam[])

setMsgInspector() - Set Message Inspector

SEND
0x6fc1b31esetMsgInspector(_msgInspector: address)

Events

Key events emitted by the OFT contract.

OFTSent - Token Transfer Sent

EVENT
OFTSent(indexed bytes32 guid, uint32 dstEid, indexed address fromAddress, uint256 amountSentLD, uint256 amountReceivedLD)

OFTReceived - Token Transfer Received

EVENT
OFTReceived(indexed bytes32 guid, uint32 srcEid, indexed address toAddress, uint256 amountReceivedLD)

Transfer - Standard ERC20 Transfer

EVENT
Transfer(indexed address from, indexed address to, uint256 value)

Errors

InvalidLocalDecimals - Invalid Decimal Configuration

ERROR
0x1e9714b0
InvalidLocalDecimals()

SlippageExceeded - Transfer Slippage Too High

ERROR
0x71c4efed
SlippageExceeded(uint256 amountLD, uint256 minAmountLD)

AmountSDOverflowed - Shared Decimal Overflow

ERROR
0xe2ce9413
AmountSDOverflowed(uint256 amountSD)

Key Functions to Try:

  • Transfer Operations:
    • quoteSend() - Get transfer fee estimates
    • send() - Transfer tokens cross-chain
    • 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:

Decentralized Verifier Network (DVN)

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

getFee() - Get DVN Verification Fee

CALL
getFee(_dstEid: uint32, _confirmations: uint64, _sender: address, _options: bytes)

dstConfig() - Get DVN Configuration

CALL
dstConfig(_dstEid: uint32)

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

CALL
0x709eb664getFee(_dstEid: uint32, _sender: address, _calldataSize: uint256, _options: bytes)

dstConfig() - Get Destination Configuration

CALL
0x9e944965dstConfig(_dstEid: uint32)
info

Contract ABIs shown here are from the latest deployment. Always verify addresses and ABIs for your specific use case.