Browser-based hero clash game built with React + TypeScript + Canvas integrated with Hedera-native on-chain automation and ETH / USDC deposits.
StakeClash provides:
- Wallet-based participation
- Non-custodial deposits
- On-chain reward execution
- Cross-asset staking (HBAR, ETH, USDC)
StakeClash executes season payouts using Hedera-native scheduling.
- No cron jobs
- No keeper bots
- No off-chain execution triggers
- Scheduling initiated from controlled logic
- Lifecycle fully observable
┌──────────────────────────────────────────────────────────────┐
│ StakeClash │
├──────────────────────────────────────────────────────────────┤
│ Frontend (React + Canvas) │
│ ├─ Hero Select │
│ ├─ Skill Tree │
│ ├─ Match Flow │
│ └─ Rewards Screen │
├──────────────────────────────────────────────────────────────┤
│ Automation Layer │
│ ├─ Deposit Detection │
│ ├─ Season Lifecycle │
│ ├─ Schedule Creation │
│ ├─ Cross-Asset Sync (ETH / USDC) │
│ └─ Mirror Polling │
├──────────────────────────────────────────────────────────────┤
│ Hedera Network │
│ ├─ Smart Contracts │
│ ├─ Schedule Service │
│ ├─ Native Execution Engine │
│ └─ Mirror Node │
├──────────────────────────────────────────────────────────────┤
│ Ethereum (Sepolia) │
│ ├─ ETH Deposits │
│ └─ USDC Deposits │
└──────────────────────────────────────────────────────────────┘
Users deposit:
- HBAR → Hedera treasury
- ETH → EVM treasury
- USDC → ERC-20 treasury
Deposits are detected and recorded.
No payout is scheduled at deposit time.
When a season begins:
For each participant:
- Compute payout
- Create
TransferTransaction - Wrap in
ScheduleCreateTransaction - Call
.setWaitForExpiry(true) - Store Schedule ID
Execution is not immediate.
The schedule is stored on Hedera.
Hedera:
- Tracks required signatures
- Executes at readiness/expiry
- Emits transaction record
- Expires invalid schedules
Execution timing is network-controlled.
- User deposits ETH or USDC on Sepolia
- Backend listens to transfer events
- Deposit normalized into internal accounting
- Season start:
- Hedera schedules HBAR payout
- ETH / USDC payout transactions prepared
- When Hedera schedule executes:
- ETH / USDC transfers executed in same payout cycle
HBAR acts as execution anchor.
ETH / USDC follow the same deterministic payout window.
StakeClash
├── Presentation Layer
│ ├── Clash.tsx (match flow)
│ ├── Skill Tree UI
│ ├── Search / Loading
│ └── Rewards Screen
│
├── Game Engine (RaidGame.tsx)
│ ├── requestAnimationFrame loop
│ ├── Entity simulation
│ ├── Collision system
│ ├── Ability state machines
│ └── Sprite rendering
│
├── Automation Backend
│ ├── Deposit watcher
│ ├── Schedule creator
│ ├── Cross-chain handler
│ └── Mirror polling
│
└── Networks
├── Hedera
└── Ethereum
The deterministic scheduling engine extracted from StakeClash has been converted into a reusable Hedera Schedule Service plugin module.
In StakeClash, Schedule Service enforces:
- Season timing
- Principal refunds
- Deterministic payout execution
Instead of backend timers or manual triggers, a scheduled transaction is created at season start and the Hedera network guarantees execution at expiry.
This module formalizes that pattern into a developer-facing toolkit providing:
- Structured schedule creation
- Lifecycle inspection
- Execution monitoring
- Deterministic network-enforced automation
- Schedule creation wrappers
- Expiry configuration
- Signature readiness handling
- Status querying utilities
- Execution verification helpers
hiero schedule:create \
--from 0.0.1234 \
--to 0.0.5678 \
--amount 100000000 \
--wait-for-expiry true \
--expiry 1800
hiero schedule:status --schedule-id 0.0.9999
hiero schedule:monitor --schedule-id 0.0.9999
Output includes:
- Schedule ID
- Expiry timestamp
- Execution status
- Transaction reference
- Failure reason (if applicable)
The plugin generalizes the production scheduling pattern used in StakeClash to:
- Enforce season timing
- Guarantee principal refunds
- Trigger payout windows
- Synchronize cross-asset settlements
Frontend:
- React
- TypeScript
- HTML Canvas
Blockchain:
- Hedera Testnet
- Hedera Schedule Service
- Solidity (EVM-compatible)
- Mirror Node API
- Ethereum (Sepolia)
- ERC-20 (USDC)
Install:
npm install
Compile contracts:
npx hardhat compile
Start frontend:
npm run dev
Start scheduler (required):
npm run scheduler
Scheduler handles:
- Deposit detection
- Schedule monitoring
- Season execution
- Cross-chain synchronization