I'm curious if the following upgrade would be safe to perform with OpenZeppelin's upgradeable proxies.
I have a deployed ERC721 implementation contract to which I would like to add an EIP-2981 interface via upgradeable proxy. Since IERC2981.sol does not add any storage variables, would it be safe to inherit the interface class in the new implementation of my ERC721 contract at the end of my inheritance list? Something like this:
contract MyUpgradeableERC721 is A, B, IERC2981Upgradeable {
/*
* storage and logic carried over from previous deployment
**\
/*
* new ERC165 interface function that exposes ERC2981
**\
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(AccessControlEnumerableUpgradeable, ERC721Upgradeable, ERC721EnumerableUpgradeable, IERC165Upgradeable)
returns (bool)
{
return interfaceId == type(IERC2981Upgradeable).interfaceId || super.supportsInterface(interfaceId);
}
}