feat(address): surface undeployed-but-funded addresses instead of "not found" - #87
Merged
Merged
Conversation
…t found" An address can hold token balances before it's ever deployed (funds sent to a counterfactual / not-yet-deployed account). Previously a search for such an address fell through every probe — no class, tx, block, or declared class — and reported "Not found as address, transaction, block hash, or class hash", even though it exists on-chain as a token-transfer recipient. Add a final check to the search resolver: if the hex resolves to nothing else but holds a non-zero balance in one of our known tokens, open the address view with a red "⚠ This contract is not deployed" note in the header (no class line, no deployed-at) and the balances populated. The note is set only once the live class fetch confirms absence (via a new AddressNotDeployed signal), so it never flashes during a normal address load, and it's gated on non-zero balances so a transient RPC error (which also nulls balances) can't trigger a false positive. Skip all enrichment for these addresses — an undeployed address has no txs, calls, events, or class history, so the full pipeline would only burn RPC/Dune/pf round trips for guaranteed-empty results: - the search path emits balances + the marker directly (single balanceOf batch, no pipeline, no redundant second balance fetch) - fetch_and_send_address_info returns right after the nonce/class join when the class is absent, covering the refresh / direct-nav paths - the MetaTxs tab no longer fires its pf-query bloom scan on entry Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Problem
An address can hold token balances before it's ever deployed — funds sent to a counterfactual / not-yet-deployed account. Searching for such an address fell through every probe (no class, tx, block, or declared class) and reported "Not found as address, transaction, block hash, or class hash", even though it exists on-chain as a token-transfer recipient.
What this does
Adds a final check to the search resolver: if a hex query matches nothing else but holds a non-zero balance in one of our known tokens, open the address view instead of erroring — header shows just the address +
Class: N/A Nonce: 0(no deployed-at line) plus a red ⚠ This contract is not deployed note, with the Balances tab populated.The note is set only once the live class fetch confirms the class is absent (via a new
AddressNotDeployedsignal), so it never flashes during a normal address load, and it's gated on non-zero balances so a transient RPC error (which also nulls balances) can't produce a false positive.No wasted API calls
An undeployed address has no txs, calls, events, or class history, so running the full address pipeline would only burn RPC / Dune / pf-query round trips for guaranteed-empty results. Both entry paths skip that work:
AddressBalancesLoaded+AddressNotDeployeddirectly — a singlebalanceOfbatch, no pipeline, no redundant second balance fetch.fetch_and_send_address_inforeturns right after the nonce/class join when the class is absent, before any enrichment (find_deploy_txwas already skipped for these).has_moreflags that default false; empty lists never scroll) and the sanity-check/gap-fill only fires on non-empty tx lists.The
AddressNotDeployedhandler also clearssources_pending/is_loading, so the view settles instead of spinning.Verification
cargo build,cargo build --release,cargo clippy(0 issues in new code),cargo test(all passing).getClassHashAt→ error code 20 "Contract not found", and non-zero balances across several known tokens — exactly the two conditions the code branches on.🤖 Generated with Claude Code