Bubbly Inky Sawfish - The totalPrincipalTokensRepaid
and totalInterestCollected
may not be updated even when funds are already transferred
#54
Labels
Sponsor Confirmed
The sponsor acknowledged this issue is valid
Will Fix
The sponsor confirmed this issue will be fixed
Bubbly Inky Sawfish
Medium
The
totalPrincipalTokensRepaid
andtotalInterestCollected
may not be updated even when funds are already transferredSummary
The
LenderCommitmentGroup_Smart.repayLoanCallback()
function will be paused, causing the transaction to continue despite the revert. As a result, while the funds are transferred, the amounts will not be added tototalPrincipalTokensRepaid
andtotalInterestCollected
. This discrepancy will lead to an incorrect calculation of the exchange rate, potentially resulting in a loss of funds for shareholders.Root Cause
The
LenderCommitmentGroup_Smart.repayLoanCallback()
function will revert due to being paused.https://github.com/sherlock-audit/2024-11-teller-finance-update/blob/main/teller-protocol-v2-audit-2024/packages/contracts/contracts/LenderCommitmentForwarder/extensions/LenderCommitmentGroup/LenderCommitmentGroup_Smart.sol#L928-L945
However, the whole transaction will not be reverted because of the try/catch statement.
https://github.com/sherlock-audit/2024-11-teller-finance-update/blob/main/teller-protocol-v2-audit-2024/packages/contracts/contracts/TellerV2.sol#L938-950
Borrowers can repay their loans even during a pause. This means that while the funds are transferred, the amounts will not be added to
totalPrincipalTokensRepaid
andtotalInterestCollected
. Consequently, the exchange rate will be calculated incorrectly, which could result in a loss of funds for shareholders.Internal pre-conditions
none
External pre-conditions
none
Attack Path
none
Impact
Loss of fund to shareholders.
PoC
none
Mitigation
The
LenderCommitmentGroup_Smart.repayLoanCallback()
function should not revert when paused.The text was updated successfully, but these errors were encountered: