From 436dc1117555e5f485e4e0edfa37eb2e9430a0e8 Mon Sep 17 00:00:00 2001 From: Andrew Dmytrenko Date: Thu, 14 Dec 2023 17:00:02 +0200 Subject: [PATCH] add options --- scripts/terminal.ts | 6 ++- scripts/utility/dashboard/Builders.ts | 11 ++++++ .../utility/dashboard/RefundAndCollateral.ts | 11 ++++++ scripts/utility/dashboard/SimpleProviders.ts | 8 ++++ .../utility/dashboard/VaultAndLockDealNFT.ts | 9 +++++ scripts/utility/deployment.ts | 38 ------------------- 6 files changed, 44 insertions(+), 39 deletions(-) create mode 100644 scripts/utility/dashboard/Builders.ts create mode 100644 scripts/utility/dashboard/RefundAndCollateral.ts create mode 100644 scripts/utility/dashboard/SimpleProviders.ts create mode 100644 scripts/utility/dashboard/VaultAndLockDealNFT.ts delete mode 100644 scripts/utility/deployment.ts diff --git a/scripts/terminal.ts b/scripts/terminal.ts index a4ca92c..23a86ae 100644 --- a/scripts/terminal.ts +++ b/scripts/terminal.ts @@ -31,17 +31,21 @@ async function displayMenu(): Promise { // Handling the selection switch (answer.menuItem) { case menuItems[0].name: - exec("npx hardhat run ./scripts/utility/deployment.ts --network truffleDashboard") + exec("npx hardhat run ./scripts/utility/deployment/VaultAndLockDealNFT.ts --network truffleDashboard") break case menuItems[1].name: + exec("npx hardhat run ./scripts/utility/deployment/SimpleProviders.ts --network truffleDashboard") break case menuItems[2].name: + exec("npx hardhat run ./scripts/utility/deployment/RefundAndCollateral.ts --network truffleDashboard") break case menuItems[3].name: + exec("npx hardhat run ./scripts/utility/deployment/Builders.ts --network truffleDashboard") break case menuItems[4].name: break case menuItems[5].name: + exec("npx hardhat run ./deploy.ts --network truffleDashboard") break default: break diff --git a/scripts/utility/dashboard/Builders.ts b/scripts/utility/dashboard/Builders.ts new file mode 100644 index 0000000..63c5bc0 --- /dev/null +++ b/scripts/utility/dashboard/Builders.ts @@ -0,0 +1,11 @@ +import { LockDealNFT, RefundProvider, CollateralProvider } from "../../../typechain-types" +import { deploy } from "../../deploy" + +export async function deployBuilders( + lockDealNFT: LockDealNFT, + refundProvider: RefundProvider, + collateralProvider: CollateralProvider +) { + await deploy("SimpleBuilder", lockDealNFT.address) + await deploy("SimpleRefundBuilder", lockDealNFT.address, refundProvider.address, collateralProvider.address) +} diff --git a/scripts/utility/dashboard/RefundAndCollateral.ts b/scripts/utility/dashboard/RefundAndCollateral.ts new file mode 100644 index 0000000..7e7f6df --- /dev/null +++ b/scripts/utility/dashboard/RefundAndCollateral.ts @@ -0,0 +1,11 @@ +import { CollateralProvider, LockDealNFT, DealProvider } from "../../../typechain-types" +import { deploy } from "../../deploy" + +export async function deployRefundWithCollateral(lockDealNFT: LockDealNFT, dealProvider: DealProvider) { + const collateralProvider: CollateralProvider = await deploy( + "CollateralProvider", + lockDealNFT.address, + dealProvider.address + ) + await deploy("RefundProvider", lockDealNFT.address, collateralProvider.address) +} diff --git a/scripts/utility/dashboard/SimpleProviders.ts b/scripts/utility/dashboard/SimpleProviders.ts new file mode 100644 index 0000000..d840a1f --- /dev/null +++ b/scripts/utility/dashboard/SimpleProviders.ts @@ -0,0 +1,8 @@ +import { LockDealNFT, DealProvider, LockDealProvider } from "../../../typechain-types" +import { deploy } from "../../deploy" + +export async function deploySimpleProviders(lockDealNFT: LockDealNFT) { + const dealProvider: DealProvider = await deploy("DealProvider", lockDealNFT.address) + const lockProvider: LockDealProvider = await deploy("LockDealProvider", lockDealNFT.address, dealProvider.address) + await deploy("TimedDealProvider", lockDealNFT.address, lockProvider.address) +} \ No newline at end of file diff --git a/scripts/utility/dashboard/VaultAndLockDealNFT.ts b/scripts/utility/dashboard/VaultAndLockDealNFT.ts new file mode 100644 index 0000000..42318ad --- /dev/null +++ b/scripts/utility/dashboard/VaultAndLockDealNFT.ts @@ -0,0 +1,9 @@ +import { VaultManager } from "../../../typechain-types" +import { deploy } from "../../deploy" + +export async function deployNFTandVaultManager(baseURI: string = "") { + const vaultManager: VaultManager = await deploy("VaultManager") + await deploy("LockDealNFT", vaultManager.address, baseURI) +} + +deployNFTandVaultManager() diff --git a/scripts/utility/deployment.ts b/scripts/utility/deployment.ts deleted file mode 100644 index 5d4e316..0000000 --- a/scripts/utility/deployment.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { - VaultManager, - LockDealNFT, - DealProvider, - LockDealProvider, - CollateralProvider, - RefundProvider, -} from "../../typechain-types" -import { deploy } from "../deploy" - -export async function deployNFTandVaultManager(baseURI: string = "") { - const vaultManager: VaultManager = await deploy("VaultManager") - await deploy("LockDealNFT", vaultManager.address, baseURI) -} - -export async function deploySimpleProviders(lockDealNFT: LockDealNFT) { - const dealProvider: DealProvider = await deploy("DealProvider", lockDealNFT.address) - const lockProvider: LockDealProvider = await deploy("LockDealProvider", lockDealNFT.address, dealProvider.address) - await deploy("TimedDealProvider", lockDealNFT.address, lockProvider.address) -} - -export async function deployRefundWithCollateral(lockDealNFT: LockDealNFT, dealProvider: DealProvider) { - const collateralProvider: CollateralProvider = await deploy( - "CollateralProvider", - lockDealNFT.address, - dealProvider.address - ) - await deploy("RefundProvider", lockDealNFT.address, collateralProvider.address) -} - -export async function deployBuilders( - lockDealNFT: LockDealNFT, - refundProvider: RefundProvider, - collateralProvider: CollateralProvider -) { - await deploy("SimpleBuilder", lockDealNFT.address) - await deploy("SimpleRefundBuilder", lockDealNFT.address, refundProvider.address, collateralProvider.address) -}