Skip to content

Add a RecurringKind distinction (FixedAmountPerPeriod vs LinearVesting) stored on the schedule, defaulting to fixed #436

Description

@thegreatfeez

Smart Contract — New Feature

Summary

Schedules can disburse in two ways: a fixed amount each period or a continuous vesting curve. This adds a RecurringKind enum distinguishing the two, defaulting to fixed for the first milestone.

Background

The RecurringPayment struct from the data model work needs a field that distinguishes a fixed-amount-per-period schedule from a linear-vesting schedule. The fixed variant is the primary target for the first implementation; the linear-vesting variant is reserved for future use but the type must be designed now.

What Needs to Be Done

  1. Add a RecurringKind enum with a FixedAmountPerPeriod variant and a LinearVesting variant, stored on the RecurringPayment struct.
  2. Default the kind to FixedAmountPerPeriod when creating a new schedule.
  3. Place the enum beside the existing RecurringStatus definitions.

Acceptance Criteria

  • RecurringKind has FixedAmountPerPeriod and LinearVesting variants.
  • The RecurringPayment struct carries a kind field of this type.
  • New schedules default to FixedAmountPerPeriod.
  • The contract compiles.

Files to Look At

  • contracts/accord/src/lib.rs — add the enum beside RecurringStatus and add the field to the struct

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