10grans-ng/scripts/deploy-eth.ts

21 lines
616 B
TypeScript

import { ethers } from "hardhat";
import fs from "fs/promises";
const env = process.env.NODE_ENV || "local";
async function main() {
const TENGRANS = await ethers.deployContract("TenGransEthToken");
await TENGRANS.waitForDeployment();
const deployedAddress = await TENGRANS.getAddress();
console.log(`Ethereum 10grans deployed to: ${deployedAddress}`);
await fs.writeFile(`.10grans-eth-address.${env}`, deployedAddress);
}
// We recommend this pattern to be able to use async/await everywhere
// and properly handle errors.
main().catch((error) => {
console.error(error);
process.exitCode = 1;
});