Skip to content

Commit

Permalink
Add mode & sei to evms spells (#6515)
Browse files Browse the repository at this point in the history
  • Loading branch information
Synthquest authored Aug 7, 2024
1 parent 949b20a commit 00f0d04
Show file tree
Hide file tree
Showing 17 changed files with 97 additions and 34 deletions.
2 changes: 2 additions & 0 deletions dbt_subprojects/daily_spellbook/models/evms/evms_blocks.sql
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
, ('zkevm', source('zkevm', 'blocks'))
, ('blast', source('blast', 'blocks'))
, ('mantle', source('mantle', 'blocks'))
, ('mode', source('mode', 'blocks'))
, ('sei', source('sei', 'blocks'))
] %}

SELECT *
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
, ('zkevm', source('zkevm', 'contracts'))
, ('blast', source('blast', 'contracts'))
, ('mantle', source('mantle', 'contracts'))
, ('sei', source('sei', 'contracts'))
] %}

SELECT *
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
, ('zkevm', source('zkevm', 'creation_traces'))
, ('blast', source('blast', 'creation_traces'))
, ('mantle', source('mantle', 'creation_traces'))
, ('sei', source('sei', 'creation_traces'))
] %}

SELECT *
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
, ('zkevm', source('erc1155_zkevm', 'evt_ApprovalForAll'))
, ('blast', source('erc1155_blast', 'evt_ApprovalForAll'))
, ('mantle', source('erc1155_mantle', 'evt_ApprovalForAll'))
, ('sei', source('erc1155_sei', 'evt_ApprovalForAll'))
] %}

SELECT *
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
, ('zkevm', source('erc1155_zkevm', 'evt_transferbatch'))
, ('blast', source('erc1155_blast', 'evt_transferbatch'))
, ('mantle', source('erc1155_mantle', 'evt_transferbatch'))
, ('sei', source('erc1155_sei', 'evt_transferbatch'))
] %}

SELECT *
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
, ('zkevm', source('erc1155_zkevm', 'evt_transfersingle'))
, ('blast', source('erc1155_blast', 'evt_transfersingle'))
, ('mantle', source('erc1155_mantle', 'evt_transfersingle'))
, ('sei', source('erc1155_sei', 'evt_transfersingle'))
] %}

SELECT *
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
, ('zkevm', source('erc20_zkevm', 'evt_approval'))
, ('blast', source('erc20_blast', 'evt_approval'))
, ('mantle', source('erc20_mantle', 'evt_approval'))
, ('sei', source('erc20_sei', 'evt_Approval'))
] %}

SELECT *
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
, ('zkevm', source('erc20_zkevm', 'evt_transfer'))
, ('blast', source('erc20_blast', 'evt_transfer'))
, ('mantle', source('erc20_mantle', 'evt_transfer'))
, ('sei', source('erc20_sei', 'evt_transfer'))
] %}

SELECT *
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
, ('zkevm', source('erc721_zkevm', 'evt_Approval'))
, ('blast', source('erc721_blast', 'evt_Approval'))
, ('mantle', source('erc721_mantle', 'evt_Approval'))
, ('sei', source('erc721_sei', 'evt_Approval'))
] %}

SELECT *
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
, ('zkevm', source('erc721_zkevm', 'evt_ApprovalForAll'))
, ('blast', source('erc721_blast', 'evt_ApprovalForAll'))
, ('mantle', source('erc721_mantle', 'evt_ApprovalForAll'))
, ('sei', source('erc721_sei', 'evt_ApprovalForAll'))
] %}

SELECT *
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
, ('zkevm', source('erc721_zkevm', 'evt_transfer'))
, ('blast', source('erc721_blast', 'evt_transfer'))
, ('mantle', source('erc721_mantle', 'evt_transfer'))
, ('sei', source('erc721_sei', 'evt_transfer'))
] %}

SELECT *
Expand Down
2 changes: 2 additions & 0 deletions dbt_subprojects/daily_spellbook/models/evms/evms_logs.sql
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
, ('zkevm', source('zkevm', 'logs'))
, ('blast', source('blast', 'logs'))
, ('mantle', source('mantle', 'logs'))
, ('mode', source('mode', 'logs'))
, ('sei', source('sei', 'logs'))
] %}

SELECT *
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
, ('zkevm', source('zkevm', 'logs_decoded'))
, ('blast', source('blast', 'logs_decoded'))
, ('mantle', source('mantle', 'logs_decoded'))
, ('sei', source('sei', 'logs_decoded'))
] %}

SELECT *
Expand Down
66 changes: 33 additions & 33 deletions dbt_subprojects/daily_spellbook/models/evms/evms_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ version: 2
models:
- name: evms_transactions
meta:
blockchain: ethereum, polygon, bnb, avalanche_c, gnosis, fantom, optimism, arbitrum, celo, base, goerli, zksync, zora, scroll, linea, zkevm, blast, mantle
blockchain: ethereum, polygon, bnb, avalanche_c, gnosis, fantom, optimism, arbitrum, celo, base, goerli, zksync, zora, scroll, linea, zkevm, blast, mantle, mode, sei
sector: evms
contributors: hildobby
contributors: [hildobby, synthquest]
config:
tags: ['evms', 'transactions']
description: "An EVM transaction refers to an action initiated by an externally-owned account (i.e., an account managed by a human, not a contract)."
Expand Down Expand Up @@ -76,9 +76,9 @@ models:

- name: evms_traces
meta:
blockchain: ethereum, polygon, bnb, avalanche_c, gnosis, fantom, optimism, arbitrum, celo, base, goerli, zksync, zora, scroll, linea, zkevm, blast, mantle
blockchain: ethereum, polygon, bnb, avalanche_c, gnosis, fantom, optimism, arbitrum, celo, base, goerli, zksync, zora, scroll, linea, zkevm, blast, mantle, mode, sei
sector: evms
contributors: hildobby
contributors: [hildobby, synthquest]
config:
tags: ['evms', 'traces']
description: "An EVM trace is a small atomic action that modify the internal state of the Ethereum Virtual Machine. The three main trace types are call, create, and suicide."
Expand Down Expand Up @@ -127,9 +127,9 @@ models:

- name: evms_traces_decoded
meta:
blockchain: ethereum, polygon, bnb, avalanche_c, gnosis, fantom, optimism, arbitrum, celo, base, goerli, zksync, zora, scroll, linea, zkevm, blast, mantle
blockchain: ethereum, polygon, bnb, avalanche_c, gnosis, fantom, optimism, arbitrum, celo, base, goerli, zksync, zora, scroll, linea, zkevm, blast, mantle, sei
sector: evms
contributors: hildobby
contributors: [hildobby, synthquest]
config:
tags: ['evms', 'traces', 'decoded']
description: "An EVM trace is a small atomic action that modify the internal state of the Ethereum Virtual Machine. The three main trace types are call, create, and suicide. Decoded traces include additional information based on submitted smart contracts and their ABI"
Expand All @@ -153,9 +153,9 @@ models:

- name: evms_logs
meta:
blockchain: ethereum, polygon, bnb, avalanche_c, gnosis, fantom, optimism, arbitrum, celo, base, goerli, zksync, zora, scroll, linea, zkevm, blast, mantle
blockchain: ethereum, polygon, bnb, avalanche_c, gnosis, fantom, optimism, arbitrum, celo, base, goerli, zksync, zora, scroll, linea, zkevm, blast, mantle, mode, sei
sector: evms
contributors: hildobby
contributors: [hildobby, synthquest]
config:
tags: ['evms', 'logs']
description: "An EVM log can be used to describe an event within a smart contract, like a token transfer or a change of ownership."
Expand Down Expand Up @@ -183,9 +183,9 @@ models:

- name: evms_logs_decoded
meta:
blockchain: ethereum, polygon, bnb, avalanche_c, gnosis, fantom, optimism, arbitrum, celo, base, goerli, zksync, zora, scroll, linea, zkevm, blast, mantle
blockchain: ethereum, polygon, bnb, avalanche_c, gnosis, fantom, optimism, arbitrum, celo, base, goerli, zksync, zora, scroll, linea, zkevm, blast, mantle, sei
sector: evms
contributors: hildobby
contributors: [hildobby, synthquest]
config:
tags: ['evms', 'logs', 'decoded']
description: "An EVM log can be used to describe an event within a smart contract, like a token transfer or a change of ownership. Those logs are decoded based on submitted smart contracts to make them human readable."
Expand All @@ -209,9 +209,9 @@ models:

- name: evms_blocks
meta:
blockchain: ethereum, polygon, bnb, avalanche_c, gnosis, fantom, optimism, arbitrum, celo, base, goerli, zksync, zora, scroll, linea, zkevm, blast, mantle
blockchain: ethereum, polygon, bnb, avalanche_c, gnosis, fantom, optimism, arbitrum, celo, base, goerli, zksync, zora, scroll, linea, zkevm, blast, mantle, mode, sei
sector: evms
contributors: hildobby
contributors: [hildobby, synthquest]
config:
tags: ['evms', 'blocks']
description: "Blocks are batches of transactions with a hash of the previous block in the chain. This links blocks together (in a chain) because hashes are cryptographically derived from the block data."
Expand All @@ -232,9 +232,9 @@ models:

- name: evms_contracts
meta:
blockchain: ethereum, polygon, bnb, avalanche_c, gnosis, fantom, optimism, arbitrum, celo, base, goerli, zksync, zora, scroll, linea, zkevm, blast, mantle
blockchain: ethereum, polygon, bnb, avalanche_c, gnosis, fantom, optimism, arbitrum, celo, base, goerli, zksync, zora, scroll, linea, zkevm, blast, mantle, sei
sector: evms
contributors: hildobby
contributors: [hildobby, synthquest]
config:
tags: ['evms', 'contracts']
description: "A view keeping track of what contracts are decoded across EVM chains on Dune; contains information associated with the decoded contract such as namespace, name, address, ABI."
Expand Down Expand Up @@ -268,9 +268,9 @@ models:

- name: evms_creation_traces
meta:
blockchain: ethereum, polygon, bnb, avalanche_c, gnosis, fantom, optimism, arbitrum, celo, base, goerli, zksync, zora, scroll, linea, zkevm, blast, mantle
blockchain: ethereum, polygon, bnb, avalanche_c, gnosis, fantom, optimism, arbitrum, celo, base, goerli, zksync, zora, scroll, linea, zkevm, blast, mantle, sei
sector: evms
contributors: hildobby
contributors: [hildobby, synthquest]
config:
tags: ['evms', 'traces', 'creation', 'contracts']
description: "EVM chains creation traces"
Expand All @@ -288,9 +288,9 @@ models:

- name: evms_erc20_transfers
meta:
blockchain: ethereum, polygon, bnb, avalanche_c, gnosis, fantom, optimism, arbitrum, celo, base, goerli, zksync, zora, scroll, linea, zkevm, blast, mantle
blockchain: ethereum, polygon, bnb, avalanche_c, gnosis, fantom, optimism, arbitrum, celo, base, goerli, zksync, zora, scroll, linea, zkevm, blast, mantle, sei
sector: evms
contributors: hildobby
contributors: [hildobby, synthquest]
config:
tags: ['evms', 'erc20', 'transfers']
description: "Transfers events for ERC20 tokens on EVM chains."
Expand All @@ -317,9 +317,9 @@ models:

- name: evms_erc20_approvals
meta:
blockchain: ethereum, polygon, bnb, avalanche_c, gnosis, fantom, optimism, arbitrum, celo, base, goerli, zksync, zora, scroll, linea, zkevm, blast, mantle
blockchain: ethereum, polygon, bnb, avalanche_c, gnosis, fantom, optimism, arbitrum, celo, base, goerli, zksync, zora, scroll, linea, zkevm, blast, mantle, sei
sector: evms
contributors: hildobby
contributors: [hildobby, synthquest]
config:
tags: ['evms', 'erc20', 'approvals']
description: "Approval events for ERC20 tokens on EVM chains."
Expand All @@ -340,9 +340,9 @@ models:

- name: evms_erc1155_transferssingle
meta:
blockchain: ethereum, polygon, bnb, avalanche_c, gnosis, fantom, optimism, arbitrum, celo, base, goerli, zksync, zora, scroll, linea, zkevm, blast, mantle
blockchain: ethereum, polygon, bnb, avalanche_c, gnosis, fantom, optimism, arbitrum, celo, base, goerli, zksync, zora, scroll, linea, zkevm, blast, mantle, sei
sector: evms
contributors: hildobby
contributors: [hildobby, synthquest]
config:
tags: ['evms', 'erc1155', 'transfers', 'single']
description: "Single transfers events for ERC1155 tokens on EVM chains."
Expand All @@ -365,9 +365,9 @@ models:

- name: evms_erc1155_transfersbatch
meta:
blockchain: ethereum, polygon, bnb, avalanche_c, gnosis, fantom, optimism, arbitrum, celo, base, goerli, zksync, zora, scroll, linea, zkevm, blast, mantle
blockchain: ethereum, polygon, bnb, avalanche_c, gnosis, fantom, optimism, arbitrum, celo, base, goerli, zksync, zora, scroll, linea, zkevm, blast, mantle, sei
sector: evms
contributors: hildobby
contributors: [hildobby, synthquest]
config:
tags: ['evms', 'erc1155', 'transfers', 'batch']
description: "Batch transfers events for ERC1155 tokens on EVM chains."
Expand All @@ -390,9 +390,9 @@ models:

- name: evms_erc1155_approvalsforall
meta:
blockchain: ethereum, polygon, bnb, avalanche_c, gnosis, fantom, optimism, arbitrum, celo, base, goerli, zksync, zora, scroll, linea, zkevm, blast, mantle
blockchain: ethereum, polygon, bnb, avalanche_c, gnosis, fantom, optimism, arbitrum, celo, base, goerli, zksync, zora, scroll, linea, zkevm, blast, mantle, sei
sector: evms
contributors: hildobby
contributors: [hildobby, synthquest]
config:
tags: ['evms', 'erc1155', 'approvals']
description: "Approval for all events for ERC1155 tokens on EVM chains."
Expand All @@ -415,9 +415,9 @@ models:

- name: evms_erc721_transfers
meta:
blockchain: ethereum, polygon, bnb, avalanche_c, gnosis, fantom, optimism, arbitrum, celo, base, goerli, zksync, zora, scroll, linea, zkevm, blast, mantle
blockchain: ethereum, polygon, bnb, avalanche_c, gnosis, fantom, optimism, arbitrum, celo, base, goerli, zksync, zora, scroll, linea, zkevm, blast, mantle, sei
sector: evms
contributors: hildobby
contributors: [hildobby, synthquest]
config:
tags: ['evms', 'erc721', 'transfers']
description: "Transfers events for ERC721 tokens on EVM chains."
Expand All @@ -436,9 +436,9 @@ models:

- name: evms_erc721_approvals
meta:
blockchain: ethereum, polygon, bnb, avalanche_c, gnosis, fantom, optimism, arbitrum, celo, base, goerli, zksync, zora, scroll, linea, zkevm, blast, mantle
blockchain: ethereum, polygon, bnb, avalanche_c, gnosis, fantom, optimism, arbitrum, celo, base, goerli, zksync, zora, scroll, linea, zkevm, blast, mantle, sei
sector: evms
contributors: hildobby
contributors: [hildobby, synthquest]
config:
tags: ['evms', 'erc721', 'approvals']
description: "Approval events for ERC721 tokens on EVM chains."
Expand All @@ -459,9 +459,9 @@ models:

- name: evms_erc721_approvalsforall
meta:
blockchain: ethereum, polygon, bnb, avalanche_c, gnosis, fantom, optimism, arbitrum, celo, base, goerli, zksync, zora, scroll, linea, zkevm, blast, mantle
blockchain: ethereum, polygon, bnb, avalanche_c, gnosis, fantom, optimism, arbitrum, celo, base, goerli, zksync, zora, scroll, linea, zkevm, blast, mantle, sei
sector: evms
contributors: hildobby
contributors: [hildobby, synthquest]
config:
tags: ['evms', 'erc721', 'approvals']
description: "Approval for all events for ERC721 tokens on EVM chains."
Expand All @@ -479,7 +479,7 @@ models:

- name: evms_info
meta:
blockchain: ethereum, polygon, bnb, avalanche_c, gnosis, fantom, optimism, arbitrum, celo, base, goerli, zksync, zora, scroll, linea, zkevm, blast, mantle
blockchain: ethereum, polygon, bnb, avalanche_c, gnosis, fantom, optimism, arbitrum, celo, base, goerli, zksync, zora, scroll, linea, zkevm, blast, mantle, mode, sei
sector: evms
contributors: hildobby
config:
Expand Down
2 changes: 2 additions & 0 deletions dbt_subprojects/daily_spellbook/models/evms/evms_traces.sql
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
, ('zkevm', source('zkevm', 'traces'))
, ('blast', source('blast', 'traces'))
, ('mantle', source('mantle', 'traces'))
, ('mode', source('mode', 'traces'))
, ('sei', source('sei', 'traces'))
] %}

SELECT *
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
, ('zkevm', source('zkevm', 'traces_decoded'))
, ('blast', source('blast', 'traces_decoded'))
, ('mantle', source('mantle', 'traces_decoded'))
, ('sei', source('sei', 'traces_decoded'))
] %}

SELECT *
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
post_hook='{{ expose_spells(\'["ethereum", "polygon", "bnb", "avalanche_c", "gnosis", "fantom", "optimism", "arbitrum", "celo", "base", "goerli", "zksync", "zora", "scroll", "linea", "zkevm", "blast", "mantle"]\',
"sector",
"evms",
\'["hildobby"]\') }}'
\'["hildobby", "synthquest"]\') }}'
)
}}

Expand All @@ -29,6 +29,11 @@
, ('zkevm', source('zkevm', 'transactions'))
, ('blast', source('blast', 'transactions'))
, ('mantle', source('mantle', 'transactions'))
, ('sei', source('sei', 'transactions'))
] %}

{% set unstructured_transactions_models = [
('mode', source('mode', 'transactions'))
] %}

SELECT *
Expand Down Expand Up @@ -92,4 +97,44 @@ FROM (
{% endif %}
{% endfor %}

UNION ALL

{% for unstructured_transactions_models in unstructured_transactions_models %}
{% if unstructured_transactions_models[0] == 'mode' %}
SELECT
'{{ unstructured_transactions_models[0] }}' AS blockchain
, CAST(NULL AS array(row(address varbinary, storagekeys array(varbinary)))) AS access_list
, block_hash
, data
, "from"
, hash
, to
, block_number
, block_time
, gas_limit
, CAST(gas_price AS double) AS gas_price
, gas_used
, index
, max_fee_per_gas
, max_priority_fee_per_gas
, nonce
, priority_fee_per_gas
, success
, "type"
, CAST(value AS double) AS value
, l1_tx_origin
, l1_fee_scalar
, l1_block_number
, l1_fee
, l1_gas_price
, l1_gas_used
, l1_timestamp
, CAST(NULL AS DECIMAL(38,0)) AS effective_gas_price
{% endif %}
FROM {{ unstructured_transactions_models[1] }}
{% if not loop.last %}
UNION ALL
{% endif %}
{% endfor %}

);

0 comments on commit 00f0d04

Please sign in to comment.