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

Publish Abstract V0.26.0 #563

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open
1,359 changes: 733 additions & 626 deletions framework/Cargo.lock

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions framework/Cargo.toml
Original file line number Diff line number Diff line change
@@ -65,9 +65,9 @@ polytone-note = { package = "abstract-polytone-note", version = "5.0.0" }

## crates in order of publishing ## see docs/Publishing.md

abstract-adapter = { path = "packages/abstract-adapter" }
abstract-app = { path = "packages/abstract-app" }
abstract-standalone = { path = "packages/abstract-standalone" }
abstract-adapter = { path = "packages/abstract-adapter", version = "0.26.0" }
abstract-app = { path = "packages/abstract-app", version = "0.26.0" }
abstract-standalone = { path = "packages/abstract-standalone", version = "0.26.0" }

# Keep these as path, creates cirular dependency otherwise
# Only need to re-publish all contracts if a re-publish of abstract-interface is required
@@ -86,7 +86,7 @@ abstract-ica = { version = "0.26.0", path = "packages/abstract-ica" }
abstract-sdk = { version = "0.26.0", path = "packages/abstract-sdk" }
abstract-std = { version = "0.26.0", path = "packages/abstract-std" }
abstract-testing = { version = "0.26.0", path = "packages/abstract-testing" }
abstract-xion = { package = "account", version = "0.1.0", git = "https://github.com/burnt-labs/contracts", features = ["library"] }
abstract-xion = { package = "xion-account", version = "0.1.0", features = ["library"] }


# These should remain fixed and don't need to be re-published (unless changes are made)
Binary file modified framework/artifacts/abstract_account-xion.wasm
Binary file not shown.
Binary file modified framework/artifacts/abstract_account.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_ibc_host.wasm
Binary file not shown.
Binary file modified framework/artifacts/abstract_ica_client.wasm
Binary file not shown.
Binary file modified framework/artifacts/abstract_module_factory.wasm
Binary file not shown.
Binary file modified framework/artifacts/abstract_registry.wasm
Binary file not shown.
16 changes: 8 additions & 8 deletions framework/artifacts/checksums.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
d8496d6433fb7cb5d2f1a0c6db22d641370e447e42e18beb56c4921987826073 abstract_account-xion.wasm
31f2c1aad47ef1d6c5301a4cdbaa48331b5116090bac25a180c2b23edd2b5cb9 abstract_account.wasm
0cbb852de4606f21fff0396430b41c41980b25f3a7a4198a47922787a6256f42 abstract_ans_host.wasm
79daca6c64abfd5b3557a6a5d77052fb248b3a27e0b196abe4cea721fd832872 abstract_ibc_client.wasm
1669d93a64f0b69664a799c96edac91d9ecb0672f3dd6da833c8a4ccde49a338 abstract_ibc_host.wasm
5e1ebbea19de85d940815bc47bccebddb902bae059a535b05acfbde5f9db5eb3 abstract_ica_client.wasm
efc127ca5c7ff88bd68cbee8b6b33ee64389f88decd2435553e843dacaaf0cb9 abstract_module_factory.wasm
e6a933b2fc0023edcf328db411de5432d03013ae484d01b2b50d21a7487f05e6 abstract_registry.wasm
d60581309eadf27a366f35eeffe364c40ce49f0bb4165a5ad03c1104983bf82f abstract_account-xion.wasm
28e31db2c7440a4138a84921a8f02e5282d39fe326c90205b9b8fb47f5b62f0d abstract_account.wasm
f5a034b452dc18e3c26253defa0b3b67beb61848d1a19c216f03e0b1737d5e56 abstract_ans_host.wasm
b344d374793d3213fe3070fa41a1b6646648af440aabcc640818686af4d636c0 abstract_ibc_client.wasm
d53935bf6121cbea4b10a56071cb6749a0bb128386db8ce8daddf3f64ddf10cc abstract_ibc_host.wasm
3d1dd9b70cc9d92b0d86cfe3f95222e363cacfef36b77c00375d1754486dd442 abstract_ica_client.wasm
eefcf1c8acc404625f5eda66b8496efb8f8d15ee41ec72ccd62988cb99c202ee abstract_module_factory.wasm
1cbfb47264d1183e26fe22c45b39c19e755888fb211e5e3835ca187f95ec78f1 abstract_registry.wasm
7 changes: 5 additions & 2 deletions framework/contracts/account/src/contract.rs
Original file line number Diff line number Diff line change
@@ -120,6 +120,9 @@ pub fn instantiate(
}
MIGRATE_CONTEXT.save(deps.storage, &vec![])?;

let owner = owner.unwrap_or(GovernanceDetails::AbstractAccount {
address: env.contract.address.clone(),
});
let governance = owner.clone().verify(deps.as_ref())?;
match governance {
// Check if the caller is the proposed owner account when creating a sub-account.
@@ -504,9 +507,9 @@ mod tests {
account::InstantiateMsg {
code_id: 1,
account_id: AccountId::new(1, AccountTrace::Local).ok(),
owner: GovernanceDetails::Monarchy {
owner: Some(GovernanceDetails::Monarchy {
monarch: abstr.owner.to_string(),
},
}),
namespace: None,
name: Some("test".to_string()),
description: None,
3 changes: 3 additions & 0 deletions framework/contracts/account/src/error.rs
Original file line number Diff line number Diff line change
@@ -127,6 +127,9 @@ pub enum AccountError {
#[error("Abstract Account don't have Authentication")]
AbstractAccountNoAuth {},

#[error("The new_code_id field needs to be filled when migrating from a xion account")]
MissingCodeIdToMigrate {},

#[cfg(feature = "xion")]
#[error(transparent)]
AbstractXion(#[from] abstract_xion::error::ContractError),
4 changes: 2 additions & 2 deletions framework/contracts/account/src/lib.rs
Original file line number Diff line number Diff line change
@@ -62,9 +62,9 @@ mod test_common {
account::InstantiateMsg {
code_id: 1,
account_id: Some(AccountId::new(1, AccountTrace::Local).unwrap()),
owner: GovernanceDetails::Monarchy {
owner: Some(GovernanceDetails::Monarchy {
monarch: abstr.owner.to_string(),
},
}),
namespace: None,
name: Some("test".to_string()),
description: None,
31 changes: 21 additions & 10 deletions framework/contracts/account/src/migrate.rs
Original file line number Diff line number Diff line change
@@ -26,8 +26,20 @@ pub fn migrate(deps: DepsMut, _env: Env, _msg: MigrateMsg) -> AccountResult {
} else {
#[cfg(feature = "xion")]
{
if current_contract_version.contract != "account" {
Err(AbstractError::ContractNameMismatch {
from: current_contract_version.contract.clone(),
to: ACCOUNT.to_string(),
})?;
}
// We might want to migrate from a XION account
migrate_from_xion_account(deps, _env, current_contract_version)
migrate_from_xion_account(
deps,
_env,
current_contract_version,
_msg.code_id
.ok_or(crate::error::AccountError::MissingCodeIdToMigrate {})?,
)
}
#[cfg(not(feature = "xion"))]
{
@@ -44,6 +56,7 @@ pub fn migrate_from_xion_account(
mut deps: DepsMut,
env: Env,
current_contract_version: cw2::ContractVersion,
new_code_id: u64,
) -> AccountResult {
use crate::modules::{_install_modules, MIGRATE_CONTEXT};
use ::{
@@ -52,6 +65,7 @@ pub fn migrate_from_xion_account(
abstract_std::account::ModuleInstallConfig,
abstract_std::objects::module::ModuleInfo,
abstract_std::objects::AccountId,
abstract_std::IBC_CLIENT,
abstract_std::{
account::state::{WhitelistedModules, SUSPENSION_STATUS, WHITELISTED_MODULES},
objects::{
@@ -60,7 +74,6 @@ pub fn migrate_from_xion_account(
},
registry::state::LOCAL_ACCOUNT_SEQUENCE,
},
abstract_std::{native_addrs, IBC_CLIENT},
cosmwasm_std::wasm_execute,
};

@@ -73,9 +86,7 @@ pub fn migrate_from_xion_account(
// Use CW2 to set the contract version, this is needed for migrations
set_contract_version(deps.storage, ACCOUNT, CONTRACT_VERSION)?;

let abstract_code_id =
native_addrs::abstract_code_id(&deps.querier, env.contract.address.clone())?;
let registry = RegistryContract::new(deps.as_ref(), abstract_code_id)?;
let registry = RegistryContract::new(deps.as_ref(), new_code_id)?;

let account_id =
AccountId::local(LOCAL_ACCOUNT_SEQUENCE.query(&deps.querier, registry.address.clone())?);
@@ -117,7 +128,7 @@ pub fn migrate_from_xion_account(

// Install IBC Client module
let (install_msgs, install_attribute) =
_install_modules(deps, install_modules, vec![], abstract_code_id)?;
_install_modules(deps, install_modules, vec![], new_code_id)?;
response = response
.add_submessages(install_msgs)
.add_attribute(install_attribute.key, install_attribute.value);
@@ -147,7 +158,7 @@ mod tests {

let version: Version = CONTRACT_VERSION.parse().unwrap();

let res = super::migrate(deps.as_mut(), env, MigrateMsg {});
let res = super::migrate(deps.as_mut(), env, MigrateMsg { code_id: None });

assert_eq!(
res,
@@ -175,7 +186,7 @@ mod tests {

let version: Version = CONTRACT_VERSION.parse().unwrap();

let res = super::migrate(deps.as_mut(), env, MigrateMsg {});
let res = super::migrate(deps.as_mut(), env, MigrateMsg { code_id: None });

assert_eq!(
res,
@@ -202,7 +213,7 @@ mod tests {
let old_name = "old:contract";
set_contract_version(deps.as_mut().storage, old_name, old_version)?;

let res = super::migrate(deps.as_mut(), env, MigrateMsg {});
let res = super::migrate(deps.as_mut(), env, MigrateMsg { code_id: None });

assert_eq!(
res,
@@ -234,7 +245,7 @@ mod tests {

set_contract_version(deps.as_mut().storage, ACCOUNT, small_version)?;

let res = super::migrate(deps.as_mut(), env, MigrateMsg {})?;
let res = super::migrate(deps.as_mut(), env, MigrateMsg { code_id: None })?;
assert!(res.messages.is_empty());

assert_eq!(
4 changes: 2 additions & 2 deletions framework/contracts/account/src/sub_account.rs
Original file line number Diff line number Diff line change
@@ -53,9 +53,9 @@ pub fn create_sub_account(
let create_account_msg = abstract_std::account::InstantiateMsg {
code_id: self_code_id,
account_id: Some(account_id.clone()),
owner: GovernanceDetails::SubAccount {
owner: Some(GovernanceDetails::SubAccount {
account: env.contract.address.into_string(),
},
}),
namespace,
install_modules,
name,
24 changes: 12 additions & 12 deletions framework/contracts/account/tests/create.rs
Original file line number Diff line number Diff line change
@@ -49,9 +49,9 @@ fn create_one_account() -> AResult {
namespace: None,
install_modules: vec![],
account_id: None,
owner: GovernanceDetails::Monarchy {
owner: Some(GovernanceDetails::Monarchy {
monarch: sender.to_string(),
},
}),
authenticator: None,
},
None,
@@ -94,9 +94,9 @@ fn create_two_accounts() -> AResult {
namespace: None,
install_modules: vec![],
account_id: None,
owner: GovernanceDetails::Monarchy {
owner: Some(GovernanceDetails::Monarchy {
monarch: sender.to_string(),
},
}),
authenticator: None,
},
None,
@@ -113,9 +113,9 @@ fn create_two_accounts() -> AResult {
namespace: None,
install_modules: vec![],
account_id: None,
owner: GovernanceDetails::Monarchy {
owner: Some(GovernanceDetails::Monarchy {
monarch: sender.to_string(),
},
}),
authenticator: None,
},
None,
@@ -164,9 +164,9 @@ fn sender_is_not_admin_monarchy() -> AResult {
namespace: None,
install_modules: vec![],
account_id: None,
owner: GovernanceDetails::Monarchy {
owner: Some(GovernanceDetails::Monarchy {
monarch: sender.to_string(),
},
}),
authenticator: None,
},
None,
@@ -213,10 +213,10 @@ fn sender_is_not_admin_external() -> AResult {
namespace: None,
install_modules: vec![],
account_id: None,
owner: GovernanceDetails::External {
owner: Some(GovernanceDetails::External {
governance_address: sender.to_string(),
governance_type: "some-gov-type".to_string(),
},
}),
authenticator: None,
},
None,
@@ -259,10 +259,10 @@ fn create_one_account_with_namespace() -> AResult {
namespace: Some(namespace_to_claim.to_string()),
install_modules: vec![],
account_id: None,
owner: GovernanceDetails::External {
owner: Some(GovernanceDetails::External {
governance_address: sender.to_string(),
governance_type: "some-gov-type".to_string(),
},
}),
authenticator: None,
},
None,
4 changes: 3 additions & 1 deletion framework/contracts/account/tests/upgrades.rs
Original file line number Diff line number Diff line change
@@ -915,7 +915,9 @@ mod upgrade_account {
),
(
ModuleInfo::from_id_latest("abstract:account")?,
Some(to_json_binary(&abstract_std::account::MigrateMsg {})?),
Some(to_json_binary(&abstract_std::account::MigrateMsg {
code_id: None,
})?),
),
(
ModuleInfo::from_id_latest(adapter_1::MOCK_ADAPTER_ID)?,
16 changes: 9 additions & 7 deletions framework/contracts/account/tests/xion.rs
Original file line number Diff line number Diff line change
@@ -123,9 +123,11 @@ fn test_init_sign_arb() {
pubkey: Binary::from(pubkey_bytes),
signature: Binary::from(signature_bytes),
}),
owner: abstract_std::objects::gov_type::GovernanceDetails::AbstractAccount {
address: env.contract.address.clone(),
},
owner: Some(
abstract_std::objects::gov_type::GovernanceDetails::AbstractAccount {
address: env.contract.address.clone(),
},
),
name: Some("account".to_owned()),
install_modules: vec![],
account_id: None,
@@ -159,9 +161,9 @@ pub(crate) fn mock_init(
account::InstantiateMsg {
code_id: 1,
account_id: Some(AccountId::new(1, AccountTrace::Local).unwrap()),
owner: GovernanceDetails::Monarchy {
owner: Some(GovernanceDetails::Monarchy {
monarch: abstr.owner.to_string(),
},
}),
namespace: None,
name: Some("test".to_string()),
description: None,
@@ -331,9 +333,9 @@ mod actual_signature {
&InstantiateMsg {
code_id,
account_id: None,
owner: GovernanceDetails::AbstractAccount {
owner: Some(GovernanceDetails::AbstractAccount {
address: account_addr.clone(),
},
}),
namespace: None,
install_modules: vec![],
name: None,
10 changes: 6 additions & 4 deletions framework/contracts/native/ibc-host/src/account_commands.rs
Original file line number Diff line number Diff line change
@@ -58,10 +58,12 @@ pub fn receive_register(

let create_account_msg = account::InstantiateMsg::<cosmwasm_std::Empty> {
code_id,
owner: abstract_std::objects::gov_type::GovernanceDetails::External {
governance_address: env.contract.address.into_string(),
governance_type: "abstract-ibc".into(), // at least 4 characters
},
owner: Some(
abstract_std::objects::gov_type::GovernanceDetails::External {
governance_address: env.contract.address.into_string(),
governance_type: "abstract-ibc".into(), // at least 4 characters
},
),
name,
description,
link,
5 changes: 4 additions & 1 deletion framework/packages/abstract-client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -22,7 +22,6 @@ interchain = ["dep:cw-orch-interchain", "abstract-interface/interchain"]
test-utils = ["cw20", "cw20-base", "cw-plus-interface", "abstract-interface/testing"]

[dependencies]
abstract-interface = { workspace = true }
abstract-std.workspace = true
cosmwasm-std.workspace = true
cw-asset = { workspace = true }
@@ -42,6 +41,10 @@ cw20-base = { version = "2.0.0", optional = true }
# For random account seq
rand = { version = "0.8.5" }

# Keep this as a version and update when publishing new versions
# Default features only works on the workspace Cargo.toml, so using workspace = true is not possible here
abstract-interface = { path = "../../packages/abstract-interface", version = "0.26.0" }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
workspace-hack = { version = "0.1", path = "../../workspace-hack" }

2 changes: 1 addition & 1 deletion framework/packages/abstract-client/src/account.rs
Original file line number Diff line number Diff line change
@@ -529,7 +529,7 @@ impl<Chain: CwEnv> Account<Chain> {
.upgrade(vec![(
ModuleInfo::from_id(abstract_std::constants::ACCOUNT, version.clone())?,
Some(
to_json_binary(&abstract_std::account::MigrateMsg {})
to_json_binary(&abstract_std::account::MigrateMsg { code_id: None })
.map_err(Into::<CwOrchError>::into)?,
),
)])
Original file line number Diff line number Diff line change
@@ -348,7 +348,7 @@ impl<Chain: IbcQueryHandler, IBC: InterchainEnv<Chain>> RemoteAccount<Chain, IBC
let modules = vec![(
ModuleInfo::from_id(abstract_std::constants::ACCOUNT, version.clone())?,
Some(
to_json_binary(&abstract_std::account::MigrateMsg {})
to_json_binary(&abstract_std::account::MigrateMsg { code_id: None })
.map_err(Into::<CwOrchError>::into)?,
),
)];
2 changes: 1 addition & 1 deletion framework/packages/abstract-interface/src/account.rs
Original file line number Diff line number Diff line change
@@ -98,7 +98,7 @@ impl<Chain: CwEnv> AccountI<Chain> {
&InstantiateMsg::<Empty> {
code_id,
account_id: details.account_id.map(AccountId::local),
owner: governance_details,
owner: Some(governance_details),
namespace: details.namespace,
install_modules: details.install_modules,
name: Some(details.name),
Loading