From d24470ec1239c3290748c622f17b102123b7badd Mon Sep 17 00:00:00 2001 From: nikolaivanovj <110764167+nikolaivanovj@users.noreply.github.com> Date: Tue, 7 Jan 2025 18:46:05 +0200 Subject: [PATCH] Update deploy.js --- hardhat/scripts/deploy.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/hardhat/scripts/deploy.js b/hardhat/scripts/deploy.js index 2a5e4271e3..c64a86ee42 100644 --- a/hardhat/scripts/deploy.js +++ b/hardhat/scripts/deploy.js @@ -8,20 +8,19 @@ async function main() { // Log the token object to inspect its properties console.log("Token object:", token); + // Check if the deployTransaction is available if (token.deployTransaction) { console.log("Deploy transaction hash:", token.deployTransaction.hash); + await token.deployTransaction.wait(); // Wait for the deployment transaction to be mined + console.log("Token deployed to:", token.address); } else { console.error("Deploy transaction is undefined"); } - - await token.deployed(); - - console.log("Token deployed to:", token.address); } main() .then(() => process.exit(0)) .catch((error) => { - console.error(error); + console.error("Error:", error); process.exit(1); });