From fbb794f76349eda1bf0e9cc1fad2d2f5aa5bd4ef Mon Sep 17 00:00:00 2001 From: Nilesh Gupta Date: Mon, 30 Oct 2023 17:41:03 +0530 Subject: [PATCH 1/3] Changes for dev migration from goerli to sepolia --- src/config/config-dev.js | 23 ++++++++++++----------- src/connectors/chains.ts | 9 +++++++-- src/helpers/CaipHelper.ts | 2 +- src/helpers/UtilityHelper.ts | 2 ++ src/helpers/w2w/udResolver.ts | 2 +- src/hooks/useInactiveListener.ts | 4 ++-- src/segments/spam.tsx | 1 + src/structure/Header.tsx | 2 +- 8 files changed, 27 insertions(+), 18 deletions(-) diff --git a/src/config/config-dev.js b/src/config/config-dev.js index 57e26d8c1e..d77bb45a42 100644 --- a/src/config/config-dev.js +++ b/src/config/config-dev.js @@ -23,6 +23,7 @@ export const config = { */ allowedNetworks: [ 5, // for eth goerli + 11155111, // for eth sepolia 80001, //for mumbai polygon 97, // bnb testnet 420, // optimism goerli testnet @@ -78,12 +79,12 @@ export const config = { */ export const addresses = { ceaErc20: "0xc1C0472c0C80bCcDC7F5D01A376Bd97a734B8815", - epnscore: "0x23346b732d56d34ec4e890419fbfb8548216a799", - epnsEthComm: "0xc064F30bac07e84500c97A04D21a9d1bfFC72Ec0", + epnscore: "0x68a401dE9a6fcBEf0e616bCC6654B49dA379DAb7", + epnsEthComm: "0x28709649Dfda9baDEbb61dBF7a8D199cfC8EcF2e", epnsPolyComm: "0xAf55BE8e6b0d6107891bA76eADeEa032ef8A4504", // the ploygon comm contract - pushToken: "0x2b9bE9259a4F5Ba6344c1b1c07911539642a2D33", //address for push token + pushToken: "0x37c779a1564DCc0e3914aB130e0e787d93e21804", //address for push token aDai: "0x31f30d9A5627eAfeC4433Ae2886Cf6cc3D25E772", - epnsToken: "0x2b9bE9259a4F5Ba6344c1b1c07911539642a2D33", + epnsToken: "0x37c779a1564DCc0e3914aB130e0e787d93e21804", epnsLPToken: "0x1f094Bd8c260D0C3fC79157096015990885af4d2", rockstar: "0x3f8C2152b79276b78315CAF66cCF951780580A8a", batchMintNFT: "0xCf733D547B9f7F87c1B1f63f45c197C007F8eedf", @@ -105,7 +106,7 @@ export const addresses = { stakingV2: "0x0B318CA01Cec62bB29526591f368b44f4b8a0303", yieldFarmLP: "0x576c46b328433AaDcb9d9cDd81E0A92852bb0B6F", // yieldFarmLP: "0x13ac63901c8fD5797939099553582951fAbAFDE3", - pushCoreV2: "0x23346b732d56d34ec4e890419fbfb8548216a799", + pushCoreV2: "0x68a401dE9a6fcBEf0e616bCC6654B49dA379DAb7", // pushCoreV2: "0x0E76e9776CB192f5840B357780efB325885073FF", uniV2LPToken: "0x698839247E5b83572fFF6ccdcf386CC37e60bEf5", pushToken: "0x2b9bE9259a4F5Ba6344c1b1c07911539642a2D33", @@ -115,13 +116,13 @@ export const addresses = { } export const CHAIN_DETAILS = { - 5: { - label: "Ethereum Goerli", - name: "ETH_TEST_GOERLI", - chainId: 5, + 11155111: { + label: "Ethereum Sepolia", + name: "ETH_TEST_SEPOLIA", + chainId: 11155111, rpcUrl: "https://goerli.infura.io/v3/4ff53a5254144d988a8318210b56f47a", - commAddress: "0xc064F30bac07e84500c97A04D21a9d1bfFC72Ec0", - network: "goerli", + commAddress: "0x28709649Dfda9baDEbb61dBF7a8D199cfC8EcF2e", + network: "sepolia", }, 80001: { label: "Polygon Mumbai", diff --git a/src/connectors/chains.ts b/src/connectors/chains.ts index 98b1fc345f..ed75885210 100644 --- a/src/connectors/chains.ts +++ b/src/connectors/chains.ts @@ -109,10 +109,15 @@ export const MAINNET_CHAINS: ChainConfig = { } export const TESTNET_CHAINS: ChainConfig = { - 5: { + // 5: { + // urls: [getInfuraUrlFor('goerli')].filter(Boolean), + // nativeCurrency: ETH, + // name: 'Görli', + // }, + 11155111: { urls: [getInfuraUrlFor('goerli')].filter(Boolean), nativeCurrency: ETH, - name: 'Görli', + name: 'Sepolia' }, 420: { urls: [getInfuraUrlFor('optimism-goerli'), 'https://goerli.optimism.io'].filter(Boolean), diff --git a/src/helpers/CaipHelper.ts b/src/helpers/CaipHelper.ts index 9233228479..086a600902 100644 --- a/src/helpers/CaipHelper.ts +++ b/src/helpers/CaipHelper.ts @@ -1,7 +1,7 @@ // Internal Configs import { appConfig } from '../config'; -export const Eip155EnabledIds: Array = [1, 56, 137, 10, 1101, 42161, 5, 97, 80001, 420, 1442, 421613]; +export const Eip155EnabledIds: Array = [1, 56, 137, 10, 1101, 42161, 11155111, 97, 80001, 420, 1442, 421613]; // Types type CAIPProps = { diff --git a/src/helpers/UtilityHelper.ts b/src/helpers/UtilityHelper.ts index 74a71ebcd3..269b8a4612 100644 --- a/src/helpers/UtilityHelper.ts +++ b/src/helpers/UtilityHelper.ts @@ -101,6 +101,7 @@ export const EnvHelper = { export const networkName = { 42: 'Ethereum Kovan', 5: "Ethereum Goerli", + 11155111: "Ethereum Sepolia", 1: 'Ethereum Mainnet', 137: 'Polygon Mainnet', 80001: 'Polygon Mumbai', @@ -116,6 +117,7 @@ export const networkName = { export const chainNameBackendStandard = { 5: "ETH_TEST_GOERLI", + 11155111: "ETH_TEST_SEPOLIA", 1: 'ETH_MAINNET', 137: 'POLYGON_MAINNET', 80001: 'POLYGON_TEST_MUMBAI', diff --git a/src/helpers/w2w/udResolver.ts b/src/helpers/w2w/udResolver.ts index 423746aa7c..515889bca5 100644 --- a/src/helpers/w2w/udResolver.ts +++ b/src/helpers/w2w/udResolver.ts @@ -3,7 +3,7 @@ import { ethers } from 'ethers'; import { appConfig, CHAIN_DETAILS } from 'config'; export const getUdResolver = (): Resolution => { - const l1ChainId = appConfig.allowedNetworks.includes(1) ? 1 : 5; + const l1ChainId = appConfig.allowedNetworks.includes(1) ? 1 : 11155111; const l2ChainId = appConfig.allowedNetworks.includes(137) ? 137 : 80001; return Resolution.fromEthersProvider({ uns: { diff --git a/src/hooks/useInactiveListener.ts b/src/hooks/useInactiveListener.ts index b50a66aec1..c7aa7ea452 100644 --- a/src/hooks/useInactiveListener.ts +++ b/src/hooks/useInactiveListener.ts @@ -15,8 +15,8 @@ export function useInactiveListener() { const getErrorMessage = () => { if (appConfig.coreContractChain === 42) return 'Unsupported Network, please connect to the Ethereum Kovan network or Polygon Mumbai network'; - else if (appConfig.coreContractChain === 5) - return 'Unsupported Network, please connect to the Ethereum Goerli, Polygon Mumbai, BNB testnet, Optimism Goerli, Arbitrum testnet or Polygon zkEVM testnet'; + else if (appConfig.coreContractChain === 11155111) + return 'Unsupported Network, please connect to the Ethereum Sepolia, Polygon Mumbai, BNB testnet, Optimism Goerli, Arbitrum testnet or Polygon zkEVM testnet'; else return 'Unsupported Network, please connect to the Ethereum, Polygon, BNB, Optimism, Arbitrum or Polygon zkEVM Mainnet'; } diff --git a/src/segments/spam.tsx b/src/segments/spam.tsx index 1609f01c1c..ead7c51eac 100644 --- a/src/segments/spam.tsx +++ b/src/segments/spam.tsx @@ -88,6 +88,7 @@ const SpamBox = ({ showFilter, setShowFilter, search, setSearch }) => { POLYGON_TEST_MUMBAI: 80001, ETH_TEST_KOVAN: 42, ETH_TEST_GOERLI: 5, + ETH_TEST_SEPOLIA: 11155111, POLYGON_MAINNET: 137, ETH_MAINNET: 1 }; diff --git a/src/structure/Header.tsx b/src/structure/Header.tsx index d1d1f75c15..9156ff9c2b 100644 --- a/src/structure/Header.tsx +++ b/src/structure/Header.tsx @@ -118,7 +118,7 @@ function Header({ isDarkMode, darkModeToggle }) { if (appConfig.coreContractChain === 42) return 'Unsupported Network, please connect to the Ethereum Kovan network or Polygon Mumbai network'; else if (appConfig.coreContractChain === 5) - return 'Unsupported Network, please connect to the Ethereum Goerli, Polygon Mumbai, BNB testnet, Optimism Goerli, Arbitrum testnet or Polygon zkEVM testnet'; + return 'Unsupported Network, please connect to the Ethereum Sepolia, Polygon Mumbai, BNB testnet, Optimism Goerli, Arbitrum testnet or Polygon zkEVM testnet'; else return 'Unsupported Network, please connect to the Ethereum, Polygon, BNB, Optimism, Arbitrum or Polygon zkEVM Mainnet'; } else { console.error(error); From 5e6473af3069d5968d6c1d2ef1f2ef21d25d930e Mon Sep 17 00:00:00 2001 From: Nilesh Gupta Date: Tue, 31 Oct 2023 15:19:56 +0530 Subject: [PATCH 2/3] Added changes for sepolia rpc --- src/components/FaucetInfo.tsx | 4 ++-- src/components/Faucets.js | 8 ++++---- src/components/YieldFarmChainError.tsx | 2 +- src/config/config-dev.js | 8 ++++---- src/connectors/chains.ts | 5 +++-- src/helpers/UtilityHelper.ts | 3 ++- src/structure/Header.tsx | 2 +- 7 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/components/FaucetInfo.tsx b/src/components/FaucetInfo.tsx index 9964974631..6e88e8a197 100644 --- a/src/components/FaucetInfo.tsx +++ b/src/components/FaucetInfo.tsx @@ -75,11 +75,11 @@ const FaucetInfo = ({ onMintPushToken, noOfPushTokensToCheck, containerProps }: ) : ( 1 - Goerli ETH Faucet + Sepolia ETH Faucet { diff --git a/src/components/Faucets.js b/src/components/Faucets.js index dee6333407..79bc93915e 100644 --- a/src/components/Faucets.js +++ b/src/components/Faucets.js @@ -23,11 +23,11 @@ const Faucets = () => { const dropdownValues = [ { - id: "5", - value: "Goerli", - title: "Goerli Faucet", + id: "11155111", + value: "Sepolia", + title: "Sepolia Faucet", function: () => {}, - link: "https://goerlifaucet.com/", + link: "https://sepoliafaucet.com/", }, { id: "80001", diff --git a/src/components/YieldFarmChainError.tsx b/src/components/YieldFarmChainError.tsx index 7e86a9ce6e..453b95d8e4 100644 --- a/src/components/YieldFarmChainError.tsx +++ b/src/components/YieldFarmChainError.tsx @@ -14,7 +14,7 @@ const YieldFarmChainError = () => { const chainIdToPass = appConfig.allowedNetworks[0]; - if (currentChainId !== 1 && currentChainId !== 5) { + if (currentChainId !== 1 && currentChainId !== 11155111) { console.log("Current Chain ID ", currentChainId); console.log("Chain Id to pass", chainIdToPass); switchChain(appConfig.coreContractChain); diff --git a/src/config/config-dev.js b/src/config/config-dev.js index d77bb45a42..308f59b82c 100644 --- a/src/config/config-dev.js +++ b/src/config/config-dev.js @@ -22,7 +22,7 @@ export const config = { * Allowed Networks */ allowedNetworks: [ - 5, // for eth goerli + // 5, // for eth goerli 11155111, // for eth sepolia 80001, //for mumbai polygon 97, // bnb testnet @@ -34,8 +34,8 @@ export const config = { /** * Core Network Related Data */ - coreContractChain: 5, //the chain id of the network which the core contract relies on - coreRPC: 'https://goerli.infura.io/v3/4ff53a5254144d988a8318210b56f47a', + coreContractChain: 11155111, //the chain id of the network which the core contract relies on + coreRPC: 'https://sepolia.infura.io/v3/5524d420b29f4f7a8d8d2f582a0d43f7', mainnetCoreRPC: "https://mainnet.infura.io/v3/4ff53a5254144d988a8318210b56f47a", mainnetCoreContractChain: 1, aliasRPC: { @@ -120,7 +120,7 @@ export const CHAIN_DETAILS = { label: "Ethereum Sepolia", name: "ETH_TEST_SEPOLIA", chainId: 11155111, - rpcUrl: "https://goerli.infura.io/v3/4ff53a5254144d988a8318210b56f47a", + rpcUrl: "https://sepolia.infura.io/v3/5524d420b29f4f7a8d8d2f582a0d43f7", commAddress: "0x28709649Dfda9baDEbb61dBF7a8D199cfC8EcF2e", network: "sepolia", }, diff --git a/src/connectors/chains.ts b/src/connectors/chains.ts index ed75885210..2a55a04aaa 100644 --- a/src/connectors/chains.ts +++ b/src/connectors/chains.ts @@ -115,9 +115,10 @@ export const TESTNET_CHAINS: ChainConfig = { // name: 'Görli', // }, 11155111: { - urls: [getInfuraUrlFor('goerli')].filter(Boolean), + urls: [getInfuraUrlFor('sepolia')].filter(Boolean), nativeCurrency: ETH, - name: 'Sepolia' + name: 'Sepolia', + blockExplorerUrls: ['https://sepolia.etherscan.io'], }, 420: { urls: [getInfuraUrlFor('optimism-goerli'), 'https://goerli.optimism.io'].filter(Boolean), diff --git a/src/helpers/UtilityHelper.ts b/src/helpers/UtilityHelper.ts index 269b8a4612..c92a65c51a 100644 --- a/src/helpers/UtilityHelper.ts +++ b/src/helpers/UtilityHelper.ts @@ -139,7 +139,8 @@ export const aliasChainIdToChainName={ export const aliasChainIdsMapping = { 1: 137, 42: 80001, - 5: 80001 + 5: 80001, + 11155111: 80001 }; export const NETWORK_DETAILS = { diff --git a/src/structure/Header.tsx b/src/structure/Header.tsx index 9156ff9c2b..b826a521f4 100644 --- a/src/structure/Header.tsx +++ b/src/structure/Header.tsx @@ -117,7 +117,7 @@ function Header({ isDarkMode, darkModeToggle }) { switchChain(appConfig.coreContractChain); if (appConfig.coreContractChain === 42) return 'Unsupported Network, please connect to the Ethereum Kovan network or Polygon Mumbai network'; - else if (appConfig.coreContractChain === 5) + else if (appConfig.coreContractChain === 11155111) return 'Unsupported Network, please connect to the Ethereum Sepolia, Polygon Mumbai, BNB testnet, Optimism Goerli, Arbitrum testnet or Polygon zkEVM testnet'; else return 'Unsupported Network, please connect to the Ethereum, Polygon, BNB, Optimism, Arbitrum or Polygon zkEVM Mainnet'; } else { From 2f6b04bcc51afdd4b421e0dc7d9c006d04572034 Mon Sep 17 00:00:00 2001 From: Nilesh Gupta Date: Fri, 10 Nov 2023 16:37:34 +0530 Subject: [PATCH 3/3] Contract address changed --- src/config/config-dev.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/config/config-dev.js b/src/config/config-dev.js index 308f59b82c..51f9c09aea 100644 --- a/src/config/config-dev.js +++ b/src/config/config-dev.js @@ -79,8 +79,8 @@ export const config = { */ export const addresses = { ceaErc20: "0xc1C0472c0C80bCcDC7F5D01A376Bd97a734B8815", - epnscore: "0x68a401dE9a6fcBEf0e616bCC6654B49dA379DAb7", - epnsEthComm: "0x28709649Dfda9baDEbb61dBF7a8D199cfC8EcF2e", + epnscore: "0x5AB1520E2bd519BDab2e1347EEe81C00a77f4946", + epnsEthComm: "0x9dDCD7ed7151afab43044E4D694FA064742C428c", epnsPolyComm: "0xAf55BE8e6b0d6107891bA76eADeEa032ef8A4504", // the ploygon comm contract pushToken: "0x37c779a1564DCc0e3914aB130e0e787d93e21804", //address for push token aDai: "0x31f30d9A5627eAfeC4433Ae2886Cf6cc3D25E772",