-
Notifications
You must be signed in to change notification settings - Fork 143
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
dao-voting-native-staked
features
#724
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## development #724 +/- ##
===============================================
- Coverage 93.98% 93.97% -0.01%
===============================================
Files 62 62
Lines 5600 5646 +46
===============================================
+ Hits 5263 5306 +43
- Misses 337 340 +3
☔ View full report in Codecov by Sentry. |
9aa53b5
to
9e649a2
Compare
Blocked on |
dao-voting-native-staked
dao-voting-native-staked
features
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some feedback :) looks good though
use cosmwasm_schema::cw_serde; | ||
use cosmwasm_std::{to_binary, Addr, StdResult, Storage, SubMsg, Uint128, WasmMsg}; | ||
|
||
// This is just a helper to properly serialize the above message |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which above message?
} | ||
|
||
#[voting_module_query] | ||
#[active_query] | ||
#[cw_serde] | ||
#[derive(QueryResponses)] | ||
pub enum QueryMsg { | ||
#[returns(crate::state::Config)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leftover paths, maybe worth running an fmt for consistency
|
||
let initial_supply = initial_balances | ||
.iter() | ||
.fold(Uint128::zero(), |p, n| p + n.amount); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be nice to add some comments or more descriptive closure parameter names here
}); | ||
Ok(Response::new() | ||
.add_message(msg) | ||
.add_submessages(hook_msgs) | ||
.add_attribute("action", "unstake") | ||
.add_attribute("from", info.sender) | ||
.add_attribute("amount", amount) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this is not a part of the pr but what happens if in Some(duration)
case we exceed the max claims?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worth an investigation.
addr: String, | ||
) -> Result<Response, ContractError> { | ||
let config: Config = CONFIG.load(deps.storage)?; | ||
if Some(info.sender.clone()) != config.owner && Some(info.sender.clone()) != config.manager { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps worth adding a check on instantiation that owner and manager are not the same
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, going to replace this outdated pattern with cw-ownable
like we are using elsewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, IMO not really a problem if they are the same. Have an existing ticket for the cw-ownable
work. May pass on it in my follow on PR because there is already a lot there.
addr: String, | ||
) -> Result<Response, ContractError> { | ||
let config: Config = CONFIG.load(deps.storage)?; | ||
if Some(info.sender.clone()) != config.owner && Some(info.sender.clone()) != config.manager { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
Closing in favor of #728 which has these commits anyway. Thanks for getting a head start on this! |
Resolves #664
This adds support for creating a new token factory denom, managed by the DAO, when instantiating the
dao-voting-native-staked
contract.It uses the TokenFactory Core middleware contract so that the contract can be used on chains without token factory support using existing denoms. This contract also allows the manager (DAO) to whitelist additional addresses that can mint tokens, giving access controls to other contracts that may need it.