Receiving a "Derived contract must override function..." Error when using Upgradeable Contracts

I am receiving a “Derived contract must override function” error on both _beforeTokenTransfer & supportsInterface when using upgradeable contracts. I understand the root cause of the error, the functions being defined in both ERC721Upgradeable.sol and ERC721EnumerableUpgradeable.sol. However, since I have added the lines __ERC721XXX_init_unchained() as found below in my Initialize function, I thought this should be sufficient to avoid the error. Isn’t this the case?

contract CryptoAstres is Initializable, ERC721Upgradeable, ERC721PausableUpgradeable, OwnableUpgradeable, 
ReentrancyGuardUpgradeable, ERC721EnumerableUpgradeable {

    function initialize() public initializer {
        __ERC721_init_unchained("Token", "TOK");
        __ERC721Pausable_init_unchained();
        __Ownable_init_unchained();
        __ReentrancyGuard_init_unchained();
        __ERC721Enumerable_init_unchained();
    }


:computer: Ubuntu 20.04

Thank you. J

I think ERC721PausableUpgradeable has derived from ERC721Upgradeable, so maybe you can just import ERC721PausableUpgradeable.

And do not have the full code, so I am unable to reproduce errors.

Thank you @Skyge I have removed the ERC721Upgradeable references but this did not help. In general, isn’t using the __ERC721XXX_init_unchained() statements supposed to take care of these issues? Am I not understanding the purpose of these properly?

Thank you again. J

I believe the issue is that you are inheriting from multiple contracts that implement different versions of those functions (check beforeTokenTransfer for example), so you need to define it in your contract using override and probably be specific and explicit on what logic should be executed there. It does not have to do with initialization but with requiring you to define those functions in CryptoAstres.