Foundry-Fe: https://github.com/cairoeth/foundry-fe
Fe-Project-Template: https://github.com/cairoeth/fe-project-template
Foundry-Fe is a plug-and-play Foundry library for compiling, debugging, and working with Fe contracts in Solidity. By integrating with Foundry, Foundry-Fe brings a suite of sophisticated testing features to Fe developers, addressing a critical need in the ecosystem for robust, comprehensive testing and debugging capabilities. Additionally, we implemented a Fe project template in Foundry, allowing developers to start writing Fe immediately.
With this library, Fe developers can leverage Foundry's testing framework with:
- Fuzz Testing: A crucial method for uncovering bugs and vulnerabilities in smart contracts by passing large volumes of random data to contracts. It is particularly effective for testing property-based aspects of Fe contracts, ensuring they adhere to specified general properties under various conditions. Fuzz testing significantly enhances the security and reliability of Fe contracts, a type of testing previously unavailable for Fe developers.
- Invariant Testing: Systematic evaluation of contract logic. By defining a set of invariants—conditions that should always hold—and testing them against randomized sequences of function calls, developers can identify logical flaws in complex protocol states. This is invaluable for Fe developers, as it helps to pinpoint false assumptions and incorrect logic that might not be evident in standard testing scenarios. Developers can leverage invariants from other Foundry projects to cross-check common implementation logic and standards.
- Differential Fuzzing: Perhaps the most advanced feature Foundry offers, differential fuzzing involves running inputs through different contract implementations and comparing the outcomes. This process helps identify discrepancies and potential vulnerabilities that could go unnoticed in conventional testing. For the Fe ecosystem, differential fuzzing is critical for ensuring that Fe contracts perform as expected, even when compared to their counterparts in more established languages like Solidity or Vyper.
In addition to the comprehensive testing capabilities provided by this library through Foundry, developers can also use features from Forge. For instance, Forge's interactive debugger makes it extremely easy to find bugs using opcodes in the session, program counter, gas, stack, source view, and memory pointers.
By addressing Fe's previous limitations in testing and debugging, we aimed to help developers ship Fe-based projects faster and create more innovative and complex applications. Lastly, we hope the Foundry-Fe project template makes Fe more accessible to the wider EVM community.