The use of strict equalities in enterRaffle may make it challenging for players to participate in the raffle.
When a player attempts to call enterRaffle with msg.value higher or lower than entranceFee * newPlayers.length, the protocol reverts with a "PuppyRaffle: Must send enough to enter raffle" error.
The provided test demonstrates the validity and severity of this vulnerability.
Requirements:
Install Foundry.
Clone the project codebase into your local workspace.
Step-by-step Guide to Run the Test:
Ensure the above requirements are met.
Copy the test below and add it to PuppyRaffleTest.t.sol tests.
Execute the following command in your terminal to run the test:
Note that the test passes even though the caller sends more than enough to enter the raffle.
Creates a Poor User Experience: The current strict equality check can frustrate potential players, leading to a poor user experience. PuppyRaffle may miss out on potential revenue as frustrated players give up on participating.
Foundry
Change the strict equality == to a more flexible option >=. The modified function should look like this:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.