diff --git a/docs/src/content/ignition/docs/guides/deploy.md b/docs/src/content/ignition/docs/guides/deploy.md index 53f10b0042..48a9c81017 100644 --- a/docs/src/content/ignition/docs/guides/deploy.md +++ b/docs/src/content/ignition/docs/guides/deploy.md @@ -95,6 +95,34 @@ You can also define global parameters that will be available to all modules. To In this example, the `shouldBeAllowed` parameter will be `true` for all modules except `MyModule`, where it will be `false`. Global parameters can be accessed in the same way as module parameters. +### Module parameters when deploying via Hardhat Scripts + +If you're deploying Ignition Modules via Hardhat Scripts, you can pass an absolute path to your parameters JSON file directly to the `deploy` function. Here's an example of how to do this: + +```typescript +import hre from "hardhat"; +import path from "path"; + +import ApolloModule from "../ignition/modules/Apollo"; + +async function main() { + const { apollo } = await hre.ignition.deploy(ApolloModule, { + // This must be an absolute path to your parameters JSON file + parameters: path.resolve(__dirname, "../ignition/parameters.json"), + }); + + console.log(`Apollo deployed to: ${await apollo.getAddress()}`); +} + +main().catch(console.error); +``` + +:::tip + +You can read more about deploying and using Ignition modules in Hardhat scripts in the [scripts guide](/ignition/docs/guides/scripts). + +::: + ## Inspecting an existing deployment To get a list of all the deployment IDs that exist in the current project, run: