Query editor
selectblock_time,case when topic0 = 0x4f58d91435b87ffb70e80c1adac9408b0c4c798447c9c580feec4f0f474264d0 then 'Add New Product'when topic0 = 0x1c3cb2160d4ec64508b49c1714b7849acb6a50cdc444607e97e13a5ccb59bcb5 then 'Update Product'end as function,bytearray_to_uint256(bytearray_substring(data, 1, 32)) as productID,bytearray_to_uint256(bytearray_substring(data, 33, 32))/1E18 as priceETH,bytearray_to_uint256(bytearray_substring(data, 65, 32))/1E18 as pricePRIME,bytearray_to_uint256(bytearray_substring(data, 97, 32)) as productType,bytearray_ltrim(bytearray_substring(data, 129, 32)) as destinationAddress, -- address = 32 bytesbytearray_rtrim(bytearray_substring(data, 161, 32)) as selector, -- bytes8 = 8 bytes, but right-padded to 32 bytestx_hashfrom ethereum.logswhere "tx_to"=0xd32034b5502910e5b56f5ac94acb4198315c2da2AND topic0 in (0x4f58d91435b87ffb70e80c1adac9408b0c4c798447c9c580feec4f0f474264d0, -- add product0x1c3cb2160d4ec64508b49c1714b7849acb6a50cdc444607e97e13a5ccb59bcb5) ---update productorder by productID,block_time ASC