Skip to content

Feature: Bulk Add Members to Pools in UI #314

@sirpy

Description

@sirpy

Feature: Bulk Add Members to Pools in UI

Is your feature request related to a problem? Please describe.
Currently, pool managers can only add members one by one through the "Member Management" tab in the UI. This becomes a tedious and time-consuming process when a large number of members need to be added to a pool. The underlying smart contracts (DirectPaymentsPool.sol and UBIPool.sol) already support bulk addition via the addMembers function, but this functionality is not exposed in the user interface.

Describe the solution you'd like
We need to implement a feature in the "Member Management" section of the ManageCollectivePage.tsx that allows pool managers to add multiple members simultaneously. This could involve:

  1. A text area where users can paste a list of wallet addresses (e.g., comma-separated, or one per line).
  2. Optionally, a file upload mechanism for a CSV file containing a list of addresses.

Upon submission, the UI should call the addMembers function on the relevant pool contract (DirectPaymentsPool or UBIPool) with the provided list of addresses.

Describe alternatives you've considered
The current alternative is to manually add each member, which is inefficient for large-scale operations. Direct interaction with the smart contract (e.g., via Etherscan or a custom script) is also possible but is not user-friendly for non-technical managers.

Acceptance Criteria

  • A new UI component (e.g., a dedicated section or a button triggering a modal) is added to the "Member Management" tab on ManageCollectivePage.tsx.
  • The component provides an input method for multiple wallet addresses (e.g., a multi-line text area).
  • The input addresses are validated (e.g., basic address format check).
  • Upon submission, the UI calls the addMembers function on the DirectPaymentsPool or UBIPool contract, passing the array of member addresses. For the extraData parameter, an empty array of bytes ([]) should be passed for all members in the initial implementation, as the current contract logic allows for this.
  • The UI provides clear feedback to the user during the transaction (e.g., "Adding members...", "Transaction confirmed", "Error: ...").
  • Successfully added members should appear in the "Current Members" list after the transaction is confirmed and the data is refreshed.
  • The feature should be accessible only to users with the MANAGER_ROLE.

Relevant Files:

  • /Users/hadarro/workspace/GoodDollar/SegmentedUBI/packages/app/src/pages/ManageCollectivePage.tsx
  • /Users/hadarro/workspace/GoodDollar/SegmentedUBI/packages/contracts/contracts/DirectPayments/DirectPaymentsPool.sol (specifically the addMembers function)
  • /Users/hadarro/workspace/GoodDollar/SegmentedUBI/packages/contracts/contracts/UBI/UBIPool.sol (specifically the addMembers function)
  • The useMemberManagement hook (likely located in packages/app/src/hooks/managePool/useMemberManagement.ts or similar) will need to be updated to support this new functionality.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

In Review

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions