code: def get_contract_events(
          chain: BlockChainService,
          abi: Dict,
          contract_address: Address,
          topics: Optional[List[str]],
          from_block: BlockSpecification,
          to_block: BlockSpecification,
  ) -> List[Dict]:
      
      verify_block_number(from_block, 'from_block')
      verify_block_number(to_block, 'to_block')
      events = chain.client.get_filter_events(
          contract_address,
          topics=topics,
          from_block=from_block,
          to_block=to_block,
      )
  
      result = []
      for event in events:
          decoded_event = dict(decode_event(abi, event))
          if event.get('blockNumber'):
              decoded_event['block_number'] = event['blockNumber']
              del decoded_event['blockNumber']
          result.append(decoded_event)
      return result
docs: Query the blockchain for all events of the smart contract at
      `contract_address` that match the filters `topics`, `from_block`, and
      `to_block`.