Contract V11 is a full TRIA-based tournament system deployed at:
0x8a7eA75b0F107b76A90BB690212E9cef6f02e0aB
Key Changes from V10:
- ❌ No more ETH → TRIA swap
- ✅ Direct TRIA deposits
- ✅ Min: 50,000 TRIA
- ✅ Max: 6,000,000,000 TRIA
- ✅ Same commit-reveal, dice roll, prize distribution logic
- File:
src/lib/contracts/etherTrialsTRIAv11ABI.ts - Exports:
ETHER_TRIALS_TRIA_V11_ADDRESSTRIA_TOKEN_ADDRESSETHER_TRIALS_TRIA_V11_ABIERC20_ABI(for TRIA token approval)
- File:
src/hooks/useTRIAContractv11.ts - Key Functions:
useTriaBalance(address)- Get TRIA balanceuseTriaAllowance(address)- Check approvalapproveTria(amount)- Approve TRIA spendingenterTournament(triaAmount)- Deposit TRIA to enter- All other functions same as V10
- File:
src/components/game/TournamentEntryModalV11.tsx - Features:
- TRIA balance display
- "Buy TRIA" button → Opens DeFi Llama swap
- Entry amount input (50k - 6B TRIA)
- Automatic TRIA approval flow
- Prize distribution preview
- File:
src/components/game/RealtimePrizePoolV11.tsx - Features:
- Live TRIA prize pool display
- Participant count
- Entry bounds info
- Prize distribution (80/20 split)
Update src/app/page.tsx:
// BEFORE (V10 - ETH to TRIA swap)
import { TournamentEntryModalV10 } from '@/components/game/TournamentEntryModalV10';
const RealtimePrizePoolV10 = dynamic(() => import('@/components/game/RealtimePrizePoolV10').then(mod => ({ default: mod.RealtimePrizePoolV10 })), { ssr: false });
import { useTRIAContractv10 } from '@/hooks/useTRIAContractv10';
// AFTER (V11 - Direct TRIA)
import { TournamentEntryModalV11 } from '@/components/game/TournamentEntryModalV11';
const RealtimePrizePoolV11 = dynamic(() => import('@/components/game/RealtimePrizePoolV11').then(mod => ({ default: mod.RealtimePrizePoolV11 })), { ssr: false });
import { useTRIAContractv11 } from '@/hooks/useTRIAContractv11';Update Component Usage:
// Replace V10 modal with V11
<TournamentEntryModalV11
isOpen={true}
onClose={handlePaymentCancel}
onSuccess={handlePaymentComplete}
/>
// Replace V10 prize pool with V11
<RealtimePrizePoolV11 />Keep both V10 and V11 components for testing:
const [useV11, setUseV11] = useState(false); // Toggle in admin panel
{useV11 ? (
<TournamentEntryModalV11 ... />
) : (
<TournamentEntryModalV10 ... />
)}const { data: triaBalance } = useTriaBalance(address);
// If insufficient, show "Buy TRIA" button- User clicks "Buy TRIA" button in modal
- Opens DeFi Llama swap: ETH → TRIA
- URL:
https://swap.defillama.com/?chain=base&from=0x0000000000000000000000000000000000000000&to=0xD852713dD8dDF61316DA19383D0c427aDb85EB07
const { data: allowance } = useTriaAllowance(address);
if (allowance < entryAmount) {
await approveTria(entryAmount);
}await enterTournament(triaAmountInWei);
// 80% → Prize Pool
// 20% → Platform Fees- Same flow as V10: dice roll → commit → play → reveal
- Same as V10:
claimReward(period)orclaimRewards([periods])
| Parameter | Value | Notes |
|---|---|---|
| Min Entry | 50,000 TRIA | Hardcoded in contract |
| Max Entry | 6,000,000,000 TRIA | 6 billion TRIA |
| Decimals | 18 | Standard ERC20 |
Entry Amount Examples:
- Min:
50000 * 10^18wei - 100k:
100000 * 10^18wei - 1M:
1000000 * 10^18wei - Max:
6000000000 * 10^18wei
- Test TRIA approval flow on testnet
- Verify "Buy TRIA" button opens correct swap URL
- Test entry with various amounts (50k, 100k, 1M)
- Verify prize pool updates in real-time
- Test commit-reveal flow (same as V10)
- Test dice roll purchases with TRIA
- Test prize claiming
- Update admin panel to use V11 hooks
- Update all V10 references to V11
- Remove V10 components (optional, after testing)
Unlike V10 (payable ETH), V11 requires:
- User approves contract to spend TRIA
- Then user calls
enterTournament(amount)
- V10: User sends ETH → Contract swaps to TRIA
- V11: User must own TRIA → Direct deposit
- Opens external swap interface (DeFi Llama)
- User completes swap outside app
- Returns to app with TRIA to enter
- V11 is cheaper than V10!
- No Uniswap swap = ~100-200k gas savings
- Just approval + transfer ≈ 100-150k gas
# Contract Address
0x8a7eA75b0F107b76A90BB690212E9cef6f02e0aB
# TRIA Token
0xD852713dD8dDF61316DA19383D0c427aDb85EB07
# Test with minimum amount
1. Get TRIA from swap (50k minimum)
2. Approve contract: approve(0x8a7eA75b0F107b76A90BB690212E9cef6f02e0aB, 50000 * 10^18)
3. Enter tournament: enterTournament(50000 * 10^18)
4. Check period info
5. Play game & submit scoreAll V11 components are ready. To activate:
- Update
src/app/page.tsximports (see Option 1 above) - Update prize pool mode from "MAINTENANCE" to "ACTIVE"
- Test thoroughly with small amounts first
- Monitor first few entries for any issues
- Scale up once confirmed working
- Show "Buy TRIA" button
- Guide user to swap ETH → TRIA
- Automatically trigger approval flow
- Modal handles this seamlessly
- Enforce bounds in UI: 50k - 6B TRIA
- Show helpful error messages
- Check
userEntry.hasEnteredbefore showing modal - Display period end time
If you encounter issues:
- Check contract on BaseScan
- Verify TRIA token address
- Ensure user has sufficient TRIA
- Test approval flow separately
- Check console logs for errors
Version: V11
Network: Base Mainnet
Status: ✅ Ready for Integration
Last Updated: 2025-01-17