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

Redundant require() check in refund()

Summary

There is a redundant require() check in the refund() method that will always be true and can be removed

Vulnerability Details

The first statement checks that playerAddress == msg.sender and the second statement check playerAddress != address(0). The msg.sender can never be address(0). Hence it's a redundant check that can be removed.

require(playerAddress == msg.sender, "PuppyRaffle: Only the player can refund");
require(playerAddress != address(0), "PuppyRaffle: Player already refunded, or is not active");

Recommendations

The second require() statement can be removed.

Updates

Lead Judging Commences

Hamiltonite Lead Judge about 2 years ago
Submission Judgement Published
Invalidated
Reason: Gas optimizations

Support

FAQs

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

Give us feedback!