Skip to content

Instantly share code, notes, and snippets.

@mycodecrafting
mycodecrafting / select-winner.js
Created May 9, 2025 13:34
Home-studio winner selection
// Set block number to select winner from
const BLOCK_NUMBER = 12863570;
(async () => {
console.log(`Selecting winner from block ${BLOCK_NUMBER}`);
// collect all the ticket issued events, in order
const request = {
cursor: "984122-0",
signatures: ["TicketIssued(address indexed user, bool hasBonus)"],
const axios = require('axios');
const shuffle = require('knuth-shuffle-seeded');
const { Spinner } = require('clui');
const BLOCK_OF_SELECTION = 2291725;
function delay(time) {
return new Promise(resolve => setTimeout(resolve, time * 1000));
}
I am attesting that this GitHub handle mycodecrafting is linked to the Tezos account tz1codeYURj5z49HKX9zmLHms2vJN2qDjrtt for tzprofiles
sig:edsigtvq3BfsJSTLdSEwdof5Wyw3c2C53ywUX7q3tJZQ2PFPoQrYKDCfZQmQsxgtSZ4rsiFNiEZ2hrrNL2cSHzFT5QbfowtD6Tq

Keybase proof

I hereby claim:

  • I am mycodecrafting on github.
  • I am codecrafting (https://keybase.io/codecrafting) on keybase.
  • I have a public key whose fingerprint is B281 237D 231E BBA6 D288 5185 5B62 38A9 AAB6 DBEE

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am phpcodecrafting on github.
  • I am codecrafting (https://keybase.io/codecrafting) on keybase.
  • I have a public key ASBDEa2AjT5K7sKebSKjYE3pijDxhkjZNjtMizfqRT5bRgo

To claim this, I am signing this object: