Mchango / mchango

Welcome to mchango a rotating savings and contribution platform
https://mchango-one.vercel.app/
3 stars 0 forks source link

implement member contribution and reputation assignment #16

Closed 3ill closed 11 months ago

3ill commented 11 months ago

Overview

This document provides an in-depth look at the disbursement and rotation processes within Mchango. Specifically, it outlines the steps involved when groups are in the rotation phase.

Activation of Rotation

During the initial rotation phase, the accumulated contributions from all eligible members are directed to the member occupying the first slot of the array. This procedure is governed by the following steps:

Disbursement Process

  1. Funds Calculation: The total amount collected during the rotation is computed.
  2. Gas Calculation: The gas expenditure required for disbursement is calculated and subtracted from the rotation fund.
  3. Commission Calculation: A 1% commission is calculated and deducted from the rotation funds.
  4. Group State Update: The group's balance field is adjusted to reflect a balance of 0.
  5. Verification of Eligible Members: The member at the front of the array is checked for the isReceived status. If it's set to false, disbursement proceeds. If it's set to true, a verification loop is initiated to ensure all members in the eligible array have a true isReceived status before concluding the rotation phase.
  6. Funds Disbursement: Once all necessary calculations are made, the rotation fund is disbursed to the individual at the front of the array.

Management of Recipients

Recipients of the rotation funds have their hasReceived status updated to true, and the received amount is recorded in the Member struct. Subsequently, recipients are moved to the end of the eligible array.

Rotation and Contribution

After a user is moved to the end of the array, the rotation cycle continues until all members in the array possess a true isReceived status. An automatic deduction mechanism is activated at intervals defined by the group administrator for all eligible array members until every member has a true isReceived status.

Reputation System

Every time a member makes a contribution, their reputation points increase by 1. This boost in reputation points enhances the member's eligibility to participate in other groups.

3ill commented 11 months ago

This function has been implemented and is ready for testing