How to call parent initializers (conversion not allowed?)

Hi I’m trying to initialize an ERC20 contract, yet got errors saying conversions are not allowed. Why is ERC20(name_, symbol_); considered a conversion rather than calling a constructor? Please help.

I ended up doing things like this. I believe this is not the right way of using an initializer, correct?

Yeah, I do not think this is a good way either, I think it should be

function initialize(string memory name_, string memory symbol_) public initializer {
    __ERC20_init(name_, symbol_);
}
2 Likes

Cool, I managed to make it work. Thanks for this.

1 Like