When I run the command "npx hardhat run scripts/deploy.js --network goerli" it gives me the error Error: insufficient funds for intrinsic transaction cost. More specifically looks like this:
- reason: 'insufficient funds for intrinsic transaction cost',
- code: 'INSUFFICIENT_FUNDS',
- error: ProviderError: insufficient funds for gas * price + value
When I deploy it without "--network goerli"" it deploys it to an static address apparently which allows to make tests but I am not sure if it is the correct way to do it .
On my metamask account I have 0.0193 GoerliETH .
Deploy.js file looks like this.
const main = async () => {
const transactionsFactory = await hre.ethers.getContractFactory("Transactions");
const transactionsContract = await transactionsFactory.deploy();
await transactionsContract.deployed();
console.log("Transactions address: ", transactionsContract.address);
};
const runMain = async () => {
try {
await main();
process.exit(0);
} catch (error) {
console.error(error);
process.exit(1);
}
};
runMain();
Hardhat.config.js looks like this where I specified the alchemy https and also the private key of my metamask account.
require('@nomiclabs/hardhat-waffle');
module.exports={
solidity:'0.8.0',
networks:{
goerli:{
url:'xxx',
accounts:['xxx']
}
}
}