The Standard

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

Add a check before transferring token for amount>0

Summary

In LiquidationPoolManager.distributeFees() transfer euros to protocol without checking the amount>0

Vulnerability Details

function distributeFees() public {
IERC20 eurosToken = IERC20(EUROs);
uint256 _feesForPool = eurosToken.balanceOf(address(this)) * poolFeePercentage / HUNDRED_PC;
if (_feesForPool > 0) {
eurosToken.approve(pool, _feesForPool);
LiquidationPool(pool).distributeFees(_feesForPool);//@audit due to precision loss complete fee isn't distributed
}
//@audit no check for transferring zero tokens
eurosToken.transfer(protocol, eurosToken.balanceOf(address(this)));
}

https://github.com/Cyfrin/2023-12-the-standard/blob/main/contracts/LiquidationPoolManager.sol#L40
it transfer tokens without checking the amount is greater than zero
Add a check that if(eurosToken.balanceOf(address(this))>0) then transfer the tokens

Tools Used

Manual

Recommendations

See Vulnerability Details

Updates

Lead Judging Commences

hrishibhat Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Lack of quality
Assigned finding tags:

informational/invalid

Support

FAQs

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