似乎Opensea没有实现ERC-2981 -版税信息。此外,开放的特许权使用费条件似乎不能用于专门的项目,这是基于特许权使用费。这就引出了最初的问题:如何在opensea上禁用NFT的销售/购买?
可以在contractURI https://docs.opensea.io/docs/contract-level-metadata的开放海域设置版税。但似乎这不支持个人NFT的动态版税。
发布于 2022-09-18 15:25:24
您需要阻止Opensea的合同转移您的NFT。您可以通过修改它的可靠源代码来完成它,所以如果它已经部署了,那就太迟了。
最直接的方法是直接阻止用户批准Opensea的合同。Opensea可以使用海港合同进行传输,但也可以使用管道,因此我们需要同时阻止两者。
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
interface IConduitController {
function getKey(address conduit) external view returns(bytes32);
}
contract MyNFT is ERC721 {
address private constant SEAPORT = 0x00000000006c3852cbEf3e08E8dF289169EdE581;
address private constant CONDUIT_CONTROLLER = 0x00000000F9490004C11Cef243f5400493c00Ad63;
constructor() ERC721("TEST", "TEST") {}
function _requireNotOpenSea(address to) internal view {
// Check spender isn't Seaport.
require(to != SEAPORT, "OPENSEA NOT ALLOWED");
// Check spender isn't a conduit.
// First we call the controller for the corresponding key:
// - if(success) -> the address is a valid conduit
// - else -> the address isn't a conduit
(bool success, ) = CONDUIT_CONTROLLER.staticcall(abi.encodeWithSelector(IConduitController.getKey.selector, to));
require(!success, "OPENSEA NOT ALLOWED");
}
function approve(address to, uint256 tokenId) public virtual override {
_requireNotOpenSea(to);
super.approve(to, tokenId);
}
function setApprovalForAll(address operator, bool approved) public virtual override {
_requireNotOpenSea(operator);
super.setApprovalForAll(operator, approved);
}
}https://ethereum.stackexchange.com/questions/135853
复制相似问题