diff --git a/.github/workflows/framework-check.yml b/.github/workflows/framework-check.yml index 11434dd8ff..8b239f9d68 100644 --- a/.github/workflows/framework-check.yml +++ b/.github/workflows/framework-check.yml @@ -7,10 +7,10 @@ on: paths: - "framework/**" pull_request: - paths: + paths: - "framework/**" -env: +env: SCCACHE_GHA_ENABLED: "true" RUSTC_WRAPPER: "sccache" @@ -63,7 +63,7 @@ jobs: toolchain: ${{ matrix.toolchain }} components: clippy - uses: Swatinem/rust-cache@v2 - with: + with: workspaces: "framework -> target" - name: cargo clippy working-directory: ./framework @@ -112,37 +112,30 @@ jobs: - name: cargo install cargo-hack uses: taiki-e/install-action@cargo-hack - uses: Swatinem/rust-cache@v2 - with: - workspaces: "framework -> target" + with: + workspaces: "framework -> target" - name: cargo hack working-directory: ./framework run: cargo hack --feature-powerset check --lib --tests # Find any unused dependencies unused-deps: runs-on: ubuntu-latest - name: nigtly / unused-deps + name: stable / unused-deps steps: - uses: actions/checkout@v3 with: submodules: true - - uses: webfactory/ssh-agent@v0.8.0 - with: - ssh-private-key: | - ${{ secrets.SSH_PRIVATE_KEY_MULTI_TEST }} - ${{ secrets.SSH_PRIVATE_KEY_CW_ORCH_INTERCHAIN }} - name: Setup sccache uses: mozilla-actions/sccache-action@v0.0.5 with: version: "v0.8.1" - - name: Install nightly - uses: dtolnay/rust-toolchain@nightly - - name: cargo install cargo-udeps - uses: taiki-e/install-action@cargo-udeps - - name: cargo install cargo-workspaces - run: cargo +stable install cargo-workspaces - - uses: Swatinem/rust-cache@v2 - with: - workspaces: "framework -> target" - - name: cargo udeps framework + - name: Install stable + uses: dtolnay/rust-toolchain@master + with: + toolchain: stable + - name: Install cargo-machete + working-directory: ./framework + run: cargo install cargo-machete + - name: Install cargo-machete working-directory: ./framework - run: cargo workspaces exec cargo +nightly udeps --workspace --exclude "workspace-hack" \ No newline at end of file + run: cargo machete ./contracts/* ./packages/* diff --git a/.github/workflows/framework-test.yml b/.github/workflows/framework-test.yml index b9441c3fd1..46fd289e6f 100644 --- a/.github/workflows/framework-test.yml +++ b/.github/workflows/framework-test.yml @@ -23,11 +23,6 @@ jobs: - uses: actions/checkout@v3 with: submodules: true - - uses: webfactory/ssh-agent@v0.8.0 - with: - ssh-private-key: | - ${{ secrets.SSH_PRIVATE_KEY_MULTI_TEST }} - ${{ secrets.SSH_PRIVATE_KEY_CW_ORCH_INTERCHAIN }} - name: Setup sccache uses: mozilla-actions/sccache-action@v0.0.5 with: diff --git a/.github/workflows/modules-check.yml b/.github/workflows/modules-check.yml index a284d50136..cc30e1f29b 100644 --- a/.github/workflows/modules-check.yml +++ b/.github/workflows/modules-check.yml @@ -39,7 +39,7 @@ jobs: strategy: fail-fast: false matrix: - toolchain: [stable, beta] + toolchain: [stable] steps: - uses: actions/checkout@v3 with: @@ -99,7 +99,7 @@ jobs: --mutually-exclusive-features \ wynd,osmosis,astroport,bow,terraswap,astrovault,testing,osmosis-test,node-tests,interface,cw-orch,schema \ --lib --tests - + # Find any unused dependencies unused-deps: runs-on: ubuntu-latest @@ -108,21 +108,17 @@ jobs: - uses: actions/checkout@v3 with: submodules: true - - uses: webfactory/ssh-agent@v0.8.0 - with: - ssh-private-key: | - ${{ secrets.SSH_PRIVATE_KEY_MULTI_TEST }} - ${{ secrets.SSH_PRIVATE_KEY_CW_ORCH_INTERCHAIN }} - name: Setup sccache uses: mozilla-actions/sccache-action@v0.0.5 with: version: "v0.8.1" - - name: Install nightly - uses: dtolnay/rust-toolchain@nightly - - name: cargo install cargo-udeps - uses: taiki-e/install-action@cargo-udeps - - name: cargo install cargo-workspaces - run: cargo +stable install cargo-workspaces - - name: cargo udeps modules + - name: Install stable + uses: dtolnay/rust-toolchain@master + with: + toolchain: stable + - name: Install cargo-machete + working-directory: ./modules + run: cargo install cargo-machete + - name: Install cargo-machete working-directory: ./modules - run: cargo workspaces exec cargo +nightly udeps + run: cargo machete diff --git a/framework/Cargo.lock b/framework/Cargo.lock index 0951ed3b2c..ddada85f7d 100644 --- a/framework/Cargo.lock +++ b/framework/Cargo.lock @@ -37,16 +37,13 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "coverage-helper", - "cw-asset", "cw-controllers", "cw-orch 0.27.0", "cw-storage-plus", "cw2", "cw20", "rstest", - "schemars", "semver", - "serde", "serial_test", "thiserror", "workspace-hack", @@ -66,7 +63,6 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "coverage-helper", - "cw-controllers", "cw-orch 0.27.0", "cw-storage-plus", "cw2", @@ -98,14 +94,12 @@ dependencies = [ "cosmwasm-std", "coverage-helper", "cw-asset", - "cw-controllers", "cw-ownable", "cw-storage-plus", "cw2", "cw20", "rstest", "semver", - "serde", "thiserror", "workspace-hack", ] @@ -125,13 +119,11 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "coverage-helper", - "cw-asset", "cw-controllers", "cw-orch 0.27.0", "cw-storage-plus", "cw2", "schemars", - "semver", "serde", "thiserror", "workspace-hack", @@ -145,7 +137,6 @@ dependencies = [ "abstract-adapter", "abstract-app", "abstract-client", - "abstract-cw-orch-polytone", "abstract-interface", "abstract-registry", "abstract-std", @@ -227,13 +218,9 @@ dependencies = [ "cw-address-like", "cw-asset", "cw-orch 0.27.0", - "cw-storage-plus", - "cw20", "dotenv", "env_logger", - "schemars", "semver", - "serde", "thiserror", "workspace-hack", ] @@ -261,7 +248,6 @@ dependencies = [ "ibc-proto", "prost", "semver", - "serde", "thiserror", "workspace-hack", ] @@ -280,16 +266,13 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "coverage-helper", - "cw-controllers", "cw-orch 0.27.0", "cw-ownable", "cw-paginate", "cw-storage-plus", "cw-utils", "cw2", - "schemars", "semver", - "serde", "thiserror", "workspace-hack", ] @@ -300,22 +283,16 @@ version = "0.25.0" dependencies = [ "abstract-sdk", "abstract-testing", - "alloy", - "alloy-sol-types", "anyhow", "cosmwasm-schema", "cosmwasm-std", "coverage-helper", "cw-orch 0.27.0", "cw-ownable", - "cw-storage-plus", "cw20-base", "map-macro", "polytone-evm", "rstest", - "schemars", - "serde", - "thiserror", "workspace-hack", ] @@ -332,12 +309,10 @@ dependencies = [ "cosmwasm-std", "coverage-helper", "cw-ownable", - "cw-storage-plus", "cw2", "evm-note", "polytone-evm", "semver", - "serde", "thiserror", "workspace-hack", ] @@ -356,11 +331,8 @@ dependencies = [ "anyhow", "cosmwasm-schema", "cosmwasm-std", - "cw-asset", "cw-orch 0.27.0", - "cw-ownable", "cw2", - "log", "semver", "workspace-hack", ] @@ -411,7 +383,6 @@ name = "abstract-macros" version = "0.25.0" dependencies = [ "cosmwasm-std", - "coverage-helper", "proc-macro2", "quote", "syn 1.0.109", @@ -431,11 +402,8 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "coverage-helper", - "cw-asset", - "cw-controllers", "cw-orch 0.27.0", "cw-ownable", - "cw-storage-plus", "cw2", "semver", "serde-cw-value", @@ -455,10 +423,6 @@ dependencies = [ "cosmwasm-std", "cw-asset", "cw-orch 0.27.0", - "cw-storage-plus", - "cw20", - "schemars", - "serde", "thiserror", "workspace-hack", ] @@ -543,7 +507,6 @@ dependencies = [ "cw-storage-plus", "cw2", "semver", - "serde", "thiserror", "workspace-hack", ] @@ -562,16 +525,12 @@ dependencies = [ "coverage-helper", "cw-asset", "cw-clearable", - "cw-controllers", "cw-ownable", "cw-storage-plus", "cw2", "cw20", - "doc-comment", "ibc-proto", - "prost-types", "schemars", - "semver", "serde", "serde-cw-value", "serde_json", @@ -595,14 +554,10 @@ dependencies = [ "cosmwasm-std", "cw-asset", "cw-orch 0.27.0", - "cw-storage-plus", "cw-utils", - "cw20", "dotenv", "env_logger", - "schemars", "semver", - "serde", "thiserror", "workspace-hack", ] @@ -620,14 +575,11 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "coverage-helper", - "cw-asset", "cw-controllers", "cw-orch 0.27.0", "cw-storage-plus", "cw2", - "schemars", "semver", - "serde", "thiserror", "workspace-hack", ] @@ -651,7 +603,6 @@ dependencies = [ "cw-storage-plus", "cw-utils", "cw2", - "cw20", "cw20-base", "function_name", "rstest", @@ -669,14 +620,11 @@ version = "0.25.0" dependencies = [ "abstract-sdk", "abstract-std", - "cosmwasm-schema", "cosmwasm-std", "cw-asset", "cw-storage-plus", "cw2", "derive_builder 0.12.0", - "schemars", - "semver", "serde", "serde_json", "workspace-hack", @@ -3050,12 +2998,6 @@ dependencies = [ "syn 2.0.87", ] -[[package]] -name = "doc-comment" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" - [[package]] name = "dotenv" version = "0.15.0" @@ -8040,7 +7982,6 @@ dependencies = [ "ppv-lite86", "primeorder", "prost", - "prost-types", "rand", "rand_chacha", "rand_core", diff --git a/framework/Cargo.toml b/framework/Cargo.toml index 1a6bd643d9..993f17e8b6 100644 --- a/framework/Cargo.toml +++ b/framework/Cargo.toml @@ -32,7 +32,7 @@ version = "0.25.0" [workspace.dependencies] cosmwasm-schema = { version = "2.0" } -cosmwasm-std = { version = "2.0.0", features = ["cosmwasm_1_2"] } +cosmwasm-std = { version = "2.0.0", features = ["cosmwasm_2_0"] } cw-controllers = { version = "2.0" } cw-storage-plus = "2.0.0" cw-utils = { version = "2.0" } diff --git a/framework/artifacts/abstract_account-xion.wasm b/framework/artifacts/abstract_account-xion.wasm index f9a331afd5..a9712b29ff 100644 Binary files a/framework/artifacts/abstract_account-xion.wasm and b/framework/artifacts/abstract_account-xion.wasm differ diff --git a/framework/artifacts/abstract_account.wasm b/framework/artifacts/abstract_account.wasm index 1facf7cbb1..4fd71a9a9d 100644 Binary files a/framework/artifacts/abstract_account.wasm and b/framework/artifacts/abstract_account.wasm differ diff --git a/framework/artifacts/abstract_ans_host.wasm b/framework/artifacts/abstract_ans_host.wasm index 83f79ae0fa..cf66976e6e 100644 Binary files a/framework/artifacts/abstract_ans_host.wasm and b/framework/artifacts/abstract_ans_host.wasm differ diff --git a/framework/artifacts/abstract_ibc_client.wasm b/framework/artifacts/abstract_ibc_client.wasm index 1380f66afe..dcbf993eef 100644 Binary files a/framework/artifacts/abstract_ibc_client.wasm and b/framework/artifacts/abstract_ibc_client.wasm differ diff --git a/framework/artifacts/abstract_ibc_host.wasm b/framework/artifacts/abstract_ibc_host.wasm index 467ac3cbf3..9a559f4f52 100644 Binary files a/framework/artifacts/abstract_ibc_host.wasm and b/framework/artifacts/abstract_ibc_host.wasm differ diff --git a/framework/artifacts/abstract_ica_client.wasm b/framework/artifacts/abstract_ica_client.wasm index f58bd84a48..b2fd962d35 100644 Binary files a/framework/artifacts/abstract_ica_client.wasm and b/framework/artifacts/abstract_ica_client.wasm differ diff --git a/framework/artifacts/abstract_module_factory.wasm b/framework/artifacts/abstract_module_factory.wasm index 6551eeee6b..cf822f15e3 100644 Binary files a/framework/artifacts/abstract_module_factory.wasm and b/framework/artifacts/abstract_module_factory.wasm differ diff --git a/framework/artifacts/abstract_registry.wasm b/framework/artifacts/abstract_registry.wasm index ff2a4cae78..f556baa4cb 100644 Binary files a/framework/artifacts/abstract_registry.wasm and b/framework/artifacts/abstract_registry.wasm differ diff --git a/framework/artifacts/checksums.txt b/framework/artifacts/checksums.txt index a4876cb636..7a2d601d87 100644 --- a/framework/artifacts/checksums.txt +++ b/framework/artifacts/checksums.txt @@ -1,8 +1,8 @@ -a686de8896ae1cdea30d016f0637ea881b36a50be302b5bcb65156997e789c8f abstract_account-xion.wasm -a27947cc60fdda96997acc0b40d9ca8a9fd38ad11ff30113f23677bdb72bad78 abstract_account.wasm -99c45571be4e98dad47e2975adb47aba4874cd858eb11d41243f19b23d36e166 abstract_ans_host.wasm -cd82c613d823674197e308fba76b463abd66ea3b05d1277413ae3af142ac7cd9 abstract_ibc_client.wasm -91c090db1753e7fb8bb453b2689f6a75fb261a11bb0a605e30cdd0501fe07a4d abstract_ibc_host.wasm -042f875a43c7cd110545e5bab20e54b085fc7e0fa43028250d6752f6759cf79d abstract_ica_client.wasm -1363539feb665f409311c69b12a9774b824584ea28e2d703a6f5ea08de1d0875 abstract_module_factory.wasm -43fc14f0ce88cc2c61ebd3b71dc21693769751d4e38852a0b8d7a522e7709bba abstract_registry.wasm +9737a1936b586437ea8aac0dc145cc1f4696fabe804ebad1acf9165c405f750c abstract_account-xion.wasm +a45246011db37252b094ec7b7351af78edb446d43d123479b7e36ecbdb559a97 abstract_account.wasm +1d4bc37f17f17f69d5832aafb4595b1f859ff35cb3072ce847e1ed9bf637877d abstract_ans_host.wasm +03440f903cb555c533a8a930d036826510806161e7cf2d2edba5c2c7884b374a abstract_ibc_client.wasm +01a133a39aa861d619b8e03703d053ce645a68f3e1d165780272b5c883801c08 abstract_ibc_host.wasm +875f2f42645e871c732d0ad3873d2560b5508f7ec0e45220b309b35d550c9171 abstract_ica_client.wasm +9f6180c43f352adc7bd36a99b6832c783af39fce206a74f66739676456064922 abstract_module_factory.wasm +8a8a599f78816f86ada549c0ec042e8be24acadb80d35b0fb15b190782e355f4 abstract_registry.wasm diff --git a/framework/contracts/account/Cargo.toml b/framework/contracts/account/Cargo.toml index f2bbb94af4..6c3c775a03 100644 --- a/framework/contracts/account/Cargo.toml +++ b/framework/contracts/account/Cargo.toml @@ -35,14 +35,10 @@ abstract-sdk = { workspace = true } abstract-std = { workspace = true } cosmwasm-schema = { workspace = true } cosmwasm-std = { workspace = true } -cw-asset = { workspace = true } cw-controllers = { workspace = true } cw-storage-plus = { workspace = true } cw2 = { workspace = true } -cw20 = { workspace = true } -schemars = { workspace = true } semver = { workspace = true } -serde = { workspace = true } thiserror = { workspace = true } abstract-ica = { workspace = true } diff --git a/framework/contracts/account/tests/xion.rs b/framework/contracts/account/tests/xion.rs index 00acb1ec8f..31b887da1a 100644 --- a/framework/contracts/account/tests/xion.rs +++ b/framework/contracts/account/tests/xion.rs @@ -320,7 +320,7 @@ mod actual_signature { )); let code_id = abstr.account_code_id().unwrap(); - let account_addr = account_addr(&abstr)?; + let account_addr = account_addr(abstr)?; let wallet = xion_wallet()?; let signature = wallet.sign(account_addr.as_bytes()).unwrap(); diff --git a/framework/contracts/native/ans-host/Cargo.toml b/framework/contracts/native/ans-host/Cargo.toml index 707f690e81..bff37acc4d 100644 --- a/framework/contracts/native/ans-host/Cargo.toml +++ b/framework/contracts/native/ans-host/Cargo.toml @@ -26,12 +26,10 @@ abstract-sdk = { workspace = true } abstract-std = { workspace = true } cosmwasm-std = { workspace = true } cw-asset = { workspace = true } -cw-controllers = { workspace = true } cw-ownable = { workspace = true } cw-storage-plus = { workspace = true } cw2 = { workspace = true } semver = { workspace = true } -serde = { workspace = true } thiserror = { workspace = true } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] diff --git a/framework/contracts/native/ibc-client/Cargo.toml b/framework/contracts/native/ibc-client/Cargo.toml index 3b8367cb1e..510d336f20 100644 --- a/framework/contracts/native/ibc-client/Cargo.toml +++ b/framework/contracts/native/ibc-client/Cargo.toml @@ -30,8 +30,8 @@ cw-storage-plus = { workspace = true } cw-utils = { workspace = true } cw2 = { workspace = true } semver = { workspace = true } -serde = { workspace = true } -thiserror = { workspace = true } + +thiserror = { workspace = true } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] workspace-hack = { version = "0.1", path = "../../../workspace-hack" } diff --git a/framework/contracts/native/ibc-host/Cargo.toml b/framework/contracts/native/ibc-host/Cargo.toml index 12fb9df7fa..68f5cf7b19 100644 --- a/framework/contracts/native/ibc-host/Cargo.toml +++ b/framework/contracts/native/ibc-host/Cargo.toml @@ -26,16 +26,13 @@ abstract-sdk = { workspace = true } abstract-std = { workspace = true } cosmwasm-schema = { workspace = true } cosmwasm-std = { workspace = true, features = ["stargate"] } -cw-controllers = { workspace = true } cw-orch = { workspace = true } cw-ownable = { workspace = true } cw-paginate = "2.0.0" cw-storage-plus = { workspace = true } cw-utils = { workspace = true } cw2 = { workspace = true } -schemars = { workspace = true } semver = { workspace = true } -serde = { workspace = true } thiserror = { workspace = true } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] diff --git a/framework/contracts/native/ica-client/Cargo.toml b/framework/contracts/native/ica-client/Cargo.toml index 1e995b4d6b..0a47e8bad6 100644 --- a/framework/contracts/native/ica-client/Cargo.toml +++ b/framework/contracts/native/ica-client/Cargo.toml @@ -26,10 +26,8 @@ abstract-std = { workspace = true } cosmwasm-schema = { workspace = true } cosmwasm-std = { workspace = true, features = ["stargate", "staking"] } cw-ownable = { workspace = true } -cw-storage-plus = { workspace = true } cw2 = { workspace = true } semver = { workspace = true } -serde = { workspace = true } thiserror = { workspace = true } evm-note = { version = "0.1.0", features = ["library"] } diff --git a/framework/contracts/native/module-factory/Cargo.toml b/framework/contracts/native/module-factory/Cargo.toml index 53bbd23bed..9fe1e50f8e 100644 --- a/framework/contracts/native/module-factory/Cargo.toml +++ b/framework/contracts/native/module-factory/Cargo.toml @@ -27,10 +27,7 @@ abstract-sdk = { workspace = true } abstract-std = { workspace = true } cosmwasm-schema = { workspace = true } cosmwasm-std = { workspace = true } -cw-asset = { workspace = true } -cw-controllers = { workspace = true } cw-ownable = { workspace = true } -cw-storage-plus = { workspace = true } cw2 = { workspace = true } semver = { workspace = true } serde-cw-value = { workspace = true } diff --git a/framework/contracts/native/registry/Cargo.toml b/framework/contracts/native/registry/Cargo.toml index f318f28c3d..1509a9fcc9 100644 --- a/framework/contracts/native/registry/Cargo.toml +++ b/framework/contracts/native/registry/Cargo.toml @@ -30,7 +30,6 @@ cw-ownable = { workspace = true } cw-storage-plus = { workspace = true } cw2 = { workspace = true } semver = { workspace = true } -serde = { workspace = true } thiserror = { workspace = true } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] diff --git a/framework/contracts/native/registry/src/migrate.rs b/framework/contracts/native/registry/src/migrate.rs index e4eab4d493..a66c670bd0 100644 --- a/framework/contracts/native/registry/src/migrate.rs +++ b/framework/contracts/native/registry/src/migrate.rs @@ -21,7 +21,7 @@ pub struct NamespaceIndexes<'a> { pub account_id: MultiIndex<'a, AccountId, AccountId, &'a Namespace>, } -impl<'a> IndexList for NamespaceIndexes<'a> { +impl IndexList for NamespaceIndexes<'_> { fn get_indexes(&'_ self) -> Box> + '_> { let v: Vec<&dyn Index> = vec![&self.account_id]; Box::new(v.into_iter()) diff --git a/framework/packages/abstract-adapter/Cargo.toml b/framework/packages/abstract-adapter/Cargo.toml index b0dadcb0e2..a5345f9d27 100644 --- a/framework/packages/abstract-adapter/Cargo.toml +++ b/framework/packages/abstract-adapter/Cargo.toml @@ -24,7 +24,6 @@ abstract-std = { workspace = true } abstract-testing = { workspace = true, optional = true } cosmwasm-schema = { workspace = true } cosmwasm-std = { workspace = true } -cw-controllers = { workspace = true } cw-orch = { workspace = true } cw-storage-plus = { workspace = true } cw2 = { workspace = true } diff --git a/framework/packages/abstract-adapter/src/msgs.rs b/framework/packages/abstract-adapter/src/msgs.rs index 80510f7f75..74aa7bd5eb 100644 --- a/framework/packages/abstract-adapter/src/msgs.rs +++ b/framework/packages/abstract-adapter/src/msgs.rs @@ -19,7 +19,7 @@ /// ::InstantiateMsg; /// pub type ExecuteMsg = ::ExecuteMsg; /// pub type QueryMsg = ::QueryMsg; - +/// /// // Implements the trait-bounds for the abstract adapter messages, which allows them to be used in the Adapter type. /// // Also implements `Into for MyAdapterExecuteMsg` and `Into for MyAdapterQueryMsg`. /// // This enables the use of the `impl_into` macro of cw-orchestrator. diff --git a/framework/packages/abstract-app/Cargo.toml b/framework/packages/abstract-app/Cargo.toml index cb5e152877..42cd34f671 100644 --- a/framework/packages/abstract-app/Cargo.toml +++ b/framework/packages/abstract-app/Cargo.toml @@ -24,13 +24,11 @@ abstract-std = { workspace = true } abstract-testing = { workspace = true, optional = true } cosmwasm-schema = { workspace = true } cosmwasm-std = { workspace = true } -cw-asset = { workspace = true } cw-controllers = { workspace = true } cw-orch = { workspace = true } cw-storage-plus = { workspace = true } cw2 = { workspace = true } schemars = { workspace = true } -semver = { workspace = true } serde = { workspace = true } thiserror = { workspace = true } diff --git a/framework/packages/abstract-app/src/msgs.rs b/framework/packages/abstract-app/src/msgs.rs index 0fb7b1176a..5683c52ed4 100644 --- a/framework/packages/abstract-app/src/msgs.rs +++ b/framework/packages/abstract-app/src/msgs.rs @@ -20,7 +20,7 @@ /// pub type ExecuteMsg = ::ExecuteMsg; /// pub type QueryMsg = ::QueryMsg; /// pub type MigrateMsg = ::MigrateMsg; - +/// /// // Implements the trait-bounds for the abstract app messages, which allows them to be used in the App type. /// // Also implements `Into for MyAppExecuteMsg` and `Into for MyAppQueryMsg`. /// // This enables the use of the `impl_into` macro of cw-orchestrator. diff --git a/framework/packages/abstract-client/Cargo.toml b/framework/packages/abstract-client/Cargo.toml index 761062ca43..dbd3234381 100644 --- a/framework/packages/abstract-client/Cargo.toml +++ b/framework/packages/abstract-client/Cargo.toml @@ -17,28 +17,22 @@ version = "0.25.0" workspace = true [features] -default = ["test-utils"] -interchain = [ - "dep:cw-orch-interchain", - "dep:cw-orch-polytone", - "abstract-interface/interchain", - "abstract-interface/testing", -] -test-utils = ["cw-asset", "cw20", "cw20-base", "cw-plus-interface"] +default = [] +interchain = ["dep:cw-orch-interchain", "abstract-interface/interchain"] +test-utils = ["cw20", "cw20-base", "cw-plus-interface", "abstract-interface/testing"] [dependencies] abstract-interface = { version = "0.25.0", path = "../abstract-interface" } abstract-std.workspace = true cosmwasm-std.workspace = true -cw-orch.workspace = true +cw-asset = { workspace = true } cw-orch-interchain = { workspace = true, optional = true } -cw-orch-polytone = { workspace = true, optional = true } +cw-orch.workspace = true semver.workspace = true serde.workspace = true thiserror.workspace = true # Used for test-utils feature -cw-asset = { workspace = true, optional = true } # For Cw20 builder cw-plus-interface = { package = "cw-plus-orch", version = "0.25.0", optional = true } diff --git a/framework/packages/abstract-client/src/builder.rs b/framework/packages/abstract-client/src/builder.rs index 5f32898cd1..d74ccc2e8e 100644 --- a/framework/packages/abstract-client/src/builder.rs +++ b/framework/packages/abstract-client/src/builder.rs @@ -9,11 +9,7 @@ use abstract_std::objects::{ use cw_asset::AssetInfoUnchecked; use cw_orch::prelude::*; -use self::cw20_builder::Cw20Builder; -use crate::{ - client::{AbstractClient, AbstractClientResult}, - Environment, -}; +use crate::client::{AbstractClient, AbstractClientResult}; impl AbstractClient { /// Abstract client builder @@ -21,14 +17,21 @@ impl AbstractClient { AbstractClientBuilder::new(chain) } + #[cfg(feature = "test-utils")] /// Cw20 contract builder pub fn cw20_builder( &self, name: impl Into, symbol: impl Into, decimals: u8, - ) -> Cw20Builder { - Cw20Builder::new(self.environment(), name.into(), symbol.into(), decimals) + ) -> self::cw20_builder::Cw20Builder { + use crate::Environment; + self::cw20_builder::Cw20Builder::new( + self.environment(), + name.into(), + symbol.into(), + decimals, + ) } } @@ -130,7 +133,6 @@ impl AbstractClientBuilder { /// Deploy abstract with current configuration pub fn build(&self) -> AbstractClientResult> { let abstr = Abstract::deploy_on(self.chain.clone(), ())?; - println!("quid"); self.update_ans(&abstr)?; AbstractClient::new(self.chain.clone()) @@ -148,6 +150,7 @@ impl AbstractClientBuilder { } } +#[cfg(feature = "test-utils")] pub mod cw20_builder { //! # CW20 Builder diff --git a/framework/packages/abstract-client/src/client.rs b/framework/packages/abstract-client/src/client.rs index a7f6f35ee9..0c706bca85 100644 --- a/framework/packages/abstract-client/src/client.rs +++ b/framework/packages/abstract-client/src/client.rs @@ -169,7 +169,7 @@ impl AbstractClient { pub fn sub_account_builder<'a>( &'a self, account: &'a Account, - ) -> AbstractClientResult> { + ) -> AbstractClientResult> { let mut builder = AccountBuilder::new(&self.abstr); builder.sub_account(account); builder.name("Sub Account"); diff --git a/framework/packages/abstract-ica/Cargo.toml b/framework/packages/abstract-ica/Cargo.toml index 8ca6988e3f..c22e123e06 100644 --- a/framework/packages/abstract-ica/Cargo.toml +++ b/framework/packages/abstract-ica/Cargo.toml @@ -16,19 +16,13 @@ version = { workspace = true } cosmwasm-schema = { workspace = true } cosmwasm-std = { workspace = true, features = ["iterator"] } cw-ownable = { workspace = true } -cw-storage-plus = { workspace = true } map-macro = "0.3.0" -schemars = { workspace = true } -serde = { workspace = true } -thiserror = { workspace = true } abstract-sdk = { workspace = true } cw-orch = { workspace = true } # EVM -alloy = { version = "0.2.1", default-features = false } -alloy-sol-types = { version = "0.7.7", default-features = false } -polytone-evm = { version = "0.1.0" } +polytone-evm = { version = "0.1.0" } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] workspace-hack = { version = "0.1", path = "../../workspace-hack" } diff --git a/framework/packages/abstract-integration-tests/Cargo.toml b/framework/packages/abstract-integration-tests/Cargo.toml index 722db193e9..96f13a0d71 100644 --- a/framework/packages/abstract-integration-tests/Cargo.toml +++ b/framework/packages/abstract-integration-tests/Cargo.toml @@ -18,11 +18,8 @@ abstract-std.workspace = true abstract-testing.workspace = true anyhow.workspace = true cosmwasm-schema = { workspace = true } -cw-asset = { workspace = true } cw-orch = { workspace = true } -cw-ownable = { workspace = true } cw2 = { workspace = true } -log = "0.4.14" [target.'cfg(not(target_arch = "wasm32"))'.dependencies] workspace-hack = { version = "0.1", path = "../../workspace-hack" } diff --git a/framework/packages/abstract-interface/src/deployment.rs b/framework/packages/abstract-interface/src/deployment.rs index 074e007946..641b586e2d 100644 --- a/framework/packages/abstract-interface/src/deployment.rs +++ b/framework/packages/abstract-interface/src/deployment.rs @@ -153,7 +153,7 @@ impl Deploy for Abstract { fn load_from(chain: Chain) -> Result { #[allow(unused_mut)] - let mut abstr = Self::new(chain); + let mut abstr = Self::new(chain.clone()); #[cfg(feature = "daemon")] { // We register all the contracts default state @@ -163,9 +163,19 @@ impl Deploy for Abstract { } // Check if abstract deployed, for successful load if let Err(CwOrchError::AddrNotInStore(_)) = abstr.registry.address() { - return Err(AbstractInterfaceError::NotDeployed {}); + return Err(AbstractInterfaceError::NotDeployed( + chain + .block_info() + .map(|b| b.chain_id) + .unwrap_or("chain id not available".to_string()), + )); } else if abstr.registry.item_query(cw2::CONTRACT).is_err() { - return Err(AbstractInterfaceError::NotDeployed {}); + return Err(AbstractInterfaceError::NotDeployed( + chain + .block_info() + .map(|b| b.chain_id) + .unwrap_or("chain id not available".to_string()), + )); } Ok(abstr) } diff --git a/framework/packages/abstract-interface/src/error.rs b/framework/packages/abstract-interface/src/error.rs index 346835e0eb..cc9b6e03ba 100644 --- a/framework/packages/abstract-interface/src/error.rs +++ b/framework/packages/abstract-interface/src/error.rs @@ -21,8 +21,8 @@ pub enum AbstractInterfaceError { #[error(transparent)] Instantiate2(#[from] cosmwasm_std::Instantiate2AddressError), - #[error("Abstract is not deployed on this chain")] - NotDeployed {}, + #[error("Abstract is not deployed on this chain {0}")] + NotDeployed(String), #[error(transparent)] Semver(#[from] semver::Error), diff --git a/framework/packages/abstract-macros/Cargo.toml b/framework/packages/abstract-macros/Cargo.toml index d6a30b194e..87d24f2e25 100644 --- a/framework/packages/abstract-macros/Cargo.toml +++ b/framework/packages/abstract-macros/Cargo.toml @@ -19,5 +19,4 @@ quote = { version = "1" } syn = { version = "1", features = ["full", "extra-traits"] } [dev-dependencies] -cosmwasm-std = { workspace = true } -coverage-helper = { workspace = true } +cosmwasm-std = { workspace = true } diff --git a/framework/packages/abstract-sdk/Cargo.toml b/framework/packages/abstract-sdk/Cargo.toml index 53dfbe4705..fb212188b9 100644 --- a/framework/packages/abstract-sdk/Cargo.toml +++ b/framework/packages/abstract-sdk/Cargo.toml @@ -15,7 +15,7 @@ workspace = true # for quicker tests, cargo test --lib [features] default = [] -stargate = ["dep:cosmos-sdk-proto", "dep:prost-types", "dep:ibc-proto"] +stargate = ["dep:cosmos-sdk-proto", "dep:ibc-proto"] # Expose MockModule for testing with other Adapters test-utils = ["dep:abstract-testing", "dep:cosmwasm-schema"] @@ -27,14 +27,11 @@ cosmos-sdk-proto = { version = "0.24", optional = true, default-features = false cosmwasm-std = { workspace = true, features = ["iterator", "staking"] } cw-asset = { workspace = true } cw-clearable = { workspace = true } -cw-controllers = { workspace = true } cw-storage-plus = { workspace = true } cw2 = { workspace = true } cw20 = { workspace = true } ibc-proto = { version = "0.47.0", optional = true, default-features = false } -prost-types = { version = "0.13.1", optional = true } schemars = { workspace = true } -semver = { workspace = true } serde = { workspace = true } serde-cw-value = { workspace = true } thiserror = { workspace = true } @@ -49,7 +46,6 @@ workspace-hack = { version = "0.1", path = "../../workspace-hack" } [dev-dependencies] cosmwasm-schema = { workspace = true } -doc-comment = "0.3.3" # Set our own feature when running tests! abstract-sdk = { path = ".", features = ["test-utils"] } cw-ownable = { workspace = true } diff --git a/framework/packages/abstract-sdk/README.md b/framework/packages/abstract-sdk/README.md index 5a4f943beb..bb1af15210 100644 --- a/framework/packages/abstract-sdk/README.md +++ b/framework/packages/abstract-sdk/README.md @@ -38,7 +38,7 @@ use cosmwasm_std::{Addr, CosmosMsg, Deps, StdResult, Uint128, Env}; // Trait to retrieve the Splitter object // Depends on the ability to transfer funds pub trait SplitterInterface: TransferInterface { - fn splitter<'a>(&'a self, deps: Deps<'a>) -> Splitter { + fn splitter<'a>(&'a self, deps: Deps<'a>) -> Splitter<'a, Self> { Splitter { base: self, deps } } } diff --git a/framework/packages/abstract-sdk/src/apis/adapter.rs b/framework/packages/abstract-sdk/src/apis/adapter.rs index 4528503cdf..e48af87a75 100644 --- a/framework/packages/abstract-sdk/src/apis/adapter.rs +++ b/framework/packages/abstract-sdk/src/apis/adapter.rs @@ -27,14 +27,14 @@ pub trait AdapterInterface: ModuleInterface + ModuleIdentification { let adapters: Adapters = module.adapters(deps.as_ref()); ``` */ - fn adapters<'a>(&'a self, deps: Deps<'a>) -> Adapters { + fn adapters<'a>(&'a self, deps: Deps<'a>) -> Adapters<'a, Self> { Adapters { base: self, deps } } } impl AdapterInterface for T where T: ModuleInterface + ModuleIdentification {} -impl<'a, T: AdapterInterface> AbstractApi for Adapters<'a, T> { +impl AbstractApi for Adapters<'_, T> { const API_ID: &'static str = "Adapters"; fn base(&self) -> &T { @@ -67,7 +67,7 @@ pub struct Adapters<'a, T: AdapterInterface> { deps: Deps<'a>, } -impl<'a, T: AdapterInterface> Adapters<'a, T> { +impl Adapters<'_, T> { /// Interactions with Abstract Adapters /// Construct an adapter execute message. pub fn execute>>( diff --git a/framework/packages/abstract-sdk/src/apis/app.rs b/framework/packages/abstract-sdk/src/apis/app.rs index a9f5b9e287..dfe903d936 100644 --- a/framework/packages/abstract-sdk/src/apis/app.rs +++ b/framework/packages/abstract-sdk/src/apis/app.rs @@ -27,14 +27,14 @@ pub trait AppInterface: ModuleInterface + ModuleIdentification { let apps: Apps = module.apps(deps.as_ref()); ``` */ - fn apps<'a>(&'a self, deps: Deps<'a>) -> Apps { + fn apps<'a>(&'a self, deps: Deps<'a>) -> Apps<'a, Self> { Apps { base: self, deps } } } impl AppInterface for T where T: ModuleInterface + ModuleIdentification {} -impl<'a, T: AppInterface> AbstractApi for Apps<'a, T> { +impl AbstractApi for Apps<'_, T> { const API_ID: &'static str = "Apps"; fn base(&self) -> &T { @@ -67,7 +67,7 @@ pub struct Apps<'a, T: AppInterface> { deps: Deps<'a>, } -impl<'a, T: AppInterface> Apps<'a, T> { +impl Apps<'_, T> { /// Construct an app request message. pub fn execute( &self, diff --git a/framework/packages/abstract-sdk/src/apis/authz.rs b/framework/packages/abstract-sdk/src/apis/authz.rs index 7e67ce78ed..2d1784c722 100644 --- a/framework/packages/abstract-sdk/src/apis/authz.rs +++ b/framework/packages/abstract-sdk/src/apis/authz.rs @@ -35,7 +35,7 @@ pub trait AuthZInterface: AccountExecutor { /// API for accessing the Cosmos SDK AuthZ module. /// The **granter** is the address of the user **granting** an authorization to perform an action on their behalf. /// By default, it is the address of the Account. - + /// /// ``` /// use abstract_sdk::prelude::*; /// # use cosmwasm_std::testing::mock_dependencies; diff --git a/framework/packages/abstract-sdk/src/apis/bank.rs b/framework/packages/abstract-sdk/src/apis/bank.rs index cd65093a2f..ecb4dc568c 100644 --- a/framework/packages/abstract-sdk/src/apis/bank.rs +++ b/framework/packages/abstract-sdk/src/apis/bank.rs @@ -35,7 +35,7 @@ pub trait TransferInterface: let bank: Bank = module.bank(deps.as_ref(), ); ``` */ - fn bank<'a>(&'a self, deps: Deps<'a>) -> Bank { + fn bank<'a>(&'a self, deps: Deps<'a>) -> Bank<'a, Self> { Bank { base: self, deps } } } @@ -45,7 +45,7 @@ impl TransferInterface for T where { } -impl<'a, T: TransferInterface> AbstractApi for Bank<'a, T> { +impl AbstractApi for Bank<'_, T> { const API_ID: &'static str = "Bank"; fn base(&self) -> &T { @@ -79,7 +79,7 @@ pub struct Bank<'a, T: TransferInterface> { deps: Deps<'a>, } -impl<'a, T: TransferInterface> Bank<'a, T> { +impl Bank<'_, T> { /// Get the balances of the provided assets. pub fn balances(&self, assets: &[AssetEntry]) -> AbstractSdkResult> { assets @@ -114,7 +114,7 @@ impl<'a, T: TransferInterface> Bank<'a, T> { } } -impl<'a, T: TransferInterface + AccountExecutor> Bank<'a, T> { +impl Bank<'_, T> { /// Transfer the provided funds from the Account to the recipient. /// ``` /// # use cosmwasm_std::{Addr, Response, Deps, DepsMut, MessageInfo, Env}; diff --git a/framework/packages/abstract-sdk/src/apis/execution.rs b/framework/packages/abstract-sdk/src/apis/execution.rs index 9cf8da2c46..5cdf46269d 100644 --- a/framework/packages/abstract-sdk/src/apis/execution.rs +++ b/framework/packages/abstract-sdk/src/apis/execution.rs @@ -33,14 +33,14 @@ pub trait Execution: AccountExecutor + ModuleIdentification { let executor: Executor = module.executor(deps.as_ref()); ``` */ - fn executor<'a>(&'a self, deps: Deps<'a>) -> Executor { + fn executor<'a>(&'a self, deps: Deps<'a>) -> Executor<'a, Self> { Executor { base: self, deps } } } impl Execution for T where T: AccountExecutor + ModuleIdentification {} -impl<'a, T: Execution> AbstractApi for Executor<'a, T> { +impl AbstractApi for Executor<'_, T> { const API_ID: &'static str = "Executor"; fn base(&self) -> &T { @@ -76,7 +76,7 @@ pub struct Executor<'a, T: Execution> { deps: Deps<'a>, } -impl<'a, T: Execution> Executor<'a, T> { +impl Executor<'_, T> { /// Execute a single message on the `ModuleActionWithData` endpoint. fn execute_with_data(&self, msg: CosmosMsg) -> AbstractSdkResult { let msg = self.base.execute_on_account( diff --git a/framework/packages/abstract-sdk/src/apis/feegrant.rs b/framework/packages/abstract-sdk/src/apis/feegrant.rs index d9d89a236e..3f5c1abd8a 100644 --- a/framework/packages/abstract-sdk/src/apis/feegrant.rs +++ b/framework/packages/abstract-sdk/src/apis/feegrant.rs @@ -22,7 +22,7 @@ pub trait GrantInterface: AccountExecutor { /// API for accessing the Cosmos SDK FeeGrant module. /// The **granter** is the address of the user granting an allowance of their funds. /// By default, it is the account address. - + /// /// ``` /// use abstract_sdk::prelude::*; /// # use cosmwasm_std::testing::mock_dependencies; diff --git a/framework/packages/abstract-sdk/src/apis/ibc.rs b/framework/packages/abstract-sdk/src/apis/ibc.rs index 863e8fcacb..966b54edf1 100644 --- a/framework/packages/abstract-sdk/src/apis/ibc.rs +++ b/framework/packages/abstract-sdk/src/apis/ibc.rs @@ -43,7 +43,7 @@ pub trait IbcInterface: let ibc_client: IbcClient = module.ibc_client(deps.as_ref()); ``` */ - fn ibc_client<'a>(&'a self, deps: Deps<'a>) -> IbcClient { + fn ibc_client<'a>(&'a self, deps: Deps<'a>) -> IbcClient<'a, Self> { IbcClient { base: self, deps } } } @@ -53,7 +53,7 @@ impl IbcInterface for T where { } -impl<'a, T: IbcInterface> AbstractApi for IbcClient<'a, T> { +impl AbstractApi for IbcClient<'_, T> { const API_ID: &'static str = "IbcClient"; fn base(&self) -> &T { @@ -86,7 +86,7 @@ pub struct IbcClient<'a, T: IbcInterface> { deps: Deps<'a>, } -impl<'a, T: IbcInterface> IbcClient<'a, T> { +impl IbcClient<'_, T> { /// Get address of this module pub fn module_address(&self) -> AbstractSdkResult { let modules = self.base.modules(self.deps); @@ -206,7 +206,7 @@ impl<'a, T: IbcInterface> IbcClient<'a, T> { } } -impl<'a, T: IbcInterface + AccountExecutor> IbcClient<'a, T> { +impl IbcClient<'_, T> { /// Execute on ibc client pub fn execute( &self, diff --git a/framework/packages/abstract-sdk/src/apis/modules.rs b/framework/packages/abstract-sdk/src/apis/modules.rs index cf4c58c91b..110bbf7688 100644 --- a/framework/packages/abstract-sdk/src/apis/modules.rs +++ b/framework/packages/abstract-sdk/src/apis/modules.rs @@ -29,14 +29,14 @@ pub trait ModuleInterface: AccountIdentification + Dependencies + ModuleIdentifi let modules: Modules = module.modules(deps.as_ref()); ``` */ - fn modules<'a>(&'a self, deps: Deps<'a>) -> Modules { + fn modules<'a>(&'a self, deps: Deps<'a>) -> Modules<'a, Self> { Modules { base: self, deps } } } impl ModuleInterface for T where T: AccountIdentification + Dependencies + ModuleIdentification {} -impl<'a, T: ModuleInterface> AbstractApi for Modules<'a, T> { +impl AbstractApi for Modules<'_, T> { const API_ID: &'static str = "Modules"; fn base(&self) -> &T { @@ -69,7 +69,7 @@ pub struct Modules<'a, T: ModuleInterface> { deps: Deps<'a>, } -impl<'a, T: ModuleInterface> Modules<'a, T> { +impl Modules<'_, T> { /// Retrieve the address of an application in this Account. /// This should **not** be used to execute messages on an `Api`. /// Use `Modules::api_request(..)` instead. diff --git a/framework/packages/abstract-sdk/src/apis/splitter.rs b/framework/packages/abstract-sdk/src/apis/splitter.rs index bd8dcb5fc3..554f0c3c7a 100644 --- a/framework/packages/abstract-sdk/src/apis/splitter.rs +++ b/framework/packages/abstract-sdk/src/apis/splitter.rs @@ -11,7 +11,7 @@ use crate::{ // Trait to retrieve the Splitter object // Depends on the ability to transfer funds pub trait SplitterInterface: TransferInterface + AccountExecutor + ModuleIdentification { - fn splitter<'a>(&'a self, deps: Deps<'a>) -> Splitter { + fn splitter<'a>(&'a self, deps: Deps<'a>) -> Splitter<'a, Self> { Splitter { base: self, deps } } } @@ -19,7 +19,7 @@ pub trait SplitterInterface: TransferInterface + AccountExecutor + ModuleIdentif // Implement for every object that can transfer funds impl SplitterInterface for T where T: TransferInterface + AccountExecutor + ModuleIdentification {} -impl<'a, T: SplitterInterface> AbstractApi for Splitter<'a, T> { +impl AbstractApi for Splitter<'_, T> { const API_ID: &'static str = "Splitter"; fn base(&self) -> &T { @@ -36,7 +36,7 @@ pub struct Splitter<'a, T: SplitterInterface> { deps: Deps<'a>, } -impl<'a, T: SplitterInterface> Splitter<'a, T> { +impl Splitter<'_, T> { /// Split an asset to multiple users pub fn split(&self, asset: AnsAsset, receivers: &[Addr]) -> AbstractSdkResult { // split the asset between all receivers diff --git a/framework/packages/abstract-sdk/src/apis/verify.rs b/framework/packages/abstract-sdk/src/apis/verify.rs index 9b7570a6ff..0f881548a6 100644 --- a/framework/packages/abstract-sdk/src/apis/verify.rs +++ b/framework/packages/abstract-sdk/src/apis/verify.rs @@ -33,7 +33,10 @@ pub trait AccountVerification: AbstractRegistryAccess + ModuleIdentification { let acc_registry: AccountRegistry = module.account_registry(deps.as_ref()).unwrap(); ``` */ - fn account_registry<'a>(&'a self, deps: Deps<'a>) -> AbstractSdkResult> { + fn account_registry<'a>( + &'a self, + deps: Deps<'a>, + ) -> AbstractSdkResult> { let vc = self.abstract_registry(deps)?; Ok(AccountRegistry { base: self, @@ -45,7 +48,7 @@ pub trait AccountVerification: AbstractRegistryAccess + ModuleIdentification { impl AccountVerification for T where T: AbstractRegistryAccess + ModuleIdentification {} -impl<'a, T: AccountVerification> AbstractApi for AccountRegistry<'a, T> { +impl AbstractApi for AccountRegistry<'_, T> { const API_ID: &'static str = "AccountRegistry"; fn base(&self) -> &T { @@ -80,7 +83,7 @@ pub struct AccountRegistry<'a, T: AccountVerification> { registry: RegistryContract, } -impl<'a, T: AccountVerification> AccountRegistry<'a, T> { +impl AccountRegistry<'_, T> { /// Verify if the provided address is indeed an Abstract Account. pub fn assert_is_account(&self, maybe_account: &Addr) -> AbstractSdkResult { self.registry diff --git a/framework/packages/abstract-sdk/src/apis/version_registry.rs b/framework/packages/abstract-sdk/src/apis/version_registry.rs index 94ba17ae39..b552f38609 100644 --- a/framework/packages/abstract-sdk/src/apis/version_registry.rs +++ b/framework/packages/abstract-sdk/src/apis/version_registry.rs @@ -36,7 +36,10 @@ pub trait ModuleRegistryInterface: AbstractRegistryAccess + ModuleIdentification let mod_registry: ModuleRegistry = module.module_registry(deps.as_ref()).unwrap(); ``` */ - fn module_registry<'a>(&'a self, deps: Deps<'a>) -> AbstractSdkResult> { + fn module_registry<'a>( + &'a self, + deps: Deps<'a>, + ) -> AbstractSdkResult> { let vc = self.abstract_registry(deps)?; Ok(ModuleRegistry { base: self, @@ -48,7 +51,7 @@ pub trait ModuleRegistryInterface: AbstractRegistryAccess + ModuleIdentification impl ModuleRegistryInterface for T where T: AbstractRegistryAccess + ModuleIdentification {} -impl<'a, T: ModuleRegistryInterface> AbstractApi for ModuleRegistry<'a, T> { +impl AbstractApi for ModuleRegistry<'_, T> { const API_ID: &'static str = "ModuleRegistry"; fn base(&self) -> &T { @@ -82,7 +85,7 @@ pub struct ModuleRegistry<'a, T: ModuleRegistryInterface> { registry: RegistryContract, } -impl<'a, T: ModuleRegistryInterface> ModuleRegistry<'a, T> { +impl ModuleRegistry<'_, T> { /// Raw query for a module reference pub fn query_module_reference_raw( &self, diff --git a/framework/packages/abstract-sdk/src/base/features/abstract_name_service.rs b/framework/packages/abstract-sdk/src/base/features/abstract_name_service.rs index 9ba215bd8d..b113140f1a 100644 --- a/framework/packages/abstract-sdk/src/base/features/abstract_name_service.rs +++ b/framework/packages/abstract-sdk/src/base/features/abstract_name_service.rs @@ -18,7 +18,7 @@ pub trait AbstractNameService: Sized { fn ans_host(&self, deps: Deps) -> AbstractSdkResult; /// Construct the name service client. - fn name_service<'a>(&'a self, deps: Deps<'a>) -> AbstractNameServiceClient { + fn name_service<'a>(&'a self, deps: Deps<'a>) -> AbstractNameServiceClient<'a, Self> { AbstractNameServiceClient { base: self, deps, @@ -36,8 +36,8 @@ pub struct AbstractNameServiceClient<'a, T: AbstractNameService> { pub host: AnsHost, } -impl<'a, T: ModuleIdentification + AbstractNameService> AbstractApi - for AbstractNameServiceClient<'a, T> +impl AbstractApi + for AbstractNameServiceClient<'_, T> { const API_ID: &'static str = "AbstractNameServiceClient"; @@ -49,7 +49,7 @@ impl<'a, T: ModuleIdentification + AbstractNameService> AbstractApi } } -impl<'a, T: ModuleIdentification + AbstractNameService> AbstractNameServiceClient<'a, T> { +impl AbstractNameServiceClient<'_, T> { /// Query ans entry pub fn query(&self, entry: &R) -> AbstractSdkResult { entry diff --git a/framework/packages/abstract-standalone/Cargo.toml b/framework/packages/abstract-standalone/Cargo.toml index 8b1b46cdfe..01458de3b2 100644 --- a/framework/packages/abstract-standalone/Cargo.toml +++ b/framework/packages/abstract-standalone/Cargo.toml @@ -21,13 +21,10 @@ abstract-sdk = { workspace = true } abstract-std = { workspace = true } cosmwasm-schema = { workspace = true } cosmwasm-std = { workspace = true } -cw-asset = { workspace = true } cw-controllers = { workspace = true } cw-storage-plus = { workspace = true } cw2 = { workspace = true } -schemars = { workspace = true } semver = { workspace = true } -serde = { workspace = true } thiserror = { workspace = true } # Interface diff --git a/framework/packages/abstract-std/Cargo.toml b/framework/packages/abstract-std/Cargo.toml index f073c7fc1d..64890b541b 100644 --- a/framework/packages/abstract-std/Cargo.toml +++ b/framework/packages/abstract-std/Cargo.toml @@ -28,7 +28,6 @@ cw-ownable = { workspace = true } cw-storage-plus = { workspace = true } cw-utils = { workspace = true } cw2 = { workspace = true } -cw20 = { workspace = true } schemars = { workspace = true } semver = { workspace = true, features = ["serde"] } serde = { workspace = true } diff --git a/framework/packages/abstract-std/src/native/ibc.rs b/framework/packages/abstract-std/src/native/ibc.rs index 66eeb47ad1..269fb94867 100644 --- a/framework/packages/abstract-std/src/native/ibc.rs +++ b/framework/packages/abstract-std/src/native/ibc.rs @@ -228,7 +228,7 @@ pub struct ICS20PacketIdentifier { pub sequence: u64, } -impl<'a> PrimaryKey<'a> for ICS20PacketIdentifier { +impl PrimaryKey<'_> for ICS20PacketIdentifier { /// channel id type Prefix = String; diff --git a/framework/packages/abstract-std/src/objects/account/account_id.rs b/framework/packages/abstract-std/src/objects/account/account_id.rs index be7f2d382e..a0a196f500 100644 --- a/framework/packages/abstract-std/src/objects/account/account_id.rs +++ b/framework/packages/abstract-std/src/objects/account/account_id.rs @@ -136,7 +136,7 @@ impl FromStr for AccountId { } } -impl<'a> PrimaryKey<'a> for AccountId { +impl PrimaryKey<'_> for AccountId { type Prefix = AccountTrace; type SubPrefix = (); @@ -152,7 +152,7 @@ impl<'a> PrimaryKey<'a> for AccountId { } } -impl<'a> Prefixer<'a> for AccountId { +impl Prefixer<'_> for AccountId { fn prefix(&self) -> Vec { self.key() } diff --git a/framework/packages/abstract-std/src/objects/account/account_trace.rs b/framework/packages/abstract-std/src/objects/account/account_trace.rs index 9603d6238e..3885799e96 100644 --- a/framework/packages/abstract-std/src/objects/account/account_trace.rs +++ b/framework/packages/abstract-std/src/objects/account/account_trace.rs @@ -26,7 +26,7 @@ impl KeyDeserialize for &AccountTrace { } } -impl<'a> PrimaryKey<'a> for AccountTrace { +impl PrimaryKey<'_> for AccountTrace { type Prefix = (); type SubPrefix = (); type Suffix = Self; @@ -64,7 +64,7 @@ impl KeyDeserialize for AccountTrace { } } -impl<'a> Prefixer<'a> for AccountTrace { +impl Prefixer<'_> for AccountTrace { fn prefix(&self) -> Vec { self.key() } diff --git a/framework/packages/abstract-std/src/objects/entry/asset_entry.rs b/framework/packages/abstract-std/src/objects/entry/asset_entry.rs index 513daee0d9..d8d55c063b 100644 --- a/framework/packages/abstract-std/src/objects/entry/asset_entry.rs +++ b/framework/packages/abstract-std/src/objects/entry/asset_entry.rs @@ -79,7 +79,7 @@ impl Display for AssetEntry { } } -impl<'a> PrimaryKey<'a> for AssetEntry { +impl PrimaryKey<'_> for AssetEntry { type Prefix = (); type SubPrefix = (); @@ -93,7 +93,7 @@ impl<'a> PrimaryKey<'a> for AssetEntry { } } -impl<'a> Prefixer<'a> for AssetEntry { +impl Prefixer<'_> for AssetEntry { fn prefix(&self) -> Vec { self.0.prefix() } diff --git a/framework/packages/abstract-std/src/objects/entry/channel_entry.rs b/framework/packages/abstract-std/src/objects/entry/channel_entry.rs index a75272b517..64637bb48d 100644 --- a/framework/packages/abstract-std/src/objects/entry/channel_entry.rs +++ b/framework/packages/abstract-std/src/objects/entry/channel_entry.rs @@ -57,7 +57,7 @@ impl Display for ChannelEntry { } } -impl<'a> PrimaryKey<'a> for &ChannelEntry { +impl PrimaryKey<'_> for &ChannelEntry { type Prefix = String; type SubPrefix = (); @@ -73,7 +73,7 @@ impl<'a> PrimaryKey<'a> for &ChannelEntry { } } -impl<'a> Prefixer<'a> for &ChannelEntry { +impl Prefixer<'_> for &ChannelEntry { fn prefix(&self) -> Vec { let mut res = self.connected_chain.str_ref().prefix(); res.extend(self.protocol.prefix()); diff --git a/framework/packages/abstract-std/src/objects/entry/contract_entry.rs b/framework/packages/abstract-std/src/objects/entry/contract_entry.rs index efd1723f6a..748acdf1dc 100644 --- a/framework/packages/abstract-std/src/objects/entry/contract_entry.rs +++ b/framework/packages/abstract-std/src/objects/entry/contract_entry.rs @@ -81,7 +81,7 @@ impl Display for ContractEntry { } } -impl<'a> PrimaryKey<'a> for &ContractEntry { +impl PrimaryKey<'_> for &ContractEntry { type Prefix = String; type SubPrefix = (); @@ -97,7 +97,7 @@ impl<'a> PrimaryKey<'a> for &ContractEntry { } } -impl<'a> Prefixer<'a> for &ContractEntry { +impl Prefixer<'_> for &ContractEntry { fn prefix(&self) -> Vec { let mut res = self.protocol.prefix(); res.extend(self.contract.prefix()); diff --git a/framework/packages/abstract-std/src/objects/entry/dex_asset_pairing.rs b/framework/packages/abstract-std/src/objects/entry/dex_asset_pairing.rs index 4f370bb1aa..1b50827c68 100644 --- a/framework/packages/abstract-std/src/objects/entry/dex_asset_pairing.rs +++ b/framework/packages/abstract-std/src/objects/entry/dex_asset_pairing.rs @@ -58,7 +58,7 @@ impl<'a> PrimaryKey<'a> for &DexAssetPairing { } } -impl<'a> Prefixer<'a> for &DexAssetPairing { +impl Prefixer<'_> for &DexAssetPairing { fn prefix(&self) -> Vec { <(AssetEntry, AssetEntry, DexName)>::prefix(&self.0) } diff --git a/framework/packages/abstract-std/src/objects/module.rs b/framework/packages/abstract-std/src/objects/module.rs index c5f22b8131..0edeb3b4ae 100644 --- a/framework/packages/abstract-std/src/objects/module.rs +++ b/framework/packages/abstract-std/src/objects/module.rs @@ -143,7 +143,7 @@ impl ModuleInfo { } } -impl<'a> PrimaryKey<'a> for &ModuleInfo { +impl PrimaryKey<'_> for &ModuleInfo { /// (namespace, name) type Prefix = (Namespace, String); @@ -164,7 +164,7 @@ impl<'a> PrimaryKey<'a> for &ModuleInfo { } } -impl<'a> Prefixer<'a> for &ModuleInfo { +impl Prefixer<'_> for &ModuleInfo { fn prefix(&self) -> Vec { let mut res = self.namespace.prefix(); res.extend(self.name.prefix()); @@ -300,7 +300,7 @@ impl TryInto for ModuleVersion { } } -impl<'a> PrimaryKey<'a> for ModuleVersion { +impl PrimaryKey<'_> for ModuleVersion { type Prefix = (); type SubPrefix = (); @@ -317,7 +317,7 @@ impl<'a> PrimaryKey<'a> for ModuleVersion { } } -impl<'a> Prefixer<'a> for ModuleVersion { +impl Prefixer<'_> for ModuleVersion { fn prefix(&self) -> Vec { let self_as_bytes = match &self { ModuleVersion::Latest => "latest".as_bytes(), diff --git a/framework/packages/abstract-std/src/objects/namespace.rs b/framework/packages/abstract-std/src/objects/namespace.rs index 0c9298d17e..57c4f01e2a 100644 --- a/framework/packages/abstract-std/src/objects/namespace.rs +++ b/framework/packages/abstract-std/src/objects/namespace.rs @@ -86,7 +86,7 @@ impl KeyDeserialize for &Namespace { } } -impl<'a> PrimaryKey<'a> for Namespace { +impl PrimaryKey<'_> for Namespace { type Prefix = (); type SubPrefix = (); @@ -100,7 +100,7 @@ impl<'a> PrimaryKey<'a> for Namespace { } } -impl<'a> Prefixer<'a> for Namespace { +impl Prefixer<'_> for Namespace { fn prefix(&self) -> Vec { self.0.prefix() } diff --git a/framework/packages/abstract-std/src/objects/pool/unique_pool_id.rs b/framework/packages/abstract-std/src/objects/pool/unique_pool_id.rs index b33d98dd39..e70443723f 100644 --- a/framework/packages/abstract-std/src/objects/pool/unique_pool_id.rs +++ b/framework/packages/abstract-std/src/objects/pool/unique_pool_id.rs @@ -36,7 +36,7 @@ impl Display for UniquePoolId { } } -impl<'a> PrimaryKey<'a> for UniquePoolId { +impl PrimaryKey<'_> for UniquePoolId { type Prefix = (); type SubPrefix = (); type Suffix = Self; @@ -47,7 +47,7 @@ impl<'a> PrimaryKey<'a> for UniquePoolId { } } -impl<'a> Prefixer<'a> for UniquePoolId { +impl Prefixer<'_> for UniquePoolId { fn prefix(&self) -> Vec { self.0.prefix() } diff --git a/framework/packages/abstract-std/src/objects/truncated_chain_id.rs b/framework/packages/abstract-std/src/objects/truncated_chain_id.rs index 08c845fd1b..86de92075e 100644 --- a/framework/packages/abstract-std/src/objects/truncated_chain_id.rs +++ b/framework/packages/abstract-std/src/objects/truncated_chain_id.rs @@ -100,7 +100,7 @@ impl FromStr for TruncatedChainId { } } -impl<'a> PrimaryKey<'a> for &TruncatedChainId { +impl PrimaryKey<'_> for &TruncatedChainId { type Prefix = (); type SubPrefix = (); @@ -114,7 +114,7 @@ impl<'a> PrimaryKey<'a> for &TruncatedChainId { } } -impl<'a> Prefixer<'a> for &TruncatedChainId { +impl Prefixer<'_> for &TruncatedChainId { fn prefix(&self) -> Vec { self.0.prefix() } diff --git a/framework/packages/abstract-std/src/objects/voting.rs b/framework/packages/abstract-std/src/objects/voting.rs index ed64a48685..bbe79ee9f6 100644 --- a/framework/packages/abstract-std/src/objects/voting.rs +++ b/framework/packages/abstract-std/src/objects/voting.rs @@ -91,7 +91,7 @@ pub struct SimpleVoting<'a> { vote_config: Item, } -impl<'a> SimpleVoting<'a> { +impl SimpleVoting<'_> { pub const fn new( proposals_key: &'static str, id_key: &'static str, diff --git a/framework/packages/abstract-testing/Cargo.toml b/framework/packages/abstract-testing/Cargo.toml index 475d758d6b..cfdc572135 100644 --- a/framework/packages/abstract-testing/Cargo.toml +++ b/framework/packages/abstract-testing/Cargo.toml @@ -11,14 +11,11 @@ version = { workspace = true } [dependencies] abstract-std = { workspace = true } -cosmwasm-schema = { workspace = true } cosmwasm-std = { workspace = true, features = ["iterator"] } cw-asset = { workspace = true } cw-storage-plus = { workspace = true } cw2 = { workspace = true } derive_builder = "0.12.0" -schemars = { workspace = true } -semver = { workspace = true } serde = { workspace = true } serde_json = "1.0.79" diff --git a/framework/packages/standards/dex/Cargo.toml b/framework/packages/standards/dex/Cargo.toml index 0b99233913..8483b59c65 100644 --- a/framework/packages/standards/dex/Cargo.toml +++ b/framework/packages/standards/dex/Cargo.toml @@ -25,10 +25,6 @@ cosmwasm-schema = { workspace = true } cosmwasm-std = { workspace = true } cw-address-like = { workspace = true } cw-asset = { workspace = true } -cw-storage-plus = { workspace = true } -cw20 = { workspace = true } -schemars = { workspace = true } -serde = { workspace = true } thiserror = { workspace = true } abstract-adapter = { version = "0.25.0", path = "../../abstract-adapter" } diff --git a/framework/packages/standards/dex/src/error.rs b/framework/packages/standards/dex/src/error.rs index 7eb52d4b84..d54dc1c0fa 100644 --- a/framework/packages/standards/dex/src/error.rs +++ b/framework/packages/standards/dex/src/error.rs @@ -28,7 +28,10 @@ pub enum DexError { #[error(transparent)] AnsHostError(#[from] AnsHostError), - #[error("DEX {0} is not a known dex on this network.")] + #[error("DEX {dex} is not a known dex on this network ({:?}).", chain)] + UnknownDexOnThisPlatform { dex: String, chain: Option }, + + #[error("DEX {0} is not a known dex by Abstract")] UnknownDex(String), #[error("DEX {0} is not local to this network.")] diff --git a/framework/packages/standards/money-market/Cargo.toml b/framework/packages/standards/money-market/Cargo.toml index 8ddaa09a0a..d963944560 100644 --- a/framework/packages/standards/money-market/Cargo.toml +++ b/framework/packages/standards/money-market/Cargo.toml @@ -23,10 +23,6 @@ testing = ["cw-orch/daemon"] cosmwasm-schema = { workspace = true } cosmwasm-std = { workspace = true } cw-asset = { workspace = true } -cw-storage-plus = { workspace = true } -cw20 = { workspace = true } -schemars = { workspace = true } -serde = { workspace = true } thiserror = { workspace = true } abstract-adapter = { version = "0.25.0", path = "../../abstract-adapter" } diff --git a/framework/packages/standards/staking/Cargo.toml b/framework/packages/standards/staking/Cargo.toml index ac843eab95..b65ba757fe 100644 --- a/framework/packages/standards/staking/Cargo.toml +++ b/framework/packages/standards/staking/Cargo.toml @@ -21,11 +21,7 @@ export = [] cosmwasm-schema = { workspace = true } cosmwasm-std = { workspace = true } cw-asset = { workspace = true } -cw-storage-plus = { workspace = true } cw-utils = { workspace = true } -cw20 = { workspace = true } -schemars = { workspace = true } -serde = { workspace = true } thiserror = { workspace = true } abstract-adapter = { version = "0.25.0", path = "../../abstract-adapter" } diff --git a/framework/packages/standards/staking/src/error.rs b/framework/packages/standards/staking/src/error.rs index d77cec4128..2f98871c72 100644 --- a/framework/packages/standards/staking/src/error.rs +++ b/framework/packages/standards/staking/src/error.rs @@ -30,10 +30,19 @@ pub enum CwStakingError { IbcQueryNotSupported, #[error("Staking provider {0} is not a known provider on this network.")] - UnknownDex(String), + UnknownStaking(String), + + #[error( + "Staking provider {staking} is not a known provider on this network ({:?}).", + chain + )] + UnknownStakingOnThisPlatform { + staking: String, + chain: Option, + }, #[error("Staking provider {0} is not local to this network.")] - ForeignDex(String), + ForeignStaking(String), #[error("Cw1155 is unsupported.")] Cw1155Unsupported, diff --git a/framework/workspace-hack/Cargo.toml b/framework/workspace-hack/Cargo.toml index 0e57189e7a..06a668266a 100644 --- a/framework/workspace-hack/Cargo.toml +++ b/framework/workspace-hack/Cargo.toml @@ -36,7 +36,6 @@ num-traits = { version = "0.2", default-features = false, features = ["i128", "l phf_shared = { version = "0.11", default-features = false, features = ["std"] } ppv-lite86 = { version = "0.2", default-features = false, features = ["simd", "std"] } prost = { version = "0.13", features = ["prost-derive"] } -prost-types = { version = "0.13" } rand = { version = "0.8", features = ["small_rng"] } rand_chacha = { version = "0.3", default-features = false, features = ["std"] } rand_core = { version = "0.6", default-features = false, features = ["std"] } @@ -76,7 +75,6 @@ num-traits = { version = "0.2", default-features = false, features = ["i128", "l phf_shared = { version = "0.11", default-features = false, features = ["std"] } ppv-lite86 = { version = "0.2", default-features = false, features = ["simd", "std"] } prost = { version = "0.13", features = ["prost-derive"] } -prost-types = { version = "0.13" } rand = { version = "0.8", features = ["small_rng"] } rand_chacha = { version = "0.3", default-features = false, features = ["std"] } rand_core = { version = "0.6", default-features = false, features = ["std"] } diff --git a/integrations/Cargo.toml b/integrations/Cargo.toml index 311deee84e..5c1abe4442 100644 --- a/integrations/Cargo.toml +++ b/integrations/Cargo.toml @@ -2,11 +2,12 @@ members = [ # "astroport-adapter", "astrovault-adapter", - # "bundles/*", + "bundles/*", "osmosis-adapter", - # "wyndex-adapter", - # "kujira-adapter", + "wyndex-adapter", + "kujira-adapter", # "mars-adapter", + "neutron-dex-adapter", ] resolver = "2" @@ -27,52 +28,52 @@ version = "0.25.0" [workspace.dependencies] cosmwasm-schema = { version = "2.0" } -cosmwasm-std = { version = "2.0" } +cosmwasm-std = { version = "2.0" } cw-address-like = { version = "2.0" } -cw-asset = { version = "4.0" } -cw-controllers = "2.0" -cw-orch = { version = "0.27.0" } -cw-ownable = { version = "2.0" } -cw-plus-orch = { version = "0.25.0" } +cw-asset = { version = "4.0" } +cw-controllers = "2.0" +cw-orch = { version = "0.27.0" } +cw-ownable = { version = "2.0" } +cw-plus-orch = { version = "0.25.0" } cw-storage-plus = "2.0.0" -cw-utils = "2.0" -cw2 = "2.0.0" -cw20 = { version = "2.0.0" } -cw20-base = { version = "2.0.0" } +cw-utils = "2.0" +cw2 = "2.0.0" +cw20 = { version = "2.0.0" } +cw20-base = { version = "2.0.0" } anyhow = "1.0" -chrono = { version = "0.4.31", default-features = false } -clap = { version = "4.0.32", features = ["derive"] } -protobuf = { version = "2", features = ["with-bytes"] } -schemars = "0.8" -semver = "1.0" -serde = { version = "1.0", default-features = false, features = ["derive"] } +chrono = { version = "0.4.31", default-features = false } +clap = { version = "4.0.32", features = ["derive"] } +protobuf = { version = "2", features = ["with-bytes"] } +schemars = "0.8" +semver = "1.0" +serde = { version = "1.0", default-features = false, features = ["derive"] } thiserror = { version = "1.0.50" } ## crates in order of publishing ## see docs/Publishing.md -abstract-adapter = { version = "0.25.0" } +abstract-adapter = { version = "0.25.0" } abstract-interface = { version = "0.25.0" } -abstract-sdk = { version = "0.25.0" } -abstract-std = { version = "0.25.0" } +abstract-sdk = { version = "0.25.0" } +abstract-std = { version = "0.25.0" } -abstract-adapter-utils = { version = "0.25.0" } -abstract-dex-standard = { version = "0.25.0" } +abstract-adapter-utils = { version = "0.25.0" } +abstract-dex-standard = { version = "0.25.0" } abstract-money-market-standard = { version = "0.25.0" } -abstract-staking-standard = { version = "0.25.0" } +abstract-staking-standard = { version = "0.25.0" } # TODO: REMOVE As soon as new dex-standard published [patch.crates-io] -abstract-adapter = { path = "../framework/packages/abstract-adapter" } -abstract-adapter-utils = { path = "../framework/packages/standards/utils" } -abstract-dex-standard = { path = "../framework/packages/standards/dex" } -abstract-interface = { path = "../framework/packages/abstract-interface" } -abstract-macros = { path = "../framework/packages/abstract-macros" } +abstract-adapter = { path = "../framework/packages/abstract-adapter" } +abstract-adapter-utils = { path = "../framework/packages/standards/utils" } +abstract-dex-standard = { path = "../framework/packages/standards/dex" } +abstract-interface = { path = "../framework/packages/abstract-interface" } +abstract-macros = { path = "../framework/packages/abstract-macros" } abstract-money-market-standard = { path = "../framework/packages/standards/money-market" } -abstract-sdk = { path = "../framework/packages/abstract-sdk" } -abstract-staking-standard = { path = "../framework/packages/standards/staking" } -abstract-std = { path = "../framework/packages/abstract-std" } +abstract-sdk = { path = "../framework/packages/abstract-sdk" } +abstract-staking-standard = { path = "../framework/packages/standards/staking" } +abstract-std = { path = "../framework/packages/abstract-std" } # In case polytone not released # abstract-polytone = { git = "https://github.com/AbstractSDK/polytone.git", branch = "bump/cw2" } @@ -81,12 +82,12 @@ abstract-std = { path = "../framework/packages/abstract-std" } # Backup release profile, will result in warnings during optimization [profile.release] -codegen-units = 1 -debug = false +codegen-units = 1 +debug = false debug-assertions = false -incremental = false -lto = true -opt-level = 3 -overflow-checks = true -panic = 'abort' -rpath = false +incremental = false +lto = true +opt-level = 3 +overflow-checks = true +panic = 'abort' +rpath = false diff --git a/integrations/astrovault-adapter/Cargo.toml b/integrations/astrovault-adapter/Cargo.toml index 2bc47af399..46086ff958 100644 --- a/integrations/astrovault-adapter/Cargo.toml +++ b/integrations/astrovault-adapter/Cargo.toml @@ -5,6 +5,7 @@ edition = "2021" license = "Apache-2.0" name = "abstract-astrovault-adapter" version = "0.2.0" +resolver = "2" [features] default = ["full_integration"] @@ -25,5 +26,5 @@ cw20 = { workspace = true, optional = true } [dev-dependencies] abstract-dex-standard = { workspace = true, features = ["testing"] } -astrovault = { version = "0.1.1" } +astrovault = { version = "2.0.1" } cw-orch = { workspace = true } diff --git a/integrations/bundles/mockdex/Cargo.toml b/integrations/bundles/mockdex/Cargo.toml index b71a609a89..37fde4d222 100644 --- a/integrations/bundles/mockdex/Cargo.toml +++ b/integrations/bundles/mockdex/Cargo.toml @@ -8,21 +8,20 @@ version = { workspace = true } [dependencies] -cw-controllers = "2.0.0" -wyndex = { git = "https://github.com/cosmorama/wynddex.git", tag = "v1.1.2" } -wyndex-factory = { git = "https://github.com/cosmorama/wynddex.git", tag = "v1.1.2" } -wyndex-multi-hop = { git = "https://github.com/cosmorama/wynddex.git", tag = "v1.1.2" } -wyndex-pair = { git = "https://github.com/cosmorama/wynddex.git", tag = "v1.1.2" } -wyndex-stake = { git = "https://github.com/cosmorama/wynddex.git", tag = "v1.1.2" } +cw-controllers = "2.0.0" +wyndex = { git = "https://github.com/abstractsdk/wynddex", rev = "cbe316f17c4a89d0c3938ea66747a5ff1fc5a5e9", version="2.2.0" } +wyndex-factory = { git = "https://github.com/abstractsdk/wynddex", rev = "cbe316f17c4a89d0c3938ea66747a5ff1fc5a5e9", version="2.2.0" } +wyndex-multi-hop = { git = "https://github.com/abstractsdk/wynddex", rev = "cbe316f17c4a89d0c3938ea66747a5ff1fc5a5e9", version="2.2.0" } +wyndex-pair = { git = "https://github.com/abstractsdk/wynddex", rev = "cbe316f17c4a89d0c3938ea66747a5ff1fc5a5e9", version="2.2.0" } +wyndex-stake = { git = "https://github.com/abstractsdk/wynddex", rev = "cbe316f17c4a89d0c3938ea66747a5ff1fc5a5e9", version="2.2.0" } -abstract-interface = { workspace = true, features = ["testing"] } -abstract-std = { workspace = true } -anyhow = { workspace = true } -cosmwasm-schema = { workspace = true } -cosmwasm-std = { workspace = true } -cw-asset = { workspace = true } -cw-orch = { workspace = true } -cw-plus-interface.workspace = true -cw-plus-orch = "0.25.0" -cw20 = { workspace = true } -cw20-base = { workspace = true } +abstract-interface = { workspace = true, features = ["testing"] } +abstract-std = { workspace = true } +anyhow = { workspace = true } +cosmwasm-schema = { workspace = true } +cosmwasm-std = { workspace = true } +cw-asset = { workspace = true } +cw-orch = { workspace = true } +cw-plus-orch = { workspace = true } +cw20 = { workspace = true } +cw20-base = { workspace = true } diff --git a/integrations/bundles/mockdex/src/lib.rs b/integrations/bundles/mockdex/src/lib.rs index 06e9270e5b..038be5057d 100644 --- a/integrations/bundles/mockdex/src/lib.rs +++ b/integrations/bundles/mockdex/src/lib.rs @@ -13,7 +13,7 @@ use abstract_std::{ use cosmwasm_std::{coin, Decimal, Uint128}; use cw20::Cw20Coin; use cw_orch::prelude::*; -use cw_plus_interface::cw20_base::Cw20Base as AbstractCw20Base; +use cw_plus_orch::cw20_base::Cw20Base as AbstractCw20Base; use wyndex::{ asset::{AssetInfo, AssetInfoExt}, factory::{DefaultStakeConfig, PartialStakeConfig}, @@ -164,6 +164,7 @@ impl Deploy for WynDex { min_bond: Uint128::new(1), unbonding_periods: vec![1, 2], max_distributions: 1, + converter: None, }) .build(&chain); @@ -443,11 +444,6 @@ impl Deploy for WynDex { Box::new(&mut self.raw_eur_lp), ] } - - // This is only a mock deploy - fn deployed_state_file_path() -> Option { - None - } } impl WynDex { /// registers the WynDex contracts and assets on Abstract diff --git a/integrations/bundles/mockdex/src/suite.rs b/integrations/bundles/mockdex/src/suite.rs index 0ddc3fe9f9..2dfb7ac671 100644 --- a/integrations/bundles/mockdex/src/suite.rs +++ b/integrations/bundles/mockdex/src/suite.rs @@ -111,6 +111,7 @@ impl SuiteBuilder { min_bond: Uint128::new(1000), unbonding_periods: vec![60 * 60 * 24 * 7, 60 * 60 * 24 * 14, 60 * 60 * 24 * 21], max_distributions: 6, + converter: None, }, trading_starts: None, } diff --git a/integrations/bundles/mockdex/tests/abstract.rs b/integrations/bundles/mockdex/tests/abstract.rs index 877426b07e..60a94a4aec 100644 --- a/integrations/bundles/mockdex/tests/abstract.rs +++ b/integrations/bundles/mockdex/tests/abstract.rs @@ -1,14 +1,13 @@ mod abstrct { use abstract_interface::Abstract; use cw_orch::prelude::*; - use wyndex_bundle::WynDex; + use mockdex_bundle::WynDex; #[test] fn deploy() { let mock = MockBech32::new("mock"); - let owner = mock.sender_addr(); - Abstract::deploy_on(mock.clone(), owner.to_string()).unwrap(); + Abstract::deploy_on(mock.clone(), ()).unwrap(); let deployed = WynDex::deploy_on(mock.clone(), Empty {}).unwrap(); let loaded = WynDex::load_from(mock).unwrap(); diff --git a/integrations/bundles/mockdex/tests/staking.rs b/integrations/bundles/mockdex/tests/staking.rs index bd145bec42..896f9421f5 100644 --- a/integrations/bundles/mockdex/tests/staking.rs +++ b/integrations/bundles/mockdex/tests/staking.rs @@ -2,9 +2,10 @@ use cosmwasm_std::{coin, from_json, Addr, Decimal, Uint128}; use wyndex::{ asset::{AssetInfo, AssetInfoExt}, factory::PartialStakeConfig, + stake::ReceiveMsg, }; use wyndex_stake::{ - msg::{QueryMsg as StakeQueryMsg, ReceiveDelegationMsg, StakedResponse}, + msg::{QueryMsg as StakeQueryMsg, StakedResponse}, state::Config as WyndexStakeConfig, }; @@ -12,8 +13,8 @@ mod staking { use super::*; use cw_orch::mock::MockBech32; use cw_orch::prelude::TxHandler; + use mockdex_bundle::{suite::SuiteBuilder, WYNDEX_OWNER}; use wyndex::factory::{DefaultStakeConfig, DistributionFlow}; - use wyndex_bundle::{suite::SuiteBuilder, WYNDEX_OWNER}; #[test] fn basic() { @@ -40,6 +41,7 @@ mod staking { min_bond: Uint128::new(1), unbonding_periods: vec![1, 2], max_distributions: 1, + converter: None, }) .build(&mock); @@ -92,7 +94,7 @@ mod staking { &pair_info.liquidity_token, 1000, &pair_info.staking_addr, - ReceiveDelegationMsg::Delegate { + ReceiveMsg::Delegate { unbonding_period: 1, delegate_as: None, }, @@ -190,6 +192,7 @@ mod staking { min_bond: Uint128::new(1), unbonding_periods: vec![1], max_distributions: 3, + converter: None, }) .build(&mock); diff --git a/integrations/bundles/mockdex/tests/swap.rs b/integrations/bundles/mockdex/tests/swap.rs index 0a01f206dc..7f3a00cfa3 100644 --- a/integrations/bundles/mockdex/tests/swap.rs +++ b/integrations/bundles/mockdex/tests/swap.rs @@ -1,8 +1,8 @@ use cosmwasm_std::{coin, testing::mock_env}; use cw_orch::mock::MockBech32; use cw_orch::prelude::TxHandler; +use mockdex_bundle::suite::SuiteBuilder; use wyndex::asset::{AssetInfo, AssetInfoExt}; -use wyndex_bundle::suite::SuiteBuilder; use wyndex_multi_hop::msg::SwapOperation; #[test] diff --git a/integrations/kujira-adapter/Cargo.toml b/integrations/kujira-adapter/Cargo.toml index babdf691d5..a7f332fb2a 100644 --- a/integrations/kujira-adapter/Cargo.toml +++ b/integrations/kujira-adapter/Cargo.toml @@ -12,7 +12,7 @@ full_integration = ["dep:kujira", "dep:cw20", "dep:cw-asset", "dep:cw-utils"] local = [] [dependencies] -kujira = { version = "0.8.2", optional = true } +kujira = { version = "1.3.0", optional = true } abstract-dex-standard = { workspace = true } abstract-money-market-standard = { workspace = true } diff --git a/integrations/kujira-adapter/src/lib.rs b/integrations/kujira-adapter/src/lib.rs index ec5b71754e..bc731db7a6 100644 --- a/integrations/kujira-adapter/src/lib.rs +++ b/integrations/kujira-adapter/src/lib.rs @@ -1,7 +1,7 @@ #[cfg(feature = "local")] -pub const AVAILABLE_CHAINS: &[&str] = abstract_sdk::std::registry::LOCAL_CHAIN; +pub const AVAILABLE_CHAINS: &[&str] = abstract_sdk::std::constants::LOCAL_CHAIN; #[cfg(not(feature = "local"))] -pub const AVAILABLE_CHAINS: &[&str] = abstract_sdk::std::registry::KUJIRA; +pub const AVAILABLE_CHAINS: &[&str] = abstract_sdk::std::constants::KUJIRA; pub mod dex; pub mod money_market; diff --git a/integrations/kujira-adapter/src/money_market.rs b/integrations/kujira-adapter/src/money_market.rs index 289e8797ab..280d669d4a 100644 --- a/integrations/kujira-adapter/src/money_market.rs +++ b/integrations/kujira-adapter/src/money_market.rs @@ -24,8 +24,8 @@ use ::{ std::objects::{ans_host::AnsHostError, AssetEntry, ContractEntry}, }, cosmwasm_std::{ - coins, wasm_execute, Addr, CosmosMsg, Decimal, Deps, QuerierWrapper, StdError, StdResult, - Uint128, + coins, wasm_execute, Addr, CosmosMsg, Decimal, Deps, GrpcQuery, QuerierWrapper, StdError, + StdResult, Uint128, }, cw_asset::{Asset, AssetInfo}, kujira::ghost::{ @@ -76,7 +76,7 @@ impl MoneyMarketCommand for Ghost { &vault_msg, coins( ((Decimal::from_ratio(asset.amount, 1u128) / status.deposit_redemption_ratio) - * Uint128::one()) + .to_uint_floor()) .u128(), config.receipt_denom, ), diff --git a/integrations/neutron-dex-adapter/Cargo.toml b/integrations/neutron-dex-adapter/Cargo.toml new file mode 100644 index 0000000000..d07e6227fb --- /dev/null +++ b/integrations/neutron-dex-adapter/Cargo.toml @@ -0,0 +1,36 @@ +[package] +authors = ["Abstract Money "] +description = "Abstract DexCommand implementation for Neutron's native dex" +edition = "2021" +license = "Apache-2.0" +name = "abstract-neutron-dex-adapter" +repository = "https://github.com/AbstractSDK/abstract" +version = "2.10.0" + +[features] +default = ["full_integration"] +full_integration = [ + "dep:cw20", + "dep:cosmwasm-schema", + "dep:cw-asset", + "dep:cw-utils", + "dep:neutron-std", +] +local = [] + +[dependencies] +neutron-std = { version = "5.0.1-rc0", optional = true } +lazy_static = "1.4.0" + +abstract-dex-standard = { workspace = true } +abstract-sdk = { workspace = true } +abstract-staking-standard = { workspace = true } +cosmwasm-schema = { workspace = true, optional = true } +cosmwasm-std = { workspace = true } +cw-asset = { workspace = true, optional = true } +cw-utils = { workspace = true, optional = true } +cw20 = { workspace = true, optional = true } + +[dev-dependencies] +abstract-dex-standard = { workspace = true, features = ["testing"] } +cw-orch = { workspace = true } diff --git a/integrations/neutron-dex-adapter/src/dex.rs b/integrations/neutron-dex-adapter/src/dex.rs new file mode 100644 index 0000000000..f0d8c57b21 --- /dev/null +++ b/integrations/neutron-dex-adapter/src/dex.rs @@ -0,0 +1,139 @@ +use abstract_dex_standard::Identify; +use cosmwasm_std::Addr; + +use crate::{AVAILABLE_CHAINS, NEUTRON}; +// Source https://github.com/astroport-fi/astroport-core +#[derive(Default)] +pub struct Neutron { + pub addr_as_sender: Option, +} + +impl Identify for Neutron { + fn name(&self) -> &'static str { + NEUTRON + } + fn is_available_on(&self, chain_name: &str) -> bool { + AVAILABLE_CHAINS.contains(&chain_name) + } +} + +#[cfg(feature = "full_integration")] +use ::{ + abstract_dex_standard::{DexCommand, DexError, Fee, FeeOnInput, Return, Spread, SwapNode}, + abstract_sdk::feature_objects::{AnsHost, RegistryContract}, + abstract_sdk::std::objects::PoolAddress, + cosmwasm_std::{CosmosMsg, Decimal, Deps}, + cw_asset::{Asset, AssetInfo}, + neutron_std::types::neutron::dex::{MsgMultiHopSwap, MultiHopRoute}, +}; + +#[cfg(feature = "full_integration")] +impl DexCommand for Neutron { + fn fetch_data( + &mut self, + _deps: Deps, + addr_as_sender: Addr, + _registry_contract: RegistryContract, + _ans_host: AnsHost, + ) -> Result<(), DexError> { + self.addr_as_sender = Some(addr_as_sender); + Ok(()) + } + fn swap( + &self, + _deps: Deps, + _pool_id: PoolAddress, + offer_asset: Asset, + ask_asset: AssetInfo, + belief_price: Option, + _max_spread: Option, + ) -> Result, DexError> { + let swap_msg = MsgMultiHopSwap { + creator: self + .addr_as_sender + .as_ref() + .expect("no local account") + .to_string(), + receiver: self + .addr_as_sender + .as_ref() + .expect("no local account") + .to_string(), + routes: vec![MultiHopRoute { + hops: vec![offer_asset.info.inner(), ask_asset.inner()], + }], + amount_in: offer_asset.amount.to_string(), + exit_limit_price: belief_price + .map(|b| b.to_string()) + .unwrap_or("0".to_string()), + pick_best_route: false, + }; + + Ok(vec![swap_msg.into()]) + } + + fn swap_route( + &self, + _deps: Deps, + swap_route: Vec>, + offer_asset: Asset, + _belief_price: Option, + _max_spread: Option, + ) -> Result, DexError> { + let swap_msg = MsgMultiHopSwap { + creator: self + .addr_as_sender + .as_ref() + .expect("no local account") + .to_string(), + receiver: self + .addr_as_sender + .as_ref() + .expect("no local account") + .to_string(), + routes: vec![MultiHopRoute { + hops: [ + vec![offer_asset.info.inner()], + swap_route + .into_iter() + .map(|r| r.ask_asset.inner()) + .collect::>(), + ] + .concat(), + }], + amount_in: offer_asset.amount.to_string(), + exit_limit_price: "0".to_string(), + pick_best_route: false, + }; + Ok(vec![swap_msg.into()]) + } + + fn provide_liquidity( + &self, + _deps: Deps, + _pool_id: PoolAddress, + _offer_assets: Vec, + _max_spread: Option, + ) -> Result, DexError> { + unimplemented!(); + } + + fn withdraw_liquidity( + &self, + _deps: Deps, + _pool_id: PoolAddress, + _lp_token: Asset, + ) -> Result, DexError> { + unimplemented!(); + } + + fn simulate_swap( + &self, + _deps: Deps, + _pool_id: PoolAddress, + _offer_asset: Asset, + _ask_asset: AssetInfo, + ) -> Result<(Return, Spread, Fee, FeeOnInput), DexError> { + unimplemented!(); + } +} diff --git a/integrations/neutron-dex-adapter/src/lib.rs b/integrations/neutron-dex-adapter/src/lib.rs new file mode 100644 index 0000000000..b26bf1ba37 --- /dev/null +++ b/integrations/neutron-dex-adapter/src/lib.rs @@ -0,0 +1,7 @@ +pub const NEUTRON: &str = "neutron"; +#[cfg(feature = "local")] +pub const AVAILABLE_CHAINS: &[&str] = abstract_sdk::std::constants::LOCAL_CHAIN; +#[cfg(not(feature = "local"))] +pub const AVAILABLE_CHAINS: &[&str] = abstract_sdk::std::constants::NEUTRON; + +pub mod dex; diff --git a/integrations/osmosis-adapter/src/dex.rs b/integrations/osmosis-adapter/src/dex.rs index fc31f678f4..01e192e8b4 100644 --- a/integrations/osmosis-adapter/src/dex.rs +++ b/integrations/osmosis-adapter/src/dex.rs @@ -1,5 +1,4 @@ use abstract_dex_standard::Identify; -use abstract_sdk::feature_objects::RegistryContract; use cosmwasm_std::Addr; use crate::{AVAILABLE_CHAINS, OSMOSIS}; @@ -21,7 +20,10 @@ impl Identify for Osmosis { #[cfg(feature = "full_integration")] use { abstract_dex_standard::{DexCommand, DexError, Fee, FeeOnInput, Return, Spread, SwapNode}, - abstract_sdk::{feature_objects::AnsHost, std::objects::PoolAddress}, + abstract_sdk::{ + feature_objects::{AnsHost, RegistryContract}, + std::objects::PoolAddress, + }, cosmwasm_std::{ Coin, CosmosMsg, Decimal, Decimal256, Deps, StdError, StdResult, Uint128, Uint256, }, diff --git a/integrations/osmosis-adapter/src/staking.rs b/integrations/osmosis-adapter/src/staking.rs index df354e2d34..02688c75f9 100644 --- a/integrations/osmosis-adapter/src/staking.rs +++ b/integrations/osmosis-adapter/src/staking.rs @@ -1,4 +1,3 @@ -use abstract_sdk::std::objects::registry::RegistryContract; use abstract_staking_standard::Identify; use cosmwasm_std::Addr; @@ -29,7 +28,8 @@ pub mod fns { use std::str::FromStr; use abstract_sdk::std::objects::{ - ans_host::AnsHost, AnsAsset, AnsEntryConvertor, AssetEntry, PoolReference, PoolType, + ans_host::AnsHost, registry::RegistryContract, AnsAsset, AnsEntryConvertor, AssetEntry, + PoolReference, PoolType, }; use abstract_staking_standard::{ diff --git a/integrations/wyndex-adapter/Cargo.toml b/integrations/wyndex-adapter/Cargo.toml index 69706920db..6ff7c68490 100644 --- a/integrations/wyndex-adapter/Cargo.toml +++ b/integrations/wyndex-adapter/Cargo.toml @@ -21,8 +21,8 @@ full_integration = [ local = [] [dependencies] -wyndex = { git = "https://github.com/wynddao/wynddex", tag = "v1.1.2", optional = true } -wyndex-stake = { git = "https://github.com/wynddao/wynddex", tag = "v1.1.2", features = ["library"], optional = true } +wyndex = { git = "https://github.com/abstractsdk/wynddex", rev = "cbe316f17c4a89d0c3938ea66747a5ff1fc5a5e9", optional = true, version="2.2.0" } +wyndex-stake = { git = "https://github.com/abstractsdk/wynddex", rev = "cbe316f17c4a89d0c3938ea66747a5ff1fc5a5e9", features = ["library"], optional = true, version="2.2.0" } abstract-dex-standard = { workspace = true } abstract-sdk = { workspace = true } diff --git a/integrations/wyndex-adapter/src/lib.rs b/integrations/wyndex-adapter/src/lib.rs index 742300ac88..93404a366b 100644 --- a/integrations/wyndex-adapter/src/lib.rs +++ b/integrations/wyndex-adapter/src/lib.rs @@ -2,9 +2,9 @@ pub const WYNDEX: &str = "wyndex"; #[cfg(feature = "local")] -pub const AVAILABLE_CHAINS: &[&str] = abstract_sdk::std::registry::LOCAL_CHAIN; +pub const AVAILABLE_CHAINS: &[&str] = abstract_sdk::std::constants::LOCAL_CHAIN; #[cfg(not(feature = "local"))] -pub const AVAILABLE_CHAINS: &[&str] = abstract_sdk::std::registry::JUNO; +pub const AVAILABLE_CHAINS: &[&str] = abstract_sdk::std::constants::JUNO; pub mod dex; pub mod staking; diff --git a/integrations/wyndex-adapter/src/staking.rs b/integrations/wyndex-adapter/src/staking.rs index 8e030f5b21..84f6fcdea6 100644 --- a/integrations/wyndex-adapter/src/staking.rs +++ b/integrations/wyndex-adapter/src/staking.rs @@ -44,8 +44,8 @@ use { cw20::Cw20ExecuteMsg, cw_asset::{AssetInfo, AssetInfoBase}, cw_utils::Duration, + wyndex::stake::ReceiveMsg, wyndex_stake::msg::DistributionDataResponse, - wyndex_stake::msg::ReceiveDelegationMsg, wyndex_stake::{ msg::{BondingInfoResponse, ExecuteMsg as StakeCw20ExecuteMsg}, state::{BondingInfo, STAKE}, @@ -98,7 +98,7 @@ impl CwStakingCommand for WynDex { unbonding_period: Option, ) -> Result, CwStakingError> { let unbonding_period = unwrap_unbond(self, unbonding_period)?; - let msg = to_json_binary(&ReceiveDelegationMsg::Delegate { + let msg = to_json_binary(&ReceiveMsg::Delegate { unbonding_period, delegate_as: None, })?; diff --git a/interchain/framework-clone-testing/Cargo.toml b/interchain/framework-clone-testing/Cargo.toml index 85e740ad9b..edf88f9250 100644 --- a/interchain/framework-clone-testing/Cargo.toml +++ b/interchain/framework-clone-testing/Cargo.toml @@ -15,7 +15,7 @@ cw-orch-clone-testing = { workspace = true } abstract-account = { workspace = true, features = ["xion"] } abstract-app = { workspace = true, features = ["test-utils"] } -abstract-client = { workspace = true } +abstract-client = { workspace = true, features = ["test-utils"] } abstract-integration-tests = { path = "../../framework/packages/abstract-integration-tests" } abstract-interface = { workspace = true, features = ["daemon"] } abstract-std = { workspace = true } diff --git a/interchain/framework-clone-testing/tests/upgrade-account.rs b/interchain/framework-clone-testing/tests/upgrade-account.rs index 371cd7fe22..46293cc9de 100644 --- a/interchain/framework-clone-testing/tests/upgrade-account.rs +++ b/interchain/framework-clone-testing/tests/upgrade-account.rs @@ -4,7 +4,6 @@ use abstract_framework_clone_testing::common; use abstract_interface::{Abstract, AccountDetails, AccountI, AccountQueryFns, RegistryQueryFns}; use abstract_std::objects::AccountId; -use abstract_testing::TEST_VERSION; use anyhow::bail; use cw_orch::{daemon::networks::PION_1, prelude::*}; use cw_orch_clone_testing::CloneTesting; diff --git a/interchain/modules-clone-testing/Cargo.toml b/interchain/modules-clone-testing/Cargo.toml index fd5ec21bd4..67f545976f 100644 --- a/interchain/modules-clone-testing/Cargo.toml +++ b/interchain/modules-clone-testing/Cargo.toml @@ -1,7 +1,8 @@ [package] -edition = { workspace = true } -name = "abstract-modules-interchain-tests" -version = { workspace = true } +edition = { workspace = true } +name = "abstract-modules-interchain-tests" +version = { workspace = true } +resolver = "2" [lib] @@ -13,8 +14,8 @@ cw-orch-clone-testing = { workspace = true } cw20 = { workspace = true } abstract-app = { workspace = true, features = ["test-utils"] } -abstract-client = { workspace = true } -abstract-interface = { workspace = true, features = ["daemon"] } +abstract-client = { workspace = true, features = ["test-utils"] } +abstract-interface = { workspace = true, features = ["testing", "daemon"] } anyhow = { workspace = true } env_logger = "0.11.3" @@ -41,7 +42,7 @@ abstract-money-market-adapter = { workspace = true, features = [ ] } # astroport = { version = "3.11.1" } # kujira = { version = "0.8" } -astrovault = { version = "0.1.4" } +astrovault = { version = "2.0.1" } serde = "1" serde_json = "1" diff --git a/interchain/modules-clone-testing/src/common.rs b/interchain/modules-clone-testing/src/common.rs index 7ade535ad0..da6481d9a3 100644 --- a/interchain/modules-clone-testing/src/common.rs +++ b/interchain/modules-clone-testing/src/common.rs @@ -38,7 +38,7 @@ pub fn load_abstr(chain: ChainInfo) -> anyhow::Result anyhow::Result> { let chain_info = ARCHWAY_1; let abstr_deployment = load_abstr(chain_info)?; + let chain = abstr_deployment.environment(); let asset_a = ( @@ -294,6 +295,7 @@ mod xasset_stable_pool_tests { fn setup_stable_pool() -> anyhow::Result> { let chain_info = ARCHWAY_1; let abstr_deployment = load_abstr(chain_info)?; + let chain = abstr_deployment.environment(); let asset_a = ( diff --git a/interchain/scripts/src/bin/deploy_modules.rs b/interchain/scripts/src/bin/deploy_modules.rs index b7a9aa5863..d2e5e934fb 100644 --- a/interchain/scripts/src/bin/deploy_modules.rs +++ b/interchain/scripts/src/bin/deploy_modules.rs @@ -11,14 +11,11 @@ use cw_orch::{ prelude::*, }; use reqwest::Url; -use tokio::runtime::Runtime; pub const ABSTRACT_VERSION: &str = env!("CARGO_PKG_VERSION"); // Run "cargo run --example download_wasms" in the `abstract-interfaces` package before deploying! fn full_deploy() -> anyhow::Result<()> { - let rt = Runtime::new()?; - let deployment = Abstract::::get_all_deployed_chains(); let networks: Vec = deployment .iter() @@ -26,9 +23,7 @@ fn full_deploy() -> anyhow::Result<()> { .collect(); for network in networks { - let chain = DaemonBuilder::new(network.clone()) - .handle(rt.handle()) - .build()?; + let chain = DaemonBuilder::new(network.clone()).build()?; // Deploy Adapters CwStakingAdapter::new(CW_STAKING_ADAPTER_ID, chain.clone()).deploy( diff --git a/interchain/scripts/src/bin/full_deploy.rs b/interchain/scripts/src/bin/full_deploy.rs index 0d460e11f7..8cae07e4ea 100644 --- a/interchain/scripts/src/bin/full_deploy.rs +++ b/interchain/scripts/src/bin/full_deploy.rs @@ -1,28 +1,24 @@ use abstract_interface::{Abstract, AccountI}; use abstract_std::objects::gov_type::GovernanceDetails; +use cw_orch_daemon::RUNTIME; use abstract_scripts::{assert_wallet_balance, SUPPORTED_CHAINS}; use clap::Parser; use cw_orch::{daemon::networks::parse_network, prelude::*}; -use tokio::runtime::Runtime; pub const ABSTRACT_VERSION: &str = env!("CARGO_PKG_VERSION"); // Run "cargo run --example download_wasms" in the `abstract-interfaces` package before deploying! fn full_deploy(mut networks: Vec) -> anyhow::Result<()> { - let rt = Runtime::new()?; - if networks.is_empty() { networks = SUPPORTED_CHAINS.iter().map(|x| x.clone().into()).collect(); } - let networks = rt.block_on(assert_wallet_balance(networks)); + let networks = RUNTIME.block_on(assert_wallet_balance(networks)); for network in networks { - let chain = DaemonBuilder::new(network.clone()) - .handle(rt.handle()) - .build()?; + let chain = DaemonBuilder::new(network.clone()).build()?; let monarch = chain.sender_addr(); diff --git a/interchain/scripts/src/bin/manual_deploy.rs b/interchain/scripts/src/bin/manual_deploy.rs index 9a6cdbbc93..2f350b8251 100644 --- a/interchain/scripts/src/bin/manual_deploy.rs +++ b/interchain/scripts/src/bin/manual_deploy.rs @@ -5,8 +5,8 @@ use abstract_scripts::assert_wallet_balance; use abstract_std::objects::gov_type::GovernanceDetails; use clap::Parser; use cw_orch::{environment::NetworkInfoOwned, prelude::*}; +use cw_orch_daemon::RUNTIME; use reqwest::Url; -use tokio::runtime::Runtime; use cw_orch::environment::ChainKind; use cw_orch_polytone::Polytone; @@ -16,17 +16,15 @@ pub const ABSTRACT_VERSION: &str = env!("CARGO_PKG_VERSION"); /// Script to deploy Abstract & polytone to a new network provided by commmand line arguments /// Run "cargo run --example download_wasms" in the `abstract-interfaces` package before deploying! fn manual_deploy(network: ChainInfoOwned) -> anyhow::Result<()> { - let rt = Runtime::new()?; - - rt.block_on(assert_wallet_balance(vec![network.clone()])); + RUNTIME.block_on(assert_wallet_balance(vec![network.clone()])); let urls = network.grpc_urls.to_vec(); for url in urls { - rt.block_on(ping_grpc(&url))?; + RUNTIME.block_on(ping_grpc(&url))?; } let chain = DaemonBuilder::new(network.clone()) - .handle(rt.handle()) + .handle(RUNTIME.handle()) .build()?; let monarch = chain.sender_addr(); diff --git a/interchain/scripts/src/bin/migrate.rs b/interchain/scripts/src/bin/migrate.rs index 50fc982038..3555665d85 100644 --- a/interchain/scripts/src/bin/migrate.rs +++ b/interchain/scripts/src/bin/migrate.rs @@ -4,14 +4,12 @@ use cw_orch::prelude::{ networks::{parse_network, ChainInfo}, *, }; -use tokio::runtime::Runtime; pub const ABSTRACT_VERSION: &str = env!("CARGO_PKG_VERSION"); fn migrate(networks: Vec) -> anyhow::Result<()> { - let rt = Runtime::new()?; for network in networks { - let chain = DaemonBuilder::new(network).handle(rt.handle()).build()?; + let chain = DaemonBuilder::new(network).build()?; let deployment = Abstract::load_from(chain.clone())?; diff --git a/interchain/scripts/src/bin/proposal_template.rs b/interchain/scripts/src/bin/proposal_template.rs index d7adeb3976..0b5cbf38a6 100644 --- a/interchain/scripts/src/bin/proposal_template.rs +++ b/interchain/scripts/src/bin/proposal_template.rs @@ -1,8 +1,6 @@ -use cosmos_sdk_proto::cosmos::gov::v1beta1::MsgSubmitProposalResponse; use cosmrs::proto::cosmos::gov::v1::MsgSubmitProposal; use cosmrs::proto::cosmwasm::wasm::v1::{AccessConfig, AccessType, MsgUpdateParams, Params}; use cw_orch::prelude::*; -use cw_orch_interchain::prelude::*; use networks::COSMOS_HUB_TESTNET; use prost::Name; use xionrs::tx::MessageExt; diff --git a/interchain/scripts/src/bin/xion_test.rs b/interchain/scripts/src/bin/xion_test.rs index 7e581f03d9..a338a5ef88 100644 --- a/interchain/scripts/src/bin/xion_test.rs +++ b/interchain/scripts/src/bin/xion_test.rs @@ -8,8 +8,8 @@ use abstract_std::{ }; use abstract_xion::AddAuthenticator; use bitcoin::secp256k1::{All, Secp256k1, Signing}; +use cosmwasm_std::to_json_vec; use cosmwasm_std::{coins, to_json_binary, Binary}; -use cosmwasm_std::{to_json_vec, Addr}; use cw_orch::{ daemon::{networks::xion::XION_NETWORK, Daemon, TxSender, RUNTIME}, prelude::*, @@ -28,29 +28,16 @@ use cw_orch_daemon::{ CosmTxResponse, DaemonError, GrpcChannel, }; use networks::ChainKind; -use std::str::FromStr; use tonic::transport::Channel; use xion_sdk_proto::abstract_account::v1::NilPubKey; use xion_sdk_proto::cosmos::auth::v1beta1::QueryAccountRequest; use xion_sdk_proto::traits::MessageExt; use xion_sdk_proto::{cosmos::bank::v1beta1::MsgSend, prost::Name, traits::Message}; -use xionrs::{ - crypto::secp256k1::SigningKey, - tendermint::chain::Id, - // tx::{self, ModeInfo, Msg, Raw, SignDoc, SignMode, SignerInfo}, - // Any, -}; - -const GAS_BUFFER: f64 = 1.3; -const BUFFER_THRESHOLD: u64 = 200_000; -const SMALL_GAS_BUFFER: f64 = 1.4; +use xionrs::crypto::secp256k1::SigningKey; // Xiond validator seed const LOCAL_MNEMONIC: &str = "clinic tube choose fade collect fish original recipe pumpkin fantasy enrich sunny pattern regret blouse organ april carpet guitar skin work moon fatigue hurdle"; -// Juno default mnemonics (used for deployment of mock abstract) -const JUNO_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"; - pub const LOCAL_XION: ChainInfo = ChainInfo { kind: ChainKind::Local, chain_id: "xion-devnet-1", @@ -214,7 +201,7 @@ fn main() -> anyhow::Result<()> { mod xion_sender { use xion_sdk_proto::cosmos::tx::v1beta1::{AuthInfo, SignDoc, SignerInfo, TxRaw}; use xionrs::{ - tx::{Msg, Raw, SignMode}, + tx::{Msg, SignMode}, Any, }; @@ -383,8 +370,8 @@ mod xion_sender { .unwrap(); let signature = self.cosmos_private_key().sign(&sign_doc_bytes)?; - let AUTHID = auth_id::AuthId::new(1u8, true).unwrap(); - let smart_contract_sig = AUTHID.signature(signature.to_vec()); + let auth_id = auth_id::AuthId::new(1u8, true).unwrap(); + let smart_contract_sig = auth_id.signature(signature.to_vec()); Ok(xion_sdk_proto::cosmos::tx::v1beta1::TxRaw { body_bytes: sign_doc.body_bytes, @@ -525,20 +512,6 @@ mod xion_sender { _ => panic!("Can't set mnemonic for unspecified chainkind"), } } - - pub(crate) fn parse_cw_coins( - coins: &[cosmwasm_std::Coin], - ) -> Result, DaemonError> { - coins - .iter() - .map(|cosmwasm_std::Coin { amount, denom }| { - Ok(xionrs::Coin { - amount: amount.u128(), - denom: xionrs::Denom::from_str(denom)?, - }) - }) - .collect::, DaemonError>>() - } } pub mod auth_id { diff --git a/interchain/scripts/state.json b/interchain/scripts/state.json index 9f013b2caa..7029b10eab 100644 --- a/interchain/scripts/state.json +++ b/interchain/scripts/state.json @@ -3,18 +3,24 @@ "code_ids": { "abstract:account": 11529, "abstract:ans-host": 11528, - "abstract:dex": 11532, + "abstract:cw-staking": 11559, + "abstract:dex": 11694, "abstract:ibc-client": 11530, "abstract:ibc-host": 11531, "abstract:module-factory": 11526, + "abstract:payment": 11735, + "abstract:ping-pong": 11558, "abstract:registry": 11527, "cw:blob": 11289 }, "default": { "abstract:account-local-0": "osmo1hafge5xucuc03ar5lkwac0n9yctnxq6xrgygftdl9xl3tzncgghshnykry", "abstract:account-local-1": "osmo1v9dl0fw5s3jujn6emmlgch7w4ynt02nykj75pnzk8mdw7nmu3p4q65tczp", + "abstract:account-local-9": "osmo1gsk99z7x568h9894lev3muwynay65v4n0npnwn82tazsv47mq33q2v20a2", "abstract:ans-host": "osmo1wx0qjtlz799pfxl73y2f4dv28nukztpmq2ztavk60v534tat9cdsepnezp", - "abstract:dex": "osmo1s8nvehqc0jf99ac2qqg0sqja5ydzxlvht3eml9swl3n736tz9dsqfc4wa4", + "abstract:cw-staking": "osmo13kp8fv0t869zcwjh9q52eygxf8w0d8anmzhgrrz5tjju9uw3fscq9mhw4u", + "abstract:dex": "osmo1n2kmtqru87hzp905qsc20wkn8kras38eqcefddn3yjah63hza55sv4ysng", + "abstract:dex-local-9": "osmo1n2kmtqru87hzp905qsc20wkn8kras38eqcefddn3yjah63hza55sv4ysng", "abstract:ibc-client": "osmo1vnt8tpxrnukcydma2x6gy2zzawl9uxmc6las8cak9sd87q67n00qn0wkj7", "abstract:ibc-host": "osmo1zzgxwn88a3ec34fw4mu8ppsh9eth746l3tl8w5l7qvknrmtldldqz7saee", "abstract:module-factory": "osmo1vnj802lyyupfaez73w7axfs3xveraxen370vhcnumaufj29r5rxqcxdtus", @@ -25,16 +31,21 @@ "code_ids": { "abstract:account": 8373, "abstract:ans-host": 8231, + "abstract:dex": 8372, "abstract:ibc-client": 8233, "abstract:ibc-host": 8234, "abstract:module-factory": 8229, + "abstract:ping-pong": 8327, "abstract:registry": 8230, "cw:blob": 7399 }, "default": { "abstract:account-local-0": "neutron12x9fcuwl382vv9l22dkcvcx6uxpeqy9rq5fe3jt8cgvqkyjnj2hs5da0m4", "abstract:account-local-1": "neutron1mxahhvpj467088td8lvysyw7m8v880tzls0sxk0zuljn6tsufqksy8whnv", + "abstract:account-local-71": "neutron1pn4l8vtvvc2gtz8hj5y4rwv2r20hq2pcnn9rnamhppth4vqsyyds2hqmqp", "abstract:ans-host": "neutron1wx0qjtlz799pfxl73y2f4dv28nukztpmq2ztavk60v534tat9cdsdn69ty", + "abstract:dex": "neutron10hr9m68uh3h2qn8tgsc370zhwsu0wsjz688xpnr6jgyh567wkrpqcv5pzv", + "abstract:dex-local-71": "neutron10hr9m68uh3h2qn8tgsc370zhwsu0wsjz688xpnr6jgyh567wkrpqcv5pzv", "abstract:ibc-client": "neutron1n9la68zja4l76plwffedj24ar3f6e5kg7j92r26hhzewncghypvs9vk28k", "abstract:ibc-host": "neutron1c67x66rln9mgrjum5urrgn0tjvup5k9uke8hgdm8tu7hztwrjy4s5ecrmu", "abstract:module-factory": "neutron1vnj802lyyupfaez73w7axfs3xveraxen370vhcnumaufj29r5rxqv5yh44", @@ -61,20 +72,31 @@ "abstract:registry": "cosmos1cag6cwygef6fuddgq2l44py7crpscufrza4mt3rum2axueemenmq7u74fa" } }, + "uni-6": { + "code_ids": {}, + "default": {} + }, "xion-testnet-1": { "code_ids": { "abstract:account": 1373, "abstract:ans-host": 1372, + "abstract:calendar": 1389, + "abstract:challenge": 1390, + "abstract:dex": 1393, "abstract:ibc-client": 1374, "abstract:ibc-host": 1375, "abstract:module-factory": 1370, + "abstract:payment": 1394, + "abstract:ping-pong": 1391, "abstract:registry": 1371, + "abstract:subscription": 1392, "cw:blob": 1278 }, "default": { "abstract:account-local-0": "xion10wvm0t3de2k23x6da6whwy30p3prt4gx3fx3klcjw36hgrjd44wsf86jwl", "abstract:account-local-1": "xion1dnymc7khmeq9ya3hjs45cthwp3gnvpl2gynw0dvw6hyxv7enj6uqj8mf9p", "abstract:ans-host": "xion1wx0qjtlz799pfxl73y2f4dv28nukztpmq2ztavk60v534tat9cdskfcdvu", + "abstract:dex": "xion1rx2pvplyue5u2slmxkpzans0htmhansl47k3fk4yl6anha0nvs4qr800c3", "abstract:ibc-client": "xion1e74x0upzwsjvt6p8t5wu33cdnavsn5kcl6ndf8l2hpeah9c94tfqs6lx3w", "abstract:ibc-host": "xion14rwy72dckjtpvtw26yppgfr6jqw4y06tf68axefzk5xjplm9ue6qvtqxjl", "abstract:module-factory": "xion1vnj802lyyupfaez73w7axfs3xveraxen370vhcnumaufj29r5rxqhwxljd", diff --git a/modules/Cargo.toml b/modules/Cargo.toml index 232e132e71..048abb717a 100644 --- a/modules/Cargo.toml +++ b/modules/Cargo.toml @@ -1,6 +1,10 @@ [workspace] exclude = ["contracts/apps/croncat", "contracts/apps/dca"] -members = ["contracts/apps/*", "contracts/adapters/*", "contracts/standalones/*"] +members = [ + "contracts/apps/*", + "contracts/adapters/*", + "contracts/standalones/*", +] resolver = "2" @@ -22,63 +26,67 @@ version = "0.25.0" cosmwasm-schema = { version = "2.0" } -cosmwasm-std = { version = "2.0" } +cosmwasm-std = { version = "2.0" } cw-address-like = { version = "2.0" } -cw-asset = { version = "4.0" } -cw-controllers = { version = "2.0" } -cw-ownable = { version = "2.0" } -cw-plus-orch = { version = "0.25.0" } +cw-asset = { version = "4.0" } +cw-controllers = { version = "2.0" } +cw-ownable = { version = "2.0" } +cw-plus-orch = { version = "0.25.0" } cw-storage-plus = "2.0.0" -cw-utils = { version = "2.0" } -cw2 = { version = "2.0" } -cw20 = { version = "2.0.0" } -cw20-base = { features = ["library"], version = "2.0.0" } - -protobuf = { version = "2", features = ["with-bytes"] } -schemars = "0.8" -serde = { version = "1.0", default-features = false, features = ["derive"] } +cw-utils = { version = "2.0" } +cw2 = { version = "2.0" } +cw20 = { version = "2.0.0" } +cw20-base = { features = ["library"], version = "2.0.0" } + +protobuf = { version = "2", features = ["with-bytes"] } +schemars = "0.8" +serde = { version = "1.0", default-features = false, features = ["derive"] } thiserror = { version = "1.0.50" } chrono = { version = "0.4.31", default-features = false } -clap = { version = "4.0.32", features = ["derive"] } +clap = { version = "4.0.32", features = ["derive"] } semver = "1.0" -cw-orch = { version = "0.27.0" } -cw-orch-interchain = { version = "0.8.0" } -cw-orch-osmosis-test-tube = { version = "0.4.0" } -tokio = { version = "1.4", features = ["full"] } +cw-orch = { version = "0.27.0" } +cw-orch-interchain = { version = "0.8.0" } +cw-orch-osmosis-test-tube = { version = "0.5.0" } +cw-orch-neutron-test-tube = { version = "0.2.0" } +tokio = { version = "1.4", features = ["full"] } ## crates in order of publishing ## see docs/Publishing.md -abstract-adapter = { version = "0.25.0" } -abstract-app = { version = "0.25.0" } -abstract-client = { version = "0.25.0" } -abstract-interface = { version = "0.25.0" } -abstract-macros = { version = "0.25.0" } +abstract-adapter = { version = "0.25.0" } +abstract-app = { version = "0.25.0" } +abstract-client = { version = "0.25.0" } +abstract-interface = { version = "0.25.0" } +abstract-macros = { version = "0.25.0" } abstract-standalone = { version = "0.25.0" } -abstract-testing = { version = "0.25.0" } +abstract-testing = { version = "0.25.0" } +abstract-integration-tests = { path = "../framework/packages/abstract-integration-tests" } -abstract-adapter-utils = { version = "0.25.0" } -abstract-dex-standard = { version = "0.25.0" } +abstract-adapter-utils = { version = "0.25.0" } +abstract-dex-standard = { version = "0.25.0" } abstract-money-market-standard = { version = "0.25.0" } -abstract-staking-standard = { version = "0.25.0" } +abstract-staking-standard = { version = "0.25.0" } + # Integrations -abstract-astroport-adapter = { path = "../integrations/astroport-adapter", default-features = false } +abstract-astroport-adapter = { path = "../integrations/astroport-adapter", default-features = false } abstract-astrovault-adapter = { path = "../integrations/astrovault-adapter", default-features = false } -abstract-kujira-adapter = { path = "../integrations/kujira-adapter", default-features = false } -abstract-mars-adapter = { path = "../integrations/mars-adapter", default-features = false } -abstract-osmosis-adapter = { path = "../integrations/osmosis-adapter", default-features = false } -abstract-wyndex-adapter = { path = "../integrations/wyndex-adapter", default-features = false } +abstract-kujira-adapter = { path = "../integrations/kujira-adapter", default-features = false } +abstract-mars-adapter = { path = "../integrations/mars-adapter", default-features = false } +abstract-osmosis-adapter = { path = "../integrations/osmosis-adapter", default-features = false } +abstract-wyndex-adapter = { path = "../integrations/wyndex-adapter", default-features = false } +abstract-neutron-dex-adapter = { path = "../integrations/neutron-dex-adapter", default-features = false } -# wyndex-bundle = { path = "../integrations/bundles/wyndex" } +mockdex-bundle = { path = "../integrations/bundles/mockdex" } ## Modules -abstract-cw-staking = { path = "./contracts/adapters/cw-staking", default-features = false } +abstract-cw-staking = { path = "./contracts/adapters/cw-staking", default-features = false } abstract-dex-adapter = { path = "./contracts/adapters/dex", default-features = false } -challenge-app = { path = "./contracts/apps/challenge", default-features = false } -croncat-app = { path = "./contracts/apps/croncat", default-features = false } -dca-app = { path = "./contracts/apps/dca", default-features = false } +challenge-app = { path = "./contracts/apps/challenge", default-features = false } +croncat-app = { path = "./contracts/apps/croncat", default-features = false } +dca-app = { path = "./contracts/apps/dca", default-features = false } ## Testing anyhow = "1" @@ -86,19 +94,19 @@ rstest = "0.17.0" # this ensures local compatability when compiling locally [patch.crates-io] -abstract-adapter = { path = "../framework/packages/abstract-adapter" } -abstract-adapter-utils = { path = "../framework/packages/standards/utils" } -abstract-app = { path = "../framework/packages/abstract-app" } -abstract-client = { path = "../framework/packages/abstract-client" } -abstract-dex-standard = { path = "../framework/packages/standards/dex" } -abstract-interface = { path = "../framework/packages/abstract-interface" } -abstract-macros = { path = "../framework/packages/abstract-macros" } +abstract-adapter = { path = "../framework/packages/abstract-adapter" } +abstract-adapter-utils = { path = "../framework/packages/standards/utils" } +abstract-app = { path = "../framework/packages/abstract-app" } +abstract-client = { path = "../framework/packages/abstract-client" } +abstract-dex-standard = { path = "../framework/packages/standards/dex" } +abstract-interface = { path = "../framework/packages/abstract-interface" } +abstract-macros = { path = "../framework/packages/abstract-macros" } abstract-money-market-standard = { path = "../framework/packages/standards/money-market" } -abstract-sdk = { path = "../framework/packages/abstract-sdk" } -abstract-staking-standard = { path = "../framework/packages/standards/staking" } -abstract-standalone = { path = "../framework/packages/abstract-standalone" } -abstract-std = { path = "../framework/packages/abstract-std" } -abstract-testing = { path = "../framework/packages/abstract-testing" } +abstract-sdk = { path = "../framework/packages/abstract-sdk" } +abstract-staking-standard = { path = "../framework/packages/standards/staking" } +abstract-standalone = { path = "../framework/packages/abstract-standalone" } +abstract-std = { path = "../framework/packages/abstract-std" } +abstract-testing = { path = "../framework/packages/abstract-testing" } # In case polytone not released # abstract-polytone = { git = "https://github.com/AbstractSDK/polytone.git", branch = "bump/cw2" } @@ -107,12 +115,12 @@ abstract-testing = { path = "../framework/packages/abstract-testin # Backup release profile, will result in warnings during optimization [profile.release] -codegen-units = 1 -debug = false +codegen-units = 1 +debug = false debug-assertions = false -incremental = false -lto = true -opt-level = 3 -overflow-checks = true -panic = 'abort' -rpath = false +incremental = false +lto = true +opt-level = 3 +overflow-checks = true +panic = 'abort' +rpath = false diff --git a/modules/artifacts/abstract_cw_staking-archway.wasm b/modules/artifacts/abstract_cw_staking-archway.wasm index 03714663b4..4ba307e38e 100644 Binary files a/modules/artifacts/abstract_cw_staking-archway.wasm and b/modules/artifacts/abstract_cw_staking-archway.wasm differ diff --git a/modules/artifacts/abstract_cw_staking-juno.wasm b/modules/artifacts/abstract_cw_staking-juno.wasm new file mode 100644 index 0000000000..a1316bf0a9 Binary files /dev/null and b/modules/artifacts/abstract_cw_staking-juno.wasm differ diff --git a/modules/artifacts/abstract_cw_staking-kujira.wasm b/modules/artifacts/abstract_cw_staking-kujira.wasm new file mode 100644 index 0000000000..4cdd88cf36 Binary files /dev/null and b/modules/artifacts/abstract_cw_staking-kujira.wasm differ diff --git a/modules/artifacts/abstract_cw_staking-osmosis.wasm b/modules/artifacts/abstract_cw_staking-osmosis.wasm index d8af4c35ab..636374483a 100644 Binary files a/modules/artifacts/abstract_cw_staking-osmosis.wasm and b/modules/artifacts/abstract_cw_staking-osmosis.wasm differ diff --git a/modules/artifacts/abstract_cw_staking.wasm b/modules/artifacts/abstract_cw_staking.wasm index 3ec41c52f0..cca0bc5197 100644 Binary files a/modules/artifacts/abstract_cw_staking.wasm and b/modules/artifacts/abstract_cw_staking.wasm differ diff --git a/modules/artifacts/abstract_dex_adapter-archway.wasm b/modules/artifacts/abstract_dex_adapter-archway.wasm index 057d61d36b..fb546d8baa 100644 Binary files a/modules/artifacts/abstract_dex_adapter-archway.wasm and b/modules/artifacts/abstract_dex_adapter-archway.wasm differ diff --git a/modules/artifacts/abstract_dex_adapter-juno.wasm b/modules/artifacts/abstract_dex_adapter-juno.wasm new file mode 100644 index 0000000000..27792e87f8 Binary files /dev/null and b/modules/artifacts/abstract_dex_adapter-juno.wasm differ diff --git a/modules/artifacts/abstract_dex_adapter-kujira.wasm b/modules/artifacts/abstract_dex_adapter-kujira.wasm new file mode 100644 index 0000000000..4dca568b7f Binary files /dev/null and b/modules/artifacts/abstract_dex_adapter-kujira.wasm differ diff --git a/modules/artifacts/abstract_dex_adapter-neutron.wasm b/modules/artifacts/abstract_dex_adapter-neutron.wasm new file mode 100644 index 0000000000..72c242ddfd Binary files /dev/null and b/modules/artifacts/abstract_dex_adapter-neutron.wasm differ diff --git a/modules/artifacts/abstract_dex_adapter-osmosis.wasm b/modules/artifacts/abstract_dex_adapter-osmosis.wasm index f499350dbd..a3d5bcc6fa 100644 Binary files a/modules/artifacts/abstract_dex_adapter-osmosis.wasm and b/modules/artifacts/abstract_dex_adapter-osmosis.wasm differ diff --git a/modules/artifacts/abstract_dex_adapter.wasm b/modules/artifacts/abstract_dex_adapter.wasm index 59b9fcbbbc..73570e725c 100644 Binary files a/modules/artifacts/abstract_dex_adapter.wasm and b/modules/artifacts/abstract_dex_adapter.wasm differ diff --git a/modules/artifacts/abstract_money_market_adapter-kujira.wasm b/modules/artifacts/abstract_money_market_adapter-kujira.wasm new file mode 100644 index 0000000000..ffdcadc8f1 Binary files /dev/null and b/modules/artifacts/abstract_money_market_adapter-kujira.wasm differ diff --git a/modules/artifacts/abstract_money_market_adapter.wasm b/modules/artifacts/abstract_money_market_adapter.wasm index f7d2e90677..a9c7a61b84 100644 Binary files a/modules/artifacts/abstract_money_market_adapter.wasm and b/modules/artifacts/abstract_money_market_adapter.wasm differ diff --git a/modules/artifacts/abstract_subscription.wasm b/modules/artifacts/abstract_subscription.wasm index 89b4298c48..c76b404736 100644 Binary files a/modules/artifacts/abstract_subscription.wasm and b/modules/artifacts/abstract_subscription.wasm differ diff --git a/modules/artifacts/abstract_tendermint_staking_adapter.wasm b/modules/artifacts/abstract_tendermint_staking_adapter.wasm index cf6bf63ba7..fae0a19c80 100644 Binary files a/modules/artifacts/abstract_tendermint_staking_adapter.wasm and b/modules/artifacts/abstract_tendermint_staking_adapter.wasm differ diff --git a/modules/artifacts/calendar_app.wasm b/modules/artifacts/calendar_app.wasm index e45a1ea0f7..018c4cc52f 100644 Binary files a/modules/artifacts/calendar_app.wasm and b/modules/artifacts/calendar_app.wasm differ diff --git a/modules/artifacts/challenge_app.wasm b/modules/artifacts/challenge_app.wasm index c45bf68488..1a5d47f175 100644 Binary files a/modules/artifacts/challenge_app.wasm and b/modules/artifacts/challenge_app.wasm differ diff --git a/modules/artifacts/checksums.txt b/modules/artifacts/checksums.txt index 6534c6956a..3062fb0480 100644 --- a/modules/artifacts/checksums.txt +++ b/modules/artifacts/checksums.txt @@ -1,14 +1,20 @@ -20c582f13c282a8470ed2ced42d5aa6ec6bfe2ac5ce4ff38f634816e21a6713c abstract_cw_staking-archway.wasm -342ecabbfb0ce94155ce53381af5c444b7886ea472c372d2523a33a83a55f333 abstract_cw_staking-osmosis.wasm -2224e95be3dd4c2aed834750a97f92450f7009e08542483c5dca49ba658d6b0b abstract_cw_staking.wasm -398336f31da53dc21f2794f9959cf3d4a0eec9ffcf6c442978808df2ba0baedb abstract_dex_adapter-archway.wasm -d8a0a30b8e1f6b702b55919ff3fbc9cefa0154e972523a9db2b1f19f7699b045 abstract_dex_adapter-osmosis.wasm -d5734b8b52202e3e47821d057ef3a8c0e5bb8ca0671f292d1d4f93dd9b70399f abstract_dex_adapter.wasm -664319145475f9f3733c0c5882a9aeac98af4ac7a388e48b085e9bc8ec405d11 abstract_money_market_adapter.wasm -419573ce2c08dd8c2300bdfa621dd008707b442c8ea9094dbfc49105c38cf83d abstract_subscription.wasm -acc1c14e732692868bf78782f4a55c44f0278a765df0a2fd1150b172d95e9628 abstract_tendermint_staking_adapter.wasm -6f7243cbf93c33de8809ba57bbd77c77a9c35728213216c13065d70c79786759 calendar_app.wasm -c7a244ea81085fca7777905664a57b8f5bfea4ad827684ebdf90100a58a07adb challenge_app.wasm -2e1d190d69d544e369a61b58391879b61458f9d22c5848a052e2bd6e1336fc1c my_standalone.wasm -da4fb9432373ad73655afb2d360822ecc70c4017a313a49efc6d07b7c2394093 payment_app.wasm -40e2a0cf2287cb302775ad68495b0d902290d2734dc473a1ad22bf8db0402a7c ping_pong.wasm +3465890d47f86909245cee4febedaada0d8662334f49564b9a925e7faab656bb abstract_cw_staking-archway.wasm +d65981fe07b945c818e626aaa42b106a435c01134b327083f0e60d35b59a4449 abstract_cw_staking-juno.wasm +1b1a765f3f1e9846c370b69947b127d78005bf69536ebbfe2ceb595ea3f2f31e abstract_cw_staking-kujira.wasm +d429d03841221944c82d23baa898c4b67f624fa36a0242735d0e993017b3be7f abstract_cw_staking-osmosis.wasm +24a326b0bb67ceb7351a1c31c05f232d4563a434a96a3bdf1aec450d6c5eef7e abstract_cw_staking.wasm +4bf30951308c04d8cca9d914fdf60cca0bbaca840a6a1e97926c92643b7f69ba abstract_dex_adapter-archway.wasm +f768a6ffa26dd2346652e75b1e16549fa8acfa94f32c857d0c9643afe1ff247f abstract_dex_adapter-juno.wasm +65634dfbc134eea746046ac4783c3a522c2b52274fdecb15955c0fcee4e4278d abstract_dex_adapter-kujira.wasm +d60cabc6f0073c2ea18e3126f58d4f68165df1835ea3a8165a6e2ac2c09b164c abstract_dex_adapter-neutron.wasm +76b9113fce39cffd97c82fb45a120055bc382cef10e6c6df405167af460c10e8 abstract_dex_adapter-osmosis.wasm +3611271b687b68776ed8c8c7aa4942627eec1b0562c3cd7765c6754363100670 abstract_dex_adapter.wasm +b23ad6746a4f431c1eb45e60091c671b1d06858fd05b3a7b1db2f7c4e9f5de55 abstract_money_market_adapter-kujira.wasm +4ae70c5e620b6b478a2745adf82cfdbbf457ef41cd9669a80a4d86d55dda351e abstract_money_market_adapter.wasm +7f7b34748073364461fb62d59d7889b3bff7c4f2609511d78efd429a8a664e55 abstract_subscription.wasm +b790018ab4e3bb36dba5f3afcde46dafbabc1ffaa23d572079bce233ad5f345a abstract_tendermint_staking_adapter.wasm +f092c38e0bebf5c7485f3167057ae7beddff51128c46734a459a1ef707cc1c34 calendar_app.wasm +4ebe8b0497b6f13314f2c5199661223ecf23abaeb7edd511fd9fc6e98539cd7b challenge_app.wasm +21efcb993ad279ae5cc1441941f69cb5abe1a5941896631fb158a5b6cc45d7c1 my_standalone.wasm +100d217ae7b0be33d4db945ab7af812d6bbb3742579194154effa868599aa905 payment_app.wasm +f28ab7af12ed378e7c485130a7727cbd9dee50eb94913568de3e85aa44011f7c ping_pong.wasm diff --git a/modules/artifacts/my_standalone.wasm b/modules/artifacts/my_standalone.wasm index 255eee9bc0..f2e91f6ddf 100644 Binary files a/modules/artifacts/my_standalone.wasm and b/modules/artifacts/my_standalone.wasm differ diff --git a/modules/artifacts/payment_app.wasm b/modules/artifacts/payment_app.wasm index 05679c454f..ede9c804d8 100644 Binary files a/modules/artifacts/payment_app.wasm and b/modules/artifacts/payment_app.wasm differ diff --git a/modules/artifacts/ping_pong.wasm b/modules/artifacts/ping_pong.wasm index 96aa654d57..2bbbeda528 100644 Binary files a/modules/artifacts/ping_pong.wasm and b/modules/artifacts/ping_pong.wasm differ diff --git a/modules/contracts/adapters/cw-staking/Cargo.toml b/modules/contracts/adapters/cw-staking/Cargo.toml index 9b198bee25..efa77b31a4 100644 --- a/modules/contracts/adapters/cw-staking/Cargo.toml +++ b/modules/contracts/adapters/cw-staking/Cargo.toml @@ -32,20 +32,20 @@ export = [] osmosis-test = ["dep:cw-orch-osmosis-test-tube"] schema = ["abstract-adapter/schema"] testing = ["dep:abstract-client", "dep:cw20", "abstract-adapter/test-utils"] +local = ["abstract-astrovault-adapter/local", "abstract-kujira-adapter/local","abstract-wyndex-adapter/local"] + # Supported Dexes -# wynd = ["abstract-wyndex-adapter/full_integration", "dep:cw-controllers"] osmosis = ["abstract-osmosis-adapter/full_integration"] +wynd = ["abstract-wyndex-adapter/full_integration"] # astroport = ["abstract-astroport-adapter/full_integration"] -# bow = ["abstract-kujira-adapter/full_integration"] astrovault = ["abstract-astrovault-adapter/full_integration"] +bow = ["abstract-kujira-adapter/full_integration"] # Builds [package.metadata.optimizer] builds = [ - # { name = "juno", features = [ - # "wynd", - # ] }, + { name = "juno", features = ["wynd"] }, # { name = "terra2", features = [ # "astroport", # ] }, @@ -53,9 +53,7 @@ builds = [ # "astroport", # ] }, { name = "osmosis", features = ["osmosis"] }, - # { name = "kujira", features = [ - # "bow", - # ] }, + { name = "kujira", features = ["bow"] }, # { name = "injective", features = [ # "astroport", # ] }, @@ -69,11 +67,7 @@ builds = [ cosmwasm-schema = { workspace = true } cosmwasm-std = { workspace = true } cw-asset = { workspace = true } -cw-controllers = { workspace = true, optional = true } cw-utils = { workspace = true } -schemars = { workspace = true } -serde = { workspace = true } -thiserror = { workspace = true } abstract-adapter = { workspace = true } cw-orch = { workspace = true } @@ -84,7 +78,7 @@ abstract-adapter-utils = { workspace = true } abstract-staking-standard = { workspace = true } # # Juno dexes # -# abstract-wyndex-adapter = { workspace = true } +abstract-wyndex-adapter = { workspace = true } # # Osmosis # abstract-osmosis-adapter = { workspace = true } @@ -92,8 +86,8 @@ abstract-osmosis-adapter = { workspace = true } # # Terra # # abstract-astroport-adapter = { workspace = true } -# # Kujira # -# abstract-kujira-adapter = { workspace = true } +# Kujira # +abstract-kujira-adapter = { workspace = true } # Astrovault # abstract-astrovault-adapter = { workspace = true } @@ -104,22 +98,25 @@ cw20 = { workspace = true, optional = true } [dev-dependencies] abstract-adapter = { workspace = true, features = ["test-utils"] } +abstract-integration-tests = { workspace = true } anyhow = { workspace = true } +bip32 = { version = "0.5.2" } clap = { workspace = true } cw-orch = { workspace = true, features = ["daemon"] } cw-staking = { path = ".", package = "abstract-cw-staking", features = [ - # "wynd", + "wynd", "osmosis", "testing", + "local" ] } +cw20 = { workspace = true } +cw20-base = { workspace = true } dotenv = "0.15.0" env_logger = "0.11.3" log = "0.4.14" +mockdex-bundle = { workspace = true } semver = { version = "1.0" } +serde-cw-value = "0.7.0" tokio = { version = "1.4", features = ["full"] } -# wyndex-bundle = { workspace = true } -bip32 = { version = "0.5.2" } -cw20 = { workspace = true } -cw20-base = { workspace = true } +abstract-client = {workspace = true, features = ["test-utils"]} -serde-cw-value = "0.7.0" diff --git a/modules/contracts/adapters/cw-staking/examples/deploy.rs b/modules/contracts/adapters/cw-staking/examples/deploy.rs index a0f5160bfa..3ed5745ef4 100644 --- a/modules/contracts/adapters/cw-staking/examples/deploy.rs +++ b/modules/contracts/adapters/cw-staking/examples/deploy.rs @@ -1,13 +1,12 @@ use abstract_adapter::abstract_interface::{ - AdapterDeployer, DeployStrategy, Registry, RegistryExecFns, + Abstract, AdapterDeployer, DeployStrategy, RegistryExecFns, }; use abstract_adapter::std::{ adapter, objects::module::{Module, ModuleInfo, ModuleVersion}, - REGISTRY, }; use abstract_cw_staking::{interface::CwStakingAdapter, CW_STAKING_ADAPTER_ID}; -use cosmwasm_std::{Addr, Empty}; +use cosmwasm_std::Empty; use cw_orch::{daemon::DaemonBuilder, prelude::*}; const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION"); @@ -17,17 +16,12 @@ fn deploy_cw_staking( prev_version: Option, code_id: Option, ) -> anyhow::Result<()> { - let rt = tokio::runtime::Runtime::new().unwrap(); - let chain = DaemonBuilder::new(network).handle(rt.handle()).build()?; + let chain = DaemonBuilder::new(network).build()?; - let registry = Registry::new(REGISTRY, chain.clone()); - // TODO: it's known address - registry.set_address(&Addr::unchecked( - std::env::var("REGISTRY").expect("REGISTRY not set"), - )); + let abstr = Abstract::load_from(chain.clone())?; if let Some(prev_version) = prev_version { - let Module { info, reference } = registry.module(ModuleInfo::from_id( + let Module { info, reference } = abstr.registry.module(ModuleInfo::from_id( CW_STAKING_ADAPTER_ID, ModuleVersion::from(prev_version), )?)?; @@ -36,21 +30,23 @@ fn deploy_cw_staking( version: ModuleVersion::from(CONTRACT_VERSION), ..info }; - registry.propose_modules(vec![(new_info, reference)])?; + abstr + .registry + .propose_modules(vec![(new_info, reference)])?; } else if let Some(code_id) = code_id { let mut cw_staking = CwStakingAdapter::new(CW_STAKING_ADAPTER_ID, chain); cw_staking.set_code_id(code_id); let init_msg = adapter::InstantiateMsg { module: Empty {}, base: adapter::BaseInstantiateMsg { - registry_address: registry.addr_str()?, + registry_address: abstr.registry.addr_str()?, }, }; cw_staking .as_instance_mut() .instantiate(&init_msg, None, &[])?; - registry.register_adapters(vec![( + abstr.registry.register_adapters(vec![( cw_staking.as_instance_mut(), CONTRACT_VERSION.to_string(), )])?; diff --git a/modules/contracts/adapters/cw-staking/src/resolver.rs b/modules/contracts/adapters/cw-staking/src/resolver.rs index c2c9cd1714..d20e5e5583 100644 --- a/modules/contracts/adapters/cw-staking/src/resolver.rs +++ b/modules/contracts/adapters/cw-staking/src/resolver.rs @@ -11,23 +11,23 @@ use crate::contract::StakingResult; /// This provides superior UX in case of an IBC execution pub(crate) fn identify_provider(value: &str) -> Result, CwStakingError> { match value { + abstract_wyndex_adapter::WYNDEX => { + Ok(Box::::default()) + } // TODO: revive integrations - // abstract_wyndex_adapter::WYNDEX => { - // Ok(Box::::default()) - // } // abstract_astroport_adapter::ASTROPORT => { // Ok(Box::::default()) // } - // abstract_kujira_adapter::staking::BOW => { - // Ok(Box::::default()) - // } + abstract_kujira_adapter::staking::BOW => { + Ok(Box::::default()) + } abstract_osmosis_adapter::OSMOSIS => { Ok(Box::::default()) } abstract_astrovault_adapter::ASTROVAULT => { Ok(Box::::default()) } - _ => Err(CwStakingError::UnknownDex(value.to_string())), + _ => Err(CwStakingError::UnknownStaking(value.to_string())), } } @@ -56,7 +56,7 @@ pub(crate) fn resolve_local_provider( abstract_astrovault_adapter::ASTROVAULT => { Ok(Box::::default()) } - _ => Err(CwStakingError::ForeignDex(name.to_owned())), + _ => Err(CwStakingError::ForeignStaking(name.to_owned())), } } @@ -69,7 +69,10 @@ pub fn is_over_ibc(env: &Env, platform_name: &str) -> StakingResult<(String, boo let platform_id = identify_provider(&local_platform_name)?; // We verify the adapter is available on the current chain if !is_available_on(platform_id, env, chain_name.as_deref()) { - return Err(CwStakingError::UnknownDex(platform_name.to_string())); + return Err(CwStakingError::UnknownStakingOnThisPlatform { + staking: platform_name.to_string(), + chain: chain_name, + }); } Ok((local_platform_name, false)) } diff --git a/modules/contracts/adapters/cw-staking/tests/common/mod.rs b/modules/contracts/adapters/cw-staking/tests/common/mod.rs deleted file mode 100644 index d53992ec99..0000000000 --- a/modules/contracts/adapters/cw-staking/tests/common/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub const ROOT_USER: &str = "root_user"; diff --git a/modules/contracts/adapters/cw-staking/tests/osmosis_stake.rs b/modules/contracts/adapters/cw-staking/tests/osmosis_stake.rs index ead96a9d6c..2a62ec2911 100644 --- a/modules/contracts/adapters/cw-staking/tests/osmosis_stake.rs +++ b/modules/contracts/adapters/cw-staking/tests/osmosis_stake.rs @@ -1,44 +1,26 @@ -#![allow(unused)] #![cfg(feature = "osmosis-test")] -mod common; - mod osmosis_test { - use std::path::PathBuf; - use std::rc::Rc; use abstract_adapter::abstract_interface::{ Abstract, AbstractInterfaceError, AccountI, AdapterDeployer, DeployStrategy, - RegisteredModule, }; - use abstract_adapter::objects::dependency::StaticDependency; use abstract_adapter::std::{ - adapter, ans_host::ExecuteMsgFns, - objects::{ - pool_id::PoolAddressBase, AccountId, AnsAsset, AssetEntry, PoolMetadata, PoolType, - }, + objects::{pool_id::PoolAddressBase, AnsAsset, AssetEntry, PoolMetadata, PoolType}, }; - use abstract_adapter::traits::{Dependencies, ModuleIdentification}; use abstract_client::GovernanceDetails; use abstract_cw_staking::interface::CwStakingAdapter; - use abstract_cw_staking::{ - contract::CONTRACT_VERSION, - msg::{ - ExecuteMsg, InstantiateMsg, QueryMsg, RewardTokensResponse, StakingAction, - StakingExecuteMsg, StakingQueryMsgFns, - }, - }; + use abstract_cw_staking::{contract::CONTRACT_VERSION, msg::StakingQueryMsgFns}; use abstract_staking_standard::{ msg::{StakingInfo, StakingInfoResponse}, CwStakingError, }; - use cosmwasm_std::{coin, coins, from_json, to_json_binary, Addr, Empty, Uint128}; + use cosmwasm_std::{coin, coins, from_json, to_json_binary, Empty, Uint128}; use cw_asset::AssetInfoBase; - use cw_orch_osmosis_test_tube::osmosis_test_tube::Account; use cw_orch_osmosis_test_tube::osmosis_test_tube::{ osmosis_std::{ - shim::{Duration, Timestamp}, + shim::Timestamp, types::osmosis::{ incentives::{MsgAddToGauge, MsgCreateGauge, QueryLockableDurationsRequest}, lockup::{ @@ -48,11 +30,11 @@ mod osmosis_test { poolincentives::v1beta1::QueryGaugeIdsRequest, }, }, - Module, OsmosisTestApp, Runner, + Module, Runner, }; use cw_orch_osmosis_test_tube::OsmosisTestTube; - use cw_orch::{interface, prelude::*}; + use cw_orch::prelude::*; const OSMOSIS: &str = "osmosis"; const DENOM: &str = "uosmo"; @@ -68,83 +50,6 @@ mod osmosis_test { format!("gamm/pool/{}", id) } - /// Stake using Abstract's OS (registered in daemon_state). - pub fn stake( - stake_assets: Vec, - provider: String, - duration: Option, - account: &AccountI, - ) -> Result<(), AbstractInterfaceError> { - let stake_msg = ExecuteMsg::Module(adapter::AdapterRequestMsg { - account_address: None, - request: StakingExecuteMsg { - provider, - action: StakingAction::Stake { - assets: stake_assets, - unbonding_period: duration, - }, - }, - }); - account.execute_on_module(CW_STAKING_ADAPTER_ID, stake_msg, vec![])?; - Ok(()) - } - - pub fn unstake( - stake_assets: Vec, - provider: String, - duration: Option, - account: &AccountI, - ) -> Result<(), AbstractInterfaceError> { - let stake_msg = ExecuteMsg::Module(adapter::AdapterRequestMsg { - account_address: None, - request: StakingExecuteMsg { - provider, - action: StakingAction::Unstake { - assets: stake_assets, - unbonding_period: duration, - }, - }, - }); - account.execute_on_module(CW_STAKING_ADAPTER_ID, stake_msg, vec![])?; - Ok(()) - } - - pub fn claim( - stake_assets: Vec, - provider: String, - account: &AccountI, - ) -> Result<(), AbstractInterfaceError> { - let claim_msg = ExecuteMsg::Module(adapter::AdapterRequestMsg { - account_address: None, - request: StakingExecuteMsg { - provider, - action: StakingAction::Claim { - assets: stake_assets, - }, - }, - }); - account.execute_on_module(CW_STAKING_ADAPTER_ID, claim_msg, vec![])?; - Ok(()) - } - - pub fn claim_rewards( - stake_assets: Vec, - provider: String, - account: &AccountI, - ) -> Result<(), AbstractInterfaceError> { - let claim_rewards_msg = ExecuteMsg::Module(adapter::AdapterRequestMsg { - account_address: None, - request: StakingExecuteMsg { - provider, - action: StakingAction::ClaimRewards { - assets: stake_assets, - }, - }, - }); - account.execute_on_module(CW_STAKING_ADAPTER_ID, claim_rewards_msg, vec![])?; - Ok(()) - } - fn setup_osmosis() -> anyhow::Result<( OsmosisTestTube, u64, @@ -152,7 +57,7 @@ mod osmosis_test { AccountI, )> { std::env::set_var("RUST_LOG", "debug"); - let _ = env_logger::try_init().unwrap(); + let _ = env_logger::try_init(); let tube = OsmosisTestTube::new(vec![ coin(1_000_000_000_000, ASSET_2), coin(1_000_000_000_000, ASSET_1), @@ -257,17 +162,12 @@ mod osmosis_test { tube.wait_seconds(10000)?; // query stake - let res = staking.staked( + staking.staked( OSMOSIS.into(), account_addr.to_string(), vec![AssetEntry::new(LP)], dur, - ); - - // TODO: something needs to be version bumped for it to work - // It's already supported on osmosis - // assert_that!(res.unwrap_err().to_string()) - // .contains(CwStakingError::NotImplemented("osmosis".to_owned()).to_string()); + )?; let staked_balance: AccountLockedCoinsResponse = tube.app.borrow().query( "/osmosis.lockup.Query/AccountLockedCoins", @@ -382,7 +282,6 @@ mod osmosis_test { #[test] fn concentrated_liquidity() -> anyhow::Result<()> { let (tube, _, staking, os) = setup_osmosis()?; - let account_addr = os.address()?; let lp = "osmosis/osmo2,atom2"; // transfer some LP tokens to the AccountI, as if it provided liquidity @@ -442,10 +341,9 @@ mod osmosis_test { #[test] fn reward_tokens_add_to_gauge() -> anyhow::Result<()> { - let (mut chain, pool_id, staking, os) = setup_osmosis()?; + let (mut chain, pool_id, staking, _account) = setup_osmosis()?; // For gauge chain.add_balance(&chain.sender_addr(), coins(1_000_000_000_000, ASSET_1))?; - let account_addr = os.address()?; let test_tube = chain.app.borrow(); let incentives = super::incentives::Incentives::new(&*test_tube); @@ -460,10 +358,10 @@ mod osmosis_test { let gauge_id_for_refill = gauge_ids.gauge_ids_with_duration[0].gauge_id; // Now incentivize pool - let time = test_tube.get_block_timestamp().plus_seconds(5); - let lockable_durations = + let _time = test_tube.get_block_timestamp().plus_seconds(5); + let _lockable_durations = incentives.query_lockable_durations(&QueryLockableDurationsRequest {})?; - let res = incentives.add_to_gauge( + incentives.add_to_gauge( MsgAddToGauge { owner: chain.sender_addr().to_string(), gauge_id: gauge_id_for_refill, @@ -474,7 +372,7 @@ mod osmosis_test { }, &chain.sender, )?; - chain.wait_seconds(10); + chain.wait_seconds(10)?; let res = staking.reward_tokens(OSMOSIS.to_owned(), vec![AssetEntry::new(LP)])?; assert_eq!(res.tokens, [[AssetInfoBase::Native(ASSET_1.to_owned())]]); @@ -484,14 +382,13 @@ mod osmosis_test { #[test] #[ignore = "Currently broken, see https://github.com/osmosis-labs/test-tube/pull/53"] fn reward_tokens_create_gauge() -> anyhow::Result<()> { - let (mut chain, pool_id, staking, os) = setup_osmosis()?; + let (mut chain, pool_id, staking, _account) = setup_osmosis()?; // For gauge chain.add_balance(&chain.sender_addr(), coins(1_000_000_000_000, ASSET_1))?; - let account_addr = os.address()?; let test_tube = chain.app.borrow(); let incentives = super::incentives::Incentives::new(&*test_tube); - let poolincentives = super::poolincentives::Poolincentives::new(&*test_tube); + let _poolincentives = super::poolincentives::Poolincentives::new(&*test_tube); // Check that we have empty assets at start let res = staking.reward_tokens(OSMOSIS.to_owned(), vec![AssetEntry::new(LP)])?; @@ -501,7 +398,7 @@ mod osmosis_test { let time = test_tube.get_block_timestamp().plus_seconds(5); let lockable_durations = incentives.query_lockable_durations(&QueryLockableDurationsRequest {})?; - let res = incentives.create_gauge( + incentives.create_gauge( MsgCreateGauge { pool_id, is_perpetual: true, @@ -524,7 +421,7 @@ mod osmosis_test { }, &chain.sender, )?; - chain.wait_seconds(10); + chain.wait_seconds(10)?; let res = staking.reward_tokens(OSMOSIS.to_owned(), vec![AssetEntry::new(LP)])?; assert_eq!( diff --git a/modules/contracts/adapters/cw-staking/tests/stake.rs b/modules/contracts/adapters/cw-staking/tests/stake.rs index 4a5134db28..6935db4238 100644 --- a/modules/contracts/adapters/cw-staking/tests/stake.rs +++ b/modules/contracts/adapters/cw-staking/tests/stake.rs @@ -1,13 +1,9 @@ -#![cfg(feature = "TODO: replace wyndex_bundle")] -mod common; - -use abstract_adapter::abstract_interface::{ - Abstract, AbstractAccount, AdapterDeployer, DeployStrategy, -}; +use abstract_adapter::abstract_interface::{Abstract, AccountI, AdapterDeployer, DeployStrategy}; use abstract_adapter::std::{ adapter::BaseQueryMsgFns, objects::{module_version::ModuleDataResponse, AnsAsset, AssetEntry}, }; +use abstract_client::builder::cw20_builder::{ExecuteMsgInterfaceFns, QueryMsgInterfaceFns}; use abstract_cw_staking::{ contract::CONTRACT_VERSION, interface::CwStakingAdapter, msg::StakingQueryMsgFns, }; @@ -15,48 +11,45 @@ use abstract_staking_standard::msg::{ Claim, RewardTokensResponse, StakingInfo, StakingInfoResponse, UnbondingResponse, }; use cosmwasm_std::{coin, Uint128}; -use cw20::msg::Cw20ExecuteMsgFns; -use cw20_base::msg::QueryMsgFns; use cw_asset::AssetInfoBase; use cw_orch::prelude::*; -use wyndex_bundle::{EUR_USD_LP, WYNDEX as WYNDEX_WITHOUT_CHAIN, WYNDEX_OWNER, WYND_TOKEN}; +use mockdex_bundle::{EUR_USD_LP, WYNDEX as WYNDEX_WITHOUT_CHAIN, WYNDEX_OWNER, WYND_TOKEN}; const WYNDEX: &str = "cosmos-testnet>wyndex"; use abstract_cw_staking::CW_STAKING_ADAPTER_ID; -use common::create_default_account; +use abstract_integration_tests::create_default_account; fn setup_mock() -> anyhow::Result<( MockBech32, - wyndex_bundle::WynDex, + mockdex_bundle::WynDex, CwStakingAdapter, - AbstractAccount, + AccountI, )> { - let chain = MockBech32::new("mock"); + let chain = MockBech32::new_with_chain_id("mock", "cosmos-testnet-6"); let sender = chain.sender_addr(); - let deployment = Abstract::deploy_on(chain.clone(), sender.to_string())?; - let wyndex = wyndex_bundle::WynDex::store_on(chain.clone())?; + let deployment = Abstract::deploy_on(chain.clone(), ())?; + let wyndex = mockdex_bundle::WynDex::store_on(chain.clone())?; - let _root_os = create_default_account(&deployment.account_factory)?; + let _root_os = create_default_account(&sender, &deployment)?; let staking = CwStakingAdapter::new(CW_STAKING_ADAPTER_ID, chain.clone()); staking.deploy(CONTRACT_VERSION.parse()?, Empty {}, DeployStrategy::Try)?; - let os = create_default_account(&deployment.account_factory)?; - let account_addr = os.account.address()?; - let _account_addr = os.account.address()?; + let account = create_default_account(&sender, &deployment)?; + let account_addr = account.address()?; - // transfer some LP tokens to the AbstractAccount, as if it provided liquidity + // transfer some LP tokens to the AccountI, as if it provided liquidity wyndex .eur_usd_lp .call_as(&chain.addr_make(WYNDEX_OWNER)) .transfer(1000u128, account_addr.to_string())?; - // install exchange on AbstractAccount - os.install_adapter(&staking, None)?; + // install exchange on AccountI + account.install_adapter(&staking, &[])?; - Ok((chain, wyndex, staking, os)) + Ok((chain, wyndex, staking, account)) } #[test] @@ -65,23 +58,29 @@ fn staking_inited() -> anyhow::Result<()> { // query staking info let staking_info = staking.info(WYNDEX.into(), vec![AssetEntry::new(EUR_USD_LP)])?; - assert_that!(staking_info).is_equal_to(StakingInfoResponse { - infos: vec![StakingInfo { - staking_target: wyndex.eur_usd_staking.into(), - staking_token: AssetInfoBase::Cw20(wyndex.eur_usd_lp.address()?), - unbonding_periods: Some(vec![ - cw_utils::Duration::Time(1), - cw_utils::Duration::Time(2), - ]), - max_claims: None, - }], - }); + assert_eq!( + staking_info, + StakingInfoResponse { + infos: vec![StakingInfo { + staking_target: wyndex.eur_usd_staking.into(), + staking_token: AssetInfoBase::Cw20(wyndex.eur_usd_lp.address()?), + unbonding_periods: Some(vec![ + cw_utils::Duration::Time(1), + cw_utils::Duration::Time(2), + ]), + max_claims: None, + }], + } + ); // query reward tokens let reward_tokens = staking.reward_tokens(WYNDEX.into(), vec![AssetEntry::new(EUR_USD_LP)])?; - assert_that!(reward_tokens).is_equal_to(RewardTokensResponse { - tokens: vec![vec![AssetInfoBase::Native(WYND_TOKEN.to_owned())]], - }); + assert_eq!( + reward_tokens, + RewardTokensResponse { + tokens: vec![vec![AssetInfoBase::Native(WYND_TOKEN.to_owned())]], + } + ); let module_data = staking.module_data()?; assert_eq!( @@ -98,13 +97,18 @@ fn staking_inited() -> anyhow::Result<()> { #[test] fn stake_lp() -> anyhow::Result<()> { - let (_, _, staking, os) = setup_mock()?; - let account_addr = os.account.address()?; + let (_, _, staking, account) = setup_mock()?; + let account_addr = account.address()?; let dur = Some(cw_utils::Duration::Time(2)); // stake 100 EUR - staking.stake(AnsAsset::new(EUR_USD_LP, 100u128), WYNDEX.into(), dur, &os)?; + staking.stake( + AnsAsset::new(EUR_USD_LP, 100u128), + WYNDEX.into(), + dur, + &account, + )?; // query stake let staked_balance = staking.staked( @@ -113,15 +117,15 @@ fn stake_lp() -> anyhow::Result<()> { vec![AssetEntry::new(EUR_USD_LP)], dur, )?; - assert_that!(staked_balance.amounts[0].u128()).is_equal_to(100u128); + assert_eq!(staked_balance.amounts[0].u128(), 100u128); Ok(()) } #[test] -fn stake_lp_wthout_chain() -> anyhow::Result<()> { - let (_, _, staking, os) = setup_mock()?; - let account_addr = os.account.address()?; +fn stake_lp_without_chain() -> anyhow::Result<()> { + let (_, _, staking, account) = setup_mock()?; + let account_addr = account.address()?; let dur = Some(cw_utils::Duration::Time(2)); @@ -130,7 +134,7 @@ fn stake_lp_wthout_chain() -> anyhow::Result<()> { AnsAsset::new(EUR_USD_LP, 100u128), WYNDEX_WITHOUT_CHAIN.into(), dur, - &os, + &account, )?; // query stake @@ -140,20 +144,25 @@ fn stake_lp_wthout_chain() -> anyhow::Result<()> { vec![AssetEntry::new(EUR_USD_LP)], dur, )?; - assert_that!(staked_balance.amounts[0].u128()).is_equal_to(100u128); + assert_eq!(staked_balance.amounts[0].u128(), 100u128); Ok(()) } #[test] fn unstake_lp() -> anyhow::Result<()> { - let (_, _, staking, os) = setup_mock()?; - let account_addr = os.account.address()?; + let (_, _, staking, account) = setup_mock()?; + let account_addr = account.address()?; let dur = Some(cw_utils::Duration::Time(2)); // stake 100 EUR - staking.stake(AnsAsset::new(EUR_USD_LP, 100u128), WYNDEX.into(), dur, &os)?; + staking.stake( + AnsAsset::new(EUR_USD_LP, 100u128), + WYNDEX.into(), + dur, + &account, + )?; // query stake let staked_balance = staking.staked( @@ -162,10 +171,15 @@ fn unstake_lp() -> anyhow::Result<()> { vec![AssetEntry::new(EUR_USD_LP)], dur, )?; - assert_that!(staked_balance.amounts[0].u128()).is_equal_to(100u128); + assert_eq!(staked_balance.amounts[0].u128(), 100u128); // now unbond 50 - staking.unstake(AnsAsset::new(EUR_USD_LP, 50u128), WYNDEX.into(), dur, &os)?; + staking.unstake( + AnsAsset::new(EUR_USD_LP, 50u128), + WYNDEX.into(), + dur, + &account, + )?; // query stake let staked_balance = staking.staked( WYNDEX.into(), @@ -173,14 +187,14 @@ fn unstake_lp() -> anyhow::Result<()> { vec![AssetEntry::new(EUR_USD_LP)], dur, )?; - assert_that!(staked_balance.amounts[0].u128()).is_equal_to(50u128); + assert_eq!(staked_balance.amounts[0].u128(), 50u128); Ok(()) } #[test] fn claim_unbonded_lp() -> anyhow::Result<()> { - let (chain, wyndex, staking, os) = setup_mock()?; - let account_addr = os.account.address()?; + let (chain, wyndex, staking, account) = setup_mock()?; + let account_addr = account.address()?; let dur = cw_utils::Duration::Time(2); @@ -189,7 +203,7 @@ fn claim_unbonded_lp() -> anyhow::Result<()> { AnsAsset::new(EUR_USD_LP, 100u128), WYNDEX.into(), Some(dur), - &os, + &account, )?; // now unbond 50 @@ -197,7 +211,7 @@ fn claim_unbonded_lp() -> anyhow::Result<()> { AnsAsset::new(EUR_USD_LP, 50u128), WYNDEX.into(), Some(dur), - &os, + &account, )?; let unstake_block_info = chain.block_info()?; @@ -209,35 +223,43 @@ fn claim_unbonded_lp() -> anyhow::Result<()> { vec![AssetEntry::new(EUR_USD_LP)], )?; let claimable_at = dur.after(&unstake_block_info); - assert_that!(unbonding_balance).is_equal_to(UnbondingResponse { - claims: vec![vec![Claim { - amount: Uint128::from(50u128), - claimable_at, - }]], - }); + assert_eq!( + unbonding_balance, + UnbondingResponse { + claims: vec![vec![Claim { + amount: Uint128::from(50u128), + claimable_at, + }]], + } + ); // forward 5 seconds chain.next_block()?; // now claim 50 - staking.claim(AssetEntry::new(EUR_USD_LP), WYNDEX.into(), &os)?; + staking.claim(AssetEntry::new(EUR_USD_LP), WYNDEX.into(), &account)?; // query balance let balance = wyndex.eur_usd_lp.balance(account_addr.to_string())?; - assert_that!(balance.balance.u128()).is_equal_to(950u128); + assert_eq!(balance.balance.u128(), 950u128); Ok(()) } #[test] fn claim_rewards() -> anyhow::Result<()> { - let (chain, mut wyndex, staking, os) = setup_mock()?; - let account_addr = os.account.address()?; + let (chain, mut wyndex, staking, account) = setup_mock()?; + let account_addr = account.address()?; let dur = Some(cw_utils::Duration::Time(2)); // stake 100 EUR - staking.stake(AnsAsset::new(EUR_USD_LP, 100u128), WYNDEX.into(), dur, &os)?; + staking.stake( + AnsAsset::new(EUR_USD_LP, 100u128), + WYNDEX.into(), + dur, + &account, + )?; // forward 500 seconds chain.wait_blocks(100)?; @@ -249,11 +271,11 @@ fn claim_rewards() -> anyhow::Result<()> { .unwrap(); // now claim rewards - staking.claim_rewards(AssetEntry::new(EUR_USD_LP), WYNDEX.into(), &os)?; + staking.claim_rewards(AssetEntry::new(EUR_USD_LP), WYNDEX.into(), &account)?; // query balance let balance = chain.query_balance(&account_addr, WYND_TOKEN)?; - assert_that!(balance.u128()).is_equal_to(10_000u128); + assert_eq!(balance.u128(), 10_000u128); Ok(()) } diff --git a/modules/contracts/adapters/dex/Cargo.toml b/modules/contracts/adapters/dex/Cargo.toml index bd1982172b..997349a46f 100644 --- a/modules/contracts/adapters/dex/Cargo.toml +++ b/modules/contracts/adapters/dex/Cargo.toml @@ -23,35 +23,45 @@ required-features = ["schema"] [features] default = ["export"] -export = [] -schema = ["abstract-adapter/schema"] -testing = ["dep:abstract-client", "dep:cw20", "dep:serde_json", "abstract-adapter/test-utils"] +export = [] +schema = ["abstract-adapter/schema"] +testing = [ + "dep:abstract-client", + "dep:cw20", + "dep:serde_json", + "abstract-adapter/test-utils", +] +local = [ + "abstract-wyndex-adapter/local", + "abstract-astrovault-adapter/local", + "abstract-kujira-adapter/local", + "abstract-neutron-dex-adapter/local", +] # Supported Dexes -# wynd = ["abstract-wyndex-adapter/full_integration"] osmosis = ["abstract-osmosis-adapter/full_integration"] +wynd = ["abstract-wyndex-adapter/full_integration"] # astroport = ["abstract-astroport-adapter/full_integration"] -# fin = ["abstract-kujira-adapter/full_integration"] astrovault = ["abstract-astrovault-adapter/full_integration"] +fin = ["abstract-kujira-adapter/full_integration"] +neutron = ["abstract-neutron-dex-adapter/full_integration"] +neutron-test = ["dep:cw-orch-neutron-test-tube"] osmosis-test = ["dep:cw-orch-osmosis-test-tube"] # Builds [package.metadata.optimizer] builds = [ - # { name = "juno", features = [ - # "wynd", - # ] }, + { name = "juno", features = ["wynd"] }, # { name = "terra2", features = [ # "astroport", # ] }, + { name = "neutron", features = ["neutron"] }, # { name = "neutron", features = [ # "astroport", # ] }, { name = "osmosis", features = ["osmosis"] }, - # { name = "kujira", features = [ - # "fin", - # ] }, + { name = "kujira", features = ["fin"] }, # { name = "injective", features = [ # "astroport", # ] }, @@ -67,18 +77,17 @@ cosmwasm-schema = { workspace = true } cosmwasm-std = { workspace = true } cw-asset = { workspace = true } cw-orch = { workspace = true } +cw-orch-neutron-test-tube = { workspace = true, optional = true } cw-orch-osmosis-test-tube = { workspace = true, optional = true } cw-storage-plus = { workspace = true } cw20 = { workspace = true, optional = true } -schemars = { workspace = true } -thiserror = { workspace = true } # Local abstract-adapter-utils = { workspace = true } abstract-dex-standard = { workspace = true } # # Wyndex # -# abstract-wyndex-adapter = { workspace = true } +abstract-wyndex-adapter = { workspace = true } # Osmosis # abstract-osmosis-adapter = { workspace = true } @@ -86,8 +95,8 @@ abstract-osmosis-adapter = { workspace = true } # # Terra # # abstract-astroport-adapter = { workspace = true } -# # Kujira # -# abstract-kujira-adapter = { workspace = true } +# Kujira # +abstract-kujira-adapter = { workspace = true } # # Terra dexes # # terraswap = { version = "2.8.0", optional = true } @@ -95,8 +104,12 @@ abstract-osmosis-adapter = { workspace = true } # Astrovault # abstract-astrovault-adapter = { workspace = true } +# Neutron # +abstract-neutron-dex-adapter = { workspace = true } +prost = "0.12.3" + # Testing # -abstract-client = { workspace = true, optional = true } +abstract-client = { workspace = true, features = ["test-utils"], optional = true } serde_json = { version = "1.0", optional = true } [dev-dependencies] @@ -105,15 +118,16 @@ anyhow = { workspace = true } clap = { workspace = true } dotenv = "0.15.0" env_logger = "0.11.3" +mockdex-bundle = { workspace = true } semver = { workspace = true } tokio = { workspace = true } -# wyndex-bundle = { workspace = true } bip32 = { version = "0.5.2" } dex = { path = ".", features = [ - # "wynd", + "wynd", "osmosis", "testing", + "local" ], package = "abstract-dex-adapter" } # abstract-wyndex-adapter = { workspace = true, features = ["local"] } @@ -121,3 +135,14 @@ dex = { path = ".", features = [ cw-utils = { workspace = true } cw20 = { workspace = true } cw20-base = { workspace = true } + +abstract-integration-tests = { workspace = true } + +cw-orch = { workspace = true, features = ["daemon"] } +cw-orch-interchain = { workspace = true, features = ["daemon"] } +cw-plus-orch = { workspace = true } +neutron-std = "5.0.1-rc0" +osmosis-std = "0.26.0" +prost = "0.12.3" +prost-types = "0.13.3" +prost_13 = { version = "0.13.3", package = "prost" } diff --git a/modules/contracts/adapters/dex/examples/deploy.rs b/modules/contracts/adapters/dex/examples/deploy.rs index a5f8a5e47f..40452e616f 100644 --- a/modules/contracts/adapters/dex/examples/deploy.rs +++ b/modules/contracts/adapters/dex/examples/deploy.rs @@ -1,37 +1,38 @@ -use abstract_dex_adapter::{interface::DexAdapter, msg::DexInstantiateMsg, DEX_ADAPTER_ID}; +use abstract_dex_adapter::{ + contract::CONTRACT_VERSION, interface::DexAdapter, msg::DexInstantiateMsg, DEX_ADAPTER_ID, +}; use abstract_interface::{AdapterDeployer, DeployStrategy}; use cosmwasm_std::Decimal; use cw_orch::daemon::networks::parse_network; use cw_orch::prelude::*; use semver::Version; -const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION"); - -fn deploy_dex(network: ChainInfo) -> anyhow::Result<()> { - let rt = Runtime::new()?; - let version: Version = CONTRACT_VERSION.parse().unwrap(); - let chain = DaemonBuilder::new(network).handle(rt.handle()).build()?; - let dex = DexAdapter::new(DEX_ADAPTER_ID, chain); - dex.deploy( - version, - DexInstantiateMsg { - swap_fee: Decimal::percent(1), - recipient_account: 0, - }, - DeployStrategy::Try, - )?; +fn deploy_dex(networks: Vec) -> anyhow::Result<()> { + // run for each requested network + for network in networks { + let version: Version = CONTRACT_VERSION.parse().unwrap(); + let chain = DaemonBuilder::new(network).build()?; + let dex = DexAdapter::new(DEX_ADAPTER_ID, chain); + dex.deploy( + version, + DexInstantiateMsg { + swap_fee: Decimal::percent(1), + recipient_account: 0, + }, + DeployStrategy::Try, + )?; + } Ok(()) } use clap::Parser; -use tokio::runtime::Runtime; #[derive(Parser, Default, Debug)] #[command(author, version, about, long_about = None)] struct Arguments { /// Network Id to deploy on - #[arg(short, long)] - network_id: String, + #[arg(short, long, value_delimiter = ' ', num_args = 1..)] + network_ids: Vec, } fn main() -> anyhow::Result<()> { @@ -41,8 +42,11 @@ fn main() -> anyhow::Result<()> { use dotenv::dotenv; let args = Arguments::parse(); + let networks = args + .network_ids + .iter() + .map(|n| parse_network(n).unwrap()) + .collect(); - let network = parse_network(&args.network_id).unwrap(); - - deploy_dex(network) + deploy_dex(networks) } diff --git a/modules/contracts/adapters/dex/examples/neutron_testnet.rs b/modules/contracts/adapters/dex/examples/neutron_testnet.rs new file mode 100644 index 0000000000..ca45b277b5 --- /dev/null +++ b/modules/contracts/adapters/dex/examples/neutron_testnet.rs @@ -0,0 +1,152 @@ +use abstract_adapter::objects::pool_id::PoolAddressBase; +use abstract_adapter::objects::{AnsAsset, AssetEntry, PoolMetadata}; +use abstract_client::{AbstractClient, Namespace}; +use abstract_dex_adapter::interface::DexAdapter; +use abstract_dex_standard::ans_action::DexAnsAction; +use abstract_interface::ExecuteMsgFns; +use abstract_neutron_dex_adapter::NEUTRON; +use cosmwasm_std::Decimal; +use cw_orch::daemon::{networks::PION_1, Daemon}; +use cw_orch::prelude::*; +use neutron_std::types::neutron::dex::DepositOptions; +use neutron_std::types::{ + neutron::dex::MsgDeposit, + osmosis::tokenfactory::v1beta1::{MsgCreateDenom, MsgMint}, +}; +use prost::Message; + +pub const NTRN: &str = "untrn"; +pub const SUB_DENOM: &str = "pooled"; + +fn new_denom(chain: &Daemon) -> String { + format!("factory/{}/{}", chain.sender_addr(), SUB_DENOM) +} + +#[allow(clippy::type_complexity)] +fn setup_denom_ans(chain: Daemon) -> anyhow::Result<()> { + let deployment = AbstractClient::new(chain.clone())?; + + // Create some liquidity + let denom_creation = MsgCreateDenom { + sender: chain.sender_addr().to_string(), + subdenom: SUB_DENOM.to_string(), + }; + // Mint to myself + let denom_mint = MsgMint { + sender: chain.sender_addr().to_string(), + amount: Some(neutron_std::types::cosmos::base::v1beta1::Coin { + denom: new_denom(&chain), + amount: "1000000000000".to_string(), + }), + mint_to_address: chain.sender_addr().to_string(), + }; + + // Deposit some initial liquidity (create pool) + let pool_create_msg = MsgDeposit { + token_a: NTRN.to_string(), + token_b: new_denom(&chain).to_string(), + amounts_a: vec!["100000".to_string()], + amounts_b: vec!["100000".to_string()], + creator: chain.sender_addr().to_string(), + receiver: chain.sender_addr().to_string(), + fees: vec![0], + options: vec![DepositOptions { + disable_autoswap: false, + fail_tx_on_bel: false, + }], + tick_indexes_a_to_b: vec![0], + }; + + chain.commit_any( + vec![ + prost_types::Any { + type_url: MsgCreateDenom::TYPE_URL.to_string(), + value: denom_creation.encode_to_vec(), + }, + prost_types::Any { + type_url: MsgMint::TYPE_URL.to_string(), + value: denom_mint.encode_to_vec(), + }, + prost_types::Any { + type_url: MsgDeposit::TYPE_URL.to_string(), + value: pool_create_msg.encode_to_vec(), + }, + ], + None, + )?; + + // We need to register some pairs and assets on the ans host contract + // Register NTRN and ATOM assets + deployment + .name_service() + .update_asset_addresses( + vec![ + ("ntrn".to_string(), cw_asset::AssetInfoBase::native(NTRN)), + ( + "new_denom".to_string(), + cw_asset::AssetInfoBase::native(new_denom(&chain)), + ), + ], + vec![], + ) + .unwrap(); + + deployment + .name_service() + .update_dexes(vec![NEUTRON.into()], vec![]) + .unwrap(); + + deployment + .name_service() + .update_pools( + vec![( + PoolAddressBase::id(0u64), + PoolMetadata::constant_product( + NEUTRON, + vec!["ntrn".to_string(), "new_denom".to_string()], + ), + )], + vec![], + ) + .unwrap(); + + Ok(()) +} +fn main() -> anyhow::Result<()> { + dotenv::dotenv()?; + env_logger::init(); + + let chain = Daemon::builder(PION_1).build()?; + setup_denom_ans(chain.clone())?; + + let deployment = AbstractClient::new(chain.clone())?; + + let namespace = Namespace::new("hackerhouse")?; + let account = deployment.fetch_or_build_account(namespace.clone(), |b| { + b.namespace(namespace.clone()) + .install_adapter::>() + })?; + let dex_adapter = account.application::>()?; + + // swap 1_000 ntrn to new_denom + let asset = AssetEntry::new("ntrn"); + let ask_asset = AssetEntry::new("new_denom"); + + let swap_value = 1_000u128; + + let action = DexAnsAction::Swap { + offer_asset: AnsAsset::new(asset, swap_value), + ask_asset, + max_spread: Some(Decimal::percent(30)), + belief_price: Some(Decimal::percent(1)), + }; + + dex_adapter.module::>()?.ans_action( + NEUTRON.into(), + action, + account.as_ref(), + deployment.name_service(), + )?; + + Ok(()) +} diff --git a/modules/contracts/adapters/dex/examples/osmosis_testnet.rs b/modules/contracts/adapters/dex/examples/osmosis_testnet.rs new file mode 100644 index 0000000000..54b3c80465 --- /dev/null +++ b/modules/contracts/adapters/dex/examples/osmosis_testnet.rs @@ -0,0 +1,167 @@ +use abstract_adapter::objects::pool_id::PoolAddressBase; +use abstract_adapter::objects::{AnsAsset, AssetEntry, PoolMetadata, UniquePoolId}; +use abstract_client::{AbstractClient, Namespace}; +use abstract_dex_adapter::interface::DexAdapter; +use abstract_dex_standard::ans_action::DexAnsAction; +use abstract_interface::ExecuteMsgFns; +use abstract_osmosis_adapter::OSMOSIS; +use cosmwasm_std::{coin, coins, Decimal}; +use cw_orch::daemon::RUNTIME; +use cw_orch::daemon::{networks::OSMO_5, Daemon}; +use cw_orch::prelude::*; +use osmosis_std::types::osmosis::gamm::poolmodels::balancer::v1beta1::MsgCreateBalancerPool; +use osmosis_std::types::osmosis::gamm::v1beta1::PoolAsset; +use osmosis_std::types::osmosis::gamm::v1beta1::PoolParams; +use osmosis_std::types::osmosis::tokenfactory::v1beta1::{MsgCreateDenom, MsgMint}; +use prost_13::Message; + +pub const OSMO: &str = "uosmo"; +pub const SUB_DENOM: &str = "pooled"; + +fn new_denom(chain: &Daemon) -> String { + format!("factory/{}/{}", chain.sender_addr(), SUB_DENOM) +} + +#[allow(clippy::type_complexity)] +fn setup_denom_ans(chain: Daemon) -> anyhow::Result<()> { + let deployment = AbstractClient::new(chain.clone())?; + + // Create some liquidity + let denom_creation = MsgCreateDenom { + sender: chain.sender_addr().to_string(), + subdenom: SUB_DENOM.to_string(), + }; + // Mint to myself + let denom_mint = MsgMint { + sender: chain.sender_addr().to_string(), + amount: Some(osmosis_std::types::cosmos::base::v1beta1::Coin { + denom: new_denom(&chain), + amount: "1000000000000".to_string(), + }), + mint_to_address: chain.sender_addr().to_string(), + }; + + // Create pool + let pool_create_msg = MsgCreateBalancerPool { + sender: chain.sender_addr().to_string(), + pool_params: Some(PoolParams { + swap_fee: "10000000000000000".to_string(), + exit_fee: "0".to_string(), + smooth_weight_change_params: None, + }), + pool_assets: [coin(100_000, OSMO), coin(100_000, new_denom(&chain))] + .iter() + .map(|c| PoolAsset { + token: Some(osmosis_std::types::cosmos::base::v1beta1::Coin { + denom: c.denom.to_owned(), + amount: format!("{}", c.amount), + }), + weight: "1000000".to_string(), + }) + .collect(), + future_pool_governor: "".to_string(), + }; + + let response = chain.commit_any( + vec![ + prost_types::Any { + type_url: MsgCreateDenom::TYPE_URL.to_string(), + value: denom_creation.encode_to_vec(), + }, + prost_types::Any { + type_url: MsgMint::TYPE_URL.to_string(), + value: denom_mint.encode_to_vec(), + }, + prost_types::Any { + type_url: MsgCreateBalancerPool::TYPE_URL.to_string(), + value: pool_create_msg.encode_to_vec(), + }, + ], + None, + )?; + + let pool_id: u64 = response.get_events("pool_created")[0].get_attributes("pool_id")[0] + .value + .parse()?; + + // We need to register some pairs and assets on the ans host contract + // Register OSMO and ATOM assets + deployment + .name_service() + .update_asset_addresses( + vec![ + ("osmo".to_string(), cw_asset::AssetInfoBase::native(OSMO)), + ( + "new_denom".to_string(), + cw_asset::AssetInfoBase::native(new_denom(&chain)), + ), + ], + vec![], + ) + .unwrap(); + + deployment + .name_service() + .update_dexes(vec![OSMOSIS.into()], vec![]) + .unwrap(); + + deployment + .name_service() + .update_pools( + vec![( + PoolAddressBase::id(pool_id), + PoolMetadata::constant_product( + OSMOSIS, + vec!["osmo".to_string(), "new_denom".to_string()], + ), + )], + vec![UniquePoolId::new(1)], + ) + .unwrap(); + + Ok(()) +} +fn main() -> anyhow::Result<()> { + dotenv::dotenv()?; + env_logger::init(); + + let chain = Daemon::builder(OSMO_5).build()?; + setup_denom_ans(chain.clone())?; + + let deployment = AbstractClient::new(chain.clone())?; + + let namespace = Namespace::new("hackerhouse")?; + let account = deployment.fetch_or_build_account(namespace.clone(), |b| { + b.namespace(namespace.clone()) + .install_adapter::>() + })?; + let dex_adapter = account.application::>()?; + + RUNTIME.block_on( + chain + .sender() + .bank_send(&account.address()?, coins(1_000, OSMO)), + )?; + + // swap 1_000 osmo to new_denom + let asset = AssetEntry::new("osmo"); + let ask_asset = AssetEntry::new("new_denom"); + + let swap_value = 1_000u128; + + let action = DexAnsAction::Swap { + offer_asset: AnsAsset::new(asset, swap_value), + ask_asset, + max_spread: Some(Decimal::percent(30)), + belief_price: Some(Decimal::percent(1)), + }; + + dex_adapter.module::>()?.ans_action( + OSMOSIS.into(), + action, + account.as_ref(), + deployment.name_service(), + )?; + + Ok(()) +} diff --git a/modules/contracts/adapters/dex/src/api.rs b/modules/contracts/adapters/dex/src/api.rs index 0d82324879..f5c64ca3b0 100644 --- a/modules/contracts/adapters/dex/src/api.rs +++ b/modules/contracts/adapters/dex/src/api.rs @@ -24,7 +24,7 @@ pub trait DexInterface: AccountIdentification + Dependencies + ModuleIdentification + AbstractNameService { /// Construct a new dex interface. - fn dex<'a>(&'a self, deps: Deps<'a>, env: &'a Env, name: DexName) -> Dex { + fn dex<'a>(&'a self, deps: Deps<'a>, env: &'a Env, name: DexName) -> Dex<'a, Self> { Dex { base: self, env, @@ -34,7 +34,7 @@ pub trait DexInterface: } } /// Construct a new dex interface with ANS support. - fn ans_dex<'a>(&'a self, deps: Deps<'a>, env: &'a Env, name: DexName) -> AnsDex { + fn ans_dex<'a>(&'a self, deps: Deps<'a>, env: &'a Env, name: DexName) -> AnsDex<'a, Self> { AnsDex { base: self, env, @@ -147,7 +147,7 @@ pub mod raw { } } - impl<'a, T: DexInterface> Dex<'a, T> { + impl Dex<'_, T> { /// Do a query in the DEX fn query(&self, query_msg: DexQueryMsg) -> AbstractSdkResult { let adapters = self.base.adapters(self.deps); @@ -283,7 +283,7 @@ pub mod ans { } } - impl<'a, T: DexInterface> AnsDex<'a, T> { + impl AnsDex<'_, T> { /// Do a query in the DEX fn query(&self, query_msg: DexQueryMsg) -> AbstractSdkResult { let adapters = self.base.adapters(self.deps); diff --git a/modules/contracts/adapters/dex/src/exchanges/exchange_resolver.rs b/modules/contracts/adapters/dex/src/exchanges/exchange_resolver.rs index 4f88b49728..92a4536f6d 100644 --- a/modules/contracts/adapters/dex/src/exchanges/exchange_resolver.rs +++ b/modules/contracts/adapters/dex/src/exchanges/exchange_resolver.rs @@ -9,15 +9,18 @@ use cosmwasm_std::Env; /// This provides superior UX in case of an IBC execution pub(crate) fn identify_exchange(value: &str) -> Result, DexError> { match value { - // abstract_wyndex_adapter::WYNDEX => { - // Ok(Box::::default()) - // } + abstract_wyndex_adapter::WYNDEX => { + Ok(Box::::default()) + } + abstract_neutron_dex_adapter::NEUTRON => { + Ok(Box::::default()) + } // abstract_astroport_adapter::ASTROPORT => { // Ok(Box::::default()) // } - // abstract_kujira_adapter::dex::FIN => { - // Ok(Box::::default()) - // } + abstract_kujira_adapter::dex::FIN => { + Ok(Box::::default()) + } abstract_osmosis_adapter::OSMOSIS => { Ok(Box::::default()) } @@ -34,6 +37,10 @@ pub(crate) fn resolve_exchange(value: &str) -> Result, DexEr abstract_wyndex_adapter::WYNDEX => { Ok(Box::::default()) } + #[cfg(feature = "neutron")] + abstract_neutron_dex_adapter::NEUTRON => { + Ok(Box::::default()) + } #[cfg(feature = "osmosis")] abstract_osmosis_adapter::OSMOSIS => { Ok(Box::::default()) @@ -63,7 +70,10 @@ pub fn is_over_ibc(env: &Env, platform_name: &str) -> Result<(String, bool), Dex let platform_id = identify_exchange(&local_platform_name)?; // We verify the adapter is available on the current chain if !is_available_on(platform_id, env, chain_name.as_deref()) { - return Err(DexError::UnknownDex(platform_name.to_string())); + return Err(DexError::UnknownDexOnThisPlatform { + dex: platform_name.to_string(), + chain: chain_name, + }); } Ok((local_platform_name, false)) } diff --git a/modules/contracts/adapters/dex/tests/common/mod.rs b/modules/contracts/adapters/dex/tests/common/mod.rs deleted file mode 100644 index 69e1f4ae0c..0000000000 --- a/modules/contracts/adapters/dex/tests/common/mod.rs +++ /dev/null @@ -1,52 +0,0 @@ -use abstract_adapter::std::objects::gov_type::GovernanceDetails; -use abstract_interface::{AbstractAccount, AccountFactory}; -use cw_orch::{environment::Environment, prelude::*}; -pub fn create_default_account( - factory: &AccountFactory, -) -> anyhow::Result> { - let os = factory.create_default_account(GovernanceDetails::Monarchy { - monarch: Addr::unchecked(factory.environment().sender_addr()).to_string(), - })?; - Ok(os) -} - -// /// Instantiates the dex adapter and registers it with the registry -// #[allow(dead_code)] -// pub fn init_dex_adapter( -// chain: Mock, -// deployment: &Abstract, -// version: Option, -// ) -> anyhow::Result> { -// let mut dex_adapter = DexAdapter::new(EXCHANGE, chain); -// dex_adapter -// .as_instance_mut() -// .set_mock(Box::new(boot_core::ContractWrapper::new_with_empty( -// ::dex::contract::execute, -// ::dex::contract::instantiate, -// ::dex::contract::query, -// ))); -// dex_adapter.upload()?; -// dex_adapter.instantiate( -// &InstantiateMsg::{ -// app: DexInstantiateMsg{ -// swap_fee: Decimal::percent(1), -// recipient_os: 0, -// }, -// base: abstract_adapter::std::adapter::BaseInstantiateMsg { -// ans_host_address: deployment.ans_host.addr_str()?, -// registry_address: deployment.registry.addr_str()?, -// }, -// }, -// None, -// None, -// )?; - -// let version: Version = version -// .unwrap_or_else(|| deployment.version.to_string()) -// .parse()?; - -// deployment -// .registry -// .register_adapters(vec![dex_adapter.as_instance()], &version)?; -// Ok(dex_adapter) -// } diff --git a/modules/contracts/adapters/dex/tests/neutron.rs b/modules/contracts/adapters/dex/tests/neutron.rs new file mode 100644 index 0000000000..ab56bbe81a --- /dev/null +++ b/modules/contracts/adapters/dex/tests/neutron.rs @@ -0,0 +1,190 @@ +#![cfg(feature = "neutron-test")] + +use abstract_adapter::std::{ + ans_host::ExecuteMsgFns, + objects::{ + gov_type::GovernanceDetails, pool_id::PoolAddressBase, AnsAsset, AssetEntry, PoolMetadata, + }, +}; +use abstract_dex_adapter::{ + contract::CONTRACT_VERSION, interface::DexAdapter, msg::DexInstantiateMsg, DEX_ADAPTER_ID, +}; +use abstract_dex_standard::ans_action::DexAnsAction; +use abstract_interface::{ + Abstract, AbstractInterfaceError, AccountI, AdapterDeployer, AnsHost, DeployStrategy, +}; +use abstract_neutron_dex_adapter::NEUTRON; +use anyhow::Result as AnyResult; +use cosmwasm_std::{coin, coins, Decimal, Uint128}; +use cw_orch::prelude::*; +use cw_orch_neutron_test_tube::{ + neutron_test_tube::{ + neutron_std::types::neutron::dex::{DepositOptions, MsgDeposit}, + Dex, Module, + }, + NeutronTestTube, +}; + +/// Provide liquidity using Abstract's OS (registered in daemon_state). +pub fn provide( + dex_adapter: &DexAdapter, + asset1: (&str, u128), + asset2: (&str, u128), + dex: String, + os: &AccountI, + ans_host: &AnsHost, +) -> Result<(), AbstractInterfaceError> { + let asset_entry1 = AssetEntry::new(asset1.0); + let asset_entry2 = AssetEntry::new(asset2.0); + + dex_adapter.ans_action( + dex, + DexAnsAction::ProvideLiquidity { + assets: vec![ + AnsAsset::new(asset_entry1, asset1.1), + AnsAsset::new(asset_entry2, asset2.1), + ], + max_spread: Some(Decimal::percent(30)), + }, + os, + ans_host, + )?; + Ok(()) +} + +pub const NTRN: &str = "untrn"; +pub const ATOM: &str = "uatom"; +pub const STARS: &str = "ustars"; + +#[allow(clippy::type_complexity)] +fn setup_mock() -> anyhow::Result<( + NeutronTestTube, + DexAdapter, + AccountI, + Abstract, + u64, +)> { + let chain = NeutronTestTube::new(vec![ + coin(1_000_000_000_000, NTRN), + coin(1_000_000_000_000, ATOM), + coin(1_000_000_000_000, STARS), + ]); + + let deployment = Abstract::deploy_on(chain.clone(), ())?; + + let _root_os = AccountI::create_default_account( + &deployment, + GovernanceDetails::Monarchy { + monarch: chain.sender_addr().to_string(), + }, + )?; + let dex_adapter = DexAdapter::new(DEX_ADAPTER_ID, chain.clone()); + + dex_adapter.deploy( + CONTRACT_VERSION.parse()?, + DexInstantiateMsg { + swap_fee: Decimal::percent(1), + recipient_account: 0, + }, + DeployStrategy::Try, + )?; + + // Deposit some inital liquidity + let pool_create_msg = MsgDeposit { + token_a: NTRN.to_string(), + token_b: ATOM.to_string(), + amounts_a: vec!["100000000000".to_string()], + amounts_b: vec!["100000000000".to_string()], + creator: chain.sender_addr().to_string(), + receiver: chain.sender_addr().to_string(), + fees: vec![0], + options: vec![DepositOptions { + disable_autoswap: false, + fail_tx_on_bel: false, + }], + tick_indexes_a_to_b: vec![0], + }; + + let app = chain.app.borrow_mut(); + let dex = Dex::new(&*app); + dex.deposit(pool_create_msg, chain.sender())?; + drop(app); + + // We need to register some pairs and assets on the ans host contract + // Register NTRN and ATOM assets + deployment + .ans_host + .update_asset_addresses( + vec![ + ("ntrn".to_string(), cw_asset::AssetInfoBase::native(NTRN)), + ("atom".to_string(), cw_asset::AssetInfoBase::native(ATOM)), + ], + vec![], + ) + .unwrap(); + deployment + .ans_host + .update_dexes(vec![NEUTRON.into()], vec![]) + .unwrap(); + + deployment + .ans_host + .update_pools( + vec![( + PoolAddressBase::id(0u64), + PoolMetadata::constant_product( + NEUTRON, + vec!["ntrn".to_string(), "atom".to_string()], + ), + )], + vec![], + ) + .unwrap(); + + let account = AccountI::create_default_account( + &deployment, + GovernanceDetails::Monarchy { + monarch: chain.sender_addr().to_string(), + }, + )?; + + // install DEX_ADAPTER_ID on OS + account.install_adapter(&dex_adapter, &[])?; + + Ok((chain.clone(), dex_adapter, account, deployment, 0)) +} + +#[test] +fn swap() -> AnyResult<()> { + // We need to deploy a Testube pool + let (chain, dex_adapter, os, abstr, _pool_id) = setup_mock()?; + + let account_addr = os.address()?; + + let swap_value = 1_000_000_000u128; + + chain.bank_send(&account_addr, coins(swap_value, NTRN))?; + + // Before swap, we need to have 0 uosmo and swap_value uatom + let balances = chain.query_all_balances(&account_addr)?; + assert_eq!(balances, coins(swap_value, NTRN)); + // swap 100_000 ntrn to atom + let asset = AssetEntry::new("ntrn"); + let ask_asset = AssetEntry::new("atom"); + + let action = DexAnsAction::Swap { + offer_asset: AnsAsset::new(asset, swap_value), + ask_asset, + max_spread: Some(Decimal::percent(30)), + belief_price: Some(Decimal::percent(1)), + }; + dex_adapter.ans_action(NEUTRON.into(), action, &os, &abstr.ans_host)?; + + // Assert balances + let balances = chain.query_all_balances(&account_addr)?; + assert_eq!(balances.len(), 1); + let balance = chain.query_balance(&account_addr, ATOM)?; + assert!(balance > Uint128::zero()); + + Ok(()) +} diff --git a/modules/contracts/adapters/dex/tests/osmosis.rs b/modules/contracts/adapters/dex/tests/osmosis.rs index dcce8d301f..eaaee1662e 100644 --- a/modules/contracts/adapters/dex/tests/osmosis.rs +++ b/modules/contracts/adapters/dex/tests/osmosis.rs @@ -1,6 +1,6 @@ #![cfg(feature = "osmosis-test")] -use std::{format, rc::Rc}; +use std::format; use abstract_adapter::std::{ ans_host::ExecuteMsgFns, @@ -23,7 +23,7 @@ use anyhow::Result as AnyResult; use cosmwasm_std::{coin, coins, Decimal, Uint128}; use cw_asset::AssetBase; use cw_orch::prelude::*; -use cw_orch_osmosis_test_tube::{osmosis_test_tube::Account, OsmosisTestTube}; +use cw_orch_osmosis_test_tube::OsmosisTestTube; /// Provide liquidity using Abstract's OS (registered in daemon_state). pub fn provide( diff --git a/modules/contracts/adapters/dex/tests/raw.rs b/modules/contracts/adapters/dex/tests/raw.rs index 826f21e9b1..49d5817cdd 100644 --- a/modules/contracts/adapters/dex/tests/raw.rs +++ b/modules/contracts/adapters/dex/tests/raw.rs @@ -1,41 +1,38 @@ -#![cfg(feature = "TODO: replace wyndex_bundle")] - use abstract_adapter::std::{ adapter::AdapterRequestMsg, ans_host::QueryMsgFns as _, objects::{PoolAddress, ABSTRACT_ACCOUNT_ID}, }; -use abstract_dex_adapter::{contract::CONTRACT_VERSION, msg::DexInstantiateMsg, DEX_ADAPTER_ID}; -use abstract_dex_standard::msg::DexExecuteMsg; -use abstract_interface::{AdapterDeployer, DeployStrategy}; -use cw20::msg::Cw20ExecuteMsgFns as _; -use cw20_base::msg::QueryMsgFns as _; -use cw_asset::{AssetBase, AssetInfoBase}; -mod common; +use abstract_client::builder::cw20_builder::{ExecuteMsgInterfaceFns, QueryMsgInterfaceFns}; use abstract_dex_adapter::interface::DexAdapter; +use abstract_dex_adapter::{contract::CONTRACT_VERSION, msg::DexInstantiateMsg, DEX_ADAPTER_ID}; use abstract_dex_standard::action::DexAction; -use abstract_interface::{Abstract, AbstractAccount}; -use common::create_default_account; +use abstract_dex_standard::msg::DexExecuteMsg; +use abstract_integration_tests::create_default_account; +use abstract_interface::Abstract; +use abstract_interface::{AccountI, AdapterDeployer, DeployStrategy}; use cosmwasm_std::{coin, Decimal}; +use cw_asset::{AssetBase, AssetInfoBase}; use cw_orch::prelude::*; -use wyndex_bundle::{EUR, USD, WYNDEX as WYNDEX_WITHOUT_CHAIN, WYNDEX_OWNER}; + +use mockdex_bundle::{EUR, USD, WYNDEX as WYNDEX_WITHOUT_CHAIN, WYNDEX_OWNER}; const WYNDEX: &str = "cosmos-testnet>wyndex"; #[allow(clippy::type_complexity)] fn setup_mock() -> anyhow::Result<( MockBech32, - wyndex_bundle::WynDex, + mockdex_bundle::WynDex, DexAdapter, - AbstractAccount, + AccountI, Abstract, )> { let chain = MockBech32::new("mock"); let sender = chain.sender_addr(); - let deployment = Abstract::deploy_on(chain.clone(), sender.to_string())?; - let wyndex = wyndex_bundle::WynDex::deploy_on(chain.clone(), Empty {})?; + let deployment = Abstract::deploy_on(chain.clone(), ())?; + let wyndex = mockdex_bundle::WynDex::deploy_on(chain.clone(), Empty {})?; - let _root_os = create_default_account(&deployment.account_factory)?; + let _root_os = create_default_account(&sender, &deployment)?; let dex_adapter = DexAdapter::new(DEX_ADAPTER_ID, chain.clone()); dex_adapter.deploy( @@ -47,20 +44,20 @@ fn setup_mock() -> anyhow::Result<( DeployStrategy::Try, )?; - let account = create_default_account(&deployment.account_factory)?; + let account = create_default_account(&sender, &deployment)?; // mint to account chain.set_balance(&account.address()?, vec![coin(10_000, EUR)])?; // install exchange on OS - account.install_adapter(&dex_adapter, None)?; + account.install_adapter(&dex_adapter, &[])?; Ok((chain, wyndex, dex_adapter, account, deployment)) } #[test] fn raw_swap_native() -> anyhow::Result<()> { - let (chain, wyndex, dex_adapter, os, abstr) = setup_mock()?; - let account_addr = os.account.address()?; + let (chain, wyndex, dex_adapter, account, abstr) = setup_mock()?; + let account_addr = account.address()?; let pools = abstr.ans_host.pool_list(None, None, None)?; println!("{:?}", pools); @@ -70,40 +67,38 @@ fn raw_swap_native() -> anyhow::Result<()> { (EUR, 100), USD, WYNDEX.into(), - &os, + &account, PoolAddress::contract(wyndex.eur_usd_pair).into(), )?; // check balances let eur_balance = chain.query_balance(&account_addr, EUR)?; - assert_that!(eur_balance.u128()).is_equal_to(9_900); + assert_eq!(eur_balance.u128(), 9_900); let usd_balance = chain.query_balance(&account_addr, USD)?; - assert_that!(usd_balance.u128()).is_equal_to(98); + assert_eq!(usd_balance.u128(), 98); - // assert that OS 0 received the swap fee - let os0_account = AbstractAccount::new(&abstr, ABSTRACT_ACCOUNT_ID) - .account - .address()?; + // assert that account 0 received the swap fee + let os0_account = AccountI::load_from(&abstr, ABSTRACT_ACCOUNT_ID)?.address()?; let os0_eur_balance = chain.query_balance(&os0_account, EUR)?; - assert_that!(os0_eur_balance.u128()).is_equal_to(1); + assert_eq!(os0_eur_balance.u128(), 1); Ok(()) } #[test] fn raw_swap_native_without_chain() -> anyhow::Result<()> { - let (chain, wyndex, dex_adapter, os, abstr) = setup_mock()?; - let account_addr = os.account.address()?; + let (chain, wyndex, dex_adapter, account, abstr) = setup_mock()?; + let account_addr = account.address()?; // swap 100 EUR to USD dex_adapter.raw_swap_native( (EUR, 100), USD, WYNDEX_WITHOUT_CHAIN.into(), - &os, + &account, PoolAddress::contract(wyndex.eur_usd_pair).into(), )?; @@ -111,25 +106,23 @@ fn raw_swap_native_without_chain() -> anyhow::Result<()> { let balances = chain.query_all_balances(&account_addr)?; println!("{:?}", balances); let eur_balance = chain.query_balance(&account_addr, EUR)?; - assert_that!(eur_balance.u128()).is_equal_to(9_900); + assert_eq!(eur_balance.u128(), 9_900); let usd_balance = chain.query_balance(&account_addr, USD)?; - assert_that!(usd_balance.u128()).is_equal_to(98); + assert_eq!(usd_balance.u128(), 98); - // assert that OS 0 received the swap fee - let os0_account = AbstractAccount::new(&abstr, ABSTRACT_ACCOUNT_ID) - .account - .address()?; - let os0_eur_balance = chain.query_balance(&os0_account, EUR)?; - assert_that!(os0_eur_balance.u128()).is_equal_to(1); + // assert that Account 0 received the swap fee + let account = AccountI::load_from(&abstr, ABSTRACT_ACCOUNT_ID)?.address()?; + let eur_balance = chain.query_balance(&account, EUR)?; + assert_eq!(eur_balance.u128(), 1); Ok(()) } #[test] fn raw_swap_raw() -> anyhow::Result<()> { - let (chain, wyndex, _, os, abstr) = setup_mock()?; - let account_addr = os.account.address()?; + let (chain, wyndex, _, account, abstr) = setup_mock()?; + let account_addr = account.address()?; // transfer raw let owner = chain.addr_make(WYNDEX_OWNER); @@ -152,21 +145,19 @@ fn raw_swap_raw() -> anyhow::Result<()> { }, }, }); - os.account.execute_on_module(DEX_ADAPTER_ID, swap_msg)?; + account.execute_on_module(DEX_ADAPTER_ID, swap_msg, vec![])?; // check balances let raw_balance = wyndex.raw_token.balance(account_addr.to_string())?; - assert_that!(raw_balance.balance.u128()).is_equal_to(9_900); + assert_eq!(raw_balance.balance.u128(), 9_900); let eur_balance = chain.query_balance(&account_addr, EUR)?; - assert_that!(eur_balance.u128()).is_equal_to(10098); + assert_eq!(eur_balance.u128(), 10098); // assert that OS 0 received the swap fee - let account0_account = AbstractAccount::new(&abstr, ABSTRACT_ACCOUNT_ID) - .account - .address()?; + let account0_account = AccountI::load_from(&abstr, ABSTRACT_ACCOUNT_ID)?.address()?; let os0_raw_balance = wyndex.raw_token.balance(account0_account.to_string())?; - assert_that!(os0_raw_balance.balance.u128()).is_equal_to(1); + assert_eq!(os0_raw_balance.balance.u128(), 1); Ok(()) } diff --git a/modules/contracts/adapters/dex/tests/swap.rs b/modules/contracts/adapters/dex/tests/swap.rs index 318e2f915a..bbdcfc82bf 100644 --- a/modules/contracts/adapters/dex/tests/swap.rs +++ b/modules/contracts/adapters/dex/tests/swap.rs @@ -1,36 +1,32 @@ -#![cfg(feature = "TODO: replace wyndex_bundle")] - use abstract_adapter::std::{ans_host::QueryMsgFns as _, objects::ABSTRACT_ACCOUNT_ID}; +use abstract_client::builder::cw20_builder::{ExecuteMsgInterfaceFns, QueryMsgInterfaceFns}; use abstract_dex_adapter::{contract::CONTRACT_VERSION, msg::DexInstantiateMsg, DEX_ADAPTER_ID}; use abstract_dex_standard::{msg::DexFeesResponse, DexError}; -use abstract_interface::{AbstractInterfaceError, AdapterDeployer, DeployStrategy}; -use cw20::msg::Cw20ExecuteMsgFns as _; -use cw20_base::msg::QueryMsgFns as _; -mod common; +use abstract_interface::{AbstractInterfaceError, AccountI, AdapterDeployer, DeployStrategy}; use abstract_dex_adapter::interface::DexAdapter; -use abstract_interface::{Abstract, AbstractAccount}; -use common::create_default_account; +use abstract_integration_tests::create_default_account; +use abstract_interface::Abstract; use cosmwasm_std::{coin, Decimal}; use cw_orch::prelude::*; -use wyndex_bundle::{EUR, RAW_TOKEN, USD, WYNDEX as WYNDEX_WITHOUT_CHAIN, WYNDEX_OWNER}; +use mockdex_bundle::{EUR, RAW_TOKEN, USD, WYNDEX as WYNDEX_WITHOUT_CHAIN, WYNDEX_OWNER}; const WYNDEX: &str = "cosmos-testnet>wyndex"; #[allow(clippy::type_complexity)] fn setup_mock() -> anyhow::Result<( MockBech32, - wyndex_bundle::WynDex, + mockdex_bundle::WynDex, DexAdapter, - AbstractAccount, + AccountI, Abstract, )> { let chain = MockBech32::new("mock"); let sender = chain.sender_addr(); - let deployment = Abstract::deploy_on(chain.clone(), sender.to_string())?; - let wyndex = wyndex_bundle::WynDex::deploy_on(chain.clone(), Empty {})?; + let deployment = Abstract::deploy_on(chain.clone(), ())?; + let wyndex = mockdex_bundle::WynDex::deploy_on(chain.clone(), Empty {})?; - let _root_os = create_default_account(&deployment.account_factory)?; + let _root_os = create_default_account(&sender, &deployment)?; let dex_adapter = DexAdapter::new(DEX_ADAPTER_ID, chain.clone()); dex_adapter.deploy( @@ -42,81 +38,77 @@ fn setup_mock() -> anyhow::Result<( DeployStrategy::Try, )?; - let account = create_default_account(&deployment.account_factory)?; + let account = create_default_account(&sender, &deployment)?; // mint to account chain.set_balance(&account.address()?, vec![coin(10_000, EUR)])?; // install exchange on OS - account.install_adapter(&dex_adapter, None)?; + account.install_adapter(&dex_adapter, &[])?; Ok((chain, wyndex, dex_adapter, account, deployment)) } #[test] fn swap_native() -> anyhow::Result<()> { - let (chain, _, dex_adapter, os, abstr) = setup_mock()?; - let account_addr = os.account.address()?; + let (chain, _, dex_adapter, account, abstr) = setup_mock()?; + let account_addr = account.address()?; let pools = abstr.ans_host.pool_list(None, None, None)?; println!("{:?}", pools); // swap 100 EUR to USD - dex_adapter.ans_swap((EUR, 100), USD, WYNDEX.into(), &os, &abstr.ans_host)?; + dex_adapter.ans_swap((EUR, 100), USD, WYNDEX.into(), &account, &abstr.ans_host)?; // check balances let eur_balance = chain.query_balance(&account_addr, EUR)?; - assert_that!(eur_balance.u128()).is_equal_to(9_900); + assert_eq!(eur_balance.u128(), 9_900); let usd_balance = chain.query_balance(&account_addr, USD)?; - assert_that!(usd_balance.u128()).is_equal_to(98); + assert_eq!(usd_balance.u128(), 98); // assert that OS 0 received the swap fee - let os0_account = AbstractAccount::new(&abstr, ABSTRACT_ACCOUNT_ID) - .account - .address()?; + let os0_account = AccountI::load_from(&abstr, ABSTRACT_ACCOUNT_ID)?.address()?; let os0_eur_balance = chain.query_balance(&os0_account, EUR)?; - assert_that!(os0_eur_balance.u128()).is_equal_to(1); + assert_eq!(os0_eur_balance.u128(), 1); Ok(()) } #[test] fn swap_native_without_chain() -> anyhow::Result<()> { - let (chain, _, dex_adapter, os, abstr) = setup_mock()?; - let account_addr = os.account.address()?; + let (chain, _, dex_adapter, account, abstr) = setup_mock()?; + let account_addr = account.address()?; // swap 100 EUR to USD dex_adapter.ans_swap( (EUR, 100), USD, WYNDEX_WITHOUT_CHAIN.into(), - &os, + &account, &abstr.ans_host, )?; // check balances let eur_balance = chain.query_balance(&account_addr, EUR)?; - assert_that!(eur_balance.u128()).is_equal_to(9_900); + assert_eq!(eur_balance.u128(), 9_900); let usd_balance = chain.query_balance(&account_addr, USD)?; - assert_that!(usd_balance.u128()).is_equal_to(98); + assert_eq!(usd_balance.u128(), 98); // assert that OS 0 received the swap fee - let os0_account = AbstractAccount::new(&abstr, ABSTRACT_ACCOUNT_ID) - .account - .address()?; + let os0_account = AccountI::load_from(&abstr, ABSTRACT_ACCOUNT_ID)?.address()?; let os0_eur_balance = chain.query_balance(&os0_account, EUR)?; - assert_that!(os0_eur_balance.u128()).is_equal_to(1); + assert_eq!(os0_eur_balance.u128(), 1); Ok(()) } #[test] fn swap_raw() -> anyhow::Result<()> { - let (chain, wyndex, dex_adapter, os, abstr) = setup_mock()?; - let account_addr = os.account.address()?; + let (chain, wyndex, dex_adapter, account, abstr) = setup_mock()?; + let account_addr = account.address()?; // transfer raw let owner = chain.addr_make(WYNDEX_OWNER); @@ -126,21 +118,25 @@ fn swap_raw() -> anyhow::Result<()> { .transfer(10_000u128, account_addr.to_string())?; // swap 100 RAW to EUR - dex_adapter.ans_swap((RAW_TOKEN, 100), EUR, WYNDEX.into(), &os, &abstr.ans_host)?; + dex_adapter.ans_swap( + (RAW_TOKEN, 100), + EUR, + WYNDEX.into(), + &account, + &abstr.ans_host, + )?; // check balances let raw_balance = wyndex.raw_token.balance(account_addr.to_string())?; - assert_that!(raw_balance.balance.u128()).is_equal_to(9_900); + assert_eq!(raw_balance.balance.u128(), 9_900); let eur_balance = chain.query_balance(&account_addr, EUR)?; - assert_that!(eur_balance.u128()).is_equal_to(10098); + assert_eq!(eur_balance.u128(), 10098); // assert that OS 0 received the swap fee - let account0_account = AbstractAccount::new(&abstr, ABSTRACT_ACCOUNT_ID) - .account - .address()?; + let account0_account = AccountI::load_from(&abstr, ABSTRACT_ACCOUNT_ID)?.address()?; let os0_raw_balance = wyndex.raw_token.balance(account0_account.to_string())?; - assert_that!(os0_raw_balance.balance.u128()).is_equal_to(1); + assert_eq!(os0_raw_balance.balance.u128(), 1); Ok(()) } @@ -148,9 +144,7 @@ fn swap_raw() -> anyhow::Result<()> { #[test] fn get_fees() -> anyhow::Result<()> { let (_, _, dex_adapter, _, abstr) = setup_mock()?; - let account0_account = AbstractAccount::new(&abstr, ABSTRACT_ACCOUNT_ID) - .account - .address()?; + let account0_account = AccountI::load_from(&abstr, ABSTRACT_ACCOUNT_ID)?.address()?; use abstract_dex_adapter::msg::DexQueryMsgFns as _; @@ -163,11 +157,11 @@ fn get_fees() -> anyhow::Result<()> { #[test] fn authorized_update_fee() -> anyhow::Result<()> { let (_, _, dex_adapter, _, abstr) = setup_mock()?; - let account0 = AbstractAccount::new(&abstr, ABSTRACT_ACCOUNT_ID); + let account0 = AccountI::load_from(&abstr, ABSTRACT_ACCOUNT_ID)?; let update_fee_msg = abstract_dex_standard::msg::ExecuteMsg::Module( abstract_adapter::std::adapter::AdapterRequestMsg { - account_address: Some(account0.account.addr_str()?), + account_address: Some(account0.addr_str()?), request: abstract_dex_standard::msg::DexExecuteMsg::UpdateFee { swap_fee: Some(Decimal::percent(5)), recipient_account: None, @@ -175,7 +169,7 @@ fn authorized_update_fee() -> anyhow::Result<()> { }, ); - dex_adapter.execute(&update_fee_msg, None)?; + dex_adapter.execute(&update_fee_msg, &[])?; use abstract_dex_adapter::msg::DexQueryMsgFns as _; @@ -199,8 +193,7 @@ fn unauthorized_update_fee() -> anyhow::Result<()> { ); let err = account - .account - .execute_on_module(DEX_ADAPTER_ID, update_fee_msg) + .execute_on_module(DEX_ADAPTER_ID, update_fee_msg, vec![]) .unwrap_err(); let AbstractInterfaceError::Orch(orch_error) = err else { panic!("unexpected error type"); diff --git a/modules/contracts/adapters/money-market/Cargo.toml b/modules/contracts/adapters/money-market/Cargo.toml index 35fa69caee..2311fb5d87 100644 --- a/modules/contracts/adapters/money-market/Cargo.toml +++ b/modules/contracts/adapters/money-market/Cargo.toml @@ -29,7 +29,7 @@ testing = ["dep:abstract-client", "dep:cw20", "abstract-adapter/test-utils"] # Supported Moneymarkets # mars = ["abstract-mars-adapter/full_integration"] -# ghost = ["abstract-kujira-adapter/full_integration"] +ghost = ["abstract-kujira-adapter/full_integration"] # osmosis-test = ["dep:cw-orch-osmosis-test-tube"] @@ -39,9 +39,7 @@ builds = [ # { name = "osmosis", features = [ # "mars", # ] }, - # { name = "kujira", features = [ - # "ghost", - # ] }, + { name = "kujira", features = ["ghost"] }, ] [dependencies] @@ -50,8 +48,6 @@ cosmwasm-std = { workspace = true } cw-asset = { workspace = true } cw-storage-plus = { workspace = true } cw20 = { workspace = true, optional = true } -schemars = { workspace = true } -thiserror = { workspace = true } abstract-adapter = { workspace = true } cw-orch = { workspace = true } @@ -61,8 +57,8 @@ cw-orch = { workspace = true } abstract-adapter-utils = { workspace = true } abstract-money-market-standard = { workspace = true } -# # Kujira # -# abstract-kujira-adapter = { workspace = true } +# Kujira # +abstract-kujira-adapter = { workspace = true } # # Mars # # abstract-mars-adapter = { workspace = true } @@ -71,19 +67,19 @@ abstract-money-market-standard = { workspace = true } abstract-client = { workspace = true, optional = true } [dev-dependencies] -abstract-interface = { workspace = true, features = ["daemon"] } -anyhow = { workspace = true } -clap = { workspace = true } -dotenv = "0.15.0" -env_logger = "0.11.3" -semver = { workspace = true } -tokio = { workspace = true } -# wyndex-bundle = { workspace = true } abstract-adapter = { workspace = true, features = ["test-utils"] } +abstract-interface = { workspace = true, features = ["daemon"] } +anyhow = { workspace = true } +clap = { workspace = true } +dotenv = "0.15.0" +env_logger = "0.11.3" +mockdex-bundle = { workspace = true } money-market = { path = ".", features = [ # "mars", # "ghost", ], package = "abstract-money-market-adapter" } +semver = { workspace = true } +tokio = { workspace = true } # abstract-wyndex-adapter = { workspace = true, features = ["local"] } diff --git a/modules/contracts/adapters/money-market/examples/deploy.rs b/modules/contracts/adapters/money-market/examples/deploy.rs index 5a1e28e9a9..22894b9c8d 100644 --- a/modules/contracts/adapters/money-market/examples/deploy.rs +++ b/modules/contracts/adapters/money-market/examples/deploy.rs @@ -10,9 +10,8 @@ use semver::Version; const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION"); fn deploy_dex(network: ChainInfo) -> anyhow::Result<()> { - let rt = Runtime::new()?; let version: Version = CONTRACT_VERSION.parse().unwrap(); - let chain = DaemonBuilder::new(network).handle(rt.handle()).build()?; + let chain = DaemonBuilder::new(network).build()?; let dex = MoneyMarketAdapter::new(MONEY_MARKET_ADAPTER_ID, chain); dex.deploy( version, @@ -26,7 +25,6 @@ fn deploy_dex(network: ChainInfo) -> anyhow::Result<()> { } use clap::Parser; -use tokio::runtime::Runtime; #[derive(Parser, Default, Debug)] #[command(author, version, about, long_about = None)] diff --git a/modules/contracts/adapters/money-market/src/api.rs b/modules/contracts/adapters/money-market/src/api.rs index e96217b1ad..4fe38db062 100644 --- a/modules/contracts/adapters/money-market/src/api.rs +++ b/modules/contracts/adapters/money-market/src/api.rs @@ -21,7 +21,7 @@ pub trait MoneyMarketInterface: AccountIdentification + Dependencies + ModuleIdentification { /// Construct a new money_market interface. - fn money_market<'a>(&'a self, deps: Deps<'a>, name: MoneyMarketName) -> MoneyMarket { + fn money_market<'a>(&'a self, deps: Deps<'a>, name: MoneyMarketName) -> MoneyMarket<'a, Self> { MoneyMarket { base: self, deps, @@ -34,7 +34,7 @@ pub trait MoneyMarketInterface: &'a self, deps: Deps<'a>, name: MoneyMarketName, - ) -> AnsMoneyMarket { + ) -> AnsMoneyMarket<'a, Self> { AnsMoneyMarket { base: self, deps, @@ -191,7 +191,7 @@ pub mod raw { } } - impl<'a, T: MoneyMarketInterface> MoneyMarket<'a, T> { + impl MoneyMarket<'_, T> { // Queries pub fn user_deposit( &self, @@ -396,7 +396,7 @@ pub mod ans { } } - impl<'a, T: MoneyMarketInterface> AnsMoneyMarket<'a, T> { + impl AnsMoneyMarket<'_, T> { // Queries pub fn user_deposit(&self, user: String, asset: AssetEntry) -> AbstractSdkResult { self.query(MoneyMarketQueryMsg::AnsUserDeposit { diff --git a/modules/contracts/adapters/money-market/src/platform_resolver.rs b/modules/contracts/adapters/money-market/src/platform_resolver.rs index baa66a9bc3..371afae8b7 100644 --- a/modules/contracts/adapters/money-market/src/platform_resolver.rs +++ b/modules/contracts/adapters/money-market/src/platform_resolver.rs @@ -9,9 +9,9 @@ use cosmwasm_std::Env; /// This provides superior UX in case of an IBC execution pub(crate) fn identify_money_market(value: &str) -> Result, MoneyMarketError> { match value { - // abstract_kujira_adapter::money_market::GHOST => { - // Ok(Box::::default()) - // } + abstract_kujira_adapter::money_market::GHOST => { + Ok(Box::::default()) + } // abstract_mars_adapter::MARS => { // Ok(Box::::default()) // } diff --git a/modules/contracts/apps/calendar/Cargo.toml b/modules/contracts/apps/calendar/Cargo.toml index d8bd5ee345..6bb03de59a 100644 --- a/modules/contracts/apps/calendar/Cargo.toml +++ b/modules/contracts/apps/calendar/Cargo.toml @@ -36,7 +36,6 @@ cosmwasm-std = { workspace = true } cw-asset = { workspace = true } cw-controllers = { workspace = true } cw-storage-plus = { workspace = true } -schemars = { workspace = true } thiserror = { workspace = true } abstract-app = { workspace = true } diff --git a/modules/contracts/apps/calendar/examples/deploy.rs b/modules/contracts/apps/calendar/examples/deploy.rs index 43859647b1..d63de3f775 100644 --- a/modules/contracts/apps/calendar/examples/deploy.rs +++ b/modules/contracts/apps/calendar/examples/deploy.rs @@ -23,7 +23,6 @@ use clap::Parser; use cw_orch::{ anyhow, prelude::{networks::parse_network, *}, - tokio::runtime::Runtime, }; use semver::Version; @@ -31,8 +30,7 @@ fn deploy(networks: Vec) -> anyhow::Result<()> { // run for each requested network for network in networks { let version: Version = APP_VERSION.parse().unwrap(); - let rt = Runtime::new()?; - let chain = DaemonBuilder::new(network).handle(rt.handle()).build()?; + let chain = DaemonBuilder::new(network).build()?; let app = CalendarAppInterface::new(APP_ID, chain); app.deploy(version, DeployStrategy::Try)?; diff --git a/modules/contracts/apps/challenge/Cargo.toml b/modules/contracts/apps/challenge/Cargo.toml index 82e04602e9..6726770b32 100644 --- a/modules/contracts/apps/challenge/Cargo.toml +++ b/modules/contracts/apps/challenge/Cargo.toml @@ -36,7 +36,6 @@ cw-address-like = { workspace = true } cw-asset = { workspace = true } cw-controllers = { workspace = true } cw-storage-plus = { workspace = true } -schemars = { workspace = true } thiserror = { workspace = true } abstract-app = { workspace = true } @@ -45,9 +44,11 @@ abstract-app = { workspace = true } cw-orch = { workspace = true } [dev-dependencies] -abstract-app = { workspace = true, features = ["test-utils"] } -challenge-app = { path = "." } -cw-orch = { workspace = true, features = ["daemon"] } -dotenv = "0.15.0" -env_logger = "0.11.3" -semver = "1.0" +abstract-app = { workspace = true, features = ["test-utils"] } +abstract-interface = { workspace = true, features = ["daemon"] } +challenge-app = { path = "." } +clap.workspace = true +cw-orch = { workspace = true, features = ["daemon"] } +dotenv = "0.15.0" +env_logger = "0.11.3" +semver = "1.0" diff --git a/modules/contracts/apps/challenge/examples/deploy.rs b/modules/contracts/apps/challenge/examples/deploy.rs index 9b3e713b62..41d7bd7051 100644 --- a/modules/contracts/apps/challenge/examples/deploy.rs +++ b/modules/contracts/apps/challenge/examples/deploy.rs @@ -1,24 +1,62 @@ -use abstract_app::abstract_interface::{AppDeployer, DeployStrategy}; -use challenge_app::{contract::CHALLENGE_APP_ID, Challenge}; +//! Deploys the module to the Abstract platform by uploading it and registering it on the registry contract. +//! +//! This should be used for mainnet/testnet deployments in combination with our front-end at https://console.abstract.money +//! +//! **Requires you to have an account and namespace registered** +//! +//! The mnemonic used to register the module must be the same as the owner of the account that claimed the namespace. +//! +//! Read our docs to learn how: https://docs.abstract.money/4_get_started/5_account_creation.html +//! +//! ## Example +//! +//! ```bash +//! $ just deploy uni-6 osmo-test-5 +//! ``` +use abstract_interface::{AppDeployer, DeployStrategy}; + +use challenge_app::{ + contract::{CHALLENGE_APP_ID, CHALLENGE_APP_VERSION}, + Challenge, +}; +use clap::Parser; use cw_orch::{ anyhow, - prelude::{networks::parse_network, DaemonBuilder}, - tokio::runtime::Runtime, + prelude::{networks::parse_network, *}, }; use semver::Version; -const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION"); +fn deploy(networks: Vec) -> anyhow::Result<()> { + // run for each requested network + for network in networks { + let version: Version = CHALLENGE_APP_VERSION.parse().unwrap(); + let chain = DaemonBuilder::new(network).build()?; -fn main() -> anyhow::Result<()> { - dotenv().ok(); - env_logger::init(); - let chain = parse_network("uni-6").unwrap(); - use dotenv::dotenv; - let version: Version = CONTRACT_VERSION.parse().unwrap(); - let rt = Runtime::new()?; - let chain = DaemonBuilder::new(chain).handle(rt.handle()).build()?; - let app = Challenge::new(CHALLENGE_APP_ID, chain); + let app = Challenge::new(CHALLENGE_APP_ID, chain); + app.deploy(version, DeployStrategy::Try)?; - app.deploy(version, DeployStrategy::Try)?; + // Create an account on our front-end to install the module! + // https://console.abstract.money + } Ok(()) } + +#[derive(Parser, Default, Debug)] +#[command(author, version, about, long_about = None)] +struct Arguments { + /// Network Id to deploy on + #[arg(short, long, value_delimiter = ' ', num_args = 1..)] + network_ids: Vec, +} + +fn main() { + dotenv::dotenv().ok(); + env_logger::init(); + let args = Arguments::parse(); + let networks = args + .network_ids + .iter() + .map(|n| parse_network(n).unwrap()) + .collect(); + deploy(networks).unwrap(); +} diff --git a/modules/contracts/apps/payment/Cargo.toml b/modules/contracts/apps/payment/Cargo.toml index d7a8cb3da7..6985eb37a2 100644 --- a/modules/contracts/apps/payment/Cargo.toml +++ b/modules/contracts/apps/payment/Cargo.toml @@ -31,7 +31,6 @@ cw-asset = { workspace = true } cw-controllers = { workspace = true } cw-storage-plus = { workspace = true } cw20 = { workspace = true } -schemars = { workspace = true } thiserror = { workspace = true } abstract-app = { workspace = true } @@ -42,19 +41,21 @@ cw-orch = { workspace = true } # Dependencies for interface [dev-dependencies] -abstract-app = { workspace = true, features = ["test-utils"] } -abstract-interface = { workspace = true, features = ["daemon"] } -cw-orch = { workspace = true, features = ["daemon"] } -dotenv = "0.15.0" -env_logger = "0.11.3" -semver = "1.0" +abstract-app = { workspace = true, features = ["test-utils"] } +abstract-integration-tests = { workspace = true } +abstract-interface = { workspace = true, features = ["daemon"] } +clap.workspace = true +cw-orch = { workspace = true, features = ["daemon"] } +dotenv = "0.15.0" +env_logger = "0.11.3" +semver = "1.0" cw-plus-orch = { workspace = true } cw20 = { workspace = true } cw20-base = { workspace = true } -# wyndex-bundle = { workspace = true } abstract-dex-adapter = { workspace = true, features = [ # "wynd", "testing", ] } +mockdex-bundle = { workspace = true } diff --git a/modules/contracts/apps/payment/examples/deploy.rs b/modules/contracts/apps/payment/examples/deploy.rs index c3cc09edf9..4ea7fcf10c 100644 --- a/modules/contracts/apps/payment/examples/deploy.rs +++ b/modules/contracts/apps/payment/examples/deploy.rs @@ -1,24 +1,63 @@ +//! Deploys the module to the Abstract platform by uploading it and registering it on the registry contract. +//! +//! This should be used for mainnet/testnet deployments in combination with our front-end at https://console.abstract.money +//! +//! **Requires you to have an account and namespace registered** +//! +//! The mnemonic used to register the module must be the same as the owner of the account that claimed the namespace. +//! +//! Read our docs to learn how: https://docs.abstract.money/4_get_started/5_account_creation.html +//! +//! ## Example +//! +//! ```bash +//! $ just deploy uni-6 osmo-test-5 +//! ``` + use abstract_interface::{AppDeployer, DeployStrategy}; +use payment_app::{ + contract::{APP_ID, APP_VERSION}, + PaymentAppInterface, +}; + +use clap::Parser; use cw_orch::{ anyhow, - prelude::{networks::parse_network, DaemonBuilder}, - tokio::runtime::Runtime, + prelude::{networks::parse_network, *}, }; -use payment_app::{contract::APP_ID, PaymentAppInterface}; use semver::Version; -const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION"); +fn deploy(networks: Vec) -> anyhow::Result<()> { + // run for each requested network + for network in networks { + let version: Version = APP_VERSION.parse().unwrap(); + let chain = DaemonBuilder::new(network).build()?; -fn main() -> anyhow::Result<()> { - dotenv().ok(); - env_logger::init(); - let chain = parse_network("juno-1").unwrap(); - use dotenv::dotenv; - let version: Version = CONTRACT_VERSION.parse().unwrap(); - let rt = Runtime::new()?; - let chain = DaemonBuilder::new(chain).handle(rt.handle()).build()?; - let app = PaymentAppInterface::new(APP_ID, chain); + let app = PaymentAppInterface::new(APP_ID, chain); + app.deploy(version, DeployStrategy::Try)?; - app.deploy(version, DeployStrategy::Try)?; + // Create an account on our front-end to install the module! + // https://console.abstract.money + } Ok(()) } + +#[derive(Parser, Default, Debug)] +#[command(author, version, about, long_about = None)] +struct Arguments { + /// Network Id to deploy on + #[arg(short, long, value_delimiter = ' ', num_args = 1..)] + network_ids: Vec, +} + +fn main() { + dotenv::dotenv().ok(); + env_logger::init(); + let args = Arguments::parse(); + let networks = args + .network_ids + .iter() + .map(|n| parse_network(n).unwrap()) + .collect(); + deploy(networks).unwrap(); +} diff --git a/modules/contracts/apps/payment/tests/integration.rs b/modules/contracts/apps/payment/tests/integration.rs index c60f89030b..084284d48d 100644 --- a/modules/contracts/apps/payment/tests/integration.rs +++ b/modules/contracts/apps/payment/tests/integration.rs @@ -1,21 +1,24 @@ -#![cfg(feature = "TODO: replace wyndex_bundle")] - use abstract_app::sdk::cw_helpers::Clearable; use abstract_app::std::{ ans_host::ExecuteMsgFns, - objects::{gov_type::GovernanceDetails, AccountId, AnsAsset, AssetEntry}, + objects::{AccountId, AnsAsset, AssetEntry}, }; use abstract_dex_adapter::{contract::CONTRACT_VERSION, msg::DexInstantiateMsg}; use abstract_interface::{ - Abstract, AbstractAccount, AdapterDeployer, AppDeployer, DeployStrategy, RegistryExecFns, + Abstract, AccountExecFns, AccountI, AdapterDeployer, AppDeployer, DeployStrategy, + RegistryExecFns, }; use cosmwasm_std::{coin, coins, to_json_binary, Decimal, Uint128}; -use cw20::{msg::Cw20ExecuteMsgFns, Cw20Coin}; -use cw20_base::msg::{InstantiateMsg as Cw20InstantiateMsg, QueryMsgFns}; +use cw20::Cw20Coin; +use cw20_base::msg::InstantiateMsg as Cw20InstantiateMsg; use cw_orch::environment::Environment; // Use prelude to get all the necessary imports +use abstract_integration_tests::create_default_account; use cw_orch::{anyhow, prelude::*}; -use cw_plus_orch::cw20_base::Cw20Base as AbstractCw20Base; +use cw_plus_orch::cw20_base::{ + Cw20Base as AbstractCw20Base, ExecuteMsgInterfaceFns as _, QueryMsgInterfaceFns as _, +}; +use mockdex_bundle::WynDex; use payment_app::{ contract::{APP_ID, APP_VERSION}, msg::{ @@ -24,10 +27,9 @@ use payment_app::{ }, *, }; -use wyndex_bundle::WynDex; type PaymentTestSetup = ( - AbstractAccount, + AccountI, Abstract, PaymentAppInterface, WynDex, @@ -36,7 +38,7 @@ type PaymentTestSetup = ( fn setup(mock: MockBech32, desired_asset: Option) -> anyhow::Result { let app = PaymentAppInterface::new(APP_ID, mock.clone()); - let abstr_deployment = Abstract::deploy_on(mock.clone(), mock.sender_addr().to_string())?; + let abstr_deployment = Abstract::deploy_on(mock.clone(), ())?; let dex_adapter = abstract_dex_adapter::interface::DexAdapter::new( abstract_dex_adapter::DEX_ADAPTER_ID, @@ -52,12 +54,7 @@ fn setup(mock: MockBech32, desired_asset: Option) -> anyhow::Result< )?; // Create a new account to install the app onto - let account = - abstr_deployment - .account_factory - .create_default_account(GovernanceDetails::Monarchy { - monarch: mock.sender_addr().to_string(), - })?; + let account = create_default_account(&mock.sender_addr(), &abstr_deployment)?; // claim the namespace so app can be deployed abstr_deployment @@ -67,7 +64,7 @@ fn setup(mock: MockBech32, desired_asset: Option) -> anyhow::Result< app.deploy(APP_VERSION.parse()?, DeployStrategy::Try)?; // install exchange module as it's a dependency - account.install_adapter(&dex_adapter, None)?; + account.install_adapter(&dex_adapter, &[])?; let wyndex = WynDex::store_on(mock)?; @@ -76,12 +73,12 @@ fn setup(mock: MockBech32, desired_asset: Option) -> anyhow::Result< &AppInstantiateMsg { desired_asset, denom_asset: "Dollah".to_owned(), - exchanges: vec![wyndex_bundle::WYNDEX.to_owned()], + exchanges: vec![mockdex_bundle::WYNDEX.to_owned()], }, - None, + &[], )?; - account.account.update_adapter_authorized_addresses( + account.update_adapter_authorized_addresses( abstract_dex_adapter::DEX_ADAPTER_ID, vec![app.address()?.to_string()], vec![], @@ -113,11 +110,11 @@ fn successful_install() -> anyhow::Result<()> { #[test] fn test_update_config() -> anyhow::Result<()> { // Create the mock - let mock = MockBech32::new("sender"); + let mock = MockBech32::new("mock"); // Set up the environment and contract let (account, abstr, app, wyndex) = - setup(mock.clone(), Some(AssetEntry::new(wyndex_bundle::USD)))?; + setup(mock.clone(), Some(AssetEntry::new(mockdex_bundle::USD)))?; let new_target_currency = wyndex.eur_token.to_string(); @@ -127,17 +124,23 @@ fn test_update_config() -> anyhow::Result<()> { .ans_host .update_dexes(vec![dex_name.clone()], vec![])?; - app.call_as(&account.address()?).update_config( - Some("Ye-uh-roah".to_owned()), - Clearable::new_opt(AssetEntry::new(&new_target_currency)), - Some(vec![dex_name.clone()]), + account.admin_execute_on_module( + app.id(), + to_json_binary(&payment_app::msg::ExecuteMsg::Module( + msg::AppExecuteMsg::UpdateConfig { + denom_asset: Some("Ye-uh-roah".to_owned()), + desired_asset: Clearable::new_opt(AssetEntry::new(&new_target_currency)), + exchanges: Some(vec![dex_name.clone()]), + }, + ))?, + &[], )?; let config = app.config()?; assert_eq!( config, ConfigResponse { - desired_asset: Some(AssetEntry::new(wyndex_bundle::EUR)), + desired_asset: Some(AssetEntry::new(mockdex_bundle::EUR)), denom_asset: "Ye-uh-roah".to_owned(), exchanges: vec![dex_name] } @@ -177,7 +180,7 @@ fn test_simple_tip() -> anyhow::Result<()> { let expected_tipper = TipperResponse { address: tipper.clone(), tip_count: 1, - total_amounts: vec![AnsAsset::new(wyndex_bundle::EUR, Uint128::new(100))], + total_amounts: vec![AnsAsset::new(mockdex_bundle::EUR, Uint128::new(100))], }; assert_eq!(expected_tipper, tipper_response); @@ -200,7 +203,7 @@ fn test_simple_tip() -> anyhow::Result<()> { assert_eq!( tipper_response.total_amounts, vec![AnsAsset::new( - AssetEntry::new(wyndex_bundle::EUR), + AssetEntry::new(mockdex_bundle::EUR), Uint128::new(tip_amount) )] ); @@ -215,7 +218,7 @@ fn test_simple_tip() -> anyhow::Result<()> { assert_eq!( tipper_response.total_amounts, vec![AnsAsset::new( - AssetEntry::new(wyndex_bundle::EUR), + AssetEntry::new(mockdex_bundle::EUR), Uint128::zero() )] ); @@ -228,7 +231,7 @@ fn test_tip_swap() -> anyhow::Result<()> { let mock = MockBech32::new("sender"); let (account, _abstr_deployment, app, wyndex) = - setup(mock.clone(), Some(AssetEntry::new(wyndex_bundle::USD)))?; + setup(mock.clone(), Some(AssetEntry::new(mockdex_bundle::USD)))?; let WynDex { eur_token, @@ -279,7 +282,7 @@ fn test_tip_swap_and_not_swap() -> anyhow::Result<()> { let mock = MockBech32::new("sender"); let (account, abstr_deployment, app, wyndex) = - setup(mock.clone(), Some(AssetEntry::new(wyndex_bundle::USD)))?; + setup(mock.clone(), Some(AssetEntry::new(mockdex_bundle::USD)))?; let WynDex { eur_token, @@ -333,7 +336,7 @@ fn test_cw20_tip() -> anyhow::Result<()> { let mock = MockBech32::new("sender"); let (account, abstr_deployment, app, _wyndex) = - setup(mock.clone(), Some(AssetEntry::new(wyndex_bundle::USD)))?; + setup(mock.clone(), Some(AssetEntry::new(mockdex_bundle::USD)))?; let tipper = mock.addr_make("tipper"); let tip_amount = 100u128; @@ -356,7 +359,7 @@ fn test_cw20_tip() -> anyhow::Result<()> { marketing: None, }, None, - None, + &[], )?; // We add the currency cw20 to the abstract deployment @@ -443,7 +446,7 @@ fn test_multiple_tippers() -> anyhow::Result<()> { let expected_tipper = TipperResponse { address: tipper1.clone(), tip_count: 1, - total_amounts: vec![AnsAsset::new(wyndex_bundle::EUR, Uint128::new(100))], + total_amounts: vec![AnsAsset::new(mockdex_bundle::EUR, Uint128::new(100))], }; assert_eq!(expected_tipper, tipper_response1); @@ -452,7 +455,7 @@ fn test_multiple_tippers() -> anyhow::Result<()> { let expected_tipper = TipperResponse { address: tipper2.clone(), tip_count: 1, - total_amounts: vec![AnsAsset::new(wyndex_bundle::EUR, Uint128::new(200))], + total_amounts: vec![AnsAsset::new(mockdex_bundle::EUR, Uint128::new(200))], }; assert_eq!(expected_tipper, tipper_response2); @@ -482,7 +485,7 @@ fn test_sent_desired_asset() -> anyhow::Result<()> { let mock = MockBech32::new("sender"); let (_, abstr_deployment, app, wyndex) = - setup(mock, Some(AssetEntry::new(wyndex_bundle::USD)))?; + setup(mock, Some(AssetEntry::new(mockdex_bundle::USD)))?; let mock: MockBech32 = abstr_deployment.ans_host.environment().clone(); let WynDex { usd_token, .. } = wyndex; @@ -499,7 +502,7 @@ fn test_sent_desired_asset() -> anyhow::Result<()> { let expected_tipper = TipperResponse { address: tipper.clone(), tip_count: 1, - total_amounts: vec![AnsAsset::new(wyndex_bundle::USD, Uint128::new(100))], + total_amounts: vec![AnsAsset::new(mockdex_bundle::USD, Uint128::new(100))], }; assert_eq!(expected_tipper, tipper_response); diff --git a/modules/contracts/apps/ping-pong/Cargo.toml b/modules/contracts/apps/ping-pong/Cargo.toml index 928b21870a..38b119b4c9 100644 --- a/modules/contracts/apps/ping-pong/Cargo.toml +++ b/modules/contracts/apps/ping-pong/Cargo.toml @@ -21,12 +21,15 @@ cw-asset = { workspace = true } cw-controllers = { workspace = true } cw-orch = { workspace = true } cw-storage-plus = { workspace = true } -schemars = { workspace = true } thiserror = { workspace = true } [dev-dependencies] abstract-client = { workspace = true, features = ["interchain"] } +abstract-interface = { workspace = true, features = ["daemon"] } +clap.workspace = true cw-orch = { workspace = true, features = ["daemon"] } cw-orch-interchain = { workspace = true, features = ["daemon"] } cw-orch-polytone = { package = "abstract-cw-orch-polytone", version = "6.0.0" } +dotenv = "0.15.0" env_logger = "0.11" +semver.workspace = true diff --git a/modules/contracts/apps/ping-pong/examples/deploy.rs b/modules/contracts/apps/ping-pong/examples/deploy.rs new file mode 100644 index 0000000000..b1ccdf860d --- /dev/null +++ b/modules/contracts/apps/ping-pong/examples/deploy.rs @@ -0,0 +1,63 @@ +//! Deploys the module to the Abstract platform by uploading it and registering it on the registry contract. +//! +//! This should be used for mainnet/testnet deployments in combination with our front-end at https://console.abstract.money +//! +//! **Requires you to have an account and namespace registered** +//! +//! The mnemonic used to register the module must be the same as the owner of the account that claimed the namespace. +//! +//! Read our docs to learn how: https://docs.abstract.money/4_get_started/5_account_creation.html +//! +//! ## Example +//! +//! ```bash +//! $ just deploy uni-6 osmo-test-5 +//! ``` + +use abstract_interface::{AppDeployer, DeployStrategy}; +use ping_pong::{ + contract::{APP_ID, APP_VERSION}, + AppInterface, +}; + +use clap::Parser; +use cw_orch::{ + anyhow, + prelude::{networks::parse_network, *}, +}; +use semver::Version; + +fn deploy(networks: Vec) -> anyhow::Result<()> { + // run for each requested network + for network in networks { + let version: Version = APP_VERSION.parse().unwrap(); + let chain = DaemonBuilder::new(network).build()?; + + let app = AppInterface::new(APP_ID, chain); + app.deploy(version, DeployStrategy::Try)?; + + // Create an account on our front-end to install the module! + // https://console.abstract.money + } + Ok(()) +} + +#[derive(Parser, Default, Debug)] +#[command(author, version, about, long_about = None)] +struct Arguments { + /// Network Id to deploy on + #[arg(short, long, value_delimiter = ' ', num_args = 1..)] + network_ids: Vec, +} + +fn main() { + dotenv::dotenv().ok(); + env_logger::init(); + let args = Arguments::parse(); + let networks = args + .network_ids + .iter() + .map(|n| parse_network(n).unwrap()) + .collect(); + deploy(networks).unwrap(); +} diff --git a/modules/contracts/apps/subscription/Cargo.toml b/modules/contracts/apps/subscription/Cargo.toml index 921150961f..be58937f4f 100644 --- a/modules/contracts/apps/subscription/Cargo.toml +++ b/modules/contracts/apps/subscription/Cargo.toml @@ -14,8 +14,7 @@ name = "schema" required-features = ["schema"] [[example]] -name = "deploy" -required-features = ["daemon"] +name = "deploy" [features] default = ["export"] @@ -28,11 +27,8 @@ cosmwasm-std = { workspace = true } cw-asset = { workspace = true } cw-controllers = { workspace = true } cw-storage-plus = { workspace = true } -cw2 = { workspace = true } cw20 = { workspace = true } -schemars = { workspace = true } semver = { workspace = true } -serde = { workspace = true } thiserror = { workspace = true } abstract-app = { workspace = true } @@ -43,6 +39,7 @@ cw-address-like = { workspace = true } [dev-dependencies] abstract-client = { workspace = true, features = ["test-utils"] } # Deploy -clap = { workspace = true } -dotenv = "0.15.0" -env_logger = "0.11.3" +abstract-interface = { workspace = true, features = ["daemon"] } +clap = { workspace = true } +dotenv = "0.15.0" +env_logger = "0.11.3" diff --git a/modules/contracts/apps/subscription/examples/deploy.rs b/modules/contracts/apps/subscription/examples/deploy.rs index d1a14b9f01..e4258ac022 100644 --- a/modules/contracts/apps/subscription/examples/deploy.rs +++ b/modules/contracts/apps/subscription/examples/deploy.rs @@ -4,7 +4,6 @@ use clap::Parser; use cw_orch::{ anyhow, prelude::{networks::parse_network, *}, - tokio::runtime::Runtime, }; use dotenv::dotenv; use semver::Version; @@ -12,10 +11,9 @@ use semver::Version; const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION"); fn deploy_subscription(networks: Vec) -> anyhow::Result<()> { - let rt = Runtime::new()?; let version: Version = CONTRACT_VERSION.parse().unwrap(); for network in networks { - let chain = DaemonBuilder::new(network).handle(rt.handle()).build()?; + let chain = DaemonBuilder::new(network).build()?; let subscription_app = SubscriptionInterface::new(SUBSCRIPTION_ID, chain); subscription_app.deploy(version.clone(), DeployStrategy::Try)?; } diff --git a/modules/contracts/standalones/ica-owner/Cargo.toml b/modules/contracts/standalones/ica-owner/Cargo.toml index 30be652043..983d343d88 100644 --- a/modules/contracts/standalones/ica-owner/Cargo.toml +++ b/modules/contracts/standalones/ica-owner/Cargo.toml @@ -36,7 +36,6 @@ cosmwasm-std = { workspace = true } cw-asset = { workspace = true } cw-controllers = { workspace = true } cw-storage-plus = { workspace = true } -schemars = { workspace = true } thiserror = { workspace = true } # Dependencies for interface @@ -60,6 +59,5 @@ abstract-client = { workspace = true } abstract-standalone = { workspace = true, features = ["test-utils"] } cw-orch = { workspace = true, features = ["daemon"] } cw-orch-interchain = { workspace = true, features = ["daemon"] } -cw-orch-starship = { version = "0.4.1" } env_logger = { version = "0.11.3" } my-standalone = { path = "." } diff --git a/modules/contracts/standalones/ica-owner/src/bin/publish.rs b/modules/contracts/standalones/ica-owner/src/bin/publish.rs index 9d85c49b83..e266f0145f 100644 --- a/modules/contracts/standalones/ica-owner/src/bin/publish.rs +++ b/modules/contracts/standalones/ica-owner/src/bin/publish.rs @@ -12,15 +12,14 @@ use my_standalone::MY_STANDALONE_ID; use abstract_client::{AbstractClient, Publisher}; use abstract_standalone::objects::namespace::Namespace; use clap::Parser; -use cw_orch::{anyhow, daemon::networks::parse_network, prelude::*, tokio::runtime::Runtime}; +use cw_orch::{anyhow, daemon::networks::parse_network, prelude::*}; use my_standalone::MyStandaloneInterface; fn publish(networks: Vec) -> anyhow::Result<()> { // run for each requested network for network in networks { // Setup - let rt = Runtime::new()?; - let chain = DaemonBuilder::new(network).handle(rt.handle()).build()?; + let chain = DaemonBuilder::new(network).build()?; let standalone_namespace = Namespace::from_id(MY_STANDALONE_ID)?; diff --git a/taplo.toml b/taplo.toml index 85e56f12e7..2c0e2f28cf 100644 --- a/taplo.toml +++ b/taplo.toml @@ -1,3 +1,5 @@ +exclude = ["workspace-hack/Cargo.toml"] + [formatting] align_entries = true column_width = 100