1

I have a smart contract method "transferFrom" which, at the end, emits an event "EventTransf". From a java program using web3j I call such a method and I obtain the receipt.

TransactionReceipt tr=contract.transferFrom(from,to, tk).send();

Now, I would read all the emitted events from this method call. I have red about the web3j filter, but I'm only interested in the events emitted inside this call. The code should also work with infura.

Discipulos
  • 423
  • 8
  • 23

1 Answers1

1

Solved. I need to use tr.getLogs() and for each Log object, I call

  List<Type> args = FunctionReturnDecoder.decode(
              log.getData(), Contract.Event_Type.getParameters());
Discipulos
  • 423
  • 8
  • 23