Implement Tiered Staking System & Governance Framework#1
Open
peace-source wants to merge 6 commits intomainfrom
Open
Implement Tiered Staking System & Governance Framework#1peace-source wants to merge 6 commits intomainfrom
peace-source wants to merge 6 commits intomainfrom
Conversation
…r tracking The `UserPositions` map has been updated to include `tier-level` and `rewards-multiplier` fields. These additions enable the protocol to track user-specific tier levels and dynamic reward multipliers, which are essential for implementing the tiered rewards system and incentivizing long-term staking. Key changes: - Added `tier-level` field to represent the user's current tier in the rewards system. - Added `rewards-multiplier` field to calculate dynamic rewards based on staking duration and tier. Impact: - Enables a more sophisticated rewards mechanism tied to user activity and staking behavior. - Lays the groundwork for implementing tier-based governance and reward distribution. - Improves the protocol's ability to incentivize user participation and loyalty.
…staking logic Enhanced the `stake-stx` function to dynamically update the user's `tier-level` and `rewards-multiplier` based on their total staked amount and lock period. This ensures that users are rewarded according to their staking behavior and tier system configuration. Key changes: - Integrated `get-tier-info` to determine the user's tier level based on their total staked amount. - Added `calculate-lock-multiplier` to adjust rewards based on the lock period. - Updated `UserPositions` map to reflect the new `tier-level` and `rewards-multiplier` values. Impact: - Improves user incentives by dynamically adjusting rewards based on staking behavior. - Strengthens the tiered rewards system, encouraging higher stakes and longer lock periods. - Enhances the protocol's ability to manage user engagement and reward distribution effectively.
Introduced the `create-proposal` function to enable users to create governance proposals. This function validates the user's voting power and ensures the proposal meets protocol requirements before being added to the `Proposals` map. Key changes: - Added validation to ensure users have at least 1,000,000 voting power to create a proposal. - Included checks for valid proposal descriptions and voting periods. - Updated the `Proposals` map to store proposal details, including creator, description, voting period, and execution status. - Incremented the `proposal-count` variable to track the total number of proposals. Impact: - Empowers users with sufficient voting power to participate in protocol governance. - Establishes a robust framework for decentralized decision-making. - Enhances the protocol's transparency and community engagement.
Implemented key contract control functions (`pause-contract` and `resume-contract`) to allow the contract owner to manage the protocol's operational state. Additionally, introduced the `vote-on-proposal` function to enable users to participate in governance by voting on proposals. Key changes: - Added `pause-contract` and `resume-contract` functions to toggle the `contract-paused` state, ensuring only the contract owner can perform these actions. - Developed the `vote-on-proposal` function to allow users to cast votes on governance proposals, with validation for voting power and proposal validity. - Included read-only functions (`get-contract-owner`, `get-stx-pool`, and `get-proposal-count`) for retrieving essential contract information. Impact: - Enhances protocol governance by enabling community-driven decision-making. - Provides the contract owner with tools to manage the protocol during emergencies or upgrades. - Improves transparency and accessibility through read-only functions.
…validation Added private utility functions to streamline calculations and validations for staking and governance operations. These functions enhance modularity and maintainability of the contract. Key changes: - `get-tier-info`: Determines the user's tier level and reward multiplier based on their staked amount. - `calculate-lock-multiplier`: Calculates the reward multiplier based on the staking lock period. - `calculate-rewards`: Computes staking rewards for a user over a specified number of blocks. - `is-valid-description`: Validates the length of a proposal description. - `is-valid-lock-period`: Ensures the lock period is one of the allowed durations. - `is-valid-voting-period`: Validates the voting period for governance proposals. Impact: - Improves code readability and reusability by encapsulating common logic. - Ensures consistent validation and calculation across staking and governance features. - Enhances the protocol's ability to handle dynamic reward and governance configurations.
…tocol smart contract Enhanced the `README.md` file to provide detailed documentation for the Bitcoin Analytics Protocol (BAP). This update includes an overview, key features, technical specifications, function references, reward calculation details, governance processes, and security mechanisms. Key additions: - **Overview**: High-level description of the protocol's purpose and capabilities. - **Key Features**: Detailed explanation of staking, governance, rewards, and security features. - **Technical Specification**: Core components, state variables, and their roles. - **Function Reference**: Parameters and descriptions for staking, governance, and control functions. - **Reward Calculation**: Formula and multiplier components for dynamic rewards. - **Governance Process**: Step-by-step explanation of proposal creation, voting, and execution. - **Security Model**: Protection mechanisms and emergency protocols. Impact: - Improves developer onboarding by providing clear and structured documentation. - Enhances transparency and usability for protocol users and contributors. - Establishes a foundation for future updates and community engagement.
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 introduces core protocol upgrades for the Bitcoin Analytics Protocol, combining 6 strategic commits to enable:
Key Improvements
1. Tiered Staking Engine
tier-levelandrewards-multipliertracking in UserPositions2. Governance Framework
3. Security Enhancements
4. Documentation
Deployment Notes
Approval Recommended For: