Query editor
-- Huntertales Campaign — Staking Party Summary-- Paste a tx hash (stake OR outcome) → see party, CROWN reward, who survives, who dies.---- v4: Predicts outcomes for IN_DUNGEON parties using the death formula:-- seed = keccak(abi.encodePacked(player, timestamp, season, sectorX, sectorY, hunterId, hunterIndex, blockhash))-- survived = (seed % 10000) >= deathChanceBps---- Auto-detects tx type:-- - Outcome tx (has 0x0e507d9d events): shows actual results-- - Stake tx (has 0xde46a24b event): PREDICTS outcomes using on-chain formula---- Parameters:-- {{tx_hash}} — stakeHunters or outcome transaction hash-- {{difficulty}} — dungeon difficulty: D1=8%, D2=18%, D3=32%, D4=40%, D5=50%, D6=60%WITH hunter_names (id, name) AS (VALUES (1,'Inori'),(2,'Akira'),(3,'Aiden'),(4,'Naia'),(5,'Ori'),(6,'Faye'),(7,'Robin'),(8,'Valkara'),(9,'Ren'),(10,'Garrick'),(11,'Jin'),(12,'Anastasia'),(13,'Soren'),(14,'Casca'),(15,'Elara'),(16,'Saber'),(17,'Yuki'),(18,'Cael'),(19,'Gojo'),(20,'Celeste'),(21,'Tomoe'),(22,'Seraph'),(23,'Elara'),(24,'Lucian')),rarity_info (min_id, max_id, rarity_tag) AS (VALUES (1,4,'C'), (5,8,'U'), (9,12,'R'),(13,16,'E'), (17,20,'L'), (21,24,'T')),-- Find all DungeonV1 events in the given txtx_logs AS (SELECT block_number, tx_hash, topic0, topic1, topic2, topic3, data, indexFROM megaeth.logsWHERE contract_address = 0xd8c7079ac26d5e749bfe2c6c6f0e2617cc14dd7fAND tx_hash = {{tx_hash}}),-- Detect: does this tx have individual outcomes or a batch event?has_outcomes AS (SELECT COUNT(*) AS cnt FROM tx_logsWHERE topic0 = 0x0e507d9d027c393ef2f688fd20768a5bdceb9b16ed9a0f1cee455dfbade1ab28),has_batch AS (SELECT COUNT(*) AS cnt FROM tx_logsWHERE topic0 = 0xde46a24bd2bb7c32c4d7f4a89fae5b9dc30e0980d7a22a8c9600f6765a8d940b),-- PATH A: OUTCOME TX - individual outcome events (0x0e507d9d)individual_outcomes AS (SELECTblock_number,tx_hash,topic1 AS player_raw,CAST(bytearray_to_uint256(topic3) AS integer) AS token_id,CAST(bytearray_to_uint256(bytearray_substring(data, 1, 32)) AS integer) AS outcome_code,CAST(bytearray_to_uint256(bytearray_substring(data, 33, 32)) AS double) / 1e18 AS crown_individual,CAST(bytearray_to_uint256(bytearray_substring(data, 65, 32)) AS integer) AS survivedFROM tx_logsWHERE topic0 = 0x0e507d9d027c393ef2f688fd20768a5bdceb9b16ed9a0f1cee455dfbade1ab28),