Query editor
-- XAUT0 TON Bridging Transactions-- Extract LayerZero bridging activity for XAUT0 on TON-- LayerZero EID: 30343 (TON)-- Note: Inflows show source chain EID (Ethereum=30101, Arbitrum=30110, TRON=30420, Solana=30168)-- Note: Outflows show destination chain EID-- Inflow OFT contracts (OFTReceived emitters):-- 0:1DDF580052174ED1DD0D66C35BFDC1A5FCC69AF4F4AE36154B13DCFC6C14A35F (397-byte body)-- 0:90D9FF1C7814705FCC74F8B7598476D65F3B9536FC132729B0606F0BE82E617F (395-byte body)-- Amount offsets: 395-byte→384, 397-byte→386; src_eid shift: 395-byte→26, 397-byte→32-- Outflow OFT contracts (OFTSentSucceeded emitters):-- 0:1DDF580052174ED1DD0D66C35BFDC1A5FCC69AF4F4AE36154B13DCFC6C14A35F (282-byte body, eid_window at offset 226)-- 0:90D9FF1C7814705FCC74F8B7598476D65F3B9536FC132729B0606F0BE82E617F (272-byte body, eid_window at offset 224)WITH params AS (SELECT '0:3547F2EE4022C794C80EA354B81BB63B5B571DD05AC091B035D19ABBADD74AC6' AS xaut0_master_raw -- XAUT0 jetton master (confirmed via ton.jetton_events on OFTReceived traces),DATE '2025-08-11' AS date_start -- Dune TON backfill start date),lz_traces AS (SELECT DISTINCT trace_idFROM ton.messagesWHERE block_date >= (SELECT date_start FROM params)AND destination = (SELECT xaut0_master_raw FROM params)),inflow AS (WITH inbound_messages AS (SELECT trace_id, block_time, body_bocFROM ton.messagesWHERE block_date >= (SELECT date_start FROM params)AND direction = 'out'AND opcode = -482633613AND ((source = '0:1DDF580052174ED1DD0D66C35BFDC1A5FCC69AF4F4AE36154B13DCFC6C14A35F' AND varbinary_length(body_boc) = 397)OR(source = '0:90D9FF1C7814705FCC74F8B7598476D65F3B9536FC132729B0606F0BE82E617F' AND varbinary_length(body_boc) = 395))),inbound_extraction AS (SELECT trace_id,block_time,varbinary_length(body_boc) AS body_len-- For topic decoding (same offsets for both variants),from_big_endian_64(varbinary_substring(body_boc, 106 + 1, 8)) AS t1,from_big_endian_64(varbinary_substring(body_boc, 114 + 1, 8)) AS t2,from_big_endian_64(varbinary_substring(body_boc, 122 + 1, 8)) AS t3,from_big_endian_64(varbinary_substring(body_boc, 130 + 1, 8)) AS t4,from_big_endian_64(varbinary_substring(body_boc, 138 + 1, 8)) AS t5-- src_eid window at same offset 277 for both; shift amount differs in decoded stage,from_big_endian_64(varbinary_substring(body_boc, 276 + 1, 8)) AS src_eid_window-- For GUID decoding (same offsets for both variants),from_big_endian_64(varbinary_substring(body_boc, 194 + 1, 8)) AS g1,from_big_endian_64(varbinary_substring(body_boc, 202 + 1, 8)) AS g2,from_big_endian_64(varbinary_substring(body_boc, 210 + 1, 8)) AS g3,from_big_endian_64(varbinary_substring(body_boc, 218 + 1, 8)) AS g4,from_big_endian_64(varbinary_substring(body_boc, 226 + 1, 8)) AS g5-- Amount: 395-byte variant is 2 bytes shorter in the tail (offset 384 vs 386),CASE WHEN varbinary_length(body_boc) = 395THEN from_big_endian_64(RPAD(varbinary_substring(body_boc, 384, 8), 8, X'00'))ELSE from_big_endian_64(RPAD(varbinary_substring(body_boc, 386, 8), 8, X'00'))