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

EnterRaffle and Refund can be called even after raffle duration has passed.

Summary

Players can enter and refund after the raffleDuration has ended, but before selectWinner is called.

Vulnerability Details

It is not likely to have any adverse effects to the contract itself, but could lead to unexpected behavior and a suboptimal UX.

Impact

the impact is low, it is mostly a UX issue/design decision.
If a player enters the raffle in the same block as a transaction calling selectWinner, who calls selectWinner

the dapp might also advertise the raffle as being over, however they still would be allowed to enter but that might not be clear to the end users.

Tools Used

Manual Review

Recommendations

if the desired outcome is more of a closed system, then checks could be performed to make sure that 'block.timestamp <=raffleStartTime + raffleDuration' in enterRaffle() and refund().
It is acceptable to keep as is, but the documentation should be very clear about this.

Updates

Lead Judging Commences

Hamiltonite Lead Judge about 2 years ago
Submission Judgement Published
Invalidated
Reason: User experience and design improvement
Hamiltonite Lead Judge about 2 years ago
Submission Judgement Published
Validated
Assigned finding tags:

PuppyRaffle::selectWinner() - L126: should use `>` instead of `>=`

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

PuppyRaffle::selectWinner() - L126: should use `>` instead of `>=`

Support

FAQs

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

Give us feedback!