diff --git a/crates/starknet-devnet-core/src/error.rs b/crates/starknet-devnet-core/src/error.rs index f38f4250c..74c24b10f 100644 --- a/crates/starknet-devnet-core/src/error.rs +++ b/crates/starknet-devnet-core/src/error.rs @@ -21,7 +21,7 @@ pub enum Error { #[error("{0:?}")] ContractExecutionError(ErrorStack), #[error("Execution error in simulating transaction no. {failure_index}: {error_stack:?}")] - ContractExecutionErrorInSimulation { failure_index: u64, error_stack: ErrorStack }, + ContractExecutionErrorInSimulation { failure_index: usize, error_stack: ErrorStack }, #[error("Types error: {0}")] TypesError(#[from] starknet_types::error::Error), #[error("I/O error: {0}")] @@ -78,12 +78,6 @@ impl From for Error { } } -impl From for Error { - fn from(e: blockifier::transaction::errors::TransactionExecutionError) -> Self { - Self::ContractExecutionError(gen_tx_execution_error_trace(&e)) - } -} - #[derive(Debug, Error)] pub enum StateError { #[error("No class hash {0:x} found")] @@ -124,7 +118,7 @@ impl From for Error { TransactionExecutionError::ValidateTransactionError { .. } => { TransactionValidationError::ValidationFailure { reason: value.to_string() }.into() } - other => Self::BlockifierTransactionError(other), + other => Self::ContractExecutionError(gen_tx_execution_error_trace(&other)), } } } @@ -133,7 +127,7 @@ impl From for Error { fn from(value: FeeCheckError) -> Self { match value { FeeCheckError::MaxL1GasAmountExceeded { .. } | FeeCheckError::MaxFeeExceeded { .. } => { - TransactionValidationError::InsufficientMaxFee.into() + TransactionValidationError::InsufficientResourcesForValidate.into() } FeeCheckError::InsufficientFeeTokenBalance { .. } => { TransactionValidationError::InsufficientAccountBalance.into() @@ -149,7 +143,7 @@ impl From for Error { | TransactionFeeError::MaxFeeTooLow { .. } | TransactionFeeError::MaxL1GasPriceTooLow { .. } | TransactionFeeError::MaxL1GasAmountTooLow { .. } => { - TransactionValidationError::InsufficientMaxFee.into() + TransactionValidationError::InsufficientResourcesForValidate.into() } TransactionFeeError::MaxFeeExceedsBalance { .. } | TransactionFeeError::L1GasBoundsExceedBalance { .. } => { diff --git a/crates/starknet-devnet-core/src/starknet/add_declare_transaction.rs b/crates/starknet-devnet-core/src/starknet/add_declare_transaction.rs index aae1387ee..c230fa949 100644 --- a/crates/starknet-devnet-core/src/starknet/add_declare_transaction.rs +++ b/crates/starknet-devnet-core/src/starknet/add_declare_transaction.rs @@ -18,7 +18,7 @@ pub fn add_declare_transaction( broadcasted_declare_transaction: BroadcastedDeclareTransaction, ) -> DevnetResult<(TransactionHash, ClassHash)> { if broadcasted_declare_transaction.is_max_fee_zero_value() { - return Err(TransactionValidationError::InsufficientMaxFee.into()); + return Err(TransactionValidationError::InsufficientResourcesForValidate.into()); } if broadcasted_declare_transaction.is_only_query() { @@ -219,7 +219,9 @@ mod tests { assert!(result.is_err()); match result.err().unwrap() { - Error::TransactionValidationError(TransactionValidationError::InsufficientMaxFee) => {} + Error::TransactionValidationError( + TransactionValidationError::InsufficientResourcesForValidate, + ) => {} _ => panic!("Wrong error type"), } } @@ -242,7 +244,9 @@ mod tests { assert!(result.is_err()); match result.err().unwrap() { - Error::TransactionValidationError(TransactionValidationError::InsufficientMaxFee) => {} + Error::TransactionValidationError( + TransactionValidationError::InsufficientResourcesForValidate, + ) => {} _ => panic!("Wrong error type"), } } @@ -383,7 +387,9 @@ mod tests { assert!(result.is_err()); match result.err().unwrap() { - Error::TransactionValidationError(TransactionValidationError::InsufficientMaxFee) => {} + Error::TransactionValidationError( + TransactionValidationError::InsufficientResourcesForValidate, + ) => {} _ => panic!("Wrong error type"), } } diff --git a/crates/starknet-devnet-core/src/starknet/add_deploy_account_transaction.rs b/crates/starknet-devnet-core/src/starknet/add_deploy_account_transaction.rs index be7f71aed..71d32c429 100644 --- a/crates/starknet-devnet-core/src/starknet/add_deploy_account_transaction.rs +++ b/crates/starknet-devnet-core/src/starknet/add_deploy_account_transaction.rs @@ -16,7 +16,7 @@ pub fn add_deploy_account_transaction( broadcasted_deploy_account_transaction: BroadcastedDeployAccountTransaction, ) -> DevnetResult<(TransactionHash, ContractAddress)> { if broadcasted_deploy_account_transaction.is_max_fee_zero_value() { - return Err(TransactionValidationError::InsufficientMaxFee.into()); + return Err(TransactionValidationError::InsufficientResourcesForValidate.into()); } if broadcasted_deploy_account_transaction.is_only_query() { @@ -155,7 +155,9 @@ mod tests { assert!(result.is_err()); match result.err().unwrap() { - Error::TransactionValidationError(TransactionValidationError::InsufficientMaxFee) => {} + Error::TransactionValidationError( + TransactionValidationError::InsufficientResourcesForValidate, + ) => {} _ => panic!("Wrong error type"), } } @@ -172,7 +174,9 @@ mod tests { )) .unwrap_err(); match txn_err { - Error::TransactionValidationError(TransactionValidationError::InsufficientMaxFee) => {} + Error::TransactionValidationError( + TransactionValidationError::InsufficientResourcesForValidate, + ) => {} _ => panic!("Wrong error type"), } } diff --git a/crates/starknet-devnet-core/src/starknet/add_invoke_transaction.rs b/crates/starknet-devnet-core/src/starknet/add_invoke_transaction.rs index 96d17c785..aa1028336 100644 --- a/crates/starknet-devnet-core/src/starknet/add_invoke_transaction.rs +++ b/crates/starknet-devnet-core/src/starknet/add_invoke_transaction.rs @@ -15,7 +15,7 @@ pub fn add_invoke_transaction( broadcasted_invoke_transaction: BroadcastedInvokeTransaction, ) -> DevnetResult { if broadcasted_invoke_transaction.is_max_fee_zero_value() { - return Err(TransactionValidationError::InsufficientMaxFee.into()); + return Err(TransactionValidationError::InsufficientResourcesForValidate.into()); } if broadcasted_invoke_transaction.is_only_query() { @@ -207,7 +207,9 @@ mod tests { .expect_err("Expected MaxFeeZeroError"); match invoke_v3_txn_error { - Error::TransactionValidationError(TransactionValidationError::InsufficientMaxFee) => {} + Error::TransactionValidationError( + TransactionValidationError::InsufficientResourcesForValidate, + ) => {} _ => panic!("Wrong error type"), } } @@ -277,7 +279,7 @@ mod tests { assert!(transaction.is_err()); match transaction.err().unwrap() { Error::TransactionValidationError( - TransactionValidationError::InsufficientMaxFee, + TransactionValidationError::InsufficientResourcesForValidate, ) => {} _ => { panic!("Wrong error type") @@ -379,7 +381,9 @@ mod tests { assert!(result.is_err()); match result.err().unwrap() { - Error::TransactionValidationError(TransactionValidationError::InsufficientMaxFee) => {} + Error::TransactionValidationError( + TransactionValidationError::InsufficientResourcesForValidate, + ) => {} _ => panic!("Wrong error type"), } } diff --git a/crates/starknet-devnet-core/src/starknet/estimations.rs b/crates/starknet-devnet-core/src/starknet/estimations.rs index 97213826f..c7aba161a 100644 --- a/crates/starknet-devnet-core/src/starknet/estimations.rs +++ b/crates/starknet-devnet-core/src/starknet/estimations.rs @@ -56,13 +56,11 @@ pub fn estimate_fee( blockifier::transaction::transaction_execution::Transaction::AccountTransaction(tx), charge_fee, validate, + return_error_on_reverted_execution, ) .map_err(|e| match e { Error::ContractExecutionError(error_stack) => { - Error::ContractExecutionErrorInSimulation { - failure_index: tx_i as u64, - error_stack, - } + Error::ContractExecutionErrorInSimulation { failure_index: tx_i, error_stack } } other => other, })?; diff --git a/crates/starknet-devnet-core/src/starknet/mod.rs b/crates/starknet-devnet-core/src/starknet/mod.rs index 25a2b8bfc..f1d2a0b12 100644 --- a/crates/starknet-devnet-core/src/starknet/mod.rs +++ b/crates/starknet-devnet-core/src/starknet/mod.rs @@ -7,9 +7,7 @@ use blockifier::execution::entry_point::CallEntryPoint; use blockifier::state::cached_state::CachedState; use blockifier::state::state_api::StateReader; use blockifier::transaction::account_transaction::AccountTransaction; -use blockifier::transaction::errors::{ - TransactionExecutionError, TransactionFeeError, TransactionPreValidationError, -}; +use blockifier::transaction::errors::TransactionExecutionError; use blockifier::transaction::objects::TransactionExecutionInfo; use blockifier::transaction::transactions::ExecutableTransaction; use ethers::types::H256; @@ -73,7 +71,7 @@ use crate::error::{DevnetResult, Error, TransactionValidationError}; use crate::messaging::MessagingBroker; use crate::predeployed_accounts::PredeployedAccounts; use crate::raw_execution::RawExecutionV1; -use crate::stack_trace::gen_tx_execution_error_trace; +use crate::stack_trace::{gen_tx_execution_error_trace, ErrorStack}; use crate::state::state_diff::StateDiff; use crate::state::{CommittedClassStorage, CustomState, CustomStateReader, StarknetState}; use crate::traits::{AccountGenerator, Deployed, HashIdentified, HashIdentifiedMut}; @@ -447,12 +445,12 @@ impl Starknet { let chain_info = ChainInfo { chain_id: chain_id.into(), fee_token_addresses: blockifier::context::FeeTokenAddresses { - eth_fee_token_address: contract_address!(eth_fee_token_address - .to_hex_string() - .as_str()), - strk_fee_token_address: contract_address!(strk_fee_token_address - .to_hex_string() - .as_str()), + eth_fee_token_address: contract_address!( + eth_fee_token_address.to_hex_string().as_str() + ), + strk_fee_token_address: contract_address!( + strk_fee_token_address.to_hex_string().as_str() + ), }, }; @@ -1121,16 +1119,18 @@ impl Starknet { transactions .iter() .enumerate() - .map(|(idx, txn)| { + .map(|(tx_idx, txn)| { // According to this conversation https://spaceshard.slack.com/archives/C03HL8DH52N/p1710683496750409, simulating a transaction will: // fail if the fee provided is 0 // succeed if the fee provided is 0 and SKIP_FEE_CHARGE is set // succeed if the fee provided is > 0 if txn.is_max_fee_zero_value() && !skip_fee_charge { - return Err(Error::ExecutionError { - execution_error: TransactionValidationError::InsufficientMaxFee - .to_string(), - index: idx, + return Err(Error::ContractExecutionErrorInSimulation { + failure_index: tx_idx, + error_stack: ErrorStack::from_str_err( + &TransactionValidationError::InsufficientResourcesForValidate + .to_string(), + ), }); } @@ -1150,7 +1150,7 @@ impl Starknet { let mut transactional_state = CachedState::new(CachedState::create_transactional(&mut state.state)); - for (tx_i, (blockifier_tx, transaction_type, skip_validate_due_to_impersonation)) in + for (tx_idx, (blockifier_tx, transaction_type, skip_validate_due_to_impersonation)) in blockifier_transactions.into_iter().enumerate() { let tx_execution_info = blockifier_tx @@ -1161,7 +1161,7 @@ impl Starknet { !(skip_validate || skip_validate_due_to_impersonation), ) .map_err(|e| Error::ContractExecutionErrorInSimulation { - failure_index: tx_i as u64, + failure_index: tx_idx, error_stack: gen_tx_execution_error_trace(&e), })?; diff --git a/crates/starknet-devnet-server/src/api/json_rpc/error.rs b/crates/starknet-devnet-server/src/api/json_rpc/error.rs index abde3d285..1b119da65 100644 --- a/crates/starknet-devnet-server/src/api/json_rpc/error.rs +++ b/crates/starknet-devnet-server/src/api/json_rpc/error.rs @@ -29,7 +29,7 @@ pub enum ApiError { #[error("Contract error")] ContractError { error_stack: ErrorStack }, #[error("Transaction execution error")] - TransactionExecutionError { failure_index: u64, error_stack: ErrorStack }, + TransactionExecutionError { failure_index: usize, error_stack: ErrorStack }, #[error("There are no blocks")] NoBlocks, #[error("Requested page size is too big")] @@ -62,8 +62,6 @@ pub enum ApiError { HttpApiError(#[from] HttpApiError), #[error("the compiled class hash did not match the one supplied in the transaction")] CompiledClassHashMismatch, - #[error("Transaction execution error")] - ExecutionError { execution_error: String, index: usize }, } impl ApiError { @@ -206,14 +204,6 @@ impl ApiError { message: error_message.into(), data: None, }, - ApiError::ExecutionError { execution_error, index } => RpcError { - code: crate::rpc_core::error::ErrorCode::ServerError(41), - message: error_message.into(), - data: Some(json!({ - "transaction_index": index, - "execution_error": execution_error - })), - }, ApiError::HttpApiError(http_api_error) => http_api_error.http_api_error_to_rpc_error(), } } diff --git a/crates/starknet-devnet/tests/common/utils.rs b/crates/starknet-devnet/tests/common/utils.rs index 4f6d56aa8..5d604e2e5 100644 --- a/crates/starknet-devnet/tests/common/utils.rs +++ b/crates/starknet-devnet/tests/common/utils.rs @@ -242,7 +242,7 @@ impl Drop for UniqueAutoDeletableFile { /// Deploys an instance of the class whose sierra hash is provided as `class_hash`. Uses a v1 invoke /// transaction. Returns the address of the newly deployed contract. pub async fn deploy_v1( - account: Arc, LocalWallet>>, + account: &SingleOwnerAccount<&JsonRpcClient, LocalWallet>, class_hash: Felt, ctor_args: &[Felt], ) -> Result { diff --git a/crates/starknet-devnet/tests/test_call.rs b/crates/starknet-devnet/tests/test_call.rs index ca4c3637f..dfc18a2b6 100644 --- a/crates/starknet-devnet/tests/test_call.rs +++ b/crates/starknet-devnet/tests/test_call.rs @@ -2,7 +2,6 @@ pub mod common; mod call { - use std::sync::Arc; use starknet_core::constants::{CAIRO_1_ERC20_CONTRACT_CLASS_HASH, ETH_ERC20_CONTRACT_ADDRESS}; use starknet_rs_accounts::SingleOwnerAccount; @@ -17,7 +16,7 @@ mod call { CAIRO_1_PANICKING_CONTRACT_SIERRA_PATH, PREDEPLOYED_ACCOUNT_ADDRESS, }; use crate::common::utils::{ - assert_json_rpc_errors_equal, declare_deploy_v1, deploy_v1, extract_json_rpc_error, + assert_json_rpc_errors_equal, declare_v3_deploy_v3, deploy_v1, extract_json_rpc_error, get_flattened_sierra_contract_and_casm_hash, }; @@ -88,20 +87,20 @@ mod call { let devnet = BackgroundDevnet::spawn().await.unwrap(); let (signer, account_address) = devnet.get_first_predeployed_account().await; - let account = Arc::new(SingleOwnerAccount::new( - devnet.clone_provider(), + let account = SingleOwnerAccount::new( + &devnet.json_rpc_client, signer, account_address, devnet.json_rpc_client.chain_id().await.unwrap(), starknet_rs_accounts::ExecutionEncoding::New, - )); + ); let (contract_class, casm_hash) = get_flattened_sierra_contract_and_casm_hash(CAIRO_1_PANICKING_CONTRACT_SIERRA_PATH); let (class_hash, contract_address) = - declare_deploy_v1(account.clone(), contract_class, casm_hash, &[]).await.unwrap(); - let other_contract_address = deploy_v1(account, class_hash, &[]).await.unwrap(); + declare_v3_deploy_v3(&account, contract_class, casm_hash, &[]).await.unwrap(); + let other_contract_address = deploy_v1(&account, class_hash, &[]).await.unwrap(); let top_selector = get_selector_from_name("create_panic_in_another_contract").unwrap(); let panic_message = cairo_short_string_to_felt("funny_text").unwrap(); diff --git a/crates/starknet-devnet/tests/test_estimate_fee.rs b/crates/starknet-devnet/tests/test_estimate_fee.rs index 4e69f5572..3e7af63af 100644 --- a/crates/starknet-devnet/tests/test_estimate_fee.rs +++ b/crates/starknet-devnet/tests/test_estimate_fee.rs @@ -680,8 +680,8 @@ mod estimate_fee_tests { } #[tokio::test] - async fn estimate_fee_of_declare_and_deploy_via_udc_returns_index_of_second_transaction_when_executed_with_non_existing_method( - ) { + async fn estimate_fee_of_declare_and_deploy_via_udc_returns_index_of_second_transaction_when_executed_with_non_existing_method() + { let devnet = BackgroundDevnet::spawn().await.expect("Could not start devnet"); // get account @@ -779,8 +779,8 @@ mod estimate_fee_tests { } #[tokio::test] - async fn estimate_fee_of_multiple_failing_txs_should_return_index_of_the_first_failing_transaction( - ) { + async fn estimate_fee_of_multiple_failing_txs_should_return_index_of_the_first_failing_transaction() + { let devnet = BackgroundDevnet::spawn().await.expect("Could not start devnet"); // get account diff --git a/crates/starknet-devnet/tests/test_old_state.rs b/crates/starknet-devnet/tests/test_old_state.rs index 59d2ff0d0..9d02c89a1 100644 --- a/crates/starknet-devnet/tests/test_old_state.rs +++ b/crates/starknet-devnet/tests/test_old_state.rs @@ -114,8 +114,8 @@ mod old_state { // estimate fee of invoke transaction that reverts must fail, but simulating the same invoke // transaction have to produce trace of a reverted transaction #[tokio::test] - async fn estimate_fee_and_simulate_transaction_for_contract_deployment_in_an_old_block_should_not_produce_the_same_error( - ) { + async fn estimate_fee_and_simulate_transaction_for_contract_deployment_in_an_old_block_should_not_produce_the_same_error() + { let devnet = BackgroundDevnet::spawn_with_additional_args(&["--state-archive-capacity", "full"]) .await diff --git a/crates/starknet-devnet/tests/test_simulate_transactions.rs b/crates/starknet-devnet/tests/test_simulate_transactions.rs index 88bedaf6a..f13d857e9 100644 --- a/crates/starknet-devnet/tests/test_simulate_transactions.rs +++ b/crates/starknet-devnet/tests/test_simulate_transactions.rs @@ -485,19 +485,19 @@ mod simulation_tests { let devnet = BackgroundDevnet::spawn().await.unwrap(); let (signer, account_address) = devnet.get_first_predeployed_account().await; - let account = Arc::new(SingleOwnerAccount::new( - devnet.clone_provider(), + let account = SingleOwnerAccount::new( + &devnet.json_rpc_client, signer.clone(), account_address, devnet.json_rpc_client.chain_id().await.unwrap(), starknet_rs_accounts::ExecutionEncoding::New, - )); + ); let (contract_class, casm_hash) = get_flattened_sierra_contract_and_casm_hash(CAIRO_1_PANICKING_CONTRACT_SIERRA_PATH); let (_, contract_address) = - declare_deploy_v1(account.clone(), contract_class, casm_hash, &[]).await.unwrap(); + declare_v3_deploy_v3(&account, contract_class, casm_hash, &[]).await.unwrap(); let top_selector = get_selector_from_name("create_panic").unwrap(); let panic_message_text = "funny_text"; @@ -745,8 +745,8 @@ mod simulation_tests { } #[tokio::test] - async fn simulate_with_max_fee_exceeding_account_balance_returns_error_if_fee_charge_is_not_skipped( - ) { + async fn simulate_with_max_fee_exceeding_account_balance_returns_error_if_fee_charge_is_not_skipped() + { let devnet = BackgroundDevnet::spawn().await.expect("Could not start Devnet"); let (sierra_artifact, casm_hash) = get_flattened_sierra_contract_and_casm_hash(CAIRO_1_PANICKING_CONTRACT_SIERRA_PATH); @@ -787,8 +787,8 @@ mod simulation_tests { } #[tokio::test] - async fn simulate_v3_with_skip_fee_charge_deploy_account_declare_deploy_via_invoke_to_udc_happy_path( - ) { + async fn simulate_v3_with_skip_fee_charge_deploy_account_declare_deploy_via_invoke_to_udc_happy_path() + { let devnet = BackgroundDevnet::spawn_with_additional_args(&["--account-class", "cairo1"]) .await .expect("Could not start Devnet"); @@ -948,8 +948,8 @@ mod simulation_tests { } #[tokio::test] - async fn simulate_invoke_v3_with_fee_just_below_estimated_should_return_a_trace_of_reverted_transaction( - ) { + async fn simulate_invoke_v3_with_fee_just_below_estimated_should_return_a_trace_of_reverted_transaction() + { let devnet = BackgroundDevnet::spawn().await.expect("Could not start Devnet"); let (sierra_artifact, casm_hash) = get_flattened_sierra_contract_and_casm_hash(CAIRO_1_PANICKING_CONTRACT_SIERRA_PATH); @@ -996,8 +996,8 @@ mod simulation_tests { } #[tokio::test] - async fn simulate_invoke_declare_deploy_account_with_either_gas_or_gas_price_set_to_zero_or_both_will_revert_if_skip_fee_charge_is_not_set( - ) { + async fn simulate_invoke_declare_deploy_account_with_either_gas_or_gas_price_set_to_zero_or_both_will_revert_if_skip_fee_charge_is_not_set() + { let devnet = BackgroundDevnet::spawn_with_additional_args(&["--account-class", "cairo1"]) .await .expect("Could not start Devnet"); @@ -1138,8 +1138,8 @@ mod simulation_tests { } #[tokio::test] - async fn simulate_invoke_v3_with_failing_execution_should_return_a_trace_of_reverted_transaction( - ) { + async fn simulate_invoke_v3_with_failing_execution_should_return_a_trace_of_reverted_transaction() + { let devnet = BackgroundDevnet::spawn().await.expect("Could not start Devnet"); let (sierra_artifact, casm_hash) = get_flattened_sierra_contract_and_casm_hash(CAIRO_1_PANICKING_CONTRACT_SIERRA_PATH); @@ -1181,8 +1181,8 @@ mod simulation_tests { /// Test with lower than (estimated_gas_units * gas_price) using two flags. With /// skip_fee_transfer shouldnt fail, without it should fail. #[tokio::test] - async fn simulate_declare_v3_with_less_than_estimated_fee_should_revert_if_fee_charge_is_not_skipped( - ) { + async fn simulate_declare_v3_with_less_than_estimated_fee_should_revert_if_fee_charge_is_not_skipped() + { let devnet = BackgroundDevnet::spawn().await.expect("Could not start Devnet"); let (sierra_artifact, casm_hash) = get_simple_contract_in_sierra_and_compiled_class_hash(); diff --git a/crates/starknet-devnet/tests/test_transaction_handling.rs b/crates/starknet-devnet/tests/test_transaction_handling.rs index ffc049ee5..aa2a95cd5 100644 --- a/crates/starknet-devnet/tests/test_transaction_handling.rs +++ b/crates/starknet-devnet/tests/test_transaction_handling.rs @@ -17,7 +17,7 @@ mod trace_tests { CAIRO_1_PANICKING_CONTRACT_SIERRA_PATH, CHAIN_ID, INVALID_ACCOUNT_SIERRA_PATH, }; use crate::common::utils::{ - declare_deploy_v1, get_flattened_sierra_contract_and_casm_hash, + declare_v3_deploy_v3, get_flattened_sierra_contract_and_casm_hash, get_simple_contract_in_sierra_and_compiled_class_hash, }; @@ -92,19 +92,19 @@ mod trace_tests { let devnet = BackgroundDevnet::spawn().await.unwrap(); let (signer, account_address) = devnet.get_first_predeployed_account().await; - let account = Arc::new(SingleOwnerAccount::new( - devnet.clone_provider(), + let account = SingleOwnerAccount::new( + &devnet.json_rpc_client, signer, account_address, CHAIN_ID, ExecutionEncoding::New, - )); + ); let (sierra, casm_hash) = get_flattened_sierra_contract_and_casm_hash(CAIRO_1_PANICKING_CONTRACT_SIERRA_PATH); let (_, contract_address) = - declare_deploy_v1(account.clone(), sierra, casm_hash, &[]).await.unwrap(); + declare_v3_deploy_v3(&account, sierra, casm_hash, &[]).await.unwrap(); let InvokeTransactionResult { transaction_hash } = account .execute_v1(vec![Call {