-
Notifications
You must be signed in to change notification settings - Fork 0
n33k - Vault: _update_debt
does not accrue interest
#167
Comments
Escalate for 10 USDC. I believe this should be high severity. |
You've created a valid escalation! To remove the escalation from consideration: Delete your comment. You may delete or edit your escalation comment anytime before the 48-hour escalation window closes. After that, the escalation becomes final. |
Recommendation:
The loss is on interest, not big loss in principal, the amount might not be considered "material loss of funds". I think medium is appropriate. |
IMO, high is appropriate is it is bricking the core functionality of interest. There is no point of lending when there is no interest on it. |
interest is core concept in lend and borrow, flawed interest updates would brick one of the core functions. when we look at this over a period of time, the loss would have incurred is huge.. |
Result:
|
Escalations have been resolved successfully! Escalation status:
|
Fixed by calling |
n33k
medium
Vault:
_update_debt
does not accrue interestSummary
_update_debt
call_debt_interest_since_last_update
to accrue interest but_debt_interest_since_last_update
always return 0 in_update_debt
.Vulnerability Detail
_update_debt
setsself.last_debt_update[_debt_token]
toblock.timestamp
and then calls_debt_interest_since_last_update
._debt_interest_since_last_update
always returns 0. becauseblock.timestamp - self.last_debt_update[_debt_token]
is always 0.Impact
Debt fee is not accrued.
Code Snippet
https://github.com/sherlock-audit/2023-06-unstoppable/blob/main/unstoppable-dex-audit/contracts/margin-dex/Vault.vy#L1050-L1076
Tool used
Manual Review
Recommendation
Call
_debt_interest_since_last_update
then updatelast_debt_update
.The text was updated successfully, but these errors were encountered: