Skip to content

Instantly share code, notes, and snippets.

View ExtraLime's full-sized avatar

William Morgan ExtraLime

View GitHub Profile
@miohtama
miohtama / fast-web3-py-event-decoder.py
Created August 19, 2021 08:08
Fast event fetcher and decoder for web3.py
"""Below is an example for faster JSON-RPC event fetcher.
It skips a lot of steps, like converting raw binary values to corresponding numbers (float, ints),
looking up ABI labels and building `AttributedDict` object.
The resulting Event dictitionary is generated faster, but harder to use and you need to know what you are doing.
"""
def _fetch_events_for_all_contracts(