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

Destruction of withdrawFees() function by sending native tokens

Summary

Sending native tokens can skew the validation of the withdrawFees() function

Vulnerability Details

The withdrawFees() function has the following validations.
require(address(this).balance == uint256(totalFees), "PuppyRaffle: There are currently players active!");
Since address(this).balance can be changed by forcing ETH to be sent, this validation can always fail.
This makes withdrawFees() virtually impossible to invoke.

Impact

fee will not be able to collect.

Tools Used

Manual

Recommendations

Stop referring to address(this).balance. Prepare another variable to manage whether the game is active or not.

Updates

Lead Judging Commences

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

greifers-send-money-to-contract-to-block-withdrawfees

Support

FAQs

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

Give us feedback!