The burn()
function in DecentralizedStableCoin.sol has onlyOwner() modifier indicating that it should only be called by DSCEngine.sol. According to this design, a owner of the token should not be allowed to burn the tokens by any other means than via DSCEngine.sol.
This design is challenged by the burnFrom()
function in Openzeppelin's ERC20Burnable implementation as it is public by default.
A malicious user can self-approve and use the burnFrom()
functionality to burn his/her token.
It is important to note here that approve function of Openzeppelin ERC20 do allow self-approval. Hence, basically allowing users to burn directly.
Serious integration concerns. Any protocols/products building on top of DSCStablecoin might not have the idea of holders being able to burn DSC tokens directly and not via DSCEngine.
The protocol remains in profit in these type of burn events - as the malicious user will incur the loss of his tokens/deposit. But it's safe to conclude that it is not the intended behaviour.
Manual Review
Override burnFrom()
function with suitable access modifier via DSCEngine or revert the function - - as per system design decisions.
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.