Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update deploy_all bin #75

Merged
merged 5 commits into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 15 additions & 11 deletions framework/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,26 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased] - yyyy-mm-dd

### Added
- Install modules on account or Sub-account creation
- Manager stores his sub-accounts and sub-accounts can register or unregister in case of ownership change
- Query on module factory to see how much funds needs to be attached for installing modules
- Version control on instantiation to the Apps alongside with registry traits
- Instantiation funds added to module configuration, allowing modules to perform external setup calls

- Install modules on account or Sub-account creation.
- Manager stores his sub-accounts and sub-accounts can register or unregister in case of ownership change.
- Query on module factory to see how much funds needs to be attached for installing modules.
- Version control on instantiation to the Apps alongside with registry traits.
- Instantiation funds added to module configuration, allowing modules to perform external setup calls.

### Changed

- Updated fetch_data arguments of CwStakingCommand
- StakingInfoResponse now returns staking target(which is either contract address or pool id) instead of always staking contract address
- Owner of the sub-accounts now Proxy, allowing modules to interact with sub-accounts
- Install modules replaced install module method on module factory to reduce gas consumption for multi-install cases
- StakingInfoResponse now returns staking target(which is either contract address or pool id) instead of always staking contract address.
- Owner of the sub-accounts now Proxy, allowing modules to interact with sub-accounts.
- Install modules replaced install module method on module factory to reduce gas consumption for multi-install cases.
- Modified the account id structure. Each account is now identified with a unique ID and a trace. This is a requirement for Abstract IBC.

### Fixed
- Partially fixed cw-staking for Osmosis
- Manager governance now changes only after new "owner" claimed ownership
- Fixed and separated cw-staking and dex adapters for kujira

- Partially fixed cw-staking for Osmosis.
- Manager governance now changes only after new "owner" claimed ownership.
- Fixed and separated cw-staking and dex adapters for kujira.
- `ExecOnModule` calls now forward any provided funds to the module that is called.

## [0.17.2] - 2023-07-27
Expand Down
2 changes: 1 addition & 1 deletion framework/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ protobuf = { version = "2", features = ["with-bytes"] }
clap = { version = "4.0.32", features = ["derive"] }
semver = "1.0"
cw-semver = { version = "1.0" }
cw-orch = { version = "0.15.0" }
cw-orch = { version = "0.16.1" }
tokio = { version = "1.4", features = ["full"] }

## crates in order of publishing ## see docs/Publishing.md
Expand Down
Binary file modified framework/artifacts/abstract_account_factory.wasm
Binary file not shown.
Binary file modified framework/artifacts/abstract_ans_host.wasm
Binary file not shown.
Binary file modified framework/artifacts/abstract_ibc_client.wasm
Binary file not shown.
Binary file modified framework/artifacts/abstract_manager.wasm
Binary file not shown.
Binary file modified framework/artifacts/abstract_module_factory.wasm
Binary file not shown.
Binary file modified framework/artifacts/abstract_proxy.wasm
Binary file not shown.
Binary file modified framework/artifacts/abstract_version_control.wasm
Binary file not shown.
14 changes: 7 additions & 7 deletions framework/artifacts/checksums.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
5824378334e2e396d9be0c440586f888cf6178835df03545ae187ec6c65c7645 abstract_account_factory.wasm
54113a905952f057274ff4604bb8fb92142165519d1e207af43dc79d0ac10eaa abstract_ans_host.wasm
9878c274815952e984cde42941651299d3e6f7ec97748c6d5047128f5954068e abstract_ibc_client.wasm
9bb139319016d649e9f1b8f13f0ac5e639c54b4c671282e8abf917482297d589 abstract_manager.wasm
edf9d130124fe2b6b632a99b7bfba595353a24a3a8158297f3cdbc6238b4db94 abstract_module_factory.wasm
cdfb6089ac5e57b108979f083063890bdd744a8db2b8443f5215fde212a3f588 abstract_proxy.wasm
455e8d471a1d2c314e44daa563ab38575b811b392d54589d3715dbefbedc390e abstract_version_control.wasm
0cc1d3f7a070438229dfafbe42b96b790aecd41e82bd8952894da2dab894dbed abstract_account_factory.wasm
ce8ac8230e325f2c82539d5ae36b5790a0e5a0725878dea84f3afa94bbc45b75 abstract_ans_host.wasm
d590f4ffae505c026c2d7dd6a0e9e57314b3f6d73e3be491b1cf2853f8809230 abstract_ibc_client.wasm
4d32a9240baa9631380e781ef6e8b347d508f5726dd2f6f50c45b544d63546df abstract_manager.wasm
5deb5812f9c673580025dce3b1d4f50d0bd0b9d7a5395a12b85c9f6133280bc4 abstract_module_factory.wasm
b068d3b0a3a1ff8567a56412b5bde14ce09315b7cda0de9f8fa40b2f61b850cb abstract_proxy.wasm
39018b13f88613f678174cb1c1f2eb72230cd303db9f1718b6ce0d304e91f82b abstract_version_control.wasm
14 changes: 7 additions & 7 deletions framework/artifacts/checksums_intermediate.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
34f0275a4eaae7f43193e1b78c4fba6c0903f1c5712e5a6b1c55d22f9fd04a2a target/wasm32-unknown-unknown/release/abstract_account_factory.wasm
c1985ba17b676866f03278f2b519afcd657bf2b1fffb2647ea12e32f8fe4dd70 target/wasm32-unknown-unknown/release/abstract_ans_host.wasm
09d4898239e1eb0abb10b549b5fd58438e24a008085a73535540915d61c106dd target/wasm32-unknown-unknown/release/abstract_ibc_client.wasm
126a5e31e50182fdc2f1d0974ee17b4144697b11ddb8317ca7e27b6b6c287218 target/wasm32-unknown-unknown/release/abstract_manager.wasm
4c4d09b5ea1a2eb0823b3229c37330f64675b06e789b30a5b505d7fb360df119 target/wasm32-unknown-unknown/release/abstract_module_factory.wasm
33890a3cf0867a5ace2545b153ac0bc754dca278f2400d0aaf01f81d01bf6ad3 target/wasm32-unknown-unknown/release/abstract_proxy.wasm
a45ed760d72f403e38c9ef3f4dd7b4a7807540c41525e2f5f56f74782eca4975 target/wasm32-unknown-unknown/release/abstract_version_control.wasm
e0be0c362d9a283506984a10dd27eecbae5b24dab49278276f7ee0cd7ec528d9 target/wasm32-unknown-unknown/release/abstract_account_factory.wasm
e8bcea0f17af9eab9f3e3c4ead149f0741eb3372323c5eb8fdd65f90bebeb62b target/wasm32-unknown-unknown/release/abstract_ans_host.wasm
f0b808d9cc2e1f23ae767ea25aa07538b8f6d137d16a29490b7b16d26e125691 target/wasm32-unknown-unknown/release/abstract_ibc_client.wasm
1936187d48173fef14cd00121c83414b6f325ce44aedf2b18af63537f1c88549 target/wasm32-unknown-unknown/release/abstract_manager.wasm
6e4fbeb9b373a4d95fa2fadb1aaf6eb631831f7a453e6473d8682fa0cdfcc707 target/wasm32-unknown-unknown/release/abstract_module_factory.wasm
3a1e9f5588462650e268920223f1cbe89fd5b379fa33bbdabce88f6a498dff09 target/wasm32-unknown-unknown/release/abstract_proxy.wasm
bb55273114f004e75d15ed86b42782b039c4cb256b58dc1be7ec9e4637464c95 target/wasm32-unknown-unknown/release/abstract_version_control.wasm
18 changes: 11 additions & 7 deletions framework/contracts/account/manager/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use abstract_core::adapter::{
use abstract_core::manager::{InternalConfigAction, UpdateSubAccountAction};
use abstract_core::module_factory::ModuleInstallConfig;
use abstract_core::objects::gov_type::GovernanceDetails;
use abstract_core::objects::AssetEntry;
use abstract_core::objects::{AccountId, AssetEntry};

use abstract_core::objects::version_control::VersionControlContract;
use abstract_core::proxy::state::ACCOUNT_ID;
Expand Down Expand Up @@ -288,7 +288,7 @@ fn unregister_sub_account(deps: DepsMut, info: MessageInfo, id: u32) -> ManagerR
let account = abstract_core::version_control::state::ACCOUNT_ADDRESSES.query(
&deps.querier,
config.version_control_address,
id,
&AccountId::local(id),
)?;

if account.is_some_and(|a| a.manager == info.sender) {
Expand All @@ -310,7 +310,7 @@ fn register_sub_account(deps: DepsMut, info: MessageInfo, id: u32) -> ManagerRes
let account = abstract_core::version_control::state::ACCOUNT_ADDRESSES.query(
&deps.querier,
config.version_control_address,
id,
&AccountId::local(id),
)?;

if account.is_some_and(|a| a.manager == info.sender) {
Expand Down Expand Up @@ -424,10 +424,12 @@ pub(crate) fn update_governance(storage: &mut dyn Storage) -> ManagerResult<Vec<
if let GovernanceDetails::SubAccount { manager, .. } = acc_info.governance_details {
let id = ACCOUNT_ID.load(storage)?;
// For optimizing the gas we save it, in case new owner is sub-account as well
account_id = Some(id);
account_id = Some(id.clone());
let unregister_message = wasm_execute(
manager,
&ExecuteMsg::UpdateSubAccount(UpdateSubAccountAction::UnregisterSubAccount { id }),
&ExecuteMsg::UpdateSubAccount(UpdateSubAccountAction::UnregisterSubAccount {
id: id.clone().seq(),
}),
vec![],
)?;
msgs.push(unregister_message.into());
Expand All @@ -442,7 +444,9 @@ pub(crate) fn update_governance(storage: &mut dyn Storage) -> ManagerResult<Vec<
};
let register_message = wasm_execute(
manager,
&ExecuteMsg::UpdateSubAccount(UpdateSubAccountAction::RegisterSubAccount { id }),
&ExecuteMsg::UpdateSubAccount(UpdateSubAccountAction::RegisterSubAccount {
id: id.seq(),
}),
vec![],
)?;
msgs.push(register_message.into());
Expand Down Expand Up @@ -952,7 +956,7 @@ pub fn update_internal_config(
response = response.add_message(wasm_execute(
manager,
&ExecuteMsg::UpdateSubAccount(UpdateSubAccountAction::RegisterSubAccount {
id: ACCOUNT_ID.load(deps.storage)?,
id: ACCOUNT_ID.load(deps.storage)?.seq(),
}),
vec![],
)?);
Expand Down
7 changes: 5 additions & 2 deletions framework/contracts/account/manager/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ mod versioning;
#[cfg(test)]
mod test_common {
use crate::contract::ManagerResult;
use abstract_core::{manager, objects::gov_type::GovernanceDetails};
use abstract_core::{
manager,
objects::{account::AccountTrace, gov_type::GovernanceDetails, AccountId},
};
use abstract_testing::prelude::*;
use cosmwasm_std::{testing::*, DepsMut};

Expand All @@ -21,7 +24,7 @@ mod test_common {
mock_env(),
info,
manager::InstantiateMsg {
account_id: 1,
account_id: AccountId::new(1, AccountTrace::Local).unwrap(),
owner: GovernanceDetails::Monarchy {
monarch: TEST_OWNER.to_string(),
},
Expand Down
4 changes: 2 additions & 2 deletions framework/contracts/account/manager/src/queries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use abstract_sdk::core::manager::{
ModuleVersionsResponse,
};
use cosmwasm_std::{
to_binary, Addr, Binary, Deps, Env, Order, QueryRequest, StdError, StdResult, Uint64, WasmQuery,
to_binary, Addr, Binary, Deps, Env, Order, QueryRequest, StdError, StdResult, WasmQuery,
};
use cw2::{ContractVersion, CONTRACT};
use cw_storage_plus::Bound;
Expand All @@ -33,7 +33,7 @@ pub fn handle_account_info_query(deps: Deps) -> StdResult<Binary> {
}

pub fn handle_config_query(deps: Deps) -> StdResult<Binary> {
let account_id = Uint64::from(ACCOUNT_ID.load(deps.storage)?);
let account_id = ACCOUNT_ID.load(deps.storage)?;
let Config {
version_control_address,
module_factory_address,
Expand Down
2 changes: 1 addition & 1 deletion framework/contracts/account/manager/tests/adapters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ fn account_install_adapter() -> AResult {

deployment
.version_control
.claim_namespace(1, "tester".to_owned())?;
.claim_namespace(TEST_ACCOUNT_ID, "tester".to_owned())?;

let adapter = BootMockAdapter1V1::new_test(chain);
adapter.deploy(V1.parse().unwrap(), MockInitMsg)?;
Expand Down
3 changes: 2 additions & 1 deletion framework/contracts/account/manager/tests/apps.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
mod common;
use abstract_app::gen_app_mock;
use abstract_core::objects::account::TEST_ACCOUNT_ID;
use abstract_core::PROXY;
use abstract_interface::*;

Expand Down Expand Up @@ -69,7 +70,7 @@ fn account_install_app() -> AResult {

deployment
.version_control
.claim_namespace(1, "tester".to_owned())?;
.claim_namespace(TEST_ACCOUNT_ID, "tester".to_owned())?;

let app = MockApp::new_test(chain);
app.deploy(APP_VERSION.parse().unwrap())?;
Expand Down
9 changes: 5 additions & 4 deletions framework/contracts/account/manager/tests/proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use abstract_core::objects::fee::FixedFee;
use abstract_core::objects::module::{ModuleInfo, ModuleVersion, Monetization};
use abstract_core::objects::module_reference::ModuleReference;
use abstract_core::objects::namespace::Namespace;
use abstract_core::objects::{AccountId, ABSTRACT_ACCOUNT_ID};
use abstract_core::version_control::UpdateModule;
use abstract_core::{manager::ManagerModuleInfo, PROXY};
use abstract_interface::*;
Expand Down Expand Up @@ -46,7 +47,7 @@ fn instantiate() -> AResult {
assert_that!(account.manager.config()?).is_equal_to(abstract_core::manager::ConfigResponse {
version_control_address: deployment.version_control.address()?,
module_factory_address: deployment.module_factory.address()?,
account_id: TEST_ACCOUNT_ID.into(),
account_id: TEST_ACCOUNT_ID,
is_suspended: false,
});
Ok(())
Expand Down Expand Up @@ -181,7 +182,7 @@ fn install_standalone_modules() -> AResult {
let sender = Addr::unchecked(common::OWNER);
let chain = Mock::new(&sender);
let deployment = Abstract::deploy_on(chain.clone(), sender.to_string())?;
let account = AbstractAccount::new(&deployment, Some(0));
let account = AbstractAccount::new(&deployment, Some(AccountId::local(0)));

let standalone1_contract = Box::new(ContractWrapper::new(
mock_modules::standalone_cw2::mock_execute,
Expand Down Expand Up @@ -236,7 +237,7 @@ fn install_standalone_versions_not_met() -> AResult {
let sender = Addr::unchecked(common::OWNER);
let chain = Mock::new(&sender);
let deployment = Abstract::deploy_on(chain.clone(), sender.to_string())?;
let account = AbstractAccount::new(&deployment, Some(0));
let account = AbstractAccount::new(&deployment, Some(AccountId::local(0)));

let standalone1_contract = Box::new(ContractWrapper::new(
mock_modules::standalone_cw2::mock_execute,
Expand Down Expand Up @@ -285,7 +286,7 @@ fn install_multiple_modules() -> AResult {
let chain = Mock::new(&sender);
chain.add_balance(&sender, vec![coin(86, "token1"), coin(500, "token2")])?;
let deployment = Abstract::deploy_on(chain.clone(), sender.to_string())?;
let account = AbstractAccount::new(&deployment, Some(0));
let account = AbstractAccount::new(&deployment, Some(ABSTRACT_ACCOUNT_ID));

let standalone1_contract = Box::new(ContractWrapper::new(
mock_modules::standalone_cw2::mock_execute,
Expand Down
Loading