Skip to main content
The LayerZero sample project supports unit testing using both the hardhat and foundry forge development framework, with specific test helpers for each:
  • EndpointV2Mock.sol: a mock LayerZero V2 Endpoint contract, meant for local testing of LayerZero message passing.
  • TestHelper.sol: an extensive LayerZero V2 testing framework, designed for simulating LayerZero state changes and contract interactions.
To run your unit tests for both Hardhat and Foundry, run the test command using your package manager:

Example Hardhat Test

Example Foundry Test