Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add in burned event #5759

Merged
merged 7 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ SELECT
MAX(token) AS token,
MAX(fee_token) AS fee_token,
MAX(destination_selector) AS destination_selector,
MAX(destination_blockchain) AS destination_blockchain
MAX(destination_blockchain) AS destination_blockchain,
MAX(tx_hash) AS tx_hash
FROM
combined_logs
GROUP BY
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{{
config(
schema='chainlink_arbitrum',
alias='ccip_tokens_transferred_logs',
materialized='incremental',
file_format='delta',
incremental_strategy='merge',
unique_key=['blockchain', 'tx_hash', 'index']
)
}}

{% set project_start_date = '2023-07-06' %}

SELECT
'arbitrum' as blockchain,
block_hash,
contract_address,
data,
topic0,
topic1,
topic2,
topic3,
tx_hash,
block_number,
block_time,
index,
tx_index,
tx_from,
bytearray_to_uint256(bytearray_substring(data, 1, 32)) as total_tokens
FROM
{{ source('arbitrum', 'logs') }} logs
WHERE
topic0 = 0x9f1ec8c880f76798e7b793325d625e9b60e4082a553c98f42b6cda368dd60008 -- Locked
jeff-dude marked this conversation as resolved.
Show resolved Hide resolved
AND block_time >= TIMESTAMP '{{project_start_date}}'
{% if is_incremental() %}
AND {{ incremental_predicate('block_time') }}
{% endif %}
UNION ALL
SELECT
'arbitrum' as blockchain,
block_hash,
contract_address,
data,
topic0,
topic1,
topic2,
topic3,
tx_hash,
block_number,
block_time,
index,
tx_index,
tx_from,
bytearray_to_uint256(bytearray_substring(data, 1, 32)) as total_tokens
FROM
{{ source('arbitrum', 'logs') }} logs
WHERE
topic0 = 0x696de425f79f4a40bc6d2122ca50507f0efbeabbff86a84871b7196ab8ea8df7 -- Burned(address,uint256)
AND block_time >= TIMESTAMP '{{project_start_date}}'
{% if is_incremental() %}
AND {{ incremental_predicate('block_time') }}
{% endif %}
13 changes: 10 additions & 3 deletions models/chainlink/arbitrum/chainlink_arbitrum_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1105,6 +1105,7 @@ models:
- &destination_chain_selector
name: destination_chain_selector
description: "Destination Chain Selector"
- *tx_hash

- name: chainlink_arbitrum_ccip_send_requested_daily
meta:
Expand Down Expand Up @@ -1168,15 +1169,21 @@ models:
name: trace_address
description: "Trace Address"

- name: chainlink_arbitrum_ccip_tokens_locked_logs
- name: chainlink_arbitrum_ccip_tokens_transferred_logs
meta:
blockchain: "arbitrum"
project: chainlink
contributors: ["linkpool_jon"]
config:
tags: ["chainlink", "ccip", "tokens", "locked", "logs", "arbitrum"]
tags: ["chainlink", "ccip", "tokens", "transferred", "logs", "arbitrum"]
description: >
Chainlink CCIP Tokens Locked Logs
Chainlink CCIP Tokens Transferred Logs
tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- blockchain
- tx_hash
- index
columns:
- *blockchain
- *block_hash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ SELECT
MAX(token) AS token,
MAX(fee_token) AS fee_token,
MAX(destination_selector) AS destination_selector,
MAX(destination_blockchain) AS destination_blockchain
MAX(destination_blockchain) AS destination_blockchain,
MAX(tx_hash) AS tx_hash
FROM
combined_logs
GROUP BY
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{{
config(
schema='chainlink_avalanche_c',
alias='ccip_tokens_transferred_logs',
materialized='incremental',
file_format='delta',
incremental_strategy='merge',
unique_key=['blockchain', 'tx_hash', 'index']
)
}}

{% set project_start_date = '2023-07-06' %}

SELECT
'avalanche_c' as blockchain,
block_hash,
contract_address,
data,
topic0,
topic1,
topic2,
topic3,
tx_hash,
block_number,
block_time,
index,
tx_index,
tx_from,
bytearray_to_uint256(bytearray_substring(data, 1, 32)) as total_tokens
FROM
{{ source('avalanche_c', 'logs') }} logs
WHERE
topic0 = 0x9f1ec8c880f76798e7b793325d625e9b60e4082a553c98f42b6cda368dd60008 -- Locked
AND block_time >= TIMESTAMP '{{project_start_date}}'
{% if is_incremental() %}
AND {{ incremental_predicate('block_time') }}
{% endif %}
UNION ALL
SELECT
'avalanche_c' as blockchain,
block_hash,
contract_address,
data,
topic0,
topic1,
topic2,
topic3,
tx_hash,
block_number,
block_time,
index,
tx_index,
tx_from,
bytearray_to_uint256(bytearray_substring(data, 1, 32)) as total_tokens
FROM
{{ source('avalanche_c', 'logs') }} logs
WHERE
topic0 = 0x696de425f79f4a40bc6d2122ca50507f0efbeabbff86a84871b7196ab8ea8df7 -- Burned(address,uint256)
AND block_time >= TIMESTAMP '{{project_start_date}}'
{% if is_incremental() %}
AND {{ incremental_predicate('block_time') }}
{% endif %}
14 changes: 11 additions & 3 deletions models/chainlink/avalanche_c/chainlink_avalanche_c_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1337,6 +1337,7 @@ models:
- &destination_chain_selector
name: destination_chain_selector
description: "Destination Chain Selector"
- *tx_hash

- name: chainlink_avalanche_c_ccip_send_requested_daily
meta:
Expand Down Expand Up @@ -1400,15 +1401,22 @@ models:
name: trace_address
description: "Trace Address"

- name: chainlink_avalanche_c_ccip_tokens_locked_logs
- name: chainlink_avalanche_c_ccip_tokens_transferred_logs
meta:
blockchain: "avalanche_c"
project: chainlink
contributors: ["linkpool_jon"]
config:
tags: ["chainlink", "ccip", "tokens", "locked", "logs", "avalanche_c"]
tags:
["chainlink", "ccip", "tokens", "transferred", "logs", "avalanche_c"]
description: >
Chainlink CCIP Tokens Locked Logs
Chainlink CCIP Tokens Transferred Logs
tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- blockchain
- tx_hash
- index
columns:
- *blockchain
- *block_hash
Expand Down
3 changes: 2 additions & 1 deletion models/chainlink/base/chainlink_base_ccip_send_requested.sql
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ SELECT
MAX(token) AS token,
MAX(fee_token) AS fee_token,
MAX(destination_selector) AS destination_selector,
MAX(destination_blockchain) AS destination_blockchain
MAX(destination_blockchain) AS destination_blockchain,
MAX(tx_hash) AS tx_hash
FROM
combined_logs
GROUP BY
Expand Down
28 changes: 0 additions & 28 deletions models/chainlink/base/chainlink_base_ccip_tokens_locked_logs.sql

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{{
config(
schema='chainlink_base',
alias='ccip_tokens_transferred_logs',
materialized='incremental',
file_format='delta',
incremental_strategy='merge',
unique_key=['blockchain', 'tx_hash', 'index']
)
}}

{% set project_start_date = '2023-07-06' %}

SELECT
'base' as blockchain,
block_hash,
contract_address,
data,
topic0,
topic1,
topic2,
topic3,
tx_hash,
block_number,
block_time,
index,
tx_index,
tx_from,
bytearray_to_uint256(bytearray_substring(data, 1, 32)) as total_tokens
FROM
{{ source('base', 'logs') }} logs
WHERE
topic0 = 0x9f1ec8c880f76798e7b793325d625e9b60e4082a553c98f42b6cda368dd60008 -- Locked
AND block_time >= TIMESTAMP '{{project_start_date}}'
{% if is_incremental() %}
AND {{ incremental_predicate('block_time') }}
{% endif %}
UNION ALL
SELECT
'base' as blockchain,
block_hash,
contract_address,
data,
topic0,
topic1,
topic2,
topic3,
tx_hash,
block_number,
block_time,
index,
tx_index,
tx_from,
bytearray_to_uint256(bytearray_substring(data, 1, 32)) as total_tokens
FROM
{{ source('base', 'logs') }} logs
WHERE
topic0 = 0x696de425f79f4a40bc6d2122ca50507f0efbeabbff86a84871b7196ab8ea8df7 -- Burned(address,uint256)
AND block_time >= TIMESTAMP '{{project_start_date}}'
{% if is_incremental() %}
AND {{ incremental_predicate('block_time') }}
{% endif %}
Loading
Loading