feat: recovery support for Hedera EVM#7521
Merged
rohitsaw115 merged 1 commit intomasterfrom Nov 18, 2025
Merged
Conversation
6ab7807 to
02b138f
Compare
mullapudipruthvik
previously requested changes
Nov 18, 2025
Contributor
mullapudipruthvik
left a comment
There was a problem hiding this comment.
please add tests
29bc8e2 to
52bebca
Compare
52bebca to
05dacbe
Compare
There was a problem hiding this comment.
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_BlockchainExplorerQueryfunction 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(extendsTestnet) has mainnet URLs (https://hashscan.io/mainnet/...), whileHederaEVM(extendsMainnet) has testnet URLs (https://hashscan.io/testnet/...). These should be corrected:
- HederaEVMTestnet should use
https://hashscan.io/testnet/transaction/andhttps://hashscan.io/testnet/account/ - HederaEVM should use
https://hashscan.io/mainnet/transaction/andhttps://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.
5f3ca58
3185665 to
dc8f120
Compare
dc8f120 to
b832596
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.