Skip to content

Add a RECUR_NEXT id counter with read_next_recurring_id/write_next_recurring_id helpers, independent of the proposal id sequence #433

Description

@thegreatfeez

Smart Contract — New Feature

Summary

Recurring schedules need their own independent id sequence. This adds a RECUR_NEXT counter with helpers to read and advance it, kept separate from the proposal id counter.

Background

The contract already maintains a next_id counter for proposals, stored under an instance key and read/written through read_next_id/write_next_id in contracts/accord/src/lib.rs. Recurring schedules must have their own id sequence so the two types do not collide.

What Needs to Be Done

  1. Add an instance storage key for the next recurring schedule id (for example RECUR_NEXT), independent of the proposal id counter.
  2. Add read_next_recurring_id and write_next_recurring_id helpers mirroring the proposal id helpers.
  3. Keep the recurring id counter's initialization and progression separate from the existing proposal sequence.

Acceptance Criteria

  • The recurring id counter is stored independently of the proposal id counter.
  • The helpers read and write the counter correctly.
  • The existing proposal id counter is unchanged.

Files to Look At

  • contracts/accord/src/lib.rs — add the helpers near the existing read_next_id/write_next_id

Difficulty: Medium

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions