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.
- 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 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
- 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 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
register-user(name, title, skills)- Create new user profileupdate-profile(name, title, skills)- Update existing profile
send-connection-request(to-user)- Send connection invitationaccept-connection(from-user)- Accept pending connection
endorse-user(endorsed-user, skill, message)- Endorse user's skill
post-job(title, description, salary-range)- Create job postingapply-for-job(job-id, cover-letter)- Apply for posted jobupdate-application-status(job-id, applicant, status)- Update application
set-platform-fee(new-fee)- Adjust job posting feesdeactivate-user(user)- Disable user account
get-user(user)- Retrieve user profileget-connection-status(user1, user2)- Check connection statusget-job-posting(job-id)- Get job detailsget-endorsement(endorser, endorsed, skill)- View endorsementget-application(job-id, applicant)- Check application status
| 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 |
- 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
- Deploy the contract to Stacks blockchain
- The deployer becomes the contract owner with admin privileges
- Users can immediately start registering and using the platform
- Admin can adjust platform fees as needed
;; 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.