smartcontractkit / hardhat-starter-kit

A repo for boilerplate code for testing, deploying, and shipping chainlink solidity code.
MIT License
1.2k stars 491 forks source link

Failed to deploy to different networks than default #172

Open bvdaniel opened 10 months ago

bvdaniel commented 10 months ago

Testing the repo and using env variables for mumbai and polygon RPCs, together with the polygonscan api key, I'm getting this when trying to deploy to another network:

hardhat-starter-kit@2.0.0 deploy hardhat run scripts/deployment/main.js mumbai

Error HH308: Unrecognized positional argument mumbai

Happens the same with sepolia and polygon. Circled it around by changing the defaut network on hardhat.config to deploy on polygon or mumbai. Compiling and testing works ok.

image
mscurtescu commented 7 months ago

It looks like --network is a hardhat specific flag and yarn, npx or npm will not recognise it .

You can run the deploy script through hardhat and then it works:

hardhat run scripts/deployment/main.js --network localhost

I think that the README should be fixed to reflect this, I run into this issue with a few other commands.