Getting the following error when trying to migrate the constructor of OpenZeppelin ERC20 Contract
@openzeppelin/contracts/token/ERC20/ERC20.sol:55:5: Warning: Visibility for constructor is ignored. If you want the contract to be non-deployable, making it "abstract" is sufficient.
constructor (string memory name_, string memory symbol_) public {
^ (Relevant source part starts here and spans across multiple lines).
,/C/Users/Asusupernova/Documents/ETH/LastCreator/contracts/MyToken.sol:7:5: Warning: Visibility for constructor is ignored. If you want the contract to be non-deployable, making it "abstract" is sufficient.
constructor(uint256 initialSupply) public ERC20("Liberation", "LIB") {
^ (Relevant source part starts here and spans across multiple lines).
Environment
Truffle v5.1.56 (core: 5.1.56)
Solidity v0.5.16 (solc-js)
Node v12.19.0
Web3.js v1.2.9
Here is my code:
pragma solidity >=0.4.21 <=0.7.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract My is ERC20 {
constructor(uint256 initialSupply) public ERC20("Liberation", "LIB") {
_mint(msg.sender, initialSupply);
}
}
Here is the OpenZep code: @openzeppelin/contracts/token/ERC20/ERC20.sol:55:5:
constructor (string memory name_, string memory symbol_) public {
_name = name_;
_symbol = symbol_;
_decimals = 18;
}