Query editor
with capped_minters as (SELECTminterAddress AS capped_minter_address, cap / 1e18 AS mint_cap, admin AS admin_address, evt_tx_hash AS capped_minter_creation_tx_hash, evt_block_time AS capped_minter_creation_time, evt_block_number AS capped_minter_creation_block, NULL AS capped_minter_expiration_time, 'v1' AS "version"FROM zksync_zksync.ZkCappedMinterFactory_evt_CappedMinterCreatedUNIONSELECTminterAddress AS capped_minter_address, cap / 1e18 AS mint_cap, admin AS admin_address, evt_tx_hash AS capped_minter_creation_tx_hash, evt_block_time AS capped_minter_creation_time, evt_block_number AS capped_minter_creation_block, expirationTime AS capped_minter_expiration_time, 'v2' AS "version"FROM zksync_zksync.ZkCappedMinterV2Factory_evt_CappedMinterV2Created)-- zk_minting as (-- SELECT *-- FROM TABLE (-- decode_evm_event (-- abi => '{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"minter","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Minted","type":"event"}',-- input => TABLE (-- SELECT *-- FROM zksync.logs-- WHERE topic0 = 0x9d228d69b5fdb8d273a2336f8fb8612d039631024ea9bf09c424a9503aa078f0-- and contract_address in (select capped_minter_address from capped_minters)-- )-- )-- ))-- select-- contract_address-- , sum(amount/1e18) as amount-- from-- zk_minting-- group by 1, minting as (SELECT _to, _amount/1e18 as _amount, block_time, "from", to, successFROM TABLE (decode_evm_function_call (abi => '{"name":"mint","type":"function","inputs":[{"name":"_to","type":"address"},{"name":"_amount","type":"uint256"}],"outputs":[]