Trick or Treat

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

Unsafe ERC20 Operations should not be used

Summary

ERC20 functions may not behave as expected. For example: return values are not always meaningful. It is recommended to use OpenZeppelin's SafeERC20 library.

Vulnerability Details


The security problem in this code is the lack of use of SafeERC20 for transferring Ether. While this particular function is transferring Ether directly to the owner, not using SafeERC20 is generally considered a security risk, especially when interacting with external contracts

payable(owner()).transfer(balance);

Impact

The transfer() function doesn't revert the transaction if the transfer fails. This could lead to silent failures where the function appears to succeed but actually doesn't.

Tools Used

Personal Knowledge

Recommendations

While this specific function doesn't interact with external contracts, it's still considered good practice to use SafeERC20 for all Ether transfers and token transfers, even within the contract itself. This ensures consistent safety across all operations.

Updates

Appeal created

bube Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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