-
Notifications
You must be signed in to change notification settings - Fork 0
Implement BitHive Core Functionality and Comprehensive Documentation #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
itohowo-dot
wants to merge
9
commits into
main
Choose a base branch
from
feat/implement-contract
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Define `jobs` map to store job details, including client, title, description, budget, status, freelancer, milestones, and current milestone. - Introduce constants for error codes to handle common errors like authorization, invalid jobs, and disputes. - Add `job-counter` data variable to track the total number of jobs. This implementation lays the foundation for milestone-based payments and secure freelance transactions on the BitHive platform.
- Introduce `bids` map to track job bids with amount, proposal, and status. - Add `user-ratings` map to manage freelancer and client reputation metrics. - Define `disputes` map to handle dispute resolution with voting and resolution status. - Implement `escrow` map to secure job payments with locked funds. These additions enhance the platform's functionality for bidding, reputation tracking, dispute resolution, and payment security.
- Add `post-job` function to allow clients to create jobs with title, description, budget, and milestones. - Secure job budgets using escrow by transferring STX to the contract. - Increment job counter and store job details in the `jobs` map. - Add `place-bid` function to enable freelancers to bid on open jobs with a proposal and amount. - Validate job status and prevent duplicate bids from the same freelancer. These functions establish the core workflow for job creation and bidding in the BitHive platform.
- Implement `accept-bid` function to allow clients to accept a freelancer's bid, updating job status to "in-progress" and marking the bid as "accepted." - Add `complete-milestone` function to release milestone payments to freelancers and update the job's current milestone. - Ensure milestone payments are securely transferred from escrow and validate job status before processing. - Automatically mark jobs as "completed" when all milestones are finished. These functions enhance the workflow for managing bids and milestone-based payments on the BitHive platform.
- Implement `raise-dispute` function to allow clients or freelancers to initiate a dispute for a job. - Validate that only authorized users (client or freelancer) can raise disputes. - Ensure disputes can only be raised if none already exist for the job. - Update the `disputes` map with dispute details, including initiator, reason, and voting status. - Change the job status to "disputed" upon dispute initiation. This feature enables decentralized dispute resolution for the BitHive platform, ensuring fairness and transparency.
- Implement `vote-on-dispute` function to allow users to vote on disputes, updating release and refund vote counts. - Add `rate-user` function to enable rating of users with validation for ratings between 1 and 5, updating total, count, and average ratings. - Introduce read-only functions: - `get-job-details` to fetch job details by job ID. - `get-user-rating` to retrieve a user's rating. - `get-bids-for-job` to list bids for a specific job. - `get-dispute-details` to view dispute information for a job. These additions enhance dispute resolution, reputation tracking, and data accessibility on the BitHive platform.
- Change string types for job titles, descriptions, and bid proposals to `string-ascii` for improved compatibility and efficiency. - Ensure all relevant functions and data maps reflect the updated string type. This update standardizes string handling across the contract, enhancing performance and consistency.
- Implement `job-bidders` map to track bidders for each job. - Add capacity checks to ensure the number of bidders does not exceed the limit of 100. - Update `place-bid` function to append bidders to the job's bidder list while enforcing capacity constraints. This enhancement ensures efficient bidder management and prevents exceeding the maximum allowed bidders per job.
- Document key features, including escrow, milestone payments, and dispute resolution. - Provide detailed descriptions of smart contract structures, core functions, and workflows. - Include security considerations and economic safeguards. - Add mermaid diagrams for visualizing the dispute resolution process. This README enhances project clarity and serves as a reference for developers and users.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR introduces the foundational components for BitHive - a decentralized freelance marketplace secured by Bitcoin via Stacks. The changes establish end-to-end functionality for job management, bidding, payments, disputes, and reputation systems, accompanied by detailed documentation.
Key Additions:
Job Management System
jobsmap storing client/freelancer details, milestones, and statusesopen,in-progress,completed,disputed)Bidding Engine
Dispute Resolution Protocol
Reputation Framework
Documentation Overhaul
Technical Considerations
string-asciitypes for optimized storage (titles, descriptions, proposals)as-contractjob-biddersmapREADME Enhancements
Checklist
Impact:
This implementation positions BitHive as a trustless alternative to traditional freelance platforms by combining Bitcoin's security with programmable escrow logic and community governance. The comprehensive documentation ensures smooth onboarding for developers and transparent operations for users.
Reviewers: Please focus on:
post-jobandcomplete-milestoneLet's revolutionize freelance marketplaces together!