Skip to main content
Version: Endpoint V1

PingPong.sol

Demonstrate an onchain call to estimateFees() and a "recursive" call within lzReceive()

This example contract demonstrates:

  • estimateFees(): how to get the message fee on chain
  • call send() within lzReceive()
  • using a contract to pay the message fee (as opposed to the msg.sender)

https://github.com/LayerZero-Labs/solidity-examples/blob/main/contracts/examples/PingPong.sol

caution

Warning: This contract will continuously send calls between two chains until one of them runs out of gas!

tip

Use LayerZero Scan to track your omnichain message after calling incrementCounter!