2023-08-13 13:15:58 +00:00
|
|
|
import { ethers } from "hardhat";
|
2023-08-20 03:19:59 +00:00
|
|
|
import fs from "fs/promises";
|
|
|
|
const env = process.env.NODE_ENV || "local";
|
2023-08-13 13:15:58 +00:00
|
|
|
|
|
|
|
async function main() {
|
2023-08-20 02:47:55 +00:00
|
|
|
const TENGRANS = await ethers.deployContract("TenGransEthToken");
|
|
|
|
|
|
|
|
await TENGRANS.waitForDeployment();
|
2023-08-20 03:19:59 +00:00
|
|
|
const deployedAddress = await TENGRANS.getAddress();
|
2023-08-20 02:47:55 +00:00
|
|
|
|
2023-08-20 03:19:59 +00:00
|
|
|
console.log(`Ethereum 10grans deployed to: ${deployedAddress}`);
|
|
|
|
await fs.writeFile(`.10grans-eth-address.${env}`, deployedAddress);
|
2023-08-13 13:15:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// 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;
|
|
|
|
});
|