Overview of Dune’s Decoded Data Approach

Dune uses the ABI (Application Binary Interface) of smart contracts to decode blockchain transactions into structured tables. Each event log and function call from the ABI are parsed into their own tables. This decoding process transforms the raw, encoded data on the blockchain into human-readable tables, simplifying the analysis of smart contract data.

Dune’s decoded data approach offers several benefits:

  • Enhanced Readability: The decoded data tables provide a clear and intuitive representation of smart contract activities

  • Efficient Analysis: The structured tables enable efficient querying and analysis of smart contract data

  • Handling Multiple Contract Instances: For smart contracts with multiple instances, Dune aggregates the data from these instances into a single table, simplifying the analysis process.

  • Collaborative Mapping: Dune’s smart contract library is continuously expanded through the active participation of the Dune community, ensuring that the decoding coverage remains comprehensive and current.

Which contracts have decoded data?

Contract submissions on Dune are driven by the community. Usually, the odds are good that the contract you are looking at is already decoded, but especially for new projects or new contracts, it might be that the contract is not decoded yet. In those cases, you can submit the contract to be decoded. Decoding usually takes about 24 hours, in special cases it might take longer.

You can check if contracts are already decoded by querying [blockchain].contracts tables, the data explorer or use this dashboard.

If you want to submit several contracts at the same time, there is also the possibility of submitting a batch of contracts. To do so, please use this CSV as a template and fill it in with the appropriate information for the contracts you want to decode. Afterwards, send the CSV to decoding@dune.com.

How does decoding work?

Smart Contracts on the TVM blockchain are mostly written in high level languages like Solidity or Vyper.

For them to be able to be deployed to a TVM execution environment, they need to be compiled to TVM executable bytecode. Once deployed, the bytecode gets associated with an address on the respective chain and is permanently stored in this chain’s state storage.

To be able to interact with this smart contract, which is now just bytecode, we need a guide to be able to call the functions that are defined in the high-level languages. This translation of names and arguments into byte representation is done using an Application Binary Interface (ABI).

The ABI documents names, types, and arguments precisely which allows us to interact with the smart contract using a somewhat human-readable format. The ABI can be compiled using the high-level language source code.

The ABI is used to call a smart contract or interpret the data it emits.

source: https://hackernoon.com/hn-images/1*Sz1a7G2pQ62UnkHoieve4w.jpeg