Skip to content

LESSON 5: 'Error: insufficient funds for intrinsic transaction cost ' #5752

Answered by COSMICnoob80
COSMICnoob80 asked this question in Q&A
Discussion options

You must be logged in to vote

I tried the following code snippet in which the gas parameters were amended, and it worked for me, thanks a lot for reaching out:

`async function main() {
const provider = new ethers.providers.JsonRpcProvider(process.env.RPC_URL);
const wallet = new ethers.Wallet(process.env.PRIVATE_KEY, provider);
const abi = fs.readFileSync("./SimpleStorage_sol_SimpleStorage.abi", "utf8");
const binary = fs.readFileSync(
"./SimpleStorage_sol_SimpleStorage.bin",
"utf8"
);
const contractFactory = new ethers.ContractFactory(abi, binary, wallet);

console.log("Deploying, please wait...");

// Set gasPrice and gasLimit here
const gasPrice = ethers.utils.parseUnits("10", "gwei"); // Adjust the gas price accordi…

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
2 replies
@COSMICnoob80
Comment options

Answer selected by COSMICnoob80
@b0nesss
Comment options

Comment options

You must be logged in to vote
1 reply
@COSMICnoob80
Comment options

Comment options

You must be logged in to vote
1 reply
@jujuvideogirlai
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
6 participants