Update deploy.js

This commit is contained in:
nikolaivanovj 2025-01-06 23:58:35 +02:00 committed by GitHub
parent 1b42a04147
commit 2e552925b0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -5,13 +5,14 @@ async function main() {
const Token = await ethers.getContractFactory("Token"); const Token = await ethers.getContractFactory("Token");
const token = await Token.deploy(); const token = await Token.deploy();
console.log("Token deployed to:", token.address); await token.deployed(); // Ensure the contract is deployed before accessing its address
}
main() console.log("Token deployed to:", token.address); // This should print the correct address
}
main()
.then(() => process.exit(0)) .then(() => process.exit(0))
.catch((error) => { .catch((error) => {
console.error(error); console.error(error);
process.exit(1); process.exit(1);
}); });