If Trate is greater then amount when the user repays the funds wont be repayed
Summary
Since of rounding error when Trate is more than the user requested it will turn into 0 and nothing will get repaid but the user will send a small amount of funds
Vulnerability Detail
ex:
Alice wants to repay 1 wei for its loan but Trate=1e19 so when 1e18/1e19=0 so it will subtract 0 and the transferFrom will transfer the 1 wei to the contract.
Impact
small loss of funds but with a bigger Trate it have bigger rounding error
simon135
medium
If
Trate
is greater thenamount
when the user repays the funds wont be repayedSummary
Since of rounding error when
Trate
is more than the user requested it will turn into 0 and nothing will get repaid but the user will send a small amount of fundsVulnerability Detail
ex: Alice wants to repay 1 wei for its loan but
Trate=1e19
so when1e18/1e19=0
so it will subtract 0 and thetransferFrom
will transfer the 1 wei to the contract.Impact
small loss of funds but with a bigger
Trate
it have bigger rounding errorCode Snippet
Tool used
Manual Review
Recommendation
check that if
t0Amount
is 0 that is reverts