1

I took a screenshot of the error that was generated. Someone please help me resolve this. Thank you.

The image shows the error in written form

Code: 1 pragma solidity ^0.8.0; 2 3 import "https://github.com/OpenZeppelin/openzeppelin- 4 contracts/blob/master/contracts/token/ERC20/ERC20.sol";

5 contract MEEBA is ERC20 { 6 constructor(uint256 initialSupply) public ERC20 ("MEEBA", "MEEBA"){ 7 _mint(msg.sender,initialSupply); 8 } 9 }

0

I took a screenshot of the error that was generated.

That's not an error, it's a warning.

This means your contract has successfully compiled. You can either leave the warning there and ignore it, or fix it.

To fix it - according to the warning message - you need to remove the public visibility specifier. As of Solidity 0.7.0, these are no longer required for constructors:

Visibility (public / external) is not needed for constructors anymore: To prevent a contract from being created, it can be marked abstract. This makes the visibility concept for constructors obsolete.

1
  • Thank you, Richard! – Col May 22 at 2:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.