Skip to content
This repository was archived by the owner on Jun 12, 2026. It is now read-only.
This repository was archived by the owner on Jun 12, 2026. It is now read-only.

Allow campaign owner to cancel pre-funded campaigns #6

Description

@0xdevcollins

Problem

Only admin can cancel campaigns (cancel_campaign and terminate_campaign are both admin-only). Campaign creators have no way to cancel their own campaigns before funding completes.

Current Behavior

  • cancel_campaign() — admin-only
  • terminate_campaign() — admin-only
  • Creator has no cancel function

Expected Behavior

Add owner_cancel_campaign(campaign_id):

  • Owner-only (require auth)
  • Only allowed in Draft, Submitted, or Campaigning status (not after Funded)
  • If Campaigning with existing pledges, trigger refund batches
  • Emit CampaignCancelledByOwner event

Acceptance Criteria

  • Owner can cancel in Draft/Submitted/Campaigning states
  • Refunds triggered automatically if pledges exist
  • Cannot cancel after Funded (milestones in progress)
  • Event emitted for indexer
  • Tests cover all cancel scenarios

Priority

Medium — Improves creator autonomy. Currently creators must ask admin to cancel.

Labels

crowdfunding, smart-contract, enhancement

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions