A blockchain-based implementation of traditional rotating savings and credit associations (ROSCAs), commonly known as "ajo" in Nigeria or "esusu" in Yoruba communities. This smart contract brings transparency, automation, and trust to community savings circles.
## Overview
The Village Savings Pool smart contract allows groups of people to pool their money together in a transparent, automated manner. Members contribute a fixed amount at regular intervals, and each cycle, one member receives the entire pool. This continues until all members have received their payout.
## Key Features
### Core Functionality
- **Group Creation**: Anyone can initialize a savings pool with customizable parameters
- **Member Management**: Pool creators can add trusted members to their circle
- **Scheduled Contributions**: Members contribute fixed amounts at defined intervals
- **Automated Payouts**: The pool amount is distributed to the designated recipient each cycle
- **Transparent Tracking**: All contributions and payouts are recorded on-chain
- **Cycle Management**: Automatic progression through member rotation
### Security Features
- Only pool creators can add members
- Members can only contribute during active cycles
- Payouts are only possible when the full pool amount is collected
- Each member receives exactly one payout per complete rotation
- Pool state prevents double-spending and unauthorized withdrawals
## How It Works
1. **Pool Initialization**: A pool owner creates a new savings pool, defining:
- Contribution amount per member
- Number of cycles (typically equals number of members)
- Pool parameters
2. **Member Enrollment**: The pool owner adds trusted members to the circle
3. **Contribution Phase**: Each cycle, all members contribute their share to the pool
4. **Payout Phase**: Once all contributions are collected, the designated member for that cycle receives the full pool amount
5. **Cycle Rotation**: The process repeats until all members have received their payout
## Smart Contract Architecture
### Data Structures
- **Pool Configuration**: Stores pool settings and current state
- **Member Registry**: Tracks member participation and payout status
- **Contribution Records**: Maintains history of all contributions
- …