In the refinance function of Lender.sol the same debt is subtracted twice from the same pool.
Firstly, in refinance, debt is subtracted from the new pool by calling the _updatePoolBalance function:
However, at the end of the function, the same debt is taken out again of the already updated poolBalance:
The accounting error is detrimental for the pool, as the pool balance would be wrongly decreased and an issue of lack of funds would emerge, threatening the finances of other users to be stuck in the contract. Furthermore, it is rather easy for any user to accidentally cause the issue.
Manual review
Update the balance of the new pool only once.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.