Can I use Crowdsale with ERC20 Token created in OZ4.5.0?

Hi everyone,

Basically, I already have ERC20 token created, which is using solidity 0.8.2 and OpenZeppelin version 4.5.0. I know that Crowdsales supports only OpenZeppelin Contracts 2.x version. I am not sure if I can use my already created Token with Crowdsale. Will it work considering both contracts use a different OpenZeppelin version?

Thank you.

Hi, welcome to the community! :wave:

I think yes, you can, although using two different versions in a project is not a good idea. But you know, sometimes, when the two contracts are used in combination, maybe they will generate some unexpected result, so I think you should test more when you publish these two contracts to use together.

1 Like

Great, thanks for the advice. I try to test them, hopefully, there won't be any conflicts. I need two different versions because my token should be upgradeable and only OZ version >=3 provides this feature.

I also found the article that desribes how Crowdsale could be modified to work with OZ4. I don't know if this is safe, what do you think?

It seems like just updating some grammar, and you still need to test more.

1 Like