20,000 USDC
View results
Submission Details
Severity: high
Valid

refinance() function causing incorrect pool balance update

Summary

The refinance(Refinance[] calldata refinances) function in the contract Lender has an error to update the pool balance.

Vulnerability Details

The new pool balance the loan refinanced to is updated in L636:

_updatePoolBalance(poolId, pools[poolId].poolBalance - debt);

And is updated again at L698:

pools[poolId].poolBalance -= debt;

Results in double accounting of the pool balance.

Impact

The impact of this vulnerability is severe, leading to financial losses for the pool lender.

Tools Used

Manual Review

Recommendations

To fix this vulnerability, the L698 should be removed.

Support

FAQs

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

Give us feedback!