Area: Frontend Β· frontend/src/config/env.ts, config/stellar.ts, context/NetworkContext.tsx
Description
The UI offers a runtime testnet/mainnet switcher (persisted in localStorage), but
STELLAR_CONFIG.factoryContractId is a single value from VITE_FACTORY_CONTRACT_ID, applied to
whichever network is selected. Switching a testnet-configured build to mainnet makes the app issue
mainnet transactions against a contract ID that either doesn't exist on mainnet (confusing "contract
not found" failures) or β the dangerous case β does exist as an unrelated contract at the same ID,
against which users could be prompted to sign real-XLM transactions. The same applies to
VITE_TOKEN_WASM_HASH. Additionally, the hardcoded mainnet RPC endpoint
https://soroban-mainnet.stellar.org (config/stellar.ts:21) is not an SDF-operated public service
(SDF provides no public mainnet Soroban RPC), so mainnet mode is broken at the transport layer too.
The service-worker cache key derives from the single contract ID, compounding cross-network cache
confusion.
Tasks
Acceptance criteria
- Each network resolves its own contract ID, WASM hash, and RPC endpoint, proven by tests.
- It is impossible to end up signing transactions on network A against network B's (or a missing)
contract ID via the switcher.
- Mainnet mode has an explicitly configured, documented RPC endpoint.
Issue 12 of 20 from the codebase audit tracked in ISSUES.md.
Area: Frontend Β·
frontend/src/config/env.ts,config/stellar.ts,context/NetworkContext.tsxDescription
The UI offers a runtime testnet/mainnet switcher (persisted in
localStorage), butSTELLAR_CONFIG.factoryContractIdis a single value fromVITE_FACTORY_CONTRACT_ID, applied towhichever network is selected. Switching a testnet-configured build to mainnet makes the app issue
mainnet transactions against a contract ID that either doesn't exist on mainnet (confusing "contract
not found" failures) or β the dangerous case β does exist as an unrelated contract at the same ID,
against which users could be prompted to sign real-XLM transactions. The same applies to
VITE_TOKEN_WASM_HASH. Additionally, the hardcoded mainnet RPC endpointhttps://soroban-mainnet.stellar.org(config/stellar.ts:21) is not an SDF-operated public service(SDF provides no public mainnet Soroban RPC), so mainnet mode is broken at the transport layer too.
The service-worker cache key derives from the single contract ID, compounding cross-network cache
confusion.
Tasks
VITE_FACTORY_CONTRACT_ID_TESTNET/_MAINNET, same for theWASM hash) resolved through
NETWORK_CONFIGS, with the misconfiguration screen listing exactlywhich network is missing configuration.
configured, instead of switching into a broken state.
VITE_SOROBAN_RPC_URL_MAINNET) withdocumentation on choosing a provider, and validate reachability on startup (surfaced, not
silent).
.env.example,vercel.jsonenv docs, README, and the Vercel deploy button parameters.misconfiguration screen names the missing variable.
Acceptance criteria
contract ID via the switcher.
Issue 12 of 20 from the codebase audit tracked in
ISSUES.md.