diff --git a/crates/sozo/ops/src/migration/migrate.rs b/crates/sozo/ops/src/migration/migrate.rs index 9142847b59..3585eb2f03 100644 --- a/crates/sozo/ops/src/migration/migrate.rs +++ b/crates/sozo/ops/src/migration/migrate.rs @@ -694,17 +694,14 @@ where format!("deploy {}", contract.diff.name) } -pub async fn print_strategy

(ui: &Ui, provider: &P, strategy: &MigrationStrategy, world_address: FieldElement, contract: &ContractMigration, base_class_hash: FieldElement) +pub async fn print_strategy

(ui: &Ui, provider: &P, strategy: &MigrationStrategy) where P: Provider + Sync + Send + 'static, { - - let contract_address = - get_contract_address(contract.salt, base_class_hash, &[], world_address); - ui.print("\nšŸ“‹ Migration Strategy\n"); - ui.print_sub(format!("World address: {:#x})\n", world_address)); - ui.print_sub(format!("Contract address: {:#x})\n", contract_address)); + if let Some(world) = &strategy.world { + ui.print_sub(format!("declare (contract address: {:#x})\n", world.contract_address)); + } if let Some(base) = &strategy.base { ui.print_header("# Base Contract"); @@ -714,7 +711,6 @@ where if let Some(world) = &strategy.world { ui.print_header("# World"); ui.print_sub(format!("declare (class hash: {:#x})\n", world.diff.local_class_hash)); - ui.print_sub(format!("declare (contract address: {:#x})\n", world.contract_address)); } if !&strategy.models.is_empty() { @@ -733,6 +729,8 @@ where for c in &strategy.contracts { let op_name = get_contract_operation_name(provider, c, strategy.world_address).await; ui.print_sub(format!("{op_name} (class hash: {:#x})", c.diff.local_class_hash)); + let contract_address = get_contract_address(c.salt, c.diff.base_class_hash, &[], c.contract_address); + ui.print_sub(format!("{op_name} (contract address: {:#x})", contract_address)); } ui.print(" "); } diff --git a/crates/sozo/ops/src/migration/mod.rs b/crates/sozo/ops/src/migration/mod.rs index 7edaa75e87..b5f478202d 100644 --- a/crates/sozo/ops/src/migration/mod.rs +++ b/crates/sozo/ops/src/migration/mod.rs @@ -5,7 +5,6 @@ use dojo_lang::compiler::MANIFESTS_DIR; use dojo_world::contracts::WorldContract; use dojo_world::migration::world::WorldDiff; use dojo_world::migration::{DeployOutput, TxnConfig, UpgradeOutput}; -use dojo_world::migration::contract::ContractMigration; use scarb::core::Workspace; use starknet::accounts::{ConnectedAccount, SingleOwnerAccount}; use starknet::core::types::FieldElement; @@ -53,8 +52,6 @@ pub async fn migrate( name: &str, dry_run: bool, txn_config: TxnConfig, - base_class_hash: FieldElement, - contract: &ContractMigration ) -> Result<()> where P: Provider + Sync + Send + 'static, @@ -100,7 +97,7 @@ where let world_address = strategy.world_address().expect("world address must exist"); if dry_run { - print_strategy(&ui, account.provider(), &strategy, world_address, contract, base_class_hash).await; + print_strategy(&ui, account.provider(), &strategy).await; update_manifests_and_abis( ws,