By using the DecentralizedStableCoin.burnFrom
function, user can burn tokens without going through DSCEngine.
DecentralizedStableCoin inherits ERC20Burnable and includes Burn feature.
DecentralizedStableCoin overrides the burn
function to limit the authority to burn with the onlyOwner modifier. DSCEngine contract will be set the owner of DecentralizedStableCoin contract, so to burn a token, the user should request to the DSCEngine contract.
But the ERC20Burnable contract also has the burnFrom
function. Since this function is not overridden at DecentralizedStableCoin, a user who is not owner can directly burn the token.
PoC can be done by adding the following test code to DecentralizedStablecoinTest.
The user can directly burn the token. If user burn the token without going through DSCEngine, the state variable of DSCEngine is not updated and the logic will not work normally.
vscode
Override burnFrom
and add the onlyOwner
modifier.
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.