ProviderError: insufficient funds for gas * price + value: balance 0, tx cost 5565648, overshot 5565648 #6260
Unanswered
tahri19younes98
asked this question in
Q&A
Replies: 1 comment
-
Hello @tahri19younes98 First of all please read this course guide on how to format questions properly. Regarding your question you are having issue because you are either using incorrect network/wallet/contract addresses or you simply do not have enough ETH to pay for transaction. There is no other reason for such error. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
const {ethers,run,network}=require("hardhat");
async function main() {
const SimpleStorageFactory = await ethers.getContractFactory("SimpleStorage")
console.log("Deploying contract...")
const simpleStorage = await SimpleStorageFactory.deploy()
//await simpleStorage.deployed()
await simpleStorage.waitForDeployment()
console.log(
Deployed contract to: ${simpleStorage.target}
)if (network.config.chainId === 11155111 && process.env.ETHERSCAN_API_KEY) {
console.log("Waiting for block confirmations...")
// await simpleStorage.deployTransaction.wait(6)
await simpleStorage.deploymentTransaction.wait(6)
await verify(simpleStorage.target, [])
}
const currentValue = await simpleStorage.retrieve()
console.log(
Current Value is: ${currentValue}
)// Update the current value
const transactionResponse = await simpleStorage.store(7)
await transactionResponse.wait(1)
const updatedValue = await simpleStorage.retrieve()
console.log(
Updated Value is: ${updatedValue}
)}
const verify = async (contractAddress, args) => {
console.log("Verifying contract...")
try {
await run("verify:verify", {
address: contractAddress,
constructorArguments: args,
})
} catch (e) {
if (e.message.toLowerCase().includes("already verified")) {
console.log("Already Verified!")
} else {
console.log(e)
}
}
}
main()
.then(() => {
process.exit(0);
}).catch((err) => {
console.error(err);
process.exit(1);
});
and i got this error why ?
$ /home/doodl/hh-fcc/hardhat-simple-storage-fcc/node_modules/.bin/hardhat run scripts/deploy.js --network sepolia
Compiled 1 Solidity file successfully (evm target: london).
Deploying contract...
ProviderError: insufficient funds for gas * price + value: balance 0, tx cost 5565648, overshot 5565648
at HttpProvider.request (/home/doodl/hh-fcc/hardhat-simple-storage-fcc/node_modules/hardhat/src/internal/core/providers/http.ts:88:21)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at HardhatEthersSigner.sendTransaction (/home/doodl/hh-fcc/hardhat-simple-storage-fcc/node_modules/@nomicfoundation/hardhat-ethers/src/signers.ts:125:18)
at ContractFactory.deploy (/home/doodl/hh-fcc/hardhat-simple-storage-fcc/node_modules/ethers/src.ts/contract/factory.ts:111:24)
at main (/home/doodl/hh-fcc/hardhat-simple-storage-fcc/scripts/deploy.js:7:25)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Beta Was this translation helpful? Give feedback.
All reactions