5. Randomness (Chainlink VRF)

  • Contract uses VRF v2.5 (VRFConsumerBaseV2Plus).

  • Requests 2 random words and shuffles a 60-number deck (Fisher–Yates) to pick 6 unique numbers in [1..60].

  • Draw is stored as a 60‑bit mask winningMask (bit i means number i+1 was drawn).

Decoding the mask

// numbers from a 60-bit mask
function maskToNumbers(mask) {
  const out = [];
  for (let i = 1; i <= 60; i++) {
    if ((BigInt(mask) & (1n << BigInt(i - 1))) !== 0n) out.push(i);
    if (out.length === 6) break;
  }
  return out;
}