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.
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.mdwith a comprehensive table:initializecampaign_initializedUpdated as each method changes.
Acceptance Criteria
docs/api.mdexists.///doc comment.docs/api.mdis inconsistent with the actual contract (likely a manual review gate).Implementation Notes
claporspectaif appropriate.Affected Files / Modules
docs/api.mdcampaign/src/lib.rsREADME.md(link)Dependencies — None.