Hello,
Im deploying my smart contract to main net and I've loaded my ethereum account with 0.0303
ETH but I get this error:
viktor@debian:~/openzeppelin-contracts-4.5.0$ npx hardhat run --network mainnet scripts/deploy.js
Deploying Box...
Error: insufficient funds for intrinsic transaction cost (error={"name":"ProviderError","code":-32000,"_isProviderError":true}, method="sendTransaction", transaction=undefined, code=INSUFFICIENT_FUNDS, version=providers/5.5.3)
at Logger.makeError (/home/viktor/openzeppelin-contracts-4.5.0/node_modules/@ethersproject/logger/src.ts/index.ts:225:28)
at Logger.throwError (/home/viktor/openzeppelin-contracts-4.5.0/node_modules/@ethersproject/logger/src.ts/index.ts:237:20)
at checkError (/home/viktor/openzeppelin-contracts-4.5.0/node_modules/@ethersproject/providers/src.ts/json-rpc-provider.ts:53:16)
at /home/viktor/openzeppelin-contracts-4.5.0/node_modules/@ethersproject/providers/src.ts/json-rpc-provider.ts:215:24
at processTicksAndRejections (internal/process/task_queues.js:97:5) {
reason: 'insufficient funds for intrinsic transaction cost',
code: 'INSUFFICIENT_FUNDS',
error: ProviderError: insufficient funds for gas * price + value
at HttpProvider.request (/home/viktor/openzeppelin-contracts-4.5.0/node_modules/hardhat/src/internal/core/providers/http.ts:49:19)
at HDWalletProvider.request (/home/viktor/openzeppelin-contracts-4.5.0/node_modules/hardhat/src/internal/core/providers/accounts.ts:182:36)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at EthersProviderWrapper.send (/home/viktor/openzeppelin-contracts-4.5.0/node_modules/@nomiclabs/hardhat-ethers/src/internal/ethers-provider-wrapper.ts:13:20),
method: 'sendTransaction',
transaction: undefined
}
npm ERR! code 1
npm ERR! path /home/viktor/openzeppelin-contracts-4.5.0
npm ERR! command failed
npm ERR! command sh -c hardhat "run" "--network" "mainnet" "scripts/deploy.js"
npm ERR! A complete log of this run can be found in:
npm ERR! /home/viktor/.npm/_logs/2022-02-15T21_13_13_034Z-debug.log
This is my deploy script:
// scripts/deploy.js
async function main () {
// We get the contract to deploy
const Box = await ethers.getContractFactory('SpaceRace');
console.log('Deploying Box...');
const box = await Box.deploy();
await box.deployed();
console.log('Box deployed to:', box.address);
}
main()
.then(() => process.exit(0))
.catch(error => {
console.error(error);
process.exit(1);
});
Can you help me to define the transaction cost to a lower level so that my account has enough ?
Thank you very much,
Viktor
Code to reproduce