Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
name: Bug Report
about: Report a bug or issue with CircleCare care circles platform
title: '[BUG] '
labels: bug
assignees: ''

---

## Bug Description
A clear and concise description of the bug.

## Steps to Reproduce
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

## Expected Behavior
A clear and concise description of what you expected to happen.

## Actual Behavior
What actually happened instead.

## Environment
- **Browser/OS**: [e.g. Chrome 91.0.4472.124 on macOS]
- **Stacks Network**: [e.g. Mainnet, Testnet, Devnet]
- **Wallet**: [e.g. Hiro Wallet, Xverse, Leather]
- **Contract Version**: [e.g. v1.0.0]
- **User Role**: [Circle Member, Circle Admin, Expense Creator]

## Affected Component
- [ ] Circle Management Contract
- [ ] Expense Tracking Contract
- [ ] Settlement Contract
- [ ] Frontend Application
- [ ] Testing Suite
- [ ] Documentation

## Circle/Expense Details
- **Circle ID**: [if applicable]
- **Expense ID**: [if applicable]
- **Transaction Type**: [Create Circle, Add Expense, Settle Expense, Join Circle]
- **STX Amount**: [if applicable]
- **Participants**: [number of people involved]

## Additional Context
Add any other context about the problem here, such as:
- Screenshots
- Error messages
- Transaction IDs
- Contract state information
- Circle configuration details

## Priority
- [ ] Critical (blocks core care circle functionality)
- [ ] High (major expense tracking issue)
- [ ] Medium (minor issue affecting user experience)
- [ ] Low (cosmetic or enhancement)
70 changes: 70 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---
name: Feature Request
about: Suggest a new feature or enhancement for CircleCare care circles platform
title: '[FEATURE] '
labels: enhancement
assignees: ''

---

## Feature Summary
A brief description of the feature you'd like to see implemented.

## Problem Statement
What problem does this feature solve? What pain point does it address for circle members, admins, or expense creators?

## Proposed Solution
Describe your proposed solution in detail. Include:
- How it should work from the perspective of each user type (circle member/admin/expense creator)
- Smart contract modifications needed
- Frontend changes required
- Integration points with existing contracts

## Alternative Solutions
Describe any alternative solutions or features you've considered.

## Technical Implementation
### Smart Contracts
- [ ] New contract functions needed
- [ ] Modifications to existing contracts
- [ ] New contract deployment required
- [ ] Integration with existing contracts

### Frontend
- [ ] New UI components
- [ ] Modified user interfaces
- [ ] New pages/routes
- [ ] API integrations

### Testing
- [ ] Unit tests for new functionality
- [ ] Integration tests
- [ ] End-to-end testing requirements

## User Impact
- **Circle Members**: How does this affect expense sharing and settlement?
- **Circle Admins**: How does this impact circle management and member administration?
- **Expense Creators**: How does this change expense creation and tracking?

## Care Circle Considerations
- **Expense Types**: How does this affect different types of shared expenses?
- **Settlement Logic**: Any changes to automatic or manual settlement processes?
- **Privacy**: Impact on expense visibility and member privacy?
- **Scalability**: Performance implications for large care circles?

## Additional Context
Add any other context or screenshots about the feature request here.

## Implementation Notes
Technical details that might be helpful:
- Contract functions needed
- Data structures required
- Security considerations
- Performance implications
- Backward compatibility requirements

## Priority
- [ ] Critical (core care circle functionality)
- [ ] High (important community feature)
- [ ] Medium (nice to have enhancement)
- [ ] Low (future consideration)
96 changes: 96 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
## Description
Brief description of the changes made in this PR.

## Type of Change
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation update
- [ ] Code refactoring
- [ ] Testing improvements

## Changes Made
### Smart Contracts
- [ ] Modified Clarity contracts in `contracts/`
- [ ] Added new contract functions
- [ ] Updated contract interfaces
- [ ] Changed contract logic
- [ ] Updated contract documentation

### Frontend
- [ ] Updated Next.js/React components
- [ ] Modified styling/CSS/Tailwind
- [ ] Added new pages/routes
- [ ] Updated dependencies
- [ ] Modified user interfaces

### Testing
- [ ] Added new unit tests
- [ ] Updated existing tests
- [ ] Added integration tests
- [ ] Updated test coverage
- [ ] Added contract tests

### Documentation
- [ ] Updated README
- [ ] Added code comments
- [ ] Updated API documentation
- [ ] Added deployment guides
- [ ] Updated contract documentation

## User Role Impact
### For Circle Members
- [ ] Expense sharing changes
- [ ] Settlement process modifications
- [ ] Circle participation updates
- [ ] UI/UX improvements

### For Circle Admins
- [ ] Circle management changes
- [ ] Member administration modifications
- [ ] Settings and configuration updates
- [ ] UI/UX improvements

### For Expense Creators
- [ ] Expense creation changes
- [ ] Expense tracking modifications
- [ ] Receipt handling updates
- [ ] UI/UX improvements

## Care Circle Impact
- [ ] Expense type handling changes
- [ ] Settlement logic modifications
- [ ] Privacy and visibility updates
- [ ] Performance improvements

## Testing
- [ ] Unit tests pass (`npm test`)
- [ ] Integration tests pass
- [ ] Contract tests pass
- [ ] Manual testing completed
- [ ] Cross-browser testing done (if applicable)

## Security Considerations
- [ ] Reviewed for potential security vulnerabilities
- [ ] No sensitive data exposure
- [ ] Contract functions are access-controlled appropriately
- [ ] Expense data privacy maintained
- [ ] User funds protection verified

## Deployment Checklist
- [ ] Contract deployment tested on testnet
- [ ] Frontend builds successfully
- [ ] Environment variables configured
- [ ] Database migrations (if applicable)
- [ ] Monitoring/logging configured
- [ ] STX wallet integration tested

## Screenshots (if applicable)
Add screenshots to show visual changes, especially for frontend modifications.

## Additional Notes
Any additional information or context about this PR, such as:
- Migration guides for breaking changes
- Performance benchmarks
- Integration testing results
- Known limitations or future improvements
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,6 @@ Thumbs.db

# Documentation (keep local only)
docs/*.md
!.github/
*.md
!.github/
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Adekunle Bamz

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
ACTION, ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
103 changes: 103 additions & 0 deletions contracts/contracts/circle-treasury.clar
Original file line number Diff line number Diff line change
Expand Up @@ -527,3 +527,106 @@
false
)
)

;; Bulk Operations

;; Add multiple expenses in one transaction (up to 10)
(define-private (add-expense-internal
(expense-data {description: (string-ascii 200), amount: uint, participants: (list 20 principal)}))
(let
(
(circle-id (get circle-id expense-data))
(description (get description expense-data))
(amount (get amount expense-data))
(participants (get participants expense-data))
)
;; Call the main add-expense function
(add-expense circle-id description amount participants)
)
)

;; Add multiple expenses in one transaction
(define-public (add-multiple-expenses
(circle-id uint)
(expenses (list 10 {description: (string-ascii 200), amount: uint, participants: (list 20 principal)})))
(let
(
(circle (unwrap! (map-get? circles circle-id) ERR-CIRCLE-NOT-FOUND))
(member-key {circle-id: circle-id, member: tx-sender})
)
;; Basic validations
(asserts! (not (get paused circle)) ERR-CIRCLE-PAUSED)
(asserts! (get active (unwrap! (map-get? members member-key) ERR-MEMBER-NOT-FOUND)) ERR-UNAUTHORIZED)
(asserts! (> (len expenses) u0) ERR-INVALID-AMOUNT)

;; Process all expenses - each will validate individually
(ok (map add-expense-internal
(map (lambda (expense) (merge expense {circle-id: circle-id})) expenses)))
)
)

;; Settle multiple debts in one transaction (up to 10)
(define-private (settle-debt-internal (settlement-data {creditor: principal}))
(let
(
(circle-id (get circle-id settlement-data))
(creditor (get creditor settlement-data))
)
;; Call the main settle function
(settle-debt-stx circle-id creditor)
)
)

;; Settle multiple debts in one transaction
(define-public (settle-multiple-debts
(circle-id uint)
(settlements (list 10 {creditor: principal})))
(let
(
(circle (unwrap! (map-get? circles circle-id) ERR-CIRCLE-NOT-FOUND))
(member-key {circle-id: circle-id, member: tx-sender})
)
;; Basic validations
(asserts! (not (get paused circle)) ERR-CIRCLE-PAUSED)
(asserts! (get active (unwrap! (map-get? members member-key) ERR-MEMBER-NOT-FOUND)) ERR-UNAUTHORIZED)
(asserts! (> (len settlements) u0) ERR-INVALID-AMOUNT)

;; Process all settlements - each will validate individually
(ok (map settle-debt-internal
(map (lambda (settlement) (merge settlement {circle-id: circle-id})) settlements)))
)
)

;; Bulk add members to circle (up to 10)
(define-private (add-member-internal
(member-data {member: principal, nickname: (string-ascii 32)}))
(let
(
(circle-id (get circle-id member-data))
(member (get member member-data))
(nickname (get nickname member-data))
)
;; Call the main add-member function
(add-member circle-id member nickname)
)
)

;; Add multiple members in one transaction
(define-public (add-multiple-members
(circle-id uint)
(new-members (list 10 {member: principal, nickname: (string-ascii 32)})))
(let
(
(circle (unwrap! (map-get? circles circle-id) ERR-CIRCLE-NOT-FOUND))
)
;; Basic validations
(asserts! (is-eq tx-sender (get creator circle)) ERR-UNAUTHORIZED)
(asserts! (not (get paused circle)) ERR-CIRCLE-PAUSED)
(asserts! (> (len new-members) u0) ERR-INVALID-AMOUNT)
(asserts! (<= (+ (get member-count circle) (len new-members)) MAX-MEMBERS) ERR-MAX-MEMBERS)

;; Process all member additions - each will validate individually
(ok (map add-member-internal
(map (lambda (member-data) (merge member-data {circle-id: circle-id})) new-members)))
)
)
Loading