-
Notifications
You must be signed in to change notification settings - Fork 299
feat: recovery support for Hedera EVM #7521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
6ab7807 to
02b138f
Compare
mullapudipruthvik
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add tests
29bc8e2 to
52bebca
Compare
52bebca to
05dacbe
Compare
ArunBala-Bitgo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
There was a problem hiding this 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_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.
Venkat-Annavazzala
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
5f3ca58
3185665 to
dc8f120
Compare
dc8f120 to
b832596
Compare
mohd-kashif
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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.