feat: implement direct soroban read layer and verification surface (#… - #87
Conversation
EmeditWeb
left a comment
There was a problem hiding this comment.
Review verdict: ✅ APPROVE with a minor correction
Good transparency feature. Verified locally: build passes, lint clean, tests pass (27). The new soroban.service.ts is read-only (no signing, submit, secret, or Keypair usage), so exposing a direct on-chain verification surface here is safe and appropriate. No hardcoded hex, no API calls in pages.
Minor correction: one any at src/services/soroban.service.ts:75 — const rawSim = simResult as any. Please give it a proper type (or cast to unknown and narrow) to satisfy the no-any standard; it's the only violation in the PR.
Otherwise merge-ready.
…egacy peer dependencies
|
@EmeditWeb any update as regards reviewing? |
I'm currently auditing it |
EmeditWeb
left a comment
There was a problem hiding this comment.
Re-audited after today's update: the any cast at soroban.service.ts:75 is removed (commit 787f326), soroban read layer is read-only (no signing/submit), build passes, eslint . clean, 27 tests pass, CI green. Approving and merging. (Note: #88 was built on top of this branch and will be rebased onto main after this lands.)
Closes #85
Features & Enhancements
Direct Soroban Smart Contract Read Layer
src/services/soroban.service.ts) using@stellar/stellar-sdkrpc.Server.getContractWasmByContractIdand calculates actual SHA-256 hashes client-side.get_pool_stats(Liquidity Pool contract)get_score(Reputation contract)get_loan(Creditline contract)reconcilePoolStats) to compare API-reported values against direct Soroban contract state and compute mismatch flags.Trust-Minimized Verification Surface (
ContractsPage)Contracts.tsxwith live on-chain WASM hashes.Mismatchwarning flags if API numbers diverge from on-chain state.Dynamic Pool Overview (
HomePage)Home.tsxwith live reads fetched viasorobanServiceandpoolService.Verification & Testing
src/services/__tests__/soroban.service.test.ts.npm testpasses with 27 tests (6 new tests added).npm run lintpasses with 0 errors and 0 warnings.npm run buildcompiles with 0 errors.lucide-reactonly, no direct API/RPC calls in page components.Related Issues
Closes #85