Warning: Visibility for constructor is ignored. If you want the contract to be non-deployable, making it "abstract" is sufficient

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";

contract Zazzle is ERC20 {
    constructor(uint256 supply) ERC20("Zazzle", "ZAZL") {
        _mint(msg.sender, supply * (10 ** decimals()));
    }
}

https://gyazo.com/1dc3076f8e66192f03adca890b8580b8 I’m getting this warning. I hate seeing it keep popping up. Can anyone help or know the problem?

Hi, welcome! :wave:

I think there is some prompts for this warning:

Visibility for constructor is ignored

So you should remove the keyword public, and this is a breaking change since the compiler version 0.7.x, for more details, you can find at here: Solidity v0.7.0 Breaking Changes

BTW, the picture you shared is different from the code you shared.

1 Like