StacksPredict: L2-Powered Bitcoin Price Prediction Protocol Implementation#1
Open
peter-curl wants to merge 7 commits intomainfrom
Open
StacksPredict: L2-Powered Bitcoin Price Prediction Protocol Implementation#1peter-curl wants to merge 7 commits intomainfrom
peter-curl wants to merge 7 commits intomainfrom
Conversation
…tract - Define key features and security features in comments - Add administrative constants including contract owner and error codes - Initialize state variables for platform configuration such as oracle address, minimum stake, fee percentage, and market counter
- Define market data structure and user predictions tracking maps - Implement create-market public function to initialize new prediction markets - Include assertions for parameter validation and ownership checks - Update market counter upon market creation
- Add make-prediction public function to place a prediction stake in an active market - Include assertions for market status, prediction validity, and stake requirements - Transfer stake amount from user to contract - Update user-predictions and markets maps with new prediction data
…t contract - Implement resolve-market public function to finalize market with end price - Include assertions for oracle address, market status, and end price validity - Update market data with end price and resolved status - Implement claim-winnings public function to allow users to claim their winnings - Include assertions for market resolution, prediction validity, and claim status - Calculate and transfer winnings and platform fee - Update user-predictions map to mark winnings as claimed
…tract - Implement read-only functions to get market details, user prediction details, and contract balance - Add administrative functions to update oracle address, minimum stake, and platform fee percentage - Implement function to withdraw accumulated fees by the contract owner - Include necessary assertions for parameter validation and ownership checks
…cksPredict contract - Correct block height references in make-prediction function to use stacks-block-height
…eatures, functions, and security measures - Include core functionality and technical advantages of the protocol - Outline security measures implemented in the smart contract - Document public functions with example usage
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
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.
Overview
This PR implements a comprehensive decentralized prediction market protocol for Bitcoin price movements on Stacks L2. The implementation includes core market functionality, security measures, and administrative controls.
Key Changes
Core Contract Implementation
Security Features
Documentation
Technical Details
Contract Components
Security Measures
Testing Checklist
Backwards Compatibility
Documentation Updates
Additional Notes
Reviewers
Please pay special attention to: