Skip to content

Commit

Permalink
Updated deploy test token script to be task
Browse files Browse the repository at this point in the history
  • Loading branch information
u-hubar committed Nov 24, 2023
1 parent 00ab110 commit 8118344
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 26 deletions.
1 change: 1 addition & 0 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { lazyObject } from 'hardhat/plugins';
import { HardhatRuntimeEnvironment } from 'hardhat/types';

import './tasks/address_converter';
import './tasks/deploy_test_token';
import './tasks/low_level_call_data_encoder';
import './tasks/selector_encoder';
import './tasks/send_otp';
Expand Down
26 changes: 0 additions & 26 deletions scripts/deploy_test_token.ts

This file was deleted.

23 changes: 23 additions & 0 deletions tasks/deploy_test_token.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { task } from 'hardhat/config';
import { HardhatRuntimeEnvironment } from 'hardhat/types';

type TestTokenDeploymentParameters = {
tokenName: string;
tokenSymbol: string;
};

task('deploy_test_token', 'Deploy Test Trace Token')
.addParam<string>('tokenName', 'Token Name')
.addParam<string>('tokenSymbol', 'Token Symbol')
.setAction(async (taskArgs: TestTokenDeploymentParameters, hre: HardhatRuntimeEnvironment) => {
const { tokenName, tokenSymbol } = taskArgs;

const TokenFactory = await hre.ethers.getContractFactory('Token');
const Token = await TokenFactory.deploy(tokenName, tokenSymbol);

await Token.deployed();

console.log(
`${tokenName} ($${tokenSymbol}) token has been deployed to: ${Token.address} on the ${hre.network.name} blockchain!`,
);
});

0 comments on commit 8118344

Please sign in to comment.