15,000 USDC
View results
Submission Details
Severity: high

`DecentralizedStableCoin` mint and burn is onlyOwner

Summary

DecentralizedStableCoin mint and burn is onlyOwner, but DSCEngine deploy the contract set i_dsc just i_dsc = DecentralizedStableCoin(dscAddress);.In the initial state, it is obvious that DSCEngine is not the owner of the DecentralizedStableCoin, which will cause the functions related to mint and burn related capital operations in DSCEngine to be unavailable

Vulnerability Details

https://github.com/Cyfrin/2023-07-foundry-defi-stablecoin/blob/main/src/DSCEngine.sol#L122

https://github.com/Cyfrin/2023-07-foundry-defi-stablecoin/blob/main/src/DecentralizedStableCoin.sol#L46C52-L46C62

https://github.com/Cyfrin/2023-07-foundry-defi-stablecoin/blob/main/src/DecentralizedStableCoin.sol#L57

Impact

It will cause the functions related to mint and burn related capital operations in DSCEngine to be unavailable

Tools Used

vs code

Recommendations

Make a deploy contract to make sure the owner of the DecentralizedStableCoin is DSCEngine

Support

FAQs

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