Iâm not sure what you mean that I should do. This is the code in the contract that I use:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/token/common/ERC2981.sol";
contract ST1155 is ERC1155, AccessControl, ERC2981 {
using Counters for Counters.Counter;
bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");
mapping(uint => string) public tokenURI;
Counters.Counter private _tokenIdCounter;
constructor() ERC1155("") {
_grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
_grantRole(MINTER_ROLE, msg.sender);
}
function mint(address to, uint id, uint amount) public onlyRole(MINTER_ROLE) {
_mint(to, id, amount, "");
}
function mintNew(address to, uint amount, string memory uri, address royaltyRecipient, uint96 royaltyValue) public onlyRole(MINTER_ROLE){
uint256 id = _tokenIdCounter.current();
_tokenIdCounter.increment();
_mint(to,id,amount, "");
if (royaltyValue > 0) {
_setTokenRoyalty(id, royaltyRecipient, royaltyValue);
}
tokenURI[id] = uri;
emit URI(uri, id);
}
function mintBatch(address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data)
public
onlyRole(MINTER_ROLE)
{
_mintBatch(to, ids, amounts, data);
}
// The following functions are overrides required by Solidity.
function supportsInterface(bytes4 interfaceId) public view override(ERC1155, AccessControl, ERC2981) returns (bool) {
return super.supportsInterface(interfaceId);
}
}