Enable HyperEVM automatic token detection - #1063
Open
j0ntz wants to merge 1 commit into
Open
Conversation
Add the ethBalCheckerContract address to the HyperEVM RPC adapter config so the engine batch-scans token balances and surfaces tokens that arrive in the wallet, matching the other EVM chains. The contract must be deployed on HyperEVM at this address for detection to work.
Contributor
Author
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.


CHANGELOG
Does this branch warrant an entry to the CHANGELOG?
Dependencies
none
Description
Asana task
Fixes HyperEVM (chainId 999) not auto-detecting tokens that arrive in a wallet. Every other EVM chain auto-detects via a deployed on-chain balance-checker contract; HyperEVM's RPC adapter config was missing the
ethBalCheckerContractaddress, soRpcAdapter.fetchTokenBalancesstayednulland the engine only re-checked already-enabled tokens, never discovering new ones.This adds the contract address to the HyperEVM
rpcadapter config, matching Sonic/Monad/Celo/RSK/FilecoinFEVM/opBNB.Contract deployment. The balance-checker is byte-identical to the one already live on the other chains (same
balances(address[],address[])/tokenBalancecontract). It is deployed on HyperEVM at0x75c246EaCe343aCe287c1A37B45D7BD4214C6f27(tx0x6e811d894e8f6fac31a67e081c7f5f651c72ddba7b34dfea3570f40563563fbb). Its deployed runtime bytecode is verified byte-for-byte equal to the contract on Sonic/Celo/opBNB. The contract is stateless and trustless (pure view functions, no owner, fallback reverts on payment).Note: the canonical
0x726391B6cA41761c4c332aa556Cf804A50279b52used on the other 6 chains was deployed by the Edge deployer EOA0xbc291f404bde7e9e819da0ebe2eb06d400220520(direct CREATE at nonce 0, not a CREATE2 factory), so reproducing that exact address on HyperEVM requires that deployer key. That EOA currently has nonce 0 on HyperEVM, so if chain-wide address consistency is preferred, the contract can instead be deployed from that deployer and this one line updated to0x726391....Testing
balances([wallet],[tokens])returns correct HyperEVM balances (verified via direct RPC call).Note
Low Risk
Single optional config field on HyperEVM network metadata; no auth, spend, or shared engine logic changes.
Overview
HyperEVM wallets can auto-detect incoming ERC-20 tokens again by wiring the same on-chain balance-checker pattern other EVM chains use.
The HyperEVM
rpcnetwork adapter config now includesethBalCheckerContractat0x75c246EaCe343aCe287c1A37B45D7BD4214C6f27, soRpcAdapterbatch balance queries run during sync instead of staying disabled and limiting checks to already-enabled tokens. The Unreleased CHANGELOG entry documents the fix.Reviewed by Cursor Bugbot for commit f73bbc7. Bugbot is set up for automated code reviews on this repo. Configure here.