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); });