Error Compiling Code generated by ERC20 wizard

I'm using the ERC20 wizard and getting errors when trying to compile it on remix.
It compiles ok when I don't use any of the features, but adding 1 or more of the features I get errors. It appears the code the wizard produces uses compilers 0.8.9 (main code) and 0.8.20 (imported code).
When I try compiling with version 0.8.20 I get errors like this:
TypeError: No arguments passed to the base constructor. Specify the arguments or mark "KaiToke" as abstract.
--> contracts/KaiToke.sol:8:1:
|
8 | contract KaiToke is ERC20, ERC20Burnable, Ownable {
| ^ (Relevant source part starts here and spans across multiple lines).
Note: Base constructor parameters:
--> @openzeppelin/contracts/access/Ownable.sol:38:16:
|
38 | constructor(address initialOwner) {
| ^^^^^^^^^^^^^^^^^^^^^^

And when I try compiling with version 0.8.9 I get errors like this:
ParserError: Source file requires different compiler version (current compiler is 0.8.9+commit.e5eed63a.Emscripten.clang) - note that nightly builds are considered to be strictly less than the released version
--> @openzeppelin/contracts/access/Ownable.sol:4:1:
|
4 | pragma solidity ^0.8.20;
| ^^^^^^^^^^^^^^^^^^^^^^^^

Is this me using the wizard incorrectly, or is this an issue with the wizard?

In the constructor of this contract, you need to call the constructor of each contract which it inherits.

In other words, in the constructor of contract KaiToke, you need to call:

  • The constructor of contract ERC20
  • The constructor of contract ERC20Burnable
  • The constructor of contract Ownable

Wizard uses 0.8.20 on https://wizard.openzeppelin.com/. Your version sounds out of date, where are you accessing it from?

1 Like

In addition to this Answer this is how you call the parent constructors.

constructor(address initialOwner) ERC20(arguments) AnyOthetInheritedConstructor(Arguments) { }

I'm accessing the wizard through my browser (Opera). This is what I get when I go to "https://wizard.openzeppelin.com":

It looks like you are getting a cached version somehow. It should say pragma solidity ^0.8.20; at the top. Can you try a force refresh, clear browser cache, or try another browser?

I tried a force refresh and clear browser data, but still get that cached version. I also tried it on Brave, Chrome, and Edge; all of them giving me the same cached version.
Is it possible that I'm getting the cached version because I'm using windows 10?

This shouldn't be the case. I just tried it on brave, and it gives me the latest vesrion.
I'm also on windows 10.