An MVP platform for managing and rewarding contributors in a decentralized manner using Solana. The platform connects contributors with tasks, allowing them to claim, work on, and submit tasks while being rewarded for their efforts. It also ensures fair distribution and accountability through blockchain-based records.
-
For integration test, make sure your solana wallet has enough SOL to pay for the transaction fees or get some faucet here.
In today’s world, people face challenges finding credible projects to contribute to and ensuring that their work is fairly compensated. The MVP Contributor platform aims to address this by offering a decentralized solution for task management, enabling contributors to participate in projects securely and transparently on the Solana blockchain.
- Install Dependencies:
-
- Make sure to use stable version:
rustup default stable
-
- Use v1.18.18
- After you have Solana-CLI installed, you can switch between versions using:
solana-install init 1.18.18
-
- Use v0.30.1
- After you have Anchor installed, you can switch between versions using:
avm use 0.30.1
-
npm install
-
Build the Program:
- Navigate to the
anchor_project
directory:
cd anchor_project
- Build the program:
anchor build
- Navigate to the
-
Test the Program:
- Run tests to ensure everything is working correctly:
anchor test
-
Install Node.js and npm:
- Ensure you have Node.js and npm installed. You can download them from nodejs.org.
-
Install Frontend Dependencies:
- Navigate to the frontend directory:
cd frontend
- Install the necessary packages:
npm install
- Build the app:
npm run build
- Navigate to the frontend directory:
-
Run the Frontend App:
- Start the development server:
npm run start
- Open your browser and go to
http://localhost:3000
to view the app.
- Start the development server:
The MVP Contributoor platform is built on the Solana blockchain, leveraging smart contracts to manage contributors, projects, and tasks in a decentralized manner.
Here's a high-level overview of its functionality:
- Contributor Registration: Users can register as contributors on the platform. This involves creating a contributor account that tracks their completed and failed tasks.
- Project Registration: Users can also register projects as an Project owner. Each project is associated with an owner and can have multiple tasks.
- Task Management:
- Create Task: Project owners can create tasks, specifying details such as the task name, description, and duration to complete.
- Update Task: Tasks can be updated to change their name, description, or duration by the project owner of each task.
- Claim Task: Contributors can claim tasks that are open, provided they are not the task creator.
- Submit Task: Once a task is completed, contributors can submit it for review.
- Approve/Reject Task: Project owners can approve or reject submitted tasks. Approved tasks are marked as completed, while rejected tasks are reopened.
sequenceDiagram
title: Register as Contributor
participant User
participant Frontend
participant Solana Program
User->>Frontend: Register as Contributor
Frontend->>Solana Program: Tx: register_contributor
Solana Program->>Solana Program: Initialize Contributor Account
Solana Program->>Solana Program: Mark Name as Taken
Solana Program-->>Frontend: Tx Success
sequenceDiagram
title: Register as Project
participant User
participant Frontend
participant Solana Program
User->>Frontend: Register as Contributor
Frontend->>Solana Program: Tx: register_contributor
Solana Program->>Solana Program: Initialize Contributor Account
Solana Program->>Solana Program: Mark Name as Taken
Solana Program-->>Frontend: Tx Success
source: tasks.rs::create_task()
sequenceDiagram
title: Task Creation
participant User as User: Project Owner
participant Frontend
participant Solana Program
User->>Frontend: Create Task
Frontend->>Frontend: Validate Has Registered as Project Account
Frontend->>Solana Program: Tx: create_task
Solana Program->>Solana Program: Initialize Task Account
Solana Program-->>Frontend: Tx Success
source: tasks.rs::update_task_info() | tasks.rs::update_task_duration()
sequenceDiagram
title: Task Update (Information or Duration)
participant User as User: Project Owner
participant Frontend
participant Solana Program
User->>Frontend: Update Task
Frontend->>Frontend: Validate Has Registered as Project Account
Frontend->>Solana Program: Tx: update_task
Solana Program->>Solana Program: Is Task Creator ?
Solana Program->>Solana Program: Is Task Status: Open ?
Solana Program->>Solana Program: Update Task Account
Solana Program-->>Frontend: Tx Success
source: tasks.rs::claim_task()
sequenceDiagram
title: Task Claim
participant User as User: Contributor
participant Frontend
participant Solana Program
User->>Frontend: Claim Task
Frontend->>Frontend: Validate Has Registered as Contributor Account
Frontend->>Solana Program: Tx: claim_task
Solana Program->>Solana Program: Is Task Status: Open ?
Solana Program->>Solana Program: Claim Task
Solana Program-->>Frontend: Tx Success
source: tasks.rs::submit_task()
sequenceDiagram
title: Task Submit
participant User as User: Contributor
participant Frontend
participant Solana Program
User->>Frontend: Submit Task
Frontend->>Frontend: Validate Has Registered as Contributor Account
Frontend->>Solana Program: Tx: submit_task
Solana Program->>Solana Program: Is Task Claimer ?
Solana Program->>Solana Program: Is Task Status: Claimed ?
Solana Program->>Solana Program: Is Task Duration Ended ?
Solana Program->>Solana Program: Submit Task
Solana Program-->>Frontend: Tx Success
source: tasks.rs::approve_task()
sequenceDiagram
title: Task Approve
participant User as User: Project Owner
participant Frontend
participant Solana Program
User->>Frontend: Approve Task
Frontend->>Frontend: Validate Has Registered as Project Account
Frontend->>Solana Program: Tx: approve_task
Solana Program->>Solana Program: Is Task Creator ?
Solana Program->>Solana Program: Is Task Status: Submitted ?
Solana Program->>Solana Program: Approve Task
Solana Program-->>Frontend: Tx Success
source: tasks.rs::reject_task()
sequenceDiagram
title: Task Reject
participant User as User: Project Owner
participant Frontend
participant Solana Program
User->>Frontend: Reject Task
Frontend->>Frontend: Validate Has Registered as Project Account
Frontend->>Solana Program: Tx: reject_task
Solana Program->>Solana Program: Is Task Creator ?
Solana Program->>Solana Program: Is Task Status: Submitted ?
Solana Program->>Solana Program: Reject Task
Solana Program-->>Frontend: Tx Success
- Off-chain backend integration: as now the program does not handle the prove of work of each claimer, we need to implement a backend that will handle this.
- Reputation system: as now the program does not handle the reputation of each contributor, this will encourage contributors to work harder and improve the quality of their work.
- Reward distribution: as now the program does not handle the reward escrow distribution, we need to implement a mechanism to distribute the rewards to the contributors for encouraging them to work as well.
- Escrow system: this will allow:
- The project owner to escrow the reward for each task and release it to the contributor once the task is approved.
- The contributor to escrow their work for each task and only get back their SOL once the task is approved to reduce the risk of fraud for the project owner.
- DAO integration: integrate the platform with a DAO to allow the community to vote on the projects and tasks that to make the platform more decentralized and trust among both sides: project owners and contributors.
This is a MVP and there is a lot of room for improvement in both security, features and UX, the smart contract is not production ready and should not be used in a production environment.