This is the full smart contract:https://github.com/laronlineworld/betMatch/blob/main/betMatch.sol
This is betting contract, when betting on id_1, the same address can't bet on id_2. I'm using Game storage
function bet(uint _gameId, uint8 _teamSelected) public payable {
Game storage game = gameInfo[_gameId];
require(game.state == State.Created,"Game has not been created");
require(bettingActive);
//The first require is used to check if the player already exist
require(!checkPlayerExists(msg.sender));
//The second one is used to see if the value sended by the player is
//Higher than the minimum value
require(msg.value >= minimumBet);
//We set the player informations : amount of the bet and selected team
playerInfo[msg.sender].amountBet = msg.value;
playerInfo[msg.sender].teamSelected = _teamSelected;
//then we add the address of the player to the players array
players.push(msg.sender);
//at the end, we increment the stakes of the team selected with the player bet
if ( _teamSelected == 1){
totalBetsOne += msg.value;
}
else{
totalBetsTwo += msg.value;
}
}