cloudr3ndecoding practise
    Updated 2024-07-23
    select
    trace_index,
    regexp_substr_all(SUBSTR(input, 11, len(input)), '.{64}') AS segmented,
    '0x' || substr(segmented[4]::string, 25) as address
    from ethereum.core.fact_traces
    where block_timestamp::date = '2023-09-06'
    and tx_hash = '0xf21ff46f82638f00d89917cca3285b6b79b4921a13d8729b1079685aeaa696f8'
    and to_address = '0x5fa60726e62c50af45ff2f6280c468da438a7837'
    and type = 'DELEGATECALL'

    get function takeBid
    -- rewatch how decoding is done, how do i know which order are the lines decoded in
    0 : 0000000000000000000000000000000000000000000000000000000000000040 offset for inputs[0] = 2 lines to skip for -- inputs
    1 : 0000000000000000000000000000000000000000000000000000000000000a80 offset for inputs[1] = 84 lines to skip for -- oracleSignature

    inputs[0] has 4 components. under same hierachy (under inputs), all offset to start from same line
    2 : 00000000000000000000000000000000000000000000000000000000000000a0 offset skip 5 lines -- orders
    3 : 0000000000000000000000000000000000000000000000000000000000000420 offset skip 33 lines -- exchanges
    since component 3 is not a tuple/bytes32[], just use directly
    4 : 000000000000000000000000cf3e932f72e5f15411d125ad80579a3ef205b9b4 -- recipient address
    5 : 0000000000000000000000000000000000000000000000000000000000000032 -- feerate
    6 : 0000000000000000000000000000000000000000000000000000000000000940 offset skip 74 lines for signature
    7 : 0000000000000000000000000000000000000000000000000000000000000003 no. of orders -- also start of order
    components of orders
    order 1
    8 : 00000000000000000000000077e3e957082ca648c1c5b0f3e6aec00ab1245186 trader
    9 : 0000000000000000000000005af0d9827e0c53e4799bb226655a1de152a425a5 collection
    10 : 0ae49054555eee6aaf3ccca914a1ca40a91ec3b1a4bbb509d6e6242daf8199de listing root (not sure why no offset here)
    11 : 0000000000000000000000000000000000000000000000000000000000000001 no. of listing
    12 : 0000000000000000000000000000000000000000000000000000000066d9adc9 expiration time
    13 : 0000000000000000000000000000000000000000000000000000000000000000 asset type
    14 : 0000000000000000000000000000000000000000000000000000000000000000 recipient
    15 : 0000000000000000000000000000000000000000000000000000000000000000 rate
    16 : 000000000000000000000000000000006f0323f145861302412265f3903a3c43 salt
    order 2
    17 : 0000000000000000000000007c7c9ce081becb5f44ef9eed3a90d99057d2eb53 trader2
    QueryRunArchived: QueryRun has been archived