From 10eeca5347f2f2e59306732cc916885236e391cf Mon Sep 17 00:00:00 2001 From: Leonard Paturel Date: Mon, 1 Jul 2024 10:39:26 +0100 Subject: [PATCH] update claim dust --- scripts/claim-dust.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/scripts/claim-dust.ts b/scripts/claim-dust.ts index a36302f..c5f179d 100644 --- a/scripts/claim-dust.ts +++ b/scripts/claim-dust.ts @@ -1,15 +1,14 @@ import { CallData } from "starknet"; +import { calculateEscrowAddress } from "../lib"; import { Gift, buildGiftCallData, executeActionOnAccount } from "../lib/claim"; import { logTransactionJson } from "./jsonTxBuilder"; /// To use this script, fill in the following value: /// - factoryAddress: the address of the factory contract -/// - escrowAddress: the address of the escrow account /// - dustReceiver: the address of the dust receiver /// - claim: the claim object const factoryAddress = ""; -const escrowAddress = ""; const dustReceiver = ""; const claim: Gift = { factory: factoryAddress, @@ -30,10 +29,6 @@ if (!dustReceiver) { throw new Error("Dust receiver address is not set. Please set it in the script file."); } -if (!escrowAddress) { - throw new Error("Escrow address is not set. Please set it in the script file."); -} - for (const key in claim) { if (key in claim && !claim[key as keyof typeof claim] && key !== "fee_amount" && key !== "gift_amount") { throw new Error(`The property ${key} is empty in the claim object.`); @@ -41,8 +36,8 @@ for (const key in claim) { } const tx = executeActionOnAccount( - "get_dust", - escrowAddress, + "claim_dust", + calculateEscrowAddress(claim), CallData.compile([(buildGiftCallData(claim), dustReceiver)]), ); logTransactionJson([tx]);