Tadle

Tadle
DeFiFoundry
27,750 USDC
View results
Submission Details
Severity: low
Invalid

`_safe_transfer` Function Does Not Handle Ether Transfers as expected

Summary

Vulnerability Details

The `_safe_transfer` function is designed to safely transfer tokens to a specified address. However, it does not handle the case where the token parameter is 0, which is intended to indicate an Ether transfer. As a result, the function will fail if it is called with token set to 0, and Ether transfers will not be processed correctly.

/**
* @dev Safe transfer.
* @param token The token to transfer. If 0, it is ether.
* @param to The address of the account to transfer to.
* @param amount The amount to transfer.
*/
function _safe_transfer(//@audit-as mentioned in the comments the function should support eth transfer
address token,
address to,
uint256 amount
) internal {
(bool success, ) = token.call(
abi.encodeWithSelector(TRANSFER_SELECTOR, to, amount)
);
if (!success) {
revert TransferFailed();
}
}

Impact

The current implementation does not support Ether transfers, which can lead to failed transactions

Tools Used

Recommendations

Updates

Lead Judging Commences

0xnevi Lead Judge
over 1 year ago
0xnevi Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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

Give us feedback!