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-examples
package. Do not copy contracts from LayerZero repositories directly to your project. - If your project requires token bridging inherit your token from
OFT
orONFT
. For new tokens useOFT
orONFT
, for bridging existing tokens useProxyOFT
orProxyONFT
. - For bridging only between EVM chains use
OFT
and for bridging between EVM and non EVM chains (e.g., Aptos) useOFTV2
. - Do not hardcode LayerZero chain Ids. Use admin restricted setters instead.
- Do not hardcode address zero (
address(0)
) aszroPaymentAddress
when estimating fees and sending messages. Pass it as a parameter instead. - Do not hardcode
useZro
tofalse
when estimating fees and sending messages. Pass it as a parameter instead. - Do not hardcode zero bytes (
bytes(0)
) asadapterParamers
. 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 destinationgas >= amount
set in theminDstGasLookup
for 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
requires
statements that repeat existing checks in the parent contracts. For example,lzReceive
function inLzApp
contract checks that the message sender is LayerZero endpoint and thescrAddress
is a trusted remote, do not perform the same checks innonblockingLzReceive
. - If your contract derives from
LzApp
, do not calllzEndpoint.send
directly, use_lzSend
. - For ONFTs that allow minting a range of tokens on each chain, make the variables that specify the range (e.g.
startMintId
andendMintId)
immutable.
Last modified 7mo ago