Implement a function to detect whether a smart contract event stream contains duplicate events and return the deduplicated sequence.
Each event is a dictionary containing transaction_hash and log_index. Two events are duplicates when both fields match. Return a dictionary with has_duplicates, a boolean, and events, the deduplicated list in original order. Preserve the first occurrence of each event and do not mutate the input.
Function signature: def deduplicate_events(events):
def deduplicate_events(events):