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

Unused and bad implementation of PuppyRaffle::_isActivePlayer function

Summary

PuppyRaffle::_isActivePlayer function not being utilized is causing other severe vulnerabilities.

Vulnerability Details

The PuppyRaffle::_isActivePlayer function is never called and if it is it can only check if msg.sender is an active player which is not sufficient to prevent some of the other reported vulnerabilities.

Impact

This function not being used is causing other severe vulnerabilities.

Tools Used

Foundry

Recommendations

Call the function where it's important that the user is an active participant of the raffle in PuppyRaffle::selectWinner and PuppyRaffle::enterRaffle functions.

-- function _isActivePlayer() internal view returns (bool) {
++ function _isActivePlayer(address player) internal view returns (bool) {
for (uint256 i = 0; i < players.length; i++) {
-- if (players[i] == msg.sender) {
++ if (players[i] == player && players[i] != address(0)) {
return true;
}
}
return false;
}
Updates

Lead Judging Commences

Hamiltonite Lead Judge about 2 years ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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

Give us feedback!