UNPKG

hardhat-ignition-deploy-everything

Version:

A hardhat plugin providing the ability to list and manage a bunch of hardhat-ignition deployments to execute at once (even conditional deployment modules)

38 lines (30 loc) 1.64 kB
const { buildModule } = require("@nomicfoundation/hardhat-ignition/modules"); module.exports = buildModule("MyModule", (m) => { // You can pass parameters (e.g. "foo") to this module and attend // or capture them by using line like this one: // // (parameter keys must be valid alphanumeric strings, and parameter // values, both expected and default, must be json-serializable ones, // which can be numbers, boolean values, strings or null) // // const foo = m.getParameter("foo", "someValue"); // This is a simple module which only refers a contract. The result // of m.contractAt is a special value (not an actual contract nor its // address) that makes part of the ignition declarative paradigm: a // "future". Read more about ignition and futures in the official // documentation @ Hardhat's website. // The [] receives as many argument as your contract needs. Those // will be passed directly to the constructor. const contract = m.contractAt( "MyContract", "0x84f5b76cdf2Bb477cF3D85D4Fd31b98fe3b041C7" ); // In this case, the result is a single object having a contract: key // which contains the future. When Ignition deployment is invoked and // retrieved via code, the result will be a single object having a // contract: key which contains a Contract instance (from `ethers` or // `viem` or whatever biding you're using for Ignition). // Feel free to edit this file as needed, but it's a good idea to keep // the object with the contract: key (you can freely add more keys) or // other tools based on this one might not work for your script. return { contract }; });