My parent contract inherits ERC1155Upgradeable & ERC1155SupplyUpgradeable with other contracts from OZ, the problem is the supply contract is throwing 3 errors. I even tried OZ Wizard and errors persist still.
contract Example is Initializable, OwnableUpgradeable, ERC1155Upgradeable, ERC1155SupplyUpgradeable {
function initialize(address initialOwner) initializer public {
__ERC1155_init("");
__Ownable_init(initialOwner);
__ERC1155Supply_init();
}
function _update(address from, address to, uint256[] memory ids, uint256[] memory values)
internal
override(ERC1155Upgradeable, ERC1155SupplyUpgradeable)
{
super._update(from, to, ids, values);
}
}
errors are:
Function has override specified but does not override anything.
Invalid contract specified in override list: "ERC1155Upgradeable".
Member "_update" not found or not visible after argument-dependent lookup in type(contract super ERC1155SupplyUpgradeable).
even ERC1155Supply standalone contract isn't compiling!!
Throwing an error is a term typically associated with runtime behavior, for example, a transaction-revert.
In your case, these are compilation errors (I guess you could claim that the compiler throws an error, but the typical terminology in this case does not involve 'throwing').
As to your actual problem:
The ERC1155SupplyUpgradeable contract already inherits the ERC1155Upgradeable contract, and it already overrides the _update function of that contract.
So your contract needs to inherit only the ERC1155SupplyUpgradeable contract, and it needs to override the _update function only of that contract.
Thanks for your input @barakman they are indeed compilation errors. But ERC1155SupplyUpgradeable as a contract isn't compiling before any inheritance (screenshot below). The wizard was used to debug before asking for support and the code I posted above was the wizard code.
@frangio can you please take a quick look and advise. Thanks