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

Missing Payable Function for ETH Reception In InheritanceManager.sol

Summary

The InheritanceManager contract contains functionality to transfer ETH from the contract, but it lacks a payable function to receive ETH. This makes the contract unable to accept ETH, rendering its ETH functionality sendETH(), withdrawInheritedFunds() unusable. While this does not lead to a direct loss of funds, it significantly impacts the intended use of the contract, particularly when dealing with inheritance and asset dispersal involving ETH.

Vulnerability Details

Affected code:

The contract implements functions like sendETH() for transferring ETH out of the contract and withdrawInheritedFunds(), but there is no payable fallback or receive function defined. As a result, the contract cannot receive ETH, meaning that:

  1. ETH cannot be sent to the contract by any external address, which limits the usability of functions involving ETH, like inheritance distribution.

  2. The lack of a receive function may also interfere with any intended cross-functionality where ETH may be required, such as asset deposits or inheritances.

Impact

The inability to receive ETH means that any operations requiring the contract to accept ETH will fail. This includes scenarios where beneficiaries need to withdraw inherited ETH or where the contract is expected to hold ETH. While no funds are directly lost due to this issue, the contract's ETH-related functionality is completely unusable, which could lead to a poor user experience or operational failure if ETH is expected to flow through the contract.

Tools Used

  • Manual review

Recommendations

Implement a receive() or fallback() payable functions to enable the contract to accept ETH transfers.

receive() external payable {
// Handle incoming ETH, e.g., log an event or process logic
}
Updates

Lead Judging Commences

0xtimefliez Lead Judge 4 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.