Skip to content

henriettasalman/Professional-Networking-Platform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 

Repository files navigation

Professional Networking Platform Smart Contract

A comprehensive Clarity smart contract for building decentralized professional networking platforms on the Stacks blockchain. This contract enables users to create profiles, connect with others, endorse skills, and manage job postings in a trustless environment.

Features

User Management

  • Profile Creation: Register with name, title, and skills
  • Profile Updates: Modify personal information anytime
  • Reputation System: Earn reputation points through network activities
  • Account Status: Admin-controlled user activation/deactivation

Connection System

  • Connection Requests: Send and receive connection invitations
  • Status Tracking: Monitor pending, accepted, and blocked connections
  • Mutual Benefits: Both parties earn reputation when connections are accepted
  • Duplicate Prevention: Prevents multiple connection requests between same users

Endorsement System

  • Skill Endorsements: Endorse connected users for specific skills
  • Message Support: Add detailed endorsement messages (up to 500 characters)
  • Reputation Rewards: Endorsed users gain 2 reputation points per endorsement
  • Connection Requirement: Only connected users can endorse each other

Job Management

  • Job Postings: Employers can post job opportunities with descriptions
  • Application System: Users can apply with cover letters
  • Status Management: Employers can accept/reject applications
  • Platform Fees: 1 STX fee for posting jobs (configurable by admin)
  • Success Rewards: Accepted applicants earn 5 reputation points

Contract Functions

Public Functions

User Management

  • register-user(name, title, skills) - Create new user profile
  • update-profile(name, title, skills) - Update existing profile

Connections

  • send-connection-request(to-user) - Send connection invitation
  • accept-connection(from-user) - Accept pending connection

Endorsements

  • endorse-user(endorsed-user, skill, message) - Endorse user's skill

Jobs

  • post-job(title, description, salary-range) - Create job posting
  • apply-for-job(job-id, cover-letter) - Apply for posted job
  • update-application-status(job-id, applicant, status) - Update application

Admin Functions

  • set-platform-fee(new-fee) - Adjust job posting fees
  • deactivate-user(user) - Disable user account

Read-Only Functions

  • get-user(user) - Retrieve user profile
  • get-connection-status(user1, user2) - Check connection status
  • get-job-posting(job-id) - Get job details
  • get-endorsement(endorser, endorsed, skill) - View endorsement
  • get-application(job-id, applicant) - Check application status

Error Codes

Code Description
u100 Owner-only function called by non-owner
u101 Requested resource not found
u102 Unauthorized action attempted
u103 Resource already exists
u104 Invalid input provided
u105 Connection already exists

Security Features

  • Input Validation: All user inputs are validated for length and content
  • Access Control: Function-level permissions and ownership checks
  • Duplicate Prevention: Prevents duplicate connections and applications
  • Principal Verification: Ensures all user principals exist before operations
  • Fee Protection: Platform fees prevent spam job postings

Deployment

  1. Deploy the contract to Stacks blockchain
  2. The deployer becomes the contract owner with admin privileges
  3. Users can immediately start registering and using the platform
  4. Admin can adjust platform fees as needed

Usage Example

;; Register as a user
(contract-call? .networking-platform register-user 
  "John Doe" 
  "Software Engineer" 
  "JavaScript, React, Node.js")

;; Send connection request
(contract-call? .networking-platform send-connection-request 'SP2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKNRV9EJ7)

;; Endorse a connected user
(contract-call? .networking-platform endorse-user 
  'SP2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKNRV9EJ7 
  "React Development" 
  "Excellent React skills and clean code practices")

This smart contract provides a robust foundation for decentralized professional networking with built-in economic incentives, security measures, and comprehensive functionality for modern professional interactions on the blockchain.

About

The contract manages user profiles with professional information (name, title, skills) and tracks reputation scores based on network activities. Users can send and accept connection requests, creating a verified professional network where both parties earn reputation points upon successful connections.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors