Skip to content

Commit

Permalink
prepare for sepolia chains for cctp (wormhole-foundation#3703)
Browse files Browse the repository at this point in the history
  • Loading branch information
barnjamin authored Jan 23, 2024
1 parent 846c2e9 commit ded305f
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 9 deletions.
44 changes: 36 additions & 8 deletions sdk/js/src/relayer/consts.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { ChainId, Network, ChainName, CHAIN_ID_TO_NAME } from "../";
import { ethers } from "ethers";
import { ChainName, Network } from "../";
import {
WormholeRelayer__factory,
WormholeRelayer,
WormholeRelayer__factory,
} from "../ethers-contracts/";

type AddressInfo = {
Expand Down Expand Up @@ -57,6 +57,26 @@ const TESTNET: { [K in ChainName]?: AddressInfo } = {
mockDeliveryProviderAddress: "0x60a86b97a7596eBFd25fb769053894ed0D9A8366",
mockIntegrationAddress: "0x9Ee656203B0DC40cc1bA3f4738527779220e3998",
},
sepolia: {
wormholeRelayerAddress: "0x7B1bD7a6b4E61c2a123AC6BC2cbfC614437D0470",
mockDeliveryProviderAddress: "0x7A0a53847776f7e94Cc35742971aCb2217b0Db81",
mockIntegrationAddress: "0x68b7Cd0d27a6F04b2F65e11DD06182EFb255c9f0",
},
arbitrum_sepolia: {
wormholeRelayerAddress: "0x7B1bD7a6b4E61c2a123AC6BC2cbfC614437D0470",
mockDeliveryProviderAddress: "0x7A0a53847776f7e94Cc35742971aCb2217b0Db81",
mockIntegrationAddress: "0x2B1502Ffe717817A0A101a687286bE294fe495f7",
},
optimism_sepolia: {
wormholeRelayerAddress: "0x93BAD53DDfB6132b0aC8E37f6029163E63372cEE",
mockDeliveryProviderAddress: "0x7A0a53847776f7e94Cc35742971aCb2217b0Db81",
mockIntegrationAddress: "0xA404B69582bac287a7455FFf315938CCd92099c1",
},
base_sepolia: {
wormholeRelayerAddress: "0x93BAD53DDfB6132b0aC8E37f6029163E63372cEE",
mockDeliveryProviderAddress: "0x7A0a53847776f7e94Cc35742971aCb2217b0Db81",
mockIntegrationAddress: "0xA404B69582bac287a7455FFf315938CCd92099c1",
},
};

const DEVNET: { [K in ChainName]?: AddressInfo } = {
Expand Down Expand Up @@ -208,6 +228,10 @@ export const RPCS_BY_CHAIN: {
gnosis: "https://sokol.poa.network/",
rootstock: "https://public-node.rsk.co",
base: "https://goerli.base.org",
sepolia: "https://rpc.ankr.com/eth_sepolia",
arbitrum_sepolia: "https://sepolia-rollup.arbitrum.io/rpc",
optimism_sepolia: "https://sepolia.optimism.io",
base_sepolia: "https://sepolia.base.org",
},
DEVNET: {
ethereum: "http://localhost:8545",
Expand Down Expand Up @@ -243,12 +267,16 @@ export const getWormscanAPI = (_network: Network) => {
};

export const getNameFromCCTPDomain = (
domain: number
domain: number,
environment: Network = "MAINNET"
): 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";
if (domain === 0) return environment === "MAINNET" ? "ethereum" : "sepolia";
else if (domain === 1) "avalanche";
else if (domain === 2)
return environment === "MAINNET" ? "optimism" : "optimism_sepolia";
else if (domain === 3)
return environment === "MAINNET" ? "arbitrum" : "arbitrum_sepolia";
else if (domain === 6)
return environment === "MAINNET" ? "base" : "base_sepolia";
else return undefined;
};
2 changes: 1 addition & 1 deletion sdk/js/src/relayer/relayer/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ export async function getCCTPMessageLogURL(
ethers.utils.toUtf8Bytes("MessageSent(bytes)")
);
try {
if (getNameFromCCTPDomain(cctpKey.domain) === sourceChain) {
if (getNameFromCCTPDomain(cctpKey.domain, environment) === sourceChain) {
const cctpLogFilter = (log: ethers.providers.Log) => {
return (
log.topics[0] === DepositForBurnTopic &&
Expand Down

0 comments on commit ded305f

Please sign in to comment.