LayerZero Integration Checklist
The checklist below is intended to help prepare a project that integrates LayerZero for an external audit or Mainnet deployment
- Use the latest version of
solidity-examplespackage. Do not copy contracts from LayerZero repositories directly to your project.
- If your project requires token bridging inherit your token from
ONFT. For new tokens use
ONFT, for bridging existing tokens use
- For bridging only between EVM chains use
OFTand for bridging between EVM and non EVM chains (e.g., Aptos) use
- Do not hardcode LayerZero chain Ids. Use admin restricted setters instead.
- Do not hardcode address zero (
zroPaymentAddresswhen estimating fees and sending messages. Pass it as a parameter instead.
- Do not hardcode
falsewhen estimating fees and sending messages. Pass it as a parameter instead.
- Do not hardcode zero bytes (
adapterParamers. Pass them as a parameter instead.
- Make sure to test the amount of gas required for the execution on the destination. Use custom adapter parameters and specify minimum destination gas for each cross-chain path when the default amount of gas (
200,000) is not enough. This requires whoever calls the send function to provide the adapter params with a destination
gas >= amountset in the
minDstGasLookupfor that chain. So that your users don't run into failed messages on the destination. It makes it a smoother end-to-end experience for all.
- Do not add
requiresstatements that repeat existing checks in the parent contracts. For example,
LzAppcontract checks that the message sender is LayerZero endpoint and the
scrAddressis a trusted remote, do not perform the same checks in
- If your contract derives from
LzApp, do not call
- For ONFTs that allow minting a range of tokens on each chain, make the variables that specify the range (e.g.