code: def on_smart_contract_event(self, sc_event: NotifyEvent):
          
          if not isinstance(sc_event, NotifyEvent):
              logger.info("Not Notify Event instance")
              return
          if sc_event.ShouldPersist:
              if sc_event.notify_type in [NotifyType.TRANSFER, NotifyType.REFUND, NotifyType.MINT]:
                  self._events_to_write.append(sc_event)
docs: Listener for NotifyEvent
          Args:
              sc_event (NotifyEvent): event to check whether it should be persisted