Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow fractional vote weights #10870

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft

Conversation

rbennettcw
Copy link
Contributor

@rbennettcw rbennettcw commented Feb 5, 2025

Link to Issue

Closes: #10832

Description of Changes

  • Fixes vote weight to allow fractional values
    • Backend still uses non-decimal wei representation of balance as source of truth
    • Frontend converts integer wei to human-readable decimal format for rendering
  • Adds migration to multiply existing calculated vote weights (originally, the value was truncated so that only full tokens counted, e.g. 10^18 == 1 token –– now we store the full wei representation for both voting power and calculated voting weight)

Test Plan

  • Create ETH native topic
    • Go to topic discussions page, confirm that balance is shown in decimal format
  • Create ERC20 topic
    • Go to topic discussions page, confirm that balance is shown in decimal format
  • For both, make a contest and vote on a thread– confirm that vote weight renders correctly

Deployment Plan

N/A

Other Considerations

N/A

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.

Allow fractional vote weight for ETH native
2 participants