diff --git a/Cargo.lock b/Cargo.lock index fdca8c392..ffe303464 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -988,6 +988,7 @@ dependencies = [ "cosmwasm-std", "cw-admin-factory", "cw-multi-test", + "cw-orch", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", "cw2 1.1.2", @@ -1356,6 +1357,7 @@ dependencies = [ "cosmwasm-std", "cw-denom 2.5.0", "cw-multi-test", + "cw-orch", "cw-ownable", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", @@ -1452,6 +1454,7 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cw-multi-test", + "cw-orch", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", "cw2 1.1.2", @@ -1467,6 +1470,7 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cw-multi-test", + "cw-orch", "cw-ownable", "cw-storage-plus 1.2.0", "cw-tokenfactory-types", @@ -1562,6 +1566,7 @@ dependencies = [ "cosmwasm-std", "cw-denom 2.5.0", "cw-multi-test", + "cw-orch", "cw-ownable", "cw-stake-tracker", "cw-storage-plus 1.2.0", @@ -2034,6 +2039,7 @@ dependencies = [ "cosmwasm-std", "cw-controllers 1.1.2", "cw-multi-test", + "cw-orch", "cw-ownable", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", @@ -2053,13 +2059,20 @@ name = "dao-cw-orch" version = "2.5.0" dependencies = [ "cosmwasm-std", + "cw-admin-factory", "cw-orch", + "cw-payroll-factory", + "cw-token-swap", + "cw-tokenfactory-issuer", + "cw-vesting", "cw20-stake 2.5.0", "cw20-stake-external-rewards", "cw20-stake-reward-distributor", "cw721-base 0.18.0", + "cw721-roles", "dao-dao-core 2.5.0", "dao-interface 2.5.0", + "dao-migrator", "dao-pre-propose-approval-single 2.5.0", "dao-pre-propose-approver", "dao-pre-propose-multiple 2.5.0", @@ -2086,6 +2099,7 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cw-controllers 1.1.2", + "cw-orch", "cw4 1.1.2", ] @@ -2228,6 +2242,7 @@ dependencies = [ "cw-core", "cw-core-interface 0.1.0 (git+https://github.com/DA0-DA0/dao-contracts.git?tag=v1.0.0)", "cw-multi-test", + "cw-orch", "cw-proposal-single", "cw-storage-plus 1.2.0", "cw-utils 0.13.4", diff --git a/contracts/external/cw-admin-factory/Cargo.toml b/contracts/external/cw-admin-factory/Cargo.toml index 394f859fb..92e299c2f 100644 --- a/contracts/external/cw-admin-factory/Cargo.toml +++ b/contracts/external/cw-admin-factory/Cargo.toml @@ -26,6 +26,7 @@ cosmwasm-std = { workspace = true, features = ["cosmwasm_1_2"] } cosmwasm-schema = { workspace = true } cw-storage-plus = { workspace = true } cw2 = { workspace = true } +cw-orch = { workspace = true } thiserror = { workspace = true } cw-utils = { workspace = true } diff --git a/contracts/external/cw-admin-factory/src/msg.rs b/contracts/external/cw-admin-factory/src/msg.rs index 13016fee1..75a328f61 100644 --- a/contracts/external/cw-admin-factory/src/msg.rs +++ b/contracts/external/cw-admin-factory/src/msg.rs @@ -9,6 +9,7 @@ pub struct InstantiateMsg { } #[cw_serde] +#[derive(cw_orch::ExecuteFns)] pub enum ExecuteMsg { /// Instantiates the target contract with the provided instantiate message, /// code ID, and label and updates the contract's admin to be itself. @@ -33,7 +34,7 @@ pub enum ExecuteMsg { } #[cw_serde] -#[derive(QueryResponses)] +#[derive(QueryResponses, cw_orch::QueryFns)] pub enum QueryMsg { #[returns(AdminResponse)] Admin {}, diff --git a/contracts/external/cw-payroll-factory/Cargo.toml b/contracts/external/cw-payroll-factory/Cargo.toml index 9b89969a5..efd300919 100644 --- a/contracts/external/cw-payroll-factory/Cargo.toml +++ b/contracts/external/cw-payroll-factory/Cargo.toml @@ -24,6 +24,7 @@ cw-ownable = { workspace = true } cw-storage-plus = { workspace = true } cw2 = { workspace = true } cw20 = { workspace = true } +cw-orch = { workspace = true } thiserror = { workspace = true } cw-vesting = { workspace = true, features = ["library"] } cw-utils = { workspace = true } diff --git a/contracts/external/cw-payroll-factory/src/msg.rs b/contracts/external/cw-payroll-factory/src/msg.rs index eacc5357e..b612ffce7 100644 --- a/contracts/external/cw-payroll-factory/src/msg.rs +++ b/contracts/external/cw-payroll-factory/src/msg.rs @@ -11,6 +11,7 @@ pub struct InstantiateMsg { #[cw_ownable_execute] #[cw_serde] +#[derive(cw_orch::ExecuteFns)] pub enum ExecuteMsg { /// Instantiates a new vesting contract that is funded by a cw20 token. Receive(Cw20ReceiveMsg), @@ -36,7 +37,7 @@ pub enum ReceiveMsg { } #[cw_serde] -#[derive(QueryResponses)] +#[derive(QueryResponses,cw_orch::QueryFns)] pub enum QueryMsg { /// Returns list of all vesting payment contracts #[returns(Vec)] diff --git a/contracts/external/cw-token-swap/Cargo.toml b/contracts/external/cw-token-swap/Cargo.toml index e974d5453..d10660ac0 100644 --- a/contracts/external/cw-token-swap/Cargo.toml +++ b/contracts/external/cw-token-swap/Cargo.toml @@ -23,6 +23,7 @@ cw-storage-plus = { workspace = true } cw-utils = { workspace = true } cw2 = { workspace = true } cw20 = { workspace = true } +cw-orch = { workspace = true } thiserror = { workspace = true } [dev-dependencies] diff --git a/contracts/external/cw-token-swap/src/msg.rs b/contracts/external/cw-token-swap/src/msg.rs index 1c591d111..2b3dd6580 100644 --- a/contracts/external/cw-token-swap/src/msg.rs +++ b/contracts/external/cw-token-swap/src/msg.rs @@ -32,6 +32,7 @@ pub struct InstantiateMsg { } #[cw_serde] +#[derive(cw_orch::ExecuteFns)] pub enum ExecuteMsg { /// Used to provide cw20 tokens to satisfy a funds promise. Receive(cw20::Cw20ReceiveMsg), @@ -43,7 +44,7 @@ pub enum ExecuteMsg { } #[cw_serde] -#[derive(QueryResponses)] +#[derive(QueryResponses, cw_orch::QueryFns)] pub enum QueryMsg { // Gets the current status of the escrow transaction. #[returns(crate::msg::StatusResponse)] diff --git a/contracts/external/cw-tokenfactory-issuer/Cargo.toml b/contracts/external/cw-tokenfactory-issuer/Cargo.toml index 2abbb4180..30449d760 100644 --- a/contracts/external/cw-tokenfactory-issuer/Cargo.toml +++ b/contracts/external/cw-tokenfactory-issuer/Cargo.toml @@ -45,6 +45,7 @@ kujira_tokenfactory = ["cw-tokenfactory-types/kujira_tokenfactory"] cosmwasm-schema = { workspace = true } cosmwasm-std = { workspace = true } cw2 = { workspace = true } +cw-orch = { workspace = true } cw-ownable = { workspace = true } cw-storage-plus = { workspace = true } cw-tokenfactory-types = { workspace = true, default-features = false } diff --git a/contracts/external/cw-tokenfactory-issuer/src/msg.rs b/contracts/external/cw-tokenfactory-issuer/src/msg.rs index 0660ecd51..6170cddc8 100644 --- a/contracts/external/cw-tokenfactory-issuer/src/msg.rs +++ b/contracts/external/cw-tokenfactory-issuer/src/msg.rs @@ -23,6 +23,7 @@ pub enum InstantiateMsg { /// State changing methods available to this smart contract. #[cw_serde] +#[derive(cw_orch::ExecuteFns)] pub enum ExecuteMsg { /// Allow adds the target address to the allowlist to be able to send or recieve tokens even if the token /// is frozen. Token Factory's BeforeSendHook listener must be set to this contract in order for this feature @@ -108,7 +109,7 @@ pub struct MigrateMsg {} /// Queries supported by this smart contract. #[cw_serde] -#[derive(QueryResponses)] +#[derive(QueryResponses, cw_orch::QueryFns)] pub enum QueryMsg { /// Returns if token transfer is disabled. Response: IsFrozenResponse #[returns(IsFrozenResponse)] diff --git a/contracts/external/cw-vesting/Cargo.toml b/contracts/external/cw-vesting/Cargo.toml index 2689de7de..2f5204551 100644 --- a/contracts/external/cw-vesting/Cargo.toml +++ b/contracts/external/cw-vesting/Cargo.toml @@ -24,6 +24,7 @@ staking = ["cosmwasm-std/staking"] cosmwasm-schema = { workspace = true } cosmwasm-std = { workspace = true } cw-denom = { workspace = true } +cw-orch = { workspace = true } cw-ownable = { workspace = true } cw-stake-tracker = { workspace = true } cw-storage-plus = { workspace = true } diff --git a/contracts/external/cw-vesting/src/msg.rs b/contracts/external/cw-vesting/src/msg.rs index 5aac6ca17..a9a89e0ae 100644 --- a/contracts/external/cw-vesting/src/msg.rs +++ b/contracts/external/cw-vesting/src/msg.rs @@ -62,6 +62,7 @@ pub struct InstantiateMsg { #[cw_ownable_execute] #[cw_serde] +#[derive(cw_orch::ExecuteFns)] pub enum ExecuteMsg { /// Fund the contract with a cw20 token. The `msg` field must have /// the shape `{"fund":{}}`, and the amount sent must be the same @@ -194,7 +195,7 @@ pub enum ReceiveMsg { } #[cw_serde] -#[derive(QueryResponses)] +#[derive(QueryResponses, cw_orch::QueryFns)] pub enum QueryMsg { /// Get the current ownership. #[returns(::cw_ownable::Ownership<::cosmwasm_std::Addr>)] diff --git a/contracts/external/cw721-roles/Cargo.toml b/contracts/external/cw721-roles/Cargo.toml index 1a6935974..c5a4ee1d6 100644 --- a/contracts/external/cw721-roles/Cargo.toml +++ b/contracts/external/cw721-roles/Cargo.toml @@ -25,6 +25,7 @@ cw-storage-plus = { workspace = true } cw-utils = { workspace = true } cw2 = { workspace = true } cw4 = { workspace = true } +cw-orch = { workspace = true } cw721 = { workspace = true } cw721-base = { workspace = true, features = ["library"] } dao-cw721-extensions = { workspace = true } diff --git a/contracts/external/dao-migrator/Cargo.toml b/contracts/external/dao-migrator/Cargo.toml index 4d2b48cb8..877838d3c 100644 --- a/contracts/external/dao-migrator/Cargo.toml +++ b/contracts/external/dao-migrator/Cargo.toml @@ -24,6 +24,7 @@ cw-utils = { workspace = true } thiserror = { workspace = true } cw2 = { workspace = true } cw20 = { workspace = true } +cw-orch = { workspace = true } dao-interface = { workspace = true } dao-dao-core = { workspace = true, features = ["library"] } diff --git a/packages/cw-orch/Cargo.toml b/packages/cw-orch/Cargo.toml index e4d3826e2..7d159b7e9 100644 --- a/packages/cw-orch/Cargo.toml +++ b/packages/cw-orch/Cargo.toml @@ -18,6 +18,13 @@ cw20-stake = { version = "2.4.2", path = "../../contracts/staking/cw20-stake" } cw20-stake-external-rewards = { version = "2.4.2", path = "../../contracts/staking/cw20-stake-external-rewards" } cw20-stake-reward-distributor = { version = "2.4.2", path = "../../contracts/staking/cw20-stake-reward-distributor" } cw721-base.workspace = true +cw721-roles = { path = "../../contracts/external/cw721-roles", version = "2.4.2" } +cw-admin-factory = { path = "../../contracts/external/cw-admin-factory", version = "2.5.0" } +cw-vesting = { version = "2.4.2", path = "../../contracts/external/cw-vesting" } +cw-payroll-factory = { version = "2.4.2", path = "../../contracts/external/cw-payroll-factory" } +cw-token-swap = { version = "2.4.2", path = "../../contracts/external/cw-token-swap" } +cw-tokenfactory-issuer = { version = "2.4.2", path = "../../contracts/external/cw-tokenfactory-issuer" } +dao-migrator = { version = "2.4.2", path = "../../contracts/external/dao-migrator" } dao-dao-core = { version = "2.4.2", path = "../../contracts/dao-dao-core" } dao-interface = { version = "2.4.2", path = "../dao-interface" } dao-pre-propose-approval-single = { version = "2.4.2", path = "../../contracts/pre-propose/dao-pre-propose-approval-single" } diff --git a/packages/cw-orch/src/external/admin_factory.rs b/packages/cw-orch/src/external/admin_factory.rs new file mode 100644 index 000000000..065b26ec4 --- /dev/null +++ b/packages/cw-orch/src/external/admin_factory.rs @@ -0,0 +1,20 @@ +use cw_orch::{interface, prelude::*}; + +use cw_admin_factory::contract::{execute, instantiate, query, reply}; +use cw_admin_factory::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; + +#[interface(InstantiateMsg, ExecuteMsg, QueryMsg, Empty)] +pub struct DaoExternalAdminFactory; + +impl Uploadable for DaoExternalAdminFactory { + /// Return the path to the wasm file corresponding to the contract + fn wasm(_chain: &ChainInfoOwned) -> WasmPath { + artifacts_dir_from_workspace!() + .find_wasm_path("dao_admin_factory") + .unwrap() + } + /// Returns a CosmWasm contract wrapper + fn wrapper() -> Box> { + Box::new(ContractWrapper::new_with_empty(execute, instantiate, query).with_reply(reply)) + } +} diff --git a/packages/cw-orch/src/external/cw721_roles.rs b/packages/cw-orch/src/external/cw721_roles.rs new file mode 100644 index 000000000..61a7d264d --- /dev/null +++ b/packages/cw-orch/src/external/cw721_roles.rs @@ -0,0 +1,20 @@ +use cw_orch::{interface, prelude::*}; + +use cw721_roles::contract::{execute, instantiate, query}; +use cw721_roles::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; + +#[interface(InstantiateMsg, ExecuteMsg, QueryMsg, Empty)] +pub struct DaoExternalCw721Roles; + +impl Uploadable for DaoExternalCw721Roles { + /// Return the path to the wasm file corresponding to the contract + fn wasm(_chain: &ChainInfoOwned) -> WasmPath { + artifacts_dir_from_workspace!() + .find_wasm_path("dao_cw721_roles") + .unwrap() + } + /// Returns a CosmWasm contract wrapper + fn wrapper() -> Box> { + Box::new(ContractWrapper::new_with_empty(execute, instantiate, query)) + } +} \ No newline at end of file diff --git a/packages/cw-orch/src/external/cw_vesting.rs b/packages/cw-orch/src/external/cw_vesting.rs new file mode 100644 index 000000000..a533b0085 --- /dev/null +++ b/packages/cw-orch/src/external/cw_vesting.rs @@ -0,0 +1,20 @@ +use cw_orch::{interface, prelude::*}; + +use cw_vesting::contract::{execute, instantiate, query}; +use cw_vesting::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; + +#[interface(InstantiateMsg, ExecuteMsg, QueryMsg, Empty)] +pub struct DaoExternalCwVesting; + +impl Uploadable for DaoExternalCwVesting { + /// Return the path to the wasm file corresponding to the contract + fn wasm(_chain: &ChainInfoOwned) -> WasmPath { + artifacts_dir_from_workspace!() + .find_wasm_path("dao_cw_vesting") + .unwrap() + } + /// Returns a CosmWasm contract wrapper + fn wrapper() -> Box> { + Box::new(ContractWrapper::new_with_empty(execute, instantiate, query)) + } +} diff --git a/packages/cw-orch/src/external/migrator.rs b/packages/cw-orch/src/external/migrator.rs new file mode 100644 index 000000000..6f3ae1dad --- /dev/null +++ b/packages/cw-orch/src/external/migrator.rs @@ -0,0 +1,20 @@ +use cw_orch::{interface, prelude::*}; + +use dao_migrator::contract::{execute, instantiate, query, reply}; +use dao_migrator::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; + +#[interface(InstantiateMsg, ExecuteMsg, QueryMsg, Empty)] +pub struct DaoExternalMigrator; + +impl Uploadable for DaoExternalMigrator { + /// Return the path to the wasm file corresponding to the contract + fn wasm(_chain: &ChainInfoOwned) -> WasmPath { + artifacts_dir_from_workspace!() + .find_wasm_path("dao_migrator") + .unwrap() + } + /// Returns a CosmWasm contract wrapper + fn wrapper() -> Box> { + Box::new(ContractWrapper::new_with_empty(execute, instantiate, query).with_reply(reply)) + } +} diff --git a/packages/cw-orch/src/external/mod.rs b/packages/cw-orch/src/external/mod.rs new file mode 100644 index 000000000..9cd2910a9 --- /dev/null +++ b/packages/cw-orch/src/external/mod.rs @@ -0,0 +1,15 @@ +mod admin_factory; +mod cw721_roles; +mod cw_vesting; +mod migrator; +mod payroll_factory; +mod token_swap; +mod tokenfactory_issuer; + +pub use admin_factory::DaoExternalAdminFactory; +pub use cw721_roles::DaoExternalCw721Roles; +pub use cw_vesting::DaoExternalCwVesting; +pub use migrator::DaoExternalMigrator; +pub use payroll_factory::DaoExternalPayrollFactory; +pub use token_swap::DaoExternalTokenSwap; +pub use tokenfactory_issuer::DaoExternalTokenfactoryIssuer; \ No newline at end of file diff --git a/packages/cw-orch/src/external/payroll_factory.rs b/packages/cw-orch/src/external/payroll_factory.rs new file mode 100644 index 000000000..28af998bd --- /dev/null +++ b/packages/cw-orch/src/external/payroll_factory.rs @@ -0,0 +1,20 @@ +use cw_orch::{interface, prelude::*}; + +use cw_payroll_factory::contract::{execute, instantiate, query, reply}; +use cw_payroll_factory::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; + +#[interface(InstantiateMsg, ExecuteMsg, QueryMsg, Empty)] +pub struct DaoExternalPayrollFactory; + +impl Uploadable for DaoExternalPayrollFactory { + /// Return the path to the wasm file corresponding to the contract + fn wasm(_chain: &ChainInfoOwned) -> WasmPath { + artifacts_dir_from_workspace!() + .find_wasm_path("dao_payroll_factory") + .unwrap() + } + /// Returns a CosmWasm contract wrapper + fn wrapper() -> Box> { + Box::new(ContractWrapper::new_with_empty(execute, instantiate, query).with_reply(reply)) + } +} diff --git a/packages/cw-orch/src/external/token_swap.rs b/packages/cw-orch/src/external/token_swap.rs new file mode 100644 index 000000000..4b9dd8373 --- /dev/null +++ b/packages/cw-orch/src/external/token_swap.rs @@ -0,0 +1,21 @@ +use cosmwasm_std::Reply; +use cw_orch::{interface, prelude::*}; + +use cw_token_swap::contract::{execute, instantiate, migrate, query}; +use cw_token_swap::msg::{ExecuteMsg, InstantiateMsg, MigrateMsg, QueryMsg}; + +#[interface(InstantiateMsg, ExecuteMsg, QueryMsg, MigrateMsg)] +pub struct DaoExternalTokenSwap; + +impl Uploadable for DaoExternalTokenSwap { + /// Return the path to the wasm file corresponding to the contract + fn wasm(_chain: &ChainInfoOwned) -> WasmPath { + artifacts_dir_from_workspace!() + .find_wasm_path("dao_tokenswap") + .unwrap() + } + /// Returns a CosmWasm contract wrapper + fn wrapper() -> Box> { + Box::new(ContractWrapper::new_with_empty(execute, instantiate, query).with_migrate(migrate)) + } +} diff --git a/packages/cw-orch/src/external/tokenfactory_issuer.rs b/packages/cw-orch/src/external/tokenfactory_issuer.rs new file mode 100644 index 000000000..95e7f834c --- /dev/null +++ b/packages/cw-orch/src/external/tokenfactory_issuer.rs @@ -0,0 +1,24 @@ +use cw_orch::{interface, prelude::*}; + +use cw_tokenfactory_issuer::contract::{execute, instantiate, migrate, query, reply}; +use cw_tokenfactory_issuer::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; + +#[interface(InstantiateMsg, ExecuteMsg, QueryMsg, Empty)] +pub struct DaoExternalTokenfactoryIssuer; + +impl Uploadable for DaoExternalTokenfactoryIssuer { + /// Return the path to the wasm file corresponding to the contract + fn wasm(_chain: &ChainInfoOwned) -> WasmPath { + artifacts_dir_from_workspace!() + .find_wasm_path("dao_tokenfactory_issuer") + .unwrap() + } + /// Returns a CosmWasm contract wrapper + fn wrapper() -> Box> { + Box::new( + ContractWrapper::new_with_empty(execute, instantiate, query) + .with_reply(reply) + .with_migrate(migrate), + ) + } +} diff --git a/packages/cw-orch/src/lib.rs b/packages/cw-orch/src/lib.rs index 3b933d3b6..7a3794426 100644 --- a/packages/cw-orch/src/lib.rs +++ b/packages/cw-orch/src/lib.rs @@ -1,4 +1,5 @@ mod core; +mod external; mod pre_propose; mod proposal; mod staking; @@ -6,6 +7,7 @@ mod test_contracts; mod voting; pub use core::*; +pub use external::*; pub use pre_propose::*; pub use proposal::*; pub use staking::*; diff --git a/packages/dao-cw721-extensions/Cargo.toml b/packages/dao-cw721-extensions/Cargo.toml index 609e89d0d..f3d2ca49e 100644 --- a/packages/dao-cw721-extensions/Cargo.toml +++ b/packages/dao-cw721-extensions/Cargo.toml @@ -12,3 +12,4 @@ cosmwasm-std = { workspace = true } cosmwasm-schema = { workspace = true } cw-controllers = { workspace = true } cw4 = { workspace = true } +cw-orch = { workspace = true } diff --git a/packages/dao-cw721-extensions/src/roles.rs b/packages/dao-cw721-extensions/src/roles.rs index 0f2c9166a..a303e508e 100644 --- a/packages/dao-cw721-extensions/src/roles.rs +++ b/packages/dao-cw721-extensions/src/roles.rs @@ -10,6 +10,7 @@ pub struct MetadataExt { } #[cw_serde] +#[derive(cw_orch::ExecuteFns)] pub enum ExecuteExt { /// Add a new hook to be informed of all membership changes. /// Must be called by Admin @@ -32,7 +33,7 @@ pub enum ExecuteExt { impl CustomMsg for ExecuteExt {} #[cw_serde] -#[derive(QueryResponses)] +#[derive(QueryResponses, cw_orch::QueryFns)] pub enum QueryExt { /// Total weight at a given height #[returns(cw4::TotalWeightResponse)]