Skip to content

Documented API table for CampaignContract::* should replace per-method drifting comments #42

Description

@P3az3

Problem Statement The contract has the following public methods, but their documented behavior is scattered across many inline doc-comments:

  • initialize, donate, get_total_raised, get_donation_count, get_donor_count, get_release_count, get_total_tx_count, get_campaign_report, get_platform_summary, get_dashboard_metrics, get_donor_record, hello, version, is_refund_eligible, claim_refund, end_campaign, cancel_campaign, extend_deadline, get_campaign_status, release_milestone, release_milestone_multi_asset, get_milestone_view, get_all_milestones, upgrade, freeze, unfreeze.

There is no central table. Drift between docs and code is hard to detect.

Expected Outcome A new docs/api.md with a comprehensive table:

Method Auth Mutates Events Emitted Idempotent Errors
initialize creator yes campaign_initialized no (once-only) ...
...

Updated as each method changes.

Acceptance Criteria

  • docs/api.md exists.
  • Cross-references from each method's /// doc comment.
  • CI step fails if docs/api.md is inconsistent with the actual contract (likely a manual review gate).

Implementation Notes

  • Generate this table from clap or specta if appropriate.

Affected Files / Modules

  • New: docs/api.md
  • campaign/src/lib.rs
  • README.md (link)

Dependencies — None.

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26documentationImprovements or additions to documentationpriority/p3Nice-to-have.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions