I am trying to create an NFT Collection where users can mint with meta transactions. which go through defender relay. But when I inherit ERC1155 and ERC2771 or Ownable contracts it is giving the
TypeError: Derived contract must override function "_msgData". Two or more base classes define function with same name and parameter types
TypeError: Derived contract must override function "_msgSender". Two or more base classes define function with same name and parameter types
TypeError: Contract "Rootster" should be marked as abstract.
Code to reproduce
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/metatx/ERC2771Context.sol";
import "@openzeppelin/contracts/metatx/MinimalForwarder.sol";
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
contract Rootster is ERC1155, ERC2771Context {
constructor(MinimalForwarder _trustedForwarder) ERC2771Context(address(_trustedForwarder)){
}
function udmint() public {
require(isTrustedForwarder(msg.sender), "caller is not trusted");
_mint(_msgSender(), 0, 1, "");
}
}
Environment
Tried hardhat and Remix, both returns same problem