record
Signature
Section titled “Signature”function record() external;Description
Section titled “Description”Tell the VM to start recording all storage reads and writes. To access the reads and writes, use accesses.
Examples
Section titled “Examples”/// contract NumsContract {/// uint256 public num1 = 100; // slot 0/// uint256 public num2 = 200; // slot 1/// }
vm.record();numsContract.num2();(bytes32[] memory reads, bytes32[] memory writes) = vm.accesses( address(numsContract));emit log_uint(uint256(reads[0])); // 1SEE ALSO
Section titled “SEE ALSO”Forge Standard Library