Skip to content

Add fail-closed config profile for production money paths (bets, predictions, claims) #503

Description

@josephchimebuka

Summary

Create a production safety profile that forces fail-closed Soroban, required secrets, disabled stub bets, and refuses to boot if money-path invariants are violated.

Why this matters

Demo-friendly defaults are dangerous if accidentally used in production campaign deployments.

Where to work

  • src/config/ + preflight
  • src/index.ts startup
  • .env.example
  • Render production env docs

What to implement

  1. Define SAFETY_PROFILE=production|demo.
  2. Production: BET_STUB_MODE forbidden, SOROBAN_FAIL_CLOSED=true, secrets required.
  3. Preflight fails fast with actionable errors.
  4. Startup logs active profile.
  5. Tests for preflight accept/reject matrix.

Acceptance criteria

  • Production profile cannot boot in stub mode.
  • Missing secrets fail preflight.
  • Demo profile still easy locally.
  • Docs clearly separate profiles.

Done when

Production money paths cannot silently run in demo-safe mode.

Metadata

Field Value
Difficulty advanced
Complexity high
Good first contribution? no

Metadata

Metadata

Assignees

No one assigned

    Labels

    GrantFox OSSGrantFox OSS campaignMaybe RewardedPotential reward for contributorsStellar WaveIssues in the Stellar wave programThird CampaignCampaign: Third CampaignbackendBackend engineeringdeploymentDeployment and runtime reliabilitysecuritySecurity hardening and abuse resistance

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions