Skip to content

Add a RECUR persistent storage key and read_recurring_payment/write_recurring_payment helpers with TTL bumping #432

Description

@thegreatfeez

Smart Contract — New Feature

Summary

A recurring schedule must be persisted and kept alive in storage. This adds a persistent storage key and read/write helpers for schedules, mirroring how proposals are stored.

Background

Proposals are persisted through read_proposal and write_proposal in contracts/accord/src/lib.rs, stored under a persistent key by id and kept alive with a TTL bump via the existing bump_persistent helper. Recurring schedules need the same treatment under their own key.

What Needs to Be Done

  1. Add a persistent storage key for recurring schedules (for example a RECUR key), keyed by schedule id.
  2. Add read_recurring_payment and write_recurring_payment helpers mirroring read_proposal and write_proposal.
  3. Bump the persistent entry's TTL on write using the existing bump helper, matching the proposal pattern.

Acceptance Criteria

  • A schedule can be written to and read back from persistent storage by its id.
  • Writing a schedule bumps its persistent TTL the way proposals do.
  • Reading a missing schedule returns a not-found error consistent with the proposal path.

Files to Look At

  • contracts/accord/src/lib.rs — add helpers near read_proposal/write_proposal and the storage key definitions

Difficulty: Medium

Activity

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions