Part 2

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

Distribution Only Performed When `assetValue` Greater Than `minFeeDistributionValueUsd`

Summary

In FeeConversionKeeper::checkFeeDistributionNeeded won't perform distribution when assetValue is equal to minFeeDistributionValueUsd, only when greater. This is a problem as the minimum should be a valid value for a distribution to be triggered.

Impact

Wrong check for fee distribution trigger.

Tools Used

Manual Review

Recommendations

Change the function in the following way:

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.