diff --git a/leo/cli/commands/deploy.rs b/leo/cli/commands/deploy.rs index eac245f802..6d065f49c4 100644 --- a/leo/cli/commands/deploy.rs +++ b/leo/cli/commands/deploy.rs @@ -18,6 +18,7 @@ use super::*; use aleo_std::StorageMode; use dialoguer::{theme::ColorfulTheme, Confirm}; use leo_retriever::NetworkName; +use num_format::{Locale, ToFormattedString}; use snarkvm::{ circuit::{Aleo, AleoCanaryV0, AleoTestnetV0, AleoV0}, ledger::query::Query as SnarkVMQuery, @@ -121,14 +122,24 @@ fn handle_deploy, N: Network>( // Generate the deployment let deployment = package.deploy::(None)?; + let variables = deployment.num_combined_variables()?; + let constraints = deployment.num_combined_constraints()?; + // Check if the number of variables and constraints are within the limits. - if deployment.num_combined_variables()? > N::MAX_DEPLOYMENT_VARIABLES { + if variables > N::MAX_DEPLOYMENT_VARIABLES { return Err(CliError::variable_limit_exceeded(name, N::MAX_DEPLOYMENT_VARIABLES, network).into()); } - if deployment.num_combined_constraints()? > N::MAX_DEPLOYMENT_CONSTRAINTS { + if constraints > N::MAX_DEPLOYMENT_CONSTRAINTS { return Err(CliError::constraint_limit_exceeded(name, N::MAX_DEPLOYMENT_CONSTRAINTS, network).into()); } + // Print deployment summary + println!( + "📊 Deployment Summary:\n Total Variables: {:>10}\n Total Constraints: {:>10}", + variables.to_formatted_string(&Locale::en), + constraints.to_formatted_string(&Locale::en) + ); + let deployment_id = deployment.to_deployment_id()?; let store = ConsensusStore::>::open(StorageMode::Production)?;