Trick or Treat

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

The `SpookySwap::withdrawFees` function uses `transfer()` instead of `call()`.

Description

The function SpookySwap::withdrawFees in charge of sending the collected fees to the SpookySwap contract uses transfer() instead of call().

Impact

Depending on the selected contract owner, the use of transfer might render ETH impossible to withdraw due to the 2300 forwarded gas limitation.

Tools Used
Foundry, VsCode

Recommended mitigation

function withdrawFees() public onlyOwner {
uint256 balance = address(this).balance;
+ payable(owner()).call{value: balance}("");
emit FeeWithdrawn(owner(), balance);
}
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.