Skip to content

feat: support fixed and percentage contributions#160

Open
None-Feeling wants to merge 1 commit into
sorosave-protocol:mainfrom
None-Feeling:codex/contribution-flexibility-23
Open

feat: support fixed and percentage contributions#160
None-Feeling wants to merge 1 commit into
sorosave-protocol:mainfrom
None-Feeling:codex/contribution-flexibility-23

Conversation

@None-Feeling
Copy link
Copy Markdown

Fixes #23.

Summary

  • add a ContributionType enum with fixed and percentage modes
  • add create_percentage_group and set_member_base_amount so members can declare the base amount used by percentage contributions
  • calculate each member's contribution dynamically in percentage mode and keep RoundInfo.total_contributed as the actual pot size
  • cover percentage contribution behavior with a unit test while preserving existing fixed contribution behavior

Verification

  • cargo fmt -- --check
  • cargo test
  • cargo build --target wasm32-unknown-unknown --release
  • cargo clippy -- -D warnings

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.

Add contribution amount flexibility (fixed vs percentage)

1 participant