├── .circleci └── config.yml ├── .editorconfig ├── .gitattributes ├── .github ├── codecov.yml ├── labeler.yml ├── pull_request_template.md └── workflows │ ├── dead_url_linter.yml │ ├── framework-check.yml │ ├── framework-test.yml │ ├── gh-pages.yml │ ├── hakari.yml │ ├── interchain-test.yml │ ├── labeler.yml │ ├── manual-build.yml │ ├── modules-check.yml │ ├── modules-test.yml │ ├── release-artifacts.yml │ ├── release.yml │ └── wasm-builder.yml ├── .gitignore ├── Dockerfile ├── LICENSE ├── LICENSE.LESSER ├── README.md ├── framework ├── .cargo │ └── config.toml ├── .config │ └── hakari.toml ├── CHANGELOG.md ├── Cargo.lock ├── Cargo.toml ├── LICENSE ├── README.md ├── artifacts │ ├── abstract_account-xion.wasm │ ├── abstract_account.wasm │ ├── abstract_ans_host.wasm │ ├── abstract_ibc_client.wasm │ ├── abstract_ibc_host.wasm │ ├── abstract_ica_client.wasm │ ├── abstract_module_factory.wasm │ ├── abstract_registry.wasm │ └── checksums.txt ├── build_release.sh ├── contracts │ ├── account │ │ ├── .cargo │ │ │ └── config.toml │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── VERSIONING.md │ │ ├── examples │ │ │ └── schema.rs │ │ ├── src │ │ │ ├── config.rs │ │ │ ├── contract.rs │ │ │ ├── error.rs │ │ │ ├── execution.rs │ │ │ ├── lib.rs │ │ │ ├── migrate.rs │ │ │ ├── modules.rs │ │ │ ├── modules │ │ │ │ └── migration.rs │ │ │ ├── queries.rs │ │ │ ├── reply.rs │ │ │ ├── sub_account.rs │ │ │ └── versioning.rs │ │ └── tests │ │ │ ├── README.md │ │ │ ├── adapters.rs │ │ │ ├── apps.rs │ │ │ ├── create.rs │ │ │ ├── ibc_client.rs │ │ │ ├── install_modules.rs │ │ │ ├── proxy.rs │ │ │ ├── snapshots │ │ │ ├── adapters__account_install_adapter.snap │ │ │ ├── adapters__install_one_adapter.snap │ │ │ ├── adapters__install_one_adapter_with_fee.snap │ │ │ ├── adapters__installing_specific_version_should_install_expected.snap │ │ │ ├── adapters__reinstalling_adapter_should_be_allowed.snap │ │ │ ├── adapters__reinstalling_new_version_should_install_latest.snap │ │ │ ├── apps__account_install_app.snap │ │ │ ├── apps__execute_on_account.snap │ │ │ ├── apps__execute_on_proxy_through_manager.snap │ │ │ ├── install_modules__adds_module_to_account_modules.snap │ │ │ ├── proxy__account_install_multiple_modules.snap │ │ │ ├── proxy__account_install_standalone_modules.snap │ │ │ ├── proxy__account_with_response_data.snap │ │ │ ├── proxy__default_without_response_data.snap │ │ │ ├── proxy__exec_on_account.snap │ │ │ ├── proxy__exec_through_manager.snap │ │ │ ├── proxy__instantiate_account.snap │ │ │ ├── proxy__instantiate_proxy.snap │ │ │ ├── proxy__proxy_install_multiple_modules.snap │ │ │ ├── proxy__proxy_install_standalone_modules.snap │ │ │ ├── proxy__proxy_with_response_data.snap │ │ │ ├── subaccount__account_move_ownership_to_falsy_sub_account.snap │ │ │ ├── subaccount__account_move_ownership_to_sub_account.snap │ │ │ ├── subaccount__account_updating_on_subaccount_should_succeed.snap │ │ │ ├── subaccount__creating_on_subaccount_should_succeed.snap │ │ │ ├── subaccount__installed_app_updating_on_subaccount_should_succeed-contract1.snap │ │ │ ├── subaccount__installed_app_updating_on_subaccount_should_succeed.snap │ │ │ ├── subaccount__proxy_updating_on_subaccount_should_succeed.snap │ │ │ ├── subaccount__recursive_updating_on_subaccount_should_succeed.snap │ │ │ ├── subaccount__sub_account_move_ownership.snap │ │ │ ├── subaccount__sub_account_move_ownership_to_sub_account.snap │ │ │ └── subaccount__updating_on_subaccount_should_succeed.snap │ │ │ ├── standalones.rs │ │ │ ├── subaccount.rs │ │ │ ├── upgrades.rs │ │ │ └── xion.rs │ └── native │ │ ├── ans-host │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── examples │ │ │ └── schema.rs │ │ └── src │ │ │ ├── commands.rs │ │ │ ├── contract.rs │ │ │ ├── error.rs │ │ │ ├── lib.rs │ │ │ ├── queries.rs │ │ │ └── tests │ │ │ ├── common.rs │ │ │ ├── instantiate.rs │ │ │ ├── interact.rs │ │ │ ├── mock_querier.rs │ │ │ └── mod.rs │ │ ├── ibc-client │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── examples │ │ │ └── schema.rs │ │ ├── src │ │ │ ├── anybuf.rs │ │ │ ├── commands.rs │ │ │ ├── contract.rs │ │ │ ├── error.rs │ │ │ ├── ibc.rs │ │ │ ├── ics20.rs │ │ │ ├── lib.rs │ │ │ ├── queries.rs │ │ │ └── reply.rs │ │ └── tests │ │ │ ├── multihop_accounts.rs │ │ │ ├── snapshots │ │ │ └── multihop_accounts__multihop_account.snap │ │ │ └── token_transfers.rs │ │ ├── ibc-host │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── examples │ │ │ └── schema.rs │ │ ├── src │ │ │ ├── account_commands.rs │ │ │ ├── chains.rs │ │ │ ├── contract.rs │ │ │ ├── endpoints │ │ │ │ ├── execute.rs │ │ │ │ ├── instantiate.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── packet.rs │ │ │ │ ├── query.rs │ │ │ │ └── reply.rs │ │ │ ├── error.rs │ │ │ └── lib.rs │ │ └── tests │ │ │ └── integration.rs │ │ ├── ica-client │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── examples │ │ │ └── schema.rs │ │ └── src │ │ │ ├── chain_types │ │ │ ├── evm.rs │ │ │ └── mod.rs │ │ │ ├── contract.rs │ │ │ ├── error.rs │ │ │ ├── lib.rs │ │ │ └── queries.rs │ │ ├── module-factory │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── examples │ │ │ └── schema.rs │ │ ├── src │ │ │ ├── commands.rs │ │ │ ├── contract.rs │ │ │ ├── error.rs │ │ │ └── lib.rs │ │ └── tests │ │ │ ├── README.md │ │ │ ├── direct_calls.rs │ │ │ └── install_native_modules.rs │ │ └── registry │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── examples │ │ └── schema.rs │ │ ├── src │ │ ├── commands.rs │ │ ├── contract.rs │ │ ├── error.rs │ │ ├── lib.rs │ │ ├── migrate.rs │ │ └── queries.rs │ │ └── tests │ │ └── direct_calls.rs ├── development │ ├── IBC.md │ ├── JUNOD.md │ ├── Publishing.md │ ├── VERSIONING.md │ ├── ans-spec.md │ └── dep_graph.png ├── docs │ ├── .markdownlint.json │ ├── book.toml │ ├── mdbook-admonish.css │ ├── mermaid-init.js │ ├── mermaid.min.js │ ├── src │ │ ├── 0_introduction.md │ │ ├── 10_integrations.md │ │ ├── 11_contact.md │ │ ├── 1_products │ │ │ ├── 1_cw_orchestrator.md │ │ │ ├── 2_abstract_app_template.md │ │ │ ├── 3_abstract_testing.md │ │ │ ├── 4_abstract_js.md │ │ │ └── index.md │ │ ├── 2_introduction │ │ │ └── 1_design_space.md │ │ ├── 3_framework │ │ │ ├── 0_technologies.md │ │ │ ├── 1_abstract_sdk.md │ │ │ ├── 2_account_abstraction.md │ │ │ ├── 2_chain_abstraction.md │ │ │ ├── 3_architecture.md │ │ │ ├── 4_ownership.md │ │ │ ├── 5_modules.md │ │ │ ├── 6_module_types.md │ │ │ ├── 7_upgradability.md │ │ │ └── 8_ibc.md │ │ ├── 4_get_started │ │ │ ├── 10_ibc_capabilities.md │ │ │ ├── 11_ibc_testing.md │ │ │ ├── 1_index.md │ │ │ ├── 2_installation.md │ │ │ ├── 3_module_builder.md │ │ │ ├── 4_sdk.md │ │ │ ├── 5_abstract_client.md │ │ │ ├── 6_module_testing.md │ │ │ ├── 7_module_deployment.md │ │ │ ├── 8_dependencies.md │ │ │ ├── 9_metadata.md │ │ │ └── custom_endpoints.md │ │ ├── 5_platform │ │ │ ├── 1_ans.md │ │ │ ├── 2_registry.md │ │ │ ├── 3_account_creation.md │ │ │ ├── 4_account_console.md │ │ │ ├── 5_module_factory.md │ │ │ ├── 6_monetization.md │ │ │ ├── 8_modules.md │ │ │ └── index.md │ │ ├── 7_use_cases │ │ │ ├── 4t2.md │ │ │ ├── carrot.md │ │ │ ├── equilibrium.md │ │ │ ├── index.md │ │ │ └── xion.md │ │ ├── 9_glossary.md │ │ ├── SUMMARY.md │ │ ├── assets │ │ │ ├── docs_bg.png │ │ │ └── modules.svg │ │ ├── contributing.md │ │ ├── ibc │ │ │ ├── account-ibc.md │ │ │ └── module-ibc.md │ │ ├── modules │ │ │ ├── cw-staking.md │ │ │ ├── defi-adapters.md │ │ │ ├── dex.md │ │ │ ├── index.md │ │ │ ├── lending-market.md │ │ │ └── subscription.md │ │ ├── releases │ │ │ ├── CHANGELOG.md │ │ │ └── index.md │ │ ├── resources │ │ │ ├── abstract_platform │ │ │ │ ├── abstract_overview.webp │ │ │ │ └── twitter_cover-1.png │ │ │ ├── account_console │ │ │ │ ├── account_creation.webp │ │ │ │ ├── account_overview.webp │ │ │ │ ├── accounts.webp │ │ │ │ └── menu.webp │ │ │ └── get_started │ │ │ │ └── use-this-template.webp │ │ └── video_and_content │ │ │ ├── faq.md │ │ │ └── videos.md │ └── theme │ │ ├── book.js │ │ ├── css │ │ ├── chrome.css │ │ ├── general.css │ │ ├── print.css │ │ └── variables.css │ │ ├── favicon.svg │ │ ├── fonts │ │ └── BerkeleyMono-Regular.otf │ │ ├── highlight.css │ │ ├── highlight.js │ │ └── index.hbs ├── hooks │ └── pre-push.sh ├── justfile ├── packages │ ├── abstract-adapter │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src │ │ │ ├── endpoints.rs │ │ │ ├── endpoints │ │ │ ├── execute.rs │ │ │ ├── ibc_callback.rs │ │ │ ├── instantiate.rs │ │ │ ├── module_ibc.rs │ │ │ ├── query.rs │ │ │ ├── reply.rs │ │ │ └── sudo.rs │ │ │ ├── error.rs │ │ │ ├── features.rs │ │ │ ├── handler.rs │ │ │ ├── interface.rs │ │ │ ├── lib.rs │ │ │ ├── msgs.rs │ │ │ ├── schema.rs │ │ │ └── state.rs │ ├── abstract-app │ │ ├── Cargo.toml │ │ ├── examples │ │ │ └── counter.rs │ │ └── src │ │ │ ├── endpoints.rs │ │ │ ├── endpoints │ │ │ ├── execute.rs │ │ │ ├── ibc_callback.rs │ │ │ ├── instantiate.rs │ │ │ ├── migrate.rs │ │ │ ├── module_ibc.rs │ │ │ ├── query.rs │ │ │ ├── reply.rs │ │ │ └── sudo.rs │ │ │ ├── error.rs │ │ │ ├── features.rs │ │ │ ├── handler.rs │ │ │ ├── interface.rs │ │ │ ├── lib.rs │ │ │ ├── msgs.rs │ │ │ ├── schema.rs │ │ │ └── state.rs │ ├── abstract-client │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── src │ │ │ ├── account.rs │ │ │ ├── application.rs │ │ │ ├── builder.rs │ │ │ ├── client.rs │ │ │ ├── error.rs │ │ │ ├── infrastructure.rs │ │ │ ├── interchain │ │ │ │ ├── mod.rs │ │ │ │ ├── remote_account.rs │ │ │ │ └── remote_application.rs │ │ │ ├── lib.rs │ │ │ ├── mut_client.rs │ │ │ ├── publisher.rs │ │ │ ├── service.rs │ │ │ └── source.rs │ │ └── tests │ │ │ ├── abstract_interchain_client_builder.rs │ │ │ ├── integration.rs │ │ │ ├── interchain_integration.rs │ │ │ └── mock_service.rs │ ├── abstract-ica │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src │ │ │ ├── action.rs │ │ │ ├── chain_type.rs │ │ │ ├── lib.rs │ │ │ └── msg.rs │ ├── abstract-integration-tests │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src │ │ │ ├── account.rs │ │ │ ├── create.rs │ │ │ ├── lib.rs │ │ │ └── mock_modules.rs │ ├── abstract-interface │ │ ├── Cargo.toml │ │ ├── artifacts │ │ ├── build.rs │ │ ├── examples │ │ │ ├── deploy.rs │ │ │ ├── mock-ibc-deploy.rs │ │ │ └── starship-ibc-deploy.rs │ │ ├── src │ │ │ ├── account.rs │ │ │ ├── daemon_state.rs │ │ │ ├── deployers.rs │ │ │ ├── deployment.rs │ │ │ ├── error.rs │ │ │ ├── ibc.rs │ │ │ ├── interfaces.rs │ │ │ ├── lib.rs │ │ │ ├── migrate.rs │ │ │ └── native │ │ │ │ ├── ans_host.rs │ │ │ │ ├── ibc_client.rs │ │ │ │ ├── ibc_host.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── module_factory.rs │ │ │ │ └── registry.rs │ │ ├── state.json │ │ └── tests │ │ │ ├── instantiate_from_migration.rs │ │ │ ├── integration_tests.rs │ │ │ └── interchain_integration │ │ │ ├── bin │ │ │ ├── ibc_hook.rs │ │ │ └── pfm.rs │ │ │ ├── interchain_accounts.rs │ │ │ ├── mod.rs │ │ │ └── module_to_module_interactions.rs │ ├── abstract-macros │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── src │ │ │ └── lib.rs │ │ └── tests │ │ │ ├── abstract_response.rs │ │ │ ├── lib.rs │ │ │ └── with_abstract_event.rs │ ├── abstract-sdk │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src │ │ │ ├── account_action.rs │ │ │ ├── ans_resolve.rs │ │ │ ├── apis.rs │ │ │ ├── apis │ │ │ ├── adapter.rs │ │ │ ├── app.rs │ │ │ ├── authz.rs │ │ │ ├── bank.rs │ │ │ ├── distribution.rs │ │ │ ├── execution.rs │ │ │ ├── feegrant.rs │ │ │ ├── ibc.rs │ │ │ ├── ibc_memo.rs │ │ │ ├── ibc_memo │ │ │ │ ├── hooks.rs │ │ │ │ └── pfm.rs │ │ │ ├── modules.rs │ │ │ ├── respond.rs │ │ │ ├── splitter.rs │ │ │ ├── stargate │ │ │ │ ├── authz.rs │ │ │ │ ├── feegrant.rs │ │ │ │ ├── gov.rs │ │ │ │ └── mod.rs │ │ │ ├── traits.rs │ │ │ ├── verify.rs │ │ │ └── version_registry.rs │ │ │ ├── base │ │ │ ├── contract_base.rs │ │ │ ├── endpoints.rs │ │ │ ├── endpoints │ │ │ │ ├── execute.rs │ │ │ │ ├── ibc_callback.rs │ │ │ │ ├── instantiate.rs │ │ │ │ ├── migrate.rs │ │ │ │ ├── modules_ibc.rs │ │ │ │ ├── query.rs │ │ │ │ ├── reply.rs │ │ │ │ └── sudo.rs │ │ │ ├── features │ │ │ │ ├── abstract_name_service.rs │ │ │ │ ├── abstract_registry_access.rs │ │ │ │ ├── dependencies.rs │ │ │ │ ├── executor.rs │ │ │ │ ├── identification.rs │ │ │ │ ├── mod.rs │ │ │ │ └── module_identification.rs │ │ │ ├── handler.rs │ │ │ └── mod.rs │ │ │ ├── cw_helpers │ │ │ ├── cosmwasm_std │ │ │ │ ├── abstract_attributes.rs │ │ │ │ ├── mod.rs │ │ │ │ └── wasm_query.rs │ │ │ ├── cw_ownable.rs │ │ │ ├── fees.rs │ │ │ ├── migrate_instantiate.rs │ │ │ └── mod.rs │ │ │ ├── error.rs │ │ │ ├── feature_objects.rs │ │ │ ├── lib.rs │ │ │ ├── mock_module.rs │ │ │ └── prelude.rs │ ├── abstract-standalone │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── examples │ │ │ └── counter.rs │ │ └── src │ │ │ ├── endpoints.rs │ │ │ ├── endpoints │ │ │ ├── instantiate.rs │ │ │ └── migrate.rs │ │ │ ├── features.rs │ │ │ ├── lib.rs │ │ │ └── state.rs │ ├── abstract-std │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src │ │ │ ├── account.rs │ │ │ ├── adapter.rs │ │ │ ├── app.rs │ │ │ ├── base.rs │ │ │ ├── constants.rs │ │ │ ├── error.rs │ │ │ ├── lib.rs │ │ │ ├── native │ │ │ ├── ans_host.rs │ │ │ ├── ibc.rs │ │ │ ├── ibc │ │ │ │ ├── ibc_client.rs │ │ │ │ ├── ibc_host.rs │ │ │ │ ├── ica_client.rs │ │ │ │ └── polytone_callbacks.rs │ │ │ ├── mod.rs │ │ │ ├── module_factory.rs │ │ │ └── registry.rs │ │ │ ├── native_addrs.rs │ │ │ ├── objects │ │ │ ├── account │ │ │ │ ├── account_id.rs │ │ │ │ └── account_trace.rs │ │ │ ├── ans_asset.rs │ │ │ ├── ans_host.rs │ │ │ ├── dependency.rs │ │ │ ├── deposit_info.rs │ │ │ ├── entry │ │ │ │ ├── ans_entry_convertor.rs │ │ │ │ ├── asset_entry.rs │ │ │ │ ├── channel_entry.rs │ │ │ │ ├── contract_entry.rs │ │ │ │ ├── dex_asset_pairing.rs │ │ │ │ ├── lp_token.rs │ │ │ │ └── mod.rs │ │ │ ├── fee.rs │ │ │ ├── gov_type.rs │ │ │ ├── mod.rs │ │ │ ├── module.rs │ │ │ ├── module_factory.rs │ │ │ ├── module_reference.rs │ │ │ ├── module_version.rs │ │ │ ├── namespace.rs │ │ │ ├── ownership.rs │ │ │ ├── ownership │ │ │ │ ├── README.md │ │ │ │ ├── cw721.rs │ │ │ │ ├── gov_ownable.rs │ │ │ │ └── nested_admin.rs │ │ │ ├── pool │ │ │ │ ├── mod.rs │ │ │ │ ├── pool_id.rs │ │ │ │ ├── pool_metadata.rs │ │ │ │ ├── pool_reference.rs │ │ │ │ ├── pool_type.rs │ │ │ │ └── unique_pool_id.rs │ │ │ ├── registry.rs │ │ │ ├── salt.rs │ │ │ ├── storage_namespaces.rs │ │ │ ├── time_weighted_average.rs │ │ │ ├── truncated_chain_id.rs │ │ │ ├── validation │ │ │ │ ├── error.rs │ │ │ │ ├── mod.rs │ │ │ │ └── verifiers.rs │ │ │ └── voting.rs │ │ │ └── standalone.rs │ ├── abstract-testing │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src │ │ │ ├── abstract_mock_querier.rs │ │ │ ├── lib.rs │ │ │ ├── map_tester.rs │ │ │ ├── mock_ans.rs │ │ │ └── mock_querier.rs │ └── standards │ │ ├── dex │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src │ │ │ ├── action.rs │ │ │ ├── ans_action.rs │ │ │ ├── command.rs │ │ │ ├── error.rs │ │ │ ├── lib.rs │ │ │ ├── msg.rs │ │ │ └── tests.rs │ │ ├── money-market │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src │ │ │ ├── ans_action.rs │ │ │ ├── command.rs │ │ │ ├── error.rs │ │ │ ├── lib.rs │ │ │ ├── msg.rs │ │ │ ├── query.rs │ │ │ ├── raw_action.rs │ │ │ └── tests.rs │ │ ├── staking │ │ ├── Cargo.toml │ │ ├── README.md │ │ └── src │ │ │ ├── command.rs │ │ │ ├── error.rs │ │ │ ├── lib.rs │ │ │ └── msg.rs │ │ └── utils │ │ ├── Cargo.toml │ │ └── src │ │ ├── identity.rs │ │ ├── lib.rs │ │ └── util.rs ├── publish │ ├── publish.sh │ └── tag-release.sh ├── rustfmt.toml ├── taplo.toml └── workspace-hack │ ├── .gitattributes │ ├── Cargo.toml │ ├── build.rs │ └── src │ └── lib.rs ├── hooks └── pre-push.sh ├── integrations ├── Cargo.lock ├── Cargo.toml ├── README.md ├── astroport-adapter │ ├── Cargo.toml │ └── src │ │ ├── dex.rs │ │ ├── lib.rs │ │ └── staking.rs ├── astrovault-adapter │ ├── Cargo.toml │ └── src │ │ ├── dex.rs │ │ ├── lib.rs │ │ ├── mini_astrovault.rs │ │ └── staking.rs ├── bundles │ └── mockdex │ │ ├── Cargo.toml │ │ ├── src │ │ ├── lib.rs │ │ └── suite.rs │ │ └── tests │ │ ├── abstract.rs │ │ ├── staking.rs │ │ └── swap.rs ├── justfile ├── kujira-adapter │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── dex.rs │ │ ├── lib.rs │ │ ├── money_market.rs │ │ └── staking.rs ├── mars-adapter │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── lib.rs │ │ └── money_market.rs ├── neutron-dex-adapter │ ├── Cargo.toml │ └── src │ │ ├── dex.rs │ │ └── lib.rs ├── osmosis-adapter │ ├── Cargo.toml │ └── src │ │ ├── dex.rs │ │ ├── lib.rs │ │ └── staking.rs ├── taplo.toml └── wyndex-adapter │ ├── Cargo.toml │ └── src │ ├── dex.rs │ ├── lib.rs │ └── staking.rs ├── interchain ├── .cargo │ └── config.toml ├── Cargo.lock ├── Cargo.toml ├── four-chain-starship │ ├── Makefile │ ├── configs │ │ ├── four-junos.yaml │ │ └── two-junos.yaml │ └── port-forward.sh ├── framework-clone-testing │ ├── Cargo.toml │ ├── src │ │ ├── common.rs │ │ └── lib.rs │ └── tests │ │ ├── migrate.rs │ │ └── upgrade-account.rs ├── interchain-end_to_end_testing │ ├── Cargo.toml │ └── src │ │ ├── bin │ │ ├── ibc_hook.rs │ │ ├── ibc_hook_callback.rs │ │ ├── pfm.rs │ │ ├── setup_funds.rs │ │ └── token_bridge.rs │ │ └── lib.rs ├── modules-clone-testing │ ├── Cargo.toml │ ├── src │ │ ├── common.rs │ │ └── lib.rs │ └── tests │ │ ├── dex │ │ ├── astroport.rs │ │ ├── astrovault.rs │ │ └── mod.rs │ │ ├── money_market │ │ ├── mars.rs │ │ └── mod.rs │ │ ├── staking │ │ ├── astroport.rs │ │ ├── astrovault.rs │ │ └── mod.rs │ │ └── tests.rs ├── rustfmt.toml ├── scripts │ ├── Cargo.toml │ ├── IBC-DEPLOYMENT.md │ ├── README.md │ ├── src │ │ ├── abstract_ibc.rs │ │ ├── bin │ │ │ ├── clone_mock_test.rs │ │ │ ├── create_remote_account.rs │ │ │ ├── deploy_modules.rs │ │ │ ├── full_deploy.rs │ │ │ ├── ibc_connect.rs │ │ │ ├── ibc_disconnect.rs │ │ │ ├── ibc_test.rs │ │ │ ├── manual_deploy.rs │ │ │ ├── migrate.rs │ │ │ ├── proposal_template.rs │ │ │ ├── transfer_ownership.rs │ │ │ └── xion_test.rs │ │ └── lib.rs │ └── state.json └── taplo.toml ├── justfile ├── modules ├── .cargo │ └── config.toml ├── CHANGELOG.md ├── Cargo.lock ├── Cargo.toml ├── artifacts │ ├── abstract_cw_staking-archway.wasm │ ├── abstract_cw_staking-juno.wasm │ ├── abstract_cw_staking-kujira.wasm │ ├── abstract_cw_staking-osmosis.wasm │ ├── abstract_cw_staking.wasm │ ├── abstract_dex_adapter-archway.wasm │ ├── abstract_dex_adapter-juno.wasm │ ├── abstract_dex_adapter-kujira.wasm │ ├── abstract_dex_adapter-neutron.wasm │ ├── abstract_dex_adapter-osmosis.wasm │ ├── abstract_dex_adapter.wasm │ ├── abstract_money_market_adapter-kujira.wasm │ ├── abstract_money_market_adapter.wasm │ ├── abstract_subscription.wasm │ ├── abstract_tendermint_staking_adapter.wasm │ ├── calendar_app.wasm │ ├── challenge_app.wasm │ ├── checksums.txt │ ├── checksums_intermediate.txt │ ├── my_standalone.wasm │ ├── payment_app.wasm │ └── ping_pong.wasm ├── build_release.sh ├── contracts │ ├── adapters │ │ ├── STATUS.md │ │ ├── cw-staking │ │ │ ├── Cargo.toml │ │ │ ├── README.md │ │ │ ├── STATUS.md │ │ │ ├── examples │ │ │ │ ├── deploy.rs │ │ │ │ └── schema.rs │ │ │ ├── src │ │ │ │ ├── adapter.rs │ │ │ │ ├── contract.rs │ │ │ │ ├── handlers │ │ │ │ │ ├── execute.rs │ │ │ │ │ ├── mod.rs │ │ │ │ │ └── query.rs │ │ │ │ ├── lib.rs │ │ │ │ ├── resolver.rs │ │ │ │ └── staking_tester.rs │ │ │ └── tests │ │ │ │ ├── osmosis_stake.rs │ │ │ │ └── stake.rs │ │ ├── dex │ │ │ ├── Cargo.toml │ │ │ ├── README.md │ │ │ ├── STATUS.md │ │ │ ├── examples │ │ │ │ ├── deploy.rs │ │ │ │ ├── neutron_testnet.rs │ │ │ │ ├── osmosis_testnet.rs │ │ │ │ └── schema.rs │ │ │ ├── src │ │ │ │ ├── adapter.rs │ │ │ │ ├── api.rs │ │ │ │ ├── contract.rs │ │ │ │ ├── dex_tester.rs │ │ │ │ ├── exchanges │ │ │ │ │ ├── exchange_resolver.rs │ │ │ │ │ └── mod.rs │ │ │ │ ├── handlers │ │ │ │ │ ├── execute.rs │ │ │ │ │ ├── instantiate.rs │ │ │ │ │ ├── mod.rs │ │ │ │ │ └── query.rs │ │ │ │ ├── lib.rs │ │ │ │ └── state.rs │ │ │ └── tests │ │ │ │ ├── neutron.rs │ │ │ │ ├── osmosis.rs │ │ │ │ ├── raw.rs │ │ │ │ └── swap.rs │ │ ├── money-market │ │ │ ├── Cargo.toml │ │ │ ├── README.md │ │ │ ├── STATUS.md │ │ │ ├── examples │ │ │ │ ├── deploy.rs │ │ │ │ └── schema.rs │ │ │ └── src │ │ │ │ ├── adapter.rs │ │ │ │ ├── api.rs │ │ │ │ ├── contract.rs │ │ │ │ ├── handlers │ │ │ │ ├── execute.rs │ │ │ │ ├── instantiate.rs │ │ │ │ ├── mod.rs │ │ │ │ └── query.rs │ │ │ │ ├── lib.rs │ │ │ │ ├── platform_resolver.rs │ │ │ │ ├── state.rs │ │ │ │ └── tester.rs │ │ └── tendermint-staking │ │ │ ├── Cargo.toml │ │ │ ├── README.md │ │ │ ├── examples │ │ │ └── schema.rs │ │ │ └── src │ │ │ ├── contract.rs │ │ │ ├── error.rs │ │ │ ├── lib.rs │ │ │ ├── msg.rs │ │ │ └── staking.rs │ ├── apps │ │ ├── calendar │ │ │ ├── Cargo.toml │ │ │ ├── README.md │ │ │ ├── examples │ │ │ │ ├── deploy.rs │ │ │ │ ├── schema.rs │ │ │ │ └── test-local.rs │ │ │ ├── justfile │ │ │ ├── metadata.json │ │ │ ├── src │ │ │ │ ├── contract.rs │ │ │ │ ├── error.rs │ │ │ │ ├── handlers │ │ │ │ │ ├── execute.rs │ │ │ │ │ ├── instantiate.rs │ │ │ │ │ ├── migrate.rs │ │ │ │ │ ├── mod.rs │ │ │ │ │ └── query.rs │ │ │ │ ├── lib.rs │ │ │ │ ├── msg.rs │ │ │ │ └── state.rs │ │ │ └── tests │ │ │ │ ├── integration.rs │ │ │ │ └── wasm.rs │ │ ├── challenge │ │ │ ├── Cargo.toml │ │ │ ├── README.md │ │ │ ├── examples │ │ │ │ ├── deploy.rs │ │ │ │ └── schema.rs │ │ │ ├── justfile │ │ │ ├── metadata.json │ │ │ ├── src │ │ │ │ ├── contract.rs │ │ │ │ ├── error.rs │ │ │ │ ├── handlers │ │ │ │ │ ├── execute.rs │ │ │ │ │ ├── instantiate.rs │ │ │ │ │ ├── mod.rs │ │ │ │ │ └── query.rs │ │ │ │ ├── lib.rs │ │ │ │ ├── msg.rs │ │ │ │ └── state.rs │ │ │ └── tests │ │ │ │ ├── integrations.rs │ │ │ │ └── wasm.rs │ │ ├── payment │ │ │ ├── Cargo.toml │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── examples │ │ │ │ ├── deploy.rs │ │ │ │ └── schema.rs │ │ │ ├── metadata.json │ │ │ ├── src │ │ │ │ ├── contract.rs │ │ │ │ ├── error.rs │ │ │ │ ├── handlers │ │ │ │ │ ├── custom.rs │ │ │ │ │ ├── execute.rs │ │ │ │ │ ├── instantiate.rs │ │ │ │ │ ├── migrate.rs │ │ │ │ │ ├── mod.rs │ │ │ │ │ ├── query.rs │ │ │ │ │ └── receive.rs │ │ │ │ ├── lib.rs │ │ │ │ ├── msg.rs │ │ │ │ └── state.rs │ │ │ └── tests │ │ │ │ ├── integration.rs │ │ │ │ └── wasm.rs │ │ ├── ping-pong │ │ │ ├── Cargo.toml │ │ │ ├── README.md │ │ │ ├── examples │ │ │ │ └── deploy.rs │ │ │ ├── src │ │ │ │ ├── contract.rs │ │ │ │ ├── error.rs │ │ │ │ ├── handlers │ │ │ │ │ ├── execute.rs │ │ │ │ │ ├── instantiate.rs │ │ │ │ │ ├── mod.rs │ │ │ │ │ └── query.rs │ │ │ │ ├── ibc │ │ │ │ │ ├── callback.rs │ │ │ │ │ ├── mod.rs │ │ │ │ │ └── module.rs │ │ │ │ ├── lib.rs │ │ │ │ ├── msg.rs │ │ │ │ └── state.rs │ │ │ └── tests │ │ │ │ └── ping_pong_tests.rs │ │ └── subscription │ │ │ ├── Cargo.toml │ │ │ ├── README.md │ │ │ ├── examples │ │ │ ├── deploy.rs │ │ │ └── schema.rs │ │ │ ├── src │ │ │ ├── contract.rs │ │ │ ├── error.rs │ │ │ ├── handlers │ │ │ │ ├── custom.rs │ │ │ │ ├── execute.rs │ │ │ │ ├── instantiate.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── query.rs │ │ │ │ └── receive.rs │ │ │ ├── lib.rs │ │ │ ├── msg.rs │ │ │ └── state.rs │ │ │ └── tests │ │ │ └── integration.rs │ └── standalones │ │ └── ica-owner │ │ ├── Cargo.toml │ │ ├── README.md │ │ ├── resources │ │ └── cw_ica_controller.wasm │ │ ├── src │ │ ├── bin │ │ │ ├── publish.rs │ │ │ └── schema.rs │ │ ├── contract.rs │ │ ├── error.rs │ │ ├── interface.rs │ │ ├── lib.rs │ │ ├── msg.rs │ │ └── state.rs │ │ ├── starship │ │ ├── Makefile │ │ ├── configs │ │ │ └── osmo-juno.yaml │ │ └── port-forward.sh │ │ └── tests │ │ └── starship.rs ├── justfile ├── rustfmt.toml └── taplo.toml ├── rustfmt.toml ├── schema ├── account │ └── 0.26.1 │ │ └── abstract-account.json ├── ans-host │ └── 0.26.0 │ │ └── abstract-ans-host.json ├── calendar │ └── 0.3.0 │ │ ├── execute_msg.json │ │ ├── instantiate_msg.json │ │ ├── migrate_msg.json │ │ ├── module-schema.json │ │ └── query_msg.json ├── challenge │ └── 0.4.0 │ │ ├── execute_msg.json │ │ ├── instantiate_msg.json │ │ ├── migrate_msg.json │ │ ├── module-schema.json │ │ └── query_msg.json ├── cw-staking │ └── 0.26.0 │ │ ├── execute_msg.json │ │ ├── instantiate_msg.json │ │ ├── module-schema.json │ │ └── query_msg.json ├── dex │ └── 0.26.0 │ │ ├── adapter_response.json │ │ ├── execute_msg.json │ │ ├── instantiate_msg.json │ │ ├── module-schema.json │ │ └── query_msg.json ├── ibc-client │ └── 0.26.0 │ │ └── abstract-ibc-client.json ├── ibc-host │ └── 0.26.0 │ │ └── abstract-ibc-host.json ├── ica-client │ └── 0.26.0 │ │ └── abstract-ica-client.json ├── module-factory │ └── 0.26.0 │ │ └── abstract-module-factory.json ├── money-market │ └── 0.26.0 │ │ ├── execute_msg.json │ │ ├── instantiate_msg.json │ │ ├── module-schema.json │ │ └── query_msg.json ├── payment │ └── 0.4.0 │ │ ├── execute_msg.json │ │ ├── instantiate_msg.json │ │ ├── migrate_msg.json │ │ ├── module-schema.json │ │ └── query_msg.json ├── registry │ └── 0.26.0 │ │ └── abstract-registry.json ├── subscription │ └── 0.26.0 │ │ ├── execute_msg.json │ │ ├── instantiate_msg.json │ │ ├── migrate_msg.json │ │ ├── module-schema.json │ │ └── query_msg.json └── tendermint-staking │ └── 0.26.0 │ ├── execute_msg.json │ ├── instantiate_msg.json │ ├── module-schema.json │ └── query_msg.json ├── scripts ├── framework-coverage.sh ├── framework-schema.sh ├── modules-coverage-local.sh ├── modules-coverage.sh ├── modules-schema.sh ├── modules-tests.sh ├── wasm-all-ci.sh ├── wasm-all.sh ├── wasm-framework-ci.sh └── wasm-modules-ci.sh └── taplo.toml /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | charset = utf-8 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true 9 | 10 | [*.rs] 11 | indent_size = 4 12 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | **/artifacts/* binary 2 | **/schema/*.json linguist-generated=true 3 | **/snapshots/*.snap linguist-generated=true 4 | **/Cargo.lock linguist-generated=true 5 | -------------------------------------------------------------------------------- /.github/codecov.yml: -------------------------------------------------------------------------------- 1 | # ref: https://docs.codecov.com/docs/codecovyml-reference 2 | coverage: 3 | # Hold ourselves to a high bar 4 | range: 85..100 5 | round: down 6 | precision: 1 7 | status: 8 | # ref: https://docs.codecov.com/docs/commit-status 9 | project: 10 | default: 11 | # Avoid false negatives 12 | threshold: 1% 13 | 14 | # Test files aren't important for coverage 15 | ignore: 16 | - "tests" 17 | - "**/examples" 18 | - "**/schema.rs" 19 | 20 | # Make comments less noisy 21 | comment: 22 | layout: "files" 23 | require_changes: true 24 | 25 | component_management: 26 | individual_components: 27 | - component_id: framework # this is an identifier that should not be changed 28 | name: framework # this is a display name, and can be changed freely 29 | paths: 30 | - framework/ 31 | - component_id: modules # this is an identifier that should not be changed 32 | name: modules # this is a display name, and can be changed freely 33 | paths: 34 | - modules/ 35 | -------------------------------------------------------------------------------- /.github/labeler.yml: -------------------------------------------------------------------------------- 1 | # Note that any updates to this files will not be applied in CI 2 | # until this file is merged into main. This is due to oddities of the labeller Github Action. 3 | "account": 4 | # Match all of account folders 5 | - framework/contracts/account/**/* 6 | "native": 7 | # Match all of native folders 8 | - framework/contracts/native/**/* 9 | "breaking?": 10 | # Match all of abstract_std folders 11 | - framework/packages/abstract_std/**/* 12 | "sdk": 13 | # Match all of sdk folders 14 | - framework/packages/abstract-sdk/**/* 15 | "adapter_base": 16 | # Match all of adapter base folders 17 | - framework/packages/abstract-adapter/**/* 18 | "app_base": 19 | # Match all of app base folders 20 | - framework/packages/abstract-app/**/* 21 | "build": 22 | - build_release.sh 23 | "CI": 24 | - .github/**/*.yml 25 | # Add "C:documentation" label to documented related files and directories. 26 | "documentation": 27 | - README.md 28 | - framework/contracts/**/*.md 29 | - framework/contracts/**/*/*.md 30 | - framework/docs/src/**/* 31 | "interface": 32 | - framework/packages/abstract-interface/**/* 33 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | ### Checklist 2 | 3 | - [ ] CI is green. 4 | - [ ] Changelog updated. 5 | -------------------------------------------------------------------------------- /.github/workflows/dead_url_linter.yml: -------------------------------------------------------------------------------- 1 | name: Link Checker 2 | 3 | on: 4 | workflow_dispatch: 5 | schedule: 6 | # Runs at 00:00 UTC every Monday 7 | - cron: '0 0 * * 1' 8 | 9 | jobs: 10 | link_check: 11 | name: Check Links 12 | runs-on: ubuntu-latest 13 | strategy: 14 | matrix: 15 | url: 16 | - https://dev-orchestrator.abstract.money 17 | - https://dev-docs.abstract.money 18 | steps: 19 | - name: Check links at ${{ matrix.url }} 20 | id: linkcheck 21 | uses: filiph/linkcheck@3.0.0 22 | with: 23 | arguments: ${{ matrix.url }} 24 | - name: Notify on failure 25 | if: ${{ failure() }} 26 | uses: appleboy/discord-action@master 27 | with: 28 | webhook_id: ${{ secrets.LINTER_WEBHOOK_ID }} 29 | webhook_token: ${{ secrets.LINTER_WEBHOOK_TOKEN }} 30 | username: Abstract Link Checker 31 | avatar_url: https://d1nhio0ox7pgb.cloudfront.net/_img/g_collection_png/standard/256x256/link_broken.png 32 | message: | 33 | **:red_circle: Link Check Failed** 34 | **URL Checked:** ${{ matrix.url }} 35 | **Status:** Failure :x: 36 | **Action Details:** [View Run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) -------------------------------------------------------------------------------- /.github/workflows/hakari.yml: -------------------------------------------------------------------------------- 1 | on: 2 | push: 3 | branches: 4 | - main 5 | pull_request: 6 | branches: 7 | - main 8 | 9 | name: cargo hakari 10 | 11 | jobs: 12 | workspace-hack-check: 13 | name: Check workspace-hack 14 | runs-on: ubuntu-latest 15 | env: 16 | RUSTFLAGS: -D warnings 17 | steps: 18 | - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 19 | - uses: dtolnay/rust-toolchain@stable 20 | - name: Install cargo-hakari 21 | uses: taiki-e/install-action@3451569d988f3b0b3eaccd1d1b539a75ec96f192 # v2 22 | with: 23 | tool: cargo-hakari 24 | - name: Check workspace-hack Cargo.toml is up-to-date 25 | working-directory: ./framework 26 | run: cargo hakari generate --diff 27 | - name: Check all crates depend on workspace-hack 28 | working-directory: ./framework 29 | run: cargo hakari manage-deps --dry-run -------------------------------------------------------------------------------- /.github/workflows/labeler.yml: -------------------------------------------------------------------------------- 1 | name: "Pull Request Labeler" 2 | on: 3 | pull_request: 4 | branches: 5 | - main 6 | - dev 7 | 8 | jobs: 9 | labeler: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/labeler@v4.0.0 13 | with: 14 | repo-token: "${{ secrets.GITHUB_TOKEN }}" -------------------------------------------------------------------------------- /.github/workflows/manual-build.yml: -------------------------------------------------------------------------------- 1 | name: Manual CircleCI Wasm Builder 2 | 3 | # Job that updates the wasms of the mono-repo only if it is triggered manually. 4 | 5 | on: 6 | workflow_dispatch: # Trigger manually on any branch. 7 | 8 | jobs: 9 | build: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Tickle CircleCI 13 | env: 14 | CCI_TOKEN: ${{ secrets.CCI_TOKEN }} 15 | run: | 16 | BRANCH_NAME=$(echo "${GITHUB_REF}" | sed -e "s/refs\/heads\///") 17 | RESPONSE=$(curl -s -X POST \ 18 | -H "Circle-Token: ${CCI_TOKEN}" \ 19 | -H 'Content-Type: application/json' \ 20 | -H 'Accept: application/json' \ 21 | -d '{ 22 | "branch": "'"$BRANCH_NAME"'", 23 | 24 | "parameters": { 25 | "GHA_Meta": "build_wasms" 26 | } 27 | }' https://circleci.com/api/v2/project/gh/AbstractSDK/abstract/pipeline) 28 | 29 | echo "CircleCI Response: $RESPONSE" 30 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Release and Publish 2 | 3 | on: 4 | workflow_dispatch: 5 | pull_request: 6 | types: 7 | - opened 8 | branches: 9 | - 'release/*' 10 | 11 | jobs: 12 | build: 13 | runs-on: ubuntu-latest 14 | if: startsWith(github.ref, 'refs/heads/release/') || github.event_name == 'workflow_dispatch' 15 | steps: 16 | - name: Tickle CircleCI to Build Wasm Binaries 17 | env: 18 | CCI_TOKEN: ${{ secrets.CCI_TOKEN }} 19 | run: | 20 | BRANCH_NAME=$(echo "${GITHUB_REF}" | sed -e "s/refs\/heads\///") 21 | RESPONSE=$(curl -s -X POST \ 22 | -H "Circle-Token: ${CCI_TOKEN}" \ 23 | -H 'Content-Type: application/json' \ 24 | -H 'Accept: application/json' \ 25 | -d '{ 26 | "branch": "'"$BRANCH_NAME"'", 27 | 28 | "parameters": { 29 | "GHA_Meta": "build_commit_deploy" 30 | } 31 | }' https://circleci.com/api/v2/project/gh/AbstractSDK/abstract/pipeline) 32 | 33 | echo "CircleCI Response: $RESPONSE" 34 | -------------------------------------------------------------------------------- /.github/workflows/wasm-builder.yml: -------------------------------------------------------------------------------- 1 | name: CircleCI Wasm Builder 2 | 3 | # Job that updates the wasms of the mono-repo after a PR is merged to main. 4 | # Or if it is triggerd manually. 5 | 6 | on: 7 | workflow_dispatch: 8 | pull_request: 9 | types: 10 | - closed 11 | 12 | jobs: 13 | build: 14 | runs-on: ubuntu-latest 15 | if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch' 16 | steps: 17 | - name: Tickle CircleCI 18 | env: 19 | CCI_TOKEN: ${{ secrets.CCI_TOKEN }} 20 | run: | 21 | curl -X POST \ 22 | -H "Circle-Token: ${CCI_TOKEN}" \ 23 | -H 'Content-Type: application/json' \ 24 | -H 'Accept: application/json' \ 25 | -d '{ 26 | "branch": "main", 27 | "parameters": { 28 | "GHA_Meta": "build_wasms" 29 | } 30 | }' https://circleci.com/api/v2/project/gh/AbstractSDK/abstract/pipeline 31 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | **/target 2 | !framework/Cargo.lock 3 | 4 | # Remove Cargo.lock from gitignore if creating an executable, leave it for libraries 5 | # More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html 6 | **/.vscode 7 | **/.idea 8 | 9 | **/.env 10 | !**/.env.example 11 | 12 | **/node_modules 13 | 14 | # states 15 | **/*_local.json 16 | **/*state.json 17 | 18 | # These are backup files generated by rustfmt 19 | **/*.rs.bk 20 | 21 | # MacOS files 22 | **/.DS_Store 23 | 24 | # temporary dockerfiles 25 | **/docker* 26 | **/.dockerignore 27 | 28 | # Schemas 29 | framework/packages/**/schema 30 | framework/contracts/**/schema 31 | modules/contracts/**/schema 32 | 33 | # Release 34 | **/release 35 | 36 | # Docs 37 | **/docs/book 38 | 39 | # logs 40 | **/logs 41 | 42 | # New snapshots 43 | **/snapshots/*.snap.new 44 | 45 | **/artifacts -------------------------------------------------------------------------------- /framework/.cargo/config.toml: -------------------------------------------------------------------------------- 1 | [alias] 2 | schema = "run --example schema" 3 | wasm = "build --release --target wasm32-unknown-unknown" 4 | -------------------------------------------------------------------------------- /framework/.config/hakari.toml: -------------------------------------------------------------------------------- 1 | # This file contains settings for `cargo hakari`. 2 | # See https://docs.rs/cargo-hakari/latest/cargo_hakari/config for a full list of options. 3 | 4 | hakari-package = "workspace-hack" 5 | 6 | # Format version for hakari's output. Version 4 requires cargo-hakari 0.9.22 or above. 7 | dep-format-version = "4" 8 | 9 | # Setting workspace.resolver = "2" in the root Cargo.toml is HIGHLY recommended. 10 | # Hakari works much better with the new feature resolver. 11 | # For more about the new feature resolver, see: 12 | # https://blog.rust-lang.org/2021/03/25/Rust-1.51.0.html#cargos-new-feature-resolver 13 | resolver = "2" 14 | 15 | # Add triples corresponding to platforms commonly used by developers here. 16 | # https://doc.rust-lang.org/rustc/platform-support.html 17 | platforms = [ 18 | "x86_64-unknown-linux-gnu", 19 | # "x86_64-apple-darwin", 20 | "aarch64-apple-darwin", 21 | # "x86_64-pc-windows-msvc", 22 | ] 23 | 24 | # Write out exact versions rather than a semver range. (Defaults to false.) 25 | # exact-versions = true 26 | 27 | [final-excludes] 28 | workspace-members = ["abstract-macros"] 29 | -------------------------------------------------------------------------------- /framework/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | docs/src/releases/CHANGELOG.md -------------------------------------------------------------------------------- /framework/artifacts/abstract_account-xion.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AbstractSDK/abstract/d189643b849bc8176c07c916377bf979cc8ad3c8/framework/artifacts/abstract_account-xion.wasm -------------------------------------------------------------------------------- /framework/artifacts/abstract_account.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AbstractSDK/abstract/d189643b849bc8176c07c916377bf979cc8ad3c8/framework/artifacts/abstract_account.wasm -------------------------------------------------------------------------------- /framework/artifacts/abstract_ans_host.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AbstractSDK/abstract/d189643b849bc8176c07c916377bf979cc8ad3c8/framework/artifacts/abstract_ans_host.wasm -------------------------------------------------------------------------------- /framework/artifacts/abstract_ibc_client.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AbstractSDK/abstract/d189643b849bc8176c07c916377bf979cc8ad3c8/framework/artifacts/abstract_ibc_client.wasm -------------------------------------------------------------------------------- /framework/artifacts/abstract_ibc_host.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AbstractSDK/abstract/d189643b849bc8176c07c916377bf979cc8ad3c8/framework/artifacts/abstract_ibc_host.wasm -------------------------------------------------------------------------------- /framework/artifacts/abstract_ica_client.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AbstractSDK/abstract/d189643b849bc8176c07c916377bf979cc8ad3c8/framework/artifacts/abstract_ica_client.wasm -------------------------------------------------------------------------------- /framework/artifacts/abstract_module_factory.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AbstractSDK/abstract/d189643b849bc8176c07c916377bf979cc8ad3c8/framework/artifacts/abstract_module_factory.wasm -------------------------------------------------------------------------------- /framework/artifacts/abstract_registry.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AbstractSDK/abstract/d189643b849bc8176c07c916377bf979cc8ad3c8/framework/artifacts/abstract_registry.wasm -------------------------------------------------------------------------------- /framework/artifacts/checksums.txt: -------------------------------------------------------------------------------- 1 | 2b762f3ac65381f39dff37e08f5a0ccd7ab0e6c72e33cf4636f2261136f329bc abstract_account-xion.wasm 2 | 0cdd7d7604198a0a52571430013acabfe6d86d6ced2e665caeaf92f63108c163 abstract_account.wasm 3 | f5a034b452dc18e3c26253defa0b3b67beb61848d1a19c216f03e0b1737d5e56 abstract_ans_host.wasm 4 | b344d374793d3213fe3070fa41a1b6646648af440aabcc640818686af4d636c0 abstract_ibc_client.wasm 5 | d53935bf6121cbea4b10a56071cb6749a0bb128386db8ce8daddf3f64ddf10cc abstract_ibc_host.wasm 6 | 3d1dd9b70cc9d92b0d86cfe3f95222e363cacfef36b77c00375d1754486dd442 abstract_ica_client.wasm 7 | eefcf1c8acc404625f5eda66b8496efb8f8d15ee41ec72ccd62988cb99c202ee abstract_module_factory.wasm 8 | 1cbfb47264d1183e26fe22c45b39c19e755888fb211e5e3835ca187f95ec78f1 abstract_registry.wasm 9 | -------------------------------------------------------------------------------- /framework/build_release.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [[ $(arch) == "arm64" ]]; then 4 | image="cosmwasm/optimizer-arm64" 5 | else 6 | image="cosmwasm/optimizer" 7 | fi 8 | 9 | # Optimized builds 10 | docker run --rm -v "$(pwd)":/code \ 11 | --mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \ 12 | --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ 13 | ${image}:0.16.1 14 | -------------------------------------------------------------------------------- /framework/contracts/account/.cargo/config.toml: -------------------------------------------------------------------------------- 1 | # We run cargo schema on every module. Account needs "xion" feature to be enabled 2 | # Tracking issue: https://github.com/rust-lang/cargo/issues/4663 3 | [alias] 4 | schema = "run --features xion --example schema" 5 | wasm = "build --release --target wasm32-unknown-unknown" 6 | -------------------------------------------------------------------------------- /framework/contracts/account/README.md: -------------------------------------------------------------------------------- 1 | # Abstract Account 2 | -------------------------------------------------------------------------------- /framework/contracts/account/examples/schema.rs: -------------------------------------------------------------------------------- 1 | use abstract_account::msg::{ExecuteMsg, InstantiateMsg, MigrateMsg, QueryMsg}; 2 | use cosmwasm_schema::write_api; 3 | 4 | fn main() { 5 | write_api! { 6 | instantiate: InstantiateMsg, 7 | query: QueryMsg, 8 | execute: ExecuteMsg, 9 | migrate: MigrateMsg, 10 | }; 11 | } 12 | -------------------------------------------------------------------------------- /framework/contracts/account/tests/README.md: -------------------------------------------------------------------------------- 1 | # Tests covered 2 | 3 | ## Unit tests 4 | 5 | ## Integration tests 6 | 7 | ### Upgrades 8 | 9 | test 0.10.0 to 0.11.0 10 | -------------------------------------------------------------------------------- /framework/contracts/native/ans-host/README.md: -------------------------------------------------------------------------------- 1 | # Abstract Name Service 2 | -------------------------------------------------------------------------------- /framework/contracts/native/ans-host/examples/schema.rs: -------------------------------------------------------------------------------- 1 | use abstract_std::ans_host::{ExecuteMsg, InstantiateMsg, MigrateMsg, QueryMsg}; 2 | use cosmwasm_schema::write_api; 3 | 4 | fn main() { 5 | write_api! { 6 | instantiate: InstantiateMsg, 7 | query: QueryMsg, 8 | execute: ExecuteMsg, 9 | migrate: MigrateMsg, 10 | }; 11 | } 12 | -------------------------------------------------------------------------------- /framework/contracts/native/ans-host/src/error.rs: -------------------------------------------------------------------------------- 1 | use abstract_std::AbstractError; 2 | use cosmwasm_std::StdError; 3 | use cw_asset::AssetError; 4 | use thiserror::Error; 5 | 6 | #[derive(Error, Debug, PartialEq)] 7 | pub enum AnsHostError { 8 | #[error(transparent)] 9 | Std(#[from] StdError), 10 | 11 | #[error(transparent)] 12 | Abstract(#[from] AbstractError), 13 | 14 | #[error(transparent)] 15 | Asset(#[from] AssetError), 16 | 17 | #[error(transparent)] 18 | Ownership(#[from] cw_ownable::OwnershipError), 19 | 20 | #[error("{} assets is not within range [{}-{}]", provided, min, max)] 21 | InvalidAssetCount { 22 | min: usize, 23 | max: usize, 24 | provided: usize, 25 | }, 26 | 27 | #[error("Dex {} is not registered", dex)] 28 | UnregisteredDex { dex: String }, 29 | 30 | #[error("Asset {} is not registered", asset)] 31 | UnregisteredAsset { asset: String }, 32 | } 33 | -------------------------------------------------------------------------------- /framework/contracts/native/ans-host/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(all(coverage_nightly, test), feature(coverage_attribute))] 2 | 3 | pub mod commands; 4 | pub mod contract; 5 | pub mod error; 6 | pub mod queries; 7 | 8 | #[cfg(test)] 9 | #[cfg(not(target_arch = "wasm32"))] 10 | mod tests; 11 | 12 | #[cfg(test)] 13 | mod test_common { 14 | use abstract_std::ans_host::InstantiateMsg; 15 | use abstract_testing::{mock_env_validated, prelude::AbstractMockAddrs}; 16 | use cosmwasm_std::{testing::*, OwnedDeps, Response}; 17 | 18 | use crate::{contract, error::AnsHostError}; 19 | 20 | pub fn mock_init( 21 | deps: &mut OwnedDeps, 22 | ) -> Result { 23 | let abstr = AbstractMockAddrs::new(deps.api); 24 | let info = message_info(&abstr.owner, &[]); 25 | let admin = info.sender.to_string(); 26 | let env = mock_env_validated(deps.api); 27 | contract::instantiate(deps.as_mut(), env, info, InstantiateMsg { admin }) 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /framework/contracts/native/ans-host/src/tests/common.rs: -------------------------------------------------------------------------------- 1 | use abstract_std::ans_host::ExecuteMsg; 2 | use abstract_testing::mock_env_validated; 3 | use cosmwasm_std::{testing::*, Addr, OwnedDeps, Querier, Storage}; 4 | 5 | use crate::{contract, contract::AnsHostResult}; 6 | 7 | pub(crate) fn execute_as( 8 | deps: &mut OwnedDeps, 9 | sender: &Addr, 10 | msg: ExecuteMsg, 11 | ) -> AnsHostResult { 12 | let env = mock_env_validated(deps.api); 13 | contract::execute(deps.as_mut(), env, message_info(sender, &[]), msg) 14 | } 15 | -------------------------------------------------------------------------------- /framework/contracts/native/ans-host/src/tests/mod.rs: -------------------------------------------------------------------------------- 1 | mod common; 2 | mod instantiate; 3 | mod interact; 4 | mod mock_querier; 5 | -------------------------------------------------------------------------------- /framework/contracts/native/ibc-client/README.md: -------------------------------------------------------------------------------- 1 | # Abstract IBC Client 2 | 3 | The IBC client contract provides a way for Abstract Accounts to create Interchain Abstract Accounts (ICAA) on other chains. It relies on [Polytone](https://github.com/DA0-DA0/polytone) for IBC message forwarding. 4 | 5 | Users can enable IBC by calling the `ExecuteMsg::InstallModules` with the `abstract:ibc-client` module ID on their account. This will register the `abstract:ibc_client` with the account so it can be referenced by other applications. 6 | 7 | You can learn more about Abstract IBC [in our docs](https://docs.abstract.money/3_framework/8_ibc.html)! 8 | -------------------------------------------------------------------------------- /framework/contracts/native/ibc-client/examples/schema.rs: -------------------------------------------------------------------------------- 1 | use abstract_sdk::std::ibc_client::{ExecuteMsg, InstantiateMsg, MigrateMsg, QueryMsg}; 2 | use cosmwasm_schema::write_api; 3 | 4 | fn main() { 5 | write_api! { 6 | instantiate: InstantiateMsg, 7 | query: QueryMsg, 8 | execute: ExecuteMsg, 9 | migrate: MigrateMsg, 10 | }; 11 | } 12 | -------------------------------------------------------------------------------- /framework/contracts/native/ibc-client/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(all(coverage_nightly, test), feature(coverage_attribute))] 2 | 3 | mod anybuf; 4 | mod commands; 5 | pub mod contract; 6 | pub mod error; 7 | pub mod ibc; 8 | pub mod ics20; 9 | mod queries; 10 | pub mod reply; 11 | 12 | #[cfg(test)] 13 | mod test_common { 14 | use abstract_std::ibc_client::InstantiateMsg; 15 | use abstract_testing::{mock_env_validated, prelude::*}; 16 | use cosmwasm_std::{ 17 | testing::{message_info, MockApi}, 18 | OwnedDeps, 19 | }; 20 | 21 | use crate::{contract, contract::IbcClientResult}; 22 | 23 | pub fn mock_init(deps: &mut OwnedDeps) -> IbcClientResult { 24 | let abstr = AbstractMockAddrs::new(deps.api); 25 | let msg = InstantiateMsg {}; 26 | let info = message_info(&abstr.owner, &[]); 27 | let env = mock_env_validated(deps.api); 28 | contract::instantiate(deps.as_mut(), env, info, msg) 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /framework/contracts/native/ibc-client/tests/snapshots/multihop_accounts__multihop_account.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: contracts/native/ibc-client/tests/multihop_accounts.rs 3 | expression: all_storage 4 | snapshot_kind: text 5 | --- 6 | "abstract:ibc-client": 7 | - - "\u0000\u0002earemoteone" 8 | - "{\"polytone_note\":\"mock1mzdhwvvh22wrt07w59wxyd58822qavwkx5lcej7aqfkpqqlhaqfsetqc4t\",\"remote_abstract_host\":\"host\",\"remote_proxy\":\"host\"}" 9 | - - "\u0000\u0002ebmock1mzdhwvvh22wrt07w59wxyd58822qavwkx5lcej7aqfkpqqlhaqfsetqc4t" 10 | - "\"remoteone\"" 11 | - - "\u0000\u0002ec\u0000\tremoteone\u0000\tremotetwo\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0004\u0000\u0000\u0000*remoteone" 12 | - "\"remote_account\"" 13 | - - contract_info 14 | - "{\"contract\":\"abstract:ibc-client\",\"version\":\"0.26.0\"}" 15 | - - mod 16 | - "{\"module\":\"abstract:ibc-client\",\"version\":\"0.26.0\",\"dependencies\":[],\"metadata\":null}" 17 | - - ownership 18 | - "{\"owner\":\"mock1pgm8hyk0pvphmlvfjc8wsvk4daluz5tgrw6pu5mfpemk74uxnx9qwrtv4f\",\"pending_owner\":null,\"pending_expiry\":null}" 19 | -------------------------------------------------------------------------------- /framework/contracts/native/ibc-host/README.md: -------------------------------------------------------------------------------- 1 | # Abstract IBC host 2 | 3 | The Abstract IBC host is a contract designed to be deployed on an Abstract-deployed chain. It enables any Account on a remote chain to claim and perform cross-chain actions on an account on the local chain. 4 | 5 | ## Supported actions 6 | 7 | ### Register 8 | 9 | Register an Account by creating a local account. Incoming requests and funds will be routed to this account. 10 | 11 | ### Dispatch 12 | 13 | Proxy a set of execute messages to the Account's proxy on the host chain. 14 | 15 | ## IBC 16 | 17 | In order to connect this host contract to the client contract on a remote chain, one need to use an IBC protocol that can relay packets between chains. In our case, we use Polytone by DA0-DA0, which provides great flexibility and built in security (by not mixing up chains), as well as common channels with all other protocols that build cross chain apps. This allows for easier maintainability and collaboration. 18 | 19 | This host contract need to whitelist Polytone's execution proxy for each chain it communicates with. IBC Channels are therefore identified with the chain name, which allows for easy migration, even when the chain id changes! 20 | -------------------------------------------------------------------------------- /framework/contracts/native/ibc-host/examples/schema.rs: -------------------------------------------------------------------------------- 1 | use abstract_sdk::std::ibc_host::{ExecuteMsg, InstantiateMsg, MigrateMsg, QueryMsg}; 2 | use cosmwasm_schema::write_api; 3 | 4 | fn main() { 5 | write_api! { 6 | instantiate: InstantiateMsg, 7 | query: QueryMsg, 8 | execute: ExecuteMsg, 9 | migrate: MigrateMsg, 10 | }; 11 | } 12 | -------------------------------------------------------------------------------- /framework/contracts/native/ibc-host/src/chains.rs: -------------------------------------------------------------------------------- 1 | pub const OSMOSIS: &str = "osmosis"; 2 | pub const JUNO: &str = "juno"; 3 | pub const TERRA: &str = "terra2"; 4 | -------------------------------------------------------------------------------- /framework/contracts/native/ibc-host/src/endpoints/instantiate.rs: -------------------------------------------------------------------------------- 1 | use abstract_sdk::std::ibc_host::InstantiateMsg; 2 | use abstract_std::IBC_HOST; 3 | use cosmwasm_std::{DepsMut, Env, MessageInfo}; 4 | use cw2::set_contract_version; 5 | 6 | use crate::contract::{HostResponse, HostResult, CONTRACT_VERSION}; 7 | 8 | pub fn instantiate( 9 | deps: DepsMut, 10 | _env: Env, 11 | info: MessageInfo, 12 | _msg: InstantiateMsg, 13 | ) -> HostResult { 14 | set_contract_version(deps.storage, IBC_HOST, CONTRACT_VERSION)?; 15 | 16 | cw_ownable::initialize_owner(deps.storage, deps.api, Some(info.sender.as_str()))?; 17 | Ok(HostResponse::action("instantiate")) 18 | } 19 | -------------------------------------------------------------------------------- /framework/contracts/native/ibc-host/src/endpoints/mod.rs: -------------------------------------------------------------------------------- 1 | mod execute; 2 | mod instantiate; 3 | pub mod packet; 4 | mod query; 5 | pub(crate) mod reply; 6 | 7 | pub use execute::execute; 8 | pub use instantiate::instantiate; 9 | pub use query::query; 10 | -------------------------------------------------------------------------------- /framework/contracts/native/ibc-host/src/error.rs: -------------------------------------------------------------------------------- 1 | use abstract_std::{ 2 | objects::{ans_host::AnsHostError, registry::RegistryError}, 3 | AbstractError, 4 | }; 5 | use cosmwasm_std::{Instantiate2AddressError, StdError}; 6 | use cw_ownable::OwnershipError; 7 | use thiserror::Error; 8 | 9 | #[derive(Error, Debug, PartialEq)] 10 | pub enum HostError { 11 | #[error(transparent)] 12 | Std(#[from] StdError), 13 | 14 | #[error(transparent)] 15 | Abstract(#[from] AbstractError), 16 | 17 | #[error(transparent)] 18 | OwnershipError(#[from] OwnershipError), 19 | 20 | #[error(transparent)] 21 | RegistryError(#[from] RegistryError), 22 | 23 | #[error(transparent)] 24 | AnsHostError(#[from] AnsHostError), 25 | 26 | #[error(transparent)] 27 | Instantiate2AddressError(#[from] Instantiate2AddressError), 28 | 29 | #[error("Semver parsing error: {0}")] 30 | SemVer(String), 31 | 32 | #[error("Chain or account address already registered.")] 33 | ProxyAddressExists {}, 34 | 35 | #[error("Can't send a module-to-module packet to {0}, wrong module type")] 36 | WrongModuleAction(String), 37 | } 38 | 39 | impl From for HostError { 40 | fn from(err: semver::Error) -> Self { 41 | Self::SemVer(err.to_string()) 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /framework/contracts/native/ibc-host/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(all(coverage_nightly, test), feature(coverage_attribute))] 2 | 3 | pub use error::HostError; 4 | 5 | pub mod account_commands; 6 | pub mod chains; 7 | pub mod endpoints; 8 | pub mod error; 9 | 10 | pub mod contract; 11 | -------------------------------------------------------------------------------- /framework/contracts/native/ica-client/README.md: -------------------------------------------------------------------------------- 1 | # Abstract ICA Client 2 | 3 | The ICA client contract provides an interface for interacting with Interchain Accounts (ICAs) on different blockchains using the IBC protocol. 4 | 5 | ```mermaid 6 | flowchart 7 | subgraph Abstract ICA Support 8 | direction LR 9 | subgraph CosmWasm Chain 10 | PV[Polytone Voice] 11 | PP[Polytone Proxy] 12 | end 13 | 14 | subgraph Cosmos Chain 15 | A5[Interchain Account] 16 | end 17 | 18 | subgraph Ethereum Chain 19 | A6[Proxy] 20 | EV[EVM Voice] 21 | EV -.-> A6 22 | end 23 | 24 | subgraph CosmWasm Chain 25 | direction TB 26 | ICAC[ICA Client] 27 | A3 <-- Queries and Executes --> ICAC 28 | A3 -.-> PN[Polytone Note] 29 | A3 -.-> EN[EVM Note] 30 | A3 -.-> CI[CW ICA Controller] 31 | end 32 | 33 | User2[fa:fa-user User] -- owns --> A3["Abstract Account"] 34 | CI -.-> A5 35 | PN -.-> PV 36 | PV -.-> PP 37 | EN -.-> EV 38 | end 39 | ``` 40 | -------------------------------------------------------------------------------- /framework/contracts/native/ica-client/examples/schema.rs: -------------------------------------------------------------------------------- 1 | use abstract_ica::msg::{ExecuteMsg, InstantiateMsg, MigrateMsg, QueryMsg}; 2 | use cosmwasm_schema::write_api; 3 | 4 | fn main() { 5 | write_api! { 6 | instantiate: InstantiateMsg, 7 | query: QueryMsg, 8 | execute: ExecuteMsg, 9 | migrate: MigrateMsg, 10 | }; 11 | } 12 | -------------------------------------------------------------------------------- /framework/contracts/native/ica-client/src/chain_types/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod evm; 2 | -------------------------------------------------------------------------------- /framework/contracts/native/ica-client/src/error.rs: -------------------------------------------------------------------------------- 1 | use abstract_std::{ 2 | objects::{ans_host::AnsHostError, registry::RegistryError}, 3 | AbstractError, 4 | }; 5 | use cosmwasm_std::StdError; 6 | use thiserror::Error; 7 | 8 | #[derive(Error, Debug, PartialEq)] 9 | pub enum IcaClientError { 10 | #[error(transparent)] 11 | Std(#[from] StdError), 12 | 13 | #[error(transparent)] 14 | Abstract(#[from] AbstractError), 15 | 16 | #[error(transparent)] 17 | Ownership(#[from] cw_ownable::OwnershipError), 18 | 19 | #[error(transparent)] 20 | RegistryError(#[from] RegistryError), 21 | 22 | #[error(transparent)] 23 | AnsHostError(#[from] AnsHostError), 24 | 25 | #[error("chain {chain} has no associated type (evm/cosmos/...)")] 26 | NoChainType { chain: String }, 27 | 28 | #[error("No existing remote account and no recipient specified")] 29 | NoRecipient {}, 30 | 31 | #[error("messages for chain {chain} are not of type {ty}")] 32 | WrongChainType { chain: String, ty: String }, 33 | 34 | #[error("Chain already registered.")] 35 | ChainExists {}, 36 | } 37 | -------------------------------------------------------------------------------- /framework/contracts/native/ica-client/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(all(coverage_nightly, test), feature(coverage_attribute))] 2 | 3 | pub mod contract; 4 | pub mod error; 5 | pub use abstract_ica::msg; 6 | mod chain_types; 7 | mod queries; 8 | 9 | #[cfg(test)] 10 | mod test_common { 11 | use crate::msg::InstantiateMsg; 12 | use abstract_testing::{mock_env_validated, prelude::*}; 13 | use cosmwasm_std::{ 14 | testing::{message_info, MockApi}, 15 | OwnedDeps, 16 | }; 17 | 18 | use crate::{contract, contract::IcaClientResult}; 19 | 20 | pub fn mock_init(deps: &mut OwnedDeps) -> IcaClientResult { 21 | let abstr = AbstractMockAddrs::new(deps.api); 22 | let msg = InstantiateMsg { 23 | ans_host_address: abstr.ans_host.to_string(), 24 | registry_address: abstr.registry.to_string(), 25 | }; 26 | let info = message_info(&abstr.owner, &[]); 27 | let env = mock_env_validated(deps.api); 28 | 29 | contract::instantiate(deps.as_mut(), env, info, msg) 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /framework/contracts/native/module-factory/README.md: -------------------------------------------------------------------------------- 1 | # Module Factory 2 | -------------------------------------------------------------------------------- /framework/contracts/native/module-factory/examples/schema.rs: -------------------------------------------------------------------------------- 1 | use abstract_sdk::std::module_factory::*; 2 | use cosmwasm_schema::write_api; 3 | 4 | fn main() { 5 | write_api! { 6 | instantiate: InstantiateMsg, 7 | query: QueryMsg, 8 | execute: ExecuteMsg, 9 | migrate: MigrateMsg, 10 | }; 11 | } 12 | -------------------------------------------------------------------------------- /framework/contracts/native/module-factory/src/error.rs: -------------------------------------------------------------------------------- 1 | use abstract_std::{objects::registry::RegistryError, AbstractError}; 2 | use cosmwasm_std::{Instantiate2AddressError, StdError}; 3 | use cw_ownable::OwnershipError; 4 | use thiserror::Error; 5 | 6 | #[derive(Error, Debug, PartialEq)] 7 | pub enum ModuleFactoryError { 8 | #[error(transparent)] 9 | Std(#[from] StdError), 10 | 11 | #[error(transparent)] 12 | Abstract(#[from] AbstractError), 13 | 14 | #[error(transparent)] 15 | Ownership(#[from] OwnershipError), 16 | 17 | #[error(transparent)] 18 | Instantiate2AddressError(#[from] Instantiate2AddressError), 19 | 20 | #[error(transparent)] 21 | RegistryError(#[from] RegistryError), 22 | 23 | #[error("This module type can not be installed on your Account")] 24 | ModuleNotInstallable {}, 25 | } 26 | -------------------------------------------------------------------------------- /framework/contracts/native/module-factory/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(all(coverage_nightly, test), feature(coverage_attribute))] 2 | 3 | mod commands; 4 | pub mod contract; 5 | pub mod error; 6 | 7 | pub(crate) use abstract_sdk::std::module_factory::state; 8 | 9 | #[cfg(test)] 10 | mod test_common { 11 | use abstract_testing::{mock_env_validated, prelude::*}; 12 | use cosmwasm_std::{testing::*, Response}; 13 | 14 | use crate::{contract, error::ModuleFactoryError}; 15 | 16 | pub fn mock_init(deps: &mut MockDeps) -> Result { 17 | let abstr = AbstractMockAddrs::new(deps.api); 18 | let info = message_info(&abstr.owner, &[]); 19 | let env = mock_env_validated(deps.api); 20 | let admin = info.sender.to_string(); 21 | 22 | contract::instantiate( 23 | deps.as_mut(), 24 | env, 25 | info, 26 | abstract_std::module_factory::InstantiateMsg { admin }, 27 | ) 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /framework/contracts/native/module-factory/tests/README.md: -------------------------------------------------------------------------------- 1 | # Tests covered 2 | 3 | ## Unit tests 4 | 5 | - Messages 6 | 7 | ## Integration tests 8 | 9 | - Messages 10 | --- 11 | 12 | # Coverage 13 | -------------------------------------------------------------------------------- /framework/contracts/native/registry/README.md: -------------------------------------------------------------------------------- 1 | # Version Control 2 | -------------------------------------------------------------------------------- /framework/contracts/native/registry/examples/schema.rs: -------------------------------------------------------------------------------- 1 | use abstract_sdk::std::registry::{ExecuteMsg, InstantiateMsg, MigrateMsg, QueryMsg}; 2 | use cosmwasm_schema::write_api; 3 | 4 | fn main() { 5 | write_api! { 6 | instantiate: InstantiateMsg, 7 | query: QueryMsg, 8 | execute: ExecuteMsg, 9 | migrate: MigrateMsg, 10 | }; 11 | } 12 | -------------------------------------------------------------------------------- /framework/contracts/native/registry/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr(all(coverage_nightly, test), feature(coverage_attribute))] 2 | 3 | pub mod commands; 4 | pub mod contract; 5 | pub mod error; 6 | pub mod migrate; 7 | pub mod queries; 8 | -------------------------------------------------------------------------------- /framework/development/Publishing.md: -------------------------------------------------------------------------------- 1 | # Publish guide 2 | 3 | Publishing new abstract versions. 4 | 5 | 1. Bump the abstract versions of packages everywhere they are used. 6 | 7 | Now you should proceed with deploying the contracts to the different chains. We want to deploy to as many chains as possible because a new version of abstract-interfaces will have to be published when new chains are added. 8 | 9 | After deploying the contracts you can proceed with publishing the rest of the contracts. Before doing this ensure that: 10 | 11 | - You have the latest x86_64 artifacts in `./framework/artifacts`. These should be automatically committed by the CI before deployment is triggered. 12 | 13 | - You have all the latest addresses and code-ids in the `state.json` file located in the `abstract-interface` folder. 14 | 15 | You can then trigger the release by executing `./publish/publish.sh`. 16 | -------------------------------------------------------------------------------- /framework/development/dep_graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AbstractSDK/abstract/d189643b849bc8176c07c916377bf979cc8ad3c8/framework/development/dep_graph.png -------------------------------------------------------------------------------- /framework/docs/.markdownlint.json: -------------------------------------------------------------------------------- 1 | { 2 | "MD030": false, 3 | "MD013": false, 4 | "MD033": false 5 | } -------------------------------------------------------------------------------- /framework/docs/book.toml: -------------------------------------------------------------------------------- 1 | [book] 2 | authors = ["cyberhoward"] 3 | language = "en" 4 | multilingual = false 5 | src = "src" 6 | title = "Abstract Money" 7 | 8 | 9 | [build] 10 | create-missing = false 11 | 12 | [preprocessor] 13 | 14 | [preprocessor.admonish] 15 | assets_version = "3.0.2" # do not edit: managed by `mdbook-admonish install` 16 | command = "mdbook-admonish" 17 | 18 | [preprocessor.mermaid] 19 | command = "mdbook-mermaid" 20 | 21 | [output] 22 | 23 | [output.html] 24 | additional-css = ["./mdbook-admonish.css"] 25 | additional-js = ["mermaid.min.js", "mermaid-init.js"] 26 | curly-quotes = true 27 | default-theme = "abstract" 28 | edit-url-template = "https://github.com/AbstractSDK/abstract/edit/main/framework/docs/{path}" 29 | fold.enable = true 30 | git-repository-icon = "fa-github" 31 | git-repository-url = "https://github.com/AbstractSDK/abstract/tree/main/framework" 32 | no-section-label = true 33 | preferred-dark-theme = "abstract" 34 | # [output.linkcheck] 35 | -------------------------------------------------------------------------------- /framework/docs/mermaid-init.js: -------------------------------------------------------------------------------- 1 | mermaid.initialize({ 2 | startOnLoad:true, 3 | theme: ['light', 'rust'].includes(window.localStorage.getItem('mdbook-theme')) ? 'default' : 'dark', 4 | }); 5 | -------------------------------------------------------------------------------- /framework/docs/src/10_integrations.md: -------------------------------------------------------------------------------- 1 | # Abstract Integrations 2 | 3 | There are many integrations available for the Abstract SDK, and the list keeps expanding as the community and ourselves 4 | develops more modules. Here's a list of some of the projects we are currently integrated with: 5 | 6 | - **Dexes**: Osmosis, Kujira, Astroport, Astrovault, and Wyndex 7 | - **Lending Markets**: Mars, Kujira GHOST, Cavern Protocol 8 | - **Oracles**: Ojo Network (planned), NOIS network 9 | - **Wallets**: Any Cosmos wallet, MetaMask 10 | - **Automation**: CronCat, Neutron Cron, and off-chain automation 11 | - **Data**: Pulsar 12 | -------------------------------------------------------------------------------- /framework/docs/src/11_contact.md: -------------------------------------------------------------------------------- 1 | # Contact Abstract 2 | 3 | We'd love to hear from you! If you're a chain or application looking to integrate Abstract, please [schedule a call with us](https://meet.abstract.money). 4 | 5 | If you're a user and looking to provide feedback or feature requests, please [join our Discord](http://discord.gg/uch3Tq3aym) or [DM us on X](https://x.com/AbstractSDK). 6 | -------------------------------------------------------------------------------- /framework/docs/src/1_products/2_abstract_app_template.md: -------------------------------------------------------------------------------- 1 | # Abstract App Template 2 | 3 | The Abstract App Module Template is a starting point for developing apps that enable features or transform Abstract 4 | Accounts into standalone products. 5 | 6 | >For a deeper understanding of Abstract Accounts, please refer to the [abstract accounts](../3_framework/3_architecture.md) documentation. If you need a refresher about apps, consult the [app module documentation](../3_framework/6_module_types.md). 7 | 8 | The primary focus of the Abstract App Template is to provide a template for building a new Abstract App, as well as support for generating TypeScript client code for the contract, which can then be imported into a frontend application. 9 | 10 | ## Getting Started 11 | 12 | To get started, please go to the Abstract App 13 | Template Github Repo and follow the instructions in the README. 14 | 15 | In there you can find instructions on how to generate a new Abstract App, how to test it, deploy it, and generate 16 | TypeScript client code. 17 | -------------------------------------------------------------------------------- /framework/docs/src/1_products/4_abstract_js.md: -------------------------------------------------------------------------------- 1 | # Abstract JS 2 | 3 | Abstract.js is a comprehensive Typescript library designed to make integrating with an on-chain Abstract application as easy as possible. We based the SDK on [viem](https://viem.sh/), the most popular EVM Typescript library. 4 | 5 | ## Features 6 | - **Modular & Lightweight** 🏗️ : Built with ESM for tiny bundle sizes and tree-shaking optimizations 7 | - **Code Generation** 🛠️ : Auto-generate Typescript interfaces and classes for every Abstract module used by your app. 8 | functionalities required for on-chain operations. 9 | - **React Support** ⚛︎️: We have a huge library of hooks to make it easy to interact with Abstract Accounts, ICAAs, modules, and Abstract apps. 10 | - **Wallet-Provider Agnosticism**: We support Cosmos Kit, Graz, and XION's Abstraxion.js. Creating a new wallet provider is also easy and automatically-compatible. 11 | 12 | ## Installation 13 | 14 | ```admonish info 15 | Please refer to the Official Abstract.js Documentation. 16 | ``` 17 | 18 | To install the main library: 19 | 20 | ```bash 21 | npm i @abstract-money/core 22 | ``` 23 | 24 | For React-specific functionalities: 25 | 26 | ```bash 27 | npm i @abstract-money/react 28 | ``` 29 | -------------------------------------------------------------------------------- /framework/docs/src/1_products/index.md: -------------------------------------------------------------------------------- 1 | # Tools and Libraries 2 | 3 | At Abstract, we are dedicated to expanding the horizons of blockchain development through our innovative and 4 | ever-growing suite of products. Our products aim to simplify and enhance the development process, allowing creators to 5 | bring their visions to life with efficiency and security. 6 | 7 | ## [Abstract App Template](2_abstract_app_template.md) 8 | 9 | - **Quick Start**: Jumpstart your app development with our robust template. 10 | - **Integration Friendly**: Easy to integrate with existing systems. 11 | - **TypeScript Support**: Build with confidence using TypeScript. 12 | 13 | ## [CW-Orchestrator](1_cw_orchestrator.md) 14 | 15 | - **Scripting Power**: Simplify your interactions with CosmWasm contracts. 16 | - **Macros for Efficiency**: Generate type-safe interfaces to streamline your workflow. 17 | - **Code Reusability**: Use the same logic for testing and deployment. 18 | 19 | ## [Abstract JS](4_abstract_js.md) 20 | 21 | - **Seamless Interactions**: Engage with the blockchain from your web application effortlessly. 22 | - **Type Declarations**: Develop with type safety in mind. 23 | - **Comprehensive**: From queries to transactions, we've got you covered. 24 | -------------------------------------------------------------------------------- /framework/docs/src/4_get_started/9_metadata.md: -------------------------------------------------------------------------------- 1 | # Module Metadata 2 | 3 | Module metadata is a set of information that describes a module. This information is stored on-chain and can be accessed by anyone. The metadata includes the following fields: -------------------------------------------------------------------------------- /framework/docs/src/5_platform/3_account_creation.md: -------------------------------------------------------------------------------- 1 | # Account Creation 2 | 3 | As was covered in the section on Account Architecture an `Account` is just a single smart-contract that can act as a wallet. This means that creating an `Account` is as simple as instantiating a smart-contract. 4 | 5 | ## Account Parameters 6 | 7 | Accounts are created by instantiating an `Account` contract that has been registered with the `registry` contract. The `registry` contract is a contract that keeps track of all the modules and account code-ids and addresses on the Abstract platform. 8 | 9 | The `Account` contract takes the following parameters: 10 | 11 | ```rust,ignore 12 | {{#include ../../../packages/abstract-std/src/account.rs:init_msg}} 13 | ``` 14 | 15 | The account can be instantiated using the normal `instantiate` function or `instantiate2`, which allows you to claim deterministic addresses. 16 | 17 | During the instantiation process the account will self-register on the `registry` contract, making it queryable by its account-id. 18 | -------------------------------------------------------------------------------- /framework/docs/src/7_use_cases/4t2.md: -------------------------------------------------------------------------------- 1 | # FortyTwo Autocompounder 2 | 3 | FortyTwo, winner of the Cosmoverse 2023 pitch contest, aims to simplify access to the Cosmos ecosystem, acting as an 4 | entry point and yield aggregator for all IBC-enabled chains. It provides a unified user interface for yield farming, liquidity optimization, and portfolio tracking. 5 | 6 | FortyTwo built a dex-agnostic autocompounder application on Abstract, allowing for autocompounding any LP position in the interchain ecosystem. 7 | 8 | 9 | ## Modules 10 | 11 | - [Dex Adapter](../modules/dex.md) 12 | - [Staking Adapter](../modules/cw-staking.md) 13 | 14 | 15 | ## Architecture 16 | 17 | 18 | ```mermaid 19 | flowchart LR 20 | subgraph App[FortyTwo Autocompounder] 21 | direction LR 22 | Auto[Autocompounder]-.-> |swaps|Dex 23 | Auto -.-> |stakes|Staking 24 | Dex[/Dex/] --> AA["Abstract Account"] 25 | Auto --> AA 26 | Staking[/Staking/] --> AA 27 | end 28 | 29 | User[fa:fa-user User] -.-> |compound|App 30 | User -.-> |deposit|App 31 | User -.-> |withdraw|App 32 | ``` 33 | 34 | 35 | For more details about FortyTwo, please visit their official 36 | website. 37 | -------------------------------------------------------------------------------- /framework/docs/src/7_use_cases/carrot.md: -------------------------------------------------------------------------------- 1 | # Carrot Savings 2 | 3 | Carrot Savings is an interchain stablecoin yield aggregator and optimizer, designed to give users the best stablecoin yields using DeFi protocols. 4 | 5 | ```admonish info 6 | [Carrot Savings is live](https://carrotsavings.com)! Deposit and withdraw USDC and get over 20% yield (as of July 15, 2024). 7 | ``` 8 | 9 | ### Modules 10 | 11 | - [Dex Adapter](../modules/dex.md) 12 | - [Lending Market Adapter](../modules/lending-market.md) 13 | - Savings: stablecoin position management 14 | 15 | ## Architecture 16 | 17 | ```mermaid 18 | flowchart LR 19 | subgraph App[Carrot Savings] 20 | direction LR 21 | B[Savings] -.-> |provide_liquidity|Dex[/Dex/] 22 | B -.-> |lend / repay|Lending[/Lending/] 23 | Dex --> AA["Abstract Account"] 24 | B --> AA 25 | Lending --> AA 26 | end 27 | 28 | User[fa:fa-user User] -.-> |deposit|App 29 | User -.-> |withdraw|App 30 | Cron -.-> |autocompound|App 31 | ``` 32 | -------------------------------------------------------------------------------- /framework/docs/src/7_use_cases/equilibrium.md: -------------------------------------------------------------------------------- 1 | # Equilibrium Rebalancer 2 | 3 | Equilibrium, 1st place winner of HackWasm 2022, is a rebalancing protocol for DeFi portfolios. It allows users to create weighted baskets of assets and supports rebalancing of the portfolio using liquidity on any Dex in the interchain ecosystem, local or remote. 4 | 5 | 6 | ### Modules 7 | 8 | - [Dex Adapter](../modules/dex.md) 9 | - ETF: tokenizes the account and allows users to buy and sell shares 10 | - Balancer: handles basket weights and rebalancing logic 11 | 12 | 13 | ## Architecture 14 | 15 | ```mermaid 16 | flowchart LR 17 | subgraph App[Equilibrium] 18 | direction LR 19 | M[Balancer] -.-> |swaps|Dex 20 | M -.-> |updates shares|ETF 21 | Dex[/Dex/] --> AA["Abstract Account"] 22 | M --> AA 23 | ETF -- tokenizes --- AA 24 | end 25 | 26 | User[fa:fa-user User] -.-> |rebalance|App 27 | User -.-> |deposit|App 28 | User -.-> |withdraw|App 29 | User -.-> |update_weights|App 30 | ``` 31 | 32 | 33 | Read more on equilbrium on its official 34 | website. 35 | -------------------------------------------------------------------------------- /framework/docs/src/7_use_cases/xion.md: -------------------------------------------------------------------------------- 1 | # XION 2 | 3 | [XION](https://xion.burnt.com) is consumer-oriented chain focused on eliminating the complexities of Web3 interaction through "generalized abstraction," offering users the ability to interact with apps and liquidity on any chain. 4 | 5 | XION uses Abstract's [ICAAs](../3_framework/8_ibc.md) to enable chain abstraction and for full control and programmability of any chain over IBC. 6 | 7 | ```admonish info 8 | Mint an NFT on Neutron directly from XION [here](https://xion.abstract.money)! This demonstration walks you through each step of the process, though all actions can be fully abstracted away in practice. 9 | ``` 10 | 11 | ## Statistics 12 | 13 | As of July 15th, 2024, XION has: 14 | 15 | - 160K+ Abstract Accounts 16 | - 150K+ Interchain Abstract Accounts on Neutron 17 | - 400K+ Transactions, 300K of which were cross-chain 18 | 19 | ## Articles 20 | 21 | - [XION Launches Chain Abstraction to Neutron via Abstract](https://xion.burnt.com/blog/xion-launches-chain-abstraction-to-neutron-via-abstract) 22 | -------------------------------------------------------------------------------- /framework/docs/src/assets/docs_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AbstractSDK/abstract/d189643b849bc8176c07c916377bf979cc8ad3c8/framework/docs/src/assets/docs_bg.png -------------------------------------------------------------------------------- /framework/docs/src/modules/cw-staking.md: -------------------------------------------------------------------------------- 1 | {{#include ../../../../modules/contracts/adapters/cw-staking/README.md}} -------------------------------------------------------------------------------- /framework/docs/src/modules/dex.md: -------------------------------------------------------------------------------- 1 | {{#include ../../../../modules/contracts/adapters/dex/README.md}} -------------------------------------------------------------------------------- /framework/docs/src/modules/index.md: -------------------------------------------------------------------------------- 1 | # Modules 2 | 3 | The following modules are offered by Abstract and can be used in your applications to add additional functionality. Before you continue, make sure to learn about [what modules are](../3_framework/5_modules.md). 4 | 5 | drawing 6 | 7 | ## Adapters 8 | 9 | - [CW Staking](./cw-staking.md) 10 | - [Dex](./dex.md) 11 | - [Lending Market](./lending-market.md) 12 | 13 | ## App Modules 14 | 15 | - [Subscription](./subscription.md) 16 | 17 | Also check out [Awesome Abstract](https://github.com/AbstractSDK/awesome-abstract) to see modules that other teams may have built. 18 | -------------------------------------------------------------------------------- /framework/docs/src/modules/lending-market.md: -------------------------------------------------------------------------------- 1 | {{#include ../../../../modules/contracts/adapters/money-market/README.md}} 2 | -------------------------------------------------------------------------------- /framework/docs/src/modules/subscription.md: -------------------------------------------------------------------------------- 1 | {{#include ../../../../modules/contracts/apps/subscription/README.md}} -------------------------------------------------------------------------------- /framework/docs/src/releases/index.md: -------------------------------------------------------------------------------- 1 | # Releases 2 | 3 | Release notes for the official Abstract SDK releases. Each release note will tell you what’s new in each version, and will also describe any backwards-incompatible changes made in that version. 4 | 5 | #### Active Stable Version: [v0.23.0](./CHANGELOG.md#0210---2024-07-16) 6 | 7 | [**Changelog**](./CHANGELOG.md) 8 | 9 | All releases: 10 | 11 | - [0.24.0](./CHANGELOG.md#0230---yyyy-mm-dd) - Unreleased 12 | - [0.23.0](./CHANGELOG.md#0230---2024-07-16) - Stable 13 | - [0.22.1](./CHANGELOG.md#0221---2024-05-08) 14 | - [0.22 Announcement](https://medium.com/abstract-money/abstract-v0-22-simplifying-the-ibc-experience-77f06a324c4d) 15 | - [0.21.0](./CHANGELOG.md#0210---2024-02-20) 16 | - [0.20.0](./CHANGELOG.md#0200---2024-01-24) 17 | - [0.19.0](./CHANGELOG.md#0190---2023-09-26) 18 | - [0.17.2](./CHANGELOG.md#0172---2023-07-27) 19 | - [0.17.1](./CHANGELOG.md#0171---2023-07-26) 20 | - [0.17.0](./CHANGELOG.md#0170---2023-07-05) 21 | - [0.7.0](./CHANGELOG.md#070---2023-02-15) 22 | - [0.7.0](./CHANGELOG.md#070---2023-02-01) 23 | - [0.5.2](./CHANGELOG.md#052---2023-01-10) 24 | - [0.5.0](./CHANGELOG.md#050---2022-01-08) 25 | - [0.5.0](./CHANGELOG.md#050---2022-01-08-1) 26 | -------------------------------------------------------------------------------- /framework/docs/src/resources/abstract_platform/abstract_overview.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AbstractSDK/abstract/d189643b849bc8176c07c916377bf979cc8ad3c8/framework/docs/src/resources/abstract_platform/abstract_overview.webp -------------------------------------------------------------------------------- /framework/docs/src/resources/abstract_platform/twitter_cover-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AbstractSDK/abstract/d189643b849bc8176c07c916377bf979cc8ad3c8/framework/docs/src/resources/abstract_platform/twitter_cover-1.png -------------------------------------------------------------------------------- /framework/docs/src/resources/account_console/account_creation.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AbstractSDK/abstract/d189643b849bc8176c07c916377bf979cc8ad3c8/framework/docs/src/resources/account_console/account_creation.webp -------------------------------------------------------------------------------- /framework/docs/src/resources/account_console/account_overview.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AbstractSDK/abstract/d189643b849bc8176c07c916377bf979cc8ad3c8/framework/docs/src/resources/account_console/account_overview.webp -------------------------------------------------------------------------------- /framework/docs/src/resources/account_console/accounts.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AbstractSDK/abstract/d189643b849bc8176c07c916377bf979cc8ad3c8/framework/docs/src/resources/account_console/accounts.webp -------------------------------------------------------------------------------- /framework/docs/src/resources/account_console/menu.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AbstractSDK/abstract/d189643b849bc8176c07c916377bf979cc8ad3c8/framework/docs/src/resources/account_console/menu.webp -------------------------------------------------------------------------------- /framework/docs/src/resources/get_started/use-this-template.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AbstractSDK/abstract/d189643b849bc8176c07c916377bf979cc8ad3c8/framework/docs/src/resources/get_started/use-this-template.webp -------------------------------------------------------------------------------- /framework/docs/theme/css/print.css: -------------------------------------------------------------------------------- 1 | 2 | #sidebar, 3 | #menu-bar, 4 | .nav-chapters, 5 | .mobile-nav-chapters { 6 | display: none; 7 | } 8 | 9 | #page-wrapper.page-wrapper { 10 | transform: none; 11 | margin-left: 0px; 12 | overflow-y: initial; 13 | } 14 | 15 | #content { 16 | max-width: none; 17 | margin: 0; 18 | padding: 0; 19 | } 20 | 21 | .page { 22 | overflow-y: initial; 23 | } 24 | 25 | code { 26 | background-color: #666666; 27 | border-radius: 5px; 28 | 29 | /* Force background to be printed in Chrome */ 30 | -webkit-print-color-adjust: exact; 31 | } 32 | 33 | pre > .buttons { 34 | z-index: 2; 35 | } 36 | 37 | a, a:visited, a:active, a:hover { 38 | color: #4183c4; 39 | text-decoration: none; 40 | } 41 | 42 | h1, h2, h3, h4, h5, h6 { 43 | page-break-inside: avoid; 44 | page-break-after: avoid; 45 | } 46 | 47 | pre, code { 48 | page-break-inside: avoid; 49 | white-space: pre-wrap; 50 | } 51 | 52 | .fa { 53 | display: none !important; 54 | } 55 | -------------------------------------------------------------------------------- /framework/docs/theme/favicon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /framework/docs/theme/fonts/BerkeleyMono-Regular.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AbstractSDK/abstract/d189643b849bc8176c07c916377bf979cc8ad3c8/framework/docs/theme/fonts/BerkeleyMono-Regular.otf -------------------------------------------------------------------------------- /framework/packages/abstract-adapter/README.md: -------------------------------------------------------------------------------- 1 | # Abstract Adapter 2 | 3 | The Abstract Adapter base is a contract framework for non-migratable contracts with account execution privileges. 4 | -------------------------------------------------------------------------------- /framework/packages/abstract-adapter/src/endpoints/ibc_callback.rs: -------------------------------------------------------------------------------- 1 | use abstract_sdk::{base::IbcCallbackEndpoint, features::AbstractRegistryAccess}; 2 | use abstract_std::{ 3 | objects::module::{ModuleInfo, ModuleVersion}, 4 | AbstractError, IBC_CLIENT, 5 | }; 6 | use cosmwasm_std::{Addr, Deps}; 7 | 8 | use crate::{state::ContractError, AdapterContract}; 9 | 10 | impl 11 | IbcCallbackEndpoint 12 | for AdapterContract 13 | { 14 | fn ibc_client_addr(&self, deps: Deps) -> Result { 15 | let registry_query_result = self 16 | .abstract_registry(deps)? 17 | .query_module( 18 | ModuleInfo::from_id( 19 | IBC_CLIENT, 20 | ModuleVersion::from(abstract_ibc_client::contract::CONTRACT_VERSION), 21 | )?, 22 | &deps.querier, 23 | ) 24 | .map_err(Into::::into)?; 25 | 26 | Ok(registry_query_result.reference.unwrap_native()?) 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /framework/packages/abstract-adapter/src/endpoints/module_ibc.rs: -------------------------------------------------------------------------------- 1 | use crate::{state::ContractError, AdapterContract}; 2 | use abstract_sdk::{base::ModuleIbcEndpoint, features::AbstractRegistryAccess}; 3 | use abstract_std::{ 4 | objects::module::{ModuleInfo, ModuleVersion}, 5 | AbstractError, IBC_HOST, 6 | }; 7 | use cosmwasm_std::Addr; 8 | 9 | impl ModuleIbcEndpoint 10 | for AdapterContract 11 | { 12 | fn ibc_host(&self, deps: cosmwasm_std::Deps) -> Result { 13 | let registry_query_result = self 14 | .abstract_registry(deps)? 15 | .query_module( 16 | ModuleInfo::from_id( 17 | IBC_HOST, 18 | ModuleVersion::from(abstract_ibc_host::contract::CONTRACT_VERSION), 19 | )?, 20 | &deps.querier, 21 | ) 22 | .map_err(Into::::into)?; 23 | 24 | Ok(registry_query_result.reference.unwrap_native()?) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /framework/packages/abstract-adapter/src/endpoints/sudo.rs: -------------------------------------------------------------------------------- 1 | use abstract_sdk::base::SudoEndpoint; 2 | 3 | use crate::{state::ContractError, AdapterContract}; 4 | 5 | impl SudoEndpoint 6 | for AdapterContract 7 | { 8 | } 9 | 10 | #[cfg(test)] 11 | mod tests { 12 | use abstract_testing::mock_env_validated; 13 | use cosmwasm_std::testing::mock_dependencies; 14 | 15 | use crate::mock::{sudo, AdapterMockResult}; 16 | 17 | #[coverage_helper::test] 18 | fn endpoint() -> AdapterMockResult { 19 | let mut deps = mock_dependencies(); 20 | let env = mock_env_validated(deps.api); 21 | deps.querier = abstract_testing::abstract_mock_querier(deps.api); 22 | let sudo_msg = crate::mock::MockSudoMsg {}; 23 | let res = sudo(deps.as_mut(), env, sudo_msg)?; 24 | assert_eq!(res.messages.len(), 0); 25 | // confirm data is set 26 | assert_eq!(res.data, Some("mock_sudo".as_bytes().into())); 27 | 28 | Ok(()) 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /framework/packages/abstract-adapter/src/handler.rs: -------------------------------------------------------------------------------- 1 | use abstract_sdk::base::{AbstractContract, Handler}; 2 | use cosmwasm_std::Empty; 3 | 4 | use crate::{state::ContractError, AdapterContract}; 5 | 6 | impl Handler 7 | for AdapterContract 8 | { 9 | type Error = Error; 10 | type CustomInitMsg = InitMsg; 11 | type CustomExecMsg = ExecMsg; 12 | type CustomQueryMsg = QueryMsg; 13 | type CustomMigrateMsg = Empty; 14 | type SudoMsg = SudoMsg; 15 | 16 | fn contract(&self) -> &AbstractContract { 17 | &self.contract 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /framework/packages/abstract-app/src/endpoints/ibc_callback.rs: -------------------------------------------------------------------------------- 1 | use abstract_sdk::features::AbstractRegistryAccess; 2 | use abstract_std::{ 3 | objects::module::{ModuleInfo, ModuleVersion}, 4 | IBC_CLIENT, 5 | }; 6 | use cosmwasm_std::Addr; 7 | 8 | use crate::{state::ContractError, AppContract, IbcCallbackEndpoint}; 9 | 10 | impl< 11 | Error: ContractError, 12 | CustomInitMsg, 13 | CustomExecMsg, 14 | CustomQueryMsg, 15 | CustomMigrateMsg, 16 | SudoMsg, 17 | > IbcCallbackEndpoint 18 | for AppContract 19 | { 20 | fn ibc_client_addr(&self, deps: cosmwasm_std::Deps) -> Result { 21 | let registry_query_result = self 22 | .abstract_registry(deps)? 23 | .query_module( 24 | ModuleInfo::from_id( 25 | IBC_CLIENT, 26 | ModuleVersion::from(abstract_ibc_client::contract::CONTRACT_VERSION), 27 | )?, 28 | &deps.querier, 29 | ) 30 | .map_err(Into::::into)?; 31 | 32 | Ok(registry_query_result.reference.unwrap_native()?) 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /framework/packages/abstract-app/src/endpoints/module_ibc.rs: -------------------------------------------------------------------------------- 1 | use abstract_sdk::{base::ModuleIbcEndpoint, features::AbstractRegistryAccess}; 2 | use abstract_std::{ 3 | objects::module::{ModuleInfo, ModuleVersion}, 4 | IBC_HOST, 5 | }; 6 | use cosmwasm_std::Addr; 7 | 8 | use crate::{state::ContractError, AppContract}; 9 | 10 | impl< 11 | Error: ContractError, 12 | CustomInitMsg, 13 | CustomExecMsg, 14 | CustomQueryMsg, 15 | CustomMigrateMsg, 16 | SudoMsg, 17 | > ModuleIbcEndpoint 18 | for AppContract 19 | { 20 | fn ibc_host(&self, deps: cosmwasm_std::Deps) -> Result { 21 | let registry_query_result = self 22 | .abstract_registry(deps)? 23 | .query_module( 24 | ModuleInfo::from_id( 25 | IBC_HOST, 26 | ModuleVersion::from(abstract_ibc_host::contract::CONTRACT_VERSION), 27 | )?, 28 | &deps.querier, 29 | ) 30 | .map_err(Into::::into)?; 31 | 32 | Ok(registry_query_result.reference.unwrap_native()?) 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /framework/packages/abstract-app/src/endpoints/reply.rs: -------------------------------------------------------------------------------- 1 | use crate::{state::ContractError, AppContract, ReplyEndpoint}; 2 | 3 | impl< 4 | Error: ContractError, 5 | CustomInitMsg, 6 | CustomExecMsg, 7 | CustomQueryMsg, 8 | CustomMigrateMsg, 9 | SudoMsg, 10 | > ReplyEndpoint 11 | for AppContract 12 | { 13 | } 14 | -------------------------------------------------------------------------------- /framework/packages/abstract-app/src/endpoints/sudo.rs: -------------------------------------------------------------------------------- 1 | use abstract_sdk::base::SudoEndpoint; 2 | 3 | use crate::{state::ContractError, AppContract}; 4 | 5 | impl< 6 | Error: ContractError, 7 | CustomInitMsg, 8 | CustomExecMsg, 9 | CustomQueryMsg, 10 | CustomMigrateMsg, 11 | SudoMsg, 12 | > SudoEndpoint 13 | for AppContract 14 | { 15 | } 16 | -------------------------------------------------------------------------------- /framework/packages/abstract-app/src/error.rs: -------------------------------------------------------------------------------- 1 | use cw_controllers::AdminError; 2 | use thiserror::Error; 3 | 4 | #[derive(Error, Debug, PartialEq)] 5 | pub enum AppError { 6 | #[error(transparent)] 7 | Admin(#[from] AdminError), 8 | } 9 | -------------------------------------------------------------------------------- /framework/packages/abstract-app/src/handler.rs: -------------------------------------------------------------------------------- 1 | use crate::{state::ContractError, AbstractContract, AppContract, Handler}; 2 | 3 | impl Handler 4 | for AppContract 5 | { 6 | type Error = Error; 7 | type CustomInitMsg = InitMsg; 8 | type CustomExecMsg = ExecMsg; 9 | type CustomQueryMsg = QueryMsg; 10 | type CustomMigrateMsg = MigrateMsg; 11 | type SudoMsg = SudoMsg; 12 | 13 | fn contract(&self) -> &AbstractContract { 14 | &self.contract 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /framework/packages/abstract-client/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![doc = include_str!("../README.md")] 2 | #![warn(missing_docs)] 3 | #![cfg_attr(all(coverage_nightly, test), feature(coverage_attribute))] 4 | pub(crate) mod account; 5 | mod application; 6 | pub mod builder; 7 | mod client; 8 | mod error; 9 | pub(crate) mod infrastructure; 10 | #[cfg(feature = "test-utils")] 11 | mod mut_client; 12 | mod publisher; 13 | mod service; 14 | pub(crate) mod source; 15 | 16 | #[cfg(feature = "interchain")] 17 | mod interchain; 18 | 19 | // Re-export common used types 20 | pub use abstract_std::objects::{gov_type::GovernanceDetails, namespace::Namespace}; 21 | // Re-export `ClientResolve` trait 22 | pub use abstract_interface::ClientResolve; 23 | pub use account::{Account, AccountBuilder}; 24 | pub use application::Application; 25 | pub use builder::AbstractClientBuilder; 26 | pub use client::AbstractClient; 27 | pub use error::AbstractClientError; 28 | pub use infrastructure::Environment; 29 | pub use publisher::Publisher; 30 | pub use service::Service; 31 | pub use source::AccountSource; 32 | 33 | #[cfg(feature = "interchain")] 34 | pub use interchain::*; 35 | -------------------------------------------------------------------------------- /framework/packages/abstract-client/src/source.rs: -------------------------------------------------------------------------------- 1 | use abstract_std::objects::{namespace::Namespace, AccountId}; 2 | use cosmwasm_std::Addr; 3 | 4 | /// Represents the a route to fetch an account from. 5 | pub enum AccountSource { 6 | /// Get the account from a registered [`Namespace`]. 7 | Namespace(Namespace), 8 | /// Get the account from an [`AccountId`]. 9 | AccountId(AccountId), 10 | /// Get the account from the address of an installed App. 11 | App(Addr), 12 | } 13 | 14 | impl From for AccountSource { 15 | fn from(namespace: Namespace) -> Self { 16 | AccountSource::Namespace(namespace) 17 | } 18 | } 19 | 20 | impl From for AccountSource { 21 | fn from(account_id: AccountId) -> Self { 22 | AccountSource::AccountId(account_id) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /framework/packages/abstract-ica/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = { workspace = true } 3 | description = "Abstract Interchain Account (ICA) Types" 4 | edition = { workspace = true } 5 | license = { workspace = true } 6 | name = "abstract-ica" 7 | readme = "README.md" 8 | repository = "https://github.com/AbstractSDK/abstract" 9 | version = { workspace = true } 10 | 11 | 12 | [features] 13 | # for quicker tests, cargo test --lib 14 | 15 | [dependencies] 16 | cosmwasm-schema = { workspace = true } 17 | cosmwasm-std = { workspace = true, features = ["iterator"] } 18 | cw-ownable = { workspace = true } 19 | map-macro = "0.3.0" 20 | 21 | abstract-sdk = { workspace = true } 22 | cw-orch = { workspace = true } 23 | 24 | # EVM 25 | polytone-evm = { version = "0.1.0" } 26 | 27 | [target.'cfg(not(target_arch = "wasm32"))'.dependencies] 28 | workspace-hack = { version = "0.1", path = "../../workspace-hack" } 29 | 30 | [dev-dependencies] 31 | abstract-testing = { path = "../abstract-testing" } 32 | anyhow = { workspace = true } 33 | coverage-helper = { workspace = true } 34 | cw20-base = { workspace = true } 35 | rstest = { workspace = true } 36 | -------------------------------------------------------------------------------- /framework/packages/abstract-ica/README.md: -------------------------------------------------------------------------------- 1 | # Abstract ICA 2 | 3 | This crate contains the types required to interact with Interchain Accounts (ICAs) on different chains, using different technologies. It is used by the Abstract IBC Client to interact with ICAs on chains that support it. 4 | -------------------------------------------------------------------------------- /framework/packages/abstract-ica/src/action.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_std::{Binary, Coin, CosmosMsg}; 2 | 3 | /// Interchain Account Action 4 | #[cosmwasm_schema::cw_serde] 5 | #[non_exhaustive] 6 | pub enum IcaAction { 7 | // Execute on the ICA 8 | Execute(IcaExecute), 9 | // Query on the ICA 10 | // Query(IcaQuery), 11 | // Send funds to the ICA 12 | Fund { 13 | funds: Vec, 14 | // Optional receiver address 15 | // Should be formatted in expected formatting 16 | // EVM: HexBinary 17 | // Cosmos: Addr 18 | receiver: Option, 19 | memo: Option, 20 | }, 21 | // ... other actions? 22 | } 23 | 24 | #[cosmwasm_schema::cw_serde] 25 | #[non_exhaustive] 26 | pub enum IcaExecute { 27 | Evm { 28 | msgs: Vec>, 29 | callback: Option, 30 | }, 31 | // Cosmos { 32 | // msgs: Vec, 33 | // callback: Option, 34 | // }, 35 | } 36 | 37 | // pub enum IcaQuery { 38 | // Evm { 39 | // // encoded data 40 | // // ... 41 | // }, 42 | // Cosmos { 43 | // // Encoded data 44 | // // ... 45 | // } 46 | // } 47 | 48 | #[cosmwasm_schema::cw_serde] 49 | pub struct IcaActionResponse { 50 | /// messages that call the underlying implementations (be it polytone/cw-ica-controller/etc) 51 | pub msgs: Vec, 52 | } 53 | -------------------------------------------------------------------------------- /framework/packages/abstract-ica/src/lib.rs: -------------------------------------------------------------------------------- 1 | mod action; 2 | mod chain_type; 3 | pub mod msg; 4 | 5 | pub use action::{IcaAction, IcaActionResponse, IcaExecute}; 6 | pub use chain_type::{CastChainType, ChainType}; 7 | 8 | pub use polytone_evm::EVM_NOTE_ID; 9 | pub use polytone_evm::POLYTONE_EVM_VERSION; 10 | -------------------------------------------------------------------------------- /framework/packages/abstract-integration-tests/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "Package with environment-agnonstic tests" 3 | edition = { workspace = true } 4 | license = { workspace = true } 5 | name = "abstract-integration-tests" 6 | version = { workspace = true } 7 | 8 | [dependencies] 9 | abstract-account = { path = "../../contracts/account" } 10 | abstract-adapter = { workspace = true, features = ["test-utils"] } 11 | abstract-app = { workspace = true, features = ["test-utils"] } 12 | abstract-interface = { workspace = true } 13 | cosmwasm-std = { workspace = true } 14 | semver = { workspace = true } 15 | 16 | abstract-sdk.workspace = true 17 | abstract-std.workspace = true 18 | abstract-testing.workspace = true 19 | anyhow.workspace = true 20 | cosmwasm-schema = { workspace = true } 21 | cw-orch = { workspace = true } 22 | cw2 = { workspace = true } 23 | 24 | [target.'cfg(not(target_arch = "wasm32"))'.dependencies] 25 | workspace-hack = { version = "0.1", path = "../../workspace-hack" } 26 | -------------------------------------------------------------------------------- /framework/packages/abstract-integration-tests/README.md: -------------------------------------------------------------------------------- 1 | # Integration Tests Outline 2 | 3 | ## Account Creation 4 | 5 | - Create account with namespace fee 6 | 7 | ## Account 8 | 9 | - Install an App 10 | - Sub account with adapters and apps 11 | - Account with monetized adapters and modules 12 | - Install app with instantiation account call 13 | - Upgrade adapters 14 | - Uninstall modules 15 | - Install adapter with fee 16 | - Module action with response data 17 | - Change account ownership to sub-account 18 | -------------------------------------------------------------------------------- /framework/packages/abstract-interface/artifacts: -------------------------------------------------------------------------------- 1 | ../../artifacts/ -------------------------------------------------------------------------------- /framework/packages/abstract-interface/examples/deploy.rs: -------------------------------------------------------------------------------- 1 | use abstract_interface::{Abstract, AccountI}; 2 | use abstract_std::objects::gov_type::GovernanceDetails; 3 | use cw_orch::{ 4 | daemon::networks::LOCAL_JUNO, 5 | prelude::{networks::ChainInfo, *}, 6 | }; 7 | pub const ABSTRACT_VERSION: &str = env!("CARGO_PKG_VERSION"); 8 | 9 | fn full_deploy(networks: Vec) -> cw_orch::anyhow::Result<()> { 10 | for network in networks { 11 | let chain = DaemonBuilder::new(network.clone()).build()?; 12 | 13 | let deployment = Abstract::deploy_on(chain.clone(), ())?; 14 | // Create the Abstract Account because it's needed for the fees for the dex module 15 | AccountI::create_default_account( 16 | &deployment, 17 | GovernanceDetails::Monarchy { 18 | monarch: chain.sender_addr().to_string(), 19 | }, 20 | )?; 21 | } 22 | 23 | Ok(()) 24 | } 25 | 26 | fn main() { 27 | dotenv().ok(); 28 | env_logger::init(); 29 | 30 | use dotenv::dotenv; 31 | 32 | let networks = vec![LOCAL_JUNO]; 33 | full_deploy(networks).unwrap(); 34 | } 35 | -------------------------------------------------------------------------------- /framework/packages/abstract-interface/examples/mock-ibc-deploy.rs: -------------------------------------------------------------------------------- 1 | use abstract_interface::Abstract; 2 | use cw_orch::prelude::*; 3 | use cw_orch_interchain::prelude::*; 4 | 5 | pub const ABSTRACT_VERSION: &str = env!("CARGO_PKG_VERSION"); 6 | 7 | fn full_deploy() -> cw_orch::anyhow::Result<()> { 8 | let interchain = MockBech32InterchainEnv::new(vec![("src-1", "src"), ("dst-1", "dst")]); 9 | 10 | let src_chain = interchain.get_chain("src-1")?; 11 | let dst_chain = interchain.get_chain("dst-1")?; 12 | 13 | let src_abstr = Abstract::deploy_on(src_chain.clone(), ())?; 14 | let dst_abstr = Abstract::deploy_on(dst_chain.clone(), ())?; 15 | 16 | src_abstr.connect_to(&dst_abstr, &interchain)?; 17 | 18 | Ok(()) 19 | } 20 | 21 | fn main() { 22 | dotenv().ok(); 23 | env_logger::init(); 24 | 25 | use dotenv::dotenv; 26 | 27 | full_deploy().unwrap(); 28 | } 29 | -------------------------------------------------------------------------------- /framework/packages/abstract-interface/examples/starship-ibc-deploy.rs: -------------------------------------------------------------------------------- 1 | use abstract_interface::Abstract; 2 | use cw_orch::prelude::*; 3 | use cw_orch_interchain::prelude::*; 4 | 5 | pub const ABSTRACT_VERSION: &str = env!("CARGO_PKG_VERSION"); 6 | 7 | fn full_deploy() -> cw_orch::anyhow::Result<()> { 8 | let starship = Starship::new(None)?; 9 | let interchain = starship.interchain_env(); 10 | 11 | let src_chain = interchain.get_chain("juno-1")?; 12 | let dst_chain = interchain.get_chain("stargaze-1")?; 13 | 14 | let src_abstr = Abstract::deploy_on(src_chain.clone(), ())?; 15 | let dst_abstr = Abstract::deploy_on(dst_chain.clone(), ())?; 16 | 17 | src_abstr.connect_to(&dst_abstr, &interchain)?; 18 | 19 | Ok(()) 20 | } 21 | 22 | fn main() { 23 | dotenv().ok(); 24 | env_logger::init(); 25 | 26 | use dotenv::dotenv; 27 | 28 | full_deploy().unwrap(); 29 | } 30 | -------------------------------------------------------------------------------- /framework/packages/abstract-interface/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![cfg(not(target_arch = "wasm32"))] 2 | #![cfg_attr(all(coverage_nightly, test), feature(coverage_attribute))] 3 | 4 | pub const VERSION: &str = env!("CARGO_PKG_VERSION"); 5 | 6 | mod account; 7 | mod ibc; 8 | #[cfg(feature = "daemon")] 9 | mod migrate; 10 | 11 | pub use crate::{account::*, ibc::*}; 12 | 13 | mod native; 14 | 15 | pub use crate::native::*; 16 | 17 | mod interfaces; 18 | 19 | pub use crate::interfaces::*; 20 | 21 | mod daemon_state; 22 | mod deployers; 23 | mod deployment; 24 | mod error; 25 | 26 | pub use error::AbstractInterfaceError; 27 | 28 | pub use crate::{deployers::*, deployment::*}; 29 | 30 | pub use daemon_state::AbstractDaemonState; 31 | -------------------------------------------------------------------------------- /framework/packages/abstract-interface/src/native/ibc_host.rs: -------------------------------------------------------------------------------- 1 | pub use abstract_std::ibc_host::{ExecuteMsg, InstantiateMsg, MigrateMsg, QueryMsg}; 2 | use cw_orch::{interface, prelude::*}; 3 | 4 | #[interface(InstantiateMsg, ExecuteMsg, QueryMsg, MigrateMsg)] 5 | pub struct IbcHost; 6 | 7 | impl cw_blob::interface::DeterministicInstantiation for IbcHost {} 8 | 9 | impl Uploadable for IbcHost { 10 | fn wrapper() -> ::ContractSource { 11 | Box::new( 12 | ContractWrapper::new_with_empty( 13 | ibc_host::contract::execute, 14 | ibc_host::contract::instantiate, 15 | ibc_host::contract::query, 16 | ) 17 | .with_migrate(ibc_host::contract::migrate) 18 | .with_reply(ibc_host::contract::reply), 19 | ) 20 | } 21 | fn wasm(_chain: &ChainInfoOwned) -> WasmPath { 22 | artifacts_dir_from_workspace!() 23 | .find_wasm_path("ibc_host") 24 | .unwrap() 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /framework/packages/abstract-interface/src/native/mod.rs: -------------------------------------------------------------------------------- 1 | mod ans_host; 2 | mod ibc_client; 3 | mod ibc_host; 4 | mod module_factory; 5 | mod registry; 6 | 7 | pub use self::{ans_host::*, ibc_client::*, ibc_host::*, module_factory::*, registry::*}; 8 | -------------------------------------------------------------------------------- /framework/packages/abstract-interface/src/native/module_factory.rs: -------------------------------------------------------------------------------- 1 | use abstract_std::module_factory::*; 2 | pub use abstract_std::module_factory::{ 3 | ExecuteMsgFns as MFactoryExecFns, QueryMsgFns as MFactoryQueryFns, 4 | }; 5 | use cw_orch::{interface, prelude::*}; 6 | 7 | #[interface(InstantiateMsg, ExecuteMsg, QueryMsg, MigrateMsg)] 8 | pub struct ModuleFactory; 9 | 10 | impl cw_blob::interface::DeterministicInstantiation for ModuleFactory {} 11 | 12 | impl Uploadable for ModuleFactory { 13 | fn wrapper() -> ::ContractSource { 14 | Box::new( 15 | ContractWrapper::new_with_empty( 16 | ::module_factory::contract::execute, 17 | ::module_factory::contract::instantiate, 18 | ::module_factory::contract::query, 19 | ) 20 | .with_migrate(::module_factory::contract::migrate), 21 | ) 22 | } 23 | fn wasm(_chain: &ChainInfoOwned) -> WasmPath { 24 | artifacts_dir_from_workspace!() 25 | .find_wasm_path("module_factory") 26 | .unwrap() 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /framework/packages/abstract-interface/state.json: -------------------------------------------------------------------------------- 1 | ../../../interchain/scripts/state.json -------------------------------------------------------------------------------- /framework/packages/abstract-interface/tests/integration_tests.rs: -------------------------------------------------------------------------------- 1 | #[cfg(feature = "interchain")] 2 | mod interchain_integration; 3 | -------------------------------------------------------------------------------- /framework/packages/abstract-interface/tests/interchain_integration/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod interchain_accounts; 2 | pub mod module_to_module_interactions; 3 | 4 | use abstract_interface::Abstract; 5 | use cw_orch::anyhow; 6 | use cw_orch::prelude::*; 7 | use cw_orch_interchain::prelude::*; 8 | 9 | pub const JUNO: &str = "juno-1"; 10 | pub const STARGAZE: &str = "stargaze-1"; 11 | pub const OSMOSIS: &str = "osmosis-1"; 12 | 13 | pub fn ibc_abstract_setup, IBC: InterchainEnv>( 14 | interchain: &IBC, 15 | origin_chain_id: &str, 16 | remote_chain_id: &str, 17 | ) -> anyhow::Result<(Abstract, Abstract)> { 18 | let origin_chain = interchain.get_chain(origin_chain_id).unwrap(); 19 | let remote_chain = interchain.get_chain(remote_chain_id).unwrap(); 20 | 21 | // Deploying abstract and the IBC abstract logic 22 | let abstr_origin = Abstract::deploy_on(origin_chain.clone(), ())?; 23 | let abstr_remote = Abstract::deploy_on(remote_chain.clone(), ())?; 24 | 25 | abstr_origin.connect_to(&abstr_remote, interchain)?; 26 | 27 | Ok((abstr_origin, abstr_remote)) 28 | } 29 | 30 | /// This allows env_logger to start properly for tests 31 | /// The logs will be printed only if the test fails ! 32 | pub fn logger_test_init() { 33 | let _ = env_logger::builder().is_test(true).try_init(); 34 | } 35 | -------------------------------------------------------------------------------- /framework/packages/abstract-macros/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = { workspace = true } 3 | description = "Macros for Abstract SDK" 4 | edition = { workspace = true } 5 | license = { workspace = true } 6 | name = "abstract-macros" 7 | readme = "README.md" 8 | repository = "https://github.com/AbstractSDK/abstract/tree/main/packages/abstract-macros" 9 | version = { workspace = true } 10 | 11 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 12 | 13 | [lib] 14 | proc-macro = true 15 | 16 | [dependencies] 17 | proc-macro2 = { version = "1.0" } 18 | quote = { version = "1" } 19 | syn = { version = "1", features = ["full", "extra-traits"] } 20 | 21 | [dev-dependencies] 22 | cosmwasm-std = { workspace = true } 23 | -------------------------------------------------------------------------------- /framework/packages/abstract-macros/README.md: -------------------------------------------------------------------------------- 1 | # Abstract-Macros 2 | 3 | 4 | 5 | [![](https://docs.rs/abstract-sdk/badge.svg)](https://docs.rs/abstract-macros) [![](https://img.shields.io/crates/v/abstract-macros)](https://crates.io/crates/abstract-macros) 6 | 7 | This crate provides macros for use in the Abstract SDK. 8 | -------------------------------------------------------------------------------- /framework/packages/abstract-macros/tests/abstract_response.rs: -------------------------------------------------------------------------------- 1 | #[cfg(test)] 2 | mod tests { 3 | use abstract_macros::abstract_response; 4 | use cosmwasm_std::Response; 5 | 6 | const TEST_CONTRACT: &str = "test:contract"; 7 | 8 | #[abstract_response(TEST_CONTRACT)] 9 | struct TestResponse; 10 | 11 | #[test] 12 | fn test_action() { 13 | let actual: Response = TestResponse::action("instantiate"); 14 | let expected = Response::new().add_event( 15 | cosmwasm_std::Event::new("abstract") 16 | .add_attributes(vec![("contract", TEST_CONTRACT), ("action", "instantiate")]), 17 | ); 18 | 19 | assert_eq!(actual, expected); 20 | } 21 | 22 | #[test] 23 | fn test_new_with_attrs() { 24 | let actual: Response = TestResponse::new("action", vec![("custom", "abstract")]); 25 | 26 | let expected = 27 | Response::new().add_event(cosmwasm_std::Event::new("abstract").add_attributes(vec![ 28 | ("contract", TEST_CONTRACT), 29 | ("action", "action"), 30 | ("custom", "abstract"), 31 | ])); 32 | 33 | assert_eq!(actual, expected); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /framework/packages/abstract-macros/tests/lib.rs: -------------------------------------------------------------------------------- 1 | mod abstract_response; 2 | mod with_abstract_event; 3 | -------------------------------------------------------------------------------- /framework/packages/abstract-sdk/src/apis.rs: -------------------------------------------------------------------------------- 1 | // Remove deprecated if we move to cosmwasm_2_0 feature 2 | 3 | pub mod adapter; 4 | pub mod app; 5 | pub mod bank; 6 | pub mod execution; 7 | pub mod ibc; 8 | pub mod ibc_memo; 9 | pub mod modules; 10 | pub mod respond; 11 | mod splitter; 12 | mod traits; 13 | pub mod verify; 14 | pub mod version_registry; 15 | 16 | pub use traits::AbstractApi; 17 | 18 | #[cfg(feature = "stargate")] 19 | pub mod authz; 20 | #[cfg(feature = "stargate")] 21 | pub mod distribution; 22 | #[cfg(feature = "stargate")] 23 | pub mod feegrant; 24 | #[cfg(feature = "stargate")] 25 | pub mod stargate; 26 | 27 | #[cfg(feature = "stargate")] 28 | pub(crate) fn stargate_msg( 29 | type_url: String, 30 | value: cosmwasm_std::Binary, 31 | ) -> cosmwasm_std::CosmosMsg { 32 | #[allow(deprecated)] 33 | cosmwasm_std::CosmosMsg::Stargate { type_url, value } 34 | } 35 | -------------------------------------------------------------------------------- /framework/packages/abstract-sdk/src/apis/respond.rs: -------------------------------------------------------------------------------- 1 | use abstract_macros::with_abstract_event; 2 | use cosmwasm_std::{Attribute, Response}; 3 | 4 | use crate::features::ModuleIdentification; 5 | 6 | /// Construct a [`Response`] with an abstract-specific event. 7 | /// The event contains the contract name and the action, and any additional attributes. 8 | pub trait AbstractResponse: ModuleIdentification { 9 | /// Respond with an abstract-specific event that contains the contract name and the action. 10 | fn response(&self, action: impl Into) -> Response { 11 | self.custom_response(action, Vec::::new()) 12 | } 13 | /// `.response()` with additional attributes. 14 | fn custom_response( 15 | &self, 16 | action: impl Into, 17 | attributes: impl IntoIterator>, 18 | ) -> Response { 19 | let module_id = self.module_id(); 20 | let response = Response::new(); 21 | with_abstract_event!(response, module_id, action, attributes) 22 | } 23 | } 24 | 25 | impl AbstractResponse for T where T: ModuleIdentification {} 26 | -------------------------------------------------------------------------------- /framework/packages/abstract-sdk/src/apis/stargate/gov.rs: -------------------------------------------------------------------------------- 1 | // https://github.com/cosmos/cosmos-sdk/blob/101a63941559705f8e0ddcc10811b8363acdb27a/proto/cosmos/gov/v1/gov.proto#L31 2 | 3 | use cosmos_sdk_proto::cosmos::gov::v1beta1::VoteOption; 4 | 5 | pub fn vote_to_option(vote: cosmwasm_std::VoteOption) -> i32 { 6 | match vote { 7 | cosmwasm_std::VoteOption::Yes => VoteOption::Yes.into(), 8 | cosmwasm_std::VoteOption::No => VoteOption::No.into(), 9 | cosmwasm_std::VoteOption::Abstain => VoteOption::Abstain.into(), 10 | cosmwasm_std::VoteOption::NoWithVeto => VoteOption::NoWithVeto.into(), 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /framework/packages/abstract-sdk/src/apis/traits.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_std::Deps; 2 | 3 | use crate::features::ModuleIdentification; 4 | 5 | pub trait AbstractApi { 6 | const API_ID: &'static str; 7 | fn base(&self) -> &T; 8 | fn deps(&self) -> Deps; 9 | /// Get the api identifier. 10 | fn api_id() -> String { 11 | Self::API_ID.to_owned() 12 | } 13 | } 14 | 15 | #[cfg(test)] 16 | pub(crate) mod test { 17 | use super::*; 18 | 19 | pub fn abstract_api_test>(api: T) { 20 | let api_id = T::api_id(); 21 | assert_eq!(api_id, T::API_ID); 22 | let base = api.base(); 23 | assert_eq!(base.module_id(), abstract_testing::module::TEST_MODULE_ID); 24 | let deps = api.deps(); 25 | assert!(deps 26 | .api 27 | .addr_validate( 28 | cosmwasm_std::testing::MockApi::default() 29 | .addr_make("test") 30 | .as_str() 31 | ) 32 | .is_ok()) 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /framework/packages/abstract-sdk/src/base/endpoints/instantiate.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_std::{DepsMut, Env, MessageInfo, Response}; 2 | use schemars::JsonSchema; 3 | use serde::Serialize; 4 | 5 | use crate::base::Handler; 6 | 7 | /// Trait for a contract's Instantiate entry point. 8 | pub trait InstantiateEndpoint: Handler { 9 | /// The message type for the Instantiate entry point. 10 | type InstantiateMsg: Serialize + JsonSchema; 11 | 12 | /// Handler for the Instantiate endpoint. 13 | fn instantiate( 14 | self, 15 | deps: DepsMut, 16 | env: Env, 17 | info: MessageInfo, 18 | msg: Self::InstantiateMsg, 19 | ) -> Result; 20 | } 21 | -------------------------------------------------------------------------------- /framework/packages/abstract-sdk/src/base/endpoints/migrate.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_std::{DepsMut, Env, Response}; 2 | use schemars::JsonSchema; 3 | use serde::Serialize; 4 | 5 | use super::super::Handler; 6 | 7 | /// Trait for a contract's Migrate entry point. 8 | pub trait MigrateEndpoint: Handler { 9 | /// The message type for the Migrate entry point. 10 | type MigrateMsg: Serialize + JsonSchema; 11 | 12 | /// Handler for the Migrate endpoint. 13 | fn migrate( 14 | self, 15 | deps: DepsMut, 16 | env: Env, 17 | msg: Self::MigrateMsg, 18 | ) -> Result; 19 | } 20 | -------------------------------------------------------------------------------- /framework/packages/abstract-sdk/src/base/endpoints/query.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_std::{Binary, Deps, Env}; 2 | 3 | use crate::base::Handler; 4 | 5 | /// Trait for a contract's Query entry point. 6 | pub trait QueryEndpoint: Handler { 7 | /// The message type for the Query entry point. 8 | type QueryMsg; 9 | 10 | /// Handler for the Query endpoint. 11 | fn query(&self, deps: Deps, env: Env, msg: Self::QueryMsg) -> Result; 12 | } 13 | -------------------------------------------------------------------------------- /framework/packages/abstract-sdk/src/base/endpoints/reply.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_std::{DepsMut, Env, Reply, Response}; 2 | 3 | use crate::base::Handler; 4 | 5 | /// Trait for a contract's Reply entry point. 6 | pub trait ReplyEndpoint: Handler { 7 | /// Handler for the Reply endpoint. 8 | fn reply(self, deps: DepsMut, env: Env, msg: Reply) -> Result { 9 | let id = msg.id; 10 | let handler = self.reply_handler(id)?; 11 | handler(deps, env, self, msg) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /framework/packages/abstract-sdk/src/base/endpoints/sudo.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_std::{DepsMut, Env, Response}; 2 | 3 | use crate::{base::handler::Handler, AbstractSdkError}; 4 | 5 | /// Trait for a contract's Sudo entry point. 6 | pub trait SudoEndpoint: Handler { 7 | /// Handler for the Sudo endpoint. 8 | fn sudo( 9 | self, 10 | deps: DepsMut, 11 | env: Env, 12 | msg: ::SudoMsg, 13 | ) -> Result { 14 | let maybe_handler = self.maybe_sudo_handler(); 15 | maybe_handler.map_or_else( 16 | || { 17 | Err(Self::Error::from(AbstractSdkError::MissingHandler { 18 | endpoint: "sudo".to_string(), 19 | })) 20 | }, 21 | |f| f(deps, env, self, msg), 22 | ) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /framework/packages/abstract-sdk/src/base/features/abstract_registry_access.rs: -------------------------------------------------------------------------------- 1 | use abstract_std::objects::registry::RegistryContract; 2 | use cosmwasm_std::Deps; 3 | 4 | use crate::AbstractSdkResult; 5 | 6 | /// Trait that enables access to a registry, like a registry contract. 7 | pub trait AbstractRegistryAccess: Sized { 8 | /// Get the address of the registry. 9 | fn abstract_registry(&self, deps: Deps) -> AbstractSdkResult; 10 | } 11 | -------------------------------------------------------------------------------- /framework/packages/abstract-sdk/src/base/features/dependencies.rs: -------------------------------------------------------------------------------- 1 | use crate::{base::Handler, std::objects::dependency::StaticDependency}; 2 | 3 | /// Retrieve the dependencies of a module. 4 | pub trait Dependencies: Sized { 5 | /// Get the dependencies of the module. 6 | fn dependencies(&self) -> &'static [StaticDependency]; 7 | } 8 | 9 | impl Dependencies for T { 10 | fn dependencies(&self) -> &'static [StaticDependency] { 11 | Handler::dependencies(self) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /framework/packages/abstract-sdk/src/base/features/executor.rs: -------------------------------------------------------------------------------- 1 | use abstract_std::account; 2 | use cosmwasm_std::{wasm_execute, Coin, CosmosMsg, Deps}; 3 | 4 | use crate::AbstractSdkResult; 5 | 6 | use super::AccountIdentification; 7 | 8 | /// Trait for modules that are allowed to execute on the account. 9 | pub trait AccountExecutor: AccountIdentification { 10 | /// Execute method on account contract 11 | fn execute_on_account( 12 | &self, 13 | deps: Deps, 14 | msg: &account::ExecuteMsg, 15 | funds: Vec, 16 | ) -> AbstractSdkResult { 17 | let account_address = self.account(deps)?; 18 | wasm_execute(account_address.into_addr(), msg, funds) 19 | .map(Into::into) 20 | .map_err(Into::into) 21 | } 22 | } 23 | 24 | impl AccountExecutor for T where T: AccountIdentification {} 25 | -------------------------------------------------------------------------------- /framework/packages/abstract-sdk/src/base/features/mod.rs: -------------------------------------------------------------------------------- 1 | mod abstract_name_service; 2 | mod abstract_registry_access; 3 | mod dependencies; 4 | mod executor; 5 | mod identification; 6 | mod module_identification; 7 | 8 | pub use abstract_name_service::{AbstractNameService, AbstractNameServiceClient}; 9 | pub use abstract_registry_access::AbstractRegistryAccess; 10 | pub use dependencies::Dependencies; 11 | pub use executor::AccountExecutor; 12 | pub use identification::AccountIdentification; 13 | pub use module_identification::ModuleIdentification; 14 | 15 | pub use crate::apis::respond::AbstractResponse; 16 | -------------------------------------------------------------------------------- /framework/packages/abstract-sdk/src/base/features/module_identification.rs: -------------------------------------------------------------------------------- 1 | use crate::{base::Handler, std::objects::module::ModuleId}; 2 | 3 | /// Return the identifier for this module. 4 | pub trait ModuleIdentification: Sized { 5 | /// Get the module identifier. 6 | fn module_id(&self) -> ModuleId<'static>; 7 | } 8 | 9 | impl ModuleIdentification for T { 10 | fn module_id(&self) -> ModuleId<'static> { 11 | self.contract().info().0 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /framework/packages/abstract-sdk/src/base/mod.rs: -------------------------------------------------------------------------------- 1 | //! Base of an Abstract Module and its features. 2 | //! 3 | //! Is used by the `abstract-adapter`, `abstract-ibc-host` and `abstract-app` crates. 4 | 5 | mod contract_base; 6 | mod endpoints; 7 | pub(crate) mod features; 8 | mod handler; 9 | 10 | pub use contract_base::{ 11 | AbstractContract, ExecuteHandlerFn, IbcCallbackHandlerFn, InstantiateHandlerFn, 12 | MigrateHandlerFn, ModuleIbcHandlerFn, ModuleId, ModuleMetadata, QueryHandlerFn, ReplyHandlerFn, 13 | SudoHandlerFn, VersionString, 14 | }; 15 | pub use endpoints::{ 16 | CustomExecuteHandler, ExecuteEndpoint, IbcCallbackEndpoint, InstantiateEndpoint, 17 | MigrateEndpoint, ModuleIbcEndpoint, QueryEndpoint, ReplyEndpoint, SudoEndpoint, 18 | }; 19 | pub use handler::Handler; 20 | -------------------------------------------------------------------------------- /framework/packages/abstract-sdk/src/cw_helpers/cosmwasm_std/mod.rs: -------------------------------------------------------------------------------- 1 | mod abstract_attributes; 2 | mod wasm_query; 3 | 4 | pub use abstract_attributes::AbstractAttributes; 5 | pub use wasm_query::wasm_raw_query; 6 | pub(crate) use wasm_query::ApiQuery; 7 | -------------------------------------------------------------------------------- /framework/packages/abstract-sdk/src/cw_helpers/migrate_instantiate.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_std::{DepsMut, Env, MessageInfo, Response}; 2 | 3 | /// Instantiate account with migration, used to migration from blob smart contract 4 | pub fn migrate_instantiate( 5 | deps: DepsMut, 6 | env: Env, 7 | init_msg: InitMsg, 8 | init_fn: impl Fn(DepsMut, Env, MessageInfo, InitMsg) -> Result, 9 | ) -> Result 10 | where 11 | Err: From, 12 | { 13 | if cw2::CONTRACT.exists(deps.storage) { 14 | return Err(cosmwasm_std::StdError::generic_err( 15 | "Second instantiation attempt: cw2 is not clear during instantiation", 16 | ) 17 | .into()); 18 | } 19 | let contract_info = deps 20 | .querier 21 | .query_wasm_contract_info(&env.contract.address)?; 22 | // Only admin can call migrate on contract 23 | let sender = contract_info.admin.unwrap(); 24 | let message_info = MessageInfo { 25 | sender, 26 | funds: vec![], 27 | }; 28 | init_fn(deps, env, message_info, init_msg) 29 | } 30 | -------------------------------------------------------------------------------- /framework/packages/abstract-sdk/src/cw_helpers/mod.rs: -------------------------------------------------------------------------------- 1 | //! Helper functions and objects for working with the CosmWasm framework. 2 | mod cosmwasm_std; 3 | mod cw_ownable; 4 | mod fees; 5 | mod migrate_instantiate; 6 | 7 | pub use cw_clearable::*; 8 | pub use migrate_instantiate::*; 9 | 10 | pub use self::{cosmwasm_std::*, fees::*}; 11 | -------------------------------------------------------------------------------- /framework/packages/abstract-sdk/src/prelude.rs: -------------------------------------------------------------------------------- 1 | //! # SDK Prelude 2 | //! 3 | //! Re-exports all the API traits to make it easier to access them. 4 | //! 5 | //! ## Usage 6 | //! 7 | //! ```rust 8 | //! use abstract_sdk::prelude::*; 9 | //! ``` 10 | 11 | #[cfg(feature = "stargate")] 12 | pub use crate::apis::{distribution::*, stargate::feegrant::*}; 13 | pub use crate::{ 14 | ans_resolve::Resolve, 15 | apis::{ 16 | adapter::*, app::*, bank::*, execution::*, ibc::*, modules::*, respond::*, verify::*, 17 | version_registry::*, 18 | }, 19 | }; 20 | -------------------------------------------------------------------------------- /framework/packages/abstract-standalone/src/endpoints.rs: -------------------------------------------------------------------------------- 1 | pub mod instantiate; 2 | pub mod migrate; 3 | -------------------------------------------------------------------------------- /framework/packages/abstract-std/README.md: -------------------------------------------------------------------------------- 1 | # Abstract 2 | 3 | This package contains everything you need to interact with Abstract contracts. 4 | 5 | This package contains: 6 | * Abstract contract interface messages 7 | * Abstract contract states 8 | * Abstract objects (preferably use the re-exported version in [Abstract-SDK](https://crates.io/crates/abstract-sdk)) 9 | 10 | ## Usage 11 | ```rust 12 | // Import a contract Exec/Init/Query message 13 | abstract_std::contract::ExecuteMsg 14 | // Import a contract state lay-out 15 | abstract_std::contract::state::STATE 16 | // Import a state object 17 | abstract_std::object::ProxyValue; 18 | ``` 19 | 20 | ## Messages 21 | Each interface in individually commented. 22 | 23 | ## States 24 | Each state-layout is also individually covered 25 | 26 | ## Objects 27 | Abstract Objects are used to store information along with helper functions. 28 | We provide these as imports so the data can be retrieved externally (using Raw Queries). 29 | 30 | If you want to use these objects in your own contracts we suggest using the abstract-sdk package. -------------------------------------------------------------------------------- /framework/packages/abstract-std/src/native/ibc/ica_client.rs: -------------------------------------------------------------------------------- 1 | pub mod state { 2 | use cosmwasm_std::Addr; 3 | use cw_storage_plus::Map; 4 | 5 | use crate::objects::{storage_namespaces, TruncatedChainId}; 6 | 7 | /// Information about the deployed infrastructure we're connected to. 8 | #[cosmwasm_schema::cw_serde] 9 | pub struct IcaInfrastructure { 10 | /// Address of the polytone note deployed on the local chain. This contract will forward the messages for us. 11 | pub polytone_note: Addr, 12 | } 13 | 14 | pub const ICA_INFRA: Map<&TruncatedChainId, IcaInfrastructure> = 15 | Map::new(storage_namespaces::ica_client::ICA_INFRA); 16 | } 17 | -------------------------------------------------------------------------------- /framework/packages/abstract-std/src/native/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod ans_host; 2 | pub mod ibc; 3 | pub use ibc::{ibc_client, ibc_host, ica_client}; 4 | pub mod module_factory; 5 | pub mod registry; 6 | -------------------------------------------------------------------------------- /framework/packages/abstract-std/src/objects/ans_asset.rs: -------------------------------------------------------------------------------- 1 | use std::fmt; 2 | 3 | use cosmwasm_std::Uint128; 4 | use schemars::JsonSchema; 5 | use serde::{Deserialize, Serialize}; 6 | 7 | use super::AssetEntry; 8 | 9 | #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] 10 | pub struct AnsAsset { 11 | pub name: AssetEntry, 12 | pub amount: Uint128, 13 | } 14 | 15 | impl AnsAsset { 16 | pub fn new(name: impl Into, amount: impl Into) -> Self { 17 | AnsAsset { 18 | name: name.into(), 19 | amount: amount.into(), 20 | } 21 | } 22 | } 23 | 24 | impl fmt::Display for AnsAsset { 25 | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { 26 | write!(f, "{}:{}", self.name, self.amount) 27 | } 28 | } 29 | 30 | #[cfg(test)] 31 | mod test { 32 | #![allow(clippy::needless_borrows_for_generic_args)] 33 | 34 | use super::*; 35 | 36 | #[coverage_helper::test] 37 | fn test_new() { 38 | let AnsAsset { name, amount } = AnsAsset::new("crab", 100u128); 39 | 40 | assert_eq!(name, AssetEntry::new("crab")); 41 | assert_eq!(amount, Uint128::new(100)); 42 | } 43 | 44 | #[coverage_helper::test] 45 | fn test_to_string() { 46 | let asset = AnsAsset::new("crab", 100u128); 47 | 48 | assert_eq!(asset.to_string(), "crab:100".to_string()); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /framework/packages/abstract-std/src/objects/entry/mod.rs: -------------------------------------------------------------------------------- 1 | pub(crate) mod ans_entry_convertor; 2 | pub(crate) mod asset_entry; 3 | pub(crate) mod channel_entry; 4 | pub(crate) mod contract_entry; 5 | pub(crate) mod dex_asset_pairing; 6 | pub(crate) mod lp_token; 7 | -------------------------------------------------------------------------------- /framework/packages/abstract-std/src/objects/module_factory.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_std::{Addr, Deps}; 2 | 3 | use crate::{native_addrs, AbstractResult}; 4 | 5 | /// Store the Module Factory contract. 6 | #[cosmwasm_schema::cw_serde] 7 | pub struct ModuleFactoryContract { 8 | /// Address of the module factory contract 9 | pub address: Addr, 10 | } 11 | 12 | impl ModuleFactoryContract { 13 | /// Retrieve address of the Registry 14 | pub fn new(deps: Deps, account_code_id: u64) -> AbstractResult { 15 | let address = deps 16 | .api 17 | .addr_humanize(&native_addrs::module_factory_address( 18 | deps, 19 | account_code_id, 20 | )?)?; 21 | Ok(Self { address }) 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /framework/packages/abstract-std/src/objects/ownership.rs: -------------------------------------------------------------------------------- 1 | /// This module used internally, for Nft Owners and could be removed at any point if cw721 will get upgraded to cosmwasm 2.0+ 2 | pub mod cw721; 3 | mod gov_ownable; 4 | pub mod nested_admin; 5 | 6 | // Re-export this type here as well 7 | pub use super::gov_type::GovernanceDetails; 8 | 9 | pub use gov_ownable::{ 10 | assert_nested_owner, get_ownership, initialize_owner, is_owner, query_ownership, 11 | update_ownership, GovAction, GovOwnershipError, Ownership, 12 | }; 13 | -------------------------------------------------------------------------------- /framework/packages/abstract-std/src/objects/pool/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod pool_id; 2 | pub mod pool_metadata; 3 | pub mod pool_reference; 4 | pub mod pool_type; 5 | pub mod unique_pool_id; 6 | 7 | pub use pool_id::PoolAddress; 8 | pub use pool_metadata::PoolMetadata; 9 | pub use pool_reference::PoolReference; 10 | pub use pool_type::PoolType; 11 | pub use unique_pool_id::UniquePoolId; 12 | -------------------------------------------------------------------------------- /framework/packages/abstract-std/src/objects/pool/pool_reference.rs: -------------------------------------------------------------------------------- 1 | use crate::objects::{pool_id::PoolAddress, unique_pool_id::UniquePoolId}; 2 | 3 | #[cosmwasm_schema::cw_serde] 4 | pub struct PoolReference { 5 | pub unique_id: UniquePoolId, 6 | pub pool_address: PoolAddress, 7 | } 8 | 9 | impl PoolReference { 10 | pub fn new(unique_id: UniquePoolId, pool_address: PoolAddress) -> Self { 11 | Self { 12 | unique_id, 13 | pool_address, 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /framework/packages/abstract-std/src/objects/validation/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod error; 2 | pub mod verifiers; 3 | 4 | pub use error::ValidationError; 5 | pub use verifiers::{validate_description, validate_link, validate_name}; 6 | -------------------------------------------------------------------------------- /framework/packages/abstract-std/src/standalone.rs: -------------------------------------------------------------------------------- 1 | //! # Abstract Standalone 2 | //! 3 | //! `abstract_std::standalone` implements shared functionality that's useful for creating new Abstract standalone modules. 4 | //! 5 | //! ## Description 6 | //! An Abstract standalone contract is a contract that is controlled by abstract account, but cannot perform actions on a [account](crate::account) contract. 7 | use crate::registry::Account; 8 | 9 | /// Data required for the `StandaloneContract::instantiate` function. 10 | #[cosmwasm_schema::cw_serde] 11 | pub struct StandaloneInstantiateMsg {} 12 | 13 | /// Contains the abstract infrastructure addresses needed the APIs. 14 | #[cosmwasm_schema::cw_serde] 15 | pub struct StandaloneState { 16 | pub account: Account, 17 | /// Used to determine if this standalone is migratable 18 | pub is_migratable: bool, 19 | } 20 | -------------------------------------------------------------------------------- /framework/packages/abstract-testing/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = { workspace = true } 3 | description = "Abstract contract interfaces and storage layouts" 4 | edition = { workspace = true } 5 | license = { workspace = true } 6 | name = "abstract-testing" 7 | readme = "README.md" 8 | repository = "https://github.com/AbstractSDK/abstract" 9 | version = { workspace = true } 10 | 11 | 12 | [dependencies] 13 | abstract-std = { workspace = true } 14 | cosmwasm-std = { workspace = true, features = ["iterator"] } 15 | cw-asset = { workspace = true } 16 | cw-storage-plus = { workspace = true } 17 | cw2 = { workspace = true } 18 | derive_builder = "0.12.0" 19 | serde = { workspace = true } 20 | serde_json = "1.0.79" 21 | 22 | [target.'cfg(not(target_arch = "wasm32"))'.dependencies] 23 | workspace-hack = { version = "0.1", path = "../../workspace-hack" } 24 | 25 | [dev-dependencies] 26 | abstract-sdk = { path = "../abstract-sdk", features = ["test-utils"] } 27 | -------------------------------------------------------------------------------- /framework/packages/abstract-testing/README.md: -------------------------------------------------------------------------------- 1 | # Abstract Testing 2 | 3 | Testing package for unit-testing with Abstract. 4 | -------------------------------------------------------------------------------- /framework/packages/standards/dex/README.md: -------------------------------------------------------------------------------- 1 | # Dex Adapter Trait 2 | 3 | A trait that defines a standard interface for Dex interactions. This trait should be implemented for each Dex that the adapter supports. 4 | 5 | To implement this trait, create a new package, import this crate and implement the trait for your Dex. 6 | -------------------------------------------------------------------------------- /framework/packages/standards/dex/src/lib.rs: -------------------------------------------------------------------------------- 1 | mod command; 2 | mod error; 3 | 4 | pub mod action; 5 | pub mod ans_action; 6 | pub mod msg; 7 | #[cfg(feature = "testing")] 8 | pub mod tests; 9 | 10 | // Export interface for use in SDK modules 11 | pub use abstract_adapter_utils::{coins_in_assets, cw_approve_msgs, Identify}; 12 | pub use command::{DexCommand, Fee, FeeOnInput, Return, Spread}; 13 | pub use error::DexError; 14 | pub use msg::SwapNode; 15 | 16 | pub const DEX_ADAPTER_ID: &str = "abstract:dex"; 17 | -------------------------------------------------------------------------------- /framework/packages/standards/money-market/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | description = "The money market adapter is an Abstract adapter for interacting with usual Money Market commands. It provides a common interface for all Money Markets" 3 | name = "abstract-money-market-standard" 4 | 5 | authors = { workspace = true } 6 | edition = { workspace = true } 7 | license = { workspace = true } 8 | version = { workspace = true } 9 | 10 | exclude = ["contract.wasm", "hash.txt"] 11 | resolver = "2" 12 | 13 | 14 | [lib] 15 | crate-type = ["cdylib", "rlib"] 16 | 17 | [features] 18 | default = ["export"] 19 | export = [] 20 | testing = ["cw-orch/daemon"] 21 | 22 | [dependencies] 23 | cosmwasm-schema = { workspace = true } 24 | cosmwasm-std = { workspace = true } 25 | cw-asset = { workspace = true } 26 | thiserror = { workspace = true } 27 | 28 | abstract-adapter = { workspace = true } 29 | abstract-adapter-utils = { workspace = true } 30 | abstract-sdk = { workspace = true } 31 | abstract-std = { workspace = true } 32 | cw-orch = { workspace = true } 33 | 34 | [target.'cfg(not(target_arch = "wasm32"))'.dependencies] 35 | workspace-hack = { version = "0.1", path = "../../../workspace-hack" } 36 | -------------------------------------------------------------------------------- /framework/packages/standards/money-market/README.md: -------------------------------------------------------------------------------- 1 | # Money Market Adapter Trait 2 | 3 | A trait that defines a standard interface for Money Market interactions. This trait should be implemented for each Money Market that the adapter supports. 4 | 5 | To implement this trait, create a new package, import this crate and implement the trait for your Money Market. 6 | 7 | We provide implementations for Mars and Kujira Ghost Protocol in the [integrations](../../../../integrations) folder. 8 | -------------------------------------------------------------------------------- /framework/packages/standards/money-market/src/lib.rs: -------------------------------------------------------------------------------- 1 | mod command; 2 | mod error; 3 | 4 | pub mod ans_action; 5 | pub mod msg; 6 | pub mod query; 7 | pub mod raw_action; 8 | #[cfg(feature = "testing")] 9 | pub mod tests; 10 | 11 | // Export interface for use in SDK modules 12 | pub use abstract_adapter_utils::{coins_in_assets, cw_approve_msgs, Identify}; 13 | pub use command::{Fee, FeeOnInput, MoneyMarketCommand, Return, Spread}; 14 | pub use error::MoneyMarketError; 15 | 16 | pub const MONEY_MARKET_ADAPTER_ID: &str = "abstract:money-market"; 17 | -------------------------------------------------------------------------------- /framework/packages/standards/staking/README.md: -------------------------------------------------------------------------------- 1 | # Dex Adapter Trait 2 | 3 | A trait that defines a standard interface for Dex interactions. This trait should be implemented for each Dex that the adapter supports. 4 | 5 | To implement this trait, create a new package, import this crate and implement the trait for your Dex. 6 | -------------------------------------------------------------------------------- /framework/packages/standards/staking/src/lib.rs: -------------------------------------------------------------------------------- 1 | mod command; 2 | pub mod error; 3 | pub mod msg; 4 | // Export interface for use in SDK modules 5 | pub use abstract_adapter_utils::{coins_in_assets, cw_approve_msgs, Identify}; 6 | pub use command::CwStakingCommand; 7 | pub use error::CwStakingError; 8 | 9 | pub const CW_STAKING_ADAPTER_ID: &str = "abstract:cw-staking"; 10 | -------------------------------------------------------------------------------- /framework/packages/standards/utils/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = { workspace = true } 3 | description = "Abstract Adapter Utils" 4 | edition = { workspace = true } 5 | exclude = ["contract.wasm", "hash.txt"] 6 | license = { workspace = true } 7 | name = "abstract-adapter-utils" 8 | resolver = "2" 9 | version = { workspace = true } 10 | 11 | [lib] 12 | crate-type = ["cdylib", "rlib"] 13 | 14 | [features] 15 | # Keep as is until TendermintStake updates. 16 | [dependencies] 17 | cosmwasm-std = { workspace = true } 18 | cw-asset = { workspace = true } 19 | cw20 = { workspace = true } 20 | 21 | [target.'cfg(not(target_arch = "wasm32"))'.dependencies] 22 | workspace-hack = { version = "0.1", path = "../../../workspace-hack" } 23 | -------------------------------------------------------------------------------- /framework/packages/standards/utils/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod identity; 2 | pub mod util; 3 | 4 | pub use identity::Identify; 5 | pub use util::{coins_in_assets, cw_approve_msgs}; 6 | -------------------------------------------------------------------------------- /framework/packages/standards/utils/src/util.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_std::{to_json_binary, Addr, Coin, CosmosMsg, StdResult, WasmMsg}; 2 | use cw20::Cw20ExecuteMsg; 3 | use cw_asset::{Asset, AssetInfo}; 4 | 5 | pub fn cw_approve_msgs(assets: &[Asset], spender: &Addr) -> StdResult> { 6 | let mut msgs = vec![]; 7 | for asset in assets { 8 | if let AssetInfo::Cw20(addr) = &asset.info { 9 | let msg = Cw20ExecuteMsg::IncreaseAllowance { 10 | spender: spender.to_string(), 11 | amount: asset.amount, 12 | expires: None, 13 | }; 14 | msgs.push(CosmosMsg::Wasm(WasmMsg::Execute { 15 | contract_addr: addr.to_string(), 16 | msg: to_json_binary(&msg)?, 17 | funds: vec![], 18 | })) 19 | } 20 | } 21 | Ok(msgs) 22 | } 23 | 24 | pub fn coins_in_assets(assets: &[Asset]) -> Vec { 25 | let mut coins = vec![]; 26 | for asset in assets { 27 | if let AssetInfo::Native(denom) = &asset.info { 28 | coins.push(Coin::new(asset.amount.u128(), denom.clone())); 29 | } 30 | } 31 | // https://github.com/cosmos/cosmos-sdk/blob/d5b40fc427f530b5ab078c61531d521b85505a1e/types/coin.go#L259-L261 32 | coins.sort_unstable_by(|a, b| a.denom.cmp(&b.denom)); 33 | coins 34 | } 35 | -------------------------------------------------------------------------------- /framework/publish/tag-release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Check if a tag name is provided 4 | if [ "$#" -ne 1 ]; then 5 | echo "Usage: $0 " 6 | exit 1 7 | fi 8 | 9 | TAG_NAME=$1 10 | 11 | # Function to check OS type for sed command compatibility 12 | function sed_in_place() { 13 | if [[ "$OSTYPE" == "darwin"* ]]; then 14 | sed -i '' "$@" 15 | else 16 | sed -i "$@" 17 | fi 18 | } 19 | 20 | # Function to restore the original state in case of an error 21 | function restore_state { 22 | git reset HEAD~ 23 | git tag -d $TAG_NAME 24 | echo "Error occurred. Restored the original state." 25 | } 26 | 27 | # Removing **/Cargo.lock from .gitignore 28 | if sed_in_place '/\*\*\/Cargo.lock/d' .gitignore; then 29 | echo "Removed Cargo.lock from .gitignore" 30 | else 31 | echo ".gitignore not found, make sure you are running command from the root of the monorepo" 32 | exit 1 33 | fi 34 | 35 | # Adding Cargo.lock files and committing 36 | git add $(find . -name Cargo.lock) .gitignore 37 | git commit --allow-empty -m "Add Cargo.lock for tag $TAG_NAME" 38 | 39 | # Tagging the commit 40 | git tag -a $TAG_NAME -m "Version $TAG_NAME with Cargo.lock" 41 | 42 | # Pushing the tag 43 | if git push origin $TAG_NAME; then 44 | echo "Tag $TAG_NAME pushed successfully." 45 | else 46 | restore_state 47 | exit 1 48 | fi 49 | 50 | echo "Completed. Tag $TAG_NAME contains Cargo.lock." 51 | -------------------------------------------------------------------------------- /framework/rustfmt.toml: -------------------------------------------------------------------------------- 1 | # stable 2 | hard_tabs = false 3 | newline_style = "Unix" 4 | tab_spaces = 4 5 | 6 | # group_imports = "StdExternalCrate" 7 | # imports_granularity = "Crate" 8 | -------------------------------------------------------------------------------- /framework/taplo.toml: -------------------------------------------------------------------------------- 1 | ../taplo.toml -------------------------------------------------------------------------------- /framework/workspace-hack/.gitattributes: -------------------------------------------------------------------------------- 1 | # Avoid putting conflict markers in the generated Cargo.toml file, since their presence breaks 2 | # Cargo. 3 | # Also do not check out the file as CRLF on Windows, as that's what hakari needs. 4 | Cargo.toml merge=binary -crlf 5 | -------------------------------------------------------------------------------- /framework/workspace-hack/build.rs: -------------------------------------------------------------------------------- 1 | // A build script is required for cargo to consider build dependencies. 2 | fn main() {} 3 | -------------------------------------------------------------------------------- /framework/workspace-hack/src/lib.rs: -------------------------------------------------------------------------------- 1 | // This is a stub lib.rs. 2 | -------------------------------------------------------------------------------- /integrations/README.md: -------------------------------------------------------------------------------- 1 | # Subtrees of modules 2 | - astroport https://github.com/AbstractSDK/astroport-core.git 3 | - osmosis https://github.com/AbstractSDK/osmosis-rust.git 4 | - wyndex https://github.com/AbstractSDK/wynddex.git 5 | 6 | # Notes 7 | - Any `.gitmodules` alongside with git submodules are removed -------------------------------------------------------------------------------- /integrations/astroport-adapter/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Abstract Money "] 3 | description = "Abstract DexCommand implementation for Astroport" 4 | edition = "2021" 5 | license = "Apache-2.0" 6 | name = "abstract-astroport-adapter" 7 | repository = "https://github.com/astroport-fi/astroport" 8 | version = "2.10.0" 9 | 10 | [features] 11 | default = ["full_integration"] 12 | full_integration = [ 13 | "dep:cw20", 14 | "dep:cosmwasm-schema", 15 | "dep:cw-asset", 16 | "dep:cw-utils", 17 | "dep:astroport", 18 | ] 19 | local = [] 20 | 21 | [dependencies] 22 | astroport = { version = "3.11.1", optional = true } 23 | lazy_static = "1.4.0" 24 | 25 | abstract-dex-standard = { workspace = true } 26 | abstract-sdk = { workspace = true } 27 | abstract-staking-standard = { workspace = true } 28 | cosmwasm-schema = { workspace = true, optional = true } 29 | cosmwasm-std = { workspace = true } 30 | cw-asset = { workspace = true, optional = true } 31 | cw-utils = { workspace = true, optional = true } 32 | cw20 = { workspace = true, optional = true } 33 | 34 | [dev-dependencies] 35 | abstract-dex-standard = { workspace = true, features = ["testing"] } 36 | cw-orch = { workspace = true } 37 | -------------------------------------------------------------------------------- /integrations/astroport-adapter/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub const ASTROPORT: &str = "astroport"; 2 | #[cfg(feature = "local")] 3 | pub const AVAILABLE_CHAINS: &[&str] = abstract_sdk::std::registry::LOCAL_CHAIN; 4 | #[cfg(not(feature = "local"))] 5 | lazy_static::lazy_static! { 6 | pub static ref AVAILABLE_CHAINS: Vec<&'static str> = { 7 | let mut v = Vec::new(); 8 | v.extend_from_slice(abstract_sdk::std::registry::NEUTRON); 9 | v.extend_from_slice(abstract_sdk::std::registry::TERRA); 10 | v 11 | }; 12 | } 13 | 14 | pub mod dex; 15 | pub mod staking; 16 | -------------------------------------------------------------------------------- /integrations/astrovault-adapter/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Abstract Money "] 3 | description = "Abstract DexCommand implementation for Astrovault" 4 | edition = "2021" 5 | license = "Apache-2.0" 6 | name = "abstract-astrovault-adapter" 7 | version = "0.2.0" 8 | resolver = "2" 9 | 10 | [features] 11 | default = ["full_integration"] 12 | full_integration = ["dep:cw20", "dep:cosmwasm-schema", "dep:cw-asset", "dep:cw-utils"] 13 | local = [] 14 | 15 | [dependencies] 16 | lazy_static = "1.4.0" 17 | 18 | abstract-dex-standard = { workspace = true } 19 | abstract-sdk = { workspace = true } 20 | abstract-staking-standard = { workspace = true } 21 | cosmwasm-schema = { workspace = true, optional = true } 22 | cosmwasm-std = { workspace = true } 23 | cw-asset = { workspace = true, optional = true } 24 | cw-utils = { workspace = true, optional = true } 25 | cw20 = { workspace = true, optional = true } 26 | 27 | [dev-dependencies] 28 | abstract-dex-standard = { workspace = true, features = ["testing"] } 29 | astrovault = { version = "2.0.1" } 30 | cw-orch = { workspace = true } 31 | -------------------------------------------------------------------------------- /integrations/astrovault-adapter/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub const ASTROVAULT: &str = "astrovault"; 2 | #[cfg(feature = "local")] 3 | pub const AVAILABLE_CHAINS: &[&str] = abstract_sdk::std::constants::LOCAL_CHAIN; 4 | #[cfg(not(feature = "local"))] 5 | lazy_static::lazy_static! { 6 | pub static ref AVAILABLE_CHAINS: Vec<&'static str> = { 7 | let mut v = Vec::new(); 8 | v.extend_from_slice(abstract_sdk::std::constants::ARCHWAY); 9 | v 10 | }; 11 | } 12 | 13 | pub mod dex; 14 | pub mod staking; 15 | 16 | #[cfg(feature = "full_integration")] 17 | pub mod mini_astrovault; 18 | -------------------------------------------------------------------------------- /integrations/bundles/mockdex/tests/abstract.rs: -------------------------------------------------------------------------------- 1 | mod abstrct { 2 | use abstract_interface::Abstract; 3 | use cw_orch::prelude::*; 4 | use mockdex_bundle::WynDex; 5 | 6 | #[test] 7 | fn deploy() { 8 | let mock = MockBech32::new("mock"); 9 | 10 | Abstract::deploy_on(mock.clone(), ()).unwrap(); 11 | 12 | let deployed = WynDex::deploy_on(mock.clone(), Empty {}).unwrap(); 13 | let loaded = WynDex::load_from(mock).unwrap(); 14 | 15 | assert_eq!(deployed, loaded) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /integrations/justfile: -------------------------------------------------------------------------------- 1 | build: 2 | cargo build 3 | 4 | # Test everything 5 | test: 6 | cargo nextest run 7 | 8 | format: 9 | cargo fmt --all 10 | find . -type f -iname "*.toml" -print0 | xargs -0 taplo format 11 | 12 | lint: 13 | cargo clippy --all --all-features -- -D warnings 14 | 15 | lintfix: 16 | cargo clippy --fix --allow-staged --allow-dirty --all-features 17 | just format 18 | 19 | check-all: 20 | cargo check --all-features 21 | 22 | check: 23 | cargo check 24 | 25 | refresh: 26 | cargo clean && cargo update 27 | 28 | check-codecov: 29 | cat codecov.yml | curl --data-binary @- https://codecov.io/validate -------------------------------------------------------------------------------- /integrations/kujira-adapter/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Abstract Money "] 3 | description = "Abstract Adapters implementation for Kujira" 4 | edition = "2021" 5 | license = "MIT OR Apache-2.0" 6 | name = "abstract-kujira-adapter" 7 | version = "0.3.0" 8 | 9 | [features] 10 | default = ["full_integration"] 11 | full_integration = ["dep:kujira", "dep:cw20", "dep:cw-asset", "dep:cw-utils"] 12 | local = [] 13 | 14 | [dependencies] 15 | kujira = { version = "1.3.0", optional = true } 16 | 17 | abstract-dex-standard = { workspace = true } 18 | abstract-money-market-standard = { workspace = true } 19 | abstract-sdk = { workspace = true } 20 | abstract-staking-standard = { workspace = true } 21 | cosmwasm-schema = { workspace = true, optional = true } 22 | cosmwasm-std = { workspace = true, features = ["stargate"] } 23 | cw-asset = { workspace = true, optional = true } 24 | cw-utils = { workspace = true, optional = true } 25 | cw20 = { workspace = true, optional = true } 26 | prost = "0.12.3" 27 | 28 | [dev-dependencies] 29 | abstract-dex-standard = { workspace = true, features = ["testing"] } 30 | cosmwasm-schema.workspace = true 31 | cw-orch = { workspace = true, features = ["daemon"] } 32 | -------------------------------------------------------------------------------- /integrations/kujira-adapter/README.md: -------------------------------------------------------------------------------- 1 | # Necessary ANS entries 2 | 3 | This protocol needs the following entries inside the ANS contract to function. 4 | 5 | ## Oracle 6 | 7 | No oracle contract, this is a Custom Query 8 | 9 | ## Vault 10 | 11 | Where lended funds are deposited. 12 | 13 | ```rust 14 | ContractEntry { 15 | protocol: "kujira".to_string(), 16 | contract: format!("vault/{}", lending_asset), 17 | } 18 | ``` 19 | 20 | ## Markets 21 | 22 | Where Collateral are deposited and funds borrowed 23 | 24 | ```rust 25 | ContractEntry { 26 | protocol: "kujira".to_string(), 27 | contract: format!("market/{}/{}", lending_asset, collateral_asset), 28 | } 29 | ``` 30 | -------------------------------------------------------------------------------- /integrations/kujira-adapter/src/lib.rs: -------------------------------------------------------------------------------- 1 | #[cfg(feature = "local")] 2 | pub const AVAILABLE_CHAINS: &[&str] = abstract_sdk::std::constants::LOCAL_CHAIN; 3 | #[cfg(not(feature = "local"))] 4 | pub const AVAILABLE_CHAINS: &[&str] = abstract_sdk::std::constants::KUJIRA; 5 | 6 | pub mod dex; 7 | pub mod money_market; 8 | pub mod staking; 9 | -------------------------------------------------------------------------------- /integrations/mars-adapter/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Abstract Money "] 3 | description = "Abstract Staking implementation for Kujira" 4 | edition = "2021" 5 | license = "MIT OR Apache-2.0" 6 | name = "abstract-mars-adapter" 7 | version = "0.3.0" 8 | 9 | [features] 10 | default = ["full_integration"] 11 | full_integration = [ 12 | "dep:mars-red-bank-types", 13 | "dep:cw20", 14 | "dep:cw-asset", 15 | "dep:cw-utils", 16 | "dep:cosmwasm-schema", 17 | ] 18 | local = [] 19 | 20 | [dependencies] 21 | 22 | abstract-dex-standard = { workspace = true } 23 | abstract-money-market-standard = { workspace = true } 24 | abstract-sdk = { workspace = true } 25 | abstract-staking-standard = { workspace = true } 26 | cosmwasm-schema = { workspace = true, optional = true } 27 | cosmwasm-std = { workspace = true, features = ["stargate"] } 28 | cw-asset = { workspace = true, optional = true } 29 | cw-utils = { workspace = true, optional = true } 30 | cw20 = { workspace = true, optional = true } 31 | mars-red-bank-types = { version = "1.0.0", optional = true } 32 | 33 | [dev-dependencies] 34 | abstract-dex-standard = { workspace = true, features = ["testing"] } 35 | cosmwasm-schema.workspace = true 36 | cw-orch = { workspace = true, features = ["daemon"] } 37 | -------------------------------------------------------------------------------- /integrations/mars-adapter/README.md: -------------------------------------------------------------------------------- 1 | # Necessary ANS entries 2 | 3 | This protocol needs the following entries inside the ANS contract to function. 4 | 5 | ## Oracle 6 | 7 | The price source for everything Mars 8 | 9 | ```rust 10 | ContractEntry { 11 | protocol: "mars".to_string(), 12 | contract: "oracle".to_string(), 13 | }; 14 | ``` 15 | 16 | ## Red Bank 17 | 18 | Where everything happens inside Mars Protocol 19 | 20 | ```rust 21 | ContractEntry { 22 | protocol: "mars".to_string(), 23 | contract: "red-bank".to_string(), 24 | }; 25 | ``` 26 | -------------------------------------------------------------------------------- /integrations/mars-adapter/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub const MARS: &str = "mars"; 2 | #[cfg(feature = "local")] 3 | pub const AVAILABLE_CHAINS: &[&str] = abstract_sdk::std::registry::LOCAL_CHAIN; 4 | #[cfg(not(feature = "local"))] 5 | pub const AVAILABLE_CHAINS: &[&str] = &["pion", "neutron", "osmosis", "osmo", "osmo-test"]; 6 | pub mod money_market; 7 | -------------------------------------------------------------------------------- /integrations/neutron-dex-adapter/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Abstract Money "] 3 | description = "Abstract DexCommand implementation for Neutron's native dex" 4 | edition = "2021" 5 | license = "Apache-2.0" 6 | name = "abstract-neutron-dex-adapter" 7 | repository = "https://github.com/AbstractSDK/abstract" 8 | version = "2.10.0" 9 | 10 | [features] 11 | default = ["full_integration"] 12 | full_integration = [ 13 | "dep:cw20", 14 | "dep:cosmwasm-schema", 15 | "dep:cw-asset", 16 | "dep:cw-utils", 17 | "dep:neutron-std", 18 | ] 19 | local = [] 20 | 21 | [dependencies] 22 | neutron-std = { version = "5.0.1-rc0", optional = true } 23 | lazy_static = "1.4.0" 24 | 25 | abstract-dex-standard = { workspace = true } 26 | abstract-sdk = { workspace = true } 27 | abstract-staking-standard = { workspace = true } 28 | cosmwasm-schema = { workspace = true, optional = true } 29 | cosmwasm-std = { workspace = true } 30 | cw-asset = { workspace = true, optional = true } 31 | cw-utils = { workspace = true, optional = true } 32 | cw20 = { workspace = true, optional = true } 33 | 34 | [dev-dependencies] 35 | abstract-dex-standard = { workspace = true, features = ["testing"] } 36 | cw-orch = { workspace = true } 37 | -------------------------------------------------------------------------------- /integrations/neutron-dex-adapter/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub const NEUTRON: &str = "neutron"; 2 | #[cfg(feature = "local")] 3 | pub const AVAILABLE_CHAINS: &[&str] = abstract_sdk::std::constants::LOCAL_CHAIN; 4 | #[cfg(not(feature = "local"))] 5 | pub const AVAILABLE_CHAINS: &[&str] = abstract_sdk::std::constants::NEUTRON; 6 | 7 | pub mod dex; 8 | -------------------------------------------------------------------------------- /integrations/osmosis-adapter/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Abstract Money "] 3 | description = "Abstract DexCommand implementation for Osmosis" 4 | edition = "2021" 5 | license = "MIT OR Apache-2.0" 6 | name = "abstract-osmosis-adapter" 7 | version = "0.26.0" 8 | 9 | [features] 10 | default = ["full_integration"] 11 | full_integration = ["dep:cw20", "dep:cw-asset", "dep:cw-utils", "dep:osmosis-std"] 12 | 13 | [dependencies] 14 | osmosis-std = { version = "0.26.0", optional = true } 15 | 16 | abstract-dex-standard = { workspace = true } 17 | abstract-sdk = { workspace = true } 18 | abstract-staking-standard = { workspace = true } 19 | cosmwasm-std = { workspace = true, features = ["stargate"] } 20 | cw-asset = { workspace = true, optional = true } 21 | cw-utils = { workspace = true, optional = true } 22 | cw20 = { workspace = true, optional = true } 23 | 24 | cosmwasm-schema = { workspace = true } 25 | -------------------------------------------------------------------------------- /integrations/osmosis-adapter/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub const OSMOSIS: &str = "osmosis"; 2 | pub const AVAILABLE_CHAINS: &[&str] = &["osmosis", "osmo-test"]; 3 | pub mod dex; 4 | pub mod staking; 5 | -------------------------------------------------------------------------------- /integrations/taplo.toml: -------------------------------------------------------------------------------- 1 | ../taplo.toml -------------------------------------------------------------------------------- /integrations/wyndex-adapter/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Wyndex is only available on juno 2 | pub const WYNDEX: &str = "wyndex"; 3 | 4 | #[cfg(feature = "local")] 5 | pub const AVAILABLE_CHAINS: &[&str] = abstract_sdk::std::constants::LOCAL_CHAIN; 6 | #[cfg(not(feature = "local"))] 7 | pub const AVAILABLE_CHAINS: &[&str] = abstract_sdk::std::constants::JUNO; 8 | 9 | pub mod dex; 10 | pub mod staking; 11 | -------------------------------------------------------------------------------- /interchain/.cargo/config.toml: -------------------------------------------------------------------------------- 1 | [net] 2 | git-fetch-with-cli = true 3 | 4 | [alias] 5 | # Clone tests 6 | ct = "test -- --test-threads=1" 7 | -------------------------------------------------------------------------------- /interchain/four-chain-starship/configs/two-junos.yaml: -------------------------------------------------------------------------------- 1 | chains: 2 | - id: juno-1 3 | name: juno 4 | numValidators: 1 5 | ports: 6 | rest: 1313 7 | rpc: 26653 8 | grpc: 30658 9 | faucet: 8000 10 | - id: junotwo-1 11 | name: osmosis 12 | numValidators: 1 13 | ports: 14 | rest: 1317 15 | rpc: 26659 16 | grpc: 30660 17 | faucet: 8004 18 | 19 | relayers: 20 | - name: juno-juno2 21 | type: hermes 22 | replicas: 1 23 | chains: 24 | - juno-1 25 | - junotwo-1 26 | config: 27 | event_source: 28 | mode: "pull" # default is "push" 29 | 30 | registry: 31 | enabled: true 32 | ports: 33 | rest: 8081 34 | -------------------------------------------------------------------------------- /interchain/framework-clone-testing/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | edition = { workspace = true } 3 | name = "abstract-framework-clone-testing" 4 | version = { workspace = true } 5 | 6 | [lib] 7 | 8 | 9 | [dependencies] 10 | cosmwasm-schema = { workspace = true } 11 | cosmwasm-std = { workspace = true } 12 | 13 | cw-orch = { workspace = true, features = ["daemon"] } 14 | cw-orch-clone-testing = { workspace = true } 15 | 16 | abstract-account = { workspace = true, features = ["xion"] } 17 | abstract-app = { workspace = true, features = ["test-utils"] } 18 | abstract-client = { workspace = true, features = ["test-utils"] } 19 | abstract-integration-tests = { path = "../../framework/packages/abstract-integration-tests" } 20 | abstract-interface = { workspace = true, features = ["daemon"] } 21 | abstract-std = { workspace = true } 22 | abstract-testing = { workspace = true } 23 | 24 | anyhow = { workspace = true } 25 | env_logger = "0.11.3" 26 | lazy_static = "1.4.0" 27 | tokio = { workspace = true } 28 | 29 | cw2 = { workspace = true } 30 | semver = { workspace = true } 31 | -------------------------------------------------------------------------------- /interchain/framework-clone-testing/src/common.rs: -------------------------------------------------------------------------------- 1 | use abstract_interface::{Abstract, RegistryQueryFns}; 2 | use cw_orch::prelude::*; 3 | use cw_orch_clone_testing::CloneTesting; 4 | 5 | /// Sets up the CloneTesting for chain. 6 | /// Returns the abstract deployment and sender (=mainnet admin) 7 | pub fn setup(chain: ChainInfo) -> anyhow::Result<(Abstract, CloneTesting)> { 8 | let _ = env_logger::builder().is_test(true).try_init(); 9 | // Run migration tests against mainnet 10 | // We set the state file to be able to clone test 11 | std::env::set_var("STATE_FILE", "../scripts/state.json"); 12 | let mut app = CloneTesting::new(chain)?; 13 | 14 | let abstr_deployment = Abstract::load_from(app.clone())?; 15 | let owner = Addr::unchecked(abstr_deployment.registry.ownership()?.owner.unwrap()); 16 | 17 | app.set_sender(owner.clone()); 18 | 19 | Ok((abstr_deployment.call_as(&owner), app)) 20 | } 21 | -------------------------------------------------------------------------------- /interchain/framework-clone-testing/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod common; 2 | -------------------------------------------------------------------------------- /interchain/modules-clone-testing/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod common; 2 | -------------------------------------------------------------------------------- /interchain/modules-clone-testing/tests/dex/mod.rs: -------------------------------------------------------------------------------- 1 | mod astrovault; 2 | 3 | // TODO: astroport moved to token factory, should be easy to implement on cw-orch clone testing 4 | // mod astroport; 5 | -------------------------------------------------------------------------------- /interchain/modules-clone-testing/tests/money_market/mod.rs: -------------------------------------------------------------------------------- 1 | // TODO: mars not updated to 2.0 yet 2 | 3 | // mod mars; 4 | -------------------------------------------------------------------------------- /interchain/modules-clone-testing/tests/staking/mod.rs: -------------------------------------------------------------------------------- 1 | mod astrovault; 2 | 3 | // TODO: astroport moved to token factory, should be easy to implement on cw-orch clone testing 4 | // mod astroport; 5 | -------------------------------------------------------------------------------- /interchain/modules-clone-testing/tests/tests.rs: -------------------------------------------------------------------------------- 1 | mod dex; 2 | mod money_market; 3 | mod staking; 4 | -------------------------------------------------------------------------------- /interchain/rustfmt.toml: -------------------------------------------------------------------------------- 1 | # stable 2 | hard_tabs = false 3 | newline_style = "Unix" 4 | tab_spaces = 4 5 | 6 | # group_imports = "StdExternalCrate" 7 | # imports_granularity = "Crate" 8 | -------------------------------------------------------------------------------- /interchain/scripts/IBC-DEPLOYMENT.md: -------------------------------------------------------------------------------- 1 | # Deployment status of Abstract IBC 2 | 3 | | From\To | Osmosis | Archway | Terra | Juno | Neutron | 4 | |----------|---------|---------|-------|------|---------| 5 | | Osmosis | ❌ | | | | | 6 | | Archway | ✅* | ❌ | ✅ | ✅ | ✅ | 7 | | Terra | ✅* | ✅ | ❌ | ✅* | ✅ | 8 | | Juno | ✅ | ✅ | ✅ | ❌ | ❌* | 9 | | Neutron | ✅ | ✅* | ✅ | ❌* | ❌ | 10 | 11 | ❌: - No reason to deploy 12 | ❌*: - For Neutron - Juno, there is no polytone connection (because there is no active IBC connection it seems) 13 | ✅ : connection was successfuly created. 14 | ✅* manual relaying was needed for abstract IBC channel creation. 15 | 16 | 17 | # Test status of Abstract IBC 18 | 19 | | From\To | Osmosis | Archway | Terra | Juno | Neutron | 20 | |----------|---------|---------|-------|------|---------| 21 | | Osmosis | ❌ | ❌* | ❌* | ❌* | ❌* | 22 | | Archway | ✅ | ❌ | ⭐️ | ⭐️ | ✅ | 23 | | Terra | ⭐️ | ✅ | ❌ | ✅ | ⭐️ | 24 | | Juno | ⭐️ | ⭐️ | ⭐️ | ❌ | ❌* | 25 | | Neutron | ✅ | ✅ | ⭐️ | ❌* | ❌ | 26 | 27 | ❌: - No reason to deploy 28 | ❌*: No active connection 29 | ⭐️: Remote account successfully created. No self-relaying was needed 30 | ✅: Remote account successfully created. Needed manual relaying 31 | -------------------------------------------------------------------------------- /interchain/scripts/src/bin/clone_mock_test.rs: -------------------------------------------------------------------------------- 1 | use abstract_interface::Abstract; 2 | use abstract_std::ibc_host::ExecuteMsgFns; 3 | use abstract_std::ibc_host::HostAction; 4 | use abstract_std::ibc_host::InternalAction; 5 | use abstract_std::ibc_host::QueryMsgFns; 6 | use abstract_std::objects::AccountId; 7 | use cw_orch::daemon::networks::OSMOSIS_1; 8 | use cw_orch::prelude::*; 9 | use cw_orch_clone_testing::CloneTesting; 10 | 11 | fn main() -> anyhow::Result<()> { 12 | let chain = OSMOSIS_1; 13 | let mut app = CloneTesting::new(chain)?; 14 | // Set the sender to the host proxy 15 | let abs = Abstract::load_from(app.clone())?; 16 | let proxy = abs.ibc.host.client_proxy("phoenix".to_string())?; 17 | 18 | app.set_sender(proxy.proxy.clone()); 19 | let abs = Abstract::load_from(app.clone())?; 20 | 21 | env_logger::init(); 22 | log::info!("Terra proxy {}", proxy.proxy); 23 | 24 | // Send a register message to the host 25 | abs.ibc.host.ibc_execute( 26 | "terra15zg7mvqxug2h4nv58u985kk89xaek49zu3cr8sylvq83ts44peaszjqsng".to_string(), 27 | AccountId::local(0), 28 | HostAction::Internal(InternalAction::Register { 29 | name: Some("Default Abstract Account".to_string()), 30 | description: None, 31 | link: None, 32 | namespace: None, 33 | install_modules: vec![], 34 | }), 35 | )?; 36 | 37 | Ok(()) 38 | } 39 | -------------------------------------------------------------------------------- /interchain/taplo.toml: -------------------------------------------------------------------------------- 1 | ../taplo.toml -------------------------------------------------------------------------------- /modules/.cargo/config.toml: -------------------------------------------------------------------------------- 1 | [alias] 2 | schema = "run --example schema --features schema" 3 | wasm = "build --release --target wasm32-unknown-unknown" 4 | -------------------------------------------------------------------------------- /modules/artifacts/abstract_cw_staking-archway.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AbstractSDK/abstract/d189643b849bc8176c07c916377bf979cc8ad3c8/modules/artifacts/abstract_cw_staking-archway.wasm -------------------------------------------------------------------------------- /modules/artifacts/abstract_cw_staking-juno.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AbstractSDK/abstract/d189643b849bc8176c07c916377bf979cc8ad3c8/modules/artifacts/abstract_cw_staking-juno.wasm -------------------------------------------------------------------------------- /modules/artifacts/abstract_cw_staking-kujira.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AbstractSDK/abstract/d189643b849bc8176c07c916377bf979cc8ad3c8/modules/artifacts/abstract_cw_staking-kujira.wasm -------------------------------------------------------------------------------- /modules/artifacts/abstract_cw_staking-osmosis.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AbstractSDK/abstract/d189643b849bc8176c07c916377bf979cc8ad3c8/modules/artifacts/abstract_cw_staking-osmosis.wasm -------------------------------------------------------------------------------- /modules/artifacts/abstract_cw_staking.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AbstractSDK/abstract/d189643b849bc8176c07c916377bf979cc8ad3c8/modules/artifacts/abstract_cw_staking.wasm -------------------------------------------------------------------------------- /modules/artifacts/abstract_dex_adapter-archway.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AbstractSDK/abstract/d189643b849bc8176c07c916377bf979cc8ad3c8/modules/artifacts/abstract_dex_adapter-archway.wasm -------------------------------------------------------------------------------- /modules/artifacts/abstract_dex_adapter-juno.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AbstractSDK/abstract/d189643b849bc8176c07c916377bf979cc8ad3c8/modules/artifacts/abstract_dex_adapter-juno.wasm -------------------------------------------------------------------------------- /modules/artifacts/abstract_dex_adapter-kujira.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AbstractSDK/abstract/d189643b849bc8176c07c916377bf979cc8ad3c8/modules/artifacts/abstract_dex_adapter-kujira.wasm -------------------------------------------------------------------------------- /modules/artifacts/abstract_dex_adapter-neutron.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AbstractSDK/abstract/d189643b849bc8176c07c916377bf979cc8ad3c8/modules/artifacts/abstract_dex_adapter-neutron.wasm -------------------------------------------------------------------------------- /modules/artifacts/abstract_dex_adapter-osmosis.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AbstractSDK/abstract/d189643b849bc8176c07c916377bf979cc8ad3c8/modules/artifacts/abstract_dex_adapter-osmosis.wasm -------------------------------------------------------------------------------- /modules/artifacts/abstract_dex_adapter.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AbstractSDK/abstract/d189643b849bc8176c07c916377bf979cc8ad3c8/modules/artifacts/abstract_dex_adapter.wasm -------------------------------------------------------------------------------- /modules/artifacts/abstract_money_market_adapter-kujira.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AbstractSDK/abstract/d189643b849bc8176c07c916377bf979cc8ad3c8/modules/artifacts/abstract_money_market_adapter-kujira.wasm -------------------------------------------------------------------------------- /modules/artifacts/abstract_money_market_adapter.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AbstractSDK/abstract/d189643b849bc8176c07c916377bf979cc8ad3c8/modules/artifacts/abstract_money_market_adapter.wasm -------------------------------------------------------------------------------- /modules/artifacts/abstract_subscription.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AbstractSDK/abstract/d189643b849bc8176c07c916377bf979cc8ad3c8/modules/artifacts/abstract_subscription.wasm -------------------------------------------------------------------------------- /modules/artifacts/abstract_tendermint_staking_adapter.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AbstractSDK/abstract/d189643b849bc8176c07c916377bf979cc8ad3c8/modules/artifacts/abstract_tendermint_staking_adapter.wasm -------------------------------------------------------------------------------- /modules/artifacts/calendar_app.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AbstractSDK/abstract/d189643b849bc8176c07c916377bf979cc8ad3c8/modules/artifacts/calendar_app.wasm -------------------------------------------------------------------------------- /modules/artifacts/challenge_app.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AbstractSDK/abstract/d189643b849bc8176c07c916377bf979cc8ad3c8/modules/artifacts/challenge_app.wasm -------------------------------------------------------------------------------- /modules/artifacts/my_standalone.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AbstractSDK/abstract/d189643b849bc8176c07c916377bf979cc8ad3c8/modules/artifacts/my_standalone.wasm -------------------------------------------------------------------------------- /modules/artifacts/payment_app.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AbstractSDK/abstract/d189643b849bc8176c07c916377bf979cc8ad3c8/modules/artifacts/payment_app.wasm -------------------------------------------------------------------------------- /modules/artifacts/ping_pong.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AbstractSDK/abstract/d189643b849bc8176c07c916377bf979cc8ad3c8/modules/artifacts/ping_pong.wasm -------------------------------------------------------------------------------- /modules/build_release.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Delete all the current wasms first 4 | rm -rf ./artifacts/*.wasm 5 | 6 | if [[ $(arch) == "arm64" ]]; then 7 | image="cosmwasm/optimizer-arm64:0.16.1" 8 | else 9 | image="cosmwasm/optimizer:0.16.1" 10 | fi 11 | 12 | # Optimized builds 13 | docker run --rm -v "$(pwd)":/code \ 14 | --mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \ 15 | -v "$(dirname "$(pwd)")/integrations":/integrations \ 16 | -v "$(dirname "$(pwd)")/framework":/framework \ 17 | --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ 18 | ${image} -------------------------------------------------------------------------------- /modules/contracts/adapters/STATUS.md: -------------------------------------------------------------------------------- 1 | # Adapter Status (Template) 2 | 3 | This document describes the status of the adapter's integrations with different external systems. 4 | 5 | | Protocol | Implementation | Execution Tests | Query Tests | Notes | 6 | | --- | --- | --- | --- | --- | 7 | | | | | | | 8 | | | | | | | 9 | | | | | | | 10 | | | | | | | 11 | | | | | | | 12 | -------------------------------------------------------------------------------- /modules/contracts/adapters/cw-staking/STATUS.md: -------------------------------------------------------------------------------- 1 | # Adapter Status 2 | 3 | This document describes the status of the staking adapter's integrations with different external systems. 4 | 5 | | Protocol | Implementation | Execution Tests | Query Tests | Notes | 6 | | --- | --- | --- | --- | --- | 7 | | Osmosis | ✅ | ✅ | ❌ | Query failing because of missing whitelist. | 8 | | Astroport | ✅ | ✅ | ✅ | | 9 | | Wynd | ✅ | ✅ | ❌ | | 10 | | Bow | ✅ | ✅ | ✅ | Creating pool not possible because it uses custom module. | 11 | | Astrovault | ✅ | ✅ | ✅ | Astrovault uses custom archway module to create pool, so we rely on existing pools. | 12 | -------------------------------------------------------------------------------- /modules/contracts/adapters/cw-staking/examples/schema.rs: -------------------------------------------------------------------------------- 1 | use std::{env::current_dir, fs::create_dir_all}; 2 | 3 | use abstract_cw_staking::contract::CwStakingAdapter; 4 | use cosmwasm_schema::remove_schemas; 5 | 6 | fn main() { 7 | let mut out_dir = current_dir().unwrap(); 8 | out_dir.push("schema"); 9 | create_dir_all(&out_dir).unwrap(); 10 | remove_schemas(&out_dir).unwrap(); 11 | 12 | CwStakingAdapter::export_schema(&out_dir); 13 | } 14 | -------------------------------------------------------------------------------- /modules/contracts/adapters/cw-staking/src/contract.rs: -------------------------------------------------------------------------------- 1 | use abstract_adapter::{export_endpoints, AdapterContract}; 2 | use abstract_staking_standard::{ 3 | msg::{StakingExecuteMsg, StakingQueryMsg}, 4 | CwStakingError, 5 | }; 6 | use cosmwasm_std::{Empty, Response}; 7 | 8 | use crate::{handlers, CW_STAKING_ADAPTER_ID}; 9 | 10 | pub const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION"); 11 | 12 | /// Staking contract adapter interface 13 | pub type CwStakingAdapter = 14 | AdapterContract; 15 | 16 | /// Staking operation result 17 | pub type StakingResult = Result; 18 | 19 | /// Staking contract adapter 20 | pub const CW_STAKING_ADAPTER: CwStakingAdapter = 21 | CwStakingAdapter::new(CW_STAKING_ADAPTER_ID, CONTRACT_VERSION, None) 22 | .with_execute(handlers::execute_handler) 23 | .with_query(handlers::query_handler); 24 | 25 | // Export the endpoints for this contract 26 | #[cfg(feature = "export")] 27 | export_endpoints!(CW_STAKING_ADAPTER, CwStakingAdapter); 28 | -------------------------------------------------------------------------------- /modules/contracts/adapters/cw-staking/src/handlers/mod.rs: -------------------------------------------------------------------------------- 1 | mod execute; 2 | mod query; 3 | 4 | pub use crate::handlers::{execute::execute_handler, query::query_handler}; 5 | -------------------------------------------------------------------------------- /modules/contracts/adapters/dex/STATUS.md: -------------------------------------------------------------------------------- 1 | # Adapter Status 2 | 3 | This document describes the status of the dex adapter's integrations with different external systems. 4 | 5 | | Protocol | Implementation | Execution Tests | Query Tests | Routing | Notes | 6 | | --- | --- | --- | --- | --- | --- | 7 | | Osmosis | ✅ | ✅ | ❌ | ✅ | | 8 | | Astroport | ✅ | ✅ | ✅ | ✅ | | 9 | | Wynd | ✅ | ✅ | ❌ | ❌ | | 10 | | Bow | ✅ | ❌ | ✅ | ❌ | Liquidity tests not implemented because it uses custom module. | 11 | | Astrovault | ✅ | ✅ | ✅ | ❌ | Testing: Astrovault uses custom archway module to create pool, so we rely on existing pools for testing. | 12 | -------------------------------------------------------------------------------- /modules/contracts/adapters/dex/examples/schema.rs: -------------------------------------------------------------------------------- 1 | use std::{env::current_dir, fs::create_dir_all}; 2 | 3 | use abstract_dex_adapter::{contract::DexAdapter, msg::SimulateSwapResponse}; 4 | use cosmwasm_schema::{export_schema_with_title, remove_schemas, schema_for}; 5 | 6 | fn main() { 7 | let mut out_dir = current_dir().unwrap(); 8 | out_dir.push("schema"); 9 | create_dir_all(&out_dir).unwrap(); 10 | remove_schemas(&out_dir).unwrap(); 11 | 12 | DexAdapter::export_schema(&out_dir); 13 | export_schema_with_title( 14 | &schema_for!(SimulateSwapResponse), 15 | &out_dir, 16 | "AdapterResponse", 17 | ); 18 | } 19 | -------------------------------------------------------------------------------- /modules/contracts/adapters/dex/src/contract.rs: -------------------------------------------------------------------------------- 1 | use abstract_adapter::AdapterContract; 2 | use abstract_dex_standard::{ 3 | msg::{DexExecuteMsg, DexInstantiateMsg, DexQueryMsg}, 4 | DexError, 5 | }; 6 | use cosmwasm_std::Response; 7 | 8 | use crate::{handlers, DEX_ADAPTER_ID}; 9 | 10 | pub const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION"); 11 | 12 | pub type DexAdapter = AdapterContract; 13 | pub type DexResult = Result; 14 | 15 | pub const DEX_ADAPTER: DexAdapter = DexAdapter::new(DEX_ADAPTER_ID, CONTRACT_VERSION, None) 16 | .with_instantiate(handlers::instantiate_handler) 17 | .with_execute(handlers::execute_handler) 18 | .with_query(handlers::query_handler); 19 | 20 | #[cfg(feature = "export")] 21 | use abstract_adapter::export_endpoints; 22 | #[cfg(feature = "export")] 23 | export_endpoints!(DEX_ADAPTER, DexAdapter); 24 | -------------------------------------------------------------------------------- /modules/contracts/adapters/dex/src/exchanges/mod.rs: -------------------------------------------------------------------------------- 1 | pub(crate) mod exchange_resolver; 2 | -------------------------------------------------------------------------------- /modules/contracts/adapters/dex/src/handlers/instantiate.rs: -------------------------------------------------------------------------------- 1 | use abstract_adapter::sdk::AccountVerification; 2 | use abstract_adapter::std::objects::{account::AccountTrace, AccountId}; 3 | use abstract_dex_standard::msg::{DexFees, DexInstantiateMsg}; 4 | use cosmwasm_std::{DepsMut, Env, MessageInfo, Response}; 5 | 6 | use crate::{ 7 | contract::{DexAdapter, DexResult}, 8 | state::DEX_FEES, 9 | }; 10 | 11 | pub fn instantiate_handler( 12 | deps: DepsMut, 13 | _env: Env, 14 | _info: MessageInfo, 15 | module: DexAdapter, 16 | msg: DexInstantiateMsg, 17 | ) -> DexResult { 18 | let recipient = module 19 | .account_registry(deps.as_ref())? 20 | .account(&AccountId::new(msg.recipient_account, AccountTrace::Local)?)?; 21 | let dex_fees = DexFees::new(msg.swap_fee, recipient.into_addr())?; 22 | DEX_FEES.save(deps.storage, &dex_fees)?; 23 | Ok(Response::default()) 24 | } 25 | -------------------------------------------------------------------------------- /modules/contracts/adapters/dex/src/handlers/mod.rs: -------------------------------------------------------------------------------- 1 | mod execute; 2 | mod instantiate; 3 | mod query; 4 | 5 | pub use execute::execute_handler; 6 | pub use instantiate::instantiate_handler; 7 | pub use query::query_handler; 8 | -------------------------------------------------------------------------------- /modules/contracts/adapters/dex/src/state.rs: -------------------------------------------------------------------------------- 1 | use abstract_dex_standard::msg::DexFees; 2 | use cw_storage_plus::Item; 3 | 4 | pub const DEX_FEES: Item = Item::new("dex_fees"); 5 | -------------------------------------------------------------------------------- /modules/contracts/adapters/money-market/STATUS.md: -------------------------------------------------------------------------------- 1 | # Adapter Status 2 | 3 | This document describes the status of the moneymarket adapter's integrations with different external systems. 4 | 5 | | Protocol | Implementation | Execution Tests | Query Tests | Notes | 6 | | --- | --- | --- | --- | --- | 7 | | Mars | ✅ | ✅ | ❌ | | 8 | | Kujira | ✅ | ❌ | ❌ | Liquidity tests not implemented because it uses custom module. | 9 | -------------------------------------------------------------------------------- /modules/contracts/adapters/money-market/examples/schema.rs: -------------------------------------------------------------------------------- 1 | use std::{env::current_dir, fs::create_dir_all}; 2 | 3 | use abstract_money_market_adapter::contract::MoneyMarketAdapter; 4 | use cosmwasm_schema::remove_schemas; 5 | 6 | fn main() { 7 | let mut out_dir = current_dir().unwrap(); 8 | out_dir.push("schema"); 9 | create_dir_all(&out_dir).unwrap(); 10 | remove_schemas(&out_dir).unwrap(); 11 | 12 | MoneyMarketAdapter::export_schema(&out_dir); 13 | } 14 | -------------------------------------------------------------------------------- /modules/contracts/adapters/money-market/src/contract.rs: -------------------------------------------------------------------------------- 1 | use abstract_adapter::{export_endpoints, AdapterContract}; 2 | use abstract_money_market_standard::{ 3 | msg::{MoneyMarketExecuteMsg, MoneyMarketInstantiateMsg, MoneyMarketQueryMsg}, 4 | MoneyMarketError, 5 | }; 6 | use cosmwasm_std::Response; 7 | 8 | use crate::{handlers, MONEY_MARKET_ADAPTER_ID}; 9 | 10 | pub const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION"); 11 | 12 | pub type MoneyMarketAdapter = AdapterContract< 13 | MoneyMarketError, 14 | MoneyMarketInstantiateMsg, 15 | MoneyMarketExecuteMsg, 16 | MoneyMarketQueryMsg, 17 | >; 18 | pub type MoneyMarketResult = Result; 19 | 20 | pub const MONEY_MARKET_ADAPTER: MoneyMarketAdapter = 21 | MoneyMarketAdapter::new(MONEY_MARKET_ADAPTER_ID, CONTRACT_VERSION, None) 22 | .with_instantiate(handlers::instantiate_handler) 23 | .with_execute(handlers::execute_handler) 24 | .with_query(handlers::query_handler); 25 | 26 | #[cfg(feature = "export")] 27 | export_endpoints!(MONEY_MARKET_ADAPTER, MoneyMarketAdapter); 28 | 29 | abstract_adapter::cw_orch_interface!( 30 | MONEY_MARKET_ADAPTER, 31 | crate::contract::MoneyMarketAdapter, 32 | MoneyMarketInstantiateMsg, 33 | MoneyMarketAdapter 34 | ); 35 | -------------------------------------------------------------------------------- /modules/contracts/adapters/money-market/src/handlers/instantiate.rs: -------------------------------------------------------------------------------- 1 | use abstract_adapter::sdk::AccountVerification; 2 | use abstract_adapter::std::objects::{account::AccountTrace, fee::UsageFee, AccountId}; 3 | use abstract_money_market_standard::msg::MoneyMarketInstantiateMsg; 4 | use cosmwasm_std::{DepsMut, Env, MessageInfo, Response}; 5 | 6 | use crate::{ 7 | contract::{MoneyMarketAdapter, MoneyMarketResult}, 8 | state::MONEY_MARKET_FEES, 9 | }; 10 | 11 | pub fn instantiate_handler( 12 | deps: DepsMut, 13 | _env: Env, 14 | _info: MessageInfo, 15 | module: MoneyMarketAdapter, 16 | msg: MoneyMarketInstantiateMsg, 17 | ) -> MoneyMarketResult { 18 | let recipient = module 19 | .account_registry(deps.as_ref())? 20 | .account(&AccountId::new(msg.recipient_account, AccountTrace::Local)?)?; 21 | let money_market_fees = UsageFee::new(msg.fee, recipient.into_addr())?; 22 | MONEY_MARKET_FEES.save(deps.storage, &money_market_fees)?; 23 | Ok(Response::default()) 24 | } 25 | -------------------------------------------------------------------------------- /modules/contracts/adapters/money-market/src/handlers/mod.rs: -------------------------------------------------------------------------------- 1 | mod execute; 2 | mod instantiate; 3 | mod query; 4 | 5 | pub use execute::execute_handler; 6 | pub use instantiate::instantiate_handler; 7 | pub use query::query_handler; 8 | -------------------------------------------------------------------------------- /modules/contracts/adapters/money-market/src/state.rs: -------------------------------------------------------------------------------- 1 | use abstract_adapter::std::objects::fee::UsageFee; 2 | use cw_storage_plus::Item; 3 | 4 | pub const MONEY_MARKET_FEES: Item = Item::new("money_market_fees"); 5 | -------------------------------------------------------------------------------- /modules/contracts/adapters/tendermint-staking/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = { workspace = true } 3 | description = "Abstract Tendermint Staking Adapter. This contract allows interacting with staking on multiple Tendermint chains" 4 | edition = { workspace = true } 5 | license = { workspace = true } 6 | name = "abstract-tendermint-staking-adapter" 7 | version = { workspace = true } 8 | 9 | exclude = ["contract.wasm", "hash.txt"] 10 | 11 | [[example]] 12 | name = "schema" 13 | required-features = ["schema"] 14 | 15 | [lib] 16 | crate-type = ["cdylib", "rlib"] 17 | 18 | [features] 19 | default = ["export"] 20 | export = [] 21 | schema = ["abstract-adapter/schema"] 22 | 23 | 24 | # Keep as is until TendermintStake updates. 25 | [dependencies] 26 | abstract-adapter = { workspace = true } 27 | cosmwasm-schema = { workspace = true } 28 | cosmwasm-std = { workspace = true } 29 | thiserror = { workspace = true } 30 | 31 | cw-orch = { workspace = true } 32 | 33 | [dev-dependencies] 34 | abstract-adapter = { workspace = true, features = ["schema"] } 35 | -------------------------------------------------------------------------------- /modules/contracts/adapters/tendermint-staking/README.md: -------------------------------------------------------------------------------- 1 | # TendermintStake Adapter 2 | 3 | Adapter module to easily delegate and claim rewards from validators. 4 | 5 | # Features 6 | 7 | - Claim all rewards in one go 8 | - (TODO) claim and swap to a specific asset in one go 9 | 10 | ## Installation 11 | TBD 12 | 13 | ## Usage with the Abstract SDK 14 | TBD 15 | 16 | ## Why Use the TendermintStake Adapter? 17 | TBD 18 | 19 | ### Use Cases 20 | TBD 21 | 22 | ## Documentation 23 | 24 | - **Adapters Documentation**: Comprehensive information about adapters can be found in the [official documentation](https://docs.abstract.money/3_framework/6_module_types.html#adapters). 25 | 26 | ## Contributing 27 | 28 | If you have suggestions, improvements, new dexes, or want to contribute to the project, we welcome your input on GitHub. 29 | 30 | -------------------------------------------------------------------------------- /modules/contracts/adapters/tendermint-staking/examples/schema.rs: -------------------------------------------------------------------------------- 1 | use std::{env::current_dir, fs::create_dir_all}; 2 | 3 | use abstract_tendermint_staking_adapter::contract::TendermintStakeAdapter; 4 | use cosmwasm_schema::remove_schemas; 5 | 6 | fn main() { 7 | let mut out_dir = current_dir().unwrap(); 8 | out_dir.push("schema"); 9 | create_dir_all(&out_dir).unwrap(); 10 | remove_schemas(&out_dir).unwrap(); 11 | 12 | TendermintStakeAdapter::export_schema(&out_dir); 13 | } 14 | -------------------------------------------------------------------------------- /modules/contracts/adapters/tendermint-staking/src/error.rs: -------------------------------------------------------------------------------- 1 | use abstract_adapter::sdk::AbstractSdkError; 2 | use abstract_adapter::std::AbstractError; 3 | use abstract_adapter::AdapterError; 4 | use cosmwasm_std::StdError; 5 | use thiserror::Error; 6 | 7 | #[derive(Error, Debug, PartialEq)] 8 | pub enum TendermintStakeError { 9 | #[error(transparent)] 10 | Std(#[from] StdError), 11 | 12 | #[error(transparent)] 13 | AbstractSdk(#[from] AbstractSdkError), 14 | 15 | #[error(transparent)] 16 | Abstract(#[from] AbstractError), 17 | 18 | #[error(transparent)] 19 | AdapterError(#[from] AdapterError), 20 | } 21 | -------------------------------------------------------------------------------- /modules/contracts/adapters/tendermint-staking/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod contract; 2 | pub mod error; 3 | pub mod msg; 4 | mod staking; 5 | 6 | pub const TENDERMINT_STAKING: &str = "abstract:tendermint-staking"; 7 | 8 | pub use contract::interface::TMintStakingAdapter; 9 | 10 | pub use msg::{TendermintStakingExecuteMsgFns, TendermintStakingQueryMsgFns}; 11 | -------------------------------------------------------------------------------- /modules/contracts/apps/calendar/examples/schema.rs: -------------------------------------------------------------------------------- 1 | use std::{env::current_dir, fs::create_dir_all}; 2 | 3 | use calendar_app::contract::CalendarApp; 4 | use cosmwasm_schema::remove_schemas; 5 | 6 | fn main() { 7 | let mut out_dir = current_dir().unwrap(); 8 | out_dir.push("schema"); 9 | create_dir_all(&out_dir).unwrap(); 10 | remove_schemas(&out_dir).unwrap(); 11 | 12 | #[cfg(feature = "schema")] 13 | CalendarApp::export_schema(&out_dir); 14 | } 15 | -------------------------------------------------------------------------------- /modules/contracts/apps/calendar/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Calendar", 3 | "description": "Stake-to-schedule to avoid people not showing up to meetings!", 4 | "website": "https://abstract.money/", 5 | "docs": "", 6 | "type": "app", 7 | "icon": "GiTrade", 8 | "enabled": false 9 | } 10 | -------------------------------------------------------------------------------- /modules/contracts/apps/calendar/src/contract.rs: -------------------------------------------------------------------------------- 1 | use abstract_app::AppContract; 2 | use cosmwasm_std::Response; 3 | 4 | use crate::{ 5 | error::CalendarError, 6 | handlers, 7 | msg::{CalendarExecuteMsg, CalendarInstantiateMsg, CalendarMigrateMsg, CalendarQueryMsg}, 8 | }; 9 | 10 | /// The version of your app 11 | pub const APP_VERSION: &str = env!("CARGO_PKG_VERSION"); 12 | /// The id of the app 13 | pub const APP_ID: &str = "abstract:calendar"; 14 | 15 | /// The type of the result returned by your app's entry points. 16 | pub type CalendarAppResult = Result; 17 | 18 | /// The type of the app that is used to build your app and access the Abstract SDK features. 19 | pub type CalendarApp = AppContract< 20 | CalendarError, 21 | CalendarInstantiateMsg, 22 | CalendarExecuteMsg, 23 | CalendarQueryMsg, 24 | CalendarMigrateMsg, 25 | >; 26 | 27 | const APP: CalendarApp = CalendarApp::new(APP_ID, APP_VERSION, None) 28 | .with_instantiate(handlers::instantiate_handler) 29 | .with_execute(handlers::execute_handler) 30 | .with_query(handlers::query_handler) 31 | .with_migrate(handlers::migrate_handler); 32 | 33 | // Export handlers 34 | #[cfg(feature = "export")] 35 | abstract_app::export_endpoints!(APP, CalendarApp); 36 | 37 | abstract_app::cw_orch_interface!(APP, CalendarApp, CalendarAppInterface); 38 | -------------------------------------------------------------------------------- /modules/contracts/apps/calendar/src/handlers/instantiate.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_std::{DepsMut, Env, MessageInfo, Response}; 2 | 3 | use super::execute::resolve_native_ans_denom; 4 | use crate::{ 5 | contract::{CalendarApp, CalendarAppResult}, 6 | error::CalendarError, 7 | msg::CalendarInstantiateMsg, 8 | state::{Config, CONFIG}, 9 | }; 10 | 11 | pub fn instantiate_handler( 12 | deps: DepsMut, 13 | _env: Env, 14 | _info: MessageInfo, 15 | module: CalendarApp, 16 | msg: CalendarInstantiateMsg, 17 | ) -> CalendarAppResult { 18 | let denom = resolve_native_ans_denom(deps.as_ref(), &module, msg.denom)?; 19 | 20 | msg.start_time.validate()?; 21 | msg.end_time.validate()?; 22 | 23 | if msg.start_time >= msg.end_time { 24 | return Err(CalendarError::EndTimeMustBeAfterStartTime {}); 25 | } 26 | 27 | let config: Config = Config { 28 | price_per_minute: msg.price_per_minute, 29 | denom, 30 | utc_offset: msg.utc_offset, 31 | start_time: msg.start_time, 32 | end_time: msg.end_time, 33 | }; 34 | 35 | CONFIG.save(deps.storage, &config)?; 36 | 37 | Ok(Response::new()) 38 | } 39 | -------------------------------------------------------------------------------- /modules/contracts/apps/calendar/src/handlers/migrate.rs: -------------------------------------------------------------------------------- 1 | use abstract_app::sdk::AbstractResponse; 2 | use cosmwasm_std::{DepsMut, Env}; 3 | 4 | use crate::{ 5 | contract::{CalendarApp, CalendarAppResult}, 6 | msg::CalendarMigrateMsg, 7 | }; 8 | 9 | /// Handle the app migrate msg 10 | /// The top-level Abstract app does version checking and dispatches to this handler 11 | pub fn migrate_handler( 12 | _deps: DepsMut, 13 | _env: Env, 14 | module: CalendarApp, 15 | _msg: CalendarMigrateMsg, 16 | ) -> CalendarAppResult { 17 | Ok(module.response("migrate")) 18 | } 19 | -------------------------------------------------------------------------------- /modules/contracts/apps/calendar/src/handlers/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod execute; 2 | pub mod instantiate; 3 | pub mod migrate; 4 | pub mod query; 5 | 6 | pub use crate::handlers::{ 7 | execute::execute_handler, instantiate::instantiate_handler, migrate::migrate_handler, 8 | query::query_handler, 9 | }; 10 | -------------------------------------------------------------------------------- /modules/contracts/apps/calendar/src/handlers/query.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_std::{to_json_binary, Binary, Deps, Env, Int64, StdResult}; 2 | 3 | use crate::{ 4 | contract::{CalendarApp, CalendarAppResult}, 5 | msg::{CalendarQueryMsg, ConfigResponse, MeetingsResponse}, 6 | state::{CALENDAR, CONFIG}, 7 | }; 8 | 9 | pub fn query_handler( 10 | deps: Deps, 11 | _env: Env, 12 | _module: &CalendarApp, 13 | msg: CalendarQueryMsg, 14 | ) -> CalendarAppResult { 15 | match msg { 16 | CalendarQueryMsg::Config {} => to_json_binary(&query_config(deps)?), 17 | CalendarQueryMsg::Meetings { day_datetime } => { 18 | to_json_binary(&query_meetings(deps, day_datetime)?) 19 | } 20 | } 21 | .map_err(Into::into) 22 | } 23 | 24 | fn query_config(deps: Deps) -> StdResult { 25 | let config = CONFIG.load(deps.storage)?; 26 | Ok(ConfigResponse { 27 | price_per_minute: config.price_per_minute, 28 | utc_offset: config.utc_offset, 29 | start_time: config.start_time, 30 | end_time: config.end_time, 31 | }) 32 | } 33 | 34 | fn query_meetings(deps: Deps, day_datetime: Int64) -> StdResult { 35 | let meetings = CALENDAR 36 | .may_load(deps.storage, day_datetime.i64())? 37 | .unwrap_or_default(); 38 | Ok(MeetingsResponse { meetings }) 39 | } 40 | -------------------------------------------------------------------------------- /modules/contracts/apps/calendar/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod contract; 2 | pub mod error; 3 | mod handlers; 4 | pub mod msg; 5 | pub mod state; 6 | 7 | pub use contract::interface::CalendarAppInterface; 8 | pub use msg::{CalendarExecuteMsgFns, CalendarQueryMsgFns}; 9 | -------------------------------------------------------------------------------- /modules/contracts/apps/calendar/tests/wasm.rs: -------------------------------------------------------------------------------- 1 | use calendar_app::CalendarAppInterface; 2 | use cw_orch::{daemon::networks::OSMOSIS_1, prelude::*}; 3 | 4 | #[test] 5 | fn successful_wasm() { 6 | CalendarAppInterface::::wasm(&OSMOSIS_1.into()); 7 | } 8 | -------------------------------------------------------------------------------- /modules/contracts/apps/challenge/examples/schema.rs: -------------------------------------------------------------------------------- 1 | use std::{env::current_dir, fs::create_dir_all}; 2 | 3 | use challenge_app::contract::ChallengeApp as App; 4 | use cosmwasm_schema::remove_schemas; 5 | 6 | fn main() { 7 | let mut out_dir = current_dir().unwrap(); 8 | out_dir.push("schema"); 9 | create_dir_all(&out_dir).unwrap(); 10 | remove_schemas(&out_dir).unwrap(); 11 | 12 | #[cfg(feature = "schema")] 13 | App::export_schema(&out_dir); 14 | } 15 | -------------------------------------------------------------------------------- /modules/contracts/apps/challenge/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Challenge", 3 | "description": "Create personal challenges and invite your friends to hold yourself accountable", 4 | "website": "https://abstract.money/", 5 | "docs": "", 6 | "type": "app", 7 | "icon": "RiCoinsLine", 8 | "enabled": false 9 | } 10 | -------------------------------------------------------------------------------- /modules/contracts/apps/challenge/src/contract.rs: -------------------------------------------------------------------------------- 1 | use abstract_app::AppContract; 2 | use cosmwasm_std::{Empty, Response}; 3 | 4 | use crate::{ 5 | error::AppError, 6 | handlers, 7 | msg::{ChallengeExecuteMsg, ChallengeInstantiateMsg, ChallengeQueryMsg}, 8 | }; 9 | 10 | /// The version of your app 11 | pub const CHALLENGE_APP_VERSION: &str = env!("CARGO_PKG_VERSION"); 12 | /// the id of the app 13 | pub const CHALLENGE_APP_ID: &str = "abstract:challenge"; 14 | 15 | /// The type of the result returned by your app's entry points. 16 | pub type AppResult = Result; 17 | 18 | /// The type of the app that is used to build your app and access the Abstract SDK features. 19 | pub type ChallengeApp = 20 | AppContract; 21 | 22 | const CHALLENGE_APP: ChallengeApp = 23 | ChallengeApp::new(CHALLENGE_APP_ID, CHALLENGE_APP_VERSION, None) 24 | .with_instantiate(handlers::instantiate_handler) 25 | .with_execute(handlers::execute_handler) 26 | .with_query(handlers::query_handler); 27 | 28 | // Export handlers 29 | #[cfg(feature = "export")] 30 | abstract_app::export_endpoints!(CHALLENGE_APP, ChallengeApp); 31 | 32 | abstract_app::cw_orch_interface!(CHALLENGE_APP, ChallengeApp, Challenge); 33 | -------------------------------------------------------------------------------- /modules/contracts/apps/challenge/src/handlers/instantiate.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_std::{DepsMut, Env, MessageInfo, Response}; 2 | 3 | use crate::{ 4 | contract::{AppResult, ChallengeApp}, 5 | msg::ChallengeInstantiateMsg, 6 | state::{NEXT_ID, SIMPLE_VOTING}, 7 | }; 8 | 9 | pub fn instantiate_handler( 10 | deps: DepsMut, 11 | _env: Env, 12 | _info: MessageInfo, 13 | _module: ChallengeApp, 14 | msg: ChallengeInstantiateMsg, 15 | ) -> AppResult { 16 | NEXT_ID.save(deps.storage, &0u64)?; 17 | SIMPLE_VOTING.instantiate(deps.storage, &msg.vote_config)?; 18 | Ok(Response::new()) 19 | } 20 | -------------------------------------------------------------------------------- /modules/contracts/apps/challenge/src/handlers/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod execute; 2 | pub mod instantiate; 3 | pub mod query; 4 | 5 | pub use crate::handlers::{ 6 | execute::execute_handler, instantiate::instantiate_handler, query::query_handler, 7 | }; 8 | -------------------------------------------------------------------------------- /modules/contracts/apps/challenge/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod contract; 2 | pub mod error; 3 | mod handlers; 4 | pub mod msg; 5 | pub mod state; 6 | 7 | pub use contract::interface::Challenge; 8 | pub use msg::{ChallengeExecuteMsgFns, ChallengeQueryMsgFns}; 9 | -------------------------------------------------------------------------------- /modules/contracts/apps/challenge/tests/wasm.rs: -------------------------------------------------------------------------------- 1 | use challenge_app::{contract::CHALLENGE_APP_ID, Challenge}; 2 | use cw_orch::{daemon::networks::OSMOSIS_1, prelude::*}; 3 | 4 | #[test] 5 | fn successful_wasm() { 6 | // Create the mock 7 | let mock = MockBech32::new("mock"); 8 | 9 | // Construct the counter interface 10 | let contract = Challenge::new(CHALLENGE_APP_ID, mock); 11 | 12 | Challenge::::wasm(&OSMOSIS_1.into()); 13 | let _ = contract.upload(); 14 | } 15 | -------------------------------------------------------------------------------- /modules/contracts/apps/payment/examples/schema.rs: -------------------------------------------------------------------------------- 1 | use std::{env::current_dir, fs::create_dir_all}; 2 | 3 | use cosmwasm_schema::remove_schemas; 4 | use payment_app::contract::PaymentApp; 5 | 6 | fn main() { 7 | let mut out_dir = current_dir().unwrap(); 8 | out_dir.push("schema"); 9 | create_dir_all(&out_dir).unwrap(); 10 | remove_schemas(&out_dir).unwrap(); 11 | 12 | #[cfg(feature = "schema")] 13 | PaymentApp::export_schema(&out_dir); 14 | } 15 | -------------------------------------------------------------------------------- /modules/contracts/apps/payment/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "App", 3 | "description": "App description.", 4 | "website": "", 5 | "docs": "", 6 | "type": "api", 7 | "icon": "GiTrade", 8 | "enabled": true 9 | } 10 | -------------------------------------------------------------------------------- /modules/contracts/apps/payment/src/error.rs: -------------------------------------------------------------------------------- 1 | use abstract_app::sdk::AbstractSdkError; 2 | use abstract_app::std::AbstractError; 3 | use abstract_app::AppError as AbstractAppError; 4 | use cosmwasm_std::StdError; 5 | use cw_asset::AssetError; 6 | use cw_controllers::AdminError; 7 | use thiserror::Error; 8 | 9 | #[derive(Error, Debug, PartialEq)] 10 | pub enum AppError { 11 | #[error(transparent)] 12 | Std(#[from] StdError), 13 | 14 | #[error(transparent)] 15 | Abstract(#[from] AbstractError), 16 | 17 | #[error(transparent)] 18 | AbstractSdk(#[from] AbstractSdkError), 19 | 20 | #[error(transparent)] 21 | Asset(#[from] AssetError), 22 | 23 | #[error(transparent)] 24 | Admin(#[from] AdminError), 25 | 26 | #[error(transparent)] 27 | DappError(#[from] AbstractAppError), 28 | 29 | #[error("Tipper does not exist")] 30 | TipperDoesNotExist {}, 31 | 32 | #[error("Desired asset does not exist on Abstract Name Service")] 33 | DesiredAssetDoesNotExist {}, 34 | 35 | #[error("Dex {0} is not registered on Abstract Name Service")] 36 | DexNotRegistered(String), 37 | } 38 | -------------------------------------------------------------------------------- /modules/contracts/apps/payment/src/handlers/custom.rs: -------------------------------------------------------------------------------- 1 | use abstract_app::sdk::base::CustomExecuteHandler; 2 | use cosmwasm_std::{DepsMut, Env, MessageInfo, Response}; 3 | 4 | use crate::{error::AppError, msg::CustomExecuteMsg}; 5 | 6 | impl CustomExecuteHandler for CustomExecuteMsg { 7 | type ExecuteMsg = crate::msg::ExecuteMsg; 8 | 9 | fn try_into_base(self) -> Result { 10 | match self { 11 | CustomExecuteMsg::Base(msg) => Ok(crate::msg::ExecuteMsg::from(msg)), 12 | CustomExecuteMsg::Module(msg) => Ok(crate::msg::ExecuteMsg::from(msg)), 13 | _ => Err(self), 14 | } 15 | } 16 | 17 | fn custom_execute( 18 | self, 19 | deps: DepsMut, 20 | env: Env, 21 | info: MessageInfo, 22 | module: crate::contract::PaymentApp, 23 | ) -> Result { 24 | match self { 25 | CustomExecuteMsg::Receive(cw20_msg) => { 26 | super::receive_handler(deps, env, info, module, cw20_msg) 27 | } 28 | _ => unreachable!(), 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /modules/contracts/apps/payment/src/handlers/instantiate.rs: -------------------------------------------------------------------------------- 1 | use abstract_app::sdk::features::AbstractNameService; 2 | use cosmwasm_std::{DepsMut, Env, MessageInfo, Response}; 3 | 4 | use crate::{ 5 | contract::{AppResult, PaymentApp}, 6 | error::AppError, 7 | msg::AppInstantiateMsg, 8 | state::{Config, CONFIG, TIP_COUNT}, 9 | }; 10 | 11 | pub fn instantiate_handler( 12 | deps: DepsMut, 13 | _env: Env, 14 | _info: MessageInfo, 15 | module: PaymentApp, 16 | msg: AppInstantiateMsg, 17 | ) -> AppResult { 18 | let name_service = module.name_service(deps.as_ref()); 19 | 20 | if let Some(asset) = &msg.desired_asset { 21 | name_service 22 | .query(asset) 23 | .map_err(|_| AppError::DesiredAssetDoesNotExist {})?; 24 | } 25 | let ans_dexes = name_service.registered_dexes()?; 26 | for dex in msg.exchanges.iter() { 27 | if !ans_dexes.dexes.contains(dex) { 28 | return Err(AppError::DexNotRegistered(dex.to_owned())); 29 | } 30 | } 31 | 32 | let config: Config = Config { 33 | desired_asset: msg.desired_asset, 34 | denom_asset: msg.denom_asset, 35 | exchanges: msg.exchanges, 36 | }; 37 | 38 | CONFIG.save(deps.storage, &config)?; 39 | TIP_COUNT.save(deps.storage, &0)?; 40 | 41 | // Example instantiation that doesn't do anything 42 | Ok(Response::new()) 43 | } 44 | -------------------------------------------------------------------------------- /modules/contracts/apps/payment/src/handlers/migrate.rs: -------------------------------------------------------------------------------- 1 | use abstract_app::sdk::AbstractResponse; 2 | use cosmwasm_std::{DepsMut, Env}; 3 | 4 | use crate::{ 5 | contract::{AppResult, PaymentApp}, 6 | msg::AppMigrateMsg, 7 | }; 8 | 9 | /// Handle the app migrate msg 10 | /// The top-level Abstract app does version checking and dispatches to this handler 11 | pub fn migrate_handler( 12 | _deps: DepsMut, 13 | _env: Env, 14 | module: PaymentApp, 15 | _msg: AppMigrateMsg, 16 | ) -> AppResult { 17 | Ok(module.response("migrate")) 18 | } 19 | -------------------------------------------------------------------------------- /modules/contracts/apps/payment/src/handlers/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod custom; 2 | pub mod execute; 3 | pub mod instantiate; 4 | pub mod migrate; 5 | pub mod query; 6 | pub mod receive; 7 | 8 | pub use crate::handlers::{ 9 | execute::execute_handler, instantiate::instantiate_handler, migrate::migrate_handler, 10 | query::query_handler, receive::receive_handler, 11 | }; 12 | -------------------------------------------------------------------------------- /modules/contracts/apps/payment/src/handlers/receive.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_std::{DepsMut, Env, MessageInfo}; 2 | use cw20::Cw20ReceiveMsg; 3 | use cw_asset::Asset; 4 | 5 | use crate::contract::{AppResult, PaymentApp}; 6 | 7 | pub fn receive_handler( 8 | deps: DepsMut, 9 | env: Env, 10 | mut info: MessageInfo, 11 | module: PaymentApp, 12 | msg: Cw20ReceiveMsg, 13 | ) -> AppResult { 14 | let Cw20ReceiveMsg { 15 | sender, 16 | amount, 17 | msg: _, 18 | } = msg; 19 | 20 | let receipt = Asset::cw20(info.sender, amount); 21 | 22 | info.sender = deps.api.addr_validate(&sender)?; 23 | crate::handlers::execute::tip(deps, env, info, module, Some(receipt)) 24 | } 25 | -------------------------------------------------------------------------------- /modules/contracts/apps/payment/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod contract; 2 | pub mod error; 3 | mod handlers; 4 | pub mod msg; 5 | pub mod state; 6 | 7 | pub use contract::interface::PaymentAppInterface; 8 | pub use msg::{AppExecuteMsgFns, AppQueryMsgFns}; 9 | -------------------------------------------------------------------------------- /modules/contracts/apps/payment/src/state.rs: -------------------------------------------------------------------------------- 1 | use abstract_app::std::objects::{AssetEntry, DexName}; 2 | use cosmwasm_std::{Addr, Uint128}; 3 | use cw_storage_plus::{Item, SnapshotMap, Strategy}; 4 | 5 | pub const CONFIG: Item = Item::new("cfg"); 6 | // The sender address is used here for querying by tipper 7 | pub const TIPPERS: SnapshotMap<(&Addr, &AssetEntry), Uint128> = 8 | SnapshotMap::new("tps", "tps__chckp", "tps_chnglg", Strategy::EveryBlock); 9 | pub const TIP_COUNT: Item = Item::new("tip-count"); 10 | pub const TIPPER_COUNT: SnapshotMap<&Addr, u32> = SnapshotMap::new( 11 | "tps-count", 12 | "tps-count__chckp", 13 | "tps-count__chglg", 14 | Strategy::EveryBlock, 15 | ); 16 | 17 | #[cosmwasm_schema::cw_serde] 18 | pub struct Config { 19 | pub desired_asset: Option, 20 | pub denom_asset: String, 21 | pub exchanges: Vec, 22 | } 23 | -------------------------------------------------------------------------------- /modules/contracts/apps/payment/tests/wasm.rs: -------------------------------------------------------------------------------- 1 | use cw_orch::{daemon::networks::OSMOSIS_1, prelude::*}; 2 | use payment_app::PaymentAppInterface; 3 | 4 | #[test] 5 | fn successful_wasm() { 6 | PaymentAppInterface::::wasm(&OSMOSIS_1.into()); 7 | } 8 | -------------------------------------------------------------------------------- /modules/contracts/apps/ping-pong/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | edition = "2021" 3 | name = "ping-pong" 4 | version = "0.1.0" 5 | 6 | [features] 7 | default = ["export"] 8 | export = [] 9 | schema = ["abstract-app/schema"] 10 | 11 | [lib] 12 | crate-type = ["cdylib", "rlib"] 13 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 14 | 15 | [dependencies] 16 | abstract-app = { workspace = true } 17 | abstract-ibc-client = { version = "0.26.0", default-features = false, path = "../../../../framework/contracts/native/ibc-client" } 18 | cosmwasm-schema = { workspace = true } 19 | cosmwasm-std = { workspace = true } 20 | cw-asset = { workspace = true } 21 | cw-controllers = { workspace = true } 22 | cw-orch = { workspace = true } 23 | cw-storage-plus = { workspace = true } 24 | thiserror = { workspace = true } 25 | 26 | [dev-dependencies] 27 | abstract-client = { workspace = true, features = ["interchain"] } 28 | abstract-interface = { workspace = true, features = ["daemon"] } 29 | clap.workspace = true 30 | cw-orch = { workspace = true, features = ["daemon"] } 31 | cw-orch-interchain = { workspace = true, features = ["daemon"] } 32 | cw-orch-polytone = { package = "abstract-cw-orch-polytone", version = "6.0.0" } 33 | dotenv = "0.15.0" 34 | env_logger = "0.11" 35 | semver.workspace = true 36 | -------------------------------------------------------------------------------- /modules/contracts/apps/ping-pong/src/error.rs: -------------------------------------------------------------------------------- 1 | use abstract_app::{ 2 | objects::module::ModuleInfo, sdk::AbstractSdkError, std::AbstractError, 3 | AppError as AbstractAppError, 4 | }; 5 | use cosmwasm_std::StdError; 6 | use cw_asset::AssetError; 7 | use cw_controllers::AdminError; 8 | use thiserror::Error; 9 | 10 | #[derive(Error, Debug, PartialEq)] 11 | pub enum AppError { 12 | #[error(transparent)] 13 | Std(#[from] StdError), 14 | 15 | #[error(transparent)] 16 | Abstract(#[from] AbstractError), 17 | 18 | #[error(transparent)] 19 | AbstractSdk(#[from] AbstractSdkError), 20 | 21 | #[error(transparent)] 22 | Asset(#[from] AssetError), 23 | 24 | #[error(transparent)] 25 | Admin(#[from] AdminError), 26 | 27 | #[error(transparent)] 28 | DappError(#[from] AbstractAppError), 29 | 30 | #[error("Caller module is not a ping pong: {source_module}")] 31 | NotPingPong { source_module: ModuleInfo }, 32 | 33 | #[error("Can't start ping pong with zero pongs")] 34 | ZeroPongs {}, 35 | 36 | #[error("First play must be a Ping")] 37 | FirstPlayMustBePing {}, 38 | } 39 | -------------------------------------------------------------------------------- /modules/contracts/apps/ping-pong/src/handlers/instantiate.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_std::{DepsMut, Env, MessageInfo, Response}; 2 | 3 | use crate::{ 4 | contract::{App, AppResult}, 5 | msg::AppInstantiateMsg, 6 | state::{LOSSES, WINS}, 7 | }; 8 | 9 | pub fn instantiate_handler( 10 | deps: DepsMut, 11 | _env: Env, 12 | _info: MessageInfo, 13 | _module: App, 14 | _msg: AppInstantiateMsg, 15 | ) -> AppResult { 16 | WINS.save(deps.storage, &0)?; 17 | LOSSES.save(deps.storage, &0)?; 18 | 19 | Ok(Response::new()) 20 | } 21 | -------------------------------------------------------------------------------- /modules/contracts/apps/ping-pong/src/handlers/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod execute; 2 | pub mod instantiate; 3 | pub mod query; 4 | 5 | pub use crate::handlers::{ 6 | execute::execute_handler, instantiate::instantiate_handler, query::query_handler, 7 | }; 8 | -------------------------------------------------------------------------------- /modules/contracts/apps/ping-pong/src/handlers/query.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_std::{to_json_binary, Binary, Deps, Env, StdResult}; 2 | 3 | use crate::{ 4 | contract::{App, AppResult}, 5 | msg::{AppQueryMsg, BlockHeightResponse, GameStatusResponse}, 6 | state::{LOSSES, WINS}, 7 | }; 8 | 9 | pub fn query_handler(deps: Deps, env: Env, _module: &App, msg: AppQueryMsg) -> AppResult { 10 | match msg { 11 | AppQueryMsg::GameStatus {} => to_json_binary(&query_wins(deps)?), 12 | AppQueryMsg::BlockHeight {} => to_json_binary(&query_block_height(env)?), 13 | } 14 | .map_err(Into::into) 15 | } 16 | 17 | fn query_wins(deps: Deps) -> StdResult { 18 | let wins = WINS.load(deps.storage)?; 19 | let losses = LOSSES.load(deps.storage)?; 20 | 21 | Ok(GameStatusResponse { wins, losses }) 22 | } 23 | 24 | fn query_block_height(env: Env) -> StdResult { 25 | Ok(BlockHeightResponse { 26 | height: env.block.height, 27 | }) 28 | } 29 | -------------------------------------------------------------------------------- /modules/contracts/apps/ping-pong/src/ibc/mod.rs: -------------------------------------------------------------------------------- 1 | mod callback; 2 | mod module; 3 | 4 | pub use callback::ibc_callback; 5 | pub use module::receive_module_ibc; 6 | -------------------------------------------------------------------------------- /modules/contracts/apps/ping-pong/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod contract; 2 | pub mod error; 3 | mod handlers; 4 | mod ibc; 5 | pub mod msg; 6 | pub mod state; 7 | 8 | pub use contract::interface::AppInterface; 9 | pub use msg::{AppExecuteMsgFns, AppQueryMsgFns}; 10 | -------------------------------------------------------------------------------- /modules/contracts/apps/ping-pong/src/state.rs: -------------------------------------------------------------------------------- 1 | use cw_storage_plus::Item; 2 | 3 | pub const WINS: Item = Item::new("wins"); 4 | pub const LOSSES: Item = Item::new("losses"); 5 | -------------------------------------------------------------------------------- /modules/contracts/apps/subscription/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = { workspace = true } 3 | edition = { workspace = true } 4 | name = "abstract-subscription" 5 | version = { workspace = true } 6 | 7 | exclude = ["contract.wasm", "hash.txt"] 8 | 9 | [lib] 10 | crate-type = ["cdylib", "rlib"] 11 | 12 | [[example]] 13 | name = "schema" 14 | required-features = ["schema"] 15 | 16 | [[example]] 17 | name = "deploy" 18 | 19 | [features] 20 | default = ["export"] 21 | export = [] 22 | schema = ["abstract-app/schema"] 23 | 24 | [dependencies] 25 | cosmwasm-schema = { workspace = true } 26 | cosmwasm-std = { workspace = true } 27 | cw-asset = { workspace = true } 28 | cw-controllers = { workspace = true } 29 | cw-storage-plus = { workspace = true } 30 | cw20 = { workspace = true } 31 | semver = { workspace = true } 32 | thiserror = { workspace = true } 33 | 34 | abstract-app = { workspace = true } 35 | cw-orch = { workspace = true } 36 | 37 | cw-address-like = { workspace = true } 38 | 39 | [dev-dependencies] 40 | abstract-client = { workspace = true, features = ["test-utils"] } 41 | # Deploy 42 | abstract-interface = { workspace = true, features = ["daemon"] } 43 | clap = { workspace = true } 44 | dotenv = "0.15.0" 45 | env_logger = "0.11.3" 46 | -------------------------------------------------------------------------------- /modules/contracts/apps/subscription/examples/deploy.rs: -------------------------------------------------------------------------------- 1 | use abstract_app::abstract_interface::*; 2 | use abstract_subscription::contract::{interface::SubscriptionInterface, SUBSCRIPTION_ID}; 3 | use clap::Parser; 4 | use cw_orch::{ 5 | anyhow, 6 | prelude::{networks::parse_network, *}, 7 | }; 8 | use dotenv::dotenv; 9 | use semver::Version; 10 | 11 | const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION"); 12 | 13 | fn deploy_subscription(networks: Vec) -> anyhow::Result<()> { 14 | let version: Version = CONTRACT_VERSION.parse().unwrap(); 15 | for network in networks { 16 | let chain = DaemonBuilder::new(network).build()?; 17 | let subscription_app = SubscriptionInterface::new(SUBSCRIPTION_ID, chain); 18 | subscription_app.deploy(version.clone(), DeployStrategy::Try)?; 19 | } 20 | Ok(()) 21 | } 22 | #[derive(Parser, Default, Debug)] 23 | #[command(author, version, about, long_about = None)] 24 | struct Arguments { 25 | /// Network Id to deploy on 26 | #[arg(short, long)] 27 | network_ids: Vec, 28 | } 29 | 30 | fn main() -> anyhow::Result<()> { 31 | dotenv().ok(); 32 | env_logger::init(); 33 | 34 | let args = Arguments::parse(); 35 | 36 | let networks = args 37 | .network_ids 38 | .iter() 39 | .map(|n| parse_network(n).unwrap()) 40 | .collect(); 41 | 42 | deploy_subscription(networks) 43 | } 44 | -------------------------------------------------------------------------------- /modules/contracts/apps/subscription/examples/schema.rs: -------------------------------------------------------------------------------- 1 | use std::{env::current_dir, fs::create_dir_all}; 2 | 3 | use abstract_subscription::{contract::SubscriptionApp, msg::CustomExecuteMsg}; 4 | use cosmwasm_schema::remove_schemas; 5 | 6 | fn main() { 7 | let mut out_dir = current_dir().unwrap(); 8 | out_dir.push("schema"); 9 | create_dir_all(&out_dir).unwrap(); 10 | remove_schemas(&out_dir).unwrap(); 11 | 12 | #[cfg(feature = "schema")] 13 | SubscriptionApp::export_schema_custom::(&out_dir); 14 | } 15 | -------------------------------------------------------------------------------- /modules/contracts/apps/subscription/src/handlers/custom.rs: -------------------------------------------------------------------------------- 1 | use abstract_app::sdk::base::CustomExecuteHandler; 2 | use cosmwasm_std::{DepsMut, Env, MessageInfo, Response}; 3 | 4 | use crate::{error::SubscriptionError, msg::CustomExecuteMsg}; 5 | 6 | impl CustomExecuteHandler for CustomExecuteMsg { 7 | type ExecuteMsg = crate::msg::ExecuteMsg; 8 | 9 | fn try_into_base(self) -> Result { 10 | match self { 11 | CustomExecuteMsg::Base(msg) => Ok(crate::msg::ExecuteMsg::from(msg)), 12 | CustomExecuteMsg::Module(msg) => Ok(crate::msg::ExecuteMsg::from(msg)), 13 | _ => Err(self), 14 | } 15 | } 16 | 17 | fn custom_execute( 18 | self, 19 | deps: DepsMut, 20 | env: Env, 21 | info: MessageInfo, 22 | module: crate::contract::SubscriptionApp, 23 | ) -> Result { 24 | match self { 25 | CustomExecuteMsg::Receive(cw20_msg) => { 26 | super::receive_cw20(deps, env, info, module, cw20_msg) 27 | } 28 | _ => unreachable!(), 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /modules/contracts/apps/subscription/src/handlers/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod custom; 2 | pub mod execute; 3 | pub mod instantiate; 4 | pub mod query; 5 | pub mod receive; 6 | 7 | pub use crate::handlers::{ 8 | execute::execute_handler, instantiate::instantiate_handler, query::query_handler, 9 | receive::receive_cw20, 10 | }; 11 | -------------------------------------------------------------------------------- /modules/contracts/apps/subscription/src/handlers/receive.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_std::{from_json, DepsMut, Env, MessageInfo}; 2 | use cw20::Cw20ReceiveMsg; 3 | use cw_asset::{Asset, AssetInfo}; 4 | 5 | use crate::{ 6 | contract::{SubscriptionApp, SubscriptionResult}, 7 | handlers::execute, 8 | msg::DepositHookMsg, 9 | }; 10 | 11 | pub fn receive_cw20( 12 | deps: DepsMut, 13 | env: Env, 14 | msg_info: MessageInfo, 15 | module: SubscriptionApp, 16 | cw20_msg: Cw20ReceiveMsg, 17 | ) -> SubscriptionResult { 18 | match from_json(cw20_msg.msg)? { 19 | DepositHookMsg::Pay { subscriber_addr } => { 20 | // Construct deposit asset 21 | let asset = Asset { 22 | info: AssetInfo::Cw20(msg_info.sender.clone()), 23 | amount: cw20_msg.amount, 24 | }; 25 | let subscriber_addr = deps 26 | .api 27 | .addr_validate(&subscriber_addr.unwrap_or(cw20_msg.sender))?; 28 | execute::try_pay(module, deps, env, asset, subscriber_addr) 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /modules/contracts/standalones/ica-owner/resources/cw_ica_controller.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AbstractSDK/abstract/d189643b849bc8176c07c916377bf979cc8ad3c8/modules/contracts/standalones/ica-owner/resources/cw_ica_controller.wasm -------------------------------------------------------------------------------- /modules/contracts/standalones/ica-owner/src/bin/schema.rs: -------------------------------------------------------------------------------- 1 | use cosmwasm_schema::{remove_schemas, write_api}; 2 | use my_standalone::msg::{ 3 | MyStandaloneExecuteMsg, MyStandaloneInstantiateMsg, MyStandaloneMigrateMsg, 4 | MyStandaloneQueryMsg, 5 | }; 6 | use std::env::current_dir; 7 | use std::fs::create_dir_all; 8 | 9 | fn main() { 10 | let mut out_dir = current_dir().unwrap(); 11 | out_dir.push("schema"); 12 | create_dir_all(&out_dir).unwrap(); 13 | remove_schemas(&out_dir).unwrap(); 14 | 15 | write_api! { 16 | name: "schema", 17 | instantiate: MyStandaloneInstantiateMsg, 18 | query: MyStandaloneQueryMsg, 19 | execute: MyStandaloneExecuteMsg, 20 | migrate: MyStandaloneMigrateMsg, 21 | }; 22 | } 23 | -------------------------------------------------------------------------------- /modules/contracts/standalones/ica-owner/src/error.rs: -------------------------------------------------------------------------------- 1 | use abstract_standalone::sdk::AbstractSdkError; 2 | use abstract_standalone::std::AbstractError; 3 | use cosmwasm_std::StdError; 4 | use cw_asset::AssetError; 5 | use cw_controllers::AdminError; 6 | use thiserror::Error; 7 | 8 | #[derive(Error, Debug, PartialEq)] 9 | pub enum MyStandaloneError { 10 | #[error(transparent)] 11 | Std(#[from] StdError), 12 | 13 | #[error(transparent)] 14 | Abstract(#[from] AbstractError), 15 | 16 | #[error(transparent)] 17 | AbstractSdk(#[from] AbstractSdkError), 18 | 19 | #[error(transparent)] 20 | Asset(#[from] AssetError), 21 | 22 | #[error(transparent)] 23 | Admin(#[from] AdminError), 24 | } 25 | -------------------------------------------------------------------------------- /modules/contracts/standalones/ica-owner/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod contract; 2 | pub mod error; 3 | pub mod msg; 4 | pub mod state; 5 | 6 | use abstract_standalone::StandaloneContract; 7 | use cosmwasm_std::Response; 8 | pub use error::MyStandaloneError; 9 | 10 | /// The version of your standalone 11 | pub const STANDALONE_VERSION: &str = env!("CARGO_PKG_VERSION"); 12 | 13 | pub const MY_NAMESPACE: &str = "yournamespace"; 14 | pub const MY_STANDALONE_NAME: &str = "my-standalone"; 15 | pub const MY_STANDALONE_ID: &str = const_format::formatcp!("{MY_NAMESPACE}:{MY_STANDALONE_NAME}"); 16 | 17 | /// The type of the result returned by your standalone's entry points. 18 | pub type MyStandaloneResult = Result; 19 | 20 | /// The type of the standalone that is used to build your contract object and access the Abstract SDK features. 21 | pub type MyStandalone = StandaloneContract; 22 | 23 | pub const MY_STANDALONE: MyStandalone = 24 | MyStandalone::new(MY_STANDALONE_ID, STANDALONE_VERSION, None); 25 | 26 | // cw-orch related interface 27 | #[cfg(not(target_arch = "wasm32"))] 28 | mod interface; 29 | 30 | #[cfg(not(target_arch = "wasm32"))] 31 | pub use interface::{ica_controller, MyStandaloneInterface}; 32 | -------------------------------------------------------------------------------- /modules/contracts/standalones/ica-owner/starship/configs/osmo-juno.yaml: -------------------------------------------------------------------------------- 1 | chains: 2 | - id: osmosis-1 3 | name: osmosis 4 | numValidators: 1 5 | ports: 6 | rest: 1313 7 | rpc: 26653 8 | grpc: 30658 9 | faucet: 8000 10 | - id: juno-1 11 | name: juno 12 | numValidators: 1 13 | ports: 14 | rest: 1317 15 | rpc: 26657 16 | grpc: 30657 17 | faucet: 8001 18 | 19 | relayers: 20 | - name: osmo-juno 21 | type: hermes 22 | replicas: 1 23 | chains: 24 | - osmosis-1 25 | - juno-1 26 | config: 27 | event_source: 28 | mode: "pull" # default is "push" 29 | ports: 30 | rest: 3001 31 | 32 | registry: 33 | enabled: true 34 | ports: 35 | rest: 8081 36 | -------------------------------------------------------------------------------- /modules/rustfmt.toml: -------------------------------------------------------------------------------- 1 | # stable 2 | hard_tabs = false 3 | newline_style = "Unix" 4 | tab_spaces = 4 5 | 6 | # group_imports = "StdExternalCrate" 7 | # imports_granularity = "Crate" 8 | -------------------------------------------------------------------------------- /modules/taplo.toml: -------------------------------------------------------------------------------- 1 | ../taplo.toml -------------------------------------------------------------------------------- /rustfmt.toml: -------------------------------------------------------------------------------- 1 | # stable 2 | newline_style = "Unix" 3 | hard_tabs = false 4 | tab_spaces = 4 5 | reorder_imports = true 6 | reorder_modules = true 7 | 8 | # These are nightly 9 | # group_imports = "StdExternalCrate" 10 | # imports_granularity = "Crate" 11 | -------------------------------------------------------------------------------- /schema/calendar/0.3.0/migrate_msg.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "MigrateMsg", 4 | "type": "object", 5 | "required": [ 6 | "base", 7 | "module" 8 | ], 9 | "properties": { 10 | "base": { 11 | "description": "base migrate information", 12 | "allOf": [ 13 | { 14 | "$ref": "#/definitions/BaseMigrateMsg" 15 | } 16 | ] 17 | }, 18 | "module": { 19 | "description": "custom migrate msg", 20 | "allOf": [ 21 | { 22 | "$ref": "#/definitions/CalendarMigrateMsg" 23 | } 24 | ] 25 | } 26 | }, 27 | "additionalProperties": false, 28 | "definitions": { 29 | "BaseMigrateMsg": { 30 | "type": "object", 31 | "additionalProperties": false 32 | }, 33 | "CalendarMigrateMsg": { 34 | "type": "object", 35 | "additionalProperties": false 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /schema/challenge/0.4.0/migrate_msg.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "MigrateMsg", 4 | "type": "object", 5 | "required": [ 6 | "base", 7 | "module" 8 | ], 9 | "properties": { 10 | "base": { 11 | "description": "base migrate information", 12 | "allOf": [ 13 | { 14 | "$ref": "#/definitions/BaseMigrateMsg" 15 | } 16 | ] 17 | }, 18 | "module": { 19 | "description": "custom migrate msg", 20 | "allOf": [ 21 | { 22 | "$ref": "#/definitions/Empty" 23 | } 24 | ] 25 | } 26 | }, 27 | "additionalProperties": false, 28 | "definitions": { 29 | "BaseMigrateMsg": { 30 | "type": "object", 31 | "additionalProperties": false 32 | }, 33 | "Empty": { 34 | "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressible in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", 35 | "type": "object", 36 | "additionalProperties": false 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /schema/payment/0.4.0/migrate_msg.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "MigrateMsg", 4 | "type": "object", 5 | "required": [ 6 | "base", 7 | "module" 8 | ], 9 | "properties": { 10 | "base": { 11 | "description": "base migrate information", 12 | "allOf": [ 13 | { 14 | "$ref": "#/definitions/BaseMigrateMsg" 15 | } 16 | ] 17 | }, 18 | "module": { 19 | "description": "custom migrate msg", 20 | "allOf": [ 21 | { 22 | "$ref": "#/definitions/AppMigrateMsg" 23 | } 24 | ] 25 | } 26 | }, 27 | "additionalProperties": false, 28 | "definitions": { 29 | "AppMigrateMsg": { 30 | "type": "object", 31 | "additionalProperties": false 32 | }, 33 | "BaseMigrateMsg": { 34 | "type": "object", 35 | "additionalProperties": false 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /schema/subscription/0.26.0/migrate_msg.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "MigrateMsg", 4 | "type": "object", 5 | "required": [ 6 | "base", 7 | "module" 8 | ], 9 | "properties": { 10 | "base": { 11 | "description": "base migrate information", 12 | "allOf": [ 13 | { 14 | "$ref": "#/definitions/BaseMigrateMsg" 15 | } 16 | ] 17 | }, 18 | "module": { 19 | "description": "custom migrate msg", 20 | "allOf": [ 21 | { 22 | "$ref": "#/definitions/SubscriptionMigrateMsg" 23 | } 24 | ] 25 | } 26 | }, 27 | "additionalProperties": false, 28 | "definitions": { 29 | "BaseMigrateMsg": { 30 | "type": "object", 31 | "additionalProperties": false 32 | }, 33 | "SubscriptionMigrateMsg": { 34 | "description": "Subscription migration message", 35 | "type": "object", 36 | "additionalProperties": false 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /scripts/framework-coverage.sh: -------------------------------------------------------------------------------- 1 | # go into the directory we want to compile 2 | cd ./framework 3 | 4 | # Install cargo-llvm-cov for coverage generation 5 | # Get host target 6 | host=$(rustc -Vv | grep host | sed 's/host: //') 7 | # # Download binary and install to $HOME/.cargo/bin 8 | curl -LsSf https://github.com/taiki-e/cargo-llvm-cov/releases/latest/download/cargo-llvm-cov-$host.tar.gz | tar xzf - -C $HOME/.cargo/bin 9 | 10 | # Create lock file if it does not exist 11 | if [ ! -f Cargo.lock ]; then 12 | cargo generate-lockfile 13 | fi 14 | 15 | cargo +nightly llvm-cov --all-features --workspace --locked --ignore-filename-regex error --lcov --output-path lcov.info 16 | 17 | # print the result. 18 | ls -la . 19 | -------------------------------------------------------------------------------- /scripts/framework-schema.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Generates the schemas for each contract and copies them to ./schema/abstract// 4 | version="cargo pkgid | cut -d@ -f2" 5 | SCHEMA_OUT_DIR=$(echo "$PWD"/schema) 6 | 7 | cd ./framework 8 | 9 | # Generates schemas for each contract, removes the "Raw" schema, and copies the rest to the schema output directory. 10 | SCHEMA_OUT_DIR=$SCHEMA_OUT_DIR version=$version \ 11 | cargo ws exec --no-bail bash -lc \ 12 | 'cargo schema && { rm -rf "schema/raw"; outdir="$SCHEMA_OUT_DIR/${PWD##*/}/$(eval $version)"; mkdir -p "$outdir"; cp -a "schema/." "$outdir";}' 13 | -------------------------------------------------------------------------------- /scripts/modules-coverage-local.sh: -------------------------------------------------------------------------------- 1 | # go into the directory we want to compile 2 | cd ./modules 3 | 4 | # Create lock file if it does not exist 5 | if [ ! -f Cargo.lock ]; then 6 | cargo generate-lockfile 7 | fi 8 | 9 | # Check the installed version 10 | go version 11 | 12 | cargo llvm-cov --locked --lcov --output-path lcov.info 13 | 14 | # print the result. 15 | ls -la . -------------------------------------------------------------------------------- /scripts/modules-coverage.sh: -------------------------------------------------------------------------------- 1 | # go into the directory we want to compile 2 | cd ./modules 3 | 4 | # Install cargo-llvm-cov for coverage generation 5 | # Get host target 6 | host=$(rustc -Vv | grep host | sed 's/host: //') 7 | # # Download binary and install to $HOME/.cargo/bin 8 | curl -LsSf https://github.com/taiki-e/cargo-llvm-cov/releases/latest/download/cargo-llvm-cov-$host.tar.gz | tar xzf - -C $HOME/.cargo/bin 9 | 10 | # Create lock file if it does not exist 11 | if [ ! -f Cargo.lock ]; then 12 | cargo generate-lockfile 13 | fi 14 | 15 | sudo apt-get update && sudo apt-get install libclang-dev -y 16 | 17 | # Set Go version 18 | GO_VERSION="1.19" 19 | 20 | # Download Go 21 | wget https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz -O /tmp/go${GO_VERSION}.linux-amd64.tar.gz 22 | 23 | # Extract Go archive 24 | sudo tar -C /usr/local -xzf /tmp/go${GO_VERSION}.linux-amd64.tar.gz 25 | 26 | # Set environment variables 27 | echo "export GOROOT=/usr/local/go" >> ~/.bash_profile 28 | echo "export GOPATH=$HOME/go" >> ~/.bash_profile 29 | echo "export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin" >> ~/.bash_profile 30 | 31 | # Load the environment variables 32 | source ~/.bash_profile 33 | 34 | # Check the installed version 35 | go version 36 | 37 | cargo llvm-cov --locked --lcov --output-path lcov.info 38 | 39 | # print the result. 40 | ls -la . -------------------------------------------------------------------------------- /scripts/modules-schema.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Generates the schemas for each module and copies them to ./schema/abstract// 4 | version="cargo pkgid | cut -d@ -f2" 5 | SCHEMA_OUT_DIR=$(echo "$PWD"/schema) 6 | 7 | cd ./modules 8 | 9 | # Generates schemas for each contract, removes the "Raw" schema, and copies the rest to the schema output directory. 10 | SCHEMA_OUT_DIR=$SCHEMA_OUT_DIR version=$version \ 11 | cargo ws exec --no-bail bash -lc \ 12 | 'cargo schema && \ 13 | { tmp=$(mktemp); jq ".contract_version = \"$(eval $version)\"" schema/module-schema.json > "$tmp" && mv "$tmp" schema/module-schema.json; \ 14 | rm -rf "schema/raw"; outdir="$SCHEMA_OUT_DIR/${PWD##*/}/$(eval $version)"; mkdir -p "$outdir"; cp -a "schema/." "$outdir";}' 15 | -------------------------------------------------------------------------------- /scripts/modules-tests.sh: -------------------------------------------------------------------------------- 1 | # go into the directory we want to compile 2 | cd ./modules 3 | 4 | # Create lock file if it does not exist 5 | if [ ! -f Cargo.lock ]; then 6 | cargo generate-lockfile 7 | fi 8 | 9 | # Force recompile osmosis test tube so build.rs is runned 10 | cargo clean -p osmosis-test-tube 11 | 12 | sudo apt-get update && sudo apt-get install libclang-dev -y 13 | 14 | # Set Go version 15 | GO_VERSION="1.21.9" 16 | 17 | # Download Go 18 | wget https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz -O /tmp/go${GO_VERSION}.linux-amd64.tar.gz 19 | 20 | # Extract Go archive 21 | sudo tar -C /usr/local -xzf /tmp/go${GO_VERSION}.linux-amd64.tar.gz 22 | 23 | # Set environment variables 24 | echo "export GOROOT=/usr/local/go" >> ~/.bash_profile 25 | echo "export GOPATH=$HOME/go" >> ~/.bash_profile 26 | echo "export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin" >> ~/.bash_profile 27 | 28 | # Install nextest 29 | curl -LsSf https://get.nexte.st/0.9.53/linux | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin 30 | 31 | # Load the environment variables 32 | source ~/.bash_profile 33 | 34 | # Check the installed versions 35 | go version 36 | cargo nextest -V 37 | 38 | cargo nextest run --locked --all-features --all-targets --build-jobs 3 -------------------------------------------------------------------------------- /scripts/wasm-all.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Detect the architecture # 4 | if [[ $(arch) == "arm64" ]]; then 5 | image="cosmwasm/optimizer-arm64:0.16.1" 6 | else 7 | image="cosmwasm/optimizer:0.16.1" 8 | fi 9 | 10 | starting_dir=$(pwd) 11 | 12 | echo "Wasming framework" 13 | cd ./framework 14 | 15 | # Delete all the current wasms first 16 | rm -rf ./artifacts/*.wasm 17 | # Optimized builds 18 | docker run --rm -v "$(pwd)":/code \ 19 | --mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \ 20 | --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ 21 | ${image} 22 | 23 | cd $starting_dir 24 | 25 | echo "Wasming apps" 26 | cd ./modules 27 | 28 | # Delete all the current wasms first 29 | rm -rf ./artifacts/*.wasm 30 | # Optimized builds 31 | docker run --rm -v "$(pwd)":/code \ 32 | --mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \ 33 | -v "$(dirname "$(pwd)")/integrations":/integrations \ 34 | -v "$(dirname "$(pwd)")/framework":/framework \ 35 | --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ 36 | ${image} 37 | -------------------------------------------------------------------------------- /scripts/wasm-framework-ci.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | # Detect the architecture # 6 | if [[ $(arch) == "arm64" ]]; then 7 | image="cosmwasm/optimizer-arm64:0.16.1" 8 | else 9 | image="cosmwasm/optimizer:0.16.1" 10 | fi 11 | 12 | starting_dir=$(pwd) 13 | 14 | # see https://github.com/CosmWasm/cw-plus/blob/main/.circleci/config.yml 15 | echo "Wasming framework" 16 | cd ./framework 17 | 18 | # Remove for docker to successfuly copy 19 | rm packages/abstract-interface/state.json 20 | rm packages/abstract-interface/build.rs 21 | rm packages/abstract-interface/artifacts || true 22 | 23 | # Create lock file if it does not exist 24 | if [ ! -f Cargo.lock ]; then 25 | cargo generate-lockfile 26 | fi 27 | 28 | docker rm -v with_code || true 29 | 30 | # create a dummy container which will hold a volume with config 31 | docker create -v /code --name with_code alpine /bin/true 32 | # copy a config file into this volume 33 | docker cp Cargo.toml with_code:/code 34 | docker cp Cargo.lock with_code:/code 35 | # copy code into this volume 36 | docker cp ./workspace-hack with_code:/code 37 | docker cp ./contracts with_code:/code 38 | docker cp ./packages with_code:/code 39 | # Run the build 40 | docker run --volumes-from with_code ${image} 41 | # Copy the artifacts back out 42 | docker cp with_code:/code/artifacts/ . 43 | ls artifacts -------------------------------------------------------------------------------- /scripts/wasm-modules-ci.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | # Detect the architecture # 6 | if [[ $(arch) == "arm64" ]]; then 7 | image="cosmwasm/optimizer-arm64:0.16.1" 8 | else 9 | image="cosmwasm/optimizer:0.16.1" 10 | fi 11 | 12 | starting_dir=$(pwd) 13 | 14 | # see https://github.com/CosmWasm/cw-plus/blob/main/.circleci/config.yml 15 | echo "Wasming modules" 16 | 17 | docker rm -v modules_with_code || true 18 | 19 | # create a dummy container which will hold a volume with config 20 | docker create -v /code -v /integrations -v /framework --name modules_with_code alpine /bin/true 21 | 22 | # copy directories to container. 23 | docker cp ./integrations modules_with_code:/ 24 | docker cp ./framework modules_with_code:/ 25 | 26 | # go into the directory we want to compile 27 | cd ./modules 28 | 29 | # Create lock file if it does not exist 30 | if [ ! -f Cargo.lock ]; then 31 | cargo generate-lockfile 32 | fi 33 | 34 | # Delete the current artifacts folder. 35 | # rm -rf ./artifacts 36 | # copy a config file into this volume 37 | docker cp Cargo.toml modules_with_code:/code 38 | docker cp Cargo.lock modules_with_code:/code 39 | # copy code into this volume 40 | docker cp ./contracts modules_with_code:/code 41 | 42 | # Run the build 43 | docker run --volumes-from modules_with_code ${image} 44 | # Copy the artifacts back out 45 | docker cp modules_with_code:/code/artifacts/ . 46 | ls artifacts -------------------------------------------------------------------------------- /taplo.toml: -------------------------------------------------------------------------------- 1 | exclude = ["workspace-hack/Cargo.toml"] 2 | 3 | [formatting] 4 | align_entries = true 5 | column_width = 100 6 | inline_table_expand = false 7 | reorder_keys = true 8 | --------------------------------------------------------------------------------