The Standard

The Standard
DeFiHardhat
20,000 USDC
View results
Submission Details
Severity: low
Invalid

Before updating PoolFeePercentage, rewards should be distributed

Summary

The liquidationPoolManager() should distributeFees () before updating the poolFeePercentage.

Vulnerability Details

The owner of the LiquidationPoolManager contract has the ability to change the poolFeePercentage.
https://github.com/Cyfrin/2023-12-the-standard/blob/91132936cb09ef9bf82f38ab1106346e2ad60f91/contracts/LiquidationPoolManager.sol#L84-L86

function setPoolFeePercentage(uint32 _poolFeePercentage) external onlyOwner {
poolFeePercentage = _poolFeePercentage;
}

The rewards distributed to stakers in the LiquidationPool exhibit a positive correlation with the poolFeePercentage parameter. A higher value for this parameter results in more substantial rewards being allocated to stakers, while a lower value corresponds to a reduction in the rewards distributed to stakers.
https://github.com/Cyfrin/2023-12-the-standard/blob/91132936cb09ef9bf82f38ab1106346e2ad60f91/contracts/LiquidationPoolManager.sol#L35

uint256 _feesForPool = eurosToken.balanceOf(address(this)) * poolFeePercentage / HUNDRED_PC;

This is why before updating this number rewards should be distributed at the current rate of poolFeePercentage. And rewards accrued after the update will be under the new poolFeePercentage`.

Impact

This vulnerability has a medium impact has the poolFeePercentage should only apply to the rewards accrued after its change.

Tools Used

Manual review

Recommendations

Before changing the poolFeePercentage distribute rewards.

function setPoolFeePercentage(uint32 _poolFeePercentage) external onlyOwner {
distributeFees();
poolFeePercentage = _poolFeePercentage;
}
Updates

Lead Judging Commences

hrishibhat Lead Judge almost 2 years ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

informational/invalid

auditism Submitter
almost 2 years ago
hrishibhat Lead Judge
almost 2 years ago
hrishibhat Lead Judge almost 2 years ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

informational/invalid

Support

FAQs

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

Give us feedback!