Description
In claim(), the balance check inside the claim loop contains a redundant first clause:
uint256 _balance = _token.balanceOf(address(this));
if (_balance == 0 || _balance < _claimRequests[_i].minAmountRequested) {
revert FeeFlow_InsufficientBalance();
}
The _balance == 0 condition is subsumed by _balance < _claimRequests[_i].minAmountRequested for any minAmountRequested >= 1. The only case where it is load-bearing is when minAmountRequested == 0, where it prevents a zero-amount safeTransfer(). That transfer is harmless (most ERC-20 implementations allow it), so the zero check serves no protective purpose and only adds gas cost and cognitive overhead.
Recommendation
Remove the redundant clause:
- if (_balance == 0 || _balance < _claimRequests[_i].minAmountRequested) {
+ if (_balance < _claimRequests[_i].minAmountRequested) {
revert FeeFlow_InsufficientBalance();
}
Description
In
claim(), the balance check inside the claim loop contains a redundant first clause:The
_balance == 0condition is subsumed by_balance < _claimRequests[_i].minAmountRequestedfor anyminAmountRequested >= 1. The only case where it is load-bearing is whenminAmountRequested == 0, where it prevents a zero-amountsafeTransfer(). That transfer is harmless (most ERC-20 implementations allow it), so the zero check serves no protective purpose and only adds gas cost and cognitive overhead.Recommendation
Remove the redundant clause: