From c8f73a539cad8f0370aa047bb18333ad82195d02 Mon Sep 17 00:00:00 2001 From: bitbeckers Date: Mon, 6 Nov 2023 14:49:54 +0100 Subject: [PATCH] chore(parse): fix parse calc --- frontend/lib/parsing.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/lib/parsing.ts b/frontend/lib/parsing.ts index ced8d3f4..6daccd78 100644 --- a/frontend/lib/parsing.ts +++ b/frontend/lib/parsing.ts @@ -27,10 +27,12 @@ export function parseAllowlistCsv( console.error("Errors parsing allowlist:", errors); throw new InvalidDataError("Errors parsing allowlist"); } + + console.log(rawData); // Get the addresses and units from the CSV const csvData = rawData.map((row: any) => ({ address: row["address"].trim().toLowerCase(), - units: BigInt((row["fractions"].trim(), 10)), + units: BigInt(row["fractions"].trim()), })); const csvTotalSupply = csvData.reduce( (accum, curr) => accum + curr.units, @@ -55,8 +57,10 @@ export function parseAllowlistCsv( } } // Combine CSV data with manually added addresses + // 0.75 const csvTotalPercentage = 1.0 - addTotalPercentage; + // 75 const percentageBigInt = BigInt(Math.floor(csvTotalPercentage * 100)); // convert percentage to BigInt const creatorSupply = (csvTotalSupply * 100n) / percentageBigInt; // calculate total supply