add erc20 deploy script

This commit is contained in:
0xb337r007 2023-06-13 10:47:21 +02:00
parent 4ae35cba0f
commit ac18c0424a
2 changed files with 18 additions and 0 deletions

18
scripts/deploy_erc20.ts Normal file
View File

@ -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;
});