Skip to content

Conversation

@rohitsaw115
Copy link
Contributor

@rohitsaw115 rohitsaw115 commented Nov 14, 2025

ticket: win-7852

Context :- Hedera's EVM layer utilizes a proprietary explorer (such as HashScan) rather than Etherscan architecture. Consequently, queries written for the Etherscan API will not function on Hedera.

Fix :- Implement a new function, recovery_HBAREVM_BlockchainExplorerQuery, designed to query Hedera's native API. This function must then parse and format the Hedera response to match the expected structure of an Etherscan API result.

@rohitsaw115 rohitsaw115 force-pushed the win-7852 branch 5 times, most recently from 6ab7807 to 02b138f Compare November 17, 2025 07:03
@rohitsaw115 rohitsaw115 marked this pull request as ready for review November 17, 2025 08:43
@rohitsaw115 rohitsaw115 requested review from a team as code owners November 17, 2025 08:43
Copy link
Contributor

@mullapudipruthvik mullapudipruthvik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add tests

@rohitsaw115 rohitsaw115 marked this pull request as draft November 18, 2025 04:39
@rohitsaw115 rohitsaw115 force-pushed the win-7852 branch 5 times, most recently from 29bc8e2 to 52bebca Compare November 18, 2025 05:54
@rohitsaw115 rohitsaw115 marked this pull request as ready for review November 18, 2025 07:24
@rohitsaw115 rohitsaw115 requested a review from a team as a code owner November 18, 2025 07:24
ArunBala-Bitgo
ArunBala-Bitgo previously approved these changes Nov 18, 2025
Copy link
Contributor

@ArunBala-Bitgo ArunBala-Bitgo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds recovery support for Hedera EVM by implementing a custom blockchain explorer query function that works with Hedera's native Mirror Node API instead of the standard Etherscan-compatible API. The implementation converts Hedera-specific responses to match the expected Etherscan format.

Key Changes:

  • Implements recovery_HBAREVM_BlockchainExplorerQuery function to query Hedera's Mirror Node API and RPC endpoints
  • Adds environment configuration for Hedera EVM (mainnet/testnet) with baseUrl and rpcUrl
  • Updates chainId mappings and fixes explorerUrl path from "transactions" to "transaction"

Reviewed Changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
yarn.lock Consolidates glob dependency versions to 11.1.0 across multiple packages
package.json Adds dependency resolutions to enforce glob version 11.1.0
modules/statics/src/networks.ts Fixes explorerUrl path (transactions→transaction); however, mainnet/testnet URLs appear swapped
modules/statics/src/map.ts Adds chainId mappings for Hedera EVM (295: hbarevm, 296: thbarevm)
modules/sdk-core/src/bitgo/environments.ts Adds Hedera EVM configuration with Mirror Node API baseUrl and RPC rpcUrl
modules/sdk-coin-evm/src/lib/utils.ts Implements new recovery function with helper methods for Hedera API queries
modules/sdk-coin-evm/test/unit/utils.ts Adds comprehensive test coverage for the new recovery function
modules/sdk-coin-evm/src/evmCoin.ts Integrates Hedera-specific recovery logic using CoinFamily switch case
modules/sdk-coin-evm/package.json Adds superagent dependency for HTTP requests
modules/abstract-eth/src/abstractEthLikeNewCoins.ts Updates nonce retrieval to handle numeric nonce responses from Hedera API
Comments suppressed due to low confidence (1)

modules/statics/src/networks.ts:2050

  • The testnet and mainnet URLs appear to be swapped. HederaEVMTestnet (extends Testnet) has mainnet URLs (https://hashscan.io/mainnet/...), while HederaEVM (extends Mainnet) has testnet URLs (https://hashscan.io/testnet/...). These should be corrected:
  • HederaEVMTestnet should use https://hashscan.io/testnet/transaction/ and https://hashscan.io/testnet/account/
  • HederaEVM should use https://hashscan.io/mainnet/transaction/ and https://hashscan.io/mainnet/account/
  explorerUrl = 'https://hashscan.io/mainnet/transaction/';
  accountExplorerUrl = 'https://hashscan.io/mainnet/account/';
  chainId = 296;
  nativeCoinOperationHashPrefix = '296';
}

class HederaEVM extends Mainnet implements EthereumNetwork {
  name = 'Hedera EVM';
  family = CoinFamily.HBAREVM;
  explorerUrl = 'https://hashscan.io/testnet/transaction/';
  accountExplorerUrl = 'https://hashscan.io/testnet/account/';
  chainId = 295;
  nativeCoinOperationHashPrefix = '295';

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@Venkat-Annavazzala Venkat-Annavazzala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rohitsaw115 rohitsaw115 force-pushed the win-7852 branch 4 times, most recently from 3185665 to dc8f120 Compare November 18, 2025 08:47
Copy link
Contributor

@mohd-kashif mohd-kashif left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rohitsaw115 rohitsaw115 merged commit b3fa864 into master Nov 18, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants