PageSourceSearch

https://badmickey.netlify.app/shared/minnie-raid-prizes.mjs

js badmickey.netlify.app collected 2026-10-03 10:29:22 UTC 3,809 bytes, 84 lines download raw bytes

1/** Canonical Bad Minnie raid prize rules. Token math is always atomic (9 decimals). */
2export const MINNIE_RAID_TOKEN_SCALE = 1_000_000_000n;
3
4const tokens = (value) => BigInt(value) * MINNIE_RAID_TOKEN_SCALE;
5
6const weeklyPlacements = Object.freeze({
7  1: tokens(5_000_000), 2: tokens(4_000_000), 3: tokens(3_000_000),
8  4: tokens(2_000_000), 5: tokens(2_000_000),
9  6: tokens(1_000_000), 7: tokens(1_000_000), 8: tokens(1_000_000),
10  9: tokens(1_000_000), 10: tokens(1_000_000),
11});
12
13const finalePlacements = Object.freeze({
14  1: tokens(3_000_000), 2: tokens(2_500_000), 3: tokens(2_000_000),
15  4: tokens(1_500_000), 5: tokens(1_500_000),
16  6: tokens(700_000), 7: tokens(700_000), 8: tokens(700_000),
17  9: tokens(700_000), 10: tokens(700_000),
18});
19
20const round = (key, label, type) => Object.freeze({
21  key,
22  label,
23  type,
24  // Only leaderboard places 1-10 are recorded. The previously advertised
25  // outside-top-ten pools remain in the raid reserve and are never inferred.
26  poolAtoms: type === "weekly" ? tokens(21_000_000) : tokens(14_000_000),
27  placements: type === "weekly" ? weeklyPlacements : finalePlacements,
28});
29
30export const MINNIE_RAID_ROUNDS = Object.freeze([
31  round("minnie_week_1", "Minnie Week 1", "weekly"),
32  round("minnie_week_2", "Minnie Week 2", "weekly"),
33  round("minnie_week_3", "Minnie Week 3", "weekly"),
34  round("minnie_week_4", "Minnie Week 4", "weekly"),
35  round("minnie_finale", "Minnie Final Two-Day Leaderboard", "finale"),
36]);
37
38export const minnieRaidRound = (key) => MINNIE_RAID_ROUNDS.find((entry) => entry.key === key) ?? null;
39
40export function minnieRaidPrizeAtoms(roundKey, placement) {
41  const rule = minnieRaidRound(roundKey);
42  return rule?.placements?.[Number(placement)] ?? null;
43}
44
45/**
46 * Lock-time calculation. Empty places are unpaid; entered places keep their
47 * fixed prizes. No winner is promoted and no skipped prize is redistributed.
48 */
49export function calculateMinnieRaidAwards(roundKey, entries) {
50  const rule = minnieRaidRound(roundKey);
51  if (!rule) return { ok: false, error: "Unknown Minnie raid round." };
52  if (!Array.isArray(entries)) return { ok: false, error: "Raid entries must be a list." };
53  const rows = entries;
54  const wallets = new Set();
55  const placements = new Set();
56  for (const entry of rows) {
57    if (!entry?.wallet || wallets.has(entry.wallet)) return { ok: false, error: "Each wallet can appear only once." };
58    wallets.add(entry.wallet);
59    if (entry.category === "placement") {
60      const place = Number(entry.placement);
61      if (!Number.isInteger(place) || place < 1 || place > 10 || placements.has(place)) {
62        return { ok: false, error: "Top-ten placements must be unique numbers from 1 through 10." };
63      }
64      placements.add(place);
65    } else return { ok: false, error: "Only top-ten raid placements are supported." };
66  }
67  const skippedPlacements = Array.from({ length: 10 }, (_, index) => index + 1)
68    .filter((place) => !placements.has(place));
69  const awards = rows.map((entry) => ({
70    ...entry,
71    amountAtoms: rule.placements[Number(entry.placement)],
72  }));
73  const totalAtoms = awards.reduce((total, entry) => total + entry.amountAtoms, 0n);
74  const unawardedAtoms = skippedPlacements.reduce((total, place) => total + rule.placements[place], 0n);
75  if (totalAtoms + unawardedAtoms !== rule.poolAtoms) return { ok: false, error: "Raid award accounting does not match the published pool." };
76  return { ok: true, rule, awards, totalAtoms, skippedPlacements, unawardedAtoms };
77}
78
79export function formatMinnieAtoms(atoms) {
80  const value = BigInt(atoms ?? 0);
81  const whole = value / MINNIE_RAID_TOKEN_SCALE;
82  const fraction = String(value % MINNIE_RAID_TOKEN_SCALE).padStart(9, "0").replace(/0+$/, "");
83  return `${whole.toLocaleString("en-US")}${fraction ? `.${fraction}` : ""}`;
84}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.