How do I properly modify supportsInterface
function?
My contract imports
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
And both of them use supportsInterface
function, could some give any hint how do I merge it properly?
AccessControl:
return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
}
ERC721 (imported into ERC721URIStorage):
return
interfaceId == type(IERC721).interfaceId ||
interfaceId == type(IERC721Metadata).interfaceId ||
super.supportsInterface(interfaceId);
}
Will that option be fine?
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, AccessControl) returns (bool) {
return
interfaceId == type(IAccessControl).interfaceId ||
interfaceId == type(IERC721).interfaceId ||
interfaceId == type(IERC721Metadata).interfaceId ||
super.supportsInterface(interfaceId);
}