Skip to content

feat: Add group templates and emergency withdrawal test#89

Open
qwldcl-del wants to merge 1 commit intosorosave-protocol:mainfrom
qwldcl-del:main
Open

feat: Add group templates and emergency withdrawal test#89
qwldcl-del wants to merge 1 commit intosorosave-protocol:mainfrom
qwldcl-del:main

Conversation

@qwldcl-del
Copy link

Summary

Implements Issue #78 (Group templates) and adds test for Issue #76 (Emergency withdrawal).

Changes:

  1. Group Templates (Issue Add support for group templates and quick creation presets #78):

    • Added struct with: name, token, contribution_amount, cycle_length, max_members
    • Added storage functions for templates per admin
    • Implemented , , ,
    • Maximum 10 templates per admin
  2. Emergency Withdrawal Test (Issue Add test: emergency withdrawal with unequal contribution states #76):

    • Added test
    • Tests 2 rounds of full contributions
    • Triggers emergency withdrawal mid-round 3 with unequal contributions
    • Verifies proportional distribution and no tokens stuck in contract

Files Modified:

    • Added GroupTemplate and storage keys
    • Added template storage functions
    • New file for template logic
    • Added template functions to contract interface
    • Added emergency withdrawal test

- Add GroupTemplate struct and storage functions
- Implement save_template, get_template, get_admin_templates, create_from_template
- Add test for emergency withdrawal with unequal contribution states
- Support max 10 templates per admin
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.

1 participant