Joining Games
How to participate in existing Gaambl Lotto games
Joining Process
Players can join active games by paying the exact entry fee in the specified token.
Requirements
- • Game must be in ACTIVE state
- • Game must not be expired or full
- • Pay exact entry fee in specified token
- • Cannot join the same game twice
Function Signature
function joinGame(uint256 gameId) external payablePayment Requirements
ETH Games
- • Send exact entry fee as msg.value
- • No token approval needed
- • Payment handled automatically
ERC-20 Games
- • Approve token transfer first
- • Send msg.value = 0
- • Token transfer handled by contract
Auto-Completion
When Games Complete
Games automatically trigger completion in two scenarios:
Max Players Reached
When the last player joins and reaches the maximum player limit, the game immediately requests randomness and begins the completion process.
Manual Completion
Anyone can call completeExpiredGame(gameId) after the game duration expires to trigger completion for games with 2+ players.