diff --git a/Cargo.toml b/Cargo.toml index 234acac..7e1fdf3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,7 +31,7 @@ lazy_static = "1.4.0" cw-orch = { version = "0.22.2" } const_format = "0.2.32" -my-app = { path = "contracts/my-app" } +intersync = { path = "contracts/intersync" } my-adapter = { path = "contracts/my-adapter" } speculoos = "0.11.0" semver = "1.0" diff --git a/contracts/my-app/Cargo.toml b/contracts/intersync/Cargo.toml similarity index 94% rename from contracts/my-app/Cargo.toml rename to contracts/intersync/Cargo.toml index 967bdbe..bce06cf 100644 --- a/contracts/my-app/Cargo.toml +++ b/contracts/intersync/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "my-app" +name = "intersync" version = "0.0.1" authors = [ "CyberHoward ", @@ -54,6 +54,9 @@ cw-asset = { workspace = true } abstract-app = { workspace = true } const_format = { workspace = true } serde = "1" +cw-utils = "1.0.3" +dao-voting = "2.3.0" + # Dependencies for interface cw-orch = { workspace = true } @@ -66,6 +69,6 @@ dotenv = { workspace = true, optional = true } env_logger = { workspace = true, optional = true } [dev-dependencies] -my-app = { workspace = true } +intersync = { workspace = true } abstract-client = { workspace = true } abstract-app = { workspace = true, features = ["test-utils"] } diff --git a/contracts/my-app/metadata.json b/contracts/intersync/metadata.json similarity index 100% rename from contracts/my-app/metadata.json rename to contracts/intersync/metadata.json diff --git a/contracts/my-app/src/bin/local_daemon.rs b/contracts/intersync/src/bin/local_daemon.rs similarity index 87% rename from contracts/my-app/src/bin/local_daemon.rs rename to contracts/intersync/src/bin/local_daemon.rs index df572c6..320a988 100644 --- a/contracts/my-app/src/bin/local_daemon.rs +++ b/contracts/intersync/src/bin/local_daemon.rs @@ -6,13 +6,13 @@ //! //! # Run //! -//! `RUST_LOG=info cargo run --bin --features="daemon-bin" local_daemon --package my-app` -use my_app::MY_APP_ID; +//! `RUST_LOG=info cargo run --bin --features="daemon-bin" local_daemon --package intersync` +use intersync::MY_APP_ID; use abstract_app::objects::namespace::Namespace; use abstract_client::{AbstractClient, Publisher}; use cw_orch::{anyhow, prelude::*, tokio::runtime::Runtime}; -use my_app::{msg::MyAppInstantiateMsg, MyAppInterface}; +use intersync::{msg::IntersyncInstantiateMsg, IntersyncInterface}; const LOCAL_MNEMONIC: &str = "clip hire initial neck maid actor venue client foam budget lock catalog sweet steak waste crater broccoli pipe steak sister coyote moment obvious choose"; @@ -46,16 +46,16 @@ fn main() -> anyhow::Result<()> { } // Publish the App to the Abstract Platform - publisher.publish_app::>()?; + publisher.publish_app::>()?; // Install the App on a new account let account = abstract_client.account_builder().build()?; // Installs the app on the Account - let app = account.install_app::>(&MyAppInstantiateMsg { count: 0 }, &[])?; + let app = account.install_app::>(&IntersyncInstantiateMsg { count: 0 }, &[])?; // Import app's endpoint function traits for easy interactions. - use my_app::msg::{MyAppExecuteMsgFns, MyAppQueryMsgFns}; + use intersync::msg::{IntersyncExecuteMsgFns, IntersyncQueryMsgFns}; assert_eq!(app.count()?.count, 0); // Execute the App app.increment()?; diff --git a/contracts/my-app/src/bin/publish.rs b/contracts/intersync/src/bin/publish.rs similarity index 94% rename from contracts/my-app/src/bin/publish.rs rename to contracts/intersync/src/bin/publish.rs index e43cee1..4e8965f 100644 --- a/contracts/my-app/src/bin/publish.rs +++ b/contracts/intersync/src/bin/publish.rs @@ -7,13 +7,13 @@ //! ```bash //! $ just publish uni-6 osmo-test-5 //! ``` -use my_app::MY_APP_ID; +use intersync::MY_APP_ID; use abstract_app::objects::namespace::Namespace; use abstract_client::{AbstractClient, Publisher}; use clap::Parser; use cw_orch::{anyhow, daemon::networks::parse_network, prelude::*, tokio::runtime::Runtime}; -use my_app::MyAppInterface; +use intersync::IntersyncInterface; fn publish(networks: Vec) -> anyhow::Result<()> { // run for each requested network @@ -38,7 +38,7 @@ fn publish(networks: Vec) -> anyhow::Result<()> { } // Publish the App to the Abstract Platform - publisher.publish_app::>()?; + publisher.publish_app::>()?; } Ok(()) } diff --git a/contracts/my-app/src/bin/schema.rs b/contracts/intersync/src/bin/schema.rs similarity index 79% rename from contracts/my-app/src/bin/schema.rs rename to contracts/intersync/src/bin/schema.rs index c7fa274..0dfdf25 100644 --- a/contracts/my-app/src/bin/schema.rs +++ b/contracts/intersync/src/bin/schema.rs @@ -1,5 +1,5 @@ use cosmwasm_schema::remove_schemas; -use my_app::contract::MyApp; +use intersync::contract::Intersync; use std::env::current_dir; use std::fs::create_dir_all; @@ -10,5 +10,5 @@ fn main() { remove_schemas(&out_dir).unwrap(); #[cfg(feature = "schema")] - MyApp::export_schema(&out_dir); + Intersync::export_schema(&out_dir); } diff --git a/contracts/my-app/src/contract.rs b/contracts/intersync/src/contract.rs similarity index 62% rename from contracts/my-app/src/contract.rs rename to contracts/intersync/src/contract.rs index ce773b8..96dff1e 100644 --- a/contracts/my-app/src/contract.rs +++ b/contracts/intersync/src/contract.rs @@ -1,7 +1,7 @@ use crate::{ - error::MyAppError, + error::IntersyncError, handlers, - msg::{MyAppExecuteMsg, MyAppInstantiateMsg, MyAppMigrateMsg, MyAppQueryMsg}, + msg::{IntersyncExecuteMsg, IntersyncInstantiateMsg, IntersyncMigrateMsg, IntersyncQueryMsg}, replies::{self, INSTANTIATE_REPLY_ID}, APP_VERSION, MY_APP_ID, }; @@ -10,13 +10,13 @@ use abstract_app::AppContract; use cosmwasm_std::Response; /// The type of the result returned by your app's entry points. -pub type MyAppResult = Result; +pub type IntersyncResult = Result; /// The type of the app that is used to build your app and access the Abstract SDK features. -pub type MyApp = - AppContract; +pub type Intersync = + AppContract; -const APP: MyApp = MyApp::new(MY_APP_ID, APP_VERSION, None) +const APP: Intersync = Intersync::new(MY_APP_ID, APP_VERSION, None) .with_instantiate(handlers::instantiate_handler) .with_execute(handlers::execute_handler) .with_query(handlers::query_handler) @@ -26,15 +26,15 @@ const APP: MyApp = MyApp::new(MY_APP_ID, APP_VERSION, None) // Export handlers #[cfg(feature = "export")] -abstract_app::export_endpoints!(APP, MyApp); +abstract_app::export_endpoints!(APP, Intersync); -abstract_app::cw_orch_interface!(APP, MyApp, MyAppInterface); +abstract_app::cw_orch_interface!(APP, Intersync, IntersyncInterface); // TODO: add to docmuentation // https://linear.app/abstract-sdk/issue/ABS-414/add-documentation-on-dependencycreation-trait #[cfg(not(target_arch = "wasm32"))] impl abstract_interface::DependencyCreation - for crate::MyAppInterface + for crate::IntersyncInterface { type DependenciesConfig = cosmwasm_std::Empty; } diff --git a/contracts/intersync/src/data.rs b/contracts/intersync/src/data.rs new file mode 100644 index 0000000..839f645 --- /dev/null +++ b/contracts/intersync/src/data.rs @@ -0,0 +1,10 @@ +use serde::{Serialize, Deserialize}; + +#[derive(Serialize, Deserialize)] +pub struct Data { + name: String, + + age: i64, + + sex: String, +} diff --git a/contracts/my-app/src/error.rs b/contracts/intersync/src/error.rs similarity index 95% rename from contracts/my-app/src/error.rs rename to contracts/intersync/src/error.rs index dc14d92..95775e8 100644 --- a/contracts/my-app/src/error.rs +++ b/contracts/intersync/src/error.rs @@ -7,7 +7,7 @@ use cw_controllers::AdminError; use thiserror::Error; #[derive(Error, Debug, PartialEq)] -pub enum MyAppError { +pub enum IntersyncError { #[error("{0}")] Std(#[from] StdError), diff --git a/contracts/intersync/src/handlers/execute.rs b/contracts/intersync/src/handlers/execute.rs new file mode 100644 index 0000000..342f09a --- /dev/null +++ b/contracts/intersync/src/handlers/execute.rs @@ -0,0 +1,44 @@ +use crate::{ + contract::{Intersync, IntersyncResult}, + msg::IntersyncExecuteMsg, + state::{CONFIG, COUNT}, +}; + +use abstract_app::traits::AbstractResponse; +use cosmwasm_std::{DepsMut, Env, MessageInfo}; + +pub fn execute_handler( + deps: DepsMut, + _env: Env, + info: MessageInfo, + app: Intersync, + msg: IntersyncExecuteMsg, +) -> IntersyncResult { + match msg { + IntersyncExecuteMsg::UpdateConfig {} => update_config(deps, info, app), + IntersyncExecuteMsg::Increment {} => increment(deps, app), + IntersyncExecuteMsg::Reset { count } => reset(deps, info, count, app), + } +} + +/// Update the configuration of the app +fn update_config(deps: DepsMut, msg_info: MessageInfo, app: Intersync) -> IntersyncResult { + // Only the admin should be able to call this + app.admin.assert_admin(deps.as_ref(), &msg_info.sender)?; + let mut _config = CONFIG.load(deps.storage)?; + + Ok(app.response("update_config")) +} + +fn increment(deps: DepsMut, app: Intersync) -> IntersyncResult { + COUNT.update(deps.storage, |count| IntersyncResult::Ok(count + 1))?; + + Ok(app.response("increment")) +} + +fn reset(deps: DepsMut, info: MessageInfo, count: i32, app: Intersync) -> IntersyncResult { + app.admin.assert_admin(deps.as_ref(), &info.sender)?; + COUNT.save(deps.storage, &count)?; + + Ok(app.response("reset")) +} diff --git a/contracts/my-app/src/handlers/instantiate.rs b/contracts/intersync/src/handlers/instantiate.rs similarity index 68% rename from contracts/my-app/src/handlers/instantiate.rs rename to contracts/intersync/src/handlers/instantiate.rs index a6f7d20..dbe2646 100644 --- a/contracts/my-app/src/handlers/instantiate.rs +++ b/contracts/intersync/src/handlers/instantiate.rs @@ -1,6 +1,6 @@ use crate::{ - contract::{MyApp, MyAppResult}, - msg::MyAppInstantiateMsg, + contract::{Intersync, IntersyncResult}, + msg::IntersyncInstantiateMsg, state::{Config, CONFIG, COUNT}, }; @@ -10,9 +10,9 @@ pub fn instantiate_handler( deps: DepsMut, _env: Env, _info: MessageInfo, - _app: MyApp, - msg: MyAppInstantiateMsg, -) -> MyAppResult { + _app: Intersync, + msg: IntersyncInstantiateMsg, +) -> IntersyncResult { let config: Config = Config {}; CONFIG.save(deps.storage, &config)?; diff --git a/contracts/my-app/src/handlers/migrate.rs b/contracts/intersync/src/handlers/migrate.rs similarity index 67% rename from contracts/my-app/src/handlers/migrate.rs rename to contracts/intersync/src/handlers/migrate.rs index 8424f22..ecf9d41 100644 --- a/contracts/my-app/src/handlers/migrate.rs +++ b/contracts/intersync/src/handlers/migrate.rs @@ -1,6 +1,6 @@ use crate::{ - contract::{MyApp, MyAppResult}, - msg::MyAppMigrateMsg, + contract::{Intersync, IntersyncResult}, + msg::IntersyncMigrateMsg, }; use abstract_app::traits::AbstractResponse; @@ -11,8 +11,8 @@ use cosmwasm_std::{DepsMut, Env}; pub fn migrate_handler( _deps: DepsMut, _env: Env, - app: MyApp, - _msg: MyAppMigrateMsg, -) -> MyAppResult { + app: Intersync, + _msg: IntersyncMigrateMsg, +) -> IntersyncResult { Ok(app.response("migrate")) } diff --git a/contracts/my-app/src/handlers/mod.rs b/contracts/intersync/src/handlers/mod.rs similarity index 100% rename from contracts/my-app/src/handlers/mod.rs rename to contracts/intersync/src/handlers/mod.rs diff --git a/contracts/my-app/src/handlers/query.rs b/contracts/intersync/src/handlers/query.rs similarity index 58% rename from contracts/my-app/src/handlers/query.rs rename to contracts/intersync/src/handlers/query.rs index 2fc60d5..905cf3f 100644 --- a/contracts/my-app/src/handlers/query.rs +++ b/contracts/intersync/src/handlers/query.rs @@ -1,6 +1,6 @@ use crate::{ - contract::{MyApp, MyAppResult}, - msg::{ConfigResponse, CountResponse, MyAppQueryMsg}, + contract::{Intersync, IntersyncResult}, + msg::{ConfigResponse, CountResponse, IntersyncQueryMsg}, state::{CONFIG, COUNT}, }; @@ -9,12 +9,12 @@ use cosmwasm_std::{to_json_binary, Binary, Deps, Env, StdResult}; pub fn query_handler( deps: Deps, _env: Env, - _app: &MyApp, - msg: MyAppQueryMsg, -) -> MyAppResult { + _app: &Intersync, + msg: IntersyncQueryMsg, +) -> IntersyncResult { match msg { - MyAppQueryMsg::Config {} => to_json_binary(&query_config(deps)?), - MyAppQueryMsg::Count {} => to_json_binary(&query_count(deps)?), + IntersyncQueryMsg::Config {} => to_json_binary(&query_config(deps)?), + IntersyncQueryMsg::Count {} => to_json_binary(&query_count(deps)?), } .map_err(Into::into) } diff --git a/contracts/my-app/src/lib.rs b/contracts/intersync/src/lib.rs similarity index 72% rename from contracts/my-app/src/lib.rs rename to contracts/intersync/src/lib.rs index c8fff1d..23e65bd 100644 --- a/contracts/my-app/src/lib.rs +++ b/contracts/intersync/src/lib.rs @@ -6,13 +6,13 @@ mod replies; pub mod state; mod data; -pub use error::MyAppError; +pub use error::IntersyncError; /// The version of your app pub const APP_VERSION: &str = env!("CARGO_PKG_VERSION"); -pub use contract::interface::MyAppInterface; +pub use contract::interface::IntersyncInterface; pub const MY_NAMESPACE: &str = "yournamespace"; -pub const MY_APP_NAME: &str = "my-app"; +pub const MY_APP_NAME: &str = "intersync"; pub const MY_APP_ID: &str = const_format::formatcp!("{MY_NAMESPACE}:{MY_APP_NAME}"); diff --git a/contracts/my-app/src/msg.rs b/contracts/intersync/src/msg.rs similarity index 59% rename from contracts/my-app/src/msg.rs rename to contracts/intersync/src/msg.rs index 753df87..1210b4a 100644 --- a/contracts/my-app/src/msg.rs +++ b/contracts/intersync/src/msg.rs @@ -1,13 +1,13 @@ -use crate::contract::MyApp; +use crate::contract::Intersync; use cosmwasm_schema::QueryResponses; // This is used for type safety and re-exporting the contract endpoint structs. -abstract_app::app_msg_types!(MyApp, MyAppExecuteMsg, MyAppQueryMsg); +abstract_app::app_msg_types!(Intersync, IntersyncExecuteMsg, IntersyncQueryMsg); /// App instantiate message #[cosmwasm_schema::cw_serde] -pub struct MyAppInstantiateMsg { +pub struct IntersyncInstantiateMsg { pub count: i32, } @@ -15,25 +15,29 @@ pub struct MyAppInstantiateMsg { #[cosmwasm_schema::cw_serde] #[derive(cw_orch::ExecuteFns)] #[impl_into(ExecuteMsg)] -pub enum MyAppExecuteMsg { - UpdateConfig {}, - /// Increment count by 1 - Increment {}, - /// Admin method - reset count - Reset { - /// Count value after reset - count: i32, +pub enum IntersyncExecuteMsg { + /// Called by gov when a chain wants to create a proposal + CreateProposal { + + }, + /// Can be called by any chain to trigger tallying + TallyProposal { + }, + ///Called by gov to vote on a proposal + VoteProposal { + + } } #[cosmwasm_schema::cw_serde] -pub struct MyAppMigrateMsg {} +pub struct IntersyncMigrateMsg {} /// App query messages #[cosmwasm_schema::cw_serde] #[derive(QueryResponses, cw_orch::QueryFns)] #[impl_into(QueryMsg)] -pub enum MyAppQueryMsg { +pub enum IntersyncQueryMsg { #[returns(ConfigResponse)] Config {}, #[returns(CountResponse)] diff --git a/contracts/intersync/src/replies/instantiate.rs b/contracts/intersync/src/replies/instantiate.rs new file mode 100644 index 0000000..9442c1a --- /dev/null +++ b/contracts/intersync/src/replies/instantiate.rs @@ -0,0 +1,8 @@ +use crate::contract::{Intersync, IntersyncResult}; + +use abstract_app::traits::AbstractResponse; +use cosmwasm_std::{DepsMut, Env, Reply}; + +pub fn instantiate_reply(_deps: DepsMut, _env: Env, app: Intersync, _reply: Reply) -> IntersyncResult { + Ok(app.response("instantiate_reply")) +} diff --git a/contracts/my-app/src/replies/mod.rs b/contracts/intersync/src/replies/mod.rs similarity index 100% rename from contracts/my-app/src/replies/mod.rs rename to contracts/intersync/src/replies/mod.rs diff --git a/contracts/intersync/src/state.rs b/contracts/intersync/src/state.rs new file mode 100644 index 0000000..bc9ba78 --- /dev/null +++ b/contracts/intersync/src/state.rs @@ -0,0 +1,63 @@ +use cosmwasm_schema::cw_serde; +use cosmwasm_std::{Binary, CosmosMsg, Empty, Uint128}; +use cw_storage_plus::{Item, Map}; +use cw_utils::Expiration; +use dao_voting::{threshold::Threshold, voting::Votes}; + +#[cosmwasm_schema::cw_serde] +pub struct Config {} + +pub const CONFIG: Item = Item::new("config"); +pub const COUNT: Item = Item::new("count"); + +pub const DATA: Map = Map::new("gov_data"); +pub const ITEM: Item = Item::new("members"); + +#[cw_serde] +pub enum Status { + Initiate = 0, + Stable = 1, + Locked = 2, +} + +#[cw_serde] +pub struct Members { + pub status: Status, + pub members: Vec, +} + +// https://github.com/DA0-DA0/dao-contracts/blob/development/contracts/proposal/dao-proposal-single/src/proposal.rs +#[cw_serde] +pub struct Proposal { + /// The title of the proposal + pub title: String, + /// The main body of the proposal text + pub description: String, + /// The address that created this proposal. + pub proposer: String, + /// The block height at which this proposal was created. Voting + /// power queries should query for voting power at this block + /// height. + pub start_height: u64, + /// The minimum amount of time this proposal must remain open for + /// voting. The proposal may not pass unless this is expired or + /// None. + pub min_voting_period: Option, + /// The the time at which this proposal will expire and close for + /// additional votes. + pub expiration: Expiration, + /// The threshold at which this proposal will pass. + pub threshold: Threshold, + /// The total amount of voting power at the time of this + /// proposal's creation. + pub total_power: Uint128, + /// The messages that will be executed should this proposal pass. + pub msgs: Vec>, + /// The proposal status + pub status: Status, + /// Votes on a particular proposal + pub votes: Votes, + /// Whether or not revoting is enabled. If revoting is enabled, a proposal + /// cannot pass until the voting period has elapsed. + pub allow_revoting: bool, +} diff --git a/contracts/my-app/tests/integration.rs b/contracts/intersync/tests/integration.rs similarity index 83% rename from contracts/my-app/tests/integration.rs rename to contracts/intersync/tests/integration.rs index 973875a..092d6a7 100644 --- a/contracts/my-app/tests/integration.rs +++ b/contracts/intersync/tests/integration.rs @@ -1,9 +1,9 @@ -use my_app::{ - contract::interface::MyAppInterface, +use intersync::{ + contract::interface::IntersyncInterface, msg::{ - ConfigResponse, CountResponse, MyAppExecuteMsgFns, MyAppInstantiateMsg, MyAppQueryMsgFns, + ConfigResponse, CountResponse, IntersyncExecuteMsgFns, IntersyncInstantiateMsg, IntersyncQueryMsgFns, }, - MyAppError, MY_NAMESPACE, + IntersyncError, MY_NAMESPACE, }; use abstract_app::objects::namespace::Namespace; @@ -15,7 +15,7 @@ use cw_orch::{anyhow, prelude::*}; struct TestEnv { abs: AbstractClient, - app: Application>, + app: Application>, } impl TestEnv { @@ -33,11 +33,11 @@ impl TestEnv { // Publish the app let publisher = abs_client.publisher_builder(namespace).build()?; - publisher.publish_app::>()?; + publisher.publish_app::>()?; let app = publisher .account() - .install_app::>(&MyAppInstantiateMsg { count: 0 }, &[])?; + .install_app::>(&IntersyncInstantiateMsg { count: 0 }, &[])?; Ok(TestEnv { abs: abs_client, @@ -83,13 +83,13 @@ fn failed_reset() -> anyhow::Result<()> { let env = TestEnv::setup()?; let app = env.app; - let err: MyAppError = app + let err: IntersyncError = app .call_as(&Addr::unchecked("NotAdmin")) .reset(9) .unwrap_err() .downcast() .unwrap(); - assert_eq!(err, MyAppError::Admin(AdminError::NotAdmin {})); + assert_eq!(err, IntersyncError::Admin(AdminError::NotAdmin {})); Ok(()) } @@ -100,7 +100,7 @@ fn update_config() -> anyhow::Result<()> { app.update_config()?; let config = app.config()?; - let expected_response = my_app::msg::ConfigResponse {}; + let expected_response = intersync::msg::ConfigResponse {}; assert_eq!(config, expected_response); Ok(()) } diff --git a/contracts/my-app/src/data.rs b/contracts/my-app/src/data.rs deleted file mode 100644 index f08f16c..0000000 --- a/contracts/my-app/src/data.rs +++ /dev/null @@ -1,23 +0,0 @@ -// Example code that deserializes and serializes the model. -// extern crate serde; -// #[macro_use] -// extern crate serde_derive; -// extern crate serde_json; -// -// use generated_module::data; -// -// fn main() { -// let json = r#"{"answer": 42}"#; -// let model: data = serde_json::from_str(&json).unwrap(); -// } - -use serde::{Serialize, Deserialize}; - -#[derive(Serialize, Deserialize)] -pub struct Data { - name: String, - - age: i64, - - sex: String, -} diff --git a/contracts/my-app/src/handlers/execute.rs b/contracts/my-app/src/handlers/execute.rs deleted file mode 100644 index d1bd405..0000000 --- a/contracts/my-app/src/handlers/execute.rs +++ /dev/null @@ -1,44 +0,0 @@ -use crate::{ - contract::{MyApp, MyAppResult}, - msg::MyAppExecuteMsg, - state::{CONFIG, COUNT}, -}; - -use abstract_app::traits::AbstractResponse; -use cosmwasm_std::{DepsMut, Env, MessageInfo}; - -pub fn execute_handler( - deps: DepsMut, - _env: Env, - info: MessageInfo, - app: MyApp, - msg: MyAppExecuteMsg, -) -> MyAppResult { - match msg { - MyAppExecuteMsg::UpdateConfig {} => update_config(deps, info, app), - MyAppExecuteMsg::Increment {} => increment(deps, app), - MyAppExecuteMsg::Reset { count } => reset(deps, info, count, app), - } -} - -/// Update the configuration of the app -fn update_config(deps: DepsMut, msg_info: MessageInfo, app: MyApp) -> MyAppResult { - // Only the admin should be able to call this - app.admin.assert_admin(deps.as_ref(), &msg_info.sender)?; - let mut _config = CONFIG.load(deps.storage)?; - - Ok(app.response("update_config")) -} - -fn increment(deps: DepsMut, app: MyApp) -> MyAppResult { - COUNT.update(deps.storage, |count| MyAppResult::Ok(count + 1))?; - - Ok(app.response("increment")) -} - -fn reset(deps: DepsMut, info: MessageInfo, count: i32, app: MyApp) -> MyAppResult { - app.admin.assert_admin(deps.as_ref(), &info.sender)?; - COUNT.save(deps.storage, &count)?; - - Ok(app.response("reset")) -} diff --git a/contracts/my-app/src/replies/instantiate.rs b/contracts/my-app/src/replies/instantiate.rs deleted file mode 100644 index 531f49e..0000000 --- a/contracts/my-app/src/replies/instantiate.rs +++ /dev/null @@ -1,8 +0,0 @@ -use crate::contract::{MyApp, MyAppResult}; - -use abstract_app::traits::AbstractResponse; -use cosmwasm_std::{DepsMut, Env, Reply}; - -pub fn instantiate_reply(_deps: DepsMut, _env: Env, app: MyApp, _reply: Reply) -> MyAppResult { - Ok(app.response("instantiate_reply")) -} diff --git a/contracts/my-app/src/state.rs b/contracts/my-app/src/state.rs deleted file mode 100644 index 52b2a63..0000000 --- a/contracts/my-app/src/state.rs +++ /dev/null @@ -1,7 +0,0 @@ -use cw_storage_plus::Item; - -#[cosmwasm_schema::cw_serde] -pub struct Config {} - -pub const CONFIG: Item = Item::new("config"); -pub const COUNT: Item = Item::new("count"); diff --git a/justfile b/justfile index 7ec2ac3..4ae6463 100644 --- a/justfile +++ b/justfile @@ -2,7 +2,7 @@ gen-data-schema: #!/usr/bin/env bash quicktype --lang schema data-schema/data.json -o data-schema/schema.json - quicktype --lang rust data-schema/data.json -o contracts/my-app/src/data.rs + quicktype --lang rust data-schema/data.json -o contracts/intersync/src/data.rs # Install the tools that are used in this justfile install-tools: