Skip to content

Commit

Permalink
fix: hide private key input, use combined templates repo (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
JackHamer09 authored Nov 23, 2023
1 parent 00e1b04 commit f8966b4
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/commands/create/groups/contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import inquirer from "inquirer";

import Logger from "../../../utils/logger.js";
import { packageManagers } from "../../../utils/packageManager.js";
import { isPrivateKey } from "../../../utils/validators.js";
import { askForTemplate, setupTemplate, askForPackageManager, successfulMessage } from "../utils.js";

import type { GenericTemplate } from "../index.js";
Expand All @@ -18,14 +19,16 @@ export const templates: Template[] = [
value: "hardhat_solidity",
framework: "Hardhat",
language: "Solidity",
git: "https://github.com/matter-labs/zksync-hardhat-template",
path: "templates/hardhat/solidity",
git: "https://github.com/matter-labs/zksync-contract-templates/",
},
{
name: "Hardhat + Vyper",
value: "hardhat_vyper",
framework: "Hardhat",
language: "Vyper",
git: "https://github.com/matter-labs/zksync-hardhat-vyper-template",
path: "templates/hardhat/vyper",
git: "https://github.com/matter-labs/zksync-contract-templates/",
},
];

Expand All @@ -41,7 +44,13 @@ export default async (folderLocation: string, folderRelativePath: string, templa
name: "privateKey",
suffix: chalk.gray(" (optional)"),
type: "input",
required: true,
validate: (input: string) => {
if (!input) return true; // since it's optional
return isPrivateKey(input);
},
transformer: (input: string) => {
return input.replace(/./g, "*");
},
},
]);
env = {
Expand Down

0 comments on commit f8966b4

Please sign in to comment.