Skip to content

[CRITICAL] Persistent storage TTLs can expire before claims/refunds — user funds permanently locked #166

Description

@grantfox-oss

Summary

All four contracts store user-claimable state (bet entries, refund records, claim windows, referral earnings) in persistent storage entries with fixed TTLs that are never extended on the read path. If a market resolves or a payout window extends beyond the original TTL, the storage entry expires and the data is permanently lost — the user can no longer claim their refund or payout.

Impact

  • Permanent fund lock: expired BetEntry or RefundRecord storage means users lose access to their XLM.
  • No read-bump: view-only operations (e.g., checking claimable amounts) do not extend the TTL, so merely querying state accelerates expiry.
  • Keeper-dependent: only an external keeper can refresh TTLs before they expire; if the keeper is offline, funds are at risk.

Fix

  • Extend the TTL on every read path (Soroban's extend_ttl or equivalent) for entries that hold claimable state.
  • Set TTLs relative to the longest possible claim window, not the creation time.
  • Add a bump_ttl public function callable by anyone for entries close to expiry.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSThird CampaignCampaign: Third CampaigncriticalCritical severity - funds at riskttl-storageTTL / storage lifecycle

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions