Error:
PS D:\SimpleStorage> npx hardhat run scripts/deploy.js
TypeError: chai.deployed is not a function
at main (D:\SimpleStorage\scripts\deploy.js:11:16)
PS D:\SimpleStorage>
deploy.js:
const hre = require("hardhat");
async function main() {
// Fetching the byte code and ABI
const Chai = await hre.ethers.getContractFactory("chai");
// Deploying an instance of our smart contract
const chai = await Chai.deploy();
// Waiting for the contract to be deployed
await chai.deployed();
console.log("Deployed contract address:", chai.address);
}
main()
.then(() => process.exit(0))
.catch((error) => {
console.error(error);
process.exit(1);
});
hardhat.config.js:
require("@nomicfoundation/hardhat-toolbox");
/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
solidity: "0.8.24",
};