Part 2

Zaros
PerpetualsDEXFoundrySolidity
70,000 USDC
View results
Submission Details
Severity: low
Invalid

Incorrect Comparison

## Summary
Incorrect comparison of `assetValue` and `self.minFeeDistributionValueUsd` in
`FeeConversionKeeper::checkFeeDistributionNeeded`
## Vulnerability Details
`FeeConversionKeeper::checkFeeDistributionNeeded` is a function that checks if fee distribution is needed based on the asset
and the collected fee amount. However, fee distribution should be triggered when accumulated fees reached the minimum value
but this is not the case in `FeeConversionKeeper::checkFeeDistributionNeeded`.
```
@> distributionNeeded = assetValue > self.minFeeDistributionValueUsd;
```
The comparison in the line of code above requires `assetValue` to be greater than `self.minFeeDistributionValueUsd` for
distribution to take place.
## Impact
Fee distribution will not be triggered if `assetValue` is equal to `self.minFeeDistributionValueUsd` causing delay in
distribution of accumulated fees.
## Tools Used
Solidity
## Recommendations
Change `>` to `>=`
```diff
function checkFeeDistributionNeeded(
address asset,
uint256 collectedFee
)
public
view
returns (bool distributionNeeded)
{
// load keeper data from storage
FeeConversionKeeperStorage storage self = _getFeeConversionKeeperStorage();
/// get asset value in USD
uint256 assetValue = self.marketMakingEngine.getAssetValue(asset, collectedFee);
// if asset value GT min distribution value return true
- distributionNeeded = assetValue > self.minFeeDistributionValueUsd;
+ distributionNeeded = assetValue >= self.minFeeDistributionValueUsd;
}
```
Updates

Lead Judging Commences

inallhonesty Lead Judge 6 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.