Trick or Treat

First Flight #27
Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: low
Valid

Owner Of SpookySwap would not be able to withdraw due to use of .transfer

Details

In function withdrawFees() , transfer is used to send money to the owners address. however transfer reverts on failure and forwards with exactly 2300 gas . issue is 2300gas fee may not be enough for the transaction causing a revert.
https://github.com/Cyfrin/2024-10-trick-or-treat/blob/9cb3955058cad9dd28a24eb5162a96d759bfa842/src/TrickOrTreat.sol#L146-L149 .

https://docs.soliditylang.org/en/latest/units-and-global-variables.html#members-of-address-types

Impact

Owner will not be able to withdraw the fees

Tools Used

manual research

Recommendations

call is a better way to handle withdrawals

Updates

Appeal created

bube Lead Judge 10 months ago
Submission Judgement Published
Validated
Assigned finding tags:

Use of `transfer` instead of `call`

Support

FAQs

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