watcher-ts/packages/erc20-watcher/test/tasks/token-deploy.ts
Ashwin Phatak cf0713eda7
Tasks in erc20-watcher to deploy and transfer tokens. (#233)
Co-authored-by: nabarun <nabarun@deepstacksoft.com>
2021-08-27 17:47:23 +05:30

20 lines
633 B
TypeScript

//
// Copyright 2021 Vulcanize, Inc.
//
import { task, types } from 'hardhat/config';
import '@nomiclabs/hardhat-ethers';
const DEFAULT_INITIAL_SUPPLY = '1000000000000000000000';
task('token-deploy', 'Deploys GLD token')
.addOptionalParam('initialSupply', 'Set total supply', DEFAULT_INITIAL_SUPPLY, types.string)
.setAction(async (args, hre) => {
const { initialSupply } = args;
await hre.run('compile');
const Token = await hre.ethers.getContractFactory('GLDToken');
const token = await Token.deploy(hre.ethers.BigNumber.from(initialSupply));
console.log('GLD Token deployed to:', token.address);
});