Create a script that deploys a sample contract to the network
When executing the script, the --network tag is ignored and the network being used is always the one defined as defaultNetwork in the hardhat.config file.
If defaultNetwork: 'previewnet', is set in the hardhat.config file, the scripts are always using the previewnet network.
Excpectation
When running the script:
npx hardhat deploy --network local
I would expect that the used network is local and not previewnet
previewnet
,testnet
,local
f.e). Example config:--network
tag is ignored and the network being used is always the one defined asdefaultNetwork
in thehardhat.config
file.If
defaultNetwork: 'previewnet',
is set in thehardhat.config
file, the scripts are always using thepreviewnet
network.Excpectation When running the script:
I would expect that the used network is
local
and notpreviewnet