From 99f6dd99fc6134c7612384e11272e27177d3e6d7 Mon Sep 17 00:00:00 2001 From: Ali Behjati Date: Fri, 9 Feb 2024 12:43:01 +0100 Subject: [PATCH] chore(ethereum): add new networks (#1288) This change adds the configuration of the following new networks: - Hedera new testnet and mainnet - Injective inEVM tesntet and mainnet - IDEX xChain testnet It also updates the ethereum sdk README to outline Hedera special behaviour around update fees. --- contract_manager/store/chains/EvmChains.yaml | 15 +++++++++++++++ .../store/contracts/EvmPriceFeedContracts.yaml | 18 +++++++++++++++--- .../packages/xc_admin_common/src/chains.ts | 3 +++ package-lock.json | 2 +- target_chains/ethereum/sdk/js/README.md | 3 +++ target_chains/ethereum/sdk/js/package.json | 2 +- target_chains/ethereum/sdk/js/src/index.ts | 6 +++++- 7 files changed, 43 insertions(+), 6 deletions(-) diff --git a/contract_manager/store/chains/EvmChains.yaml b/contract_manager/store/chains/EvmChains.yaml index 1f96f276b..4f573e509 100644 --- a/contract_manager/store/chains/EvmChains.yaml +++ b/contract_manager/store/chains/EvmChains.yaml @@ -458,3 +458,18 @@ rpcUrl: https://sepolia-dela.deperp.com networkId: 9393 type: EvmChain +- id: idex_xchain_testnet + mainnet: false + rpcUrl: https://xchain-testnet-rpc.idex.io + networkId: 671276500 + type: EvmChain +- id: injective_inevm_testnet + mainnet: false + rpcUrl: https://inevm-testnet.rpc.caldera.xyz/http + networkId: 2424 + type: EvmChain +- id: injective_inevm + mainnet: true + rpcUrl: https://inevm.calderachain.xyz/http + networkId: 2525 + type: EvmChain diff --git a/contract_manager/store/contracts/EvmPriceFeedContracts.yaml b/contract_manager/store/contracts/EvmPriceFeedContracts.yaml index b6474cfdd..ebb315733 100644 --- a/contract_manager/store/contracts/EvmPriceFeedContracts.yaml +++ b/contract_manager/store/contracts/EvmPriceFeedContracts.yaml @@ -253,9 +253,6 @@ - chain: zetachain address: "0x2880aB155794e7179c9eE2e38200202908C17B43" type: EvmPriceFeedContract -- chain: hedera_testnet - address: "0x7a7F2493c578796ABfBA15Ce2e914A7A819979B7" - type: EvmPriceFeedContract - chain: sei_evm_devnet address: "0x23f0e8FAeE7bbb405E7A7C3d60138FCfd43d7509" type: EvmPriceFeedContract @@ -271,3 +268,18 @@ - chain: lightlink_phoenix address: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729" type: EvmPriceFeedContract +- chain: idex_xchain_testnet + address: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729" + type: EvmPriceFeedContract +- chain: injective_inevm_testnet + address: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729" + type: EvmPriceFeedContract +- chain: injective_inevm + address: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729" + type: EvmPriceFeedContract +- chain: hedera_testnet + address: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729" + type: EvmPriceFeedContract +- chain: hedera + address: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729" + type: EvmPriceFeedContract diff --git a/governance/xc_admin/packages/xc_admin_common/src/chains.ts b/governance/xc_admin/packages/xc_admin_common/src/chains.ts index 8c8a8bcde..21b962439 100644 --- a/governance/xc_admin/packages/xc_admin_common/src/chains.ts +++ b/governance/xc_admin/packages/xc_admin_common/src/chains.ts @@ -61,6 +61,7 @@ export const RECEIVER_CHAINS = { hedera: 60042, filecoin: 60043, lightlink_phoenix: 60044, + injective_inevm: 60045, // Testnets as a separate chain ids (to use stable data sources and governance for them) injective_testnet: 60013, @@ -123,6 +124,8 @@ export const RECEIVER_CHAINS = { sei_evm_devnet: 50051, fantom_sonic_testnet: 50052, dela_deperp_testnet: 50053, + injective_inevm_testnet: 50054, + idex_xchain_testnet: 50055, }; // If there is any overlapping value the receiver chain will replace the wormhole diff --git a/package-lock.json b/package-lock.json index 04a74d625..56c7f5f36 100644 --- a/package-lock.json +++ b/package-lock.json @@ -59418,7 +59418,7 @@ }, "target_chains/ethereum/sdk/js": { "name": "@pythnetwork/pyth-evm-js", - "version": "1.30.0", + "version": "1.31.0", "license": "Apache-2.0", "dependencies": { "@pythnetwork/price-service-client": "*", diff --git a/target_chains/ethereum/sdk/js/README.md b/target_chains/ethereum/sdk/js/README.md index 2394635e1..29d4dc107 100644 --- a/target_chains/ethereum/sdk/js/README.md +++ b/target_chains/ethereum/sdk/js/README.md @@ -48,8 +48,11 @@ const priceUpdateData = await connection.getPriceFeedsUpdateData(priceIds); const updateFee = await pythContract.methods .getUpdateFee(priceUpdateData) .call(); + // Calling someContract method // `someContract` below is a web3.js contract; if you wish to use ethers, you need to change it accordingly. +// Note: In Hedera you need to pass updateFee * 10^10 as value to the send method as there is an +// inconsistency in the way the value is handled in Hedera RPC and the way it is handled on-chain. await someContract.methods .doSomething(someArg, otherArg, priceUpdateData) .send({ value: updateFee }); diff --git a/target_chains/ethereum/sdk/js/package.json b/target_chains/ethereum/sdk/js/package.json index a13058e19..fc17cdaee 100644 --- a/target_chains/ethereum/sdk/js/package.json +++ b/target_chains/ethereum/sdk/js/package.json @@ -1,6 +1,6 @@ { "name": "@pythnetwork/pyth-evm-js", - "version": "1.30.0", + "version": "1.31.0", "description": "Pyth Network EVM Utils in JS", "homepage": "https://pyth.network", "author": { diff --git a/target_chains/ethereum/sdk/js/src/index.ts b/target_chains/ethereum/sdk/js/src/index.ts index 7fbc8cf7b..4c5533834 100644 --- a/target_chains/ethereum/sdk/js/src/index.ts +++ b/target_chains/ethereum/sdk/js/src/index.ts @@ -30,7 +30,9 @@ export const CONTRACT_ADDR: Record = { fantom: "0xff1a0f4744e8582DF1aE09D5611b887B6a12925C", filecoin: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729", gnosis: "0x2880aB155794e7179c9eE2e38200202908C17B43", + hedera: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729", horizen_eon: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729", + injective_inevm: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729", kava: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729", lightlink: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729", linea: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729", @@ -74,7 +76,9 @@ export const CONTRACT_ADDR: Record = { fantom_testnet: "0x5744Cbf430D99456a0A8771208b674F27f8EF0Fb", filecoin_calibration: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729", fuji: "0x23f0e8FAeE7bbb405E7A7C3d60138FCfd43d7509", - hedera_testnet: "0x7a7F2493c578796ABfBA15Ce2e914A7A819979B7", + hedera_testnet: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729", + idex_xchain_testnet: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729", + injective_inevm_testnet: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729", kcc_testnet: "0x74f09cb3c7e2A01865f424FD14F6dc9A14E3e94E", kava_testnet: "0xfA25E653b44586dBbe27eE9d252192F0e4956683", lightlink_pegasus_testnet: "0x5D289Ad1CE59fCC25b6892e7A303dfFf3a9f7167",