Audit scope: whole-repo, commit 7aa85a4
Dimension 4 (code quality) · low
Location:test/src/lib/LibHexString.bytesToHex.t.sol:226, 269-270, 277-278, 288-289, 298-299, 308-309, 318-319, 327-328, 338-339, 349-350, 357-358, 374-375
Path note: PR #56 is open and unmerged as of filing. On main today this file is test/lib/LibHexString.bytesToHex.t.sol; it becomes test/src/lib/LibHexString.bytesToHex.t.sol after #56 merges.
Problem
Every revert test opens with the same two new statements, one of them inside a
2048-run fuzz (lines 226 and 374). The repo's own pattern already covers this:
LibFsTest and LibFsBuildFileForContractTest hold an iExternal immutable
built in the constructor, and the five tooling suites build their mock in
setUp. This file uses neither.
Proposed fix
One LibHexStringExternal internal immutable iExternal; assigned in the
constructor, plus function badVm(string memory toStringReturn) internal returns (Vm) { return Vm(address(new NonConformingVm(toStringReturn))); }. Each revert
test then reads vm.expectRevert(…); iExternal.bytesToHex(badVm("0xaa"), hex"aabb");.
Audit scope: whole-repo, commit 7aa85a4Dimension 4 (code quality) · low
Location:
test/src/lib/LibHexString.bytesToHex.t.sol:226, 269-270, 277-278, 288-289, 298-299, 308-309, 318-319, 327-328, 338-339, 349-350, 357-358, 374-375Problem
Every revert test opens with the same two
newstatements, one of them inside a2048-run fuzz (lines 226 and 374). The repo's own pattern already covers this:
LibFsTestandLibFsBuildFileForContractTesthold aniExternalimmutablebuilt in the constructor, and the five tooling suites build their mock in
setUp. This file uses neither.Proposed fix
One
LibHexStringExternal internal immutable iExternal;assigned in theconstructor, plus
function badVm(string memory toStringReturn) internal returns (Vm) { return Vm(address(new NonConformingVm(toStringReturn))); }. Each reverttest then reads
vm.expectRevert(…); iExternal.bytesToHex(badVm("0xaa"), hex"aabb");.