Skip to content

fix(crowdfund): count collected pledges toward milestone voting/refun… - #1387

Merged
afurious merged 2 commits into
Crowdfunding-DApp:mainfrom
chideraisiguzor:fix/milestone-weight-includes-pledges
Aug 24, 2026
Merged

fix(crowdfund): count collected pledges toward milestone voting/refun…#1387
afurious merged 2 commits into
Crowdfunding-DApp:mainfrom
chideraisiguzor:fix/milestone-weight-includes-pledges

Conversation

@chideraisiguzor

Copy link
Copy Markdown
Contributor

closes #1374

…d weight

collect_pledges() folded collected pledge amounts into TotalRaised (and therefore the frozen MilestoneBasis) but never wrote a DataKey::Contribution record for the pledger. execute_vote_milestone and execute_claim_milestone_refund derive weight solely from DataKey::Contribution, so a campaign funded predominantly or entirely through pledges had milestone governance with no electorate and no way for backers to reclaim their share of a rejected milestone.

Fold each successfully collected pledge into the pledger's Contribution record at collection time, and add the pledger to Contributors (capacity permitting) so get_stats and NFT reward minting see them too.

Note: this changes fund-accounting semantics going forward only. Existing deployed campaigns with pledges already collected before this fix will still show zero weight for those pledgers unless a storage backfill is performed.

Description

Related Issues

Closes #

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • CI / Infrastructure

Required CI Checks

The following status checks must pass before this PR can be merged:

Frontend CI (frontend_ci.ymlci-frontend job):

  • TypeScript type-check (pnpm --filter @stellar-raise/frontend typecheck)
  • Vitest test suite (pnpm --filter @stellar-raise/frontend test)
  • ESLint across all workspaces (pnpm lint)
  • Prettier format check (pnpm format:check)

Rust CI (rust_ci.ymlcheck job):

  • cargo fmt --all -- --check
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo build --release --target wasm32-unknown-unknown
  • cargo test --workspace

Checklist

  • My branch is based off develop, not main
  • I have run cargo fmt --all and the code is properly formatted
  • I have run cargo clippy --all-targets -- -D warnings with no warnings
  • I have run cargo test and all tests pass
  • I have run pnpm typecheck with no type errors
  • I have run pnpm test and all frontend tests pass
  • I have run pnpm lint with no ESLint errors
  • I have run pnpm format:check with no formatting violations
  • I have added tests for any new functionality
  • All public functions have /// doc comments
  • I have updated CHANGELOG.md if applicable
  • My commit messages follow the conventional commits format

Screenshots / Logs (if applicable)

Additional Notes

…d weight

collect_pledges() folded collected pledge amounts into TotalRaised (and
therefore the frozen MilestoneBasis) but never wrote a DataKey::Contribution
record for the pledger. execute_vote_milestone and execute_claim_milestone_refund
derive weight solely from DataKey::Contribution, so a campaign funded
predominantly or entirely through pledges had milestone governance with no
electorate and no way for backers to reclaim their share of a rejected
milestone.

Fold each successfully collected pledge into the pledger's Contribution
record at collection time, and add the pledger to Contributors (capacity
permitting) so get_stats and NFT reward minting see them too.

Note: this changes fund-accounting semantics going forward only. Existing
deployed campaigns with pledges already collected before this fix will still
show zero weight for those pledgers unless a storage backfill is performed.
CI's Check, Lint & Test job failed on cargo fmt --all -- --check for the
new pledge-funded milestone governance tests added in b07fd40.
@afurious
afurious merged commit 55c6489 into Crowdfunding-DApp:main Aug 24, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Audit #72] Milestone voting/refund weight derives only from Contribution, permanently excluding pledgers

2 participants