Browse all Foundry articles.
17 min read
Cheatcodes in Starknet Foundry A "cheatcode" in Foundry is a mechanism that allows contract tests to control environment variables such as caller address, the current timestamp, and so on. In this...
16 min read
Invariant Testing in Foundry Introduction In this article, we will discuss invariants and how to perform an invariant test on Solidity smart contracts using Foundry test suites. Invariant testing is...
6 min read
Solidity Mutation Testing Mutation testing is a method to check the quality of the test suite by intentionally introducing bugs into the code and ensuring the tests catch the bug. The kind of bugs...
1 min read
Foundry forge coverage Visual line coverage report with LCOV !forge coverage lcov report If you run "forge coverage" in a Foundry project, you'll get a table showing how much of your lines and...
1 min read
Verify Signature Solidity in Foundry Here is a minimal (copy and paste) example of how to safely create and verify ECDSA signatures with OpenZeppelin in the Foundry environment. Contract:...
3 min read
Solidity test internal function To test an internal Solidity function, create a child contract that inherits from the contract being tested, wrap the parent contract’s internal function with an...
11 min read
Foundry Unit Tests This article will describe how to create unit tests in Solidity using Foundry. We will cover how to test all the state transitions that can occur in a smart contract, plus some...