In the documentation: http://web3py.readthedocs.io/en/latest/filters.html

Quote "Subsequent topic items are the hex encoded values for indexed event arguments. In the above example, the second item is the arg1 value 10 encoded to its hex string representation."

So how to make "0x000000000000000000000000000000000000000000000000000000000000000a" from arg1 and 10 ? Please advise. Thank you

1 Answer 1


If you convert the integer 10 to its hexadecimal representation, you get 0xA. Fill that with enough zeros to get the string you need:

>>> hex_str = "0x{:064x}".format(10)
>>> print(hex_str)

Your Answer

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

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