From ac18c0424aa3e4acc3eeffa23365cc834e9e5da7 Mon Sep 17 00:00:00 2001 From: 0xb337r007 <0xe4e5@proton.me> Date: Tue, 13 Jun 2023 10:47:21 +0200 Subject: [PATCH] add erc20 deploy script --- scripts/deploy_erc20.ts | 18 ++++++++++++++++++ scripts/{deploy.ts => deploy_erc721.ts} | 0 2 files changed, 18 insertions(+) create mode 100644 scripts/deploy_erc20.ts rename scripts/{deploy.ts => deploy_erc721.ts} (100%) diff --git a/scripts/deploy_erc20.ts b/scripts/deploy_erc20.ts new file mode 100644 index 0000000..d5d12a6 --- /dev/null +++ b/scripts/deploy_erc20.ts @@ -0,0 +1,18 @@ +import { ethers } from "hardhat"; +import { pn } from "./utils"; + +async function main() { + const CommunityERC20 = await ethers.getContractFactory("CommunityERC20"); + const contract = await CommunityERC20.deploy("Test", "TEST", 100); + + const instance = await contract.deployed(); + const tx = instance.deployTransaction; + const rec = await tx.wait(); + console.log("CommunityERC20 deployed. Gas used:", pn(rec.gasUsed)); +} +// 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; +}); diff --git a/scripts/deploy.ts b/scripts/deploy_erc721.ts similarity index 100% rename from scripts/deploy.ts rename to scripts/deploy_erc721.ts