Beginner FriendlyFoundryNFT
100 EXP
View results
Submission Details
Severity: high
Valid

POSSIBILITY OF SELECTING ADDRESS (0) AS THE WINNER

Summary

After the refund function has been called, the index of the player that called the refund is pegged to address (0) which is possible to be selected as the winner too. This will result in the game throwing error sometimes.

Vulnerability Details

players[playerIndex] = address(0); this will add address(0) to the players and cause error. Therefore, it is better to delete the refunded player and make the contract request a new player be added.

Impact

the select winner function may continuously throw error if the players are less than 4 due to refund which will also affect the poolprize calculation

Tools Used

manual review
remixIde

Recommendations

Updates

Lead Judging Commences

Hamiltonite Lead Judge almost 2 years ago
Submission Judgement Published
Validated
Assigned finding tags:

zero address can win the raffle

Funds are locked to no one. If someone gets the refund issue, they also got this issue. IMPACT: High Likelihood: High

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.