Refinancing a loan into the same pool it is in requires the pool to have the original loan amount +- the difference
because it doesn't check whether the pool already has the original amount as outstanding debt.
Lender.sol
's refinance()
has a check, which makes sure the pool we are refinancing into has enough liquidity to cover the new debt of the loan.
The issue arises when the loan is getting refinanced in the same pool it is already in. Then it will require the pool to have the amount of the loan again instead of just the difference between the old debt and the new debt. This makes it harder for a loan to be refinanced in the same pool as the pool may not have enough liquidity to pass this check.
Some loans will not be able to be properly refinanced.
Manual Review
Consider checking whether the loan's old pool is the new pool as well first and doing additional checks accordingly.
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.