From ade83a8ed166cea0094ec0188f9f8a450bbfe959 Mon Sep 17 00:00:00 2001 From: Dennis Zoma Date: Thu, 25 Jul 2024 08:07:47 +0200 Subject: [PATCH] feat(scripts): Add `NEW_CONFIG` deploy param to set updated fee & registration period --- scripts/deploy.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/deploy.ts b/scripts/deploy.ts index 109b17c..4a6f69d 100644 --- a/scripts/deploy.ts +++ b/scripts/deploy.ts @@ -18,6 +18,7 @@ import { writeContractAddresses } from './utils/writeContractAddresses' * - `CHAIN`: Chain ID (optional, defaults to `development`) * - `ADMIN`: Address of contract admin (optional, defaults to caller) * - `RESERVATIONS`: Path to .csv file with reserved names & addresses + * - `NEW_CONFIG`: If set, use new default price (10 AZERO) & max registration duration (200 years) * * Example usage: * - `CHAIN=alephzero-testnet ADMIN=5feiā€¦ RESERVATIONS=reserved-names.csv pnpm run deploy` @@ -27,8 +28,15 @@ const main = async () => { const chainId = initParams.chain.network // Deploy all contracts + const useNewConfig = ['true', true, '1', 1].includes(process.env.NEW_CONFIG || '') + const feeCalculator = await deployFeeCalculator( + initParams, + useNewConfig && { + maxRegistrationDuration: 200, + commonPrice: initParams.toBNWithDecimals(10), + }, + ) const nameChecker = await deployNameChecker(initParams) - const feeCalculator = await deployFeeCalculator(initParams) const tlds = chainId === alephzero.network ? ['azero', 'a0'] : ['tzero'] const tld = tlds[0] const baseUri =