base is domain 6 (#3471)
* base is domain 6 * explicit CCTP domain to name mapping
This commit is contained in:
parent
b708f5ac5b
commit
ae1e4b32e3
|
@ -242,10 +242,13 @@ export const getWormscanAPI = (_network: Network) => {
|
|||
}
|
||||
};
|
||||
|
||||
export const CCTP_DOMAIN_TO_NAME = [
|
||||
"ethereum",
|
||||
"avalanche",
|
||||
"optimism",
|
||||
"arbitrum",
|
||||
"base",
|
||||
];
|
||||
export const getNameFromCCTPDomain = (
|
||||
domain: number
|
||||
): ChainName | undefined => {
|
||||
if (domain === 0) return "ethereum";
|
||||
else if (domain === 1) return "avalanche";
|
||||
else if (domain === 2) return "optimism";
|
||||
else if (domain === 3) return "arbitrum";
|
||||
else if (domain === 6) return "base";
|
||||
else return undefined;
|
||||
};
|
||||
|
|
|
@ -16,7 +16,7 @@ import {
|
|||
getWormholeRelayerAddress,
|
||||
getCircleAPI,
|
||||
getWormscanAPI,
|
||||
CCTP_DOMAIN_TO_NAME,
|
||||
getNameFromCCTPDomain,
|
||||
} from "../consts";
|
||||
import {
|
||||
parseWormholeRelayerPayloadType,
|
||||
|
@ -82,9 +82,9 @@ export function printChain(chainId: number) {
|
|||
}
|
||||
|
||||
export function printCCTPDomain(domain: number) {
|
||||
if (domain >= CCTP_DOMAIN_TO_NAME.length)
|
||||
if (getNameFromCCTPDomain(domain) === undefined)
|
||||
throw Error(`Invalid cctp domain: ${domain}`);
|
||||
return `${CCTP_DOMAIN_TO_NAME[domain]} (Domain ${domain})`;
|
||||
return `${getNameFromCCTPDomain(domain)} (Domain ${domain})`;
|
||||
}
|
||||
|
||||
export const estimatedAttestationTimeInSeconds = (
|
||||
|
@ -536,7 +536,7 @@ export async function getCCTPMessageLogURL(
|
|||
);
|
||||
const MessageSentTopic = ethers.utils.keccak256("MessageSent(bytes)");
|
||||
try {
|
||||
if (CCTP_DOMAIN_TO_NAME[cctpKey.domain] === sourceChain) {
|
||||
if (getNameFromCCTPDomain(cctpKey.domain) === sourceChain) {
|
||||
const cctpLogFilter = (log: ethers.providers.Log) => {
|
||||
return (
|
||||
log.topics[0] === DepositForBurnTopic &&
|
||||
|
|
Loading…
Reference in New Issue