Explain solidity>multiple requires

Multiple Requires

Now let's create the function where Player O accepts the game by matching the stake.

Accept Game Requirements:

There must be a game waiting for acceptance:

require(gameActive, "No active game");

It cannot already be accepted:

require(!gameAccepted, "Already accepted");

Game isn't already over:

require(!gameOver, "Game already over");

Player O must match the stake that Player X put up:

require(msg.value == stake, "Must match stake");

Only Player O can accept:

require(msg.sender == playerO, "Only opponent can accept");

The deadline hasn't expired:

require(block.timestamp <= acceptDeadline, "Accept period expired");

After Validation:

Set gameAccepted = true;

Set lastMoveAt = uint64(block.timestamp);

Double the stake: stake = msg.value * 2;



Create the acceptGame() payable function with all validations.

Create acceptGame function
0%
0 of 11 requirements passed.
Requirements:
Declares acceptGame function
acceptGame is public payable
Checks msg.value matches stake
Checks game is active
Checks game not already accepted
Checks msg.sender is playerO
Checks deadline not expired
Checks game not over
Sets gameAccepted to true
Sets lastMoveAt
Doubles the stake