foundry
foundry copied to clipboard
When deploying etherscan verifcation fails
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?
btw running the script without the verification part works fine and deploys all contracts withtin that script as expected
Where is your script file located ? It should be located inside the project as well iirc
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
deploy
is not a default project folder. Should be inside of script
.
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
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