Algo Ssstablecoinsss

First Flight #30
Beginner FriendlyDeFi
100 EXP
View results
Submission Details
Severity: high
Invalid

DSCEngine : Subtractions underflow

Summary

Substraction without prior checking

Vulnerability Details

In _redeem_collateral:

self.user_to_token_address_to_amount_deposited[_from][ token_collateral_address ] -= amount_collateral

If amount_collateral exceeds the user’s balance, an underflow occurs.

Impact

Failing to validate subtractions can lead to underflows, allowing users to redeem more collateral than they deposited or burn more DSC than they minted.

Tools Used

N/A

Recommendations

assert self.user_to_token_address_to_amount_deposited[_from][token_collateral_address] >= amount_collateral, "Insufficient collateral balance"

This ensures the user has enough collateral in their balance before proceeding with the subtraction.

Updates

Lead Judging Commences

bube Lead Judge 6 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.