Can't deploy contract to Rinkeby but only hardhat #339
-
When I deploy the contract with deploy.js on hardhat, it automatically does hardhat but when I force it to do rinkeby by making the default network rinkeby instead of hardhat and have my .env and everything set up, it tells me
Here is my hardhat config file:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
leave default hardhat and deploy with --network rinkeby flag uncomment
or
|
Beta Was this translation helpful? Give feedback.
-
@rileymross you have commented out the default network that was hardhat. So if you comment on the default network it will still be hardhat by default. The error is saying that it is a Type error in the URL, you should try this: module.exports = {
solidity: "0.8.8",
defaultNetwork: "rinkeby",
networks: {
rinkeby: {
url: process.env.RINKEBY_RPC_URL,
accounts: [process.env.PRIVATE_KEY],
chainId: 4,
},
},
etherscan: {
apiKey: process.env.ETHERSCAN_API_KEY,
},
} |
Beta Was this translation helpful? Give feedback.
@rileymross you have commented out the default network that was hardhat. So if you comment on the default network it will still be hardhat by default.
The error is saying that it is a Type error in the URL, you should try this: