Skip to content

Commit 3715f64

Browse files
remove useless type definition
1 parent c701f90 commit 3715f64

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

deploy/erc721_support.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ import fs from "fs/promises";
55
import path from "path";
66
import { parse } from "csv-parse/sync";
77

8-
type MyMapLikeType = Record<string, string>;
9-
const ADDRESS_TABLE_PATH = path.resolve(__dirname,"..","helper_scripts", "contract-addresses.csv");
8+
const ADDRESS_TABLE_PATH = path.resolve(__dirname, "..", "helper_scripts", "contract-addresses.csv");
109

1110
const func: DeployFunction = async function(hre: HardhatRuntimeEnvironment) {
1211
const { deployments, getNamedAccounts } = hre
@@ -15,7 +14,7 @@ const func: DeployFunction = async function(hre: HardhatRuntimeEnvironment) {
1514
const network: string = hre.hardhatArguments.network ? hre.hardhatArguments.network : 'ropsten'
1615
const deployedContracts = await loadDeployedAddress();
1716
const proxyAddress = deployedContracts[network]
18-
17+
1918
if (true) {
2019
// deploy, we normally do this only once
2120
const HappyRedPacketImpl_erc721 = await ethers.getContractFactory('HappyRedPacket_ERC721')
@@ -45,12 +44,12 @@ const func: DeployFunction = async function(hre: HardhatRuntimeEnvironment) {
4544
}
4645
}
4746

48-
async function loadDeployedAddress(): Promise<MyMapLikeType>{
47+
async function loadDeployedAddress(): Promise<Record<string, string>> {
4948
const data = await fs.readFile(ADDRESS_TABLE_PATH, "utf-8");
5049
const columns = ['Chain', 'HappyRedPacket', 'HappyRedPacket_ERC721'];
5150
const records = parse(data, { delimiter: ',', columns, from: 2 });
52-
let deployedContract: MyMapLikeType = {};
53-
for (const { Chain, HappyRedPacket_ERC721} of records) {
51+
let deployedContract: Record<string, string> = {};
52+
for (const { Chain, HappyRedPacket_ERC721 } of records) {
5453
deployedContract[Chain.toLowerCase()] = HappyRedPacket_ERC721;
5554
}
5655
return deployedContract;

deploy/redpacket.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import path from "path";
66
import { parse } from "csv-parse/sync";
77

88
const ADDRESS_TABLE_PATH = path.resolve(__dirname, "..", "helper_scripts", "contract-addresses.csv");
9-
type MyMapLikeType = Record<string, string>
109

1110
const func: DeployFunction = async function(hre: HardhatRuntimeEnvironment) {
1211
const { deployments, getNamedAccounts } = hre
@@ -45,12 +44,12 @@ const func: DeployFunction = async function(hre: HardhatRuntimeEnvironment) {
4544
}
4645
}
4746

48-
async function loadDeployedAddress(): Promise<MyMapLikeType>{
47+
async function loadDeployedAddress(): Promise<Record<string, string>> {
4948
const data = await fs.readFile(ADDRESS_TABLE_PATH, "utf-8");
5049
const columns = ['Chain', 'HappyRedPacket', 'HappyRedPacket_ERC721'];
5150
const records = parse(data, { delimiter: ',', columns, from: 2 });
52-
let deployedContract: MyMapLikeType = {};
53-
for (const { Chain, HappyRedPacket} of records) {
51+
let deployedContract: Record<string, string> = {};
52+
for (const { Chain, HappyRedPacket } of records) {
5453
deployedContract[Chain.toLowerCase()] = HappyRedPacket;
5554
}
5655
return deployedContract;

0 commit comments

Comments
 (0)