I see a weird behaviour when deriving a contract from ERC721PresetMinterPauserAutoIdUpgradeable
:
contract MyNFT is Initializable, ERC721PresetMinterPauserAutoIdUpgradeable
{
function initialize(
string memory name,
string memory symbol,
string memory baseTokenURI
) public initializer {
__AccessControlEnumerable_init_unchained();
__ERC721PresetMinterPauserAutoId_init(name, symbol, baseTokenURI);
}
}
Compiling this contract gives an error:
TypeError: Overriding function is missing "override" specifier.
--> contracts/MyNFT.sol:41:5:
|
41 | function initialize(
| ^ (Relevant source part starts here and spans across multiple lines).
Note: Overridden function is here:
--> @openzeppelin/contracts-upgradeable/token/ERC721/presets/ERC721PresetMinterPauserAutoIdUpgradeable.sol:39:5:
|
39 | function initialize(
| ^ (Relevant source part starts here and spans across multiple lines).
Is override
really necessary? Couldn't find anything regarding this. As far as I know the iniailizer-methods are handled differently and are not overriding themselfs.