Last active
May 2, 2023 20:18
-
-
Save Blauyourmind/a6c0cf0c90f4ad60025e0857687e6a15 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity 0.8.13; | |
import {IERC1155CreatorCore} from "@manifoldxyz/creator-core-solidity/contracts/core/IERC1155CreatorCore.sol"; | |
import {IERC1155CreatorExtensionApproveTransfer} from "@manifoldxyz/creator-core-solidity/contracts/extensions/ERC1155/IERC1155CreatorExtensionApproveTransfer.sol"; | |
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol"; | |
contract NonTransferableExtension is IERC1155CreatorExtensionApproveTransfer { | |
constructor() {} | |
function supportsInterface(bytes4 interfaceId) | |
public | |
pure | |
override(IERC165) | |
returns (bool) | |
{ | |
return | |
interfaceId == type(IERC1155CreatorExtensionApproveTransfer).interfaceId || | |
interfaceId == type(IERC165).interfaceId; | |
} | |
function setApproveTransfer(address creator, bool enabled) external {} | |
function approveTransfer(address operator, address from, address to, uint256[] calldata tokenIds, uint256[] calldata amounts) external pure returns (bool) { | |
if (from != address(0) && to != address(0)) { | |
return false; | |
} else { | |
return true; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment