Foundry
Foundry is a fast, Solidity-native toolkit for building, testing, and deploying contracts. Its defining choice is that you write your tests in Solidity itself rather than JavaScript, and they execute inside a built-in EVM written in Rust, so the edit-test loop is very quick. For many teams it has become the default development environment.
It is a set of command-line tools. forge compiles your project, runs the test suite, and performs property-based fuzzing and invariant testing. cast is a Swiss-army knife for the command line — encoding/decoding data, reading state, and sending transactions over RPC. anvil is a local development node (the equivalent of Ganache or the Hardhat network). chisel is a Solidity REPL for quick experiments. Tests reach the EVM's special powers through 'cheatcodes' on a reserved vm address: vm.prank spoofs msg.sender for the next call, vm.expectRevert asserts a call fails, vm.warp moves block.timestamp, vm.deal sets balances, and vm.roll changes the block number.
Two features make Foundry strong for security work. Its fuzzer automatically generates many random values for any test function that takes parameters, surfacing edge cases a fixed test would miss. Its invariant tester fires long random sequences of calls across your contracts and checks that stated properties (for example 'total supply equals the sum of balances') always hold. Because it runs on revm in Rust rather than a JavaScript engine, large suites typically run far faster than the older stacks.
function testIncrement() public {
vm.prank(alice); // next call comes from alice
counter.increment();
assertEq(counter.count(), 1);
}
function testFuzz_Add(uint96 x) public { /* forge fuzzes x */ }Solidity tests, native cheatcodes, built-in fuzzing.
Cheatcodes only exist inside Foundry's test EVM — vm.prank, vm.warp and friends are testing tools, not opcodes. They have no meaning on a real chain.