Skip to content

Commit

Permalink
Merge pull request #15 from Artemis-xyz/sm-add-celo-token-transfers
Browse files Browse the repository at this point in the history
Celo Token Transfers
  • Loading branch information
SebMelendez01 authored Apr 8, 2024
2 parents 7e51f44 + c676192 commit 636de38
Show file tree
Hide file tree
Showing 6 changed files with 681 additions and 9 deletions.
5 changes: 3 additions & 2 deletions macros/decode/decode_events.sql
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
contract_address,
origin_from_address,
origin_to_address,
status,
status as tx_status,
t1.topic_zero,
t2.event_name,
{{ target.schema }}.decode_evm_event_log(
event_data, t2.event_info
) as decoded_event
) as decoded_log
from {{ ref("fact_" ~ chain ~ "_events") }} t1
inner join {{ ref("dim_events_silver") }} t2 on t1.topic_zero = t2.topic_zero
{% if is_incremental() %}
Expand Down
21 changes: 21 additions & 0 deletions macros/decode/transfer_events.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{% macro transfer_events(chain) %}
select
block_timestamp,
block_number,
transaction_hash,
event_index,
origin_from_address,
origin_to_address,
contract_address,
decoded_log:"from"::string as "from",
decoded_log:"to"::string as "to",
decoded_log:"value"::string as amount,
tx_status
from {{ ref("fact_" ~ chain ~ "_decoded_events") }}
where topic_zero = '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef'
{% if is_incremental() %}
and
block_timestamp
>= (select dateadd('day', -3, max(block_timestamp)) from {{ this }})
{% endif %}
{% endmacro %}
Loading

0 comments on commit 636de38

Please sign in to comment.