update cctp seed and v2 evm logic

This commit is contained in:
San Yong 2025-05-16 17:46:33 +01:00
parent 54b5e53fb7
commit 9ae5446f06
3 changed files with 44 additions and 86 deletions

View File

@ -10,4 +10,5 @@ polygon pos,7
sui,8
aptos,9
unichain,10
linea,11
linea,11
sonic,13
1 chain domain
10 sui 8
11 aptos 9
12 unichain 10
13 linea 11
14 sonic 13

View File

@ -24,52 +24,37 @@ WITH base_evt AS (
TRY_TO_NUMBER(utils.udf_hex_to_int(segmented_data [0] :: STRING)) AS burn_amount,
TRY_TO_NUMBER(utils.udf_hex_to_int(segmented_data [2] :: STRING)) AS destination_domain,
CASE
WHEN destination_domain IN (
0,
1,
2,
3,
6,
7,
10
) THEN CONCAT('0x', SUBSTR(segmented_data [1] :: STRING, 25, 40)) -- evm
WHEN destination_domain = 5 THEN utils.udf_hex_to_base58(CONCAT('0x', segmented_data [1] :: STRING)) -- solana
WHEN LEFT(
segmented_data [1] :: STRING,
24
) = '000000000000000000000000' THEN CONCAT('0x', SUBSTR(segmented_data [1] :: STRING, 25, 40)) -- evm
ELSE CONCAT(
'0x',
segmented_data [1] :: STRING
) -- other non-evm chains
) -- non-evm chains
END AS mint_recipient,
CASE
WHEN destination_domain IN (
0,
1,
2,
3,
6,
7,
10
) THEN CONCAT('0x', SUBSTR(segmented_data [3] :: STRING, 25, 40)) -- evm
WHEN destination_domain = 5 THEN utils.udf_hex_to_base58(CONCAT('0x', segmented_data [3] :: STRING)) -- solana
WHEN LEFT(
segmented_data [3] :: STRING,
24
) = '000000000000000000000000' THEN CONCAT('0x', SUBSTR(segmented_data [3] :: STRING, 25, 40)) -- evm
ELSE CONCAT(
'0x',
segmented_data [3] :: STRING
) -- other non-evm chains
) -- non-evm chains
END AS destinationTokenMessenger,
CASE
WHEN destination_domain IN (
0,
1,
2,
3,
6,
7,
10
) THEN CONCAT('0x', SUBSTR(segmented_data [4] :: STRING, 25, 40)) -- evm
WHEN destination_domain = 5 THEN utils.udf_hex_to_base58(CONCAT('0x', segmented_data [4] :: STRING)) -- solana
WHEN LEFT(
segmented_data [4] :: STRING,
24
) = '000000000000000000000000' THEN CONCAT('0x', SUBSTR(segmented_data [4] :: STRING, 25, 40)) -- evm
ELSE CONCAT(
'0x',
segmented_data [4] :: STRING
) -- other non-evm chains
) -- non-evm chains
END AS destination_caller,
CONCAT(
tx_hash,

View File

@ -33,83 +33,55 @@ WITH base_evt AS (
decoded_log :destinationDomain :: STRING
) AS destination_domain,
CASE
WHEN destination_domain IN (
0,
1,
2,
3,
6,
7,
10
) THEN CONCAT(
WHEN destination_domain = 5 THEN utils.udf_hex_to_base58(
decoded_log :mintRecipient :: STRING
) -- solana
WHEN LEFT(
decoded_log :mintRecipient :: STRING,
26
) = '0x000000000000000000000000' THEN CONCAT(
'0x',
SUBSTR(
decoded_log :mintRecipient :: STRING,
25,
27,
40
)
) -- evm
WHEN destination_domain = 5 THEN utils.udf_hex_to_base58(CONCAT('0x', decoded_log :mintRecipient :: STRING)) -- solana
ELSE CONCAT(
'0x',
decoded_log :mintRecipient :: STRING
) -- other non-evm chains
ELSE decoded_log :mintRecipient :: STRING -- non-evm chains
END AS mint_recipient,
CASE
WHEN destination_domain IN (
0,
1,
2,
3,
6,
7,
10
) THEN CONCAT(
WHEN destination_domain = 5 THEN utils.udf_hex_to_base58(
decoded_log :destinationTokenMessenger :: STRING
) -- solana
WHEN LEFT(
decoded_log :destinationTokenMessenger :: STRING,
26
) = '0x000000000000000000000000' THEN CONCAT(
'0x',
SUBSTR(
decoded_log :destinationTokenMessenger :: STRING,
25,
27,
40
)
) -- evm
WHEN destination_domain = 5 THEN utils.udf_hex_to_base58(
CONCAT(
'0x',
decoded_log :destinationTokenMessenger :: STRING
)
) -- solana
ELSE CONCAT(
'0x',
decoded_log :destinationTokenMessenger :: STRING
) -- other non-evm chains
ELSE decoded_log :destinationTokenMessenger :: STRING -- non-evm chains
END AS destination_token_messenger,
CASE
WHEN destination_domain IN (
0,
1,
2,
3,
6,
7,
10
) THEN CONCAT(
WHEN destination_domain = 5 THEN utils.udf_hex_to_base58(
decoded_log :destinationCaller :: STRING
) -- solana
WHEN LEFT(
decoded_log :destinationCaller :: STRING,
26
) = '0x000000000000000000000000' THEN CONCAT(
'0x',
SUBSTR(
decoded_log :destinationCaller :: STRING,
25,
27,
40
)
) -- evm
WHEN destination_domain = 5 THEN utils.udf_hex_to_base58(
CONCAT(
'0x',
decoded_log :destinationCaller :: STRING
)
) -- solana
ELSE CONCAT(
'0x',
decoded_log :destinationCaller :: STRING
) -- other non-evm chains
ELSE decoded_log :destinationCaller :: STRING -- non-evm chains
END AS destination_caller,
modified_timestamp,
CONCAT(