Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(verify): improve err handling for unset etherscan api key #7673

Merged
merged 3 commits into from
Apr 15, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion crates/verify/src/bytecode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,11 @@ impl VerifyBytecodeArgs {
self.etherscan_opts.chain = Some(chain);
self.etherscan_opts.key =
config.get_etherscan_config_with_chain(Some(chain))?.map(|c| c.key);

// If etherscan key is not set, we can't proceed with etherscan verification
if self.etherscan_opts.key.is_none() {
yash-atreya marked this conversation as resolved.
Show resolved Hide resolved
eyre::bail!("Etherscan API key is required for verification");
}
// Create etherscan client
let etherscan = Client::new(chain, self.etherscan_opts.key.clone().unwrap())?;

Expand Down Expand Up @@ -170,7 +175,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(),
);
}

Expand Down
Loading