Trick or Treat

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

Using `transfer` in `withdrawFees()`

Summary

The withdrawFees() function uses transfer to withdraw funds from the contract to the owner's address.

Vulnerability Details

In line 146 of the SpookySwap contract where the withdrawFees() function was defined, was transfer used as the method to send ether to the owner from the contract

Impact

The function is at risk of reentrancy attack as the transfer method is not the best way to send ether

Tools Used

Recommendations

The call method should be used instead of transfer.

(bool success, ) = payable(owner).call{value: balance}("");
require(success, "Withdrawal failed");
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.