Skip to content

Feat/contract 22 instance ttl bump#575

Merged
orunganiekan merged 2 commits into
SiLioLabs:masterfrom
otsimaofficial:feat/contract-22-instance-ttl-bump
Jun 30, 2026
Merged

Feat/contract 22 instance ttl bump#575
orunganiekan merged 2 commits into
SiLioLabs:masterfrom
otsimaofficial:feat/contract-22-instance-ttl-bump

Conversation

@otsimaofficial

Copy link
Copy Markdown
Contributor

No description provided.

otsimaofficial and others added 2 commits June 30, 2026 10:56
[CONTRACT-22] DataKey::ActiveCount, FeeCollector, FeeBps,
GracePeriod, WhitelistEnabled, Admin, and SchemaVersion all live in
instance storage and share one TTL, but the contract never
explicitly extended it. On Soroban mainnet, instance TTL is bounded
— a contract gone dormant for long enough loses its Admin/Token keys
and is effectively bricked.

- New private bump_instance_ttl(env) helper, threshold
  SUBSCRIPTION_TTL_LEDGERS / 2, extend-to SUBSCRIPTION_TTL_LEDGERS
  (only writes when actually needed).
- Called at the start of initialize and every state-mutating public
  function: subscribe/subscribe_with_metadata (via subscribe_inner),
  charge, pay_per_use, cancel, pause/pause_until, resume,
  propose_fee/commit_fee, propose_grace_period/commit_grace_period,
  set_whitelist_enabled, add_merchant/remove_merchant, batch_charge.
- Read-only functions are untouched, per the issue's edge cases.
@orunganiekan orunganiekan merged commit 1b8d3e3 into SiLioLabs:master Jun 30, 2026
0 of 2 checks 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.

2 participants