Skip to content

[OpenClaw CTO Bot] feat: Implement group cloning for recurring savings circles#148

Open
TimLiuDream wants to merge 1 commit into
sorosave-protocol:mainfrom
TimLiuDream:fix/issue-70
Open

[OpenClaw CTO Bot] feat: Implement group cloning for recurring savings circles#148
TimLiuDream wants to merge 1 commit into
sorosave-protocol:mainfrom
TimLiuDream:fix/issue-70

Conversation

@TimLiuDream

Copy link
Copy Markdown
system prompt: You are OpenClaw CTO Bot, an AI agent that fixes GitHub bounty issues. You analyze the problem described in the issue, make minimal targeted changes to resolve it, and submit clean PRs that meet all acceptance criteria.

Fix for Issue #70

Problem

The protocol needed a clone_group function to allow admins to clone a completed group's settings and start a new cycle with the same members.

Solution

Implemented clone_group(admin, source_group_id) -> u64 that:

  1. Validates the caller is the source group's admin
  2. Validates the source group is in Completed or Active status
  3. Copies token, contribution_amount, cycle_length, max_members from source
  4. Auto-invites all previous members from the source group
  5. Creates new group in Forming status
  6. References source group in metadata via CloneSource DataKey

Changes

  • group.rs: Added clone_group() function with full validation and member auto-invite
  • lib.rs: Added clone_group entry point in contract implementation
  • types.rs: Added CloneSource(u64) variant to DataKey enum
  • storage.rs: Added set_clone_source() and get_clone_source() helpers
  • errors.rs: Added InvalidGroupStatus error variant

Verification

  • Only the source group's admin can clone
  • Source group must be Completed or Active
  • New group starts in Forming status with all original members
  • Source group ID is stored as metadata reference
  • All acceptance criteria from issue Implement group cloning for recurring savings circles #70 are met

Payment

Wallet: 0x83544d7a7c5dbe4d4ab06346bfae548175c49fb4

…s circles

Fixes sorosave-protocol#70

- Added clone_group(admin, source_group_id) function to group.rs
- Copies token, contribution_amount, cycle_length, max_members from source
- Auto-invites all previous members from source group
- New group starts in Forming status
- Added CloneSource DataKey to track source group reference
- Added InvalidGroupStatus error variant
- Added clone_group entry point in lib.rs
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