Interactive Contract Playground
Test LayerZero contracts directly from your browser. No coding required. Explore contract functions, simulate transactions, and understand how LayerZero works through hands-on interaction.
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
0x0fbd277fquote(_params: MessagingParams, _sender: address)
send() - Send Messages
0x1fd91580send(_params: MessagingParams, _refundAddress: address)
lzReceive() - Receive Messages
0xbb68813elzReceive(_origin: Origin, _receiver: address, _guid: bytes32, _message: bytes, _extraData: bytes)
sendCompose() - Send Compose Messages
0x7cb59012sendCompose(_to: address, _guid: bytes32, _index: uint16, _message: bytes)
lzCompose() - Execute Compose Messages
0x91d20fa1lzCompose(_from: address, _to: address, _guid: bytes32, _index: uint16, _message: bytes, _extraData: bytes)
Configuration Management
Functions for setting custom verification, execution, and pathway management.
isRegisteredLibrary() - Check Library Registration
0xdc706a62isRegisteredLibrary(lib: address)
receiveLibraryTimeout() - Get Library Timeout
0xef667aa1receiveLibraryTimeout(receiver: address, srcEid: uint32)
setDelegate() - Set Delegate Address
0xca5eb5e1setDelegate(_delegate: address)
setSendLibrary() - Configure Send Library
0x9535ff30setSendLibrary(_oapp: address, _eid: uint32, _newLib: address)
setReceiveLibrary() - Configure Receive Library
0x6a14d715setReceiveLibrary(_oapp: address, _eid: uint32, _newLib: address, _gracePeriod: uint256)
setConfig() - Set Configuration Parameters
0x01dd9320setConfig(_oapp: address, _lib: address, _params: SetConfigParam[])
Message Recovery & Security
Functions for handling message exceptions, security threats, and recovery scenarios.
burn() - Permanently Block Message
0x40f80683burn(_oapp: address, _srcEid: uint32, _sender: bytes32, _nonce: uint64, _payloadHash: bytes32)
skip() - Skip Message Nonce
0xd70b8902skip(_oapp: address, _srcEid: uint32, _sender: bytes32, _nonce: uint64)
nilify() - Mark Message as Nil
0x2e80fbf3nilify(_oapp: address, _srcEid: uint32, _sender: bytes32, _nonce: uint64, _payloadHash: bytes32)
clear() - Clear Stored Message
0x841515b1clear(_oapp: address, _origin: Origin, _guid: bytes32, _message: bytes)
Status Checks
Functions for querying current configuration settings, library assignments, nonce tracking, and message states.
getConfig() - Check Configuration
0x2b3197b9getConfig(_oapp: address, _lib: address, _eid: uint32, _configType: uint32)
delegates() - Check Delegate Address
0x587cde1edelegates(oapp: address)
getSendLibrary() - Get Send Library
0xb96a277fgetSendLibrary(_sender: address, _dstEid: uint32)
getReceiveLibrary() - Get Receive Library
0x402f8468getReceiveLibrary(_receiver: address, _srcEid: uint32)
inboundNonce() - Get Processed Nonce
0xa0dd43fcinboundNonce(_receiver: address, _srcEid: uint32, _sender: bytes32)
lazyInboundNonce() - Get Lazy Nonce
0x5b17bb70lazyInboundNonce(receiver: address, srcEid: uint32, sender: bytes32)
initializable() - Check Message Initialization
0x8a237427initializable(_origin: Origin, _receiver: address)
verifiable() - Check Message Verification
0xbe619818verifiable(_origin: Origin, _receiver: address)
inboundPayloadHash() - Get Message Payload Hash
0xc9fc7bcdinboundPayloadHash(receiver: address, srcEid: uint32, sender: bytes32, inboundNonce: uint64)
nextGuid() - Get Next Message GUID
0xaafe5e07nextGuid(_sender: address, _dstEid: uint32, _receiver: bytes32)
composeQueue() - Check Compose Message Queue
0x35d330b0composeQueue(from: address, to: address, guid: bytes32, index: uint16)
isSendingMessage() - Check Send State
0x79624ca9isSendingMessage()
getSendContext() - Get Current Send Context
0x14f651a9getSendContext()
Key Functions to Try:
- Messaging Operations:
quote()
- Get fee estimates for cross-chain messagessend()
- Send messages to other chainslzReceive()
- Receive messages from other chainssendCompose()
- Queue compose messageslzCompose()
- Execute compose messages
- Configuration Management:
setDelegate()
- Assign configuration permissionssetSendLibrary()
- Choose send message librarysetReceiveLibrary()
- Choose receive message librarysetConfig()
- Set library-specific parameters
- Message Recovery & Security:
burn()
- Permanently block malicious messagesskip()
- Skip flagged message noncesnilify()
- Mark messages for re-verificationclear()
- Clear verified but unexecuted messages
- Status Checks:
getConfig()
- Check current configurationsdelegates()
- View current delegate addressgetSendLibrary()
- Check send library for endpointgetReceiveLibrary()
- Check receive library for endpointinboundNonce()
- Get highest processed message noncelazyInboundNonce()
- Get highest verified/skipped noncenextGuid()
- Get next message GUIDcomposeQueue()
- Check compose queueisSendingMessage()
- Check send stategetSendContext()
- Get send context
Omnichain Application (OApp)
The foundation for building any cross-chain application. OApp provides the core messaging infrastructure.
Core Information
oAppVersion() - Get OApp Version
0x17442b70oAppVersion()
endpoint() - Get Endpoint Address
0x5e280f11endpoint()
Peer Configuration
peers() - Get Remote Peer Address
0xbb0b6a53peers(eid: uint32)
setPeer() - Connect Remote Chains
0x3400288bsetPeer(_eid: uint32, _peer: bytes32)
setDelegate() - Set Configuration Delegate
0xca5eb5e1setDelegate(_delegate: address)
Message Reception
allowInitializePath() - Check Path Initialization
0xbfe94e81allowInitializePath(origin: Origin)
nextNonce() - Get Next Message Nonce
0x7d25a05enextNonce(: uint32, : bytes32)
lzReceive() - Receive Cross-Chain Messages
0xbf282d99lzReceive(_origin: Origin, _guid: bytes32, _message: bytes, _executor: address, _extraData: bytes)
Composability
isComposeMsgSender() - Verify Compose Sender
0x8833c245isComposeMsgSender(: Origin, : bytes, _sender: address)
Key Functions to Try:
- Core Information:
oAppVersion()
- Get OApp version informationendpoint()
- Get connected endpoint address
- Peer Configuration:
setPeer()
- Connect to remote chainspeers()
- Check connected chainssetDelegate()
- Set configuration delegate
- Message Reception:
lzReceive()
- Receive cross-chain messagesallowInitializePath()
- Check path initializationnextNonce()
- 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 OApp methods plus the read channel configuration.
setReadChannel() - Configure Read Channel
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
0x2f603a24quoteSend(_sendParam: SendParam, _payInLzToken: bool)
quoteOFT() - Get Detailed Transfer Quote
0xe6343d44quoteOFT(_sendParam: SendParam)
send() - Transfer Tokens
0xccfc9451send(_sendParam: SendParam, _fee: MessagingFee, _refundAddress: address)
Token Details
sharedDecimals() - Get Shared Decimals
0x857749b0sharedDecimals()
approvalRequired() - Check Approval Requirement
0x9f68b964approvalRequired()
oftVersion() - Get OFT Version
0x156a0d0foftVersion()
token() - Get Underlying Token Address
0xfc0c546atoken()
decimalConversionRate() - Get Decimal Conversion Factor
0x963efcaadecimalConversionRate()
Management Functions
owner() - Get Current Owner
0x8da5cb5bowner()
transferOwnership() - Transfer Contract Ownership
0xf2fde38btransferOwnership(newOwner: address)
renounceOwnership() - Renounce Ownership
0x715018a6renounceOwnership()
setPeer() - Connect to Remote OFTs
0x3400288bsetPeer(_eid: uint32, _peer: bytes32)
setEnforcedOptions() - Configure Message Options
0xd833f371setEnforcedOptions(_enforcedOptions: EnforcedOptionParam[])
setMsgInspector() - Set Message Inspector
0x6fc1b31esetMsgInspector(_msgInspector: address)
Key Functions to Try:
- Transfer Operations:
quoteSend()
- Get transfer fee estimatessend()
- Transfer tokens cross-chainquoteOFT()
- Get comprehensive transfer quotes
- Token Information:
sharedDecimals()
- Check decimal configurationapprovalRequired()
- Check if approval is neededoftVersion()
- Get OFT implementation versiontoken()
- Get underlying token addressdecimalConversionRate()
- Get decimal conversion factor
- Management Functions:
owner()
- Check current contract ownersetPeer()
- Connect to OFTs on other chainssetEnforcedOptions()
- Configure security parameterssetMsgInspector()
- Set message inspectortransferOwnership()
- Transfer contract ownershiprenounceOwnership()
- Permanently remove ownership
Tips:
- Always call
quoteSend()
beforesend()
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 ABIs shown here are from the latest deployment. Always verify addresses and ABIs for your specific use case.