suivant la fonction "function withdraw(uint256 gameId, uint256 amount) public payable {…
Jump to turn (7)
- 1suivant la fonction "function withdraw(uint256 gameId, uint256 amount) public pa
- 2context ("FONCTION RETRAIT - GAGNANT", () => { before(async function() { penduel
- 3j'ai une erreur " Error: invalid address (argument="address", value={"from":"0x1
- 4comment tester ceci : address winner = games[gameId].winner;
- 5winner fait partie d'une structure " struct Game { address player1; address play
- 6il n'y a pas de fonction winner, winner est défini de cette manière games[gameId
- 7"await penduelInstance.setGameWinner(gameId, currentPlayer);" il n'y a pas de fo
- User
suivant la fonction "function withdraw(uint256 _gameId, uint256 _amount) public payable { address winner = games[_gameId].winner; currentPlayer = msg.sender; require(currentPlayer == games[_gameId].player1 || currentPlayer == games[_gameId].player2, "You re not a player"); require(!games[_gameId].player1HasWithdrawn || !games[_gameId].player2HasWithdrawn, "withdrawn balance"); uint256 balance = playerBalances[_gameId][currentPlayer].balance; require(balance >= _amount, "Insufficient balance"); require(winner == currentPlayer, "You are not the winner");