Contract-Monitoring
Seite: app/contracts/page.tsx (256 Zeilen)
API: app/api/contracts/route.ts (111 Zeilen)
Pfad: /contracts
Übersicht
Die Contracts-Seite zeigt Echtzeit-USDT- und ETH-Salden aller 12 Blockchain-Contracts in 4 Kategorien.
┌──────────────────────────────────────────────┐
│ Zusammenfassung │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │Total USDT│ │Contracts │ │ Largest │ │
│ │ Held │ │with USDT │ │ Holder │ │
│ │45.678,00 │ │ 8 │ │ReserveV. │ │
│ └──────────┘ └──────────┘ └──────────┘ │
├──────────────────────────────────────────────┤
│ Contract | Address | Category | USDT | ETH │
│ ReserveVault | 0x12..34 | vault | 30000 | │
│ GameManager | 0xab..cd | game | 5000 | │
│ ... │
│ [🔄 Refresh Balances] │
└──────────────────────────────────────────────┘
Contract-Registry
Die API enthält eine statische Registry aller überwachten Contracts:
Vaults
| Contract |
Env-Variable |
Beschreibung |
| ReserveVault |
RESERVE_VAULT |
Haupt-USDT-Vault für Preisgelder |
| CharityVault |
CHARITY_VAULT |
Charity-Spendengelder |
| AffiliateVault |
AFFILIATE_VAULT |
Affiliate-Reward-Claims |
| PrizeVaultV2 |
PRIZE_VAULT_V2 |
Merkle-Proofs & Claim-Historie |
| ClaimRouter |
CLAIM_ROUTER |
Prize/Affiliate Claim-Routing |
Game
| Contract |
Env-Variable |
Beschreibung |
| GameManager |
GAMEMANAGER |
Ticket-Käufe & Bonus-Validierung |
| SettlementV4 |
SETTLEMENT |
Täglicher Settlement-Prozessor |
| GameTreasury |
GAME_TREASURY |
Pot-Accounting pro Pool |
Infra
| Contract |
Env-Variable |
Beschreibung |
| VRFReceiver |
VRF_RECEIVER |
Chainlink VRF Random Number Consumer |
| Operator/Relayer |
OPERATOR |
Relayer, Bonus-Signer, Fee-Receiver |
Safes
| Contract |
Env-Variable |
Beschreibung |
| Treasury Safe (Dev) |
TREASURY_SAFE |
Development-Multisig |
| Treasury Safe (Prod) |
TREASURY_SAFE_PROD |
Production-Multisig |
Balance-Abfrage
USDT-Balance (ERC20)
// balanceOf(address) Selector = 0x70a08231
const callData = "0x70a08231" + address.slice(2).padStart(64, "0");
const result = await fetch(rpcUrl, {
method: "POST",
body: JSON.stringify({
method: "eth_call",
params: [{ to: USDT_CONTRACT, data: callData }, "latest"]
})
});
// USDT hat 6 Dezimalstellen
const balance = Number(BigInt(result)) / 1_000_000;
ETH-Balance
const result = await fetch(rpcUrl, {
method: "POST",
body: JSON.stringify({
method: "eth_getBalance",
params: [address, "latest"]
})
});
// ETH hat 18 Dezimalstellen
const balance = Number(BigInt(result)) / 1e18;
Zusammenfassungskarten
| Karte |
Berechnung |
| Total USDT Held |
Summe aller USDT-Balances |
| Contracts with USDT |
Anzahl Contracts mit Balance > 0 |
| Largest Holder |
Contract mit höchster USDT-Balance |
Anzeige-Details
- Kategorie-Farbcodierung: Vault, Game, Infra, Safe jeweils unterschiedlich
- Adress-Format: Gekürzt (0x1234...5678) mit Arbiscan-Link
- Manueller Refresh: Button zum Neuladen aller Balances
- Keine Datenbank-Queries: Rein On-Chain über RPC-Calls