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

Feat/voting power #19

Merged
merged 10 commits into from
Jan 14, 2025
Merged

Feat/voting power #19

merged 10 commits into from
Jan 14, 2025

Conversation

LNow
Copy link
Contributor

@LNow LNow commented Jan 14, 2025

This PR:

  • adds notion of Liquid Supply which is calculated as: total supply - tokens in treasury - tokens in dex
  • uses liquid supply to calculate user voting power

@LNow LNow requested a review from whoabuddy January 14, 2025 16:31
This greatly simplifies things as we can drop in template values where needed vs trying to initialize everything after the fact and require calling functions with extra information, e.g. trait contracts. From here we can review how to calculate liquid balance at proposal block, then complete the voting logic.
This hardcodes them for the purpose we're using them for, and they can be extended/upgraded/changed out in the future. This way the voting calculations are not in flux if something changes, and we can use the templates to provide the correct contract names when generating the contracts.
This was a one-off shot at adding tests and def would fix a few things, going to set a standard on the first few then iterate, as well as focus on key elements.
Still leaves some boilerplate this should be tested language for what wouldve been empty files, otherwise removes blank checks that were hints to what tests should be run. Can pass through again and turn them back on.
This version works with the test, the clarinet check version causes problems for some reason. Shouldn't be an issue in GH action.
@whoabuddy
Copy link
Contributor

Updated calculation in each proposal contract for:
totalSupply - (treasuryBalance - tokenDexBalance - tokenPoolBalance)

This will make both voting extensions valid before and after the DEX graduates.

Changing the target pool or providing liquidity after graduation may affect this extension and require some modification / replacement.

Also cleaned up the test files to get everything at a clear starting point. Next PR let's add tests to verify everything is working as expected.

Copy link
Contributor

@whoabuddy whoabuddy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huge 🙏

@whoabuddy whoabuddy merged commit 2f52f35 into main Jan 14, 2025
1 check 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.

2 participants