Skip to content

Open Source Project Funding Smart Contract#1

Open
Vicky08100 wants to merge 3 commits into
mainfrom
open
Open

Open Source Project Funding Smart Contract#1
Vicky08100 wants to merge 3 commits into
mainfrom
open

Conversation

@Vicky08100
Copy link
Copy Markdown
Owner

Overview

This PR introduces a new smart contract that enables decentralized funding for open source projects on the Stacks blockchain. The contract allows project creators to set up projects with milestones, receive funding from contributors, and release funds upon milestone completion.

Key Features

  • Project creation with title, description, and funding target
  • Milestone-based development tracking
  • Secure STX token transfers for project funding
  • Contributor tracking and management
  • Automated milestone completion verification
  • Input validation and error handling throughout

Technical Details

Data Structures

  • open-source-projects: Maps project IDs to project details
  • project-development-milestones: Maps project and milestone IDs to milestone details
  • project-funding-contributors: Tracks contributor funding amounts

Public Functions

  1. create-open-source-project: Create new projects with funding targets
  2. add-project-milestone: Add development milestones to projects
  3. contribute-project-funding: Allow STX contributions to projects
  4. complete-project-milestone: Mark milestones as complete and release funds

Read-Only Functions

  1. get-project-details: Retrieve project information
  2. get-milestone-details: Get milestone information
  3. get-contributor-funding-amount: Check contribution amounts
  4. is-project-fully-funded: Check project funding status
  5. is-milestone-completed: Verify milestone completion
  6. get-total-projects: Get total number of projects

Security Features

  • Input validation for all function parameters
  • Access control checks for administrative functions
  • Safe STX transfer handling
  • Protection against common smart contract vulnerabilities

Implementation Notes

  • Uses Clarity's built-in STX transfer capabilities
  • Implements proper error handling with descriptive error codes
  • Follows best practices for Clarity smart contract development
  • All public functions include input validation
  • Read-only functions maintain data integrity

Security Considerations

  • All user inputs are validated
  • STX transfers use try! for proper error handling
  • Access controls prevent unauthorized modifications
  • Milestone completion requires deadline verification

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant