2021-08-27 12:17:23 +00:00
|
|
|
//
|
|
|
|
// 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));
|
|
|
|
|
2022-05-26 12:30:17 +00:00
|
|
|
const receipt = await token.deployTransaction.wait();
|
2021-08-27 12:17:23 +00:00
|
|
|
console.log('GLD Token deployed to:', token.address);
|
2022-05-26 12:30:17 +00:00
|
|
|
console.log('Deployed at block:', receipt.blockNumber, receipt.blockHash);
|
2021-08-27 12:17:23 +00:00
|
|
|
});
|