Skip to content

[Feature] Add add_member and remove_member functions to pool contracts #66

Description

@grantfox-oss

Getting Started

  1. Fork the repository: https://github.com/JointSave-org/Joint_Save
  2. Clone your fork:
   git clone https://github.com/<your-username>/Joint_Save.git
   cd Joint_Save
  1. Create a new branch:
   git checkout -b feat/pool-member-management

Overview

Once a pool is created, the member list is immutable across all pool types. There is currently no way to add latecomers or remove inactive members — confirmed by checking all five contracts (Factory, Rotational, Target, Flexible, Reputation), none of which have an add_member or remove_member function. This limits real-world usability since groups change over time.

Requirements

Smart Contract Changes (all pool types)

Rotational Pool

pub fn add_member(env: Env, admin: Address, new_member: Address)
// Only before round 1 begins (current_round == 0 and no deposits yet)
// Appends new_member to the members Vec

pub fn remove_member(env: Env, admin: Address, member: Address)
// Only callable if member has not deposited in current round
// Removes from members Vec; if current beneficiary is removed, skip to next

Target & Flexible Pools

pub fn add_member(env: Env, admin: Address, new_member: Address)
pub fn remove_member(env: Env, admin: Address, member: Address)
// For target: only if pool is not yet unlocked
// For flexible: refund member's balance before removal

Frontend Changes

  • In group-actions.tsx, show a "Manage Members" section for pool creators (admin only)
  • Input field to add a new Stellar address
  • Member list with a "Remove" button next to each member (admin only)
  • Confirmation dialog before removal: "This will remove [address] from the pool. Their balance will be refunded."

Acceptance Criteria

  • add_member guarded so only the admin can call it
  • remove_member on the flexible pool automatically refunds the removed member's balance
  • Frontend "Manage Members" section only visible to the pool creator/admin
  • Unit tests: add member → deposit → verify new member can deposit; remove member → verify they can no longer deposit

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSOfficial CampaignCampaign: Official CampaignfeatureNew functionality to addmedium-complexityNot too complex, Few files and some planning needed

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions