foundry-rs / foundry

Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.
https://getfoundry.sh
Apache License 2.0
8.1k stars 1.67k forks source link

--verify should prompt for Etherscan API key #3815

Closed arjunblj closed 1 month ago

arjunblj commented 1 year ago

Component

Forge

Have you ensured that all of these are up to date?

What version of Foundry are you on?

forge 0.2.0 (6174975 2022-11-30T00:15:57.020771Z)

What command(s) is the bug in?

forge script

Operating System

macOS (Apple Silicon)

Describe the bug

forge script --verify silently fails without verifying a contract deployment when the user does not provide an Etherscan API key. Foundry should prompt the user to provide an Etherscan API key if the --verify flag is used.

iFrostizz commented 1 year ago

Should we prompt for a key or more simply return an error like "No key provided for verifying the contract" ?

zerosnacks commented 1 month ago

Now prompts when running forge script script/Counter.s.sol --verify --broadcast --rpc-url <RPC_URL> without an Etherscan API key set:

Error: 
Missing etherscan key for chain 17000

This errors before an actual deployment is done