From 8d3f185bf4d382d522815cff7cb2b70902cfffa8 Mon Sep 17 00:00:00 2001 From: 0xb337r007 <0xe4e5@proton.me> Date: Thu, 10 Aug 2023 09:16:42 +0200 Subject: [PATCH] update deploy script --- scripts/deploy_owner_token.ts | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/scripts/deploy_owner_token.ts b/scripts/deploy_owner_token.ts index 5879471..1382eec 100644 --- a/scripts/deploy_owner_token.ts +++ b/scripts/deploy_owner_token.ts @@ -2,6 +2,8 @@ import { ethers } from "hardhat"; import { pn } from "./utils"; async function main() { + const [deployer] = await ethers.getSigners(); + const CollectibleV1 = await ethers.getContractFactory("OwnerToken"); const contract = await CollectibleV1.deploy( "Test", @@ -16,10 +18,20 @@ async function main() { const instance = await contract.deployed(); const tx = instance.deployTransaction; const rec = await tx.wait(); - console.log( - `OwnerToken deployed at ${instance.address}. Gas used: ${pn(rec.gasUsed)}` - ); + console.log(`OwnerToken deployed at ${instance.address}`); + console.log(`Gas used: ${pn(rec.gasUsed)}`); console.log("Master token deployed at", rec.events[0].args.masterToken); + const mt = await ethers.getContractAt( + "MasterToken", + rec.events[0].args.masterToken + ); + console.log("Name:", await instance.name()); + console.log("Max Supply:", (await instance.maxSupply()).toString()); + console.log("Total Supply:", (await instance.totalSupply()).toString()); + console.log( + "Deployer balance:", + (await instance.balanceOf(deployer.address)).toString() + ); } // We recommend this pattern to be able to use async/await everywhere // and properly handle errors.