Open spengrah opened 1 month ago
Useful foundry tool for verifying that no state has been changed for a given contract
function testNoStorageChanges() public {
// Start recording storage accesses
vm.record();
// Perform the operation you're testing
contract.someFunction();
// Get the storage accesses
(bytes32[] memory reads, bytes32[] memory writes) = vm.accesses(address(contract));
// Assert that no storage writes occurred
assertEq(writes.length, 0, "Storage was modified unexpectedly");
}
Running list of HSG invariants:
Notes: