The sendETH
function lacks a check for the contract's ETH balance before attempting a transfer. This omission can lead to failed transactions if the contract does not hold enough ETH, potentially disrupting expected operations.
The function is designed to send a specified amount of ETH (_amount
) to a recipient (_to
). However, unlike the sendERC20
function, which includes a balance check before transferring tokens, sendETH
directly attempts the transfer without verifying if the contract has sufficient ETH.
If _amount
exceeds the contract’s available ETH balance, the transaction will fail, reverting all operations in the function call.
Unexpected Transaction Reverts: Calls to sendETH
will fail if _amount
exceeds the contract's ETH balance, leading to disrupted contract functionality.
Denial of Service (DoS): The owner may be unable to distribute ETH as intended, causing operational bottlenecks.
Inconsistent Logic: The sendERC20
function includes a balance check, ensuring safe transfers, while sendETH
does not, leading to inconsistent safety mechanisms in the contract.
Manual Review
Add a Balance Check Before Transfer: Ensure the contract holds enough ETH before attempting a transfer.
Implement Fallback Handling: If required, implement an alternative strategy such as partial transfers or logging failed attempts.
Enhance Testing: Include unit tests that simulate scenarios where the contract has insufficient ETH balance to verify proper error handling.
By implementing these fixes, the contract will prevent unnecessary transaction failures and maintain consistency in its asset transfer logic.
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.