diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 0a38438aa..55b7bddbb 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -31,7 +31,7 @@ jobs: sudo make version-map make build - name: Upload Artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: contracts path: ./artifacts/ @@ -44,7 +44,7 @@ jobs: - name: Build Deploy Script run: cargo build -p andromeda-deploy --release - name: Upload Artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: deploy path: ./target/release/andromeda-deploy @@ -83,7 +83,7 @@ jobs: chmod +x ./andromeda-deploy ./andromeda-deploy - name: Upload Deployment Report - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: deployment-report path: ./deployment-reports/ diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index c5dbd923a..b2a81e44b 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -75,7 +75,7 @@ jobs: chmod +x "${GITHUB_WORKSPACE}/.github/file-size.sh" "${GITHUB_WORKSPACE}/.github/file-size.sh" - name: Upload Artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: contracts path: ./artifacts/ @@ -111,7 +111,7 @@ jobs: chmod +x "${GITHUB_WORKSPACE}/scripts/build_schema.sh" "${GITHUB_WORKSPACE}/scripts/build_schema.sh" - name: Upload Artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: schema path: ./schemas/ diff --git a/CHANGELOG.md b/CHANGELOG.md index aba018ff4..f40e283c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added Kernel ICS20 Transfer with Optional ExecuteMsg [(#577)](https://github.com/andromedaprotocol/andromeda-core/pull/577) - Added IBC Denom Wrap/Unwrap [(#579)](https://github.com/andromedaprotocol/andromeda-core/pull/579) - Added deployment script/CI workflow for OS [(#616)](https://github.com/andromedaprotocol/andromeda-core/pull/616) +- Added deployable interfaces to all ADOs [(#620)](https://github.com/andromedaprotocol/andromeda-core/pull/620) ### Changed diff --git a/Cargo.lock b/Cargo.lock index e1e54d9f9..2a59beae9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -88,6 +88,7 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cw-multi-test", + "cw-orch", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", ] @@ -127,6 +128,7 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cw-multi-test", + "cw-orch", "cw-storage-plus 1.2.0", "enum-repr", ] @@ -142,6 +144,7 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cw-multi-test", + "cw-orch", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", "cw20", @@ -158,6 +161,7 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cw-multi-test", + "cw-orch", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", "cw20", @@ -174,6 +178,7 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cw-multi-test", + "cw-orch", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", ] @@ -222,6 +227,7 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cw-multi-test", + "cw-orch", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", "cw20", @@ -239,6 +245,7 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cw-multi-test", + "cw-orch", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", "test-case", @@ -273,6 +280,7 @@ dependencies = [ "cosmwasm-std", "cw-asset", "cw-multi-test", + "cw-orch", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", "cw20", @@ -336,6 +344,7 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cw-multi-test", + "cw-orch", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", ] @@ -344,22 +353,40 @@ dependencies = [ name = "andromeda-deploy" version = "0.0.1" dependencies = [ + "andromeda-address-list", "andromeda-adodb", + "andromeda-app-contract", + "andromeda-auction", + "andromeda-boolean", + "andromeda-conditional-splitter", "andromeda-counter", + "andromeda-crowdfund", + "andromeda-curve", "andromeda-cw20", + "andromeda-cw20-exchange", "andromeda-cw20-staking", "andromeda-cw721", + "andromeda-date-time", "andromeda-economics", "andromeda-ibc-registry", "andromeda-kernel", + "andromeda-lockdrop", "andromeda-macros", + "andromeda-marketplace", + "andromeda-merkle-airdrop", "andromeda-primitive", + "andromeda-rate-limiting-withdrawals", + "andromeda-rates", + "andromeda-set-amount-splitter", + "andromeda-shunting", "andromeda-splitter", "andromeda-std", + "andromeda-string-storage", "andromeda-timelock", "andromeda-validator-staking", "andromeda-vesting", "andromeda-vfs", + "andromeda-weighted-distribution-splitter", "chrono 0.4.38", "cosmwasm-schema", "cosmwasm-std", @@ -536,6 +563,7 @@ dependencies = [ "cosmwasm-std", "cw-asset", "cw-multi-test", + "cw-orch", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", "cw20", @@ -561,6 +589,7 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cw-multi-test", + "cw-orch", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", "cw20", @@ -579,6 +608,7 @@ dependencies = [ "cosmwasm-std", "cw-asset", "cw-multi-test", + "cw-orch", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", "cw20", @@ -655,6 +685,7 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cw-multi-test", + "cw-orch", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", "cw20", @@ -671,6 +702,7 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cw-multi-test", + "cw-orch", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", "cw20", @@ -687,6 +719,7 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cw-multi-test", + "cw-orch", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", ] @@ -703,6 +736,7 @@ dependencies = [ "cosmwasm-std", "cw-json", "cw-multi-test", + "cw-orch", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", "cw2 1.1.2", @@ -768,6 +802,7 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cw-multi-test", + "cw-orch", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", "cw20", @@ -909,6 +944,7 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cw-multi-test", + "cw-orch", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", ] diff --git a/contracts/app/andromeda-app-contract/Cargo.toml b/contracts/app/andromeda-app-contract/Cargo.toml index 892376d40..b4eeaa325 100644 --- a/contracts/app/andromeda-app-contract/Cargo.toml +++ b/contracts/app/andromeda-app-contract/Cargo.toml @@ -20,6 +20,7 @@ enum-repr = { workspace = true } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] cw-multi-test = { workspace = true, optional = true } andromeda-testing = { workspace = true, optional = true } +cw-orch = { workspace = true } [features] diff --git a/contracts/app/andromeda-app-contract/src/interface.rs b/contracts/app/andromeda-app-contract/src/interface.rs new file mode 100644 index 000000000..7947678f4 --- /dev/null +++ b/contracts/app/andromeda-app-contract/src/interface.rs @@ -0,0 +1,6 @@ +use andromeda_app::app::{ExecuteMsg, InstantiateMsg, QueryMsg}; +use andromeda_std::{ado_base::MigrateMsg, contract_interface, deploy::ADOMetadata}; + +pub const CONTRACT_ID: &str = "app-contract"; + +contract_interface!(AppContract, CONTRACT_ID, "andromeda_app_contract.wasm"); diff --git a/contracts/app/andromeda-app-contract/src/lib.rs b/contracts/app/andromeda-app-contract/src/lib.rs index 7e4b2662e..45896bc83 100644 --- a/contracts/app/andromeda-app-contract/src/lib.rs +++ b/contracts/app/andromeda-app-contract/src/lib.rs @@ -10,3 +10,8 @@ pub mod testing; mod execute; mod query; mod reply; + +#[cfg(not(target_arch = "wasm32"))] +mod interface; +#[cfg(not(target_arch = "wasm32"))] +pub use crate::interface::AppContract; diff --git a/contracts/data-storage/andromeda-boolean/Cargo.toml b/contracts/data-storage/andromeda-boolean/Cargo.toml index 109130681..c9c0c8981 100644 --- a/contracts/data-storage/andromeda-boolean/Cargo.toml +++ b/contracts/data-storage/andromeda-boolean/Cargo.toml @@ -38,3 +38,4 @@ andromeda-data-storage = { workspace = true } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] cw-multi-test = { workspace = true, optional = true } andromeda-testing = { workspace = true, optional = true } +cw-orch = { workspace = true } diff --git a/contracts/data-storage/andromeda-boolean/src/contract.rs b/contracts/data-storage/andromeda-boolean/src/contract.rs index 3e8675a36..565ea7690 100644 --- a/contracts/data-storage/andromeda-boolean/src/contract.rs +++ b/contracts/data-storage/andromeda-boolean/src/contract.rs @@ -1,6 +1,6 @@ #[cfg(not(feature = "library"))] use cosmwasm_std::entry_point; -use cosmwasm_std::{Addr, Binary, Deps, DepsMut, Env, MessageInfo, Response}; +use cosmwasm_std::{Addr, Binary, Deps, DepsMut, Env, MessageInfo, Reply, Response, StdError}; use crate::{ execute::handle_execute, @@ -92,3 +92,14 @@ pub fn query(deps: Deps, env: Env, msg: QueryMsg) -> Result Result { ADOContract::default().migrate(deps, CONTRACT_NAME, CONTRACT_VERSION) } + +#[cfg_attr(not(feature = "library"), entry_point)] +pub fn reply(_deps: DepsMut, _env: Env, msg: Reply) -> Result { + if msg.result.is_err() { + return Err(ContractError::Std(StdError::generic_err( + msg.result.unwrap_err(), + ))); + } + + Ok(Response::default()) +} diff --git a/contracts/data-storage/andromeda-boolean/src/interface.rs b/contracts/data-storage/andromeda-boolean/src/interface.rs new file mode 100644 index 000000000..555301132 --- /dev/null +++ b/contracts/data-storage/andromeda-boolean/src/interface.rs @@ -0,0 +1,6 @@ +use andromeda_data_storage::boolean::{ExecuteMsg, InstantiateMsg, QueryMsg}; +use andromeda_std::{ado_base::MigrateMsg, contract_interface, deploy::ADOMetadata}; + +pub const CONTRACT_ID: &str = "boolean"; + +contract_interface!(BooleanContract, CONTRACT_ID, "andromeda_boolean.wasm"); diff --git a/contracts/data-storage/andromeda-boolean/src/lib.rs b/contracts/data-storage/andromeda-boolean/src/lib.rs index 36553fb8f..a9ef355fd 100644 --- a/contracts/data-storage/andromeda-boolean/src/lib.rs +++ b/contracts/data-storage/andromeda-boolean/src/lib.rs @@ -7,3 +7,8 @@ mod state; #[cfg(test)] mod testing; + +#[cfg(not(target_arch = "wasm32"))] +mod interface; +#[cfg(not(target_arch = "wasm32"))] +pub use crate::interface::BooleanContract; diff --git a/contracts/data-storage/andromeda-string-storage/Cargo.toml b/contracts/data-storage/andromeda-string-storage/Cargo.toml index 6094e90c6..c1373d438 100644 --- a/contracts/data-storage/andromeda-string-storage/Cargo.toml +++ b/contracts/data-storage/andromeda-string-storage/Cargo.toml @@ -38,3 +38,4 @@ andromeda-data-storage = { workspace = true } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] cw-multi-test = { workspace = true, optional = true } andromeda-testing = { workspace = true, optional = true } +cw-orch = { workspace = true } diff --git a/contracts/data-storage/andromeda-string-storage/src/contract.rs b/contracts/data-storage/andromeda-string-storage/src/contract.rs index 2662d510e..172545760 100644 --- a/contracts/data-storage/andromeda-string-storage/src/contract.rs +++ b/contracts/data-storage/andromeda-string-storage/src/contract.rs @@ -1,6 +1,6 @@ #[cfg(not(feature = "library"))] use cosmwasm_std::entry_point; -use cosmwasm_std::{Binary, Deps, DepsMut, Env, MessageInfo, Response}; +use cosmwasm_std::{Binary, Deps, DepsMut, Env, MessageInfo, Reply, Response, StdError}; use crate::{ execute::handle_execute, @@ -72,3 +72,14 @@ pub fn query(deps: Deps, env: Env, msg: QueryMsg) -> Result Result { ADOContract::default().migrate(deps, CONTRACT_NAME, CONTRACT_VERSION) } + +#[cfg_attr(not(feature = "library"), entry_point)] +pub fn reply(_deps: DepsMut, _env: Env, msg: Reply) -> Result { + if msg.result.is_err() { + return Err(ContractError::Std(StdError::generic_err( + msg.result.unwrap_err(), + ))); + } + + Ok(Response::default()) +} diff --git a/contracts/data-storage/andromeda-string-storage/src/interface.rs b/contracts/data-storage/andromeda-string-storage/src/interface.rs new file mode 100644 index 000000000..92e29c4a4 --- /dev/null +++ b/contracts/data-storage/andromeda-string-storage/src/interface.rs @@ -0,0 +1,10 @@ +use andromeda_data_storage::string_storage::{ExecuteMsg, InstantiateMsg, QueryMsg}; +use andromeda_std::{ado_base::MigrateMsg, contract_interface, deploy::ADOMetadata}; + +pub const CONTRACT_ID: &str = "string-storage"; + +contract_interface!( + StringStorageContract, + CONTRACT_ID, + "andromeda_string_storage.wasm" +); diff --git a/contracts/data-storage/andromeda-string-storage/src/lib.rs b/contracts/data-storage/andromeda-string-storage/src/lib.rs index 36553fb8f..b9957cb66 100644 --- a/contracts/data-storage/andromeda-string-storage/src/lib.rs +++ b/contracts/data-storage/andromeda-string-storage/src/lib.rs @@ -7,3 +7,8 @@ mod state; #[cfg(test)] mod testing; + +#[cfg(not(target_arch = "wasm32"))] +mod interface; +#[cfg(not(target_arch = "wasm32"))] +pub use crate::interface::StringStorageContract; diff --git a/contracts/finance/andromeda-conditional-splitter/Cargo.toml b/contracts/finance/andromeda-conditional-splitter/Cargo.toml index 295315f21..6641ba874 100644 --- a/contracts/finance/andromeda-conditional-splitter/Cargo.toml +++ b/contracts/finance/andromeda-conditional-splitter/Cargo.toml @@ -27,6 +27,7 @@ andromeda-finance = { workspace = true } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] cw-multi-test = { workspace = true, optional = true } andromeda-testing = { workspace = true, optional = true } +cw-orch = { workspace = true } [dev-dependencies] andromeda-app = { workspace = true } diff --git a/contracts/finance/andromeda-conditional-splitter/src/interface.rs b/contracts/finance/andromeda-conditional-splitter/src/interface.rs new file mode 100644 index 000000000..2bd14c8b1 --- /dev/null +++ b/contracts/finance/andromeda-conditional-splitter/src/interface.rs @@ -0,0 +1,10 @@ +use andromeda_finance::conditional_splitter::{ExecuteMsg, InstantiateMsg, QueryMsg}; +use andromeda_std::{ado_base::MigrateMsg, contract_interface, deploy::ADOMetadata}; + +pub const CONTRACT_ID: &str = "conditional-splitter"; + +contract_interface!( + ConditionalSplitterContract, + CONTRACT_ID, + "andromeda_conditional_splitter.wasm" +); diff --git a/contracts/finance/andromeda-conditional-splitter/src/lib.rs b/contracts/finance/andromeda-conditional-splitter/src/lib.rs index abf4af66c..f0a95aebf 100644 --- a/contracts/finance/andromeda-conditional-splitter/src/lib.rs +++ b/contracts/finance/andromeda-conditional-splitter/src/lib.rs @@ -6,3 +6,8 @@ pub mod mock; #[cfg(test)] mod testing; + +#[cfg(not(target_arch = "wasm32"))] +mod interface; +#[cfg(not(target_arch = "wasm32"))] +pub use crate::interface::ConditionalSplitterContract; diff --git a/contracts/finance/andromeda-rate-limiting-withdrawals/Cargo.toml b/contracts/finance/andromeda-rate-limiting-withdrawals/Cargo.toml index 5444fa422..c33cd8968 100644 --- a/contracts/finance/andromeda-rate-limiting-withdrawals/Cargo.toml +++ b/contracts/finance/andromeda-rate-limiting-withdrawals/Cargo.toml @@ -29,6 +29,7 @@ andromeda-finance = { workspace = true } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] cw-multi-test = { workspace = true, optional = true } andromeda-testing = { workspace = true, optional = true } +cw-orch = { workspace = true } [dev-dependencies] andromeda-app = { workspace = true } diff --git a/contracts/finance/andromeda-rate-limiting-withdrawals/src/contract.rs b/contracts/finance/andromeda-rate-limiting-withdrawals/src/contract.rs index 060f69d31..89ba69443 100644 --- a/contracts/finance/andromeda-rate-limiting-withdrawals/src/contract.rs +++ b/contracts/finance/andromeda-rate-limiting-withdrawals/src/contract.rs @@ -11,8 +11,8 @@ use andromeda_std::common::Milliseconds; use andromeda_std::{common::encode_binary, error::ContractError}; use cosmwasm_std::{ - ensure, entry_point, BankMsg, Binary, Coin, CosmosMsg, Deps, DepsMut, Env, MessageInfo, - Response, Uint128, + ensure, entry_point, BankMsg, Binary, Coin, CosmosMsg, Deps, DepsMut, Env, MessageInfo, Reply, + Response, StdError, Uint128, }; use cw_utils::{nonpayable, one_coin}; @@ -258,3 +258,14 @@ fn query_coin_allowance_details(deps: Deps) -> Result Result { + if msg.result.is_err() { + return Err(ContractError::Std(StdError::generic_err( + msg.result.unwrap_err(), + ))); + } + + Ok(Response::default()) +} diff --git a/contracts/finance/andromeda-rate-limiting-withdrawals/src/interface.rs b/contracts/finance/andromeda-rate-limiting-withdrawals/src/interface.rs new file mode 100644 index 000000000..7556ad255 --- /dev/null +++ b/contracts/finance/andromeda-rate-limiting-withdrawals/src/interface.rs @@ -0,0 +1,10 @@ +use andromeda_finance::rate_limiting_withdrawals::{ExecuteMsg, InstantiateMsg, QueryMsg}; +use andromeda_std::{ado_base::MigrateMsg, contract_interface, deploy::ADOMetadata}; + +pub const CONTRACT_ID: &str = "rate-limiting-withdrawals"; + +contract_interface!( + RateLimitingWithdrawalsContract, + CONTRACT_ID, + "andromeda_rate_limiting_withdrawals.wasm" +); diff --git a/contracts/finance/andromeda-rate-limiting-withdrawals/src/lib.rs b/contracts/finance/andromeda-rate-limiting-withdrawals/src/lib.rs index fea2cb877..a64c56eb4 100644 --- a/contracts/finance/andromeda-rate-limiting-withdrawals/src/lib.rs +++ b/contracts/finance/andromeda-rate-limiting-withdrawals/src/lib.rs @@ -3,3 +3,8 @@ pub mod state; #[cfg(test)] mod testing; + +#[cfg(not(target_arch = "wasm32"))] +mod interface; +#[cfg(not(target_arch = "wasm32"))] +pub use crate::interface::RateLimitingWithdrawalsContract; diff --git a/contracts/finance/andromeda-set-amount-splitter/Cargo.toml b/contracts/finance/andromeda-set-amount-splitter/Cargo.toml index 154404a61..5a0b53eca 100644 --- a/contracts/finance/andromeda-set-amount-splitter/Cargo.toml +++ b/contracts/finance/andromeda-set-amount-splitter/Cargo.toml @@ -27,6 +27,7 @@ andromeda-finance = { workspace = true } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] cw-multi-test = { workspace = true, optional = true } andromeda-testing = { workspace = true, optional = true } +cw-orch = { workspace = true } [dev-dependencies] andromeda-app = { workspace = true } diff --git a/contracts/finance/andromeda-set-amount-splitter/src/interface.rs b/contracts/finance/andromeda-set-amount-splitter/src/interface.rs new file mode 100644 index 000000000..a2a98b36a --- /dev/null +++ b/contracts/finance/andromeda-set-amount-splitter/src/interface.rs @@ -0,0 +1,10 @@ +use andromeda_finance::set_amount_splitter::{ExecuteMsg, InstantiateMsg, QueryMsg}; +use andromeda_std::{ado_base::MigrateMsg, contract_interface, deploy::ADOMetadata}; + +pub const CONTRACT_ID: &str = "set-amount-splitter"; + +contract_interface!( + SetAmountSplitterContract, + CONTRACT_ID, + "andromeda_set_amount_splitter.wasm" +); diff --git a/contracts/finance/andromeda-set-amount-splitter/src/lib.rs b/contracts/finance/andromeda-set-amount-splitter/src/lib.rs index abf4af66c..5b3e5f3cc 100644 --- a/contracts/finance/andromeda-set-amount-splitter/src/lib.rs +++ b/contracts/finance/andromeda-set-amount-splitter/src/lib.rs @@ -6,3 +6,8 @@ pub mod mock; #[cfg(test)] mod testing; + +#[cfg(not(target_arch = "wasm32"))] +mod interface; +#[cfg(not(target_arch = "wasm32"))] +pub use crate::interface::SetAmountSplitterContract; diff --git a/contracts/finance/andromeda-weighted-distribution-splitter/Cargo.toml b/contracts/finance/andromeda-weighted-distribution-splitter/Cargo.toml index f858e2ec5..b3dc507d6 100644 --- a/contracts/finance/andromeda-weighted-distribution-splitter/Cargo.toml +++ b/contracts/finance/andromeda-weighted-distribution-splitter/Cargo.toml @@ -26,6 +26,7 @@ andromeda-finance = { workspace = true } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] cw-multi-test = { workspace = true, optional = true } +cw-orch = { workspace = true } [dev-dependencies] andromeda-app = { workspace = true } diff --git a/contracts/finance/andromeda-weighted-distribution-splitter/src/contract.rs b/contracts/finance/andromeda-weighted-distribution-splitter/src/contract.rs index 39f5bea0f..83cb1e64a 100644 --- a/contracts/finance/andromeda-weighted-distribution-splitter/src/contract.rs +++ b/contracts/finance/andromeda-weighted-distribution-splitter/src/contract.rs @@ -18,7 +18,7 @@ use andromeda_std::{ }; use cosmwasm_std::{ attr, ensure, entry_point, BankMsg, Binary, Coin, CosmosMsg, Deps, DepsMut, Env, MessageInfo, - Response, SubMsg, Uint128, + Reply, Response, StdError, SubMsg, Uint128, }; use cw_utils::nonpayable; @@ -479,3 +479,14 @@ fn query_splitter(deps: Deps) -> Result Result { + if msg.result.is_err() { + return Err(ContractError::Std(StdError::generic_err( + msg.result.unwrap_err(), + ))); + } + + Ok(Response::default()) +} diff --git a/contracts/finance/andromeda-weighted-distribution-splitter/src/interface.rs b/contracts/finance/andromeda-weighted-distribution-splitter/src/interface.rs new file mode 100644 index 000000000..d9d0aa9b0 --- /dev/null +++ b/contracts/finance/andromeda-weighted-distribution-splitter/src/interface.rs @@ -0,0 +1,10 @@ +use andromeda_finance::weighted_splitter::{ExecuteMsg, InstantiateMsg, QueryMsg}; +use andromeda_std::{ado_base::MigrateMsg, contract_interface, deploy::ADOMetadata}; + +pub const CONTRACT_ID: &str = "weighted-distribution-splitter"; + +contract_interface!( + WeightedDistributionSplitterContract, + CONTRACT_ID, + "andromeda_weighted_distribution_splitter.wasm" +); diff --git a/contracts/finance/andromeda-weighted-distribution-splitter/src/lib.rs b/contracts/finance/andromeda-weighted-distribution-splitter/src/lib.rs index fea2cb877..1a3944968 100644 --- a/contracts/finance/andromeda-weighted-distribution-splitter/src/lib.rs +++ b/contracts/finance/andromeda-weighted-distribution-splitter/src/lib.rs @@ -3,3 +3,8 @@ pub mod state; #[cfg(test)] mod testing; + +#[cfg(not(target_arch = "wasm32"))] +mod interface; +#[cfg(not(target_arch = "wasm32"))] +pub use crate::interface::WeightedDistributionSplitterContract; diff --git a/contracts/fungible-tokens/andromeda-cw20-exchange/Cargo.toml b/contracts/fungible-tokens/andromeda-cw20-exchange/Cargo.toml index ba8f9159f..8594ced9c 100644 --- a/contracts/fungible-tokens/andromeda-cw20-exchange/Cargo.toml +++ b/contracts/fungible-tokens/andromeda-cw20-exchange/Cargo.toml @@ -28,6 +28,7 @@ andromeda-fungible-tokens = { workspace = true } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] cw-multi-test = { workspace = true, optional = true } +cw-orch = { workspace = true } [dev-dependencies] andromeda-app = { workspace = true } diff --git a/contracts/fungible-tokens/andromeda-cw20-exchange/src/interface.rs b/contracts/fungible-tokens/andromeda-cw20-exchange/src/interface.rs new file mode 100644 index 000000000..ac1991368 --- /dev/null +++ b/contracts/fungible-tokens/andromeda-cw20-exchange/src/interface.rs @@ -0,0 +1,10 @@ +use andromeda_fungible_tokens::cw20_exchange::{ExecuteMsg, InstantiateMsg, QueryMsg}; +use andromeda_std::{ado_base::MigrateMsg, contract_interface, deploy::ADOMetadata}; + +pub const CONTRACT_ID: &str = "cw20-exchange"; + +contract_interface!( + Cw20ExchangeContract, + CONTRACT_ID, + "andromeda_cw20_exchange.wasm" +); diff --git a/contracts/fungible-tokens/andromeda-cw20-exchange/src/lib.rs b/contracts/fungible-tokens/andromeda-cw20-exchange/src/lib.rs index a68a9186f..004158c56 100644 --- a/contracts/fungible-tokens/andromeda-cw20-exchange/src/lib.rs +++ b/contracts/fungible-tokens/andromeda-cw20-exchange/src/lib.rs @@ -6,3 +6,8 @@ mod state; #[cfg(test)] mod testing; + +#[cfg(not(target_arch = "wasm32"))] +mod interface; +#[cfg(not(target_arch = "wasm32"))] +pub use crate::interface::Cw20ExchangeContract; diff --git a/contracts/fungible-tokens/andromeda-lockdrop/Cargo.toml b/contracts/fungible-tokens/andromeda-lockdrop/Cargo.toml index 16f4c60fa..77bd247b5 100644 --- a/contracts/fungible-tokens/andromeda-lockdrop/Cargo.toml +++ b/contracts/fungible-tokens/andromeda-lockdrop/Cargo.toml @@ -30,6 +30,7 @@ andromeda-fungible-tokens = { workspace = true } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] cw-multi-test = { workspace = true, optional = true } andromeda-testing = { workspace = true, optional = true } +cw-orch = { workspace = true } [dev-dependencies] andromeda-app = { workspace = true } diff --git a/contracts/fungible-tokens/andromeda-lockdrop/src/contract.rs b/contracts/fungible-tokens/andromeda-lockdrop/src/contract.rs index be5221f27..8afaa46f5 100644 --- a/contracts/fungible-tokens/andromeda-lockdrop/src/contract.rs +++ b/contracts/fungible-tokens/andromeda-lockdrop/src/contract.rs @@ -14,7 +14,9 @@ use andromeda_std::{ }, error::ContractError, }; -use cosmwasm_std::{ensure, from_json, Binary, Deps, DepsMut, Env, MessageInfo, Response, Uint128}; +use cosmwasm_std::{ + ensure, from_json, Binary, Deps, DepsMut, Env, MessageInfo, Reply, Response, StdError, Uint128, +}; use cosmwasm_std::{entry_point, Decimal}; use cw_asset::Asset; @@ -620,3 +622,14 @@ pub fn allowed_withdrawal_percent( Decimal::zero() } } + +#[cfg_attr(not(feature = "library"), entry_point)] +pub fn reply(_deps: DepsMut, _env: Env, msg: Reply) -> Result { + if msg.result.is_err() { + return Err(ContractError::Std(StdError::generic_err( + msg.result.unwrap_err(), + ))); + } + + Ok(Response::default()) +} diff --git a/contracts/fungible-tokens/andromeda-lockdrop/src/interface.rs b/contracts/fungible-tokens/andromeda-lockdrop/src/interface.rs new file mode 100644 index 000000000..de96fe345 --- /dev/null +++ b/contracts/fungible-tokens/andromeda-lockdrop/src/interface.rs @@ -0,0 +1,6 @@ +use andromeda_fungible_tokens::lockdrop::{ExecuteMsg, InstantiateMsg, QueryMsg}; +use andromeda_std::{ado_base::MigrateMsg, contract_interface, deploy::ADOMetadata}; + +pub const CONTRACT_ID: &str = "lockdrop"; + +contract_interface!(LockdropContract, CONTRACT_ID, "andromeda_lockdrop.wasm"); diff --git a/contracts/fungible-tokens/andromeda-lockdrop/src/lib.rs b/contracts/fungible-tokens/andromeda-lockdrop/src/lib.rs index bcbc58bb5..e67dca0da 100644 --- a/contracts/fungible-tokens/andromeda-lockdrop/src/lib.rs +++ b/contracts/fungible-tokens/andromeda-lockdrop/src/lib.rs @@ -5,3 +5,8 @@ pub mod testing; #[cfg(all(not(target_arch = "wasm32"), feature = "testing"))] pub mod mock; + +#[cfg(not(target_arch = "wasm32"))] +mod interface; +#[cfg(not(target_arch = "wasm32"))] +pub use crate::interface::LockdropContract; diff --git a/contracts/fungible-tokens/andromeda-merkle-airdrop/Cargo.toml b/contracts/fungible-tokens/andromeda-merkle-airdrop/Cargo.toml index 167ad549c..52b7b646c 100644 --- a/contracts/fungible-tokens/andromeda-merkle-airdrop/Cargo.toml +++ b/contracts/fungible-tokens/andromeda-merkle-airdrop/Cargo.toml @@ -31,6 +31,7 @@ andromeda-fungible-tokens = { workspace = true } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] cw-multi-test = { workspace = true, optional = true } +cw-orch = { workspace = true } [dev-dependencies] andromeda-app = { workspace = true } diff --git a/contracts/fungible-tokens/andromeda-merkle-airdrop/src/contract.rs b/contracts/fungible-tokens/andromeda-merkle-airdrop/src/contract.rs index 94c8f7517..db1d2bd5c 100644 --- a/contracts/fungible-tokens/andromeda-merkle-airdrop/src/contract.rs +++ b/contracts/fungible-tokens/andromeda-merkle-airdrop/src/contract.rs @@ -3,7 +3,8 @@ #[cfg(not(feature = "library"))] use cosmwasm_std::entry_point; use cosmwasm_std::{ - attr, ensure, Addr, Binary, Deps, DepsMut, Env, MessageInfo, Response, StdResult, Uint128, + attr, ensure, Addr, Binary, Deps, DepsMut, Env, MessageInfo, Reply, Response, StdError, + StdResult, Uint128, }; use cw_utils::nonpayable; use sha2::Digest; @@ -363,3 +364,14 @@ pub fn query_total_claimed(deps: Deps, stage: u8) -> Result Result { ADOContract::default().migrate(deps, CONTRACT_NAME, CONTRACT_VERSION) } + +#[cfg_attr(not(feature = "library"), entry_point)] +pub fn reply(_deps: DepsMut, _env: Env, msg: Reply) -> Result { + if msg.result.is_err() { + return Err(ContractError::Std(StdError::generic_err( + msg.result.unwrap_err(), + ))); + } + + Ok(Response::default()) +} diff --git a/contracts/fungible-tokens/andromeda-merkle-airdrop/src/interface.rs b/contracts/fungible-tokens/andromeda-merkle-airdrop/src/interface.rs new file mode 100644 index 000000000..dba8e2a0b --- /dev/null +++ b/contracts/fungible-tokens/andromeda-merkle-airdrop/src/interface.rs @@ -0,0 +1,10 @@ +use andromeda_fungible_tokens::airdrop::{ExecuteMsg, InstantiateMsg, QueryMsg}; +use andromeda_std::{ado_base::MigrateMsg, contract_interface, deploy::ADOMetadata}; + +pub const CONTRACT_ID: &str = "merkle_airdrop"; + +contract_interface!( + MerkleAirdropContract, + CONTRACT_ID, + "andromeda_merkle_airdrop.wasm" +); diff --git a/contracts/fungible-tokens/andromeda-merkle-airdrop/src/lib.rs b/contracts/fungible-tokens/andromeda-merkle-airdrop/src/lib.rs index d9faed66c..8692e3e23 100644 --- a/contracts/fungible-tokens/andromeda-merkle-airdrop/src/lib.rs +++ b/contracts/fungible-tokens/andromeda-merkle-airdrop/src/lib.rs @@ -4,3 +4,8 @@ mod state; #[cfg(test)] mod testing; + +#[cfg(not(target_arch = "wasm32"))] +mod interface; +#[cfg(not(target_arch = "wasm32"))] +pub use crate::interface::MerkleAirdropContract; diff --git a/contracts/modules/andromeda-address-list/Cargo.toml b/contracts/modules/andromeda-address-list/Cargo.toml index 74141e2f4..9987b5b61 100644 --- a/contracts/modules/andromeda-address-list/Cargo.toml +++ b/contracts/modules/andromeda-address-list/Cargo.toml @@ -27,6 +27,7 @@ andromeda-modules = { workspace = true } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] cw-multi-test = { workspace = true, optional = true } andromeda-testing = { workspace = true, optional = true } +cw-orch = { workspace = true } [dev-dependencies] andromeda-app = { workspace = true } diff --git a/contracts/modules/andromeda-address-list/src/contract.rs b/contracts/modules/andromeda-address-list/src/contract.rs index 3d01506c2..627f083c0 100644 --- a/contracts/modules/andromeda-address-list/src/contract.rs +++ b/contracts/modules/andromeda-address-list/src/contract.rs @@ -10,7 +10,8 @@ use andromeda_std::{ }; use cosmwasm_std::{ - attr, ensure, entry_point, Addr, Binary, Deps, DepsMut, Env, MessageInfo, Response, + attr, ensure, entry_point, Addr, Binary, Deps, DepsMut, Env, MessageInfo, Reply, Response, + StdError, }; use cw_utils::nonpayable; @@ -186,3 +187,14 @@ fn query_actor_permission( Err(ContractError::ActorNotFound {}) } } + +#[cfg_attr(not(feature = "library"), entry_point)] +pub fn reply(_deps: DepsMut, _env: Env, msg: Reply) -> Result { + if msg.result.is_err() { + return Err(ContractError::Std(StdError::generic_err( + msg.result.unwrap_err(), + ))); + } + + Ok(Response::default()) +} diff --git a/contracts/modules/andromeda-address-list/src/interface.rs b/contracts/modules/andromeda-address-list/src/interface.rs new file mode 100644 index 000000000..d9b8c7de8 --- /dev/null +++ b/contracts/modules/andromeda-address-list/src/interface.rs @@ -0,0 +1,10 @@ +use andromeda_modules::address_list::{ExecuteMsg, InstantiateMsg, QueryMsg}; +use andromeda_std::{ado_base::MigrateMsg, contract_interface, deploy::ADOMetadata}; + +pub const CONTRACT_ID: &str = "address_list"; + +contract_interface!( + AddressListContract, + CONTRACT_ID, + "andromeda_address_list.wasm" +); diff --git a/contracts/modules/andromeda-address-list/src/lib.rs b/contracts/modules/andromeda-address-list/src/lib.rs index bcbc58bb5..314604aac 100644 --- a/contracts/modules/andromeda-address-list/src/lib.rs +++ b/contracts/modules/andromeda-address-list/src/lib.rs @@ -5,3 +5,8 @@ pub mod testing; #[cfg(all(not(target_arch = "wasm32"), feature = "testing"))] pub mod mock; + +#[cfg(not(target_arch = "wasm32"))] +mod interface; +#[cfg(not(target_arch = "wasm32"))] +pub use crate::interface::AddressListContract; diff --git a/contracts/modules/andromeda-curve/Cargo.toml b/contracts/modules/andromeda-curve/Cargo.toml index 5a540b487..0060fa100 100644 --- a/contracts/modules/andromeda-curve/Cargo.toml +++ b/contracts/modules/andromeda-curve/Cargo.toml @@ -28,6 +28,7 @@ andromeda-modules = { workspace = true } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] cw-multi-test = { workspace = true, optional = true } andromeda-testing = { workspace = true, optional = true } +cw-orch = { workspace = true } [dev-dependencies] andromeda-app = { workspace = true } diff --git a/contracts/modules/andromeda-curve/src/contract.rs b/contracts/modules/andromeda-curve/src/contract.rs index 8a41998be..31c602b00 100644 --- a/contracts/modules/andromeda-curve/src/contract.rs +++ b/contracts/modules/andromeda-curve/src/contract.rs @@ -14,7 +14,8 @@ use andromeda_std::{ }; use cosmwasm_std::{ - ensure, entry_point, Addr, Binary, Deps, DepsMut, Env, MessageInfo, Response, Storage, + ensure, entry_point, Addr, Binary, Deps, DepsMut, Env, MessageInfo, Reply, Response, StdError, + Storage, }; use cw_utils::nonpayable; @@ -211,3 +212,14 @@ pub fn query_plot_y_from_x( pub fn migrate(deps: DepsMut, _env: Env, _msg: MigrateMsg) -> Result { ADOContract::default().migrate(deps, CONTRACT_NAME, CONTRACT_VERSION) } + +#[cfg_attr(not(feature = "library"), entry_point)] +pub fn reply(_deps: DepsMut, _env: Env, msg: Reply) -> Result { + if msg.result.is_err() { + return Err(ContractError::Std(StdError::generic_err( + msg.result.unwrap_err(), + ))); + } + + Ok(Response::default()) +} diff --git a/contracts/modules/andromeda-curve/src/interface.rs b/contracts/modules/andromeda-curve/src/interface.rs new file mode 100644 index 000000000..74d221cae --- /dev/null +++ b/contracts/modules/andromeda-curve/src/interface.rs @@ -0,0 +1,6 @@ +use andromeda_modules::curve::{ExecuteMsg, InstantiateMsg, QueryMsg}; +use andromeda_std::{ado_base::MigrateMsg, contract_interface, deploy::ADOMetadata}; + +pub const CONTRACT_ID: &str = "curve"; + +contract_interface!(CurveContract, CONTRACT_ID, "andromeda_curve.wasm"); diff --git a/contracts/modules/andromeda-curve/src/lib.rs b/contracts/modules/andromeda-curve/src/lib.rs index bcbc58bb5..b43280813 100644 --- a/contracts/modules/andromeda-curve/src/lib.rs +++ b/contracts/modules/andromeda-curve/src/lib.rs @@ -5,3 +5,8 @@ pub mod testing; #[cfg(all(not(target_arch = "wasm32"), feature = "testing"))] pub mod mock; + +#[cfg(not(target_arch = "wasm32"))] +mod interface; +#[cfg(not(target_arch = "wasm32"))] +pub use crate::interface::CurveContract; diff --git a/contracts/modules/andromeda-date-time/Cargo.toml b/contracts/modules/andromeda-date-time/Cargo.toml index 5baed0208..b008a67d8 100644 --- a/contracts/modules/andromeda-date-time/Cargo.toml +++ b/contracts/modules/andromeda-date-time/Cargo.toml @@ -29,6 +29,7 @@ chrono = "0.4.38" [target.'cfg(not(target_arch = "wasm32"))'.dependencies] cw-multi-test = { workspace = true, optional = true } andromeda-testing = { workspace = true, optional = true } +cw-orch = { workspace = true } [dev-dependencies] andromeda-app = { workspace = true } diff --git a/contracts/modules/andromeda-date-time/src/contract.rs b/contracts/modules/andromeda-date-time/src/contract.rs index ed31698dc..f94b9518c 100644 --- a/contracts/modules/andromeda-date-time/src/contract.rs +++ b/contracts/modules/andromeda-date-time/src/contract.rs @@ -1,6 +1,6 @@ #[cfg(not(feature = "library"))] use cosmwasm_std::entry_point; -use cosmwasm_std::{Binary, Deps, DepsMut, Env, MessageInfo, Response}; +use cosmwasm_std::{Binary, Deps, DepsMut, Env, MessageInfo, Reply, Response, StdError}; use andromeda_modules::date_time::GetDateTimeResponse; use andromeda_modules::date_time::{ExecuteMsg, InstantiateMsg, QueryMsg, Timezone}; @@ -124,3 +124,14 @@ pub fn get_date_time( pub fn migrate(deps: DepsMut, _env: Env, _msg: MigrateMsg) -> Result { ADOContract::default().migrate(deps, CONTRACT_NAME, CONTRACT_VERSION) } + +#[cfg_attr(not(feature = "library"), entry_point)] +pub fn reply(_deps: DepsMut, _env: Env, msg: Reply) -> Result { + if msg.result.is_err() { + return Err(ContractError::Std(StdError::generic_err( + msg.result.unwrap_err(), + ))); + } + + Ok(Response::default()) +} diff --git a/contracts/modules/andromeda-date-time/src/interface.rs b/contracts/modules/andromeda-date-time/src/interface.rs new file mode 100644 index 000000000..f86708b21 --- /dev/null +++ b/contracts/modules/andromeda-date-time/src/interface.rs @@ -0,0 +1,6 @@ +use andromeda_modules::date_time::{ExecuteMsg, InstantiateMsg, QueryMsg}; +use andromeda_std::{ado_base::MigrateMsg, contract_interface, deploy::ADOMetadata}; + +pub const CONTRACT_ID: &str = "date-time"; + +contract_interface!(DateTimeContract, CONTRACT_ID, "andromeda_date_time.wasm"); diff --git a/contracts/modules/andromeda-date-time/src/lib.rs b/contracts/modules/andromeda-date-time/src/lib.rs index b0b35c28c..36ae37b81 100644 --- a/contracts/modules/andromeda-date-time/src/lib.rs +++ b/contracts/modules/andromeda-date-time/src/lib.rs @@ -4,3 +4,8 @@ pub mod testing; #[cfg(all(not(target_arch = "wasm32"), feature = "testing"))] pub mod mock; + +#[cfg(not(target_arch = "wasm32"))] +mod interface; +#[cfg(not(target_arch = "wasm32"))] +pub use crate::interface::DateTimeContract; diff --git a/contracts/modules/andromeda-rates/Cargo.toml b/contracts/modules/andromeda-rates/Cargo.toml index 87e4529f2..0a2fa3e93 100644 --- a/contracts/modules/andromeda-rates/Cargo.toml +++ b/contracts/modules/andromeda-rates/Cargo.toml @@ -29,6 +29,7 @@ andromeda-modules = { workspace = true } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] cw-multi-test = { workspace = true, optional = true } andromeda-testing = { workspace = true } +cw-orch = { workspace = true } [dev-dependencies] andromeda-app = { workspace = true } diff --git a/contracts/modules/andromeda-rates/src/contract.rs b/contracts/modules/andromeda-rates/src/contract.rs index 90c109070..5df97a64f 100644 --- a/contracts/modules/andromeda-rates/src/contract.rs +++ b/contracts/modules/andromeda-rates/src/contract.rs @@ -13,7 +13,8 @@ use andromeda_std::{ }; use cosmwasm_std::{ - attr, coin, ensure, Binary, Coin, Deps, DepsMut, Env, Event, MessageInfo, Response, SubMsg, + attr, coin, ensure, Binary, Coin, Deps, DepsMut, Env, Event, MessageInfo, Reply, Response, + StdError, SubMsg, }; use cosmwasm_std::{entry_point, from_json}; use cw20::Cw20Coin; @@ -210,3 +211,14 @@ pub fn query_deducted_funds( events, }) } + +#[cfg_attr(not(feature = "library"), entry_point)] +pub fn reply(_deps: DepsMut, _env: Env, msg: Reply) -> Result { + if msg.result.is_err() { + return Err(ContractError::Std(StdError::generic_err( + msg.result.unwrap_err(), + ))); + } + + Ok(Response::default()) +} diff --git a/contracts/modules/andromeda-rates/src/interface.rs b/contracts/modules/andromeda-rates/src/interface.rs new file mode 100644 index 000000000..708aeab6b --- /dev/null +++ b/contracts/modules/andromeda-rates/src/interface.rs @@ -0,0 +1,6 @@ +use andromeda_modules::rates::{ExecuteMsg, InstantiateMsg, QueryMsg}; +use andromeda_std::{ado_base::MigrateMsg, contract_interface, deploy::ADOMetadata}; + +pub const CONTRACT_ID: &str = "rates"; + +contract_interface!(RatesContract, CONTRACT_ID, "andromeda_rates.wasm"); diff --git a/contracts/modules/andromeda-rates/src/lib.rs b/contracts/modules/andromeda-rates/src/lib.rs index bcbc58bb5..ac37dbd69 100644 --- a/contracts/modules/andromeda-rates/src/lib.rs +++ b/contracts/modules/andromeda-rates/src/lib.rs @@ -5,3 +5,8 @@ pub mod testing; #[cfg(all(not(target_arch = "wasm32"), feature = "testing"))] pub mod mock; + +#[cfg(not(target_arch = "wasm32"))] +mod interface; +#[cfg(not(target_arch = "wasm32"))] +pub use crate::interface::RatesContract; diff --git a/contracts/modules/andromeda-shunting/Cargo.toml b/contracts/modules/andromeda-shunting/Cargo.toml index 12381a893..d4b7a9031 100644 --- a/contracts/modules/andromeda-shunting/Cargo.toml +++ b/contracts/modules/andromeda-shunting/Cargo.toml @@ -29,6 +29,7 @@ cw-json = { git = "https://github.com/SlayerAnsh/cw-json.git" } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] cw-multi-test = { workspace = true, optional = true } andromeda-testing = { workspace = true } +cw-orch = { workspace = true } [dev-dependencies] andromeda-app = { workspace = true } diff --git a/contracts/modules/andromeda-shunting/src/contract.rs b/contracts/modules/andromeda-shunting/src/contract.rs index 2e802850a..bf48a46c4 100644 --- a/contracts/modules/andromeda-shunting/src/contract.rs +++ b/contracts/modules/andromeda-shunting/src/contract.rs @@ -4,13 +4,14 @@ use andromeda_modules::shunting::{ EvaluateParam, EvaluateRefParam, ExecuteMsg, InstantiateMsg, QueryMsg, }; use andromeda_std::{ - ado_base::InstantiateMsg as BaseInstantiateMsg, + ado_base::{InstantiateMsg as BaseInstantiateMsg, MigrateMsg}, ado_contract::ADOContract, common::{context::ExecuteContext, encode_binary}, error::ContractError, }; use cosmwasm_std::{ - attr, ensure, entry_point, Binary, Deps, DepsMut, Env, MessageInfo, Response, WasmQuery, + attr, ensure, entry_point, Binary, Deps, DepsMut, Env, MessageInfo, Reply, Response, StdError, + WasmQuery, }; use cw2::set_contract_version; use cw_utils::nonpayable; @@ -187,3 +188,19 @@ fn eval(expr: &str) -> Result { Ok(result.unwrap()) } + +#[cfg_attr(not(feature = "library"), entry_point)] +pub fn migrate(deps: DepsMut, _env: Env, _msg: MigrateMsg) -> Result { + ADOContract::default().migrate(deps, CONTRACT_NAME, CONTRACT_VERSION) +} + +#[cfg_attr(not(feature = "library"), entry_point)] +pub fn reply(_deps: DepsMut, _env: Env, msg: Reply) -> Result { + if msg.result.is_err() { + return Err(ContractError::Std(StdError::generic_err( + msg.result.unwrap_err(), + ))); + } + + Ok(Response::default()) +} diff --git a/contracts/modules/andromeda-shunting/src/interface.rs b/contracts/modules/andromeda-shunting/src/interface.rs new file mode 100644 index 000000000..db0902ef4 --- /dev/null +++ b/contracts/modules/andromeda-shunting/src/interface.rs @@ -0,0 +1,6 @@ +use andromeda_modules::shunting::{ExecuteMsg, InstantiateMsg, QueryMsg}; +use andromeda_std::{ado_base::MigrateMsg, contract_interface, deploy::ADOMetadata}; + +pub const CONTRACT_ID: &str = "shunting"; + +contract_interface!(ShuntingContract, CONTRACT_ID, "andromeda_shunting.wasm"); diff --git a/contracts/modules/andromeda-shunting/src/lib.rs b/contracts/modules/andromeda-shunting/src/lib.rs index bcbc58bb5..5130de3a8 100644 --- a/contracts/modules/andromeda-shunting/src/lib.rs +++ b/contracts/modules/andromeda-shunting/src/lib.rs @@ -5,3 +5,8 @@ pub mod testing; #[cfg(all(not(target_arch = "wasm32"), feature = "testing"))] pub mod mock; + +#[cfg(not(target_arch = "wasm32"))] +mod interface; +#[cfg(not(target_arch = "wasm32"))] +pub use crate::interface::ShuntingContract; diff --git a/contracts/non-fungible-tokens/andromeda-auction/Cargo.toml b/contracts/non-fungible-tokens/andromeda-auction/Cargo.toml index 05a63d715..001aa5c5b 100644 --- a/contracts/non-fungible-tokens/andromeda-auction/Cargo.toml +++ b/contracts/non-fungible-tokens/andromeda-auction/Cargo.toml @@ -30,6 +30,7 @@ andromeda-non-fungible-tokens = { workspace = true } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] cw-multi-test = { workspace = true, optional = true } andromeda-testing = { workspace = true, optional = true } +cw-orch = { workspace = true } [dev-dependencies] andromeda-app = { workspace = true } diff --git a/contracts/non-fungible-tokens/andromeda-auction/src/contract.rs b/contracts/non-fungible-tokens/andromeda-auction/src/contract.rs index a83b367e0..64be2c107 100644 --- a/contracts/non-fungible-tokens/andromeda-auction/src/contract.rs +++ b/contracts/non-fungible-tokens/andromeda-auction/src/contract.rs @@ -29,8 +29,8 @@ use andromeda_std::{ado_contract::ADOContract, common::context::ExecuteContext}; use cosmwasm_std::{ attr, coins, ensure, entry_point, from_json, wasm_execute, Addr, BankMsg, Binary, Coin, - CosmosMsg, Deps, DepsMut, Env, MessageInfo, QuerierWrapper, QueryRequest, Response, Storage, - SubMsg, Uint128, WasmMsg, WasmQuery, + CosmosMsg, Deps, DepsMut, Env, MessageInfo, QuerierWrapper, QueryRequest, Reply, Response, + StdError, Storage, SubMsg, Uint128, WasmMsg, WasmQuery, }; use cw20::{Cw20Coin, Cw20ExecuteMsg, Cw20ReceiveMsg}; use cw721::{Cw721ExecuteMsg, Cw721QueryMsg, Cw721ReceiveMsg, OwnerOfResponse}; @@ -1399,3 +1399,14 @@ fn query_authorized_addresses( pub fn migrate(deps: DepsMut, _env: Env, _msg: MigrateMsg) -> Result { ADOContract::default().migrate(deps, CONTRACT_NAME, CONTRACT_VERSION) } + +#[cfg_attr(not(feature = "library"), entry_point)] +pub fn reply(_deps: DepsMut, _env: Env, msg: Reply) -> Result { + if msg.result.is_err() { + return Err(ContractError::Std(StdError::generic_err( + msg.result.unwrap_err(), + ))); + } + + Ok(Response::default()) +} diff --git a/contracts/non-fungible-tokens/andromeda-auction/src/interface.rs b/contracts/non-fungible-tokens/andromeda-auction/src/interface.rs new file mode 100644 index 000000000..9ed38460c --- /dev/null +++ b/contracts/non-fungible-tokens/andromeda-auction/src/interface.rs @@ -0,0 +1,6 @@ +use andromeda_non_fungible_tokens::auction::{ExecuteMsg, InstantiateMsg, QueryMsg}; +use andromeda_std::{ado_base::MigrateMsg, contract_interface, deploy::ADOMetadata}; + +pub const CONTRACT_ID: &str = "auction"; + +contract_interface!(AuctionContract, CONTRACT_ID, "andromeda_auction.wasm"); diff --git a/contracts/non-fungible-tokens/andromeda-auction/src/lib.rs b/contracts/non-fungible-tokens/andromeda-auction/src/lib.rs index bcbc58bb5..3fe5a648a 100644 --- a/contracts/non-fungible-tokens/andromeda-auction/src/lib.rs +++ b/contracts/non-fungible-tokens/andromeda-auction/src/lib.rs @@ -5,3 +5,8 @@ pub mod testing; #[cfg(all(not(target_arch = "wasm32"), feature = "testing"))] pub mod mock; + +#[cfg(not(target_arch = "wasm32"))] +mod interface; +#[cfg(not(target_arch = "wasm32"))] +pub use crate::interface::AuctionContract; diff --git a/contracts/non-fungible-tokens/andromeda-crowdfund/Cargo.toml b/contracts/non-fungible-tokens/andromeda-crowdfund/Cargo.toml index 88fc0e37d..7e98a51aa 100644 --- a/contracts/non-fungible-tokens/andromeda-crowdfund/Cargo.toml +++ b/contracts/non-fungible-tokens/andromeda-crowdfund/Cargo.toml @@ -29,6 +29,7 @@ andromeda-non-fungible-tokens = { workspace = true } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] cw-multi-test = { workspace = true, optional = true } andromeda-testing = { workspace = true, optional = true } +cw-orch = { workspace = true } [dev-dependencies] andromeda-app = { workspace = true } diff --git a/contracts/non-fungible-tokens/andromeda-crowdfund/src/interface.rs b/contracts/non-fungible-tokens/andromeda-crowdfund/src/interface.rs new file mode 100644 index 000000000..498bced4b --- /dev/null +++ b/contracts/non-fungible-tokens/andromeda-crowdfund/src/interface.rs @@ -0,0 +1,6 @@ +use andromeda_non_fungible_tokens::crowdfund::{ExecuteMsg, InstantiateMsg, QueryMsg}; +use andromeda_std::{ado_base::MigrateMsg, contract_interface, deploy::ADOMetadata}; + +pub const CONTRACT_ID: &str = "crowdfund"; + +contract_interface!(CrowdfundContract, CONTRACT_ID, "andromeda_crowdfund.wasm"); diff --git a/contracts/non-fungible-tokens/andromeda-crowdfund/src/lib.rs b/contracts/non-fungible-tokens/andromeda-crowdfund/src/lib.rs index bcbc58bb5..79c81f017 100644 --- a/contracts/non-fungible-tokens/andromeda-crowdfund/src/lib.rs +++ b/contracts/non-fungible-tokens/andromeda-crowdfund/src/lib.rs @@ -5,3 +5,8 @@ pub mod testing; #[cfg(all(not(target_arch = "wasm32"), feature = "testing"))] pub mod mock; + +#[cfg(not(target_arch = "wasm32"))] +mod interface; +#[cfg(not(target_arch = "wasm32"))] +pub use crate::interface::CrowdfundContract; diff --git a/contracts/non-fungible-tokens/andromeda-marketplace/Cargo.toml b/contracts/non-fungible-tokens/andromeda-marketplace/Cargo.toml index 3f8a1f54d..fb05c1acb 100644 --- a/contracts/non-fungible-tokens/andromeda-marketplace/Cargo.toml +++ b/contracts/non-fungible-tokens/andromeda-marketplace/Cargo.toml @@ -29,6 +29,7 @@ andromeda-non-fungible-tokens = { workspace = true } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] cw-multi-test = { workspace = true, optional = true } andromeda-testing = { workspace = true, optional = true } +cw-orch = { workspace = true } [dev-dependencies] andromeda-app = { workspace = true } diff --git a/contracts/non-fungible-tokens/andromeda-marketplace/src/contract.rs b/contracts/non-fungible-tokens/andromeda-marketplace/src/contract.rs index 6533e5f16..1b6a17d26 100644 --- a/contracts/non-fungible-tokens/andromeda-marketplace/src/contract.rs +++ b/contracts/non-fungible-tokens/andromeda-marketplace/src/contract.rs @@ -33,7 +33,8 @@ use cw721::{Cw721ExecuteMsg, Cw721QueryMsg, Cw721ReceiveMsg, OwnerOfResponse}; use cosmwasm_std::entry_point; use cosmwasm_std::{ attr, coin, ensure, from_json, Addr, Binary, Coin, CosmosMsg, Deps, DepsMut, Env, MessageInfo, - QuerierWrapper, QueryRequest, Response, Storage, SubMsg, Uint128, WasmMsg, WasmQuery, + QuerierWrapper, QueryRequest, Reply, Response, StdError, Storage, SubMsg, Uint128, WasmMsg, + WasmQuery, }; use cw_utils::{nonpayable, Expiration}; @@ -901,3 +902,14 @@ fn query_authorized_addresses( pub fn migrate(deps: DepsMut, _env: Env, _msg: MigrateMsg) -> Result { ADOContract::default().migrate(deps, CONTRACT_NAME, CONTRACT_VERSION) } + +#[cfg_attr(not(feature = "library"), entry_point)] +pub fn reply(_deps: DepsMut, _env: Env, msg: Reply) -> Result { + if msg.result.is_err() { + return Err(ContractError::Std(StdError::generic_err( + msg.result.unwrap_err(), + ))); + } + + Ok(Response::default()) +} diff --git a/contracts/non-fungible-tokens/andromeda-marketplace/src/interface.rs b/contracts/non-fungible-tokens/andromeda-marketplace/src/interface.rs new file mode 100644 index 000000000..0c3343f0a --- /dev/null +++ b/contracts/non-fungible-tokens/andromeda-marketplace/src/interface.rs @@ -0,0 +1,10 @@ +use andromeda_non_fungible_tokens::marketplace::{ExecuteMsg, InstantiateMsg, QueryMsg}; +use andromeda_std::{ado_base::MigrateMsg, contract_interface, deploy::ADOMetadata}; + +pub const CONTRACT_ID: &str = "marketplace"; + +contract_interface!( + MarketplaceContract, + CONTRACT_ID, + "andromeda_marketplace.wasm" +); diff --git a/contracts/non-fungible-tokens/andromeda-marketplace/src/lib.rs b/contracts/non-fungible-tokens/andromeda-marketplace/src/lib.rs index bcbc58bb5..ab39ece75 100644 --- a/contracts/non-fungible-tokens/andromeda-marketplace/src/lib.rs +++ b/contracts/non-fungible-tokens/andromeda-marketplace/src/lib.rs @@ -5,3 +5,8 @@ pub mod testing; #[cfg(all(not(target_arch = "wasm32"), feature = "testing"))] pub mod mock; + +#[cfg(not(target_arch = "wasm32"))] +mod interface; +#[cfg(not(target_arch = "wasm32"))] +pub use crate::interface::MarketplaceContract; diff --git a/contracts/os/andromeda-vfs/Cargo.toml b/contracts/os/andromeda-vfs/Cargo.toml index 5e95e7a91..ead9544a5 100644 --- a/contracts/os/andromeda-vfs/Cargo.toml +++ b/contracts/os/andromeda-vfs/Cargo.toml @@ -28,8 +28,9 @@ cw-storage-plus = { workspace = true } serde = { version = "1.0.127", default-features = false, features = ["derive"] } andromeda-std = { workspace = true } -cw-orch = { workspace = true } + [target.'cfg(not(target_arch = "wasm32"))'.dependencies] +cw-orch = { workspace = true } cw-multi-test = { workspace = true, optional = true } # [dev-dependencies] diff --git a/packages/deploy/Cargo.toml b/packages/deploy/Cargo.toml index 4533f13c1..774e094d9 100644 --- a/packages/deploy/Cargo.toml +++ b/packages/deploy/Cargo.toml @@ -47,17 +47,39 @@ andromeda-splitter = { path = "../../contracts/finance/andromeda-splitter" } andromeda-validator-staking = { path = "../../contracts/finance/andromeda-validator-staking" } andromeda-vesting = { path = "../../contracts/finance/andromeda-vesting" } andromeda-timelock = { path = "../../contracts/finance/andromeda-timelock" } +andromeda-conditional-splitter = { path = "../../contracts/finance/andromeda-conditional-splitter" } +andromeda-rate-limiting-withdrawals = { path = "../../contracts/finance/andromeda-rate-limiting-withdrawals" } +andromeda-set-amount-splitter = { path = "../../contracts/finance/andromeda-set-amount-splitter" } +andromeda-weighted-distribution-splitter = { path = "../../contracts/finance/andromeda-weighted-distribution-splitter" } # Data Storage Contracts andromeda-counter = { path = "../../contracts/data-storage/andromeda-counter" } andromeda-primitive = { path = "../../contracts/data-storage/andromeda-primitive" } +andromeda-boolean = { path = "../../contracts/data-storage/andromeda-boolean" } +andromeda-string-storage = { path = "../../contracts/data-storage/andromeda-string-storage" } # Fungible Tokens Contracts andromeda-cw20-staking = { path = "../../contracts/fungible-tokens/andromeda-cw20-staking" } andromeda-cw20 = { path = "../../contracts/fungible-tokens/andromeda-cw20" } +andromeda-cw20-exchange = { path = "../../contracts/fungible-tokens/andromeda-cw20-exchange" } +andromeda-lockdrop = { path = "../../contracts/fungible-tokens/andromeda-lockdrop" } +andromeda-merkle-airdrop = { path = "../../contracts/fungible-tokens/andromeda-merkle-airdrop" } # Non-Fungible Tokens Contracts andromeda-cw721 = { path = "../../contracts/non-fungible-tokens/andromeda-cw721" } +andromeda-auction = { path = "../../contracts/non-fungible-tokens/andromeda-auction" } +andromeda-crowdfund = { path = "../../contracts/non-fungible-tokens/andromeda-crowdfund" } +andromeda-marketplace = { path = "../../contracts/non-fungible-tokens/andromeda-marketplace" } + +# App Contracts +andromeda-app-contract = { path = "../../contracts/app/andromeda-app-contract" } + +# Modules Contracts +andromeda-address-list = { path = "../../contracts/modules/andromeda-address-list" } +andromeda-curve = { path = "../../contracts/modules/andromeda-curve" } +andromeda-date-time = { path = "../../contracts/modules/andromeda-date-time" } +andromeda-rates = { path = "../../contracts/modules/andromeda-rates" } +andromeda-shunting = { path = "../../contracts/modules/andromeda-shunting" } andromeda-std = { workspace = true } env_logger = "0.11.5" diff --git a/packages/deploy/src/chains.rs b/packages/deploy/src/chains.rs index 546271ed8..528ac1cee 100644 --- a/packages/deploy/src/chains.rs +++ b/packages/deploy/src/chains.rs @@ -3,7 +3,7 @@ use cw_orch::{ prelude::ChainInfo, }; -pub const ANDROMEDA_NETWORK: NetworkInfo = NetworkInfo { +pub const ANDROMEDA_TESTNET_NETWORK: NetworkInfo = NetworkInfo { chain_name: "andromeda", pub_address_prefix: "andr", coin_type: 118u32, @@ -16,11 +16,28 @@ pub const ANDROMEDA_TESTNET: ChainInfo = ChainInfo { gas_price: 0.025, grpc_urls: &["http://137.184.182.11:9090/"], lcd_url: Some("http://137.184.182.11:1317/"), - network_info: ANDROMEDA_NETWORK, + network_info: ANDROMEDA_TESTNET_NETWORK, kind: ChainKind::Testnet, }; -pub const ALL_CHAINS: &[ChainInfo] = &[ANDROMEDA_TESTNET]; +pub const STARGAZE_TESTNET_NETWORK: NetworkInfo = NetworkInfo { + chain_name: "stargaze", + pub_address_prefix: "stars", + coin_type: 118u32, +}; + +pub const STARGAZE_TESTNET: ChainInfo = ChainInfo { + chain_id: "elgafar-1", + gas_denom: "ustars", + fcd_url: None, + gas_price: 0.025, + grpc_urls: &["http://grpc-1.elgafar-1.stargaze-apis.com:26660"], + lcd_url: Some("https://rest.elgafar-1.stargaze-apis.com/"), + network_info: STARGAZE_TESTNET_NETWORK, + kind: ChainKind::Testnet, +}; + +pub const ALL_CHAINS: &[ChainInfo] = &[ANDROMEDA_TESTNET, STARGAZE_TESTNET]; pub fn get_chain(chain: String) -> ChainInfo { ALL_CHAINS diff --git a/packages/deploy/src/contracts.rs b/packages/deploy/src/contracts.rs index 08fc3e175..be6d91ef2 100644 --- a/packages/deploy/src/contracts.rs +++ b/packages/deploy/src/contracts.rs @@ -1,13 +1,30 @@ +use andromeda_address_list::AddressListContract; +use andromeda_app_contract::AppContract; +use andromeda_auction::AuctionContract; +use andromeda_boolean::BooleanContract; +use andromeda_conditional_splitter::ConditionalSplitterContract; use andromeda_counter::CounterContract; +use andromeda_crowdfund::CrowdfundContract; +use andromeda_curve::CurveContract; use andromeda_cw20::CW20Contract; +use andromeda_cw20_exchange::Cw20ExchangeContract; use andromeda_cw20_staking::CW20StakingContract; use andromeda_cw721::CW721Contract; +use andromeda_lockdrop::LockdropContract; +use andromeda_marketplace::MarketplaceContract; +use andromeda_merkle_airdrop::MerkleAirdropContract; use andromeda_primitive::PrimitiveContract; +use andromeda_rate_limiting_withdrawals::RateLimitingWithdrawalsContract; +use andromeda_rates::RatesContract; +use andromeda_set_amount_splitter::SetAmountSplitterContract; +use andromeda_shunting::ShuntingContract; use andromeda_splitter::SplitterContract; use andromeda_std::deploy::ADOMetadata; +use andromeda_string_storage::StringStorageContract; use andromeda_timelock::TimelockContract; use andromeda_validator_staking::ValidatorStakingContract; use andromeda_vesting::VestingContract; +use andromeda_weighted_distribution_splitter::WeightedDistributionSplitterContract; use cw_orch::prelude::*; use cw_orch_daemon::{DaemonBase, Wallet}; @@ -41,5 +58,24 @@ pub fn all_contracts() -> Vec { deployable!(CW20Contract), deployable!(CW20StakingContract), deployable!(CW721Contract), + deployable!(AppContract), + deployable!(BooleanContract), + deployable!(StringStorageContract), + deployable!(ConditionalSplitterContract), + deployable!(RateLimitingWithdrawalsContract), + deployable!(SetAmountSplitterContract), + deployable!(WeightedDistributionSplitterContract), + deployable!(Cw20ExchangeContract), + deployable!(LockdropContract), + deployable!(MerkleAirdropContract), + deployable!(AddressListContract), + deployable!(CurveContract), + // Undeployable for now + // deployable!(DateTimeContract), + deployable!(RatesContract), + deployable!(ShuntingContract), + deployable!(AuctionContract), + deployable!(CrowdfundContract), + deployable!(MarketplaceContract), ] }