TestHelper (Foundry)
Overview
The TestHelper contract is designed to facilitate the testing of Omnichain Applications (OApps) developed using LayerZero V2, specifically within the Foundry test framework.
This contract provides a suite of functions to simulate cross-chain transactions and validate the behavior of OApps locally in your Foundry unit tests. The full code to this contract can be found in Monorepo.
For developers new to Foundry or those looking to deepen their understanding of its capabilities in Solidity testing, the following resources can be helpful:
-
Getting Started with Foundry: To begin your journey with Foundry, the Foundry Book offers a detailed guide on installation, setup, and basic usage. It's an excellent starting point for understanding the fundamentals of Foundry and its role in smart contract development.
-
Solidity Testing with Foundry: For a deeper dive into testing Solidity contracts using Foundry, the Foundry GitHub provides comprehensive documentation, examples, and community contributions. This resource is invaluable for learning best practices and advanced techniques in contract testing.
Installation
To install the TestHelper package in Foundry, run the following command:
forge install LayerZero-Labs/devtools
And then add the following remapping to your remappings.txt file:
@layerzerolabs/test-devtools-evm-foundry/=lib/devtools/packages/test-devtools-evm-foundry