Overview
Users currently sign transactions blindly — they see the Freighter pop-up but have no understanding of what the transaction will do, what state the contract will be in after it succeeds, or how much it will cost. A simulation sandbox runs the transaction against testnet before the user signs, showing them the exact outcome.
What to build
SorobanSimulator service (frontend, lib/soroban-simulator.ts):
- Accepts a built (unsigned)
SorobanTransaction XDR
- Calls
simulateTransaction on the configured Stellar RPC endpoint
- Parses the
SimulateTransactionResponse: resource fee, CPU instructions, memory bytes, read/write ledger entries
- Returns
{ success: bool, fee_estimate: { resource_fee, base_fee, total_fee_xlm }, state_diff: LedgerEntryDiff[], error?: string }
LedgerEntryDiff — human-readable diff of storage entries that would change:
TransactionPreviewModal component (shown before any sign() call):
- "What this transaction does" description (derived from the method name and decoded arguments)
- Fee breakdown table: resource fee, base fee, total in XLM and USD (using live rate from full-stack issue)
- State diff panel: collapsible table of storage changes
- Risk indicators: warn if transaction writes to more than 10 storage keys (large footprint), or if resource fee exceeds 1 XLM
- "Sign & Submit" and "Cancel" buttons
- Wire into: escrow creation, milestone release, dispute filing — every Soroban transaction entry point
Acceptance Criteria
Technical notes
- Use
@stellar/stellar-sdk rpc.Server.simulateTransaction() for simulation
- ABI decoding: parse
ScVal XDR using the contract's method schema from the registry; unknown types fall back to raw hex display
Overview
Users currently sign transactions blindly — they see the Freighter pop-up but have no understanding of what the transaction will do, what state the contract will be in after it succeeds, or how much it will cost. A simulation sandbox runs the transaction against testnet before the user signs, showing them the exact outcome.
What to build
SorobanSimulatorservice (frontend,lib/soroban-simulator.ts):SorobanTransactionXDRsimulateTransactionon the configured Stellar RPC endpointSimulateTransactionResponse: resource fee, CPU instructions, memory bytes, read/write ledger entries{ success: bool, fee_estimate: { resource_fee, base_fee, total_fee_xlm }, state_diff: LedgerEntryDiff[], error?: string }LedgerEntryDiff— human-readable diff of storage entries that would change:readWritefootprint from the simulation responseLedgerEntryXDR using the contract's ABI (fetched from the contract ABI registry, feat(backend): build Soroban contract ABI version registry — deployed WASM hash tracking, method signature changelog, compatibility matrix, and REST API for client version negotiation #1530){ key, old_value, new_value }where old value is fetched from chain and new is from simulationTransactionPreviewModalcomponent (shown before anysign()call):Acceptance Criteria
simulateTransactionendpoint; notsubmitTransactionEscrowState,MilestoneState,u128amountsSorobanSimulator.parseFeeandLedgerEntryDiffdecoding with fixture XDR blobsTechnical notes
@stellar/stellar-sdkrpc.Server.simulateTransaction()for simulationScValXDR using the contract's method schema from the registry; unknown types fall back to raw hex display