Deploying your contracts | Ethereum development environment for professionals by Nomic Foundation (2024)

To deploy your contracts, you can use Hardhat Ignition, our declarative deployment system. You can deploy the Lock contract from the sample project by using its accompanying Ignition module. An Ignition module is a TypeScript or JavaScript file that allows you to specify what needs to be deployed.

In the sample project, the Ignition module LockModule which deploys the Lock contract, is under the ./ignition/modules directory and looks like this:

TypeScript

JavaScript

// This setup uses Hardhat Ignition to manage smart contract deployments.// Learn more about it at https://hardhat.org/ignitionimport { buildModule } from "@nomicfoundation/hardhat-ignition/modules";const JAN_1ST_2030 = 1893456000;const ONE_GWEI: bigint = 1_000_000_000n;const LockModule = buildModule("LockModule", (m) => { const unlockTime = m.getParameter("unlockTime", JAN_1ST_2030); const lockedAmount = m.getParameter("lockedAmount", ONE_GWEI); const lock = m.contract("Lock", [unlockTime], { value: lockedAmount, }); return { lock };});export default LockModule;
// This setup uses Hardhat Ignition to manage smart contract deployments.// Learn more about it at https://hardhat.org/ignitionconst { buildModule } = require("@nomicfoundation/hardhat-ignition/modules");const JAN_1ST_2030 = 1893456000;const ONE_GWEI = 1_000_000_000n;module.exports = buildModule("LockModule", (m) => { const unlockTime = m.getParameter("unlockTime", JAN_1ST_2030); const lockedAmount = m.getParameter("lockedAmount", ONE_GWEI); const lock = m.contract("Lock", [unlockTime], { value: lockedAmount, }); return { lock };});

You can deploy in the localhost network following these steps:

  1. Start a local node

  2. Open a new terminal and deploy the Hardhat Ignition module in the localhost network

    TypeScript

    JavaScript

    npx hardhat ignition deploy ./ignition/modules/Lock.ts --network localhost
    npx hardhat ignition deploy ./ignition/modules/Lock.js --network localhost

As general rule, you can target any network from your Hardhat config using:

npx hardhat ignition deploy ./ignition/modules/Lock.js --network <your-network>

If no network is specified, Hardhat Ignition will run against an in-memory instance of Hardhat Network.

In the sample LockModule above, two module parameters are used: unlockTime which will default to the 1st of Jan 2030 and lockedAmount which will default to one Gwei. You can learn more about overriding these values by providing your own module parameters during deployment in our Deploying a module guide.

Read more about Hardhat Ignition generally in the Hardhat Ignition documentation.

Deploying your contracts | Ethereum development environment for professionals by Nomic Foundation (2024)
Top Articles
How Does Random Access Memory (RAM) Affect the Performance of a Computer
How Long Should a Job Interview Last?
Nybe Business Id
Jefferey Dahmer Autopsy Photos
Arrests reported by Yuba County Sheriff
Evita Role Wsj Crossword Clue
Devourer Of Gods Resprite
B67 Bus Time
Obituary Times Herald Record
Sitcoms Online Message Board
Phillies Espn Schedule
Assets | HIVO Support
3472542504
How to Store Boiled Sweets
Accuradio Unblocked
Cvb Location Code Lookup
Uc Santa Cruz Events
Blackwolf Run Pro Shop
The Grand Canyon main water line has broken dozens of times. Why is it getting a major fix only now?
Farmer's Almanac 2 Month Free Forecast
Fraction Button On Ti-84 Plus Ce
Edicts Of The Prime Designate
Craigslist Missoula Atv
V-Pay: Sicherheit, Kosten und Alternativen - BankingGeek
Why Is 365 Market Troy Mi On My Bank Statement
Poe Str Stacking
Mj Nails Derby Ct
Buying Cars from Craigslist: Tips for a Safe and Smart Purchase
Southland Goldendoodles
Wrights Camper & Auto Sales Llc
Truvy Back Office Login
Mjc Financial Aid Phone Number
Jail Roster Independence Ks
Kelley Fliehler Wikipedia
Current Time In Maryland
Vistatech Quadcopter Drone With Camera Reviews
O'reilly Auto Parts Ozark Distribution Center Stockton Photos
Manatee County Recorder Of Deeds
Gpa Calculator Georgia Tech
Kornerstone Funeral Tulia
Disassemble Malm Bed Frame
VDJdb in 2019: database extension, new analysis infrastructure and a T-cell receptor motif compendium
Shell Gas Stations Prices
Go Nutrients Intestinal Edge Reviews
Graduation Requirements
Nurses May Be Entitled to Overtime Despite Yearly Salary
Zom 100 Mbti
Deviantart Rwby
Psalm 46 New International Version
Palmyra Authentic Mediterranean Cuisine مطعم أبو سمرة
Lux Nails & Spa
Latest Posts
Article information

Author: Aracelis Kilback

Last Updated:

Views: 5554

Rating: 4.3 / 5 (44 voted)

Reviews: 91% of readers found this page helpful

Author information

Name: Aracelis Kilback

Birthday: 1994-11-22

Address: Apt. 895 30151 Green Plain, Lake Mariela, RI 98141

Phone: +5992291857476

Job: Legal Officer

Hobby: LARPing, role-playing games, Slacklining, Reading, Inline skating, Brazilian jiu-jitsu, Dance

Introduction: My name is Aracelis Kilback, I am a nice, gentle, agreeable, joyous, attractive, combative, gifted person who loves writing and wants to share my knowledge and understanding with you.