15,000 USDC
View results
Submission Details
Severity: gas
Valid

Address 0 check in `DecentralizedStableCoin::mint` is redundant

Description

The check in DecentralizedStableCoin::mint for 0 address

function mint(address _to, uint256 _amount) external onlyOwner returns (bool) {
if (_to == address(0)) {
revert DecentralizedStableCoin__NotZeroAddress();

is redundant as it is already done in the default ERC20 OpenZeppelin implementation

function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");

Recommend Mitigation

Remove the redundant check.

Support

FAQs

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