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

'refund' function introduces duplicates in players array

Summary

'refund' function introduces duplicates in players array

Vulnerability Details

The refund function gives option of the function callers to exit the raffle retrieving back 'entranceFee' amount of money. Where this does not result in a reentrancy attack(reported in another finding) leaves the corresponding index in players array with value address(0).

Impact

If the refund is called twice for different indexes we would end up with players array having duplicate values (address(0)). That would make it impossible for further addresses to enter the raffle given the implementation of the 'enterRaffle' function which reverts if duplicate addresses are found in the players array.

Tools Used

Manual review

Recommendations

Remove the refund() function.

Updates

Lead Judging Commences

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

refund-doesnt-reduce-players-array-size-causing-protocol-to-freeze

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.