Query editor
-- Follow each first Prepunk registration through repeat old-registry auctions-- and later fresh registrations. Renewals do not count. The February 2020 bulk-- registrar transfer also emitted NameRegistered but was a migration, not a-- fresh registration; it is intentionally absent from these controller events.-- Repeat HashRegistered logs with the original auction registration date are-- repeat finalizations of the same auction, not a new registration.WITH original_events AS (SELECThash AS labelhash,owner AS original_owner,evt_block_time AS original_registered_at,registrationdate AS original_auction_registration_date,evt_block_number,evt_index,row_number() OVER (PARTITION BY hash ORDER BY evt_block_number, evt_index) AS occurrenceFROM ethereumnameservice_ethereum.registrar_old_evt_hashregisteredWHERE contract_address = 0x6090a6e47849629b7245dfa1ca21d94cd15878efAND evt_block_date >= DATE '2017-05-09'AND evt_block_date < DATE '2017-07-01'AND evt_block_number < 3919721),prepunks AS (SELECT labelhash, original_owner, original_registered_at,original_auction_registration_date,evt_block_number AS original_block, evt_index AS original_log_indexFROM original_eventsWHERE occurrence = 1),fresh_registrations AS (SELECTe.hash AS labelhash,e.evt_block_time AS registered_at,e.owner AS registered_ownerFROM ethereumnameservice_ethereum.registrar_old_evt_hashregistered eJOIN prepunks p ON p.labelhash = e.hashWHERE e.contract_address = 0x6090a6e47849629b7245dfa1ca21d94cd15878efAND e.evt_block_date >= DATE '2017-05-09'AND e.evt_block_date < DATE '2020-08-01'AND (e.evt_block_number > p.original_blockOR (e.evt_block_number = p.original_blockAND e.evt_index > p.original_log_index))AND e.registrationdate <> p.original_auction_registration_dateUNION ALLSELECTlabel AS labelhash,evt_block_time AS registered_at,owner AS registered_ownerFROM ens.view_registrationsWHERE evt_block_time >= TIMESTAMP '2019-05-04'AND label IN (SELECT labelhash FROM prepunks)UNION ALL-- The curated view does not yet include controller 5.SELECTlabelhash,