ERC20 functions may not behave as expected. For example: return values are not always meaningful. It is recommended to use OpenZeppelin's SafeERC20 library.
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
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.
Personal Knowledge
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.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.