Beginner FriendlySolidity
100 EXP
View results
Submission Details
Severity: high
Valid

DOS - Some contracts won't be able to receive eth

Summary

Some contracts won't be able to receive eth.

Vulnerability Details

https://github.com/CodeHawks-Contests/2025-03-inheritable-smart-contract-wallet/blob/main/src/InheritanceManager.sol#L104

/**
* @dev sends ETH out of the contract. Reentrancy safe, in case we interact with
* malicious contracts.
* @param _amount amount in ETH to send
* @param _to address to send ETH to
*/
function sendETH(uint256 _amount, address _to) external nonReentrant onlyOwner {
(bool success,) = _to.call{value: _amount}("");
require(success, "Transfer Failed");
_setDeadline();
}

Some contracts are not able to receive ETH, it should check if the _to address is a contract or an EOA.
If it's a contract, wrapp the ETH amount and send the Wrapped ETH instead.

Impact

Deny Of Service if _to is a contract that cannot receive ETH.

Tools Used

Manual review, Github.

Recommendations

Check if _to is a contract or an EOA.
If it's a contract, wrapp the ETH amount and send the WETH instead of ETH to ensure the transaction won't ever fail.

Updates

Lead Judging Commences

0xtimefliez Lead Judge 6 months ago
Submission Judgement Published
Validated
Assigned finding tags:

Missing receive() or fallback() function

Support

FAQs

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