diff --git a/crates/cli/src/utils/cmd.rs b/crates/cli/src/utils/cmd.rs index ab61f0f6cc498..b8b7bf37d1c07 100644 --- a/crates/cli/src/utils/cmd.rs +++ b/crates/cli/src/utils/cmd.rs @@ -22,10 +22,10 @@ use std::{ }; use yansi::Paint; -/// Given a `Project`'s output, removes the matching ABI, Bytecode and -/// Runtime Bytecode of the given contract. +/// Given a `Project`'s output, finds the contract by path and name and returns its +/// ABI, creation bytecode, and `ArtifactId`. #[track_caller] -pub fn remove_contract( +pub fn find_contract_artifacts( output: ProjectCompileOutput, path: &Path, name: &str, diff --git a/crates/cli/src/utils/mod.rs b/crates/cli/src/utils/mod.rs index 942fe6ae805b9..78e0f87d93e5d 100644 --- a/crates/cli/src/utils/mod.rs +++ b/crates/cli/src/utils/mod.rs @@ -630,7 +630,7 @@ ignore them in the `.gitignore` file." .map(|stdout| stdout.lines().any(|line| line.starts_with('-'))) } - /// Returns true if the given path has no submodules by checking `git submodule status` + /// Returns true if the given path has submodules by checking `git submodule status` pub fn has_submodules(self, paths: I) -> Result where I: IntoIterator, diff --git a/crates/forge/src/cmd/create.rs b/crates/forge/src/cmd/create.rs index 61c9d0dba180a..0187020721af1 100644 --- a/crates/forge/src/cmd/create.rs +++ b/crates/forge/src/cmd/create.rs @@ -14,7 +14,7 @@ use eyre::{Context, Result}; use forge_verify::{RetryArgs, VerifierArgs, VerifyArgs}; use foundry_cli::{ opts::{BuildOpts, EthereumOpts, EtherscanOpts, TransactionOpts}, - utils::{self, LoadConfig, read_constructor_args_file, remove_contract}, + utils::{self, LoadConfig, find_contract_artifacts, read_constructor_args_file}, }; use foundry_common::{ compile::{self}, @@ -123,7 +123,7 @@ impl CreateArgs { let output = compile::compile_target(&target_path, &project, shell::is_json())?; - let (abi, bin, id) = remove_contract(output, &target_path, &self.contract.name)?; + let (abi, bin, id) = find_contract_artifacts(output, &target_path, &self.contract.name)?; let bin = match bin.object { BytecodeObject::Bytecode(_) => bin.object,