A loan with some special parameters may never be able to doing a periodic partial repayments #1126
Labels
bug
Something isn't working
downgraded by judge
Judge downgraded the risk level of this issue
duplicate-1182
grade-c
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
sufficient quality report
This report is of sufficient quality
unsatisfactory
does not satisfy C4 submission criteria; not eligible for awards
Lines of code
https://github.com/code-423n4/2023-12-ethereumcreditguild/blob/2376d9af792584e3d15ec9c32578daa33bb56b43/src/loan/LendingTerm.sol#L490-L559
Vulnerability details
Impact
A loan with some special parameters may never be able to doing a periodic partial repayments, and this loan will inevitably become bad debt for the system.
Proof of Concept
Suppose there is a lendingTerm in the system, which stipulates that the minimum amount a user can borrow in a single loan is 100 tokens, and the minimum partial repayment is 5%.(Assume that the impact of APR and openingFee is not considered for the time being)
partialRepay
function ofLendingTerm.sol
, we can see a contradiction that prevents the following two conditions from being met simultaneously:Tools Used
Manual audit
Recommended Mitigation Steps
Suggested optimization statement:
Assessed type
Other
The text was updated successfully, but these errors were encountered: