adriaparcerisasList of Flow Contracts
Updated 2024-12-09
99
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
›
⌄
-- Visualization of valid staged contracts.
-- Staging Events:
-- Stage: Counted as staged.
-- Replace: Counted as staged.
-- Unstage: Not counted as staged.
-- Contracts that have not historically had Stage/Replace events: Not counted as staged.
WITH ContractInit AS (
SELECT
event_contract,
MIN(block_timestamp) AS ContractInitialized_Date,
MIN(inserted_timestamp) AS InsertedTimestampInit_Date
FROM flow.core.fact_events
WHERE event_type = 'ContractInitialized'
GROUP BY event_contract
),
EventsCount AS (
SELECT
event_contract,
COUNT(DISTINCT tx_id) AS events_emitted
FROM flow.core.fact_events
GROUP BY event_contract
),
StagedContracts AS (
SELECT DISTINCT event_data:contract AS contract
FROM flow.core.fact_events
WHERE block_timestamp > '2024-04-01'
AND event_type ILIKE '%StagingStatusUpdated%'
AND event_contract = 'A.56100d46aa9b0212.MigrationContractStaging'
AND event_data:action = 'stage'
)
SELECT
x.event_contract,
x.contract_name,
COALESCE(ci.ContractInitialized_Date, '2021-01-01') AS ContractInitialized_Date,
QueryRunArchived: QueryRun has been archived