diff --git a/crates/verify/src/bytecode.rs b/crates/verify/src/bytecode.rs index f801ff7715e5..d84acbccc998 100644 --- a/crates/verify/src/bytecode.rs +++ b/crates/verify/src/bytecode.rs @@ -135,8 +135,12 @@ impl VerifyBytecodeArgs { self.etherscan_opts.chain = Some(chain); self.etherscan_opts.key = config.get_etherscan_config_with_chain(Some(chain))?.map(|c| c.key); - // Create etherscan client - let etherscan = Client::new(chain, self.etherscan_opts.key.clone().unwrap())?; + + // If etherscan key is not set, we can't proceed with etherscan verification + let Some(key) = self.etherscan_opts.key.clone() else { + eyre::bail!("Etherscan API key is required for verification"); + }; + let etherscan = Client::new(chain, key)?; // Get the constructor args using `source_code` endpoint let source_code = etherscan.contract_source_code(self.address).await?; @@ -170,7 +174,7 @@ impl VerifyBytecodeArgs { if provided_constructor_args != constructor_args.to_string() && !self.json { println!( "{}", - Paint::red("The provider constructor args do not match the constructor args from etherscan. This will result in a mismatch - Using the args from etherscan").bold(), + Paint::red("The provided constructor args do not match the constructor args from etherscan. This will result in a mismatch - Using the args from etherscan").bold(), ); }