This repository was archived by the owner on Sep 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 89
This repository was archived by the owner on Sep 1, 2023. It is now read-only.
Creator fees not enforced on OpenSea - ERC1155 #87
Copy link
Copy link
Open
Description
Hello!
I've read through most of the existing issues, but can't quite figure out why my contract is being shown as optional for creator fees...
Chain: Polygon Testnet (Mumbai)
Token Type: ERC1155
Here's my Smart Contract code:
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.9;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/token/common/ERC2981.sol";
import "operator-filter-registry/src/DefaultOperatorFilterer.sol";
contract Clones is ERC1155, ERC2981, DefaultOperatorFilterer, Ownable {
// Contract name
string public name;
// Contract symbol
string public symbol;
constructor(
string memory _name,
string memory _symbol,
string memory someUri
) ERC1155("someBaseUri") {
name = _name;
symbol = _symbol;
_setURI(someUri);
_setDefaultRoyalty(owner(), 500);
}
function airdropClone(uint256 tokenId, address to) public onlyOwner {
_mint(to, tokenId, 1, "");
}
function setDefaultRoyalty(address receiver, uint96 feeNumerator) public onlyOwner {
_setDefaultRoyalty(receiver, feeNumerator);
}
/// @dev Set royalty fee for specific token
/// @param _tokenId The tokenId where to add the royalty
/// @param _receiver The royalty receiver
/// @param _feeNumerator the fee for specific tokenId
function setTokenRoyalty(
uint256 _tokenId,
address _receiver,
uint96 _feeNumerator
) public onlyOwner {
_setTokenRoyalty(_tokenId, _receiver, _feeNumerator);
}
/// @dev Allow owner to delete the default royalty for all collection
function deleteDefaultRoyalty() external onlyOwner {
_deleteDefaultRoyalty();
}
/// @dev Reset specific royalty
/// @param tokenId The token id where to reset the royalty
function resetTokenRoyalty(uint256 tokenId) external onlyOwner {
_resetTokenRoyalty(tokenId);
}
//=======================================================================
// [public/override/onlyAllowedOperatorApproval] for OperatorFilter
//=======================================================================
function setApprovalForAll(address operator, bool approved) public override onlyAllowedOperatorApproval(operator) { super.setApprovalForAll(operator, approved); }
function safeTransferFrom(address from, address to, uint256 tokenId, uint256 amount, bytes memory data) public override onlyAllowedOperator(from) { super.safeTransferFrom(from, to, tokenId, amount, data); }
function safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) public virtual override onlyAllowedOperator(from) { super.safeBatchTransferFrom(from, to, ids, amounts, data); }
//=======================================================================
// [public/override]
//=======================================================================
function supportsInterface(bytes4 interfaceId) public view override( ERC1155, ERC2981 ) returns (bool) {
return super.supportsInterface(interfaceId);
}
}
Editing the contract on OpenSea shows the following:

I've seen some other people saying that they had to hit a refresh button, but I don't have access to a refresh button to run the check again. I've also minted a few NFTs from the contract, as it says in the documentation that the enforcement check is run whenever the first NFT is minted.
Any ideas as to why this isn't being enforced?
Thanks,
Matt
Metadata
Metadata
Assignees
Labels
No labels