Query editor
WITHtokens as (SELECT*FROM (values(1, 'optimism', 0x9C46FE757ea200dFba1A77d1300F77289D8314Cd, 'BytePass', 'A base NFT to join us, and the one that holds all reputation tokens', '<a href="https://read.cryptodatabytes.com/p/64a41653-deeb-45a1-bfea-d025b866bcab" target="_blank">Mint</a>'),(2, 'optimism', 0xCbD623F16e92023660549B130529B3876F6893b9, 'ByteTiers', 'A reputation NFT minted based on total other reputation tokens earned', '<a href="https://read.cryptodatabytes.com/p/join-the-bytexplorers#:~:text=At%20the%20start%2C%20I%20will%20own%20all%20the%20voting%20power.%20As%20the%20community%20grows%2C%20I%20will%20gradually%20give%20it%20out%20by%20bytexplorer%20tier.%20These%20are%20the%20tier%20requirements%3A" target="_blank">Level Up</a>'),(3, 'optimism', 0xA014F6649667c73B108F611413916324e9276Eab, 'ByteGuilds', 'A reputation NFT minted for completing quests', '<a href="https://read.cryptodatabytes.com/p/bytexplorers-weekly-quest-1" target="_blank">Earn</a>'),(4, 'optimism', 0x022C7A578dc7C9731D5264661f8486E807dC2A6B, 'ByteInsight', 'A reputation NFT minted based on ByteLight questions answered', '<a href="https://read.cryptodatabytes.com/p/the-bytelight-token-spotlight-any" target="_blank">Earn</a>'),(5, 'base', 0x4Fc7be21c4437f6D56DF01B1BA38f8B361AeE9e4, 'ByteLight', 'An generic NFT that spotlights questions from holders (in and outside the community)', '<a href="https://read.cryptodatabytes.com/p/the-bytelight-token-spotlight-any" target="_blank">Buy</a>')) as v(ordering, chain, contract_address, name, what, how)), nft_transfers as (SELECT contract_address, "from", to, id as token_id, value as amount, evt_tx_hash as tx_hash, evt_block_time as block_time, evt_indexFROM erc1155_optimism.evt_TransferSingleUNION ALLSELECT contract_address, "from", to, token_id, "values"[index] as amount, evt_tx_hash as tx_hash, evt_block_time as block_time, evt_indexFROM erc1155_optimism.evt_TransferBatchLEFT JOIN unnest(ids) WITH ORDINALITY as tk(token_id, index) on trueUNION ALLSELECT contract_address, "from", to, tokenId as token_id, 1 as amount, evt_tx_hash as tx_hash, evt_block_time as block_time, evt_indexFROM erc721_optimism.evt_TransferUNION ALLSELECT contract_address, "from", to, id as token_id, value as amount, evt_tx_hash as tx_hash, evt_block_time as block_time, evt_indexFROM erc1155_base.evt_TransferSingleUNION ALLSELECT contract_address, "from", to, token_id, "values"[index] as amount, evt_tx_hash as tx_hash, evt_block_time as block_time, evt_indexFROM erc1155_base.evt_TransferBatchLEFT JOIN unnest(ids) WITH ORDINALITY as tk(token_id, index) on true), total_supply as (SELECTcontract_address, sum((case when "from" = 0x0000000000000000000000000000000000000000 then 1when to = 0x0000000000000000000000000000000000000000 then -1end)*cast(amount as double)) as total_supplyFROM nft_transfersWHERE contract_address IN (SELECT contract_address FROM tokens)AND ("from" = 0x0000000000000000000000000000000000000000 OR to = 0x0000000000000000000000000000000000000000)and block_time > timestamp '2023-12-20 00:00:00'group by 1)SELECTget_href(get_chain_explorer(t.chain) || '/address/' || cast(COALESCE(t.contract_address, 0x01) as varchar), t.name) as name, COALESCE(s.total_supply,0) as supply, t.how, t.what, t.ordering