The udf_decode_event method is a powerful tool in Footprint Analytics that allows you to parse and decode event data from Ethereum transactions. This method is particularly useful when working with smart contract interactions, as it provides insights into the specific events that were emitted and the parameters that were used.

The example provided is also included in the tutorial.


The syntax for the udf_decode_event method is as follows:

udf_decode_event('Event ABI', "data", topics) AS decoded_data
  • Event ABI: This is a JSON-formatted string that describes the event signature and its parameters. It follows the Ethereum ABI specification.
  • "data": This is the actual data from the event that needs to be decoded. It is typically stored as a hexadecimal string in the event data field of an Ethereum transaction.
  • topics: This is a comma-separated list of topics that corresponds to the indexed parameters of the event. Each topic is a hexadecimal string.
  • decoded_data: This is the output column that will contain the decoded information. The data is structured as per the ABI specification, making it easy to understand and work with.


Let's take a look at an example query that uses the udf_decode_event method:

    topics) AS decoded_data
FROM iceberg.prod_bronze.ethereum_logs
WHERE address = '0x60e4d786628fea6478f785a6d7e704777c86a7c6'
AND transaction_hash = '0xd48ffa07cf7c20d98600fcc8f6de9d2a619e93252ad89143c769cb3c783acfdb'
AND block_timestamp > date '2023-10-07';

In this example, we're querying the ethereum_logs table to find events where the address matches a specific smart contract address, the transaction_hash is a specific value, and the event occurred after a certain date. We then use the udf_decode_event method to decode the event data for these events.


The udf_decode_event method is a valuable addition to your analytical toolkit when working with Ethereum transactions and smart contract events. It allows you to decode and understand the events emitted by smart contracts, providing a deeper level of insight into the transactions and interactions on the Ethereum network.

Please note that the example provided is a simplified version and may not cover all edge cases or variations in the data. It's always recommended to test the method with your actual data to ensure it works as expected.