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

Reentrancy in selectWinner function

Summary

Reentrancy guard not present for SelectWinner function.

Vulnerability Details

selectWinner
function selectWinner() external { 👈 we're dealing with money & changing states here but without a Reentrancy Guard.
// statements...
// statements...
}

Impact

Raffle can misbehave, Winner might not be so random further more, Would not be considered a Fair Raffle (lottery).

Tools Used

Manual review

Recommendations

We should use openzeppelin library's utility called Reentrancy Guard.

See Below... 👇

selectWinner Reentrancy Guard Added
import {ReentrancyGuard} from "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
//...
//...
//...
function selectWinner() external nonReentrant { 👈 here i added nonReentrant modifier.
// statements...
}
Updates

Lead Judging Commences

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

reentrancy-in-refund

reentrancy in refund() function

Support

FAQs

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

Give us feedback!