* The protocol mints DSC tokens when users deposit collateral and burns DSC tokens when users repay debt. The internal state tracking user debt is updated before calling the DSC token contract's mint and burn functions.
* The `_mint_dsc()` and `_burn_dsc()` functions update internal state (`user_to_dsc_minted`) before calling external functions on the DSC token contract, but do not check the return values of these external calls. If the DSC token's `mint()` or `burn_from()` functions fail silently or return false, the internal state will be inconsistent with the actual token supply.
```vyper
@internal
def _mint_dsc(amount_dsc_to_mint: uint256):
assert amount_dsc_to_mint > 0, "DSCEngine__NeedsMoreThanZero"
self.user_to_dsc_minted[msg.sender] += amount_dsc_to_mint // @> State updated
self._revert_if_health_factor_is_broken(msg.sender)
# Note, we are not checking success here
extcall DSC.mint(msg.sender, amount_dsc_to_mint) // @> No return value check
```
```vyper
@internal
def _burn_dsc(
amount_dsc_to_burn: uint256, on_behalf_of: address, dsc_from: address
):
self.user_to_dsc_minted[on_behalf_of] -= amount_dsc_to_burn // @> State updated
# Note, we are not checking success here
extcall DSC.burn_from(dsc_from, amount_dsc_to_burn) // @> No return value check
```
Likelihood:
* The DSC token contract may implement `mint()` or `burn_from()` functions that return false on failure instead of reverting
* Future modifications to the DSC token contract could change behavior to return false instead of reverting
* If the DSC token contract has a bug that causes these functions to fail silently, the state mismatch will occur
Impact:
* If `mint()` fails silently, users will have increased debt tracking but no actual DSC tokens, allowing them to bypass health factor checks and mint more than they should
* If `burn_from()` fails silently, users will have decreased debt tracking but still have DSC tokens, allowing them to mint unlimited DSC
* Protocol insolvency due to accounting mismatch between internal state and actual token supply
The contest is live. Earn rewards by submitting a finding.
Submissions are being reviewed by our AI judge. Results will be available in a few minutes.
View all submissionsThe contest is complete and the rewards are being distributed.