Skip to content

Commit f8966b4

Browse files
authored
fix: hide private key input, use combined templates repo (#84)
1 parent 00e1b04 commit f8966b4

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/commands/create/groups/contracts.ts

+12-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import inquirer from "inquirer";
33

44
import Logger from "../../../utils/logger.js";
55
import { packageManagers } from "../../../utils/packageManager.js";
6+
import { isPrivateKey } from "../../../utils/validators.js";
67
import { askForTemplate, setupTemplate, askForPackageManager, successfulMessage } from "../utils.js";
78

89
import type { GenericTemplate } from "../index.js";
@@ -18,14 +19,16 @@ export const templates: Template[] = [
1819
value: "hardhat_solidity",
1920
framework: "Hardhat",
2021
language: "Solidity",
21-
git: "https://github.com/matter-labs/zksync-hardhat-template",
22+
path: "templates/hardhat/solidity",
23+
git: "https://github.com/matter-labs/zksync-contract-templates/",
2224
},
2325
{
2426
name: "Hardhat + Vyper",
2527
value: "hardhat_vyper",
2628
framework: "Hardhat",
2729
language: "Vyper",
28-
git: "https://github.com/matter-labs/zksync-hardhat-vyper-template",
30+
path: "templates/hardhat/vyper",
31+
git: "https://github.com/matter-labs/zksync-contract-templates/",
2932
},
3033
];
3134

@@ -41,7 +44,13 @@ export default async (folderLocation: string, folderRelativePath: string, templa
4144
name: "privateKey",
4245
suffix: chalk.gray(" (optional)"),
4346
type: "input",
44-
required: true,
47+
validate: (input: string) => {
48+
if (!input) return true; // since it's optional
49+
return isPrivateKey(input);
50+
},
51+
transformer: (input: string) => {
52+
return input.replace(/./g, "*");
53+
},
4554
},
4655
]);
4756
env = {

0 commit comments

Comments
 (0)