豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

stepanic/modric-lottery-verify

Repository files navigation

$MODRIC Lottery — Independent On-Chain Verification

Independent cryptographic verification of all 3 Trendex $MODRIC lottery draws (signed Luka Modric jersey giveaways) using Orao VRF on Solana.

Nezavisna kriptografska verifikacija sva 3 Trendex $MODRIC nagradna izvlacenja (potpisani dresovi Luke Modrica) koristeci Orao VRF na Solani.

All 3 Draws

Draw Date Holders VRF Seed Rand Offset Winner
1 Oct 19, 2025 20 (all) 2ZhsqrcN...hpNn [40:104] (computed)
2 Nov 01, 2025 8 (all) 4SLs5v8A...Hnez [73:137] (computed)
3 Jan 14, 2026 140 (top) 5DkZHCp9...6kK [40:104] 6bwzpk...gCyA

Draw 3 Details (Main Lottery)

Field Value
Winner Wallet 6bwzpkSKSXbjVMBYMSdazEytkaCZatibRdmExpjSgCyA
VRF Seed 5DkZHCp9gbBKzcto6ezFhdFqyiqhig7cfn87Ugix36kK
VRF PDA HJyvitPbQ7AjxaH9EPHtZjsh9e4wcuaPbgJ9YQ1Q37PF
VRF Transaction 3uVX8xScuf...Fj997h
$MODRIC Mint F5qFr17LeunQk5ikRM9hseSi2bbZYXYRum8zaTegtrnd

Chain of Trust / Lanac povjerenja

What Status How
VRF Randomness On-chain Orao VRF PDA account on Solana mainnet
PDA Derivation On-chain Programmatically derived from seed, not hardcoded
VRF Transaction On-chain Transaction exists, succeeded, invoked Orao VRF
Selection Algorithm Open-source Exact port of Trendex source
$MODRIC Token On-chain Winner's token account verified on-chain
Holder Snapshots GitHub Published by Trendex (commits)

Transparency note: The holder snapshots were published by Trendex on their GitHub. VRF randomness and the selection algorithm are fully on-chain/open-source and independently verifiable. For complete trustlessness, snapshot balances can be cross-verified using an archival Solana RPC at each lottery block height.

Usage / Koristenje

CLI Verification

# Requires Node.js 18+
npm install

# Verify all 3 draws
npm run verify
# or: node verify.mjs

# Verify a single draw
node verify.mjs 3

Browser dApp

npm install
npm run serve
# Open http://localhost:3000

The browser dApp has a draw selector (tabs) to verify each draw independently.

Cloudflare Deployment

The app is hosted on Cloudflare Pages. To deploy updates:

# 1. Install wrangler globally (if not installed)
npm install -g wrangler

# 2. Login to Cloudflare (first time only)
wrangler login

# 3. Deploy the current directory
npm run deploy
# (which runs: wrangler pages deploy .)

The browser dApp has a draw selector (tabs) to verify each draw independently.

Test Suite

npm test

How It Works / Kako radi

For each draw:

  1. Load snapshot -- Load holders from Trendex's official GitHub snapshot
  2. Verify token -- Confirm $MODRIC mint exists, winner holds tokens on-chain
  3. Derive PDA -- Programmatically derive VRF account from seed using ["orao-vrf-randomness-request", seed]
  4. Fetch VRF -- Read 64-byte randomness from Orao VRF account at the draw's byte offset
  5. Verify transaction -- Confirm VRF TX exists on Solana mainnet, invoked Orao VRF
  6. Replay algorithm -- Run Trendex's exact selection algorithm:
    • Each holder gets floor(tokens / 1000) lottery slots
    • First 8 bytes of VRF randomness read as BigUInt64BE
    • Winner index = randomness_value % total_slots
  7. Compare -- Computed winner must match announced winner (where known)

Byte Offset Note

Draws 1 and 3 use randomness bytes at offset [40:104], while Draw 2 uses offset [73:137]. This difference is undocumented but both offsets produce verifiable, reproducible results against their respective VRF accounts.

Trendex Source Code Timeline

From github.com/trendexgg/trendexgg commit history:

Commit Date Description
5c5ded6 Oct 21, 2025 Initial project: randomness generation and winner selection
bf54572 Oct 21, 2025 Refactor: validation utilities, improved modularity
fdc4007 Oct 21, 2025 Remove unused scripts
f028cea Nov 1, 2025 Add November top holders data file
004c67a Jan 14, 2026 Add data directory to .gitignore
e39e2aa Jan 14, 2026 VS Code debug config, update default data path to Jan 14
dd66bc1 Jan 19, 2026 Add January 14 holder snapshot (997 holders)

Project Structure

.
├── verify.mjs                              # CLI verification (all 3 draws)
├── index.html                              # Browser dApp (draw selector)
├── server.mjs                              # Dev server (CORS proxy)
├── test/verify-lottery.test.mjs            # Test suite
├── data/
│   ├── modric_top_holders_oct_19.json      # Draw 1 snapshot (20 holders)
│   ├── modric_top_holders_nov_01.json      # Draw 2 snapshot (8 holders)
│   └── modric_top_holders_jan_14_2026.json # Draw 3 snapshot (997 holders, top 140 used)
└── package.json

On-Chain Links

Draw 3 (Main Lottery)

Draw 1

Draw 2

Token & Source

About

Independent on-chain verification of the Trendex $MODRIC lottery winner — all 3 draws

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages