Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions contracts/forge-vesting-factory/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,19 @@ assert_eq!(factory.get_schedule_count(), 2);

---

## Storage TTL Strategy

All persistent storage entries in this contract are subject to Stellar's TTL expiry (~30 days without a bump). To prevent vesting data from expiring and locking beneficiary tokens, every mutating function extends the TTL of the entries it touches:

| Function | Entries bumped |
| :--- | :--- |
| `create_schedule()` | `Schedule(id)`, `ScheduleCount` |
| `claim()` | `Schedule(id)`, `Claimed(id)` |
| `cancel()` | `Schedule(id)`, `Claimed(id)`, `VestedAtCancel(id)` |

All bumps use a minimum threshold of **17 280 ledgers** (~1 day) and a target of **34 560 ledgers** (~2 days), matching the convention used by `forge-governor`, `forge-multisig`, and `forge-stream`.

If a schedule is inactive for an extended period, an off-chain keeper or the beneficiary themselves should call `get_status()` (which does not bump TTL) and then `claim()` to refresh the TTL before expiry.
## Storage Strategy

`ScheduleCount` is stored in **persistent** storage (not instance storage). This is critical: if `ScheduleCount` were in instance storage and that entry expired, the counter would reset to 0 and new schedules would silently overwrite existing ones in persistent storage, permanently destroying beneficiary vesting data.
Expand Down
Loading