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

Gauge Contracts #844

Draft
wants to merge 17 commits into
base: development
Choose a base branch
from
Draft

Gauge Contracts #844

wants to merge 17 commits into from

Conversation

JakeHartnell
Copy link
Member

@JakeHartnell JakeHartnell commented Jul 4, 2024

Inspired by the Curve gauge system and forked from the Wynd DAO repo with history and Apache 2.0 license maintained.

These contracts have been modified to be more generic and support any type of DAO.

However, consider this a straw-man implementation. There are many improvements to be made!

  • More tests (consider refactoring with cw-orch)
  • Make improvements to GaugeAdapter API
  • Improve GaugeAdapter example (needs significant work, we may want more than one example)
  • Currently oes not handle small voting power numbers elegantly (a problem with NFT DAOs, where people might stake 1 NFT)
  • Better READMEs and documentation

Bonus:

  • Implement decay, so that people eventually have to re-express their preferences on the gauge
  • Think about how to hook in incentives from the dao-rewards-distributor contract so that DAOs can optional incentivize people to participate in gauges

If you are looking to contribute to this and want to understand how they work, the gauge-orchestrator README is a good place to start.

Twitter post and discussion.

Gauges in actual decentralize applications:

  • Curve: the OG
  • Wynd: what these are based on

Use cases:

  • Budget Allocation
  • Setting parameters
  • Incentives Allocation
  • Managing liquid staking protocols (choosing which validators to to delegate to)
  • etc.

@hard-nett
Copy link
Contributor

  • More tests (consider refactoring with cw-orch)
  • Make improvements to GaugeAdapter API
  • Improve GaugeAdapter example (needs significant work, we may want more than one example)

spearheading these three points this week! an additional gauge adapter template can be one that turns itself off after a specific # of times the gauges epoch occurs.

@JakeHartnell
Copy link
Member Author

  • More tests (consider refactoring with cw-orch)
  • Make improvements to GaugeAdapter API
  • Improve GaugeAdapter example (needs significant work, we may want more than one example)

spearheading these three points this week! an additional gauge adapter template can be one that turns itself off after a specific # of times the gauges epoch occurs.

AMAZING ❤️

* Use cw-denom and payment utils in gauge adapter

TODO: 2 tests are failing, because the cw20 cannot be validated with cw-denom. This should be fixed with a cw-orch refactor.

* gauge adapter cw-orch tests

* include suite changes

* cleanup adapter test

* A couple tweaks to gauge adapter tests

* cleanup tests a bit

* cargo lock

* bump prost, lint

* lint

---------

Co-authored-by: hard-nett <hardnettt@proton.me>
Co-authored-by: Hard-Nett <123711748+hard-nett@users.noreply.github.com>
pub struct InstantiateMsg {
/// Address of contract to that contains all voting powers (where we query)
pub voting_powers: String,
/// Addres that will call voting power change hooks (often same as voting power contract)
Copy link
Member Author

Choose a reason for hiding this comment

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

Suggested change
/// Addres that will call voting power change hooks (often same as voting power contract)
/// Address that will call voting power change hooks (often same as voting power contract)

Copy link

codecov bot commented Aug 14, 2024

Codecov Report

Attention: Patch coverage is 98.34811% with 95 lines in your changes missing coverage. Please review.

Project coverage is 96.78%. Comparing base (a417f9d) to head (f56a129).

Files Patch % Lines
contracts/gauges/gauge/src/contract.rs 95.56% 36 Missing ⚠️
contracts/gauges/gauge/src/helpers.rs 0.00% 13 Missing ⚠️
contracts/gauges/gauge/src/state.rs 98.06% 10 Missing ⚠️
contracts/gauges/gauge-adapter/src/bin/schema.rs 0.00% 8 Missing ⚠️
contracts/gauges/gauge-adapter/src/contract.rs 97.85% 7 Missing ⚠️
contracts/gauges/gauge/src/bin/schema.rs 0.00% 7 Missing ⚠️
...tracts/gauges/gauge-adapter/src/multitest/suite.rs 94.38% 5 Missing ⚠️
contracts/gauges/gauge/src/multitest/suite.rs 99.70% 2 Missing ⚠️
contracts/gauges/gauge-adapter/src/error.rs 0.00% 1 Missing ⚠️
contracts/gauges/gauge-adapter/src/msg.rs 92.30% 1 Missing ⚠️
... and 5 more
Additional details and impacted files
@@               Coverage Diff               @@
##           development     #844      +/-   ##
===============================================
+ Coverage        96.64%   96.78%   +0.13%     
===============================================
  Files              241      262      +21     
  Lines            65544    71295    +5751     
===============================================
+ Hits             63347    69003    +5656     
- Misses            2197     2292      +95     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

4 participants