Skip to content

fix: error in hardhat deployed func, use new Hardhat deploy func #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions build-on-mode/deploying-a-smart-contract/using-hardhat.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,14 @@ In the `scripts` directory, create a new file named `deploy.ts`:
import { ethers } from "hardhat";

async function main() {
const HelloWorld = await ethers.getContractFactory("HelloWorld");
const gasPrice = ethers.utils.parseUnits('10', 'gwei'); // Adjust the '10' as needed
const gasLimit = 500000; // Adjust this value based on your needs
const helloWorld = await HelloWorld.deploy({ gasPrice: gasPrice, gasLimit: gasLimit });
await helloWorld.deployed();
console.log("HelloWorld deployed to:", helloWorld.address);
const HelloWorld = await ethers.deployContract("HelloWorld", {
gasPrice: gasPrice,
gasLimit: gasLimit,
});
await HelloWorld.waitForDeployment();
console.log("HelloWorld deployed to:", HelloWorld.getAddress());
}

main()
Expand Down