0

The following code doesn't print any transactions. What am I missing?

def main():
  uni_v3_router = Web3.toChecksumAddress('0x68b3465833fb72a70ecdf485e0e4c7bd8665fc45')
  event_filter = w3.eth.filter({"address": uni_v3_router, 'fromBlock':'latest'})
  while True:
      print("checking for txn")
      for res in event_filter.get_new_entries():
          print(Web3.toJSON(res))
      time.sleep(5)

1 Answer 1

0

I'm dumb. I believe I just misunderstood what the address filter was referring to. The contract itself makes no transactions so this filter would always return nothing. What I needed was to just get all transactions in a block and then see if the "to" field was pointing at the uniswap v3 contract.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.