15,000 USDC
View results
Submission Details
Severity: medium

Owner's address is not set in the constructor

Summary

See Details

Vulnerability Details

The owner's address is not set in the constructor of DecentralizedStableCoin.sol.

constructor() ERC20("DecentralizedStableCoin", "DSC") {}

Impact

This means that the creator of the contract will be the initial owner. However, since there is no owner check in the constructor or mint() function, anyone will be able to call mint() and generate new tokens. This could allow malicious actors to mint unlimited tokens, devaluing the total token supply and reducing the value of existing tokens.

Tools Used

Manual code Review

Recommendations

Setting the initial owner's address in the constructor:

constructor() ERC20("DecentralizedStableCoin", "DSC") {
_transferOwnership(msg.sender);
}

Support

FAQs

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