Permanent block entropy, multi-token duels (Coinflip, Dice, RPS), and automated house fee burn
MiniGamesEcosystem.sol provides an on-chain PvP and PvE mini-games engine. To guarantee mathematical fairness without paying expensive off-chain oracle fees, it employs a 3-phase Commit-Reveal scheme.
- Phase 1 (Creation): Player 1 commits their secret move hash:
keccak256(choice, salt). - Phase 2 (Join): Player 2 commits a secret seed:
keccak256(secret). The contract permanently locks block entropy. - Phase 3 (Settle): Player 1 reveals their salt and choice. The contract computes the deterministic outcome.
Standard Ethereum blockhash lookups become 0 after 256 blocks (~5 minutes), causing unrevealed games in other protocols to brick. TribFi solves this by capturing and permanently storing block entropy in state during Player 2's commit:
Supports binary games (Coinflip, Rock-Paper-Scissors, Red/Black, High/Low), 6-sided Dice duels, 2-dice Craps, Card draw battles, and 1–100 Percentile battles.
House fees (default 3.0%, capped at 10%) are automatically sent to BURN_ADDRESS (0x0...dEaD) when burnHouseFee is active. This permanently reduces token supply whenever tribe members play. A daily Freeplay Faucet provides 1,000 credits for risk-free training.