[L-6] Lack of option for borrowers to payback their complete loan
Description
Fuji's Borrowing Vault accepts absolute debt amount only in payback.
Lending providers charge interest per block, so between the time you submit a transaction and the time it gets processed, the debt will have increased by some small margin, especially on L2s. On L1s, it is also not guaranteed that you will land in the same block; there is always some latency. This prevents someone from paying off their total debt, and there will always be some leftover dust.
Remediation to consider
Ask users to pass the unit max as the amount in payback if they want to repay their total debt, then define the amount as the user's current debt inside payback. AAVE does the same
[L-6] Lack of option for borrowers to payback their complete loan
Description
Fuji's Borrowing Vault accepts absolute debt amount only in
payback
.Lending providers charge interest per block, so between the time you submit a transaction and the time it gets processed, the debt will have increased by some small margin, especially on L2s. On L1s, it is also not guaranteed that you will land in the same block; there is always some latency. This prevents someone from paying off their total debt, and there will always be some leftover dust.
Remediation to consider
payback
if they want to repay their total debt, then define the amount as the user's current debt insidepayback
. AAVE does the samepayback
in terms of shares.