communities-contracts/scripts/deploy_erc20.ts

19 lines
604 B
TypeScript
Raw Normal View History

2023-01-19 11:21:41 +00:00
import { ethers } from "hardhat";
import { pn } from "./utils";
2023-01-19 11:21:41 +00:00
async function main() {
2023-06-13 08:47:21 +00:00
const CommunityERC20 = await ethers.getContractFactory("CommunityERC20");
const contract = await CommunityERC20.deploy("Test", "TEST", 100);
2023-01-19 11:21:41 +00:00
const instance = await contract.deployed();
const tx = instance.deployTransaction;
const rec = await tx.wait();
2023-06-13 08:47:21 +00:00
console.log("CommunityERC20 deployed. Gas used:", pn(rec.gasUsed));
2023-01-19 11:21:41 +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;
});