Medium to low impact. The _claimInterest function hardcodes a 0% percent slippage and does not perform a final check after attempting to release funds from various sources. If the contracts balance is still insufficient after these fund releases, it could lead to a revert on the safeTransfer call, preventing users from claiming their interest.
Take a look at the _claimInterest() function:
In the above function, the contract tries to ensure it has enough balance to pay out the users interest in the following way:
The potential issue arises after this. There is no final check to ensure that the amount is less than or equal to the contracts balance before executing safeTransfer, do note that a slippage of 0% has been applied.
If both releases (from IProtocolShareReserve and IPrimeLiquidityProvider) do not provide sufficient tokens, the safeTransfer will revert, and the user will be unable to claim their interest.
Depending on the situation this might not only lead to user frustration but also cause trust issues with the platform and would lead to user funds to be stuck s
To address this issue, the following changes are suggested:
A diff for the recommended changes might look like:
This ensures that a user always gets whatever is available, if the third suggestion is going to be implemented then do not forget to store the differences in a variable
