Using simple OZ ERC20:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract MyToken is ERC20, Ownable {
constructor(address initialOwner)
ERC20("MyToken", "MTK")
Ownable(initialOwner)
{}
function mint(address to, uint256 amount) public onlyOwner {
_mint(to, amount);
}
}
When Ownable(initialOwner) is set to initialOwner there is an error: TypeError: Wrong argument count for modifier invocation: 1 arguments given but expected 0.
After removing initialOwner from Ownable, so it's Ownable(), everything works. Is it ok ?
