-
-
Notifications
You must be signed in to change notification settings - Fork 1
feat(tri27): TRI-27 Staking Module #443
Copy link
Copy link
Open
Description
Sub-Issue #438: TRI-27 Staking Module
Files: src/tri27/staking.zig (NEW, ~400 LOC)
Tasks:
- Create spec/staking.tri
- Generate staking.zig via tri gen
- Define StakingState:
- total_staked: u128
- stakers: AutoHashMap([32]u8 -> StakeInfo)
- reward_pool: u128
- apy: f64
- Implement functions:
- stakeTokens(amount, lock_period)
- unstakeTokens()
- calculateReward(compute_units) -> u128
- distributeRewards(epoch)
- Add Coptic mapping:
- t21: Total staked
- t22: Current APY
- Add slashing:
- Manipulation: -50% stake
- Theft: -100% stake
Parent: #435
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels