From 52edd5d6ec4f15df70ec91762439866af398cb13 Mon Sep 17 00:00:00 2001 From: Peter <49856481+peterrliem@users.noreply.github.com> Date: Tue, 12 Nov 2024 08:45:41 +0700 Subject: [PATCH 1/7] Create tokens_abstract_base_transfers --- .../abstract/tokens_abstract_base_transfers | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 dbt_subprojects/tokens/models/transfers_and_balances/abstract/tokens_abstract_base_transfers diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/abstract/tokens_abstract_base_transfers b/dbt_subprojects/tokens/models/transfers_and_balances/abstract/tokens_abstract_base_transfers new file mode 100644 index 00000000000..7a503791f4f --- /dev/null +++ b/dbt_subprojects/tokens/models/transfers_and_balances/abstract/tokens_abstract_base_transfers @@ -0,0 +1,20 @@ +{{config( + schema = 'tokens_ronin', + alias = 'base_transfers', + partition_by = ['block_month'], + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], + unique_key = ['block_date','unique_key'], + ) + }} + + {{transfers_base( + blockchain='ronin', + traces = source('ronin','traces'), + transactions = source('ronin','transactions'), + erc20_transfers = source('erc20_ronin','evt_transfer'), + native_contract_address = null + ) + }} From 6a05a9e1f37ea7e846f5be9108c6924213487824 Mon Sep 17 00:00:00 2001 From: Peter <49856481+peterrliem@users.noreply.github.com> Date: Tue, 12 Nov 2024 08:48:16 +0700 Subject: [PATCH 2/7] Create tokens_abstract_transfers.sql --- .../abstract/tokens_abstract_transfers.sql | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 dbt_subprojects/tokens/models/transfers_and_balances/abstract/tokens_abstract_transfers.sql diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/abstract/tokens_abstract_transfers.sql b/dbt_subprojects/tokens/models/transfers_and_balances/abstract/tokens_abstract_transfers.sql new file mode 100644 index 00000000000..cfec6dc7ac7 --- /dev/null +++ b/dbt_subprojects/tokens/models/transfers_and_balances/abstract/tokens_abstract_transfers.sql @@ -0,0 +1,26 @@ +{{config( + schema = 'tokens_ronin', + alias = 'transfers', + partition_by = ['block_month'], + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['block_date','unique_key'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_date')], + post_hook='{{ expose_spells(\'["ronin"]\', + "sector", + "tokens", + \'["aalan3", "jeff-dude", "peterrliem"]\') }}' + ) + }} + + {{ + transfers_enrich( + base_transfers = ref('tokens_ronin_abstract_transfers') + , tokens_erc20_model = source('tokens', 'erc20') + , prices_model = source('prices', 'usd') + , evms_info_model = source('evms','info') + , transfers_start_date = '2021-01-24' + , blockchain = 'abstract' + ) + }} From c9b0b4a05cf5f70a7e091884b51dae4edd7643ef Mon Sep 17 00:00:00 2001 From: Peter <49856481+peterrliem@users.noreply.github.com> Date: Tue, 12 Nov 2024 09:07:28 +0700 Subject: [PATCH 3/7] Made changes --- .../abstract/tokens_abstract_base_transfers | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/abstract/tokens_abstract_base_transfers b/dbt_subprojects/tokens/models/transfers_and_balances/abstract/tokens_abstract_base_transfers index 7a503791f4f..f38eaaed3c7 100644 --- a/dbt_subprojects/tokens/models/transfers_and_balances/abstract/tokens_abstract_base_transfers +++ b/dbt_subprojects/tokens/models/transfers_and_balances/abstract/tokens_abstract_base_transfers @@ -1,5 +1,5 @@ {{config( - schema = 'tokens_ronin', + schema = 'tokens_abstract', alias = 'base_transfers', partition_by = ['block_month'], materialized = 'incremental', @@ -11,10 +11,10 @@ }} {{transfers_base( - blockchain='ronin', - traces = source('ronin','traces'), - transactions = source('ronin','transactions'), - erc20_transfers = source('erc20_ronin','evt_transfer'), + blockchain='abstract', + traces = source('abstract','traces'), + transactions = source('abstract','transactions'), + erc20_transfers = source('erc20_abstract','evt_transfer'), native_contract_address = null ) }} From 9b72f90d3f80668335ca738693529fa08179dcea Mon Sep 17 00:00:00 2001 From: Peter <49856481+peterrliem@users.noreply.github.com> Date: Tue, 12 Nov 2024 09:08:46 +0700 Subject: [PATCH 4/7] Made changes to titles --- .../abstract/tokens_abstract_transfers.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/abstract/tokens_abstract_transfers.sql b/dbt_subprojects/tokens/models/transfers_and_balances/abstract/tokens_abstract_transfers.sql index cfec6dc7ac7..265dce9a6ef 100644 --- a/dbt_subprojects/tokens/models/transfers_and_balances/abstract/tokens_abstract_transfers.sql +++ b/dbt_subprojects/tokens/models/transfers_and_balances/abstract/tokens_abstract_transfers.sql @@ -1,5 +1,5 @@ {{config( - schema = 'tokens_ronin', + schema = 'tokens_abstract', alias = 'transfers', partition_by = ['block_month'], materialized = 'incremental', @@ -7,7 +7,7 @@ incremental_strategy = 'merge', unique_key = ['block_date','unique_key'], incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_date')], - post_hook='{{ expose_spells(\'["ronin"]\', + post_hook='{{ expose_spells(\'["abstract"]\', "sector", "tokens", \'["aalan3", "jeff-dude", "peterrliem"]\') }}' @@ -16,7 +16,7 @@ {{ transfers_enrich( - base_transfers = ref('tokens_ronin_abstract_transfers') + base_transfers = ref('tokens_abstract_base_transfers') , tokens_erc20_model = source('tokens', 'erc20') , prices_model = source('prices', 'usd') , evms_info_model = source('evms','info') From df10408291c337e299b94957cf0eb1ad80e6a736 Mon Sep 17 00:00:00 2001 From: Peter <49856481+peterrliem@users.noreply.github.com> Date: Tue, 12 Nov 2024 09:15:13 +0700 Subject: [PATCH 5/7] Rename tokens_abstract_base_transfers to tokens_abstract_base_transfers.sql Changed file name --- ...abstract_base_transfers => tokens_abstract_base_transfers.sql} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename dbt_subprojects/tokens/models/transfers_and_balances/abstract/{tokens_abstract_base_transfers => tokens_abstract_base_transfers.sql} (100%) diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/abstract/tokens_abstract_base_transfers b/dbt_subprojects/tokens/models/transfers_and_balances/abstract/tokens_abstract_base_transfers.sql similarity index 100% rename from dbt_subprojects/tokens/models/transfers_and_balances/abstract/tokens_abstract_base_transfers rename to dbt_subprojects/tokens/models/transfers_and_balances/abstract/tokens_abstract_base_transfers.sql From 775a3e38d0639d517b99555ca6145fcd724c0785 Mon Sep 17 00:00:00 2001 From: Huang Geyang Date: Sun, 17 Nov 2024 17:15:50 +0800 Subject: [PATCH 6/7] Add abstract_base_sources --- .../evm/abstract_base_sources.yml | 446 ++++++++++++++++++ .../_base_sources/evm/abstract_docs_block.md | 221 +++++++++ 2 files changed, 667 insertions(+) create mode 100644 sources/_base_sources/evm/abstract_base_sources.yml create mode 100644 sources/_base_sources/evm/abstract_docs_block.md diff --git a/sources/_base_sources/evm/abstract_base_sources.yml b/sources/_base_sources/evm/abstract_base_sources.yml new file mode 100644 index 00000000000..3c1515e0d09 --- /dev/null +++ b/sources/_base_sources/evm/abstract_base_sources.yml @@ -0,0 +1,446 @@ +version: 2 + +sources: + # abstract Tables + - name: abstract + description: "raw tables for the chain" + + tables: + - name: transactions + meta: + docs_slug: /evm/abstract/raw/transactions + short_description: The transactions table contains detailed information about transactions on the network. + description: '{{ doc("abstract_transactions_doc") }}' + + columns: + - &block_date + name: block_date + description: "The UTC date of the block in which this transaction was included" + - &block_time + name: block_time + description: "The exact UTC timestamp when the block containing this transaction was added to the chain" + - &value + name: value + description: "Amount of ETH sent from sender to recipient (if any), measured in wei (1 ETH = 10^18 wei)" + - &block_number + name: block_number + description: "The sequential number of the block containing this transaction" + - name: gas_limit + description: "Maximum number of gas units this transaction can consume" + - name: gas_price + description: "Price per unit of gas for this transaction, denominated in wei (1 gwei = 10^9 wei)" + - name: gas_used + description: "Actual amount of gas units consumed by this transaction's execution" + - name: max_fee_per_gas + description: "Maximum total amount per gas unit the initiator is willing to pay, including abstract fee and priority fee" + - name: max_priority_fee_per_gas + description: "Maximum additional fee per gas unit the initiator is willing to pay as a tip to validators" + - name: base_fee_per_gas + description: "Minimum fee per gas unit required for transaction inclusion" + - name: nonce + description: "Sequential number representing the count of transactions sent from the sender's address" + - name: index + description: "Position of this transaction within its containing block" + - &success + name: success + description: "Boolean flag indicating whether the transaction executed successfully (true) or failed (false)" + - &from + name: from + description: "Address of the account that initiated and signed this transaction" + - &to + name: to + description: "Address of the recipient account or contract for this transaction" + - &block_hash + name: block_hash + description: "Unique 256-bit identifier (hash) of the block containing this transaction" + - name: data + description: "Input data for the transaction, which may include function calls or contract interaction data" + - name: hash + description: "Unique 256-bit identifier (hash) of this specific transaction" + - name: type + description: "Type of transaction (e.g., legacy, EIP-1559) indicating its structure and fee mechanism" + - name: access_list + description: "List of addresses and storage keys the transaction plans to access, used for gas optimization in EIP-2930 transactions" + - name: effective_gas_price + description: "Actual price per gas unit paid for this transaction, calculated post-execution" + - name: l1_block_number + description: "Block number on the L1 where this L2 transaction was batch submitted (may be deprecated in abstract)" + - name: l1_fee + description: "L1 Fees that the network pays to submit L2 transactions to Ethereum L1 " + - name: l1_fee_scalar + description: "Scalar value used to calculate L1 fee, covering potential changes in L1 gas price and network costs" + - name: l1_gas_price + description: "Gas price on the L1 at the time of L2 transaction submission" + - name: l1_gas_used + description: "The gas used on Ethereum L1 to publish this L2 transaction" + - name: l1_timestamp + description: "The timestamp when the L2 transaction was batched and confirmed on the L1" + - name: l1_tx_origin + description: "L1 transaction origin address for L2 transactions that were initiated on L1" + + - name: traces + meta: + docs_slug: /evm/abstract/raw/traces + short_description: The traces table contains information about traces on the network. + description: '{{ doc("abstract_traces_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *value + - name: gas + description: "Amount of gas allocated for this trace's execution (including gas used by child traces)" + - name: gas_used + description: "Actual amount of gas consumed by this trace's execution" + - *block_hash + - name: success + description: "Boolean flag indicating whether this specific trace was executed successfully (true) or reverted (false)" + - &tx_index + name: tx_index + description: "Position of the parent transaction within its containing block" + - name: subtraces + description: "Number of child traces spawned by this trace during execution" + - name: error + description: "Error message or code if the trace execution failed" + - name: tx_success + description: "Boolean flag indicating whether the parent transaction of this trace was successful" + - &tx_hash + name: tx_hash + description: "Unique 256-bit identifier (hash) of the parent transaction" + - name: from + description: "address that sent this trace" + - name: to + description: "address that received this trace" + - name: trace_address + description: "Array indicating the exact position of this trace within the trace tree of the transaction" + - name: type + description: "Type of trace (e.g., call, create, suicide) indicating the nature of the operation" + - name: address + description: "If this trace is a contract creation, this is the address of the deployed contract" + - name: code + description: "If this trace is a contract creation, this is the deployed bytecode of contract" + - name: call_type + description: "Type of call made in this trace (e.g., call, delegatecall, staticcall)" + - name: input + description: "call data provided to this trace, often containing function signatures and parameters" + - name: output + description: "Data returned by this trace after execution" + - name: refund_address + description: "address designated to receive any gas refund from this trace" + + - name: traces_decoded + meta: + docs_slug: /evm/abstract/decoded/traces_decoded + short_description: The `abstract.traces_decoded` table contains decoded traces, including additional information on submitted smart contracts and their ABIs. + description: '{{ doc("abstract_traces_decoded_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *tx_hash + - name: contract_name + description: "Human-readable name of the smart contract involved in this trace" + - name: function_name + description: "Name of the specific contract function called in this trace" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: signature + description: "8 byte function signature used to identify the function" + - name: to + description: "address of the contract or account receiving this trace" + - name: trace_address + description: "Array indicating the exact position of this trace within the trace tree of the transaction" + + - name: logs + meta: + docs_slug: /evm/abstract/raw/logs + short_description: The `abstract.logs` table contains information about event logs emitted by smart contracts on the abstract blockchain. + description: '{{ doc("abstract_logs_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *block_hash + - *tx_index + - *tx_hash + - name: contract_address + description: "Address of the smart contract that emitted this log" + - name: topic0 + description: "First 32-byte topic, typically containing the event signature hash" + - name: topic1 + description: "Second 32-byte topic, often containing indexed event parameters" + - name: topic2 + description: "Third 32-byte topic, often containing indexed event parameters" + - name: topic3 + description: "Fourth 32-byte topic, often containing indexed event parameters" + - name: data + description: "ABI-encoded data of the log, containing non-indexed event parameters" + - name: index + description: "Position of this log within the block" + + - name: logs_decoded + meta: + docs_slug: /evm/abstract/decoded/logs_decoded + short_description: The `abstract.logs_decoded` table contains a subset of all logs for which Dune has the ABI. + description: '{{ doc("abstract_logs_decoded_doc") }}' + columns: + - *block_date + - *block_time + - *block_number + - *tx_hash + - name: index + description: "Position of this log within the block" + - name: contract_address + description: "Address of the smart contract that emitted this log" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: contract_name + description: "name of the smart contract that emitted this log" + - name: event_name + description: "Name of the event emitted in this log" + - name: signature + description: "Topic0 hash of the event signature" + + - name: blocks + meta: + docs_slug: /evm/abstract/raw/blocks + short_description: The `abstract.blocks` table contains information about abstract blocks. Each row represents a single block. + description: '{{ doc("abstract_blocks_doc") }}' + columns: + - name: base_fee_per_gas + description: "Minimum fee per gas unit required for transaction inclusion in this block in the abstract unit wei" + - name: difficulty + description: "Measure of how difficult it was to produce this block (deprecated in abstract)" + - name: total_difficulty + description: "Total chain difficulty up to this block (deprecated in abstract)" + - name: gas_limit + description: "Maximum amount of gas that can be used by all transactions in this block" + - name: gas_used + description: "Total amount of gas actually consumed by all transactions in this block" + - name: hash + description: "Unique 256-bit identifier (hash) of this block" + - name: miner + description: "Address of the sequencer who produced this block (currently just one sequencer)" + - name: nonce + description: "A block's nonce value, used in the consensus mechanism (may be deprecated in abstract)" + - name: number + description: "Sequential position of this block in the blockchain" + - name: parent_hash + description: "Hash of the previous block in the blockchain" + - name: size + description: "Size of this block in bytes" + - name: time + description: "Timestamp when this block was added to the chain" + - name: blob_gas_used + description: "The total amount of blob gas consumed by transactions in the block (not in use for abstract)" + - name: excess_blob_gas + description: "A running total of blob gas consumed in excess of the target, prior to the block. This is used to set blob gas pricing(not in use for abstract)." + + + - name: contracts + meta: + docs_slug: /evm/abstract/raw/contracts + short_description: The `abstract.contracts` table tracks decoded contracts on abstract, including associated metadata such as namespace, name, address, ABI. It is populated manually by the Dune Community via [contract decoding submissions](https://dune.com/contracts/new). + description: '{{ doc("abstract_contracts_doc") }}' + columns: + - name: abi_id + description: "Unique identifier for the contract's ABI. This is used to identify the contract across all chains." + - name: abi + description: "JSON representation of the contract's Application Binary Interface (ABI)" + - name: address + description: "Address of the deployed contract" + - name: from + description: "Address that deployed this contract. Can be a contract or EOA." + - name: code + description: "Bytecode of the contract at the time of creation" + - name: name + description: "Name assigned to the contract" + - name: namespace + description: "Categorical grouping or project name associated with the contract" + - name: dynamic + description: "Boolean indicating if this contract was submitted to Dune with the 'dynamic' flag enabled. If yes, our decoder will search for exact matches of the contract's bytecode and decode them into the same namespace as the initial contract." + - name: abstract + description: "Boolean indicating if this is a manual individual submission of a contract." + - name: factory + description: "Boolean indicating if this submission was submitted to Dune with the 'factory' flag enabled. If yes, our decoder will search for contract's deployed by the same factory and decode them into the same namespace as the initial contract." + - name: detection_source + description: "Method used to detect and decode this contract: 'factory', 'abstract', or 'dynamic'. " + - name: created_at + description: "Timestamp of when this contract was first decoded on Dune. This is not the contract creation timestamp." + + - name: creation_traces + meta: + docs_slug: /evm/abstract/raw/creation_traces + short_description: The `abstract.creation_traces` table contains information about contract creation traces on the abstract blockchain. It includes details about newly created contracts, their creators, and the contract code. + description: '{{ doc("abstract_creation_traces_doc") }}' + columns: + - *block_time + - *block_number + - *tx_hash + - name: address + description: "Address of the contract created" + - name: from + description: "Address that created this contract. Can be a contract or EOA." + - name: code + description: "Deployed bytecode of the contract" + + # ERC Transfer Tables + - name: erc20_abstract + description: "Transfer events for ERC20 tokens on abstract" + tables: + - name: evt_transfer + meta: + docs_slug: /evm/abstract/decoded/interfaces/erc20/evt_transfer + short_description: This table contains individual transfer events for ERC20 tokens on the abstract blockchain. Each row represents a single token transfer event. + description: '{{ doc("erc20_abstract_evt_transfer_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC20 token contract that emitted this event" + - &evt_tx_hash + name: evt_tx_hash + description: "Hash of the transaction containing this event" + - &evt_index + name: evt_index + description: "Index position of this event within the transaction" + - &evt_block_time + name: evt_block_time + description: "Timestamp of the block containing this event" + - &evt_block_number + name: evt_block_number + description: "The block number containing this event" + - *from + - *to + - name: value + description: "Amount of ERC20 tokens transferred, in the token's abstract unit" + + - name: evt_approval + meta: + docs_slug: /evm/abstract/decoded/interfaces/erc20/evt_approval + short_description: The `abstract.evt_approval` table contains approval events for ERC20 tokens on abstract, allowing an address to spend tokens on behalf of the owner. + description: '{{ doc("erc20_abstract_evt_approval_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC20 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: owner + description: "address of the token owner granting approval" + - name: spender + description: "address being granted permission to spend tokens" + - name: value + description: "Amount of ERC20 tokens approved for spending, in the token's smallest unit" + + - name: erc1155_abstract + description: "events related to ERC1155 tokens" + tables: + - name: evt_transfersingle + meta: + docs_slug: /evm/abstract/decoded/interfaces/erc1155/evt_transfersingle + short_description: This table contains single transfer events for ERC1155 tokens on the network. + description: '{{ doc("erc1155_abstract_evt_transfersingle_doc") }}' + columns: + - name: contract_address + description: "address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: operator + description: "the address that is authorized to execute the transfer on behalf of the owner" + - *from + - *to + - name: id + description: "Unique identifier of the ERC1155 token being transferred" + - name: value + description: "Quantity of the ERC1155 token transferred" + - name: evt_transferbatch + meta: + docs_slug: /evm/abstract/decoded/interfaces/erc1155/evt_transferbatch + short_description: This table contains all batch transfer events for ERC1155 tokens on the network. + description: '{{ doc("erc1155_abstract_evt_transferbatch_doc") }}' + columns: + - name: contract_address + description: "Contract address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - name: operator + description: "Contract address authorized to execute the batch transfer on behalf of the owner" + - *from + - *to + - name: ids + description: "Array of unique identifiers of the ERC1155 tokens being transferred" + - name: values + description: "Array of quantities for each ERC1155 token transferred, corresponding to the ids array" + - name: evt_ApprovalForAll + meta: + docs_slug: /evm/abstract/decoded/interfaces/erc1155/evt_ApprovalForAll + short_description: This table contains approval events for all tokens of an ERC1155 contract on this network. + description: '{{ doc("erc1155_abstract_evt_ApprovalForAll_doc") }}' + columns: + - name: contract_address + description: "abstract address of the ERC1155 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - &approved + name: approved + description: "Boolean indicating whether approval is granted (true) or revoked (false)" + - &owner + name: owner + description: "abstract address of the token owner granting or revoking approval" + - name: operator + description: "abstract address being granted or revoked permission to operate all tokens" + + - name: erc721_abstract + description: '{{ doc("erc721_abstract_evt_transfer_doc") }}' + tables: + - name: evt_transfer + description: "Transfer events for ERC721 tokens on this network" + columns: + - name: contract_address + description: "Contract address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *from + - *to + - name: tokenId + description: "Unique identifier of the ERC721 token (NFT) being transferred" + - name: evt_Approval + meta: + docs_slug: /evm/abstract/decoded/interfaces/erc721/evt_Approval + short_description: "Approval events for ERC721 tokens on this network" + description: '{{ doc("erc721_abstract_evt_Approval_doc") }}' + columns: + - name: contract_address + description: "Contract address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *approved + - *owner + - name: tokenId + description: "Unique identifier of the ERC721 token (NFT) for which approval is granted or revoked" + - name: evt_ApprovalForAll + meta: + docs_slug: /evm/abstract/decoded/interfaces/erc721/evt_ApprovalForAll + short_description: The `abstract.evt_ApprovalForAll` table contains approval events for all tokens of an ERC721 contract on the abstract blockchain. + description: '{{ doc("erc721_abstract_evt_ApprovalForAll_doc") }}' + columns: + - name: contract_address + description: "Address of the ERC721 token contract" + - *evt_tx_hash + - *evt_index + - *evt_block_time + - *evt_block_number + - *approved + - *owner + - name: operator + description: "The address being granted or revoked permission to operate all tokens" diff --git a/sources/_base_sources/evm/abstract_docs_block.md b/sources/_base_sources/evm/abstract_docs_block.md new file mode 100644 index 00000000000..7d2fdfba4f2 --- /dev/null +++ b/sources/_base_sources/evm/abstract_docs_block.md @@ -0,0 +1,221 @@ +{% docs abstract_transactions_doc %} + +The `abstract.transactions` table contains detailed information about transactions on the abstract blockchain. It includes: + +- Block information: number, timestamp, hash +- Transaction details: hash, from_address, to_address, value +- Gas data: gas_price, gas_limit, gas_used +- Status: success or failure +- Input data for contract interactions +- Nonce +- Transaction type + +This table is used for analyzing transaction patterns, gas usage, value transfers, and overall network activity on abstract. + +{% enddocs %} + +{% docs abstract_traces_doc %} + +The `abstract.traces` table contains records of execution steps for transactions on the abstract blockchain. Each trace represents an atomic operation that modifies the state of the Ethereum Virtual Machine (EVM). Key components include: + +- Transaction hash +- Block number and timestamp +- From and to addresses +- Value transferred +- Input data +- Gas used +- Error information (if applicable) + +This table is used for analyzing transaction execution paths, internal contract calls, and state changes within the abstract network. + +{% enddocs %} + +{% docs abstract_traces_decoded_doc %} + +The `abstract.traces_decoded` table contains a subset of decoded traces from the abstract blockchain dependent on submitted smart contracts and their ABIs. It includes: + +- All fields from the `abstract.traces` table +- Decoded function names and signature (first four bytes of the calldata) +- the contract name and schema name we have decoded the function call to + +This table is used for high level analysis of smart contract interactions. For fully decoded function calls and parameters, refer to decoded tables such as `uniswap_v3_abstract.UniswapV3Pool_call_Swap`. + +{% enddocs %} + +{% docs abstract_logs_doc %} + +The `abstract.logs` table contains event logs emitted by smart contracts on the abstract blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Topic hashes +- Raw data + +This table is used for tracking contract events and state changes on the abstract network. + +{% enddocs %} + +{% docs abstract_logs_decoded_doc %} + +The `abstract.logs_decoded` table contains a subset of decoded logs from the abstract blockchain dependent on submitted smart contracts and their ABIs. It includes: + +- All fields from the `abstract.logs` table +- Decoded event names and signature (topic0 of the log) +- the contract name and schema name we have decoded the event to + +This table is used for high level analysis of smart contract events. For fully decoded events and parameters, refer to decoded tables such as `erc20_abstract.UniswapV3Pool_evt_Swap`. + +{% enddocs %} + +{% docs abstract_blocks_doc %} + +The `abstract.blocks` table contains information about abstract blocks. It provides essential data about each block in the abstract blockchain, including timestamps, gas metrics, and block identifiers. This table is fundamental for analyzing blockchain structure, block production rates, and overall network performance. + +{% enddocs %} + +{% docs abstract_contracts_doc %} + +The `abstract.contracts` table tracks all contracts that have been submitted to Dune for decoding. It includes: + +- metadata about the contract, including its name and namespace +- the contract address + +{% enddocs %} + +{% docs abstract_creation_traces_doc %} + +The `abstract.creation_traces` table contains data about contract creation events on the abstract blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Creator's address +- Created contract address +- deployed contract bytecode +- Gas used for deployment + +This table is used for analyzing contract deployment patterns and tracking the origin of smart contracts on the abstract network. It's essentially a filtered version of the `abstract.traces` table for the condition that `type = create`. + +{% enddocs %} + +{% docs erc20_abstract_evt_transfer_doc %} + +The `erc20_abstract.evt_transfer` table contains Transfer events for ERC20 tokens on the abstract blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- From and to addresses +- Amount transferred + +This table is used for tracking ERC20 token movements on the abstract network. + +Please be aware that this table is the raw ERC20 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `tokens.transfers` for a more complete and curated view of token transfers. + +{% enddocs %} + +{% docs erc20_abstract_evt_approval_doc %} + +The `erc20_abstract.evt_approval` table contains Approval events for ERC20 tokens on the abstract blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and spender addresses +- Approved amount + +This table is used for analyzing ERC20 token approvals and spending permissions on the abstract network. + +{% enddocs %} + +{% docs erc1155_abstract_evt_transfersingle_doc %} + +The `erc1155_abstract.evt_transfersingle` table contains TransferSingle events for ERC1155 tokens on the abstract blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Operator, from, and to addresses +- Token ID +- Amount transferred + +This table is used for tracking individual ERC1155 token transfers on the abstract network. + +Please be aware that this table is the raw ERC1155 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `nft.transfers` for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc1155_abstract_evt_transferbatch_doc %} + +The `erc1155_abstract.evt_transferbatch` table contains TransferBatch events for ERC1155 tokens on the abstract blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Operator, from, and to addresses +- Array of token IDs +- Array of amounts transferred + +This table is used for tracking batch transfers of multiple ERC1155 tokens on the abstract network. + +Please be aware that this table is the raw ERC1155 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use nft.transfers for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc1155_abstract_evt_ApprovalForAll_doc %} + +The `erc1155_abstract.evt_ApprovalForAll` table contains ApprovalForAll events for ERC1155 tokens on the abstract blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Account and operator addresses +- Approved status (boolean) + +This table is used for analyzing blanket approvals for ERC1155 token collections on the abstract network. + +{% enddocs %} + +{% docs erc721_abstract_evt_transfer_doc %} + +The `erc721_abstract.evt_transfer` table contains Transfer events for ERC721 tokens on the abstract blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- From and to addresses +- Token ID + +This table is used for tracking ERC721 token (NFT) transfers on the abstract network. + +Please be aware that this table is the raw ERC721 event data, and does not include any additional metadata, context or is in any way filtered or curated. Use `nft.transfers` for a more complete and curated view of NFT transfers. + +{% enddocs %} + +{% docs erc721_abstract_evt_Approval_doc %} + +The `erc721_abstract.evt_Approval` table contains Approval events for ERC721 tokens on the abstract blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and approved addresses +- Token ID + +This table is used for analyzing approvals for individual ERC721 tokens (NFTs) on the abstract network. + +{% enddocs %} + +{% docs erc721_abstract_evt_ApprovalForAll_doc %} + +The `erc721_abstract.evt_ApprovalForAll` table contains ApprovalForAll events for ERC721 tokens on the abstract blockchain. It includes: + +- Block number and timestamp +- Transaction hash +- Contract address +- Owner and operator addresses +- Approved status (boolean) + +This table is used for analyzing blanket approvals for ERC721 token collections on the abstract network. + +{% enddocs %} From c49d8a055ef465d4dd00c35e2b02011b7ac0c359 Mon Sep 17 00:00:00 2001 From: Huang Geyang Date: Sun, 17 Nov 2024 17:18:35 +0800 Subject: [PATCH 7/7] Add schema --- .../abstract/_schema.yml | 106 ++++++++++++++++++ .../tokens_transfers.sql | 3 +- 2 files changed, 108 insertions(+), 1 deletion(-) create mode 100644 dbt_subprojects/tokens/models/transfers_and_balances/abstract/_schema.yml diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/abstract/_schema.yml b/dbt_subprojects/tokens/models/transfers_and_balances/abstract/_schema.yml new file mode 100644 index 00000000000..c402ee095bf --- /dev/null +++ b/dbt_subprojects/tokens/models/transfers_and_balances/abstract/_schema.yml @@ -0,0 +1,106 @@ +version: 2 + +models: + - name: tokens_abstract_base_transfers + meta: + blockchain: abstract + sector: tokens + contributors: aalan3, jeff-dude, peterrliem, hosuke + config: + tags: ['tokens','transfers', 'abstract'] + description: > + Token transfers + data_tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - block_date + - unique_key + columns: + - name: unique_key + description: "Surrogate key to identify unique row" + - name: blockchain + description: "The blockchain of the transfers" + - name: block_date + description: "The date of the block" + - name: block_time + description: "The time of the block" + - name: block_number + description: "The block number" + - name: tx_hash + description: "The transaction hash" + - name: evt_index + description: "The log event index of the transfer if any" + - name: trace_address + description: "The trace address of the transfer if any" + - name: token_standard + description: "The token standard of the transfer" + - name: tx_from + description: "The transaction sender" + - name: tx_to + description: "The transaction receiver" + - name: tx_index + description: "The transaction index" + - name: from + description: "The sender of the transfer" + - name: to + description: "The receiver of the transfer" + - name: contract_address + description: "The contract address of the transfer" + - name: amount_raw + description: "The raw amount of the transfer" + + - name: tokens_abstract_transfers + meta: + blockchain: abstract + sector: tokens + contributors: aalan3, jeff-dude, peterrliem, hosuke + config: + tags: ['tokens','transfers', 'abstract'] + description: > + Token transfers + data_tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - block_date + - unique_key + columns: + - name: unique_key + description: "Surrogate key to identify unique row" + - name: blockchain + description: "The blockchain of the transfers" + - name: block_date + description: "The date of the block" + - name: block_time + description: "The time of the block" + - name: block_number + description: "The block number" + - name: tx_hash + description: "The transaction hash" + - name: evt_index + description: "The log event index of the transfer if any" + - name: trace_address + description: "The trace address of the transfer if any" + - name: token_standard + description: "The token standard of the transfer" + - name: tx_from + description: "The transaction sender" + - name: tx_to + description: "The transaction receiver" + - name: tx_index + description: "The transaction index" + - name: from + description: "The sender of the transfer" + - name: to + description: "The receiver of the transfer" + - name: contract_address + description: "The contract address of the transfer" + - name: symbol + description: "The token symbol transferred" + - name: amount_raw + description: "The raw amount of the transfer" + - name: amount + description: "The formatted amount of the transfer" + - name: price_usd + description: "The USD price used to calculate the amount_usd" + - name: amount_usd + description: "The USD amount of the transfer" diff --git a/dbt_subprojects/tokens/models/transfers_and_balances/tokens_transfers.sql b/dbt_subprojects/tokens/models/transfers_and_balances/tokens_transfers.sql index cce05e8ac9d..c757f595346 100644 --- a/dbt_subprojects/tokens/models/transfers_and_balances/tokens_transfers.sql +++ b/dbt_subprojects/tokens/models/transfers_and_balances/tokens_transfers.sql @@ -28,7 +28,8 @@ }} {% set chains = [ - 'arbitrum' + 'abstract' + ,'arbitrum' ,'avalanche_c' ,'base' ,'blast'