Skip to content

Commit

Permalink
dao-update
Browse files Browse the repository at this point in the history
  • Loading branch information
Buckram123 committed Jan 10, 2023
1 parent 3bf1627 commit 517861b
Show file tree
Hide file tree
Showing 9 changed files with 514 additions and 380 deletions.
552 changes: 331 additions & 221 deletions Cargo.lock

Large diffs are not rendered by default.

29 changes: 18 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,14 @@ overflow-checks = true

[workspace.package]
version = "0.0.3"
authors = ["[email protected]", "@tjtc", "@mikedotexe","@NinoLipartiia","@Buckram123","deveusss"]
authors = [
"[email protected]",
"@tjtc",
"@mikedotexe",
"@NinoLipartiia",
"@Buckram123",
"deveusss",
]
edition = "2021"
description = "Croncat provides a general purpose, fully autonomous network that enables scheduled function calls for blockchain contract execution. It allows any application to schedule logic to get executed in the future, once or many times, triggered by an approved “agent,” in an economically stable format."
documentation = "https://docs.cron.cat/"
Expand All @@ -39,26 +46,26 @@ rusty-hook = "0.11.2"
#For some reason it tries to deploy cw_core here
# voting = { version = "0.2.0", default-features = false, git = "https://github.com/DA0-DA0/dao-contracts" }
smart-query = { version = "0.1.0", path = "./packages/smart-query" }
cw20 = { version = "0.13.4" }
cw20 = { version = "0.16.0" }
cw-multi-test = { version = "0.16.0" }
cw20-base = { version = "0.13.4", features = ["library"] }
cw20-base = { version = "0.16.0", features = ["library"] }
cw-rules-core = { version = "0.1.2", path = "./packages/cw-rules-core" }
cw-storage-plus = "0.16.0"
cron_schedule = "0.2.3"
cw2 = "0.16.0"
hex = { version = "0.4", default-features = false }
sha2 = { version = "0.10.6", default-features = false }
serde-json-wasm = { version = "0.5.0" }
cw-utils = "0.13.4"
cw-utils = "0.16.0"
cw721 = "0.15.0"
# DAO contracts
cwd-voting = { version = "0.2.0", git = "https://github.com/DA0-DA0/dao-contracts.git" }
cwd-proposal-single = { version = "0.2.0", git = "https://github.com/DA0-DA0/dao-contracts" }
cwd-proposal-multiple = { version = "0.2.0", git = "https://github.com/DA0-DA0/dao-contracts" }
cwd-voting-cw20-staked = { version = "0.2.0", git = "https://github.com/DA0-DA0/dao-contracts" }
cw20-stake = { version = "0.2.6", git = "https://github.com/DA0-DA0/dao-contracts" }
cwd-core = { version = "0.2.0", git = "https://github.com/DA0-DA0/dao-contracts" }
cwd-interface = { version = "0.2.0", git = "https://github.com/DA0-DA0/dao-contracts" }
dao-voting = { version = "2.0.0-beta", git = "https://github.com/DA0-DA0/dao-contracts.git", tag = "v2.0.0" }
dao-proposal-single = { version = "2.0.0-beta", git = "https://github.com/DA0-DA0/dao-contracts", tag = "v2.0.0" }
dao-proposal-multiple = { version = "2.0.0-beta", git = "https://github.com/DA0-DA0/dao-contracts", tag = "v2.0.0" }
dao-voting-cw20-staked = { version = "2.0.0-beta", git = "https://github.com/DA0-DA0/dao-contracts", tag = "v2.0.0" }
cw20-stake = { version = "2.0.0-beta", git = "https://github.com/DA0-DA0/dao-contracts", tag = "v2.0.0" }
dao-core = { version = "2.0.0-beta", git = "https://github.com/DA0-DA0/dao-contracts", tag = "v2.0.0" }
dao-interface = { version = "2.0.0-beta", git = "https://github.com/DA0-DA0/dao-contracts", tag = "v2.0.0" }
# Testing generic msg
cw4 = "0.16.0"
cw4-group = "0.16.0"
Expand Down
4 changes: 2 additions & 2 deletions ci/gas-benchmark/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ serde_json = "1.0"
serde = "1.0"
env_logger = "0.9.0"

cw20-base = "0.13.4"
cw20 = "0.13.4"
cw20-base = "0.16.0"
cw20 = "0.16.0"

cw-croncat-core = { version = "0.1.4", path = "../../packages/cw-croncat-core" }
cw-rules-core = { version = "0.1.2", path = "../../packages/cw-rules-core" }
Expand Down
10 changes: 5 additions & 5 deletions contracts/cw-croncat/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ cw4 = { workspace = true }
cw4-group = { workspace = true, features = ["library"] }
smart-query = { workspace = true }
generic-query = { workspace = true }
cwd-voting-cw20-staked = { workspace = true }
dao-voting-cw20-staked = { workspace = true }
cw20-stake = { workspace = true }
cwd-core = { workspace = true }
cwd-interface = { workspace = true }
cwd-proposal-single = { workspace = true }
cwd-voting = { workspace = true }
dao-core = { workspace = true }
dao-interface = { workspace = true }
dao-proposal-single = { workspace = true }
dao-voting = { workspace = true }
rusty-hook = { workspace = true }
48 changes: 24 additions & 24 deletions contracts/cw-croncat/src/tests/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ use cw_croncat_core::{
types::{BoundaryValidated, Interval, Task},
};
use cw_multi_test::{App, AppBuilder, Contract, ContractWrapper, Executor};
use cwd_voting::threshold::{PercentageThreshold, Threshold};
use cwd_voting_cw20_staked::msg::ActiveThreshold;
use dao_voting::threshold::{PercentageThreshold, Threshold};
use dao_voting_cw20_staked::msg::ActiveThreshold;

use crate::{helpers::CwTemplateContract, ContractError, CwCroncat};

Expand Down Expand Up @@ -88,32 +88,32 @@ pub fn cw20_stake_contract() -> Box<dyn Contract<Empty>> {

pub fn cw20_staked_balances_voting() -> Box<dyn Contract<Empty>> {
let contract = ContractWrapper::new(
cwd_voting_cw20_staked::contract::execute,
cwd_voting_cw20_staked::contract::instantiate,
cwd_voting_cw20_staked::contract::query,
dao_voting_cw20_staked::contract::execute,
dao_voting_cw20_staked::contract::instantiate,
dao_voting_cw20_staked::contract::query,
)
.with_reply(cwd_voting_cw20_staked::contract::reply);
.with_reply(dao_voting_cw20_staked::contract::reply);
Box::new(contract)
}

pub fn cw_gov_contract() -> Box<dyn Contract<Empty>> {
let contract = ContractWrapper::new(
cwd_core::contract::execute,
cwd_core::contract::instantiate,
cwd_core::contract::query,
dao_core::contract::execute,
dao_core::contract::instantiate,
dao_core::contract::query,
)
.with_reply(cwd_core::contract::reply);
.with_reply(dao_core::contract::reply);
Box::new(contract)
}

pub fn single_proposal_contract() -> Box<dyn Contract<Empty>> {
let contract = ContractWrapper::new(
cwd_proposal_single::contract::execute,
cwd_proposal_single::contract::instantiate,
cwd_proposal_single::contract::query,
dao_proposal_single::contract::execute,
dao_proposal_single::contract::instantiate,
dao_proposal_single::contract::query,
)
.with_reply(cwd_proposal_single::contract::reply)
.with_migrate(cwd_proposal_single::contract::migrate);
.with_reply(dao_proposal_single::contract::reply)
.with_migrate(dao_proposal_single::contract::migrate);
Box::new(contract)
}

Expand Down Expand Up @@ -245,29 +245,29 @@ pub fn proper_instantiate_with_dao(
percentage: PercentageThreshold::Majority {},
};
let max_voting_period = cw_utils::Duration::Height(6);
let instantiate_govmod = cwd_proposal_single::msg::InstantiateMsg {
let instantiate_govmod = dao_proposal_single::msg::InstantiateMsg {
threshold,
max_voting_period,
min_voting_period: None,
only_members_execute: false,
allow_revoting: false,
close_proposal_on_execution_failure: true,
pre_propose_info: cwd_voting::pre_propose::PreProposeInfo::AnyoneMayPropose {},
pre_propose_info: dao_voting::pre_propose::PreProposeInfo::AnyoneMayPropose {},
};
to_binary(&instantiate_govmod).unwrap()
});

let governance_instantiate = cwd_core::msg::InstantiateMsg {
let governance_instantiate = dao_core::msg::InstantiateMsg {
admin: None,
name: "DAO DAO".to_string(),
description: "A DAO that builds DAOs".to_string(),
image_url: None,
automatically_add_cw20s: true,
automatically_add_cw721s: true,
voting_module_instantiate_info: cwd_interface::ModuleInstantiateInfo {
voting_module_instantiate_info: dao_interface::ModuleInstantiateInfo {
code_id: votemod_id,
msg: to_binary(&cwd_voting_cw20_staked::msg::InstantiateMsg {
token_info: cwd_voting_cw20_staked::msg::TokenInfo::New {
msg: to_binary(&dao_voting_cw20_staked::msg::InstantiateMsg {
token_info: dao_voting_cw20_staked::msg::TokenInfo::New {
code_id: cw20_id,
label: "DAO DAO governance token".to_string(),
name: "DAO".to_string(),
Expand All @@ -282,13 +282,13 @@ pub fn proper_instantiate_with_dao(
active_threshold,
})
.unwrap(),
admin: Some(cwd_interface::Admin::CoreModule {}),
admin: Some(dao_interface::Admin::CoreModule {}),
label: "DAO DAO voting module".to_string(),
},
proposal_modules_instantiate_info: vec![cwd_interface::ModuleInstantiateInfo {
proposal_modules_instantiate_info: vec![dao_interface::ModuleInstantiateInfo {
code_id: proposal_module_code_id,
msg: proposal_module_instantiate,
admin: Some(cwd_interface::Admin::CoreModule {}),
admin: Some(dao_interface::Admin::CoreModule {}),
label: "DAO DAO governance module".to_string(),
}],
initial_items: None,
Expand Down
21 changes: 11 additions & 10 deletions contracts/cw-croncat/src/tests/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ use cw_croncat_core::msg::{
use cw_croncat_core::types::{Action, Boundary, Interval, Transform};
use cw_multi_test::Executor;
use cw_rules_core::types::{CroncatQuery, HasBalanceGte};
use cwd_core::state::ProposalModule;
use dao_core::state::ProposalModule;
use dao_voting::proposal::SingleChoiceProposeMsg;
use generic_query::{GenericQuery, PathToValue, ValueIndex, ValueOrdering};
use smart_query::{SmartQueries, SmartQuery, SmartQueryHead};

Expand Down Expand Up @@ -2959,7 +2960,7 @@ fn test_error_in_reply() {
.wrap()
.query_wasm_smart(
governance_addr.clone(),
&cwd_core::msg::QueryMsg::ProposalModules {
&dao_core::msg::QueryMsg::ProposalModules {
start_after: None,
limit: None,
},
Expand All @@ -2968,30 +2969,30 @@ fn test_error_in_reply() {

let govmod_single = governance_modules.into_iter().next().unwrap().address;

let govmod_config: cwd_proposal_single::state::Config = app
let govmod_config: dao_proposal_single::state::Config = app
.wrap()
.query_wasm_smart(
govmod_single.clone(),
&cwd_proposal_single::msg::QueryMsg::Config {},
&dao_proposal_single::msg::QueryMsg::Config {},
)
.unwrap();
let dao = govmod_config.dao;
let voting_module: Addr = app
.wrap()
.query_wasm_smart(dao, &cwd_core::msg::QueryMsg::VotingModule {})
.query_wasm_smart(dao, &dao_core::msg::QueryMsg::VotingModule {})
.unwrap();
let staking_contract: Addr = app
.wrap()
.query_wasm_smart(
voting_module.clone(),
&cwd_voting_cw20_staked::msg::QueryMsg::StakingContract {},
&dao_voting_cw20_staked::msg::QueryMsg::StakingContract {},
)
.unwrap();
let token_contract: Addr = app
.wrap()
.query_wasm_smart(
voting_module,
&cwd_interface::voting::Query::TokenContract {},
&dao_interface::voting::Query::TokenContract {},
)
.unwrap();

Expand All @@ -3008,17 +3009,17 @@ fn test_error_in_reply() {
app.execute_contract(
Addr::unchecked(ADMIN),
govmod_single.clone(),
&cwd_proposal_single::msg::ExecuteMsg::Propose {
&dao_proposal_single::msg::ExecuteMsg::Propose(SingleChoiceProposeMsg {
title: "Cron".to_string(),
description: "Cat".to_string(),
msgs: vec![],
proposer: None,
},
}),
&[],
)
.unwrap();

let execute_msg = cwd_proposal_single::msg::ExecuteMsg::Execute { proposal_id: 1 };
let execute_msg = dao_proposal_single::msg::ExecuteMsg::Execute { proposal_id: 1 };

// create a task for executing proposal
let wasm = WasmMsg::Execute {
Expand Down
12 changes: 6 additions & 6 deletions contracts/cw-rules/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ cw-multi-test = { workspace = true }
cw-utils = { workspace = true }
cw20-base = { workspace = true }
# DAO contracts
cwd-voting = { workspace = true }
cwd-proposal-single = { workspace = true }
cwd-proposal-multiple = { workspace = true }
cwd-voting-cw20-staked = { workspace = true }
dao-voting = { workspace = true }
dao-proposal-single = { workspace = true }
dao-proposal-multiple = { workspace = true }
dao-voting-cw20-staked = { workspace = true }
cw20-stake = { workspace = true }
cwd-core = { workspace = true }
cwd-interface = { workspace = true }
dao-core = { workspace = true }
dao-interface = { workspace = true }
# Testing generic msg
cw4 = { workspace = true }
cw4-group = { workspace = true }
Expand Down
Loading

0 comments on commit 517861b

Please sign in to comment.