I'm trying to get an event args in web3j version 4.0.1.
I use the simple syntax which is explained in the docs. I'm getting the log object but there is no args
property or such thing in it.
Here is my code:
EthFilter filter = new EthFilter(DefaultBlockParameterName.EARLIEST,
DefaultBlockParameterName.LATEST, <contract-address>);
web3j.ethLogFlowable(filter).subscribe(log -> {
System.out.println(log);
});
I expected to find args
in the log
it is not there. There is a data
index and its value is some unreadable hex string.
I must mention that I'm able to see the log arguments in remix and even in truffle test transaction receipt. But no success in web3j.
Best Answer
For the following event:
You can extract the event arguments from the log like this