Closed c4-bot-1 closed 7 months ago
https://github.com/code-423n4/2024-04-gondi/blob/b9863d73c08fcdd2337dc80a8b5e0917e18b036c/src/lib/pools/Pool.sol#L53
when loanRepayment() / loanLiquidation()
loanRepayment()
loanLiquidation()
Fees accumulated to getCollectedFees
getCollectedFees
function loanRepayment( uint256 _loanId, uint256 _principalAmount, uint256 _apr, uint256, uint256 _protocolFee, uint256 _startTime ) external override onlyAcceptedCallers { uint256 netApr = _netApr(_apr, _protocolFee); uint256 interestEarned = _principalAmount.getInterest(netApr, block.timestamp - _startTime); uint256 received = _principalAmount + interestEarned; uint256 fees = IFeeManager(getFeeManager).processFees(_principalAmount, interestEarned); @> getCollectedFees += fees; _loanTermination(msg.sender, _loanId, _principalAmount, netApr, interestEarned, received - fees); } /// @inheritdoc LoanManager function loanLiquidation( uint256 _loanId, uint256 _principalAmount, uint256 _apr, uint256, uint256 _protocolFee, uint256 _received, uint256 _startTime ) external override onlyAcceptedCallers { uint256 netApr = _netApr(_apr, _protocolFee); uint256 interestEarned = _principalAmount.getInterest(netApr, block.timestamp - _startTime); uint256 fees = IFeeManager(getFeeManager).processFees(_received, 0); @> getCollectedFees += fees; _loanTermination(msg.sender, _loanId, _principalAmount, netApr, interestEarned, _received - fees); }
But currently Pool.sol does not provide a method to claim and reduce getCollectedFees
Pool.sol
Pool.getCollectedFees can't be claimed.
Pool.getCollectedFees
Add a method so that administrators can claim getCollectedFees.
Context
0xA5DF marked the issue as duplicate of #60
0xA5DF marked the issue as satisfactory
Lines of code
https://github.com/code-423n4/2024-04-gondi/blob/b9863d73c08fcdd2337dc80a8b5e0917e18b036c/src/lib/pools/Pool.sol#L53
Vulnerability details
Vulnerability details
when
loanRepayment()
/loanLiquidation()
Fees accumulated to
getCollectedFees
But currently
Pool.sol
does not provide a method to claim and reducegetCollectedFees
Impact
Pool.getCollectedFees
can't be claimed.Recommended Mitigation
Add a method so that administrators can claim
getCollectedFees
.Assessed type
Context