Hey guys, So my question is let's say I created contract contractA and deployed it using an open zeppelin upgrade. And now I want to upgrade it with contractAVersion2 , So in this new contractAVersion2 I want to override few methods of the first version and also some new methods. So one way I found was to inherit contractA into contractAVersion2 and then override methods or add a new one. But there are few problems that I have:
- There are few methods in version1 contract that are not declared virtual and hence I cannot override them.
- Super keyword in version 1 points to open zeppelin erc20 contract , but in version2 if I inherit version 1 , super keyword will point to version 1 and not open zeppelin contract sitting on top of inheritence.
So solution I found was rather then inheriting version 1 contract , I will copy the whole code of version 1 in version 2 and then make my changes into it. In this way I won't have to override anything , and super keyword will still point to open zeppelin erc20.
So my question is , is this a fair practice? Or what will be correct practices to create this version 2.