The function declares a storage pointer LBTCStorage storage $ = _getLBTCStorage(); before the loop, but this pointer is never used within the loop or elsewhere in the function. The _mintWithFee function internally calls _getLBTCStorage() to access storage when needed.
// Current implementation
LBTCStorage storage $ = _getLBTCStorage(); // Unnecessary SLOAD operation
for (uint256 i; i < mintPayload.length; ++i) {
_mintWithFee(
mintPayload[i],
proof[i],
feePayload[i],
userSignature[i]
);
}
This creates an unused storage pointer that: Consumes unnecessary gas (approximately 2100 gas for SLOAD operation) Makes the code less clean by introducing an unused variable Could potentially mislead other developers into thinking the storage pointer is being used
Proof of Concept
This is a simple proof-of-concept (PoC) code, but I believe that this issue doesn’t require a PoC to be taken seriously; it can be identified through a visual inspection alone.