Skip to content

fix: integrate staked tokens for governance voting power#447

Merged
Devsol-01 merged 5 commits intoDevsol-01:mainfrom
binayyub4211:feat/governance-token-integration-444
Mar 30, 2026
Merged

fix: integrate staked tokens for governance voting power#447
Devsol-01 merged 5 commits intoDevsol-01:mainfrom
binayyub4211:feat/governance-token-integration-444

Conversation

@binayyub4211
Copy link
Copy Markdown

closes #444

PR Description: Governance Token Integration
Summary
Updated the governance module to use the native token's staked balance for voting power calculation, replacing the historical lifetime_deposited metric. This ensures that a user's governance weight accurately reflects their current active stake in the contract.

Changes
Governance Module: Modified

get_voting_power
in

governance.rs
to fetch and return the user's current total_balance.
Balance Synchronization: Updated the

goal
and

group
modules to correctly maintain the User::total_balance field during all deposit, contribution, and withdrawal operations.
Verification: Added a new unit test

test_voting_power_decreases_after_withdraw
in

governance_tests.rs
to confirm that voting power correctly updates when a user withdraws funds.
How it was verified
Added a regression test case in

governance_tests.rs
.
Manually verified the consistency of total_balance tracking across

flexi
,

lock
,

goal
, and

group
modules.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nestera Ready Ready Preview, Comment Mar 29, 2026 1:19am

@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 27, 2026

@binayyub4211 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! 🚀

Learn more about application limits

@Devsol-01
Copy link
Copy Markdown
Owner

@binayyub4211 please failing pipeline

@Devsol-01 Devsol-01 merged commit 4916278 into Devsol-01:main Mar 30, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Contract] Governance Token Integration

2 participants