Query editor
with serviceId_multisig as (select serviceId, multisigfrom autonolas_gnosis.serviceregistryl2_evt_createmultisigwithagents),-- as for MMagentId_mech_address as (select *,varbinary_ltrim(topic1) as mech,varbinary_to_uint256(topic2) as agentIdfrom gnosis.logswhere contract_address in ( select factory_address from query_5547000 )and topic0 = 0x67a2e45041c70013518c5b9b849a6944a6c17ff44d66be1c707020460ecbd1db),-- from all the withelisted factories we check for createMech event : mech + agentIdagentId_multisig as ( select *,varbinary_ltrim(topic2) as multisig,varbinary_to_uint256(topic3) as agentIdfrom gnosis.logswhere contract_address = 0xe49cb081e8d96920c38aa7ab90cb0294ab4bc8eaand topic0= 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efand topic1=0x0000000000000000000000000000000000000000000000000000000000000000 )-- from agentRegistry contract: we check the transfer from 0 address (mint) to the operato-- operator is the multisig in our logic-- and we have the agentId-- AGENT ID you see here is not at all agentId azssociated to services! This agentId associated to mechs on the agent mech registryselect sm.*,am.agentId,ac.mechfrom serviceId_multisig smleft join agentId_multisig am on am.multisig=sm.multisigleft join agentId_mech_address ac on ac.agentId=am.agentId