Resolve wallet factory address per chain for CreateIdentity#19
Conversation
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.
There was a problem hiding this comment.
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.
The CHAIN env already selected Chains.Base, but argv only accepted oasis|moonbeam. Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
wallet_factory_address/1now takes the chain and resolves the factory viaDiodeClient.Contracts.Factoryinstead of a hardcoded Oasis address.chainthroughprepare_metatransaction/2so Basedm0CreateIdentity requests target the Base factory (0x1a36092d…).scripts/trace.exsand 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.exsCreateIdentityRequestreceipttois0x1a36092d88fb73692ee7c502978d634c4afcc486