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 = [
|
export const getNameFromCCTPDomain = (
|
||||||
"ethereum",
|
domain: number
|
||||||
"avalanche",
|
): ChainName | undefined => {
|
||||||
"optimism",
|
if (domain === 0) return "ethereum";
|
||||||
"arbitrum",
|
else if (domain === 1) return "avalanche";
|
||||||
"base",
|
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,
|
getWormholeRelayerAddress,
|
||||||
getCircleAPI,
|
getCircleAPI,
|
||||||
getWormscanAPI,
|
getWormscanAPI,
|
||||||
CCTP_DOMAIN_TO_NAME,
|
getNameFromCCTPDomain,
|
||||||
} from "../consts";
|
} from "../consts";
|
||||||
import {
|
import {
|
||||||
parseWormholeRelayerPayloadType,
|
parseWormholeRelayerPayloadType,
|
||||||
|
@ -82,9 +82,9 @@ export function printChain(chainId: number) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function printCCTPDomain(domain: number) {
|
export function printCCTPDomain(domain: number) {
|
||||||
if (domain >= CCTP_DOMAIN_TO_NAME.length)
|
if (getNameFromCCTPDomain(domain) === undefined)
|
||||||
throw Error(`Invalid cctp domain: ${domain}`);
|
throw Error(`Invalid cctp domain: ${domain}`);
|
||||||
return `${CCTP_DOMAIN_TO_NAME[domain]} (Domain ${domain})`;
|
return `${getNameFromCCTPDomain(domain)} (Domain ${domain})`;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const estimatedAttestationTimeInSeconds = (
|
export const estimatedAttestationTimeInSeconds = (
|
||||||
|
@ -536,7 +536,7 @@ export async function getCCTPMessageLogURL(
|
||||||
);
|
);
|
||||||
const MessageSentTopic = ethers.utils.keccak256("MessageSent(bytes)");
|
const MessageSentTopic = ethers.utils.keccak256("MessageSent(bytes)");
|
||||||
try {
|
try {
|
||||||
if (CCTP_DOMAIN_TO_NAME[cctpKey.domain] === sourceChain) {
|
if (getNameFromCCTPDomain(cctpKey.domain) === sourceChain) {
|
||||||
const cctpLogFilter = (log: ethers.providers.Log) => {
|
const cctpLogFilter = (log: ethers.providers.Log) => {
|
||||||
return (
|
return (
|
||||||
log.topics[0] === DepositForBurnTopic &&
|
log.topics[0] === DepositForBurnTopic &&
|
||||||
|
|
Loading…
Reference in New Issue