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

Improvements/gauges are cool #861

Closed

Conversation

hard-nett
Copy link
Contributor

adds epoch limit for gauge to turn off automatically once reached.

test incoming!

Kayanski and others added 30 commits May 16, 2024 14:41
Also updates just lint to match basic.yml
TODO: 2 tests are failing, because the cw20 cannot be validated with cw-denom. This should be fixed with a cw-orch refactor.
Nightly toolchain is required for integration_tests
@hard-nett
Copy link
Contributor Author

@JakeHartnell ok should have all gauge-orchestrator cw-orch test mirrored

hard-nett and others added 13 commits August 9, 2024 19:28
* fix cargo errors

* clarify scalar values a bit more and update comments

* added extensions that make math more readable and maintainable
…xpiry (DA0-DA0#862)

* fix cargo errors

* reorganized fund logic and fixed rewards being lost when funding a previously expired discontinuous linear distribution
* fix cargo errors

* validate pre propose submission policy update before reading from storage
* fix cargo errors

* remove unnecessary state update
…ate NFT token IDs (DA0-DA0#864)

* fix cargo errors

* fix ONFT double counting vulnerability
…gration (DA0-DA0#866)

* fix cargo errors

* validate pre-propose policy on migrate
…tion (DA0-DA0#868)

* fix cargo errors

* replaced pre-propose submission policy's optional vectors of strings with vectors of addrs

* de-dupe redundant code

* updated schema
@hard-nett hard-nett marked this pull request as ready for review August 12, 2024 15:14
@JakeHartnell JakeHartnell changed the base branch from gauges-are-cool to development August 14, 2024 19:38
@JakeHartnell JakeHartnell changed the base branch from development to feature/cw-orch-interface August 14, 2024 19:44
#[cw_serde]
pub struct InstantiateMsg {
/// Address that is allowed to return deposits.
pub admin: String,
Copy link
Member

Choose a reason for hiding this comment

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

Maybe let's call this "owner" to differentiate it from the CosmWasm contract admin.

Copy link
Member

Choose a reason for hiding this comment

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

Let's update this contract to use cw-ownable.

Comment on lines 50 to 71
#[cw_serde]
#[derive(QueryResponses, cw_orch::QueryFns)]
pub enum AdapterQueryMsg {
#[returns(crate::state::Config)]
Config {},
#[returns(AllOptionsResponse)]
AllOptions {},
#[returns(CheckOptionResponse)]
CheckOption { option: String },
#[returns(SampleGaugeMsgsResponse)]
SampleGaugeMsgs {
/// Option along with weight.
/// Sum of all weights should be 1.0 (within rounding error).
selected: Vec<(String, Decimal)>,
},

// Marketing-gauge specific queries to help on frontend
#[returns(SubmissionResponse)]
Submission { address: String },
#[returns(AllSubmissionsResponse)]
AllSubmissions {},
}
Copy link
Member

Choose a reason for hiding this comment

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

I like adding robust comments for ExecuteMsg and QueryMsg because they basically document the API (and show up in generated docs).

/// Addres that will call voting power change hooks (often same as voting power contract)
pub hook_caller: String,
/// Address that can add new gauges or stop them
pub owner: String,
Copy link
Member

Choose a reason for hiding this comment

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

Let's use cw-ownable for this contract as well.

@JakeHartnell
Copy link
Member

TODO:

  • Use cw-ownable with the gauge and example gauge-adapter contracts (owner should be optional)
  • Make sure all InstantiateMsg, QueryMsg, and ExecuteMsg for gauge contracts are well documented

@JakeHartnell JakeHartnell changed the base branch from feature/cw-orch-interface to gauges-are-cool August 14, 2024 21:13
@JakeHartnell
Copy link
Member

JakeHartnell commented Aug 14, 2024

Closing this as we really should separate cw-orch work from gauges work.

Please make a new PR with gauges related work into #844.

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.

6 participants