Skip to content

Feat/realtime sponsor dashboard#40

Merged
EmeditWeb merged 9 commits into
StepFi-app:mainfrom
KingFRANKHOOD:feat/realtime-sponsor-dashboard
Jun 27, 2026
Merged

Feat/realtime sponsor dashboard#40
EmeditWeb merged 9 commits into
StepFi-app:mainfrom
KingFRANKHOOD:feat/realtime-sponsor-dashboard

Conversation

@KingFRANKHOOD

Copy link
Copy Markdown
Contributor

Description

Completes the remaining implementation gaps across the StepFi contracts codebase — fixing a critical bug in the Liquidity Pool, exposing the loan counter for frontend enumeration, adding the vouching contract to deployment, and eliminating all compiler warnings.

Changes

Bug fix — calculate_withdrawal empty pool (contracts/liquidity-pool-contract/src/lib.rs)

  • Returns 0 when total_shares == 0 instead of computing a phantom value from the default share price. Two tests were silently failing.

Feature — get_loan_counter public method (contracts/creditline-contract/src/lib.rs)

  • Exposes the existing storage counter as a contract method so frontends can enumerate loan IDs without iterating per-borrower.

Deployment — vouching contract (scripts/deploy-testnet.sh)

  • Added vouching-contract to build, optimize, deploy, initialize (admin, reputation_contract, vouch_boost=5), and write to .env.contracts / deployed-testnet.json.

Cleanup — zero compiler warnings

  • Added #[allow(dead_code)] on intentionally unused safe_math helpers across all contracts.
  • Removed unused imports and variables in test files.

Testing

All 296 tests pass across all 6 contracts — 0 failures, 0 warnings.

Contract Tests
creditline 108 ✓
liquidity-pool 80 ✓
parameters 20 ✓
reputation 51 ✓
vendor-registry 21 ✓
vouching 16 ✓

Build is clean: cargo build produces zero warnings.


Closes #21

…tline integration tests

- Make MockReputation stateful with storage-backed score tracking
- Make MockLiquidityPool stateful with call-tracking and query functions
- Add MockLiquidityPoolEmpty for insufficient-liquidity test scenario
- Add helper methods to TestCtx for querying mock state
- Un-ignore and implement assertions for 5 previously TODO-stubbed tests:
  test_loan_funding_debits_liquidity_pool
  test_repayment_credited_to_liquidity_pool
  test_guarantee_transferred_to_pool_on_default
  test_insufficient_liquidity_rejects_loan_creation
  test_multi_contract_integration_full_flow
…y vouching

- Fix calculate_withdrawal returning non-zero when total_shares == 0
- Add get_loan_counter public method to creditline contract
- Add vouching-contract to deploy-testnet.sh (build, deploy, init, env)
- Zero compiler warnings across all contracts
- 296 tests passing, 0 failing

Closes StepFi-app#21
- useRealtimePool hook with configurable polling via RealtimeChannel
- useRealtimeLoan hook fetching loans via get_loan_counter + get_loan
- ConnectionIndicator in Navbar showing Stellar network status
- Sponsor Dashboard with live-updating stat cards, visual change indicators
- Offline banner handling for Stellar RPC disconnection
- Rewrote soroban.ts for @stellar/stellar-sdk v12 API (simulateTransaction)
- .gitignore updated for Node.js artifacts

Closes StepFi-app#21
@EmeditWeb

Copy link
Copy Markdown
Member

LGTM 🚀

@EmeditWeb EmeditWeb merged commit c7e7f28 into StepFi-app:main Jun 27, 2026
1 check passed
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.

core: implement protocol pause mechanism

2 participants