From 34dceba87f9584be9a29d0222e68aaa8c8653839 Mon Sep 17 00:00:00 2001 From: Manolis Liolios Date: Thu, 12 Oct 2023 12:08:59 -0700 Subject: [PATCH 1/2] deauth and re-auth with correct pricing --- scripts/transactions/quest_3_setup.ts | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/scripts/transactions/quest_3_setup.ts b/scripts/transactions/quest_3_setup.ts index a85e9193..09d39774 100644 --- a/scripts/transactions/quest_3_setup.ts +++ b/scripts/transactions/quest_3_setup.ts @@ -34,6 +34,18 @@ export type Range = { to: number; } +// remove discount for type +const removeDiscountForType = (txb: TransactionBlock, setup: PackageInfo, type: string) => { + txb.moveCall({ + target: `${setup.discountsPackage.packageId}::discounts::deauthorize_type`, + arguments: [ + txb.object(setup.adminCap), + txb.object(setup.discountsPackage.discountHouseId), + ], + typeArguments: [type] + }); +} + // Sets up discount prices for type. const setupDiscountForType = (txb: TransactionBlock, setup: PackageInfo, type: string, prices: Discount) => { txb.moveCall({ @@ -81,20 +93,25 @@ const setup = async (network: Network) => { // setup `discount` both for free-claims & discounts by presenting type. // 3 chars -> 250 | 4 chars -> 50 | 5 chars+ -> 10 const priceList: Discount = { - threeCharacterPrice: 250n * MIST_PER_SUI, - fourCharacterPrice: 50n * MIST_PER_SUI, + threeCharacterPrice: 450n * MIST_PER_SUI, + fourCharacterPrice: 90n * MIST_PER_SUI, fivePlusCharacterPrice: 10n * MIST_PER_SUI }; + /// deauthorize. uplaod fixed + removeDiscountForType(txb, setup, SUIFREN_BULLSHARK_TYPE[network]); + removeDiscountForType(txb, setup, SUIFREN_CAPY_TYPE[network]); + removeDiscountForType(txb, setup, DAY_ONE_TYPE[network]); + /// authorize the discounts package to allow name registrations. setupDiscountForType(txb, setup, SUIFREN_BULLSHARK_TYPE[network], priceList); setupDiscountForType(txb, setup, SUIFREN_CAPY_TYPE[network], priceList); setupDiscountForType(txb, setup, DAY_ONE_TYPE[network], priceList); // authorize the free claims to allow free claiming for 10+ names. - setupFreeClaimsForType(txb, setup, SUIFREN_BULLSHARK_TYPE[network], { from: 10, to: 63 }); - setupFreeClaimsForType(txb, setup, SUIFREN_CAPY_TYPE[network], { from: 10, to: 63 }); - setupFreeClaimsForType(txb, setup, DAY_ONE_TYPE[network], { from: 10, to: 63 }); + // setupFreeClaimsForType(txb, setup, SUIFREN_BULLSHARK_TYPE[network], { from: 10, to: 63 }); + // setupFreeClaimsForType(txb, setup, SUIFREN_CAPY_TYPE[network], { from: 10, to: 63 }); + // setupFreeClaimsForType(txb, setup, DAY_ONE_TYPE[network], { from: 10, to: 63 }); // for mainnet, we prepare the multi-sig tx. if(network === 'mainnet') return prepareMultisigTx(txb, 'mainnet'); From cdb03d5465dc4c00d5baaaf6d92f4a5575244f22 Mon Sep 17 00:00:00 2001 From: Manolis Liolios Date: Thu, 12 Oct 2023 12:11:18 -0700 Subject: [PATCH 2/2] fix --- scripts/transactions/quest_3_setup.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/scripts/transactions/quest_3_setup.ts b/scripts/transactions/quest_3_setup.ts index 09d39774..b890925c 100644 --- a/scripts/transactions/quest_3_setup.ts +++ b/scripts/transactions/quest_3_setup.ts @@ -80,15 +80,15 @@ const setup = async (network: Network) => { const txb = new TransactionBlock(); - // authorize `discount` package to claim names - txb.moveCall({ - target: `${setup.packageId}::suins::authorize_app`, - arguments: [ - txb.object(setup.adminCap), - txb.object(setup.suins), - ], - typeArguments: [`${setup.discountsPackage.packageId}::house::DiscountHouseApp`], - }); + // // authorize `discount` package to claim names + // txb.moveCall({ + // target: `${setup.packageId}::suins::authorize_app`, + // arguments: [ + // txb.object(setup.adminCap), + // txb.object(setup.suins), + // ], + // typeArguments: [`${setup.discountsPackage.packageId}::house::DiscountHouseApp`], + // }); // setup `discount` both for free-claims & discounts by presenting type. // 3 chars -> 250 | 4 chars -> 50 | 5 chars+ -> 10