Flipside TeamTest BTC Staking Bitcoin
Updated 2024-12-02
999
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
›
⌄
with
-------------------- Staking Transactions on Core --------------------
core_logs as (
select
block_timestamp,
tx_hash,
contract_address,
origin_from_address,
origin_to_address,
origin_function_signature,
event_name,
split_part(address_name, 'validator: ', 2) as operator,
decoded_log:agent as operator_address,
decoded_log:delegator as delegator,
decoded_log:blockHeight as bitcoin_block_number,
lower(to_char(reverse(try_to_binary(trim(decoded_log:txid, '0x'))))) as bitcoin_tx_id,
decoded_log:outputIndex as bitcoin_output_index,
decoded_log:script as bitcoin_script
-- lower(to_char(reverse(to_binary(trim(topics[1], '0x'))))) as bitcoin_staking_tx_id,
-- topics[2] as operator_address,
-- topics[3] as core_reward_address
from
core.core.ez_decoded_event_logs logs
left join core.core.dim_labels labels on logs.decoded_log:agent = labels.address
where
tx_succeeded
-- and contract_address = '0x0000000000000000000000000000000000001007'
and origin_to_address = '0x0000000000000000000000000000000000001007'
and topics[0] = '0xd9bac531f4c140de07ef9de431f5233b0d6ead3f0aa7834fcffd828c882dfdd2' -- Bitcoin Staking on Core Chain
-- and tx_hash = '0x1a933903faebba7473b3deb016ce1e5ba3cc7a4225704e35ac4adbc4e76e3cd3'
),
-------------------- Staking Transactions on Bitcoin --------------------
bitcoin_outputs as (
select
core.bitcoin_block_number,
bitcoin.block_timestamp as bitcoin_block_timestamp,
QueryRunArchived: QueryRun has been archived