The ERC20Burnable
contract which DecentralizedStableCoin
inherits from exposes the burnFrom
function (Link).
Thereby it is possible to burn DSC without paying off any debt (decreasing a user's amountDscMinted
balance in the DSCEngine
contract).
Thereby the invariant is violated that the sum of all entries in the amountDscMinted
mapping is equal to the total supply of DSC (which I assume is an invariant that should hold based on the fact that the DecentralizedStableCoin.burn
function can only be called by the DSCEngine
contract).
In addition this can lead to imbalances in the DSC system.
As you can see in the following test, the burnFrom
function can be called in order to burn DSC:
Thereby the supply of DSC is reduced without a corresponding decrease in the amountDscMinted
mapping in the DSCEngine
contract.
As explained above the invariant is violated that I presume should hold true.
Also there will be bad debt in the DSC system, meaning it is not possible to pay off all debt as there's an insufficient amount of DSC.
This puts an upward pressure on the DSC/USD price which should be pegged to the USD. However it's economically reasonable for a liquidator to pay up to 1.1 USD per DSC as he receives a 10% bonus upon liquidating an account.
This pressure to the upside (demand for DSC) is not offset by an equal pressure to the downside (supply of DSC) because someone that mints and sells DSC runs into the risk of not being able to buy DSC at the same or lower price due to the shortage of DSC in the first place.
VSCode, Manual Review
In the DecentralizedStableCoin
contract override the burnFrom
function such that it reverts when it is called.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.