freemartianEnter BrushID >> See Its Power
Updated 2024-10-05
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
›
⌄
-- forked from TokenID & Strength @ https://flipsidecrypto.xyz/edit/queries/c04b600c-2776-4369-a205-aaf75b634969
with mints as (
select
tx_hash,
tokenid
from base.nft.ez_nft_transfers
where nft_address = '0xd68fe5b53e7e1abeb5a4d0a6660667791f39263a'
and event_type = 'mint'),
source as (
select
tx_hash,
regexp_substr_all(SUBSTR(data:input, 11, len(data:input)), '.{64}') AS segmented_data
from base.core.fact_traces
where tx_hash in (select tx_hash from mints)
and type = 'CALL')
select
tokenid as brushID,
case
when ethereum.public.udf_hex_to_int(segmented_data[0] :: STRING) = '100' then 'Regular'
when ethereum.public.udf_hex_to_int(segmented_data[0] :: STRING) = '500' then 'Bronze'
when ethereum.public.udf_hex_to_int(segmented_data[0] :: STRING) = '5000' then 'Rare'
when ethereum.public.udf_hex_to_int(segmented_data[0] :: STRING) = '200' then 'Upgraded'
end as Brush_type,
ethereum.public.udf_hex_to_int(segmented_data[0] :: STRING) as strength
from source s inner join mints m on m.tx_hash = s.tx_hash
where brushID = '{{Brush_ID}}'
Auto-refreshes every 1 hour
QueryRunArchived: QueryRun has been archived