Skip to content

Commit

Permalink
update the deploy scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Abidoyesimze committed Dec 16, 2024
1 parent 39ebc79 commit 890ec2f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
"node": ">=18.18.0"
},
"dependencies": {
"hardhat": "^2.22.17",
"react-icons": "^5.3.0"
}
}
27 changes: 15 additions & 12 deletions packages/hardhat/deploy/00_deploy_your_contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -25,30 +25,33 @@ 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.
autoMine: true,
});

// Get the deployed contract to interact with it after deploying.
// const batchRegistry = await hre.ethers.getContract<Contract>("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<Contract>("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<Contract>("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();
Expand All @@ -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"];

0 comments on commit 890ec2f

Please sign in to comment.