feat: implement staking module with minting and burning functionality for tokens#449
Merged
Devsol-01 merged 1 commit intoDevsol-01:mainfrom Mar 27, 2026
Merged
Conversation
|
@Shredder401k Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Token Economics Implementation
Overview
This PR implements comprehensive token economics for the Nestera protocol, including minting, burning, rewards distribution, and staking mechanisms.
Changes
#376 - Token Minting Logic
mint_tokens(caller, to, amount)function for controlled token mintingTokenMintedevent with recipient, amount, and new total supply#377 - Token Burning Mechanism
burn(from, amount)function for deflationary mechanicsTokenBurnedevent with sender, amount, and new total supply#441 - Rewards Distribution in Token
claim_rewards()function transfers native tokens to usersUserRewardsstructRewardsClaimedevent on successful claim#442 - Staking Mechanism
stakingmodule with full staking functionalitystake(user, amount)- stakes tokens for a userunstake(user, amount)- unstakes tokens for a userclaim_staking_rewards(user)- claims accumulated staking rewardsStakestruct tracks:amount- staked tokensstart_time- when stake was createdlast_update_time- last reward calculationreward_per_share- accumulated rewardsStakingConfigstruct for configuration:min_stake_amount- minimum stake requiredmax_stake_amount- maximum stake per userreward_rate_bps- APY in basis pointsenabled- whether staking is activelock_period_seconds- optional lock periodStakeCreated,StakeWithdrawn,StakingRewardsClaimedFiles Modified
contracts/src/token.rs- Added mint and burn functions with eventscontracts/src/lib.rs- Added contract functions for mint, burn, and stakingcontracts/src/staking/mod.rs- New staking modulecontracts/src/staking/storage_types.rs- Staking data structurescontracts/src/staking/storage.rs- Staking logic implementationcontracts/src/staking/events.rs- Staking event helperscontracts/src/token_tests.rs- Tests for minting and burningcontracts/src/staking_tests.rs- Tests for staking mechanismTests
All new functionality includes comprehensive tests:
Acceptance Criteria Met
#376 - Token Minting Logic
#377 - Token Burning Mechanism
#441 - Rewards Distribution in Token
#442 - Staking Mechanism
Closes
Closes #376
Closes #377
Closes #441
Closes #442