LayerZero v2: message _options Explained

Nazreen Mohamad
1 min readApr 26, 2024

If you are intending to integrated LayerZero v2 into your smart contract, you’ll need to understand the various message execution option types available. This post assumes you are already familiar with LayerZero v2 at a high level.

How LayerZero v2 works

The message options determine how your message will be processed.

There are 4 option types:

  1. lzReceive
  2. lzCompose
  3. lzNativeDrop
  4. OrderedExecution

The options are not mutually exclusive and can be chained together.

Which option you will need depends on your answer to these questions:

  • On the destination chain, will you need gas token to be sent ?
  • On the destination chain, will the Omnichain application need to call another contract ?
  • Do you need messages to be executed in a strict order ?

If your answer to all the above questions is ‘No’, then the only option type you need is the vanilla lzReceive. This option allows you to specify the gas parameters for when the Executor calls the lzReceive function on the destination chain.

If you need some native gas token to sent, then you’ll need the lzNativeDrop option.

If you need messages to be processed in sequence, then what you need is OrderedExecution .

For the full documentation, go to https://docs.layerzero.network/v2/developers/evm/gas-settings/options

--

--

Nazreen Mohamad
Nazreen Mohamad

Written by Nazreen Mohamad

Technical Instructor and Software Engineer.

No responses yet