Mchango / mchango

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

update the release collection function #25

Closed 3ill closed 11 months ago

3ill commented 11 months ago

this function can be called automatically, when alll members in the eligible array has made their contribution or it can be called by the admin

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.