Skip to content

Add a ProposalKind::CreateRecurringPayment variant carrying full schedule parameters and wire it into the execute dispatch #437

Description

@thegreatfeez

Smart Contract — New Feature

Summary

To create a recurring schedule through the multisig approval flow, a new proposal kind must carry the full schedule parameters. This adds the ProposalKind::CreateRecurringPayment(...) variant and wires it into the execute dispatch.

Background

The contract's ProposalKind enum in contracts/accord/src/lib.rs currently has transfer, add-owner, remove-owner, change-threshold, and set-spending-limit variants. The execute function dispatches on the kind to perform the corresponding action. A new variant is needed to carry schedule parameters and, when executed, create the persistent schedule.

What Needs to Be Done

  1. Add a ProposalKind::CreateRecurringPayment(...) variant that carries the full schedule parameters (recipient, token, amount, interval, start, optional end, optional cliff, optional cap, kind).
  2. Add a dispatch arm in the execute function for this variant.
  3. The execution logic should validate the schedule parameters, allocate a new recurring id, persist the schedule, and increment the active-recurring counter.

Acceptance Criteria

  • ProposalKind has a CreateRecurringPayment variant with the schedule parameters.
  • The execute function dispatches on it.
  • Execution creates a persistent schedule and increments the active counter.
  • The contract compiles.

Files to Look At

  • contracts/accord/src/lib.rs — the ProposalKind enum and the execute function

Difficulty: Hard

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