EsusuChain is a blockchain-based implementation of traditional rotating savings and credit associations (ROSCA), also known as "Esusu" in many African communities. Built on the Flow blockchain with Cadence smart contracts, it provides a trustless, automated savings circle system powered by Flow Token (FLOW).
Contract Address: 0xa89655a0f8e3d113 (deployed on Flow testnet)
Vercel link: https://esusu-chain.vercel.app/
- Any user can create a new savings circle
- Define number of members, contribution amount, and cycle duration
- Creator automatically becomes the first member
- Immutable circle parameters stored on-chain
- Scheduled contributions using Forte Workflow
- Members automatically contribute on each cycle
- No manual intervention required
- Contributions tracked transparently on-chain
- Payouts triggered automatically when all members contribute
- Funds distributed in predetermined rotation order
- Each member receives total pool amount once
- Circle completes after all members receive payouts
- Built on Flowβs FungibleToken standard
- Uses Flow Token (FLOW) for contributions and payouts
- Secure vault management for all circle funds
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β EsusuChain Contract β
β β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ β
β β Circle β β Circle β β Circle β β
β β Resource β β Resource β β Resource β β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ β
β β β β β
β ββββββββββββββββββββ΄βββββββββββββββββββ β
β β β
β Vaults β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Forte Workflow β
β β
β ββββββββββββββββββββ ββββββββββββββββββββ β
β β Contribution β β Payout β β
β β Scheduler ββββββββββΆβ Executor β β
β ββββββββββββββββββββ ββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π’ Social Media Post
Weβve officially launched EsusuChain on the Flow blockchain β a decentralized platform bringing African-style rotating savings groups (Esusu) to Web3!
Join the revolution of community savings powered by Flow. πΈπ
π Try it here: https://esusuchain.vercel.app
π Contract: 0xa89655a0f8e3d113 (Flow Testnet)
#FlowBlockchain #EsusuChain #Web3Savings #FlowHackathon @flow_blockchain
π Posted on X (Twitter): https://x.com/0xDanny__/status/1984279590085546115
esusu_chain/
βββ cadence/
β βββ contracts/
β β βββ EsusuChain.cdc # Main contract
β βββ transactions/
β β βββ setup_circle_manager.cdc
β β βββ create_circle.cdc
β β βββ join_circle.cdc
β β βββ setup_usdc_vault.cdc
β β βββ make_contribution.cdc
β β βββ execute_payout.cdc
β βββ scripts/
β β βββ get_circle_info.cdc
β β βββ get_member_info.cdc
β β βββ get_user_circles.cdc
β β βββ check_balance.cdc
β βββ tests/
β βββ EsusuChain_test.cdc
βββ flow.json
βββ README.md (Flow project docs)
βββ ESUSU_README.md (This file)
βββ FORTE_WORKFLOW_INTEGRATION.md
- Flow CLI installed
- Node.js and npm (for Forte Workflow integration)
- Flow wallet account with USDC
-
Navigate to the project:
cd esusu_chain -
Start the Flow emulator:
flow emulator start
-
Deploy contracts (in a new terminal):
flow project deploy --network emulator
Run the comprehensive test suite:
flow test cadence/tests/EsusuChain_test.cdcFirst, set up a CircleManager resource in your account:
flow transactions send cadence/transactions/setup_circle_manager.cdc \
--network testnet \
--signer your-accountCreate a new savings circle:
flow transactions send cadence/transactions/create_circle.cdc \
--args-json '[
{"type": "UInt64", "value": "4"},
{"type": "UFix64", "value": "100.0"},
{"type": "UFix64", "value": "604800.0"}
]' \
--network testnet \
--signer your-accountParameters:
- Number of members: 4
- Contribution amount: 100.0 USDC
- Cycle duration: 604800 seconds (7 days)
Join an existing circle:
flow transactions send cadence/transactions/join_circle.cdc \
--args-json '[
{"type": "UInt64", "value": "0"}
]' \
--network testnet \
--signer member-accountGet details about a circle:
flow scripts execute cadence/scripts/get_circle_info.cdc \
--args-json '[
{"type": "UInt64", "value": "0"}
]' \
--network testnetContribute to a circle:
flow transactions send cadence/transactions/make_contribution.cdc \
--args-json '[
{"type": "UInt64", "value": "0"},
{"type": "UFix64", "value": "100.0"}
]' \
--network testnet \
--signer member-accountRepresents a savings circle with:
circleId: Unique identifiernumberOfMembers: Total members in circlecontributionAmount: Amount each member contributescycleDuration: Time between cyclescurrentCycle: Current cycle numbercurrentPayoutPosition: Next member to receive payoutmembers: Member information mappingvault: Flow Token vault holding contributions
Manages multiple circles for a user:
- Creates new circles
- Tracks circle IDs
- Provides public interface for queries
Creates a new savings circle with specified parameters.
Adds a member to an existing circle.
Processes a member's contribution for the current cycle.
Executes payout to the next member in rotation.
Advances to the next cycle after all contributions received.
The contract emits the following events:
CircleCreated: New circle createdMemberJoined: Member joined a circleContributionMade: Member made a contributionPayoutExecuted: Payout sent to memberCycleAdvanced: Circle advanced to next cycleCircleCompleted: All payouts completed
EsusuChain uses Forte Workflow for automated contributions and payouts. See FORTE_WORKFLOW_INTEGRATION.md for detailed setup instructions.
- Automatic contribution scheduling
- No manual transaction triggering
- Gas-efficient execution
- Reliable timing
- Event-driven automation
- Member Verification: Only registered members can contribute
- Amount Validation: Contributions must match exact circle amount
- Cycle Management: Payouts only execute when all members contribute
- Status Checks: Circle must be active for operations
- Vault Security: Circle funds are securely stored in isolated FLOW token vaults, ensuring transparent and tamper-proof fund management on-chain.
The project includes comprehensive tests covering:
-
Circle Creation Tests
- Valid circle creation
- Invalid parameter handling
- Multiple circles per user
-
Membership Tests
- Joining circles
- Full circle prevention
- Duplicate member prevention
-
Contribution Tests
- Valid contributions
- Amount validation
- Cycle advancement
-
Payout Tests
- Correct recipient selection
- Amount calculation
- Circle completion
-
Integration Tests
- Full circle lifecycle
- Multi-cycle operation
- Error handling
- Update
flow.jsonwith your testnet account address - Deploy to testnet:
flow project deploy --network testnet
- Thoroughly test on testnet
- Audit smart contracts
- Update
flow.jsonmainnet configuration - Deploy:
flow project deploy --network mainnet
- Implement penalty mechanism for missed contributions
- Add emergency withdrawal functionality
- Support multiple token types (not just Flow Token)
- Build web interface for circle management
- Implement reputation system for members
- Add circle discovery and recommendation features
- Support variable contribution amounts
- Implement lending features on top of savings
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Submit a pull request
This project is licensed under the MIT License.
Built with β€οΈ for the Web3 community