[Fixed] hardhat-tools change deployment's functions. For hardhat-tools 3.0.0:
deploy() is now deployContract() deployed() is now awaitForDeployment()
We can downgrade hardhat-tools or use the new ones.
When I use Hardhat to deploy the contract in Sepolia, I keep getting the following error:
My deploy script:
const { ethers } = require("hardhat");
async function main() {
const whitelistContract = await ethers.getContractFactory("Whitelist");
const deployedWhitelistContract = await whitelistContract.deploy(10);
await deployedWhitelistContract.deployed();
console.log("Whitelist Contract Address:", deployedWhitelistContract.address);
}
main()
.then(() => process.exit(0))
.catch((error) => {
console.error(error);
process.exit(1);
});
My hardhat-config file:
require("@nomicfoundation/hardhat-toolbox");
require("dotenv").config({ path: ".env" });
const QUICKNODE_HTTP_URL = process.env.QUICKNODE_HTTP_URL;
const PRIVATE_KEY = process.env.PRIVATE_KEY;
module.exports = {
solidity: "0.8.10",
networks: {
hardhat: {},
sepolia: {
url: QUICKNODE_HTTP_URL,
accounts: [`0x${PRIVATE_KEY}`],
},
},
};