fix/cctpv2-address (#347)

* fix address logic

* update seed
This commit is contained in:
San Yong 2025-06-05 11:40:18 +08:00 committed by GitHub
parent 4858e150a1
commit 4f6a012f41
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 32 additions and 57 deletions

View File

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

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 -- other 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 -- other 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 -- other non-evm chains
END AS destination_caller,
modified_timestamp,
CONCAT(
@ -152,7 +124,7 @@ SELECT
origin_from_address AS receiver,
mint_recipient AS destination_chain_receiver,
destination_domain AS destination_chain_id,
chain AS destination_chain,
coalesce(chain, 'other') AS destination_chain,
_log_id,
modified_timestamp
FROM