foundry icon indicating copy to clipboard operation
foundry copied to clipboard

When deploying etherscan verifcation fails

Open FredCoen opened this issue 2 years ago • 1 comments

Component

Forge

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

  • [ ] Foundry
  • [X] Foundryup

What version of Foundry are you on?

forge 0.2.0 (49f35c7 2022-06-30T00:06:55.326479Z)

What command(s) is the bug in?

forge script ./deploy/deploy.sol:DeployScript --sig "deploy()" \ -vvvvv --rpc-url $RPC_URL --private-key $PRIVATE_KEY $ETHERSCAN_KEY --broadcast --optimize --via-ir

Operating System

macOS (Apple Silicon)

Describe the bug

Getting the error “You can only verify deployments from inside a project! Make sure it exists with forge tree.”

This is odd, all my contracts that are deployed are within the project. Or a OZ submodule dependency. What am I supposed to be looking for here, or is this a bug?

FredCoen avatar Aug 07 '22 21:08 FredCoen

btw running the script without the verification part works fine and deploys all contracts withtin that script as expected

FredCoen avatar Aug 07 '22 21:08 FredCoen

Where is your script file located ? It should be located inside the project as well iirc

joshieDo avatar Aug 10 '22 11:08 joshieDo

hey @joshieDo i run the below from project root

@forge script ./deploy/deploy.sol:DeployScript --sig "deploy()" \
        -vvvvv  --rpc-url $(RPC_URL) --private-key $(PRIVATE_KEY) --verify --etherscan-api-key $ETHERSCAN_KEY --broadcast --optimize --via-ir --ffi

FredCoen avatar Aug 10 '22 12:08 FredCoen

deploy is not a default project folder. Should be inside of script.

joshieDo avatar Aug 10 '22 15:08 joshieDo

Closing since deploy is not a valid folder, feel free to ping if the issue persists after moving the script to either script or src

onbjerg avatar Aug 11 '22 18:08 onbjerg

yup thanks can confirm this works after moving to script folder. Thanks!

getting a different error now (see below), this a known issue or should i open seperate ticket?

i run the following command:

public-deploy: @forge script ./script/deploy.sol:DeployScript --sig "deploy()" \ -vvvvv --rpc-url $(RPC_URL) --private-key $(PRIVATE_KEY) --broadcast --optimize --via-ir --ffi --verify --etherscan-api-key $(ETHERSCAN_KEY)

Error: Etherscan could not detect the deployment. make: *** [public-deploy] Error 1

FredCoen avatar Aug 12 '22 07:08 FredCoen