Open RyanRHall opened 2 months ago
I found another false positive also when using multiple addresses, since you can't pack 2 addresses into the same slot
struct ExampleStruct {
address addr1; // 1 slot
address addr2; // 1 slot
address addr3; // 1 slot
}
./ExampleContract.sol
39:3 warning GC: For [ ExampleStruct ] struct, packing seems inefficient. Try rearranging to achieve 32bytes slots gas-struct-packing
I think there is a false positive with the
gas-struct-packing
rule when using contract types. Here is the MRE:MyStruct1
andMyStruct2
are both "tightly packed", but for some reason the linter doesn't like the first struct. I tested this against solhint v5.0.3