Skip to content

Add an ACTIVE_RECUR instance counter bounded by a new MAX_ACTIVE_RECURRING constant to cap storage cost #434

Description

@thegreatfeez

Smart Contract — New Feature

Summary

The number of active recurring schedules must be capped to control storage costs. This adds an ACTIVE_RECUR instance counter and a MAX_ACTIVE_RECURRING constant, mirroring the existing active-proposal cap.

Background

The contract caps active proposals at MAX_ACTIVE_PROPOSALS via a persisted ACTCNT counter, checked at creation and execute time in contracts/accord/src/lib.rs. Recurring schedules need the same guard: an active-schedule counter and a maximum constant, bounded to prevent unbounded storage growth.

What Needs to Be Done

  1. Define a MAX_ACTIVE_RECURRING constant beside the existing MAX_ACTIVE_PROPOSALS.
  2. Add an ACTIVE_RECUR instance storage key and read_active_recurring_count/write_active_recurring_count helpers mirroring the active-proposal helpers.
  3. The counter should count both Active and Paused schedules.

Acceptance Criteria

  • The contract defines a MAX_ACTIVE_RECURRING constant.
  • The active-recurring counter is persisted in instance storage.
  • The helpers read and write the counter correctly.

Files to Look At

  • contracts/accord/src/lib.rs — add the constant and helpers near the active-proposal equivalents

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