I am having an issue getting the deployment: I get an error but I see a contract up on the chain and blocks are made. I am not getting the same confirmation as the video.
I did have to change a few things in my code, such as importing fs instead of 'fs-extra' and using: ethers.JsonRpcProvider("http://127.0.0.1:7545/"); without "provider" after doing some research online my IDE and AI helped me debug into changing them to newer versions
this is my code:
const {ethers} = require('ethers');
const fs = require("fs");
require('dotenv').config();
async function Deploy() {
const provider = new ethers.JsonRpcProvider("http://127.0.0.1:7545");
const wallet = new ethers.Wallet(process.env.PRIVATE_KEY, provider);
const abi = fs.readFileSync("./SimpleStorage_sol_SimpleStorage.abi", "utf8");
const bin = fs.readFileSync("./SimpleStorage_sol_SimpleStorage.bin", "utf8");
const contractFactory = new ethers.ContractFactory(abi, bin, wallet);
console.log("🚀 Deploying, please wait...")
const contract = await contractFactory.deploy({gasLimit: 6721975});
// overrides can be : transactionNonce: 1000000, gasPrice: 100000000000, value: 10000000000000000 , gasPrice: 10000000000
// https://docs.ethers.org/v5/api/contract/contract-factory/#ContractFactory-deploy
console.log("💰 " +contract);
// the older the block the more secure it is, we make sure we have another block attached to the one we just sent up to the chain to make sure we can mine it
}
Deploy().then(() => process.exit(0))
.catch(error => {
console.error(error);
process.exitCode = 1;
});
I am having an issue getting the deployment: I get an error but I see a contract up on the chain and blocks are made. I am not getting the same confirmation as the video.
I did have to change a few things in my code, such as importing fs instead of 'fs-extra' and using: ethers.JsonRpcProvider("http://127.0.0.1:7545/"); without "provider" after doing some research online my IDE and AI helped me debug into changing them to newer versions
this is my code: