Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 0
Comparing changes
Open a pull request
base repository: tari-ctrl/bitstack-decentralized-analytics
base: main
head repository: tari-ctrl/bitstack-decentralized-analytics
compare: implementation
- 16 commits
- 4 files changed
- 1 contributor
Commits on Nov 27, 2024
-
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.
Configuration menu - View commit details
-
Copy full SHA for 70fe979 - Browse repository at this point
Copy the full SHA 70fe979View commit details -
Add data variables and maps for BitStack Analytics Contract
- Introduce data variables for contract state and parameters. - Add `Proposals` map to store proposal details.
Configuration menu - View commit details
-
Copy full SHA for 2205290 - Browse repository at this point
Copy the full SHA 2205290View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for a8ee073 - Browse repository at this point
Copy the full SHA a8ee073View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 064588c - Browse repository at this point
Copy the full SHA 064588cView commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for dcc0ae6 - Browse repository at this point
Copy the full SHA dcc0ae6View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 912aab2 - Browse repository at this point
Copy the full SHA 912aab2View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for b673461 - Browse repository at this point
Copy the full SHA b673461View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 3d43633 - Browse repository at this point
Copy the full SHA 3d43633View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for b995c70 - Browse repository at this point
Copy the full SHA b995c70View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 9f37471 - Browse repository at this point
Copy the full SHA 9f37471View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for bebf418 - Browse repository at this point
Copy the full SHA bebf418View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for b5432ef - Browse repository at this point
Copy the full SHA b5432efView commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for f354940 - Browse repository at this point
Copy the full SHA f354940View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 8575a2b - Browse repository at this point
Copy the full SHA 8575a2bView commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 605cf5e - Browse repository at this point
Copy the full SHA 605cf5eView commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for c444946 - Browse repository at this point
Copy the full SHA c444946View commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff main...implementation
