Events let your contract log important actions. Frontend apps can listen for these events.
What Are Events?
Events are logs stored on the blockchain that external apps can read.
They're much cheaper than storing data in state variables.
Declaring Events:event GameStarted(address indexed playerX, address indexed playerO, uint stake);
The indexed keyword makes parameters searchable/filterable.
Emitting Events:
Use the emit keyword to trigger an event: emit GameStarted(playerX, playerO, stake);
Your Task:
1. Declare two events at the top: GameStarted and GameEnded
2. Emit GameStarted at the end of startGame
3. Emit GameEnded when gameOver is set to true in makeMove