Lender.giveLoan increases amount that user should pay
Lender.giveLoan function allows lender to give his loan to another lender.
In this process new debt becomes previous debt + interests.
This can seem ok, as borrower should compensate funds that new loaner paid, but it actually not good, because now not only debt amount is accruing interest, but debt + interests.
Example.
I have debt for 1000$ with interest 5% a month. So should repay 1100 in 2 months. And after 1 month my lender gives my loan to another lender with same 5% interest rate. totalDebt is 1050$ now(as 1 month already gone). After 1 more month i want to repay my debt and i expect to pay 1100.
Also lender can give loan to himself and in such way increase debt for user.
Borrower will pay more funds.
VsCode
Accrued interest from previous debt should not be added to the debt and accrue interests. They can be stored to additional variable to be repaid.
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.