Comparing main...implementation · tari-ctrl/bitstack-decentralized-analytics · GitHub
Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: tari-ctrl/bitstack-decentralized-analytics
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: tari-ctrl/bitstack-decentralized-analytics
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: implementation
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 16 commits
  • 4 files changed
  • 1 contributor

Commits on Nov 27, 2024

  1. Add initial BitStack Analytics Contract with token definitions and co…

    …nstants
    
    - Introduce the BitStack Analytics Contract, a comprehensive DeFi analytics contract featuring multi-tier staking, governance, and emergency controls.
    - Define the ANALYTICS-TOKEN fungible token.
    - Establish key constants including CONTRACT-OWNER and various error codes for authorization, protocol validation, amount validation, STX sufficiency, cooldown status, stake presence, minimum requirements, and contract pause status.
    tari-ctrl committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    70fe979 View commit details
    Browse the repository at this point in the history
  2. Add data variables and maps for BitStack Analytics Contract

    - Introduce data variables for contract state and parameters.
    - Add `Proposals` map to store proposal details.
    tari-ctrl committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    2205290 View commit details
    Browse the repository at this point in the history
  3. Add Proposals data map to BitStack Analytics Contract

    - Define `Proposals` map to store proposal details including creator, description, start and end blocks, execution status, votes for and against, and minimum votes required.
    tari-ctrl committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    a8ee073 View commit details
    Browse the repository at this point in the history
  4. Add UserPositions, StakingPositions, and TierLevels data maps

    - Define `UserPositions` map to track user collateral, debt, health factor, staking, and voting details.
    - Define `StakingPositions` map to manage user staking details including amount, start block, last claim, lock period, cooldown, and rewards.
    - Define `TierLevels` map to specify tier levels with minimum stake, reward multiplier, and enabled features.
    tari-ctrl committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    064588c View commit details
    Browse the repository at this point in the history
  5. Add initialize-contract function to set up tier levels

    - Define `initialize-contract` public function to initialize the contract.
    - Ensure only the contract owner can initialize by checking `tx-sender`.
    - Set up tier levels with specific minimum stakes, reward multipliers, and enabled features.
    tari-ctrl committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    dcc0ae6 View commit details
    Browse the repository at this point in the history
  6. Add stake-stx function for staking STX tokens with optional lock period

    - Define `stake-stx` public function to allow users to stake STX tokens.
    - Validate lock period and ensure contract is not paused.
    - Check if the staked amount meets the minimum requirement.
    - Transfer STX tokens to the contract.
    - Calculate new total stake, tier level, and lock multiplier.
    - Update staking and user positions with new information.
    - Update the STX pool with the staked amount.
    tari-ctrl committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    912aab2 View commit details
    Browse the repository at this point in the history
  7. Add initiate-unstake function to start the unstaking process

    - Define `initiate-unstake` public function to initiate the unstaking process.
    - Ensure the user has sufficient staked amount and no active cooldown.
    - Update the staking position to set the cooldown start block.
    tari-ctrl committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    b673461 View commit details
    Browse the repository at this point in the history
  8. Add complete-unstake function to finalize the unstaking process

    - Define `complete-unstake` public function to complete the unstaking process after the cooldown period.
    - Ensure the cooldown period has passed.
    - Transfer the staked STX back to the user.
    - Clear the user's staking position.
    tari-ctrl committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    3d43633 View commit details
    Browse the repository at this point in the history
  9. Add create-proposal function for governance proposals

    - Define `create-proposal` public function to allow users to create governance proposals.
    - Ensure the user has sufficient voting power.
    - Validate the proposal description and voting period.
    - Store the proposal details in the `Proposals` map.
    - Increment the proposal count.
    tari-ctrl committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    b995c70 View commit details
    Browse the repository at this point in the history
  10. Add vote-on-proposal function for governance voting

    - Define `vote-on-proposal` public function to allow users to vote on governance proposals.
    - Ensure the proposal is valid and the voting period is active.
    - Update the proposal with the user's vote, adjusting votes-for or votes-against based on the vote.
    tari-ctrl committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    9f37471 View commit details
    Browse the repository at this point in the history
  11. Add functions to pause and resume the contract

    - Define `pause-contract` public function to pause the contract, disabling certain functions.
    - Define `resume-contract` public function to resume the contract, re-enabling certain functions.
    - Ensure only the contract owner can execute these functions.
    tari-ctrl committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    bebf418 View commit details
    Browse the repository at this point in the history
  12. Add read-only functions for contract owner, STX pool balance, and pro…

    …posal count
    
    - Define `get-contract-owner` to return the contract owner.
    - Define `get-stx-pool` to return the current STX pool balance.
    - Define `get-proposal-count` to return the current proposal count.
    tari-ctrl committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    b5432ef View commit details
    Browse the repository at this point in the history
  13. Add private functions for tier info and lock multiplier calculations

    - Define `get-tier-info` private function to retrieve tier information based on the stake amount.
    - Define `calculate-lock-multiplier` private function to calculate the lock multiplier based on the lock period.
    tari-ctrl committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    f354940 View commit details
    Browse the repository at this point in the history
  14. Add private functions for reward calculation and description validation

    - Define `calculate-rewards` private function to calculate rewards for a user based on their stake and the number of blocks.
    - Define `is-valid-description` private function to validate the length of a proposal description.
    tari-ctrl committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    8575a2b View commit details
    Browse the repository at this point in the history
  15. Add private functions for lock period and voting period validation

    - Define `is-valid-lock-period` private function to validate the lock period.
    - Define `is-valid-voting-period` private function to validate the voting period.
    tari-ctrl committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    605cf5e View commit details
    Browse the repository at this point in the history
  16. Update README with detailed overview and features of BitStack Analytics

    - Add comprehensive overview of BitStack Analytics smart contract.
    - Detail multi-tier staking system, flexible staking options, and governance mechanism.
    - Highlight security features and contract constants.
    - List main functions for staking, governance, and contract management.
    - Include tier benefits and security considerations.
    - Provide installation and deployment steps.
    - Encourage contributions and provide contact information.
    tari-ctrl committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    c444946 View commit details
    Browse the repository at this point in the history
Loading