Sol.College

Structure lesson (licence does not allow quoting code)

DICE

DICE Network — Distributed Infrastructure for Cryptographic Entropy. Hardware-backed VRF oracle on Solana.

Original
hariFED/DICE
SuperStack fork
Blockchains/DICE @ d5df88f
Stars
0
Last push (original)
2026-10-19
Languages
Rust, HTML, TypeScript, Python, C, Shell
Detected stack
AnchorNext.jsweb3.js
Categories
DePIN
Licence
none detected: code not quoted on Sol.College
Homepage
https://dice-ten-ashen.vercel.app

Architecture

255 source files. By extension: .tsx ×96, .rs ×90, .py ×29, .ts ×25, .c ×15.

Top-level directorySource files
frontend113
programs44
coordinator22
tests20
firmware19
sdk16
pki11
dapp-examples5

On-chain programs: programs/dice

How it works: instructions and accounts

Each instruction handler and the accounts struct it validates, found by reading the Rust source. Links go to the exact line at the pinned commit.

InstructionAccountsSource
register_deviceRegisterDeviceprograms/dice/src/lib.rs:24
request_randomnessRequestRandomnessprograms/dice/src/lib.rs:31
claim_rewardsClaimRewardsprograms/dice/src/lib.rs:67
init_escrowInitEscrowprograms/dice/src/lib.rs:73
fund_channelFundChannelprograms/dice/src/lib.rs:92
request_randomness_v2RequestRandomnessV2programs/dice/src/lib.rs:98
finalize_v2FinalizeV2programs/dice/src/lib.rs:142
withdraw_balanceWithdrawBalanceprograms/dice/src/lib.rs:168
close_channelCloseChannelprograms/dice/src/lib.rs:173
fail_roundFailRoundprograms/dice/src/lib.rs:179
resize_channelResizeChannelprograms/dice/src/lib.rs:184
close_feedCloseFeedprograms/dice/src/lib.rs:231
withdraw_from_vaultWithdrawFromVaultprograms/dice/src/lib.rs:284
fund_escrowFundEscrowprograms/dice/src/lib.rs:306
handlerCloseFeedprograms/dice/src/instructions/close_feed.rs:25
handlerFundEscrowprograms/dice/src/instructions/fund_escrow.rs:28
handlerFailRoundprograms/dice/src/instructions/fail_round.rs:25
handlerRegisterDeviceprograms/dice/src/instructions/register_device.rs:25
handlerFundChannelprograms/dice/src/instructions/fund_channel.rs:23
handlerInitEscrowprograms/dice/src/instructions/init_escrow.rs:24
handlerFinalizeRandomnessprograms/dice/src/instructions/finalize_randomness.rs:58
handlerResizeChannelprograms/dice/src/instructions/resize_channel.rs:27
handlerCloseChannelprograms/dice/src/instructions/close_channel.rs:22
handlerRequestRandomnessprograms/dice/src/instructions/request_randomness.rs:36
handlerFinalizeV2programs/dice/src/instructions/finalize_v2.rs:21
handlerRequestRandomnessV2programs/dice/src/instructions/request_randomness_v2.rs:21
handlerWithdrawFromVaultprograms/dice/src/instructions/withdraw_from_vault.rs:39
handlerWithdrawBalanceprograms/dice/src/instructions/withdraw_balance.rs:21
initializeInitializedapp-examples/coin-toss/src/lib.rs:35
dice_callbackDiceCallbackdapp-examples/coin-toss/src/lib.rs:116

Where the Solana code lives

Source files that import a Solana SDK, ranked by how many Solana APIs they use, with the APIs each one calls. Read them in this order to see how the app talks to the chain.

FileSolana APIs used
sdk/dice-vrf/src/cpi.rsPubkey, invoke, invoke_signed
tests/dice.tsPublicKey, SystemProgram, Keypair, findProgramAddressSync, Program, transfer
tests/dice_v2.tsSystemProgram, PublicKey, Keypair, Program, findProgramAddressSync, AnchorProvider
tests/devnet_setup.tsPublicKey, getAccountInfo, Keypair, SystemProgram, Transaction, sendAndConfirmTransaction
sdk/dice-vrf/src/accounts.rsPubkey, Program, invoke
dapp-examples/coin-toss/src/lib.rsseeds, Program, Pubkey, AccountInfo, CpiContext, transfer
programs/dice/src/instructions/register_node_vault.rsPubkey, seeds, init_if_needed, Program
dapp-examples/dice-roll/src/lib.rsseeds, Pubkey, Program, AccountInfo, CpiContext, transfer
programs/dice/src/instructions/credit_vault_helper.rstransfer, AccountInfo, CpiContext, Pubkey
dapp-examples/lucky-wheel/src/lib.rsseeds, Program, Pubkey, AccountInfo, CpiContext, transfer
dapp-examples/prediction-market/src/lib.rsseeds, Pubkey, AccountInfo, Program, CpiContext, transfer
sdk/dice-vrf-ts/src/instructions.tsPublicKey, SystemProgram

Dapp: devnet deploy pending

⏳ Devnet deploy pending — goes live when the devnet wallet is topped up. This fork's own dapp is not deployed yet, so there is no program address or transaction to show. It is queued in dapp-queue.txt; once devnet SOL is available it is deployed, exercised with real devnet transactions, and this section switches to the live dapp at /dapps/dice/. Until then, the lesson and step-by-step guide below are complete, and you can run it locally with the commands below.

How to run, build and test

These commands come from the repo's own manifests (package.json scripts, Anchor.toml, Cargo, go.mod, Makefile). Check the README for prerequisites and environment variables.

DirectoryCommandRuns
.npm run test
frontendnpm run dev
frontendnpm run start
frontendnpm run build
frontendnpm run lint
sdk/dice-vrf-tsnpm run build
.anchor build
.anchor test
.anchor run test
.cargo build
.cargo test

What you could build from it