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
What Are Financial Ratios? The Most Important Financial Ratios
Project Expedition
Po Box 7250 Sioux Falls Sd
The Largest Banks - ​​How to Transfer Money With Only Card Number and CVV (2024)
Avonlea Havanese
Obituary (Binghamton Press & Sun-Bulletin): Tully Area Historical Society
Words From Cactusi
Best Theia Builds (Talent | Skill Order | Pairing + Pets) In Call of Dragons - AllClash
Barstool Sports Gif
Acbl Homeport
Azeroth Pilot Reloaded - Addons - World of Warcraft
Bros Movie Wiki
Springfield Mo Craiglist
Love In The Air Ep 9 Eng Sub Dailymotion
Midlife Crisis F95Zone
Craftology East Peoria Il
Eva Mastromatteo Erie Pa
Mzinchaleft
Palm Coast Permits Online
NHS England » Winter and H2 priorities
Bj Alex Mangabuddy
Unity - Manual: Scene view navigation
Governor Brown Signs Legislation Supporting California Legislative Women's Caucus Priorities
Hampton University Ministers Conference Registration
Jordan Poyer Wiki
How to Make Ghee - How We Flourish
Walmart Pharmacy Near Me Open
Beaufort 72 Hour
Kroger Feed Login
4Oxfun
JVID Rina sauce set1
Marokko houdt honderden mensen tegen die illegaal grens met Spaanse stad Ceuta wilden oversteken
Ou Football Brainiacs
Miles City Montana Craigslist
Angel Haynes Dropbox
Publix Christmas Dinner 2022
Craftsman Yt3000 Oil Capacity
Motor Mounts
Kamzz Llc
4083519708
Second Chance Apartments, 2nd Chance Apartments Locators for Bad Credit
Pain Out Maxx Kratom
6576771660
Here's Everything You Need to Know About Baby Ariel
Lady Nagant Funko Pop
Crigslist Tucson
Devotion Showtimes Near Showplace Icon At Valley Fair
552 Bus Schedule To Atlantic City
Diccionario De Los Sueños Misabueso
Sam's Club Fountain Valley Gas Prices
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.