Skip to content

seun-ola/-Knowledge-Sharing-Platform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 

Repository files navigation

Knowledge Sharing Platform - Clarity Smart Contract

A decentralized knowledge sharing platform built on the Stacks blockchain using Clarity smart contracts. This platform enables users to create, share, and reward valuable knowledge content while building reputation through community engagement.

Features

Core Functionality

  • Article Creation: Users can publish knowledge articles with titles, content hashes, and categories
  • Voting System: Community-driven upvote/downvote mechanism for content quality assessment
  • Reward System: STX-based rewards for valuable content creators
  • Reputation System: Dynamic reputation scoring based on contributions and community feedback
  • Category Management: Organized content categorization with admin controls
  • Content Moderation: Article locking capabilities for authors and administrators

Key Components

  • User Profiles: Track reputation, article count, total rewards, and join date
  • Article Management: Comprehensive article metadata with voting and reward tracking
  • Category System: Pre-defined categories (technology, science, education, business, general)
  • Platform Economics: Configurable platform fees and minimum stake requirements

Contract Structure

Data Maps

  • articles: Stores article metadata, votes, and reward pools
  • user-profiles: User reputation and statistics
  • article-votes: Tracks individual user votes per article
  • article-rewards: Records reward contributions
  • categories: Category status and article counts

Constants & Variables

  • Platform fee: 5% (configurable by owner)
  • Minimum stake: 1 STX (configurable by owner)
  • Error codes for comprehensive error handling

Functions

Read-Only Functions

  • get-article(article-id): Retrieve article details
  • get-user-profile(user): Get user profile information
  • get-article-vote(article-id, voter): Check user's vote on article
  • get-category-info(category): Get category status and stats
  • get-platform-stats(): Platform-wide statistics

Public Functions

Content Management

  • create-article(title, content-hash, category): Publish new article (+10 reputation)
  • vote-article(article-id, is-upvote): Vote on articles (+5/-2 reputation to author)
  • lock-article(article-id): Lock article from further interactions

Rewards & Economics

  • reward-article(article-id): Send STX rewards to article authors (+20 reputation to author, +5 to contributor)

Administration

  • toggle-category(category, is-active): Enable/disable categories (owner only)
  • update-platform-settings(new-fee, new-min-stake): Update platform economics (owner only)

Deployment

Prerequisites

  • Stacks blockchain testnet/mainnet access
  • Clarity CLI or compatible deployment tool
  • STX tokens for deployment and testing

Deployment Steps

  1. Clone this repository
  2. Deploy using Clarity CLI: ```bash clarinet deploy --testnet ```
  3. Initialize with default categories (automatically done on deployment)

Usage Examples

Creating an Article

(contract-call? .knowledge-platform create-article 
  "Introduction to Blockchain" 
  "QmHash123..." 
  "technology")

About

This is a Clarity smart contract for the Stacks blockchain that implements a decentralized knowledge sharing and content monetization platform.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors