mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-17 17:33:47 +00:00
Update deploy.js
This commit is contained in:
parent
1b42a04147
commit
2e552925b0
1 changed files with 17 additions and 16 deletions
|
|
@ -1,17 +1,18 @@
|
|||
async function main() {
|
||||
const [deployer] = await ethers.getSigners();
|
||||
console.log("Deploying contracts with the account:", deployer.address);
|
||||
|
||||
const Token = await ethers.getContractFactory("Token");
|
||||
const token = await Token.deploy();
|
||||
|
||||
console.log("Token deployed to:", token.address);
|
||||
}
|
||||
|
||||
main()
|
||||
.then(() => process.exit(0))
|
||||
.catch((error) => {
|
||||
console.error(error);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
const [deployer] = await ethers.getSigners();
|
||||
console.log("Deploying contracts with the account:", deployer.address);
|
||||
|
||||
const Token = await ethers.getContractFactory("Token");
|
||||
const token = await Token.deploy();
|
||||
|
||||
await token.deployed(); // Ensure the contract is deployed before accessing its address
|
||||
|
||||
console.log("Token deployed to:", token.address); // This should print the correct address
|
||||
}
|
||||
|
||||
main()
|
||||
.then(() => process.exit(0))
|
||||
.catch((error) => {
|
||||
console.error(error);
|
||||
process.exit(1);
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue