From 890ec2f322c6e1e18599336cb92e5404341ccade Mon Sep 17 00:00:00 2001 From: Abidoyesimze Date: Mon, 16 Dec 2024 03:03:17 +0100 Subject: [PATCH] update the deploy scripts --- package.json | 1 - .../hardhat/deploy/00_deploy_your_contract.ts | 27 ++++++++++--------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index 44fdb6f..a569f19 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,6 @@ "node": ">=18.18.0" }, "dependencies": { - "hardhat": "^2.22.17", "react-icons": "^5.3.0" } } diff --git a/packages/hardhat/deploy/00_deploy_your_contract.ts b/packages/hardhat/deploy/00_deploy_your_contract.ts index 740675b..95d52ab 100644 --- a/packages/hardhat/deploy/00_deploy_your_contract.ts +++ b/packages/hardhat/deploy/00_deploy_your_contract.ts @@ -3,7 +3,7 @@ import { DeployFunction } from "hardhat-deploy/types"; import { Contract } from "ethers"; // Update with your Batch number -// const BATCH_NUMBER = "11"; +const BATCH_NUMBER = "11"; /** * Deploys a contract named "deployYourContract" using the deployer account and @@ -25,13 +25,16 @@ const deployYourContract: DeployFunction = async function (hre: HardhatRuntimeEn const { deployer } = await hre.getNamedAccounts(); const { deploy } = hre.deployments; - // await deploy("BatchRegistry", { - // from: deployer, - // // Contract constructor arguments - // args: [deployer, BATCH_NUMBER], + await deploy("BatchRegistry", { + from: deployer, + // Contract constructor arguments + args: [deployer, BATCH_NUMBER], + log: true, + }); + await deploy("PixelCanvas", { from: deployer, - args: [], + args: [deployer], // Added deployer as an argument similar to BatchRegistry log: true, // autoMine: can be passed to the deploy function to make the deployment process faster on local networks by // automatically mining the contract deployment transaction. There is no effect on live networks. @@ -39,16 +42,16 @@ const deployYourContract: DeployFunction = async function (hre: HardhatRuntimeEn }); // Get the deployed contract to interact with it after deploying. - // const batchRegistry = await hre.ethers.getContract("BatchRegistry", deployer); - // console.log("\nBatchRegistry deployed to:", await batchRegistry.getAddress()); - // console.log("Remember to update the allow list!\n"); + const batchRegistry = await hre.ethers.getContract("BatchRegistry", deployer); + console.log("\nBatchRegistry deployed to:", await batchRegistry.getAddress()); + console.log("Remember to update the allow list!\n"); const pixelCanvas = await hre.ethers.getContract("PixelCanvas", deployer); console.log("\nPixelCanvas deployed to:", await pixelCanvas.getAddress()); // The GraduationNFT contract is deployed on the BatchRegistry constructor. - // const batchGraduationNFTAddress = await batchRegistry.batchGraduationNFT(); - // console.log("BatchGraduation NFT deployed to:", batchGraduationNFTAddress, "\n"); + const batchGraduationNFTAddress = await batchRegistry.batchGraduationNFT(); + console.log("BatchGraduation NFT deployed to:", batchGraduationNFTAddress, "\n"); // Verify initial canvas state const canvasWidth = await pixelCanvas.CANVAS_WIDTH(); @@ -60,4 +63,4 @@ export default deployYourContract; // Tags are useful if you have multiple deploy files and only want to run one of them. // e.g. yarn deploy --tags YourContract -deployYourContract.tags = ["PixelCanvas"]; +deployYourContract.tags = ["BatchRegistry", "PixelCanvas"];