From 80187f6998626f957c4944cd5923ef24ceb28212 Mon Sep 17 00:00:00 2001 From: Bruno Campos Date: Tue, 2 Apr 2024 10:13:49 -0300 Subject: [PATCH] Using contract names as keys --- scripts/deploy.ts | 51 +++++++++++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 22 deletions(-) diff --git a/scripts/deploy.ts b/scripts/deploy.ts index cabeee6..8cf8ba5 100644 --- a/scripts/deploy.ts +++ b/scripts/deploy.ts @@ -2,13 +2,13 @@ import { ethers } from 'hardhat'; import { writeFile } from 'fs/promises'; // Initial function for logs and configs -async function init(): Promise> { +async function init(): Promise> { console.log(" - Deploying contracts..."); return {}; } // Deploy main contracts for the ERC3643 Standart (T-REX) -async function deployERC3643(contracts: Record): Promise> { +async function deployERC3643(contracts: Record): Promise> { console.log(' - Deploying ERC3643 contracts...'); const [deployer] = await ethers.getSigners(); @@ -59,22 +59,26 @@ async function deployERC3643(contracts: Record): Promise): Promise> { +async function deployComplianceModules(contracts: Record): Promise> { const [deployer] = await ethers.getSigners(); // Deploy compliance Modules @@ -83,21 +87,26 @@ async function deployComplianceModules(contracts: Record): Promi return { ...contracts, - requiresNFTModule: await requiresNFTModule.getAddress(), - countryAllowModule: await countryAllowModule.getAddress(), + compliance: { + RequiresNFTModule: await requiresNFTModule.getAddress(), + CountryAllowModule: await countryAllowModule.getAddress(), + } } } // Deploy Vault contracts -async function deployVault(contracts: Record): Promise> { +async function deployVault(contracts: Record): Promise> { console.log(' - Deploying Vault contracts...'); return { - ...contracts + ...contracts, + vault: { + + } }; } // creates a deployment file into data/deployments (eg: data/deployments/mainnet.json) -async function exportDeploymentVersion(contracts: Record): Promise> { +async function exportDeploymentVersion(contracts: Record): Promise> { console.log(' - Export Deployment contract addresses...'); const network = await ethers.provider.getNetwork(); const filePath = `./data/deployments/chain-${network.chainId.toString()}.json` @@ -105,9 +114,7 @@ async function exportDeploymentVersion(contracts: Record): Promi await writeFile(filePath, jsonData, 'utf-8'); console.log(` - Deployment addresses written to ${filePath}`); - return { - ...contracts - } + return contracts; } // Finish function