Skip to content

Resolve wallet factory address per chain for CreateIdentity#19

Merged
dominicletz merged 2 commits into
mainfrom
fix/base-wallet-factory-by-chain
Jul 16, 2026
Merged

Resolve wallet factory address per chain for CreateIdentity#19
dominicletz merged 2 commits into
mainfrom
fix/base-wallet-factory-by-chain

Conversation

@dominicletz

Copy link
Copy Markdown
Member

Summary

  • wallet_factory_address/1 now takes the chain and resolves the factory via DiodeClient.Contracts.Factory instead of a hardcoded Oasis address.
  • Pass chain through prepare_metatransaction/2 so Base dm0 CreateIdentity requests target the Base factory (0x1a36092d…).
  • Update scripts/trace.exs and add tests covering Oasis vs Base factory selection.

Without this, Base identity creation succeeds on-chain as a no-op against an empty account, so Base meta-nonces never advance and clients keep pending txs in the UI.

Test plan

  • mix test test/remote_chain/edge_test.exs test/chains/base_test.exs
  • Deploy to a relay and confirm Base CreateIdentityRequest receipt to is 0x1a36092d88fb73692ee7c502978d634c4afcc486
  • Confirm Base identity has code / account root after create, and subsequent meta-txs settle in the client UI

Base CreateIdentityRequest was submitted to the Oasis factory because
wallet_factory_address was hardcoded; look up the factory via diode_client
for the active chain instead.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the wallet factory address lookup to be dynamic based on the chain, replacing the previously hardcoded address. It updates RemoteChain.Edge to accept a chain parameter, adapts the tracing script to resolve the address dynamically using the CHAIN environment variable, and adds corresponding unit tests. The review feedback suggests adding safety checks to handle cases where the chain shell or wallet factory address cannot be resolved (returning nil), preventing potential runtime crashes.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread lib/remote_chain/edge.ex
Comment thread scripts/trace.exs
The CHAIN env already selected Chains.Base, but argv only accepted oasis|moonbeam.

Co-authored-by: Cursor <cursoragent@cursor.com>
@dominicletz
dominicletz merged commit ced17e0 into main Jul 16, 2026
2 checks passed
@dominicletz
dominicletz deleted the fix/base-wallet-factory-by-chain branch July 16, 2026 14:14
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.

1 participant