Skip to content

Commit 0ecaf63

Browse files
Merge pull request duneanalytics#433 from thecaptncrunch/decoding-docs-test
New decoding index
2 parents c994c32 + 6ce0aac commit 0ecaf63

File tree

6 files changed

+93
-30
lines changed

6 files changed

+93
-30
lines changed

docs/data-tables/decoded/.pages

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
title: Decoded Tables
22
nav:
33
- index.md
4+
- new_guide.md
45
- EVM: evm
56
- Solana: solana

docs/data-tables/decoded/index.md

Lines changed: 92 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,112 @@
1-
---
2-
title: Decoded Tables
3-
description: Instead of working with the transactions, logs, and traces in their raw states, on Dune we decode smart contract activity into nice human-readable tables.
4-
---
1+
---
2+
title: Decoding Contracts
3+
description: Instead of working with the logs and traces in their raw states, on Dune we decode smart contract activity into nice human-readable tables.
4+
---
55

6+
# Decoding Contracts
67

8+
**Dune’s extensive catalog of decoded smart contracts are driven by our Wizards. Our decoding process empowers our community to submit the data and build the tables that they’d like to query on Dune!**
79

8-
**To make it easier to work with smart contracts and programs, Dune has decoded data from all transactions (all functions and logs) into human readable tables. This means you don't need to work with any of the raw data from the blockchain!**
10+
But what does decoding mean? Blockchain transaction data starts as bytecode, a low level programming language that can be read by machines. Using the ABI (Application Binary Interface) that is personal to each contract, we translate that bytecode into query-able data tables.
911

10-
!!! suggestion "Consider using spellbook tables first"
11-
We highly recommend you use spellbook tables first, as many decoded tables have been further abstracted into tables like [`nft.trades`](../spellbook/top-tables/nft.trades.md) and [`dex.trades`](../spellbook/top-tables/dex.trades.md)
12+
## A. The Lifecycle of Decoding
1213

13-
## EVM decoded tables
14+
### Step 1: Submission
1415

15-
We support [decoded tables for Ethereum based chains (EVM)](evm/index.md) like Ethereum, Optimism, Arbitrum.
16+
Our decoding process begins with our [contract submission page](https://dune.com/docs/app/decoding-contracts/)
1617

17-
There are two types of EVM decoded tables, one that decodes functions and one that decodes event logs.
18-
<div class="cards grid" markdown>
18+
![](../images/General-Submission.png)
1919

20-
- #### [Call Tables](evm/call-tables.md)
20+
To successfully submit a contract, you will need four pieces of information:
2121

22-
---
22+
1. Blockchain: The name of the origin blockchain of the contract
23+
2. Contract Address: The address associated with contract
24+
3. Project Name: The name of the project that the contract originates from (ex. Tether)
25+
4. Contract name: The name of the smart contract as given by the Project (ex. USDT)
26+
5. ABI: Unique to each smart contract. Further details can be found [here](https://docs.soliditylang.org/en/latest/abi-spec.html). Note that for contracts that are verified by a chain's explorer we will attempt to auto-fetch the ABI. Otherwise the ABI will need to be entered manually.
2327

24-
These are decoded from traces, which contain every function call within a transaction (i.e. between contracts).
25-
26-
[→ Call Tables](evm/call-tables.md)
28+
In most cases, the contract name will be pulled directly from a blockchain scanner. We recommend using the name provided. If the name is not automatically provided, please follow our naming conventions to assure the contract is properly assimilated into Dune’s database.
2729

28-
- #### [Event Log Tables](evm/event-logs.md)
30+
**When do you need Advanced Options?**
2931

30-
---
32+
**Are there several instances of this contract?**
3133

32-
These are decoded from event logs, which are data points emitted during a function call.
33-
34-
[→ Event Log Tables](evm/event-logs.md)
34+
Contract “instances” are essentially contracts that are on the same chain and have the same bytecode (and therefore the same ABI). If you toggle instances to “Yes”, Dune can decode all instances without multiple submissions.
3535

36-
</div>
36+
**Is it created by a factory contract?**
3737

38+
A factory contract is essentially a smart contract that creates other smart contracts. If there are multiple contract instances, there is a chance that it is due to a factory contract. If you toggle this question to “yes”, Dune can decode all contracts created by the same factory that use the same ABI, and store them in the same table (ex., pools from Uniswap V3).
3839

39-
## Solana decoded tables
40+
**Other Special Contracts**
4041

41-
We also support [decoded tables on Solana](solana/idl-tables.md), for any program (Candy Machine, Whirlpool, Jupiter, SPL Token, System Program, Pyth, and many more).
42+
Other special smart contracts can be decoded as well, following these conventions:
4243

43-
<div class="cards grid" markdown>
44+
Proxy contract: Submit using the proxy address but the ABI of the implementation
4445

45-
- #### [IDL Tables](solana/idl-tables.md)
46+
Diamond proxy contracts: Submit all the facets using just the same name for the project and contract and upload all the relevant ABIs. This can be done with one ABI representing all facets or separate ABIs for each facet.
4647

47-
These are decoded from `instruction_calls`, so all function calls at the first instruction level (not inner instructions) are decoded.
48-
49-
[→ IDL Tables](solana/idl-tables.md)
50-
</div>
48+
!!! suggestion "Where can I find this information?"
49+
Contract addresses can usually be found in a project’s docs. Once you have the contract address, you can use a blockchain explorer to get the rest of the information. Most blockchain explorers have everything you need!
50+
51+
<details>
52+
<summary> What to Know about Re-Submissions </summary>
53+
<br>
54+
Given the popularity of some smart contracts, re-submissions happen. If the contract you are trying to submit already exists, an error like the following will pop up.
55+
![](../images/Resubmission%20Info.png)
56+
There are some circumstances under which a contract can be resubmitted, like if the contract needs to be renamed. In that case, you can click **“Proceed to Resubmit”** and follow the steps to submit the contract as normal with one caveat: at the end of the submission process, you will be asked to explain why you want to resubmit the contract. Give as much detail as possible to avoid the resubmission being rejected!
57+
</details>
58+
59+
### Step 2: Decoding
60+
61+
Once the contract has been approved for decoding, you will receive a notification in your email. While the table itself may be visible after approval, it may be empty. No reason to worry! Note that it takes around 6 hours from the time the contract has been approved to be fully decoded and incorporated into the Dune database.
62+
63+
### Step 3: Finding Your Decoded Contract
64+
65+
One quick tip to find and begin querying your decoded table is to use Dune's Explorer. When beginning a new query, the Explorer is located to the left side of the Query Editor. Drop the contract address of your decoded contract in the search bar, pull up the specific function or event you are looking for, and use the ">>" button to immediately populate that table in your Query Editor.
66+
67+
![The search bar and >> symbol that will help you get started](../images/Explorer%20Image.png)
68+
69+
Then it’s all ready for you to query. Let the data flow!
70+
71+
## B. Frequently Asked Questions
72+
73+
<details>
74+
<summary> **What contracts can be decoded?** </summary>
75+
<br>
76+
Any contracts launched on blockchains that Dune has integrated. To check which blockchains we currently have available, see our section on [Tables and Chains](https://dune.com/docs/data-tables/).
77+
</details>
78+
79+
<details>
80+
<summary>**How do I figure out if my contract has been decoded?**</summary>
81+
<br>
82+
There are two main ways to find out if your contract has been decoded.
83+
84+
First: Account Settings
85+
86+
Information on submitted contracts can be found in your account settings under “Contracts”. The status of the contract will reflect one of the following:
87+
88+
Pending
89+
Approved/Rejected*
90+
91+
Note that once a contract has been approved, it takes around 6 hours for the data to be fully decoded and populated into our database.
92+
93+
*If the contract is rejected, hover your mouse over the status to see the reason for the rejection.
94+
95+
Second: Our [Contract Decoding Dashboard](https://dune.com/dune/is-my-contract-decoded-yet-v2)
96+
![](../images/Decoding%20Dashboard.png)
97+
Built by our decoding team, this dashboard gives you information on the status of any submitted contract. Input the contract address in the box at the top of the dashboard and if the contract has been decoded, the contract information will populate the box along with where it is located in the Dune database.
98+
</details>
99+
100+
<details>
101+
<summary> I see data on Dune but it doesn’t match or is missing what I expected to see. </summary>
102+
<br>
103+
Unfortunately, Dune only has access to contract data in circumstances that the contract performed an event that left a trace. Our recommendation is to check out the {blockchain}.traces table to see what information is available for a particular contract.
104+
105+
Alternatively, some contracts are upgradeable (ie., the smart contract code can be modified). In this case we may not have all of the ABIs. ABIs can be checked in the ABI column of the {blockchain}.contracts tables. A contract can always be resubmitted with missing ABIs so we can update our data.
106+
</details>
107+
108+
<details>
109+
<summary> **My submission got rejected, why?** </summary>
110+
<br>
111+
Submissions can be rejected for a number of reasons, including not following the naming conventions, not providing clear data at submission, etc. The particular reason for a contract submission being rejected can be found in account settings under “Contracts” by hovering the mouse over the “Rejected” status.
112+
</details>
144 KB
Loading
49.5 KB
Loading
148 KB
Loading
104 KB
Loading

0 commit comments

Comments
 (0)