Skip to content

Commit

Permalink
chore(parse): fix parse calc
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbeckers committed Nov 6, 2023
1 parent d467682 commit c8f73a5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion frontend/lib/parsing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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

Expand Down

0 comments on commit c8f73a5

Please sign in to comment.