-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdeploy.ts
28 lines (26 loc) · 1.04 KB
/
deploy.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import ContractMetadata from "../utils/ContractMetadata";
import { Helper } from "../utils/Helper";
import { main as deployContract } from "./scripts/logic";
import { main as createContractProxy } from "./scripts/transparentUpgradeableProxy";
import { main as updateContractProxy } from "./scripts/upgradeProxy";
async function main() {
const contractName = await Helper.prompt(
ContractMetadata.SUPPORTED_CONTRACTS_FOR_DEPLOYMENT,
"Please select which contract you want to deploy ?",
);
if (contractName === "exit") {
return "nothing to execute";
}
await deployContract(contractName);
const proxyOption = await Helper.prompt(
ContractMetadata.SUPPORTED_PROXY_OPTIONS,
"Please select any option for proxy operation from menu !",
);
proxyOption === "create" && (await createContractProxy(contractName));
proxyOption === "update" && (await updateContractProxy(contractName));
return "all done successfully";
}
main()
.then((res) => console.log(res))
.catch((error) => console.error(error))
.finally(() => process.exit(1));