```\nfunction _doSafeTransferAcceptanceCheck(\n    address operator,\n    address from,\n    address to,\n    uint256 id,\n    uint256 amount,\n    bytes memory data\n) private {\n    if (to.isContract()) {\n        try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {\n            if (response != IERC1155Receiver.onERC1155Received.selector) {\n                revert("ERC1155: ERC1155Receiver rejected tokens");\n            }\n        } catch Error(string memory reason) {\n            revert(reason);\n        } catch {\n            revert("ERC1155: transfer to non ERC1155Receiver implementer");\n        }\n    }\n}\n```\n