Skip to content

Commit

Permalink
Fix game: allow only the winner to withdraw, not anyone except them
Browse files Browse the repository at this point in the history
  • Loading branch information
silverologist committed Dec 24, 2024
1 parent 664b656 commit a4b455e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/VulnerableGame.sol
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ contract VulnerableGame {
* After the winner withdraws, the total balance is reset to 0.
*/
function withdraw() public {
if (msg.sender == winner) {
if (msg.sender != winner) {
revert VulnerableGame__OnlyWinnerCanWithdraw();
}

Expand Down

0 comments on commit a4b455e

Please sign in to comment.